Faerlynn

MikuInit v0.20.0 (14.1.2019)

Jan 14th, 2019
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.49 KB | None | 0 0
  1. import discord
  2. import time
  3. import timeit
  4. import ctypes
  5. import asyncio
  6. import main, imp
  7.  
  8. start = timeit.timeit()
  9.  
  10. file = open('bot_save_files\patch.txt', 'r')
  11. version = file.readline()
  12. file.close()
  13. print(str(version))
  14. print('------------')
  15. ctypes.windll.kernel32.SetConsoleTitleW(str(version))
  16.  
  17. discord = discord.Client()
  18.  
  19. @discord.event
  20. async def on_message(message):
  21.     if message.content.startswith('mikureload'):
  22.         if str(message.author.id) == '207505077013839883':
  23.             try:
  24.                 imp.reload(main)
  25.                 msg = 'Reload of Miku sucessful!'
  26.             except Exception as e:
  27.                 msg = 'Reload of Miku failed!\n{0}'.format(e)
  28.             print(msg)
  29.             await discord.send_message(message.channel, msg)
  30.             return
  31.         else:
  32.             return
  33.     else:
  34.         await main.message_in(message, discord)
  35.         return
  36.  
  37. @discord.event
  38. async def on_ready():
  39.     global start, statuses
  40.     print('Logged in as:', discord.user.name)
  41.     print('Client ID:', discord.user.id)
  42.     print('Loading files...')
  43.     success = main.reload_files()
  44.     if success == False:
  45.         print('Files loaded successfully')
  46.     else:
  47.         print("Loading of files unsuccessfull")
  48.     end = timeit.timeit()
  49.     print('Started up in', round((end - start)*100, 2), 'seconds')
  50.     discord.loop.create_task(main.task_loop(discord))
  51.     await asyncio.sleep(0.5)
  52.     print('------------')
  53.  
  54. TOKEN = '<removed>'
  55. discord.run(TOKEN)
Add Comment
Please, Sign In to add comment