【问题标题】:Discord.js - How to copy a portion of an other bot's embedDiscord.js - 如何复制其他机器人嵌入的一部分
【发布时间】:2021-07-11 01:09:09
【问题描述】:

我想复制显示在另一个机器人嵌入中的一些文本信息,然后从我的机器人发布该信息。我完全坚持如何做到这一点。我会怎么做?

【问题讨论】:

  • 您是否尝试过研究并查看 DJS 指南和/或文档?

标签: discord.js embed


【解决方案1】:

像这样:

client.on('message', message => {
    message.embeds.forEach(embed => {
        //You can resend the embed whole or some parts of it
        //If you want to resend the whole embed
        message.channel.send(embed);
        //Or, some parts of it
        let description = embed.description;
        let title = embed.title;
        if(title && description){
            let emb = new Discord.MessageEmbed()
                .setTitle(title)
                .setDescription(description)
            message.channel.send(emb);
        }
    });
});

也可以看看Read contents of an embed message from a discord server

【讨论】:

    猜你喜欢
    • 2020-09-22
    • 2020-10-11
    • 1970-01-01
    • 2020-08-03
    • 2020-09-08
    • 2020-09-15
    • 2020-12-06
    • 2020-07-18
    • 2018-09-25
    相关资源
    最近更新 更多