我正在尝试建立类似[this](https://stackoverflow.com/)
的链接,但似乎无法找到任何答案。
我已经尝试了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 EngineBot", "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](https://discordapp.com/oauth2/authorize?client_id=439778986050977792&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](https://discordapp.com/oauth2/authorize?client_id=439778986050977792&scope=bot&permissions=8)
但是我得到了输出:
Add DiscordBot to your server! \[Click here\]\(https://discordapp.com/oauth2/authorize?client_id=439778986050977792&scope=bot&permissions=8\)
答案 0 :(得分:2)
字段名称不能包含链接,但字段值可以包含。
所以像这样的事情会起作用:
.addField("Its mine now", "Add DiscordBot to your server! [Click here](https://discordapp.com/oauth2/authorize?client_id=439778986050977792&scope=bot&permissions=8)")