Advertisement
Guest User

Untitled

a guest
Feb 28th, 2016
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.09 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. @client.event
  10. async def on_message(message):
  11.     entered = []
  12.     if message.author == client.user:
  13.         return
  14.  
  15.     if message.content.startswith("!start10man"):
  16.         await client.send_message(message.channel, "Starting 10 man: To enter, type '!enter' and to leave type '!leave'")
  17.         while entered >= 10:
  18.             if entered == 10
  19.                 await client.send_message(message.channel, "Starting 10 man with the following users: ")
  20.                 while x <= 10
  21.                     await client.send_message(message.channel, "@".join(entered[x]))
  22.                     x += 1
  23.                 entered = []
  24.                 return
  25.             else:
  26.                 await client.send_message(message.channel, "To enter 10 man type '!enter'")
  27.                 messageobj = await client.wait_for_message()
  28.                 content = messageobj.content
  29.                 author = messageobj.author
  30.                 if content.startswith("!enter"):
  31.                     if any(author in s for s in entered):
  32.                         await client.send_message(message.channel, "Cannot add " + author + " to 10 man, because " + author + " is already a part of the 10 man")
  33.                     else:
  34.                         entered.append(author)
  35.                         await client.send_message(message.channel, "Entered @".join(author) + " to the 10 man, to leave type '!leave'")
  36.                 if content.startswith("!leave"):
  37.                     if any(author in s for s in entered):
  38.                         entered.remove(author)
  39.                         await client.send_message(message.channel, "Removed @".join(author) + " from the 10 man")
  40.                     else:
  41.                        await client.send_message(message.channel, "Cannot remove " + author + " from the 10 man, because " + author + " is not in the 10 man")  
  42. @client.event
  43. async def on_ready():
  44.     print('Logged in as')
  45.     print(client.user.name)
  46.     print(client.user.id)
  47.  
  48. client.run(email, password)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement