亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

AttributeError: 'Member' 對象沒有屬性 'public_flags'

AttributeError: 'Member' 對象沒有屬性 'public_flags'

海綿寶寶撒 2022-12-20 15:26:08
@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 回答

?
MMTTMM

TA貢獻1869條經驗 獲得超4個贊

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

配置文件包含的信息在這里


查看完整回答
反對 回復 2022-12-20
?
catspeake

TA貢獻1111條經驗 獲得超0個贊

我找到了答案。從 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())

    ..........


查看完整回答
反對 回復 2022-12-20
  • 2 回答
  • 0 關注
  • 104 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號