Discrod Bot反应错误有人知道为什么?

时间:2020-06-19 11:14:09

标签: discord.js

(node:20344) UnhandledPromiseRejectionWarning: TypeError: Function.prototype.apply was called on null, which is a object and not a function    at ReactionCollector.handleCollect (C:\Users\USER10\Desktop\Bots\React Tutorial\node_modules\discord.js\src\structures\interfaces\Collector.js:92:46)

那是我的代码:

                let m = await message.channel.messages.fetch(args[1]);
                m.react(args[2])
                const collector = m.createReactionCollector(null, {});
                collector.on('collect', (reaction, user) => {

谢谢!

1 个答案:

答案 0 :(得分:1)

createReactionCollector的第一个参数是过滤器函数。如果您想在没有过滤器的情况下收集所有邮件,请不要将其提供给null,而应将始终返回true的函数提供给_ => true