Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os, discord
- from discord.ext import commands
- events_path = os.listdir('events')
- bot = commands.Bot(command_prefix='alp!', description='Type alp!help "command", for help on a command')
- @bot.command()
- async def addevent():
- '''Add an event. Doing this to an existing event will overwrite it'''
- e = open('events/{}'.format(event_name), 'w+')
- e.write('__**{}**__'.format(event_name))
- e.close()
- await bot.say('Event successfully created')
- @bot.command()
- async def events():
- '''List events, just list them. For more details on an event do alp!details'''
- await bot.say('\n'.join(event_list))
- @bot.event
- async def on_ready():
- await bot.send_message(bot.get_channel('Channel ID'), 'Hello young masters')
- await bot.change_presence(game=discord.Game(name='with my bits'))
- @bot.event
- async def on_member_join(member):
- guild = member.guild
- await member.send("Welcome master {}".format(guild.name))
- bot.run('Your token')
Add Comment
Please, Sign In to add comment