discordgo icon indicating copy to clipboard operation
discordgo copied to clipboard

Adding error unmarshalling event clarity

Open bkuhl opened this issue 5 years ago • 3 comments

Seems to be a type issue in handling the GUILD_CREATE event in my case, I've also seen several others. It's unclear to me what's actually happening under the covers.

2019/04/21 13:34:31 [DG0] wsapi.go:552:onEvent() error unmarshalling GUILD_CREATE event, json: cannot unmarshal string into Go struct field Game.timestamps of type float64

There seems to be a lot of these kinds of type-related issues being tossed around. Maybe it would be a good idea to add some more clear logging as to what the underlying issue is so it's more clear what's happening? I personally would like to have more insight into the event that my bot wasn't able to process.

bkuhl avatar Apr 21 '19 15:04 bkuhl

The master branch doesn't appear to be completely up to date with the current payloads received from Discord

VetSoftKeith avatar May 14 '19 01:05 VetSoftKeith

@bkuhl I agree actually and was thinking the same thing a couple days ago. What extra data would you like? Personally, I wouldn't mind seeing the user id, guild id, and maybe the value it's having a problem with. I'm not sure if all of that can be added cleanly but it's worth looking into.

bwmarrin avatar May 15 '19 14:05 bwmarrin

Those are the exact fields I'm thinking of.

bkuhl avatar May 15 '19 14:05 bkuhl