将嵌入标题设置为可点击的链接 [英] Set embed title to a clickable link

查看:82
本文介绍了将嵌入标题设置为可点击的链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 RichEmbed ,我想制作一个它可以使我拥有一个字段标题,当我单击它时,它将带我到一个链接。

I have a RichEmbed and I want to make it so I can have a field title that when I click on it, it will lead me to a link.

推荐答案

如果想要将嵌入标题作为链接,可以添加 .url 属性,方法是使用 RichEmbed.setURL() ,手动将其设置或将其添加到传递的对象中

If you want the title of the embed to be a link, you can add a .url property to it, either by using RichEmbed.setURL(), manually setting it or adding it to the object you pass in the constructor.

如果您希望字段的标题成为无法完成的链接,那么不幸的是,它不支持markdown:\ < br>
如果需要,可以使用markdown在字段的值文本中添加链接:

If you want the title of a field to be a link that can't be done since that, unfortunately, doesn't support markdown :\
If you want you can add the link in the value text of the field, using markdown:

embed.addField("Field title", "Your text here: [link](http://example.com)")

这篇关于将嵌入标题设置为可点击的链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆