Guest User

Untitled

a guest
Jun 18th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. import os, discord
  2. from discord.ext import commands
  3.  
  4. events_path = os.listdir('events')
  5. bot = commands.Bot(command_prefix='alp!', description='Type alp!help "command", for help on a command')
  6.  
  7. @bot.command()
  8. async def addevent():
  9. '''Add an event. Doing this to an existing event will overwrite it'''
  10. e = open('events/{}'.format(event_name), 'w+')
  11. e.write('__**{}**__'.format(event_name))
  12. e.close()
  13. await bot.say('Event successfully created')
  14.  
  15. @bot.command()
  16. async def events():
  17. '''List events, just list them. For more details on an event do alp!details'''
  18. await bot.say('\n'.join(event_list))
  19.  
  20. @bot.event
  21. async def on_ready():
  22. await bot.send_message(bot.get_channel('Channel ID'), 'Hello young masters')
  23. await bot.change_presence(game=discord.Game(name='with my bits'))
  24.  
  25. @bot.event
  26. async def on_member_join(member):
  27. guild = member.guild
  28. await member.send("Welcome master {}".format(guild.name))
  29.  
  30. bot.run('Your token')
Add Comment
Please, Sign In to add comment