如何发送自定义帮助PM

问题描述 投票:2回答:1

到目前为止,尝试使用discord.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)

但这给出了一个关于机器人无法发送消息的错误

python python-3.x discord discord.py discord.py-rewrite
1个回答
0
投票

你有一些拼写错误的问题

@bot.command(pass_contex = true)

应该

@bot.command(pass_context = True)

你从来没有真正做过嵌入

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)
© www.soinside.com 2019 - 2024. All rights reserved.