on_member_join and remove dont work. How to make it work?

I don't know why but those 2 commands don't work for me.

@client.event
async def on_member_join(member):
    ver_Channel = client.get_channel(799666119787020289)
    await ver_Channel.send(member+ " have joined the server!")


@client.event
async def on_member_remove(member):
    ver_Channel = client.get_channel(799666119787020289)
    await ver_Channel.send(member + " have been left :(")

btw please write in basic coding explanation I'm a beginner


I'm pretty sure this is an intents issue, you should enable intents.members

intents = discord.Intents.default() # Enabling everything apart from privileged intents (members & presences)
intents.members = True # Explicitly enabling `intents.members`

client = commands.Bot(..., intents=intents)

Also make sure to enable them in the developer portal

How to enable privileged gateway intents