DISCORD JS某些命令无效,没有给出错误

时间:2020-04-28 18:28:44

标签: node.js discord discord.js

因此,在尝试将其托管在heroku上之前,我的机器人运行良好。托管后,某些命令将无法使用,并且完全是随机的。我什至尝试复制并粘贴一个有效的命令,并替换单词以更改该命令的内容,但这是行不通的。在下面,我将发布一个工作命令和一个不工作命令的示例,由于我很困惑,因为我没有收到任何错误,希望对您有所帮助

client.on('message', message => {
    if (message.channel.type == "dm") return;
    if (message.author.bot) return;
    msg = message.content.toLowerCase();
    var hiresponse = helloResponse [Math.floor(Math.random()*helloResponse .length)];
    if (msg.includes("hey")||msg.includes("hi")) {
        message.channel.startTyping();
        setTimeout(()=>{
            message.channel.send(hiresponse).then((message)=>{
                message.channel.stopTyping();
            });
        }, 5000)
    }
//Working command

    if (message.channel.type == "dm") return;
    if (message.author.bot) return;
    msg = message.content.toLowerCase();
    var gmresponse = goodmorningResponse [Math.floor(Math.random()*goodmorningResponse .length)];
    if (msg.includes("goodmorning")||msg.includes("good morning")) {
        message.channel.startTyping();
        setTimeout(()=>{
            message.channel.send(gmresponse).then((message)=>{
                message.channel.stopTyping();
            });
        }, 7000)
    }
//Non working command 

0 个答案:

没有答案