(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) => {
谢谢!
答案 0 :(得分:1)
createReactionCollector
的第一个参数是过滤器函数。如果您想在没有过滤器的情况下收集所有邮件,请不要将其提供给null
,而应将始终返回true
的函数提供给_ => true
。