guild.icon和guild.iconURL()无法在嵌入缩略图中使用

时间:2020-04-28 11:40:33

标签: discord discord.js

我想将公会图标设置为embed的缩略图,但是guild.iconguild.iconURL()都不起作用

bot.on('message', message => {
    if(message.author.bot) return;

    if(message.channel.name === 'verify') {
        if(message.content === '!verify') {
            message.delete()
            let dm = message.author;
            let server = message.guild.name;
            let servericon = message.guild.iconURL();
            console.log(servericon)

            let attachment = new Discord.MessageAttachment(this.choose , 'chosen.png')

            let embed = new Discord.MessageEmbed()
            .setTitle(`**Welcome to ${server}**\n\nCaptcha`)
            .setDescription("Please complete the captcha given below to gain access to the server.\n**Note:** This is case sensitive")
            .setAuthor('Mr.Verifier', "https://i.ibb.co/nckjDjG/hmm.png")
            .setThumbnail(servericon)
            .addField(
                { name: '**Why all this?**', value: 'This is to protect the servers from\nmalicious raids of automated bots'}
            )
            .setImage(`attachment://chosen.png`)


            dm.send(embed)

        }else{
        message.delete();
        }
    };
})

1 个答案:

答案 0 :(得分:1)

您需要使用guild.iconURL()