如何发送自定义帮助PM

2024-09-28 01:26:16 发布

您现在位置:Python中文网/ 问答频道 /正文

尝试使用生成自定义帮助命令不和.py重写到目前为止我有这个

@bot.command(pass_contex = true)
  async def help(ctx):    
    author = ctx.message.author

    embed.set_author(name="Help")
    embed.add_field(name="!Commands" , value= "Type '!' + a name starting with a capital" , inline=False)
    await bot.send_message(author, embed=embed)

但这会导致一个错误,即bot不会发送消息


Tags: namepy命令truemessageasyncdefbot
1条回答
网友
1楼 · 发布于 2024-09-28 01:26:16

你有一些拼写错误的问题

@bot.command(pass_contex = true)

应该是

^{pr2}$

但你从来没有做过嵌入

author = ctx.message.author
embed = discord.Embed()
embed.set_author(name="Help")
embed.add_field(name="!Commands" , value= "Type '!' + a name starting with a capital" , inline=False)
await ctx.send(author, embed=embed)

相关问题 更多 >

    热门问题