Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import discord
- import time
- import timeit
- import ctypes
- import asyncio
- import main, imp
- start = timeit.timeit()
- file = open('bot_save_files\patch.txt', 'r')
- version = file.readline()
- file.close()
- print(str(version))
- print('------------')
- ctypes.windll.kernel32.SetConsoleTitleW(str(version))
- discord = discord.Client()
- @discord.event
- async def on_message(message):
- if message.content.startswith('mikureload'):
- if str(message.author.id) == '207505077013839883':
- try:
- imp.reload(main)
- msg = 'Reload of Miku sucessful!'
- except Exception as e:
- msg = 'Reload of Miku failed!\n{0}'.format(e)
- print(msg)
- await discord.send_message(message.channel, msg)
- return
- else:
- return
- else:
- await main.message_in(message, discord)
- return
- @discord.event
- async def on_ready():
- global start, statuses
- print('Logged in as:', discord.user.name)
- print('Client ID:', discord.user.id)
- print('Loading files...')
- success = main.reload_files()
- if success == False:
- print('Files loaded successfully')
- else:
- print("Loading of files unsuccessfull")
- end = timeit.timeit()
- print('Started up in', round((end - start)*100, 2), 'seconds')
- discord.loop.create_task(main.task_loop(discord))
- await asyncio.sleep(0.5)
- print('------------')
- TOKEN = '<removed>'
- discord.run(TOKEN)
Add Comment
Please, Sign In to add comment