Discord.py-消息变成';无类型';循环中的对象

Discord.py-消息变成';无类型';循环中的对象,discord.py,Discord.py,我正试图用dict创建一个help命令,并用循环为dict的每个项目编辑一些消息,但是当我使用help命令时,它返回错误AttributeError:“NoneType”对象没有属性“edit”当使用ping命令时,我不明白为什么help\u msg会变成“NoneType”对象… 代码如下: @bot.command(aliases = ['h','aide']) async def help(ctx): help_msg = await ctx.send("__**Avai

我正试图用dict创建一个help命令,并用循环为dict的每个项目编辑一些消息,但是当我使用help命令时,它返回错误
AttributeError:“NoneType”对象没有属性“edit”
当使用ping命令时,我不明白为什么
help\u msg
会变成“NoneType”对象…
代码如下:

@bot.command(aliases = ['h','aide'])
async def help(ctx):
    help_msg = await ctx.send("__**Available commands:**__")
    for commande, info in help_list.items():
        help_msg = await help_msg.edit(content=str(help_msg.content)+commande+info)

@bot.command(pass_context=True)
async def ping(ctx, message=None):
    await ctx.send(f":ping_pong: Pong!  `{round(bot.latency*1000)}ms`")


p = bot.command_prefix
help_list = {
    f"``` {p}help | Alias: {', '.join(help.aliases)}```" : "Affiche la liste des commandes | ?help <commande>",
    f"``` {p}ping | Alias: {', '.join(ping.aliases)}```" : "Affiche le ping du bot en ms | ?ping"
    }
@bot.command(别名=['h','aide'])
异步def帮助(ctx):
help\u msg=wait ctx.send(“\uuu**可用命令:*\uuuuu”)
对于命令,请参阅帮助列表.items()中的信息:
help\u msg=wait help\u msg.edit(content=str(help\u msg.content)+命令+信息)
@命令(pass\u context=True)
异步定义ping(ctx,消息=无):
等待ctx.send(f):ping_-pong:pong!`{round(bot.latency*1000)}ms`)
p=bot.command_前缀
帮助列表={
f“``{p}help |别名:{','.join(help.Alias)}`````:“帮助命令列表”,
f“``{p}ping |别名:{,'.join(ping.Alias)}`````:“将ping-du-bot附加在ms |?ping上”
}
没有返回值,因此
help\u msg
设置为无

我相信如果你取消任务,它应该会起作用

for commande, info in help_list.items():
    await help_msg.edit(content=str(help_msg.content)+commande+info)
没有返回值,因此
help\u msg
设置为无

我相信如果你取消任务,它应该会起作用

for commande, info in help_list.items():
    await help_msg.edit(content=str(help_msg.content)+commande+info)