Ask coding questions

← Back to all posts
Bot Spam and Message not deleting
DomLowe (4)

I am trying to make the bot delete the message '~countdown' (line 66) after it has sent and ran the command. For some reason, it doesn't delete, and it spams the chat. This is what the console said:

Dom said: ~begin
ONUW Bot said: The game will begin in...
ONUW Bot said: 3
(node:302) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added. Use emitter.setMaxListeners() to increase limit
ONUW Bot said: 2
ONUW Bot said: 1
ONUW Bot said: Night has fallen!
ONUW Bot said: ~countdown
(node:302) UnhandledPromiseRejectionWarning: ReferenceError: messsage is not defined
    at message.channel.send.then.message (/home/runner/index.js:67:66)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:302) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:302) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
ONUW Bot said: Your time has begun! Hop over to ONUW Discussion Voice Channel and tell everyone your role, or try and trick people. Remember, some people may lie so you don't know who they really are!
ONUW Bot said: Your time has begun! Hop over to ONUW Discussion Voice Channel and tell everyone your role, or try and trick people. Remember, some people may lie so you don't know who they really are!
ONUW Bot said: Your time has begun! Hop over to ONUW Discussion Voice Channel and tell everyone your role, or try and trick people. Remember, some people may lie so you don't know who they really are!
ONUW Bot said: Your time has begun! Hop over to ONUW Discussion Voice Channel and tell everyone your role, or try and trick people. Remember, some people may lie so you don't know who they really are!
ONUW Bot said: Your time has begun! Hop over to ONUW Discussion Voice Channel and tell everyone your role, or try and trick people. Remember, some people may lie so you don't know who they really are!
ONUW Bot said: Your time has begun! Hop over to ONUW Discussion Voice Channel and tell everyone your role, or try and trick people. Remember, some people may lie so you don't know who they really are!
ONUW Bot said: Your time has begun! Hop over to ONUW Discussion Voice Channel and tell everyone your role, or try and trick people. Remember, some people may lie so you don't know who they really are!
ONUW Bot said: Your time has begun! Hop over to ONUW Discussion Voice Channel and tell everyone your role, or try and trick people. Remember, some people may lie so you don't know who they really are!
ONUW Bot said: Times up! Vote for who you want to kill!
ONUW Bot said: Times up! Vote for who you want to kill!
ONUW Bot said: Times up! Vote for who you want to kill!
ONUW Bot said: Times up! Vote for who you want to kill!
ONUW Bot said: Times up! Vote for who you want to kill!
ONUW Bot said: Times up! Vote for who you want to kill!
ONUW Bot said: Times up! Vote for who you want to kill!
ONUW Bot said: Times up! Vote for who you want to kill!

Any help would be appreciated!
Thanks once again.