列出没有共同行会的朋友,discord.py rewrite

时间:2018-08-16 13:13:27

标签: python discord discord.py discord.py-rewrite

我已经尝试了下面的代码,但出现此错误。我显然没有正确的属性,但是我无法在文档中找到它。

AttributeError: type object 'User' has no attribute 'mutual_guilds

@bot.command()
async def C(ctx):
    for user in bot.user.friends:
        if user.mutual_guilds == None:
            print ("Friend: " + user.name+"#"+user.discriminator)

1 个答案:

答案 0 :(得分:1)

mutual_guildsUser s Profile

的属性
@bot.command()
async def C(ctx):
    for user in bot.user.friends:
        profile = await user.profile()
        if not profile.mutual_guilds:
            print ("Friend: " + user.name+"#"+user.discriminator)