【发布时间】:2018-10-04 04:22:08
【问题描述】:
我正在使用 discord.js / node.js 构建一个不和谐的机器人
我想欢迎用户并告诉他们他们需要做什么。 但我遇到了这个问题,它重复和重复更多。
我的代码:
//WELCOME MESSAGE//
client.on("guildMemberAdd", async (member) => {
console.log(`"${member.user.username}" has joined "${member.guild.name}" at ${new Date()}`);
member.guild.channels.find(x => x.name === "welcome").send(`welcome ${member.user} Please watch your DM for a message from Auttaja and complete the Captcha verification to enter the main channels.`);
});
一开始它像欢迎一样把它放了 1 次....但是当 1 个用户加入时它是 2 次,然后是 3 次甚至 4 次。
这是输出:
有人有什么想法或建议吗?
【问题讨论】:
标签: node.js discord.js