@client.command()
async def nitro(ctx):
nitro = ctx.message.author.discord.profile.nitro
embed = discord.Embed(title=f":house_with_garden: {ctx.message.author} - Stats",
description=f"Nitro: {nitro}",
color=discord.Colour.green())
await ctx.send(embed=embed)每当我运行这个命令时,我都会得到这样的错误:
"discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Member' object has no attribute 'discord'" 当我输入:.nitro @username时,我想告诉用户是否有nitro
发布于 2021-01-12 05:11:49
使用ctx.message.author.profile().nitro,因为discord.Profile是一个表示用户配置文件的类(可通过Member.profile访问)。
https://stackoverflow.com/questions/65674545
复制相似问题