Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import discord
- import config
- client = discord.Client()
- email = config.email
- password = config.password
- @client.event
- async def on_message(message):
- entered = []
- if message.author == client.user:
- return
- if message.content.startswith("!start10man"):
- await client.send_message(message.channel, "Starting 10 man: To enter, type '!enter' and to leave type '!leave'")
- while entered >= 10:
- if entered == 10
- await client.send_message(message.channel, "Starting 10 man with the following users: ")
- while x <= 10
- await client.send_message(message.channel, "@".join(entered[x]))
- x += 1
- entered = []
- return
- else:
- await client.send_message(message.channel, "To enter 10 man type '!enter'")
- messageobj = await client.wait_for_message()
- content = messageobj.content
- author = messageobj.author
- if content.startswith("!enter"):
- if any(author in s for s in entered):
- await client.send_message(message.channel, "Cannot add " + author + " to 10 man, because " + author + " is already a part of the 10 man")
- else:
- entered.append(author)
- await client.send_message(message.channel, "Entered @".join(author) + " to the 10 man, to leave type '!leave'")
- if content.startswith("!leave"):
- if any(author in s for s in entered):
- entered.remove(author)
- await client.send_message(message.channel, "Removed @".join(author) + " from the 10 man")
- else:
- await client.send_message(message.channel, "Cannot remove " + author + " from the 10 man, because " + author + " is not in the 10 man")
- @client.event
- async def on_ready():
- print('Logged in as')
- print(client.user.name)
- print(client.user.id)
- client.run(email, password)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement