Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import discord as bot
- import urllib.request
- import demjson
- flightname = None
- flightime = None
- flightaircraft = None
- flightshouttime = 0
- adminlist = ['323014681511985154', '406329247435849730']
- client = bot.Client()
- prefix = '[]'
- @client.event
- async def on_message(message):
- global flightshouttime
- global flightname
- global flightaircraft
- global flightime
- admin = False
- msg = str(message.content)
- if message.author == client.user:
- return
- elif msg.startswith(prefix):
- msg = msg[len(prefix):len(msg)]
- response = urllib.request.urlopen('https://trello.com/1/boards/0BJgbL8N/lists?key=37d50eb4be08bb1fe103829e212ddb22&token=6b4e3a5f6b25fc1d92ff5475ecbffdd19394de05ef7bd4250b3d33f77393f1a0')
- st = response.read().decode("utf8")
- d = demjson.decode(st)
- for a in range(len(d)):
- print(d[a]['name'])
- if message.author.id == d[a]['name']:
- await client.send_message(message.channel, 'Sorry, but you current was in the GLOBAL BANLIST')
- return
- for a in adminlist:
- if message.author.id == a:
- admin = True
- if admin == True:
- if msg[:10] == "flightname":
- print("test")
- msgsec = msg[10:len(msg)]
- print(msgsec)
- returnmsg = 'Finish, the system [Flight Name] Value has changed to: '+ msgsec
- flightname = msgsec
- await client.send_message(message.channel, returnmsg)
- elif msg[:10] == "flighttime":
- print("test")
- msgsec = msg[10:len(msg)]
- print(msgsec)
- returnmsg = 'Finish, the system [Flight Time] Value has changed to: '+ msgsec
- flightime = msgsec
- await client.send_message(message.channel, returnmsg//***)
- elif msg[:14] == "flightaircraft":
- print("test")
- msgsec = msg[14:len(msg)]
- print(msgsec)
- returnmsg = 'Finish, the system [Flight Aircraft] Value has changed to: '+ msgsec
- flightaircraft = msgsec
- await client.send_message(message.channel, returnmsg)
- elif msg[:11] == "flightshout":
- if flightshouttime == 0:
- flightshouttime = 1
- await client.send_message(message.channel, 'Are you sure about that? Use the commands one more time to comform. Current mode: No tagging')
- else:
- print(flightime)
- print(flightaircraft)
- print(flightname)
- flightshouttime = 0
- returnmsg = 'Hey there, we got a ' + flightname +' and it will be hosted in '+ flightime + ' and we will use the ' + flightaircraft
- await client.send_message(client.get_channel('444873253098356756'), returnmsg)
- if msg[:7] == "aboutus":
- await client.send_message(message.channel, 'Mars Airways Is An Airline Founded In April And Officially Started Operations On October 23rd, 2018, Since Then Mars Airways Has Been Operating Threw Bexon Airport To Mars. There Fleet Is 737-10MAX. This Airline Was Founded By 10xTheFoxy. \n Mars Airways, The Airline Of The Gateway to Mars.')
- @client.event
- async def on_ready():
- print('Logged in as')
- print(client.user.name)
- print(client.user.id)
- print('------')
- client.run('NTIyNzczMzMyNDkyNDE5MDgz.DvP2Mg.oM2jvDozYpDzZb_A0DENahYHIMA')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement