Discord.py: on_member_join suddenly stopped working

后端 未结 1 1162
被撕碎了的回忆
被撕碎了的回忆 2021-01-25 17:10

I have the following code that I am trying out:

@bot.event
async def on_member_join(member):
    print("works")
    for channel in member.guild.text_cha         


        
1条回答
  •  借酒劲吻你
    2021-01-25 17:22

    discord.py 1.5.0 now supports discord API's Privileged Gateway Intents. In order to be able to exploit server data, you need to:

    • Enable Presence Intent and Server Members Intent in your discord application:

    • Use discord.Intents at the beginning of your code:
    intents = Intents.all()
    
    #If you use commands.Bot()
    bot = commands.Bot(command_prefix="!", intents=intents)
    
    #If you use discord.Client()
    client = discord.Client(intents=intents)
    

    0 讨论(0)
提交回复
热议问题