【发布时间】:2021-08-05 14:25:59
【问题描述】:
我刚开始编写我的 Discord 机器人,我做了一个命令来回复不是由机器人发送的每条消息。当我在 DM 中尝试它时,它工作正常,但是当我在我的服务器中尝试它时,它会在命令之前提到用户。在 DM 中它只会说“测试”,但在服务器中会说类似“@ExampleUser, test”。
有什么办法可以解决这个问题吗?这是我的代码:
const Discord = require('discord.js');
const client = new Discord.Client();
client.on("message", (message) => {
if (message.author.bot) return;
return message.reply("test")
});
【问题讨论】:
标签: javascript node.js discord discord.js bots