mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-19 14:38:43 +00:00
.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
19 lines
483 B
Python
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')
|