node.js - Discord bot 不会回复带有“KlH04s69”这样的内容的命令
问题描述
这对我来说不是什么大问题,我只是好奇为什么机器人会毫无问题地回复这个命令
else if (command === "give me cookies") {
const attachment = new Discord.MessageAttachment('./laisaembarasment.png');
message.reply(`NOPE`);
message.channel.send(attachment);
}
然而机器人不回复这个
else if (command === "KlH04s69") {
const attachment = new Discord.MessageAttachment('./hornyticket.png');
message.reply(`just used his ticket! Oh no, it's a horny one...`);
message.channel.send(attachment);
}
解决方案
我无法回复它,因为命令输入中的所有内容都必须是小写的,因此
const command = args.shift().toLowerCase();
推荐阅读
- css - rem 中的背景大小会导致 ie11 和 edge 出现问题
- node.js - 如何在客户端运行 server.js?
- java - 未定义字符串 .length() 函数
- java - Java数组似乎改变了值而不被直接修改
- c++ - 安装 2 个或更多次要版本的 Visual Studio
- .htaccess - 重定向除首页外的所有页面
- json - 如何使用 T-SQL 从具有相似标签的 json 中获取特定值
- python - 有没有办法在不提交的情况下避免 FK 完整性错误?
- processing - 如何在 Leap Motion 中获取先前的手指位置
- leaflet - baseLayers 的地图控制的传单问题