import discord
intent=discord.Intents.default()
intent.members=True
client=discord.Client()
@client.event
async def on_ready():
print('We have logged in as {0.user}'.format(client))
@client.event
async def on_member_join(member):
guild=client.get_guild(ServerID)
channel=guild.get_channel(ChannelID)
await channel.send(f'Welcome to the server{member.mention}! :D')
await member.send(f'Welcome to the {guild.name} server,{member.name}! :D')
print(f'Welcome to the {guild.name} server,{member.name}! :D')
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith('$hello'):
await message.channel.send('Hello!')
Why is my join function not being executed when someone joins my discord server ? i have given all the permission as well that is needed to msg in the specific channel but it seems that it never even calls the function Edit: I changed it to on_member_join it still doesn't work