bwmarrin / discordgo

(Golang) Go bindings for Discord
BSD 3-Clause "New" or "Revised" License
5.05k stars 802 forks source link

Panics when handling presences #1506

Open sentinelb51 opened 7 months ago

sentinelb51 commented 7 months ago

It seems that anything to do with Presences causes a segmentation fault within the library itself. For example, in state.go, presenceAdd has been throwing panics for me: image

I seemed to have fixed it by adding a simple check to see if User is not nil: image

Then, another issue came up in state.go: image

Hopefully this will fix the issue for now, but I was wondering if anyone else is having this issue. This is on the latest commit of discordgo as of this date.

image
yorukot commented 5 months ago

You can try t.Member instead of t.User t.User is in private message t.Member is in the guild

I'm new to Discordgo but I also have this problem, but this works for me.

yorukot commented 5 months ago

@sentinelb51 Forgot to mention :(