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.