Clickable link inside message discord.py(Message discord.py中的可点击链接)
本文介绍了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中的可点击链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
沃梦达教程
本文标题为:Message discord.py中的可点击链接


猜你喜欢
- pytorch 中的自适应池是如何工作的? 2022-07-12
- 如何在 Python 的元组列表中对每个元组中的第一个值求和? 2022-01-01
- padding='same' 转换为 PyTorch padding=# 2022-01-01
- 沿轴计算直方图 2022-01-01
- python check_output 失败,退出状态为 1,但 Popen 适用于相同的命令 2022-01-01
- 如何在 python3 中将 OrderedDict 转换为常规字典 2022-01-01
- python-m http.server 443--使用SSL? 2022-01-01
- 分析异常:路径不存在:dbfs:/databricks/python/lib/python3.7/site-packages/sampleFolder/data; 2022-01-01
- 使用Heroku上托管的Selenium登录Instagram时,找不到元素';用户名'; 2022-01-01
- 如何将一个类的函数分成多个文件? 2022-01-01