1
0
mirror of https://github.com/Rapptz/discord.py.git synced 2025-09-19 14:38:43 +00:00
Files
.github
discord
docs
examples
background_task.py
basic_bot.py
basic_voice.py
custom_context.py
deleted.py
edits.py
guessing_game.py
new_member.py
reply.py
.gitignore
.readthedocs.yml
LICENSE
MANIFEST.in
README.ja.rst
README.rst
requirements.txt
setup.py
discord.py/examples/new_member.py
Rapptz 00ee7549c9 Update new member example to not be broken.
Took forever but better late than never.
2018-08-22 21:06:09 -04:00

19 lines
483 B
Python

import discord
class MyClient(discord.Client):
async def on_ready(self):
print('Logged in as')
print(self.user.name)
print(self.user.id)
print('------')
async def on_member_join(self, member):
guild = member.guild
if guild.system_channel is not None:
to_send = 'Welcome {0.mention} to {1.name}!'.format(member, guild)
await guild.system_channel.send(to_send)
client = MyClient()
client.run('token')