【发布时间】:2021-09-15 05:57:20
【问题描述】:
我正在尝试为我正在开发的机器人制作一个帮助嵌入页面。但是,它没有嵌入它,而是显示了这种胡言乱语:
我使用的代码:
@client.command
async def help(ctx):
print("ctx.message.author.avatar_url")
embed=discord.Embed(title="Commands", description="Help Page", color=0xad1f1f)
embed.set_author(name=ctx.message.author.name + "#" + ctx.message.author.discriminator, icon_url=ctx.message.author.avatar_url)
embed.add_field(name=".help", value="Shows this page. Do .help [Page] for more help pages", inline=False)
embed.add_field(name=".say", value="Says what you input and removes your message. (Administrator Exclusive)", inline=False)
embed.add_field(name=".avatar", value="Sends your avatar. Or the avatar of anyone mentioned or replied to.", inline=False)
embed.set_footer(text="Page (1/1)")
await ctx.message.reply(embed=embed)
我什么都试过了。我用谷歌搜索,打印所有变量,以防avatar_url 出现问题。我现在只是厌倦了。也许这是一个语法错误,我真的很愚蠢,我希望不是这样。
【问题讨论】:
-
这是默认的帮助命令,你之前删除了吗?
-
什么?有默认的帮助命令吗?如何
-
总是有一个默认的帮助命令,它就是你得到的。您应该首先删除它(使用
bot.remove_command("help")),然后定义您自己的帮助命令。虽然你应该得到这样的错误:'help' command is already registered
标签: python discord discord.py embed