【问题标题】:DiscordAPIError: Cannot send an empty message with and embedDiscordAPIError:无法发送带有和嵌入的空消息
【发布时间】:2021-12-15 09:33:39
【问题描述】:

我不知道是什么问题,总是出现无法发送空消息

module.exports = {
    name: 'actualhelp',
    description: "here is some ACTUAL help",
    execute(message, args, Discord){
        const newEmbed = new Discord.MessageEmbed()
        .setColor('#304281')
        .setTitle('Help')
        .setURL('URL')
        .setDescription('Here is some basic help')
        .addFields(
            {name: '4/102', value: 'Base Set Charizard'},
            {name: 'cool', value: 'You will become cool with the Looking Epic role'},
            {name: 'ugly', value: 'Thats not nice, you are now not cool and have your Looking Epic role removed if you already had it'},
            {name: 'help', value: 'get fooled kiddo, I aint helping you'},
            {name: 'kick', value: 'checks to see if you can kick people'},
            {name: 'ping', value: 'play some ping pong with me'}
        )
        .setImage('Image url');

        message.channel.send({newEmbed});
    }


}

【问题讨论】:

    标签: javascript discord discord.js


    【解决方案1】:

    您当前发送嵌入的方式与此相同:

    message.channel.send({newEmbed: newEmbed})
    

    但是,这不是要设置的有效属性。相反,你可以这样做embed: newEmbed

    message.channel.send({
      embed: newEmbed
    })
    

    或在 v13 上,embeds: [newEmbed]

    message.channel.send({
      embeds: [newEmbed]
    })
    

    【讨论】:

      猜你喜欢
      • 2021-09-15
      • 2021-12-01
      • 2021-12-28
      • 2020-04-07
      • 2022-01-01
      • 2021-11-02
      • 1970-01-01
      • 2022-01-23
      相关资源
      最近更新 更多