Search code examples
discorddiscord.py

Send message to user upon join with discord.py self-bot


It suppose to send message upon join but Member_join event isn't working By the way it's a self bot Discord.py Version : 1.7.3 My code:


@client.event
async def on_member_join(member):
  await member.send("welcome to random server")
  print(f"Sent message to {member.username}")

Solution

  • So if you use discord.py-self then your current code will work. it in newer version as in newer version of discord.py they have blocked the access to api thru non bot auth token.