【问题标题】:Embed doesn't show up for slash command嵌入不显示斜杠命令
【发布时间】:2021-10-24 23:11:30
【问题描述】:

我有一个奇怪的问题。由于某些原因,嵌入不再出现,但它昨天工作了,我不完全确定我是否做错了什么。

交互回复示例代码:

   const testEmbed = new MessageEmbed()
        .setAuthor('Example')
        .setDescription('Some description for this embed')
        .setColor('YELLOW')
        .setTitle('Embed title');
    console.log(testEmbed);

    interaction.reply({
        content: 'Response with content!',
        embeds: [testEmbed],
        ephemeral: false
    }).catch(console.error);

最搞笑的是,如果我把回复的内容注释掉,交互回复完全是空白的。

https://i.imgur.com/XKOTWM5.png

【问题讨论】:

  • 我可以知道你的 discord.js 版本吗? (在你的 package.json 文件中)
  • @MalikLahlou discord.js@13.1.0 我想这是最新的。
  • 也许您使用的 Discord 客户端在设置中禁用了链接预览(嵌入)? Settings -> Text & Images -> Link Preview
  • @0x464e 天哪,非常感谢。我自己要花很长时间才能想出这个;D

标签: javascript discord.js


【解决方案1】:

正如0x464e 提到的,问题不在您的代码上。您只是没有在设置中启用链接预览。您可以在Settings -> Text & Images -> Link Preview ->

中启用它

【讨论】:

    猜你喜欢
    • 2015-10-14
    • 1970-01-01
    • 2021-11-24
    • 2021-07-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-07
    相关资源
    最近更新 更多