discord.py on_member_join not working even though the bot is in the server and online

You need to pass intents in the Client() initializer

Below is the revised code:

import discord
intents = discord.Intents.default()
intents.members = True
client = discord.Client(intents=intents)

@client.event
async def on_ready():
    print(f'We have logged in as {client.user}')


@client.event
async def on_member_join(member):
    await member.send('welcome !')

client.run('TOKEN')

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top