【问题标题】:Why doesn't on_member_update trigger?为什么 on_member_update 不触发?
【发布时间】:2022-08-03 09:40:10
【问题描述】:

我启用了意图,为什么没有触发

import discord
intents = discord.Intents.default()
intents.members = True
intents.presences = True

@client.event
async def on_member_update(before, after):
    print(\'working\')

  • 您的客户未定义。
  • 这是。我发布的显然只是一小段代码。整个代码大约 600 行长
  • 如果我们能看到您在客户端中定义了意图,那将是最好的。

标签: python discord.py


【解决方案1】:

应该是这样的

intents = discord.Intents().all()
client = commands.Bot(command_prefix = '[your prefix here]', intents = intents)

【讨论】:

    猜你喜欢
    • 2020-07-30
    • 1970-01-01
    • 2018-10-27
    • 2011-10-12
    • 2015-06-16
    • 1970-01-01
    • 2017-03-16
    • 2014-11-05
    • 1970-01-01
    相关资源
    最近更新 更多