python - 添加嵌入字段和缩略图后命令不起作用
问题描述
我目前正在使我的帮助命令更加花哨。我为嵌入和缩略图添加了字段。每当我运行机器人并尝试命令时,它都不会发送任何内容。我看了一遍又一遍,找不到错误在哪里。没有错误。任何线索问题出在哪里?谢谢!
@bot.command(aliases=['bothelp'])
async def help(ctx):
embed=discord.Embed(title="Ultimate Bot Help", description="Hello! Here, you can get help from lots of useful links and info!", color=0x00FFFF)
embed.add_field(name="Website", value="link here", incline=False)
embed.add_field(name="Bot Suggestions", value="link here", incline=False)
embed.add_field(name="Bot Invite", value="link here", incline=False)
embed.add_field(name="Bot Prefix", value="My prefix is `>`")
embed.set_thumbnail(url="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTnRvkNUAgzhNyYU_zWiyh0TNxzAQ0kWGZbHCrd5o8op9p9PUzSe_H4kiO-DxmnJ_lF9_sVi3ZEjHyUQC0n:https://cmkt-image-prd.freetls.fastly.net/0.1.0/ps/3277870/910/607/m1/fpnw/wm0/ghostplayer-logo-template-02-.png%3F1505882390%26s%3D930fa4a9fcbc678396da1bc42bcf862e&usqp=CAU")
await ctx.send(embed=embed)
解决方案
首先,帮助命令已经安装在 discord.py 模块中。这意味着该命令将不起作用,因此您需要禁用它:
bot = commands.bot(command_prefix=“prefix”, help_command=None)
incline
第二件事是,当正确的术语是 时,对于所有嵌入,您都使用术语inline
。
推荐阅读
- r - 在标记化期间丢失了一份文件
- python - Python:删除未出现在单独的一维列表中的二维数组中的值
- c# - Silverlight 到 WPF:Windows 身份验证
- python-3.x - asyncio 抛出运行时错误并忽略异常
- json - 使用 SwiftUI 从 json 数据加载更多功能
- python - 包括一个开始和结束节点到一个graphviz有向图
- haskell - 将 `Sem (x ': r) a` 解释为 `Sem (y ': r) b`?
- android - Flutter 电子邮件发件人回栈问题
- java - 带有自定义绑定的 JOOQ 批量插入
- gstreamer - 如何从收音机流式传输并使用 gstreamer 将其转换为 opus 并将其发送到 Janus?