Skip to content
Advertisement

My bot is collecting it’s own message (infinite loop) and spamming an specific line

the bot spams the (`You Found ${earnings} Coins!`); and I think it’s collecting it’s own messages (infinite loop) I asked the problem from some of my friends and they said the same: “the bot is collecting it’s own messages, remove the collector”. but I don’t know how can I replace the collector.

JavaScript

Advertisement

Answer

In discord.js v13 all Collector related classes and methods (e.g. .createMessageCollector() or .awaitMessages()) take a single object parameter which also includes the filter. So, your collector should look like this:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement