Skip to content

Instantly share code, notes, and snippets.

@ivansaul
Last active June 13, 2022 04:14
Show Gist options
  • Save ivansaul/8f2351ecd61933d8053059944ecfab8a to your computer and use it in GitHub Desktop.
Save ivansaul/8f2351ecd61933d8053059944ecfab8a to your computer and use it in GitHub Desktop.
Welcome direct message discord python
import discord
from discord.ext import commands
#add this line
intents=intents=discord.Intents.all()
#if the above don't work, try with this
#intents = discord.Intents()
#intents.members = True
TOKEN = 'your token'
bot=commands.Bot(command_prefix='!',intents=intents)
#Events
@bot.event
async def on_member_join(member):
await member.send('Private message')
@bot.event
async def on_ready():
print('My bot is ready')
bot.run(TOKEN)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment