Python 属性错误:';消息';对象没有属性';成员';-Discord.py重写

Python 属性错误:';消息';对象没有属性';成员';-Discord.py重写,python,discord.py,Python,Discord.py,因此,我正试图让版主能够将用户注册到JSON文件中,我们在其中存储货币 这是我的代码,我得到了错误: id=str(ctx.message.member.id) AttributeError:“消息”对象没有属性“成员” @bot.command(pass\u context=True) 异步def注册表服务器(ctx,成员:discord.member): id=str(ctx.message.member.id) 如果id不在金额中: 金额[id]=0 等待ctx.send(“您现在已注册

因此,我正试图让版主能够将用户注册到JSON文件中,我们在其中存储货币

这是我的代码,我得到了错误:

id=str(ctx.message.member.id)
AttributeError:“消息”对象没有属性“成员”
@bot.command(pass\u context=True)
异步def注册表服务器(ctx,成员:discord.member):
id=str(ctx.message.member.id)
如果id不在金额中:
金额[id]=0
等待ctx.send(“您现在已注册到AccoladeBot。”)
_保存()
其他:
等待ctx.send(“您已经有一个帐户了。”)```

如果要检查指定用户是否有帐户,则应编写
str(member.id)
而不是
str(ctx.message.member.id)


有关
上下文
对象的详细信息。

给了我第二个错误:NameError:name'message'未定义如果来自代码的另一部分,我给出的命令中没有“message”变量:/
@bot.command()
async def registeruser(ctx, member: discord.Member):
    id = str(member.id)
    if id not in amounts:
        amounts[id] = 0
        await ctx.send("You are now registered to AccoladeBot.")
        _save()
    else:
        await ctx.send("You already have an account.")