Python Discord.py:on_member_join突然停止工作

Python Discord.py:on_member_join突然停止工作,python,discord.py,Python,Discord.py,我正在试用以下代码: @bot.event async def on_member_join(member): print("works") for channel in member.guild.text_channels: if channel.name == 'general': await channel.send("Welcome to " + member.guild.name + &qu

我正在试用以下代码:

@bot.event
async def on_member_join(member):
    print("works")
    for channel in member.guild.text_channels:
        if channel.name == 'general':
            await channel.send("Welcome to " + member.guild.name + ", " + member + "!")
我以前参加的“会员加入”活动效果很好,但由于某些原因,它不再有效了。我已尝试更新到discord.py 1.5。任何帮助都将不胜感激


我没有收到任何错误。

discord.py
1.5.0现在支持discord API的特权网关意图。为了能够利用服务器数据,您需要:

  • 在您的中启用
    Presence Intent
    Server Members Intent

  • 在代码开头使用:
intents=intents.all()
#如果您使用commands.Bot()
bot=commands.bot(command_prefix=“!”,intents=intents)
#如果使用discord.Client()
客户端=不一致。客户端(意图=意图)

您是否收到任何错误?不,我没有错误您是否有
关于\u命令\u错误的事件进行错误处理,并且您确定频道存在吗?