【问题标题】:How to get the message link of an embed in discord.js?如何在 discord.js 中获取嵌入的消息链接?
【发布时间】:2021-04-06 14:54:30
【问题描述】:

我想发送一个不和谐的嵌入,然后将嵌入的消息链接存储在数据库中。但为了做到这一点,我需要一种访问嵌入链接的方法。有没有办法在 discord.js 中获取 MessageEmbed 对象的消息链接?我浏览了 discord.js 文档,但找不到任何东西。

【问题讨论】:

    标签: discord discord.js


    【解决方案1】:

    您可以使用message.url 获取消息的 URL

    如果您的机器人发送消息,它可以像这样使用

    channel.send(embed).then(embedMessage => {
        const url = embedMessage.url
        // add to url database
    });
    

    【讨论】:

      猜你喜欢
      • 2021-01-09
      • 2021-12-13
      • 2021-07-16
      • 1970-01-01
      • 2021-11-07
      • 2022-08-04
      • 1970-01-01
      • 2019-03-19
      • 2020-11-28
      相关资源
      最近更新 更多