Overloaded? DiscordAPIError[50027]: Invalid Webhook Token

This may have been Discord's API acting up but I'm pretty sure my bot was having issues with processing too many button interactions. Context: I have a live voting event where several dozen users were interacting with the same button. I got feedback saying there was a huge delay between the message confirming your vote and actually pressing the button. I think them spamming the buttons didn't help (I pressed a button to vote multiple times since sometimes discord sucks when it comes to buttons, and this would give me the same vote message over 5 times. For one message I voted on I kept getting the message 10 mins after the match had ended) Is there a work around to help fix this? Is this a known problem? Should I have all button interaction processes in some sort of queue system?
3 Replies
d.js toolkit
d.js toolkit7mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
irukanoko
irukanoko7mo ago
I'm assuming I'm not being rate limited. Should I implement something below? Will it help? Avoid Repetitive Interactions: To prevent repetitive interactions, you can maintain a record of interactions and ignore duplicates. You can store a unique identifier for each interaction, such as a user ID and a message ID, and check if you've already processed an interaction from the same user for the same message. If you've already processed it, you can ignore subsequent interactions. Asynchronous Processing: Depending on your bot's architecture, you might consider offloading the processing of button interactions to a background queue system. This can help distribute the workload and improve responsiveness. (Isn't it was already async)
Unknown User
Unknown User7mo ago
Message Not Public
Sign In & Join Server To View