Skip to content
Advertisement

Message collector in Discord.JS not running

I have a basic command for testing the message collector feature on my discord.js v13 bot.

The bot doesn’t crash when I run it, but the feature doesn’t load properly, as it has an error.

JavaScript

The error is in the line inside the collector function when I call filter. The IDE gives me an error:

Type ‘(m: Message) => void’ is not assignable to type ‘CollectorFilter<[Message]>’. Type ‘void’ is not assignable to type ‘boolean | Promise’.

I understand what the error is trying to say, but how can I fix it?

Advertisement

Answer

Your filter needs to return a boolean. At the moment you don’t return anything, you just compare the two variables. Any of these will work:

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