最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

是否可以在RichEmbed中嵌入超链接?

运维笔记admin10浏览0评论

是否可以在RichEmbed中嵌入超链接?

是否可以在RichEmbed中嵌入超链接?

我正在尝试建立类似于[this](/)的链接,但如果可能,我似乎找不到任何答案。

我已经尝试了markdown语法(如上所示),但似乎找不到其他答案。

这是我当前正在使用的代码:

message.author.send({
  embed: new Discord.RichEmbed()
    .setTitle("DiscordBot Help")
    .setColor("#42b6f4")
    .addField("help cosmetic - Cosmetic help.", "All cosmetic commands")
    .addField("help economy - Economy help.", "All economy commands")
    .addField("facts - Gives you facts", "Subcommands required")
    .addField("credits - Shows the developers", "All hail the Creators!")
    .addField("info - Fun info about DiscordBot", "10 fun facts.. or what?")
    .addField("patch - Shows current patch/updates.", "UPDATES ARE AWESOME!")
    // This is the line I'm having trouble with.
    .addField("Add DiscordBot to your server! [Click here](;scope=bot&permissions=8)", "Its mine now.")
    // Here the line ends.
    .addField("Enter prefix before the commands", "It wont work else ;)")
    .addField("MIT License | Copyright © 2018, Technotype", "All rights reserved.")
    .addField("More content coming soon!", "It'll just take time")
});

我希望代码的输出像这样:

Add DiscordBot to your server! [Click here](;scope=bot&permissions=8)

但是我得到了输出:

Add DiscordBot to your server! \[Click here\]\(;scope=bot&permissions=8\)
回答如下:

字段名称不能包含链接,但是字段值可以。所以这样的事情会起作用:

.addField("Its mine now", "Add DiscordBot to your server! [Click here](https://discordapp/oauth2/authorize?client_id=439778986050977792&scope=bot&permissions=8)")
发布评论

评论列表(0)

  1. 暂无评论