Not registering events
Hello! I am having an issue where events (in this case, guildBanAdd) doesn't always register. When I am testing in my own server, ban logging works 100% of the time. When in production, it doesn't work 100% of the time (but has been confirmed working intermittently). I can only assume that in production multiple events are being fired quickly and it gets missed, or is slow? I am not sure why it is not always registering in production.
Further to this, when someone is banned later on and the event is registered by the bot, it will post the log, but the audit log conflicts, almost like it has grabbed the event from the earlier ban and newer ban. I know it conflicts as I have a check for if the ban executor matches the executor in the audit log. If they don't it just sends a generalised log with an 'Audit log incomplete' message to not send wrong information. I hope this makes sense.
We rarely use a 'discord ban' and usually use our 'bot ban'. This only affects 'discord bans' as we log through our bot when banning with it. The only time this affects a 'bot ban' is when a 'discord ban' has been used before it and it seems like it registers both events. it's quite confusing so not sure best how to explain.
4 Replies
• What's your exact discord.js
npm list discord.js
and node node -v
version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.[email protected], v16.13.2
No errors
ModLogsExclude
includes the ID of our bot, so this should not run when the bot executed the ban.
This is what I mean by it not affecting 'bot bans'.
I don't think we have error handling for that anywhere. And what do you mean by 'call the passed GuildBan msg'. Sorry, this isn't solely my code! Are you meaning to use something like executor: async (ban) => {
instead of executor: async (msg) => {
??
Is it at all possible that discord isn't always spitting out events? I have been told before that they can sometimes be slow and unreliable, but unsure how much truth there is to this
Ok thanks, I will dive a bit further to see if I can find what is up