AttributeError: 'Member' 对象没有属性 '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)

    #

    ..........

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


海绵宝宝撒
浏览 67回答 2
2回答

MMTTMM

使用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)配置文件包含的信息在这里

catspeake

我找到了答案。从 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())    ..........
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python