AttributeError:“成员”对象没有属性“ public_flags”

时间:2020-06-03 20:07:17

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

@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)
    #
    ..........

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

2 个答案:

答案 0 :(得分:0)

使用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

的信息

答案 1 :(得分:0)

我找到了答案。从github安装最新的discord.py

*args[1000]