2024-09-30 18:30:06 发布
网友
我正试图让机器人在人们对某个反应做出反应时加入角色,它以前工作得很好,但突然停止了工作
client.get_user(payload.user_id)本应返回用户,但它不返回任何用户,我打印了用户id,它工作了,打印了我自己的id,但当我添加get_用户时,它立即不返回任何用户(我正在使用我自己的id)
我不知道发生了什么,我确定discor.py是最新的更新
下面是相关的代码部分:https://paste.pythondiscord.com/olivohevud.cs
谢谢
使用discord.py 1.5.x设置意图对于事件的正常运行是必要的
将此添加到您的代码中:
intents = discord.Intents.default() # If you are using client client = discord.Client(intents=intents) # If you are using bot bot = commands.Bot(command_prefix='!', intents=intents)
使用discord.py 1.5.x设置意图对于事件的正常运行是必要的
将此添加到您的代码中:
相关问题 更多 >
编程相关推荐