【发布时间】:2020-12-05 13:10:15
【问题描述】:
“/tts”也不起作用,即使有 tss 权限,bot 也只能写入。
const prefix = "!";
bot.on('message', message => {
if (message.author.bot || !message.content.startsWith(prefix)) return;
const args = message.content.slice(prefix.length).split(new RegExp(' ', 'g'));
const command = args.shift().toLowerCase();
const user = message.author;
if (command == "stretch" || "sr"){
message.channel.send(user.username + ' your stretch reminder was
activated!', tts=true);
}
});
【问题讨论】:
-
尝试删除不必要的 { } 从返回开始;
-
我做到了,但遗憾的是问题仍然存在。我还删除了部分代码(你可以看到我编辑了帖子),问题仍然存在所以它与我取出的部分无关。看起来是对的,idk什么出了问题。
-
现在至少它只是回答正确的前缀,但仍然在没有任何命令的情况下回答它。
标签: node.js discord bots discord.js