我已经尝试了下面的代码,但出现此错误。我显然没有正确的属性,但是我无法在文档中找到它。
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)
答案 0 :(得分:1)
mutual_guilds
是User
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)