如何发送自定义帮助PM

时间:2018-09-12 06:46:52

标签: python python-3.x discord discord.py discord.py-rewrite

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

但这会给出关于机器人不打算发送消息的错误

1 个答案:

答案 0 :(得分: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)