Guild Ban triggers wrong event

When I tested out my bot on a test server a few minutes ago, I realised that when banning a user, it's the guildMemberRemove event that fire, and not the guildBanAdd event. I've a console.log on both events and only one was triggered.
11 Replies
megatank58
megatank583y ago
Do you have the GuildBans intent
Eccléria
EcclériaOP3y ago
No But was it normal to fire the other event ?
megatank58
megatank583y ago
yes
Eccléria
EcclériaOP3y ago
So what's the difference between the 2 events ?
megatank58
megatank583y ago
guildMemberRemove triggers when a person is no longer part of the guild guildBanAdd triggers when a new entry is added to audit log for a member being banned
Eccléria
EcclériaOP3y ago
So both might be triggered when there's a ban ?
megatank58
megatank583y ago
for kick guildMemberRemove would trigger, guildBanAdd would not both WILL be triggered when there's a ban since the member is no longer part of the guild AND the entry to audit log was added as the member was banned
Eccléria
EcclériaOP3y ago
I don't get why having 2 different events for that is usefull.
megatank58
megatank583y ago
it's completely different and this is a Discord issue djs just emits it because it gets the event directly from discord guildMemberRemove is for more than bans
Eccléria
EcclériaOP3y ago
Oh it comes from discord ? ok then Thanks for the answers 🙂
megatank58
megatank583y ago
the only internal event is userUpdate iirc the rest is all from Discord directly

Did you find this page helpful?