【问题标题】:Trying to make a discord bot direct message new members. What am I doing wrong?试图让不和谐的机器人直接向新成员发送消息。我究竟做错了什么?
【发布时间】:2021-05-21 00:23:30
【问题描述】:

试图让不和谐的机器人直接向新成员发送消息。我做错了什么?

const Discord = require('discord.js');
const bot = new Discord.Client();


bot.on('guildMemberAdd', member => {
    member.send("Welcome to the server!");
});
    
bot.login('TOKEN_HERE');

【问题讨论】:

标签: discord bots


【解决方案1】:

一切都是正确的。您唯一需要做的就是启用一些设置以使其正常工作。首先,转到开发人员门户。其次,转到您的应用程序并转到“Bot”。第三,单击“Privileged Gateway Intents”中的 2 个按钮,一切顺利!另外,如果你想在 Discord 上添加我,这是我的用户名:Jellybee#4284。

【讨论】:

    猜你喜欢
    • 2021-09-24
    • 2013-08-06
    • 1970-01-01
    • 2021-11-30
    • 1970-01-01
    • 2018-01-13
    • 2019-12-10
    • 2016-07-18
    • 1970-01-01
    相关资源
    最近更新 更多