Javascript 类型错误:message.createReactionCollector不是函数Discord.js

Javascript 类型错误:message.createReactionCollector不是函数Discord.js,javascript,node.js,discord,discord.js,Javascript,Node.js,Discord,Discord.js,我正在为我的机器人制作一个赌博系统。我使用discord.js并尝试制作一个反应收集器来选择他们想要玩的游戏。Idk为什么创建一个反应收集器不是一个函数,所以它可能只是我 代码如下: run(message) { const embed = new RichEmbed() .setColor(1) .setTitle(`Welcome to the gambling center! Please select a game to play!`) .addBlankFi

我正在为我的机器人制作一个赌博系统。我使用discord.js并尝试制作一个反应收集器来选择他们想要玩的游戏。Idk为什么创建一个反应收集器不是一个函数,所以它可能只是我

代码如下:

run(message) {

    const embed = new RichEmbed()
   .setColor(1)
   .setTitle(`Welcome to the gambling center! Please select a game to play!`)
   .addBlankField(true)
   .addField(`:one:`, `Gamble away to win double or nothin!`)
   .addBlankField(true)
   .addField(`:two:`, `Gamble like the lottery to have a chance to win big!`)
   .addBlankField(true)
   let m = message.channel.send({embed}).then((m)=>{
        m.react('\u0031\u20E3')
        m.react('\u0032\u20E3')
    }).then(()=>{
        const collector = message.createReactionCollector((reaction, user) => 
            user.id === message.author.id &&
            reaction.emoji.name === "\u0031\u20E3" ||
            reaction.emoji.name === "\u0032\u20E3" 
        ).once("collect", reaction => {
             const chosen = reaction.emoji.name;
                 if(chosen === "\u0031\u20E3"){
                    message.channel.send(`Double or Nothin!`)
                }else{(chosen === "\u0032\u20E3")
                message.channel.send(`Lottery!`)}
collector.stop()});
    })  
}
下面是弹出的完整错误:

(node:5948) UnhandledPromiseRejectionWarning: TypeError: message.createReactionCollector is not a function
at message.channel.send.then.then (C:\Users\patri\Documents\Super Dev\commands\Economy\Gamble.js:36:39)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:160:7)
(node:5948) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:5948) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(节点:5948)未处理的PromisejectionWarning:TypeError:message.createReactionCollector不是函数
在message.channel.send.then.then(C:\Users\patri\Documents\Super Dev\commands\Economy\Gamble.js:36:39)
在
在进程中。_tick回调(内部/process/next_tick.js:160:7)
(节点:5948)未处理的PromisejectionWarning:未处理的承诺拒绝。此错误源于在没有catch块的异步函数中抛出,或者拒绝未使用.catch()处理的承诺。(拒绝id:1)
(节点:5948)[DEP0018]弃用警告:未处理的承诺拒绝已弃用。将来,未处理的承诺拒绝将使用非零退出代码终止Node.js进程。

任何帮助都将不胜感激!(如果有点凌乱,很抱歉。)

您似乎正在发送一条消息,但使用了不同的消息对象。尝试将变量m设置为反应收集器

Hi,您能发布完整错误以帮助我们帮助您吗?谢谢是的,我插入了完整的错误,没有太多需要处理的…是的,问题是m变量不能通过下一个。然后,它在没有。然后的情况下工作。但是不能使它正常工作。我需要一个解决方案让m变量通过第二个。然后(如果这有意义的话…)在第一个中返回m。然后-你应该能够在第二个中获得变量。然后