繁体   English   中英

为什么它说错误的消息?

[英]Why does it say the wrong Message?

else if (message.content.startsWith(prefix + 'test2')) //you can change command name here - not recommended but you can :)
{
    message.reply('**Just a Test2**');
        fs.truncate('../ConsoleClient/Console/output.txt', 0, function(){});
            setTimeout(function () {
                var out = fs.readFileSync('../ConsoleClient/RaidAlerts/messages.txt', 'utf-8').toString();
                var out3 = "test2";
                if(out == "stone")
                {
                    out3 = "Walls are fine";
                }
                else if(out == "air")
                {
                    out3 = "**WEEWOO** We´re being raided **WEEWOO**";
                }
                else if(out == "other")
                {
                    out3 = "Someone changed the block. Check ASAP";
                }
                const outembed = new Discord.RichEmbed()
                .setColor(0xe580ff)
                .setTimestamp()
                .setTitle('Walls')
                .addField('Status', "```" + out3 + out + "```")
                .setURL("https://de.namemc.com/profile/Memag")
                message.channel.sendEmbed(outembed)
                fs.truncate('../ConsoleClient/Console/output.txt', 0, function(){});
            }, 1000);
}

为什么它说“墙是细石其他”或“墙是细石空气”或“墙是细石”而不是“墙很好”、“ WEWEWOO我们正在被突袭WEEWOO ”和“有人改变了街区。尽快检查”?

尝试

.addField('Status', "```" + out3 + "```")

并发布“/ConsoleClient/RaidAlerts/messages.txt”的内容

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM