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中的可点击链接
基础教程推荐
猜你喜欢
- Discord.py 缺少必需的参数 2022-01-01
- 将 x 轴刻度更改为自定义字符串 2022-01-01
- pyserial - 可以从线程 a 写入串行端口,是否阻塞从线程 b 读取? 2022-01-01
- 尝试制作WhatsApp机器人 2022-01-01
- 使用生成器和迭代器时 Python 多循环失败 2022-01-01
- 与常规 dict 相比,Python manager.dict() 非常慢 2022-01-01
- 在 Celery 工作人员中捕获 Heroku SIGTERM 以优雅地关 2022-01-01
- 由Python将MP3转换为MIDI(类型错误:无法加载插件:mtg-Melodia:Melodia) 2022-01-01
- numpy float:比算术运算中内置的慢 10 倍? 2022-01-01
- 用 Python 编写 Fortran 无格式文件 2022-01-01
