Last active
June 13, 2022 04:14
-
-
Save ivansaul/8f2351ecd61933d8053059944ecfab8a to your computer and use it in GitHub Desktop.
Welcome direct message discord python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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