aboutsummaryrefslogtreecommitdiff
path: root/examples/new_member.py
blob: 67e700a4f456d568c36351f518960a9ea1babd60 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
        await guild.default_channel.send('Welcome {0.mention} to {1.name}!'.format(member, guild))

client = MyClient()
client.run('token')