python - 当我的不和谐机器人引用 reddit 时,如何不显示这个无用的小部件
问题描述
当我的不和谐机器人引用 reddit 时,如何不显示这个无用的小部件:
是否可以使这个小部件不显示?
这是我的代码:
@client.command()
async def reddit(ctx, arg, arg2 = None):
if not arg2:
await ctx.send('https://www.reddit.com/search/?q=' + str(arg))
await ctx.send('`^ Searching for` ' + str(arg) + '`... ^`')
if arg2:
await ctx.send('https://www.reddit.com/' + str(arg2) + '/search?q=' + str(arg) + '&restrict_sr=1')
解决方案
把链接包进去< >
await ctx.send('<https://www.reddit.com/search/?q=' + str(arg) + ">")
这是 Discord 的一项功能,不仅限于编写机器人。
推荐阅读
- node.js - MongoDB NodeJS - 如何获取两个日期之间的值总和?
- python - 你如何修复元素不可交互异常:python selenium
- jquery - 如何在 .xsl 文件中将参数传递给 $(document).ready()
- sql - 如何查找所有存在的事件并标记特定用户是否参加过?(PostgreSQL, Laravel)
- google-sheets - 过滤不在谷歌表格列表中的数据的功能是什么?
- apache-spark - 使用 pyspark 3.0.0 和 Hive 1.1.0 的 Hive 查询因“无法获取表 test_table。无效的方法名称:'get_table_req'”而失败
- regex - 带或不带破折号的正则表达式匹配校验和
- r - 使用 Aitoff 投影在 x 轴的“边缘”上切割地图
- python - 在模态中重定向 django 表单的问题
- javascript - 如何在chartjs中显示条形图