Discord bot sending 2 messages at once


Help, im making a discord bot and when i run the bot, it sends 2 messages at once. like, it was supposed to check if the person was an admin and say if it is an admin, but it repeats the message after it sends it. i also noticed that when i close the bot, the commands still work, but it was supposed to be offline. please help



To me even though i don’t code discord bots i will suggest you put the script in between a try except statement and then catch an error and also why not define wrapper that checks if a user is admin



This may be because 2 instances of the bot are running.

In the Glitch console, execute the following command: killall node

The command will end/kill all instances of the node process. Automatically, Glitch will start up a new Node.js process running your bot’s code. If the bot continues to send messages twice please let me know.

1 Like