AttributeError: 'Member' object has no attribute 'public_flags'

AttributeError: 'Member' object has no attribute 'public_flags'

@commands.command()
async def profile(self, ctx, *, user: discord.Member = None):
    """Profile"""
    if user == None:
      user = ctx.author
    server = ctx.guild
    #error in this
    print(ctx.author.public_flags)
    #
    ..........

我想知道 public 用户示例的标志:Hypesquad balance

使用discord.User.profile.

@commands.command()
async def profile(self, ctx, *, user: discord.Member = None):
    """Profile"""
    if user == None:
      user = ctx.author
    server = ctx.guild
    # this for example prints if the user has discord nitro
    print(await ctx.author.profile().nitro)

配置文件包含的信息here

我找到了答案。从 github

安装最近的 discord.py
@commands.command()
async def profile(self, ctx, *, user: discord.Member = None):
    """Profile"""
    if user == None:
      user = ctx.author
    server = ctx.guild
    print(ctx.author.public_flags.all())
    ..........