Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import discord
- from discord.ext import commands
- #creating instance of a bot and setting it to a 'client' variable. And set prefix to call the bot
- client = commands.Bot(command_prefix = '.')
- #created first event
- @client.event
- async def on_ready():
- print('I am ready')
- @client.event
- async def on_member_join(member):
- message = f'Welcome to the server, {member}'
- print(message)
- @client.event
- async def on_member_remove(member):
- message = f'Farewell, {member}.'
- #print('Type is', type(member))
- print(message)
- @client.command()
- async def greet(ctx):
- await ctx.send("Hello")
Advertisement
Add Comment
Please, Sign In to add comment