【问题标题】:Is it possible to send multiple RichEmbeds in a single message是否可以在一条消息中发送多个 RichEmbeds
【发布时间】:2020-01-04 21:26:09
【问题描述】:

在文档中,它指出Message 可以有一个array of Embeds

如果可以用一条消息发送多个RichEmbed,这显然会产生一个问题。

发送 Embed 的正常方式是使用 MessageOptions 对象,如下所示:

message.channel.send({embed: embedName});

虽然这似乎不允许多个 RichEmbeds,但有谁知道是否可以发送多个?

【问题讨论】:

  • 您只能使用 webhook 完成此操作

标签: discord discord.js


【解决方案1】:

正如Abz6is 指出的那样,您可以使用Webhook 一次发布多个RichEmbeds

HereWebhookMessageOptions 的文档。

快速示例:

message.channel.createWebhook('Webhook Name', message.author.displayAvatarURL)
.then(w => w.send({embeds: [
    new Discord.RichEmbed().setAuthor('Embed 1'),
    new Discord.RichEmbed().setAuthor('Embed 2'),
]}));

这适用于最多 10 个嵌入。

【讨论】:

    【解决方案2】:

    是的!这样做是可能的,通过这样做

    if(message.content.startswith(Anything)) {
    message.channel.send({embed: embedName});
    message.channel.send({embed: embedName});
    }
    

    Caltrop 的回答也有效。

    【讨论】:

    • 嗯,这并不是我们所要求的。您正在发送 2 条不同的消息,每条消息都有 1 个嵌入,我要求发送一条带有多个嵌入的单条消息。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-18
    • 2019-02-08
    • 2014-02-24
    • 2020-04-27
    相关资源
    最近更新 更多