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
- #The bot itself
- @client.event
- async def on_message(message):
- # we do not want the bot to reply to itself
- if message.author == client.user:
- return
- if message.content.startswith("!veto"):
- maps = config.maps
- while len(maps) > 0:
- if len(maps) == 1:
- await client.send_message(message.channel, "Selected map: " + maps[0])
- return
- else:
- print(len(maps))
- await client.send_message(message.channel, "Maps left: " + ','.join(maps))
- await client.send_message(message.channel, "Enter your veto (for example de_dust2)")
- messageobj = await client.wait_for_message()
- userVeto = messageobj.content
- if any(userVeto in s for s in maps):
- maps.remove(userVeto)
- await client.send_message(message.channel, "Removed " + userVeto)
- #else:
- #await client.send_message(message.channel, "Invalid Map Name")
- #Display account info when logged in
- @client.event
- async def on_ready():
- print('Logged in as')
- print(client.user.name)
- print(client.user.id)
- print('------')
- #Login to account
- client.run(email, password)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement