Closed tulser closed 6 years ago
Despite dellim
containing only numbers, it is extracted from a string and is therefore also a string. options.limit
only accepts numbers, so you must convert it to a number before using it.
You can convert dellim
to a number in several ways: +dellim
, Number(dellim)
, parseInt(dellim)
and parseFloat(dellim)
will all work. Pick your favourite, and either assign the result to a variable or use it directly in .getMessages
.
By the way, fix your indentation. Please. I cannot understand how people code like this. And tabs too? Oof.
Don't forget to join the discord.io server so you can get help there in future rather than posting GitHub issues. https://discord.gg/0MvHMfHcTKVVmIGP
Ah, okay, I initially I thought it had set it up to be a number but I guess not. Thanks!
Hi, I'm rather novice at Javascript, but I'm having an issue where I'm trying to get the bot to get and then delete certain number of messages before the trigger message. So far the code below gets messages, but when I debug, getMessages does not appear to return an array with the correct number of terms but rather returns all the messages before the trigger message, which leads me to believe the 'limit' input may not work.