Advertisement
Guest User

Untitled

a guest
Feb 28th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. import discord
  2. import config
  3.  
  4.  
  5. client = discord.Client()
  6. email = config.email
  7. password = config.password
  8.  
  9.  
  10. #The bot itself
  11. @client.event
  12. async def on_message(message):
  13. # we do not want the bot to reply to itself
  14. if message.author == client.user:
  15. return
  16.  
  17. if message.content.startswith("!veto"):
  18. maps = config.maps
  19. while len(maps) > 0:
  20. if len(maps) == 1:
  21. await client.send_message(message.channel, "Selected map: " + maps[0])
  22. return
  23. else:
  24. print(len(maps))
  25. await client.send_message(message.channel, "Maps left: " + ','.join(maps))
  26. await client.send_message(message.channel, "Enter your veto (for example de_dust2)")
  27. messageobj = await client.wait_for_message()
  28. userVeto = messageobj.content
  29. if any(userVeto in s for s in maps):
  30. maps.remove(userVeto)
  31. await client.send_message(message.channel, "Removed " + userVeto)
  32. #else:
  33. #await client.send_message(message.channel, "Invalid Map Name")
  34.  
  35.  
  36. #Display account info when logged in
  37. @client.event
  38. async def on_ready():
  39. print('Logged in as')
  40. print(client.user.name)
  41. print(client.user.id)
  42. print('------')
  43.  
  44. #Login to account
  45. client.run(email, password)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement