为什么这会向欢迎消息发送垃圾邮件?

时间:2020-07-03 22:35:55

标签: javascript discord discord.js

bot.on('guildMemberAdd', member => {
    const welcomeembed = new Discord.RichEmbed()
        .setColor(0xfcdb03)
        .setThumbnail(member.user.avatarURL)
        .setTitle('Welcome to our Discord! \uD83D\uDC4B')
        .setDescription(member)
        .addField('\u200B', "Please verify yourself in " + member.guild.channels.get('723965000062074990'))
    member.guild.channels.get('723240170329079870').sendEmbed(welcomeembed); 
    });

我想我记得它昨天工作了,但是今天,当有人加入时,它开始无数次向欢迎消息发送垃圾邮件。

1 个答案:

答案 0 :(得分:0)

你有

bot.on('guildMemberAdd', member => {
    const welcomeembed = new Discord.RichEmbed()
        .setColor(0xfcdb03)
        .setThumbnail(member.user.avatarURL)
        .setTitle('Welcome to our Discord! \uD83D\uDC4B')
        .setDescription(member)
        .addField('\u200B', "Please verify yourself in " + member.guild.channels.get('723965000062074990'))
    member.guild.channels.get('723240170329079870').sendEmbed(welcomeembed); 
    });

您需要将其放入

bot.on('guildMemberAdd', member => {
    const welcomeembed = new Discord.RichEmbed()
        .setColor(0xfcdb03)
        .setThumbnail(member.user.avatarURL)
        .setTitle('Welcome to our Discord! \uD83D\uDC4B')
        .setDescription(member)
        .addField('\u200B', "Please verify yourself in " + member.guild.channels.get('723965000062074990')) 
    });
    member.guild.channels.get('723240170329079870').sendEmbed(welcomeembed);

在const语句的外部带有member.guild.channels.get('723240170329079870').sendEmbed(welcomeembed);。 至少我认为这是正确的,我是新手,但希望对您有所帮助。