当他们更新他们的头像/用户名/鉴别符时,我试图打印 a 的用户名 + 鉴别符,但是当我更新我自己的用户名、头像或鉴别符时没有任何反应。我还确保在 https://discord.com/developers/applications/(my application id)/bot
上启用意图我的代码是:
import discord
intents = discord.Intents().all()
client = discord.Client(Intents=intents)
@client.event
async def on_ready():
print('We have logged in as {0.user}'.format(client))
@client.event
async def on_user_update(before, after):
print(str(after))
client.run('my token')
答案 0 :(得分:1)
关键字参数区分大小写,客户端意图配置的关键字参数是intents
,而不是Intents
。所以客户端实例必须是:
client = discord.Client(intents=intents)