Discord.js bot 不发送嵌入的消息

时间:2021-02-04 05:56:58

标签: javascript node.js discord discord.js

我使用 discord.js 制作了一个 discord bot 我有一些命令和其他 3 个带有嵌入形式的命令。一个命令是 help 工作正常,另外两个不起作用,所有代码都具有相同的主代码,我用来发送消息的代码是 message.channel.send(atc) 这是一个工作正常的代码。< /p>

if (command === "help") {
    const help = new Discord.MessageEmbed()
        .setColor(0xeb2315)
        .setTitle("Coming to help")
        .setDescription("The help command")
        .setAuthor(message.author.username)
        .addField("The prefix of this bot is ;", "You probably know this", true)
        .setDescription("")
        .addField("To add your custom channel contact me at Your daily dose of computers#6644", "Do it now", true)
        .setDescription("")
        .addField("Fealing lonely type ;hello", true)
        .setDescription("")
        .addField("To see the atc that are in this server type ;ATC", "not for this server", true)
        .setDescription("")
        .setThumbnail(message.author.avatarURL)
        .addField("Ban", "Ban someone from the server", true)
        .addField("Kick", "Kick someone from the server", true)
        .addField("Ping", "Want to see your ping in this sever for some reason type ;Ping", true)
        .setImage("https://cdn.discordapp.com/app-icons/805831227977236559/5743e8b25ebec0763346d08f4bf2a060.png?size=512&quot")
        .setFooter("Coded designed and invited by Your daily dose of computers#6644");

    message.channel.send(help);
}

还有一个没有:

if (command === "ATC") {
    const atc = new Discord.MessageEmbed()
        .setColor(0xf21313)
        .setTitle("The atc in this server")
        .setDescription("The atc in this server command")
        .setThumbnail(message.author.avatarURL)
        .setAuthor(message.author.username)
        .addField("The atc are @121.8 KSFO GROUND @CapitinVector")
        .setThumbnail("https://www.zazzle.com/rlv/svc/view?rlvnet=1&realview=113297416891423264&design=1768ff2c-4d36-43e0-8ebc-93e958b519e0&size=1.5&style=square_sticker&max_dim=220&ah=0&cacheDefeat=1612246725290")
        .setImage(message.author.avatarURL)
        .setFooter("made by Your daily dose of computers#6644");

    message.channel.send(atc);
}

2 个答案:

答案 0 :(得分:1)

这应该是因为您设置了两次缩略图,尝试删除其中一个缩略图,看看是否有效。

如果我错了,请纠正我。

编辑:如果您有任何错误,请提供。

答案 1 :(得分:0)

尝试设置不带大写字母的“atc”,并如 m_hm0ud 所述删除缩略图之一,我认为您需要将 @media screen and (max-width: 700px) { .img-responsive { width: auto; height: auto; } 修复为 message.author.avatarURL