首页 > 解决方案 > 添加嵌入字段和缩略图后命令不起作用

问题描述

我目前正在使我的帮助命令更加花哨。我为嵌入和缩略图添加了字段。每当我运行机器人并尝试命令时,它都不会发送任何内容。我看了一遍又一遍,找不到错误在哪里。没有错误。任何线索问题出在哪里?谢谢!

@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)

标签: pythondiscorddiscord.py

解决方案


首先,帮助命令已经安装在 discord.py 模块中。这意味着该命令将不起作用,因此您需要禁用它:

bot = commands.bot(command_prefix=“prefix”, help_command=None)

incline第二件事是,当正确的术语是 时,对于所有嵌入,您都使用术语inline


推荐阅读