Message discord.py中的可点击链接 [英] Clickable link inside message discord.py

查看:35
本文介绍了Message discord.py中的可点击链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我的机器人将消息发送到聊天中,如下所示:

await ctx.send("This country is not supported, you can ask me to add it here")

但是要使";here";变成可点击的链接,在HTML中我会这样做,对吗?

<a href="https://www.youtube.com/" > This country is not supported, you can ask me to add it here </a>

如何在python中完成?

推荐答案

正如另一个答案所解释的,您不能在普通邮件中添加超链接,但可以在嵌入中添加。我不明白您为什么不想对错误消息使用嵌入式,特别是考虑到它添加了更多功能,所以您应该考虑使用它。

embed = discord.Embed()
embed.description = "This country is not supported, you can ask me to add it [here](your_link_goes_here)."
await ctx.send(embed=embed)
您可以随意摆弄Embed&;添加一些字段、标题、颜色以及您想要做的任何其他操作以使其看起来更好。有关API docs的更多信息。

这篇关于Message discord.py中的可点击链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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