def START():
loop = asyncio.new_event_loop()
try:
loop.run_until_complete(bot.start(config.BOT_TOKEN))
except KeyboardInterrupt:
loop.run_until_complete(bot.close())
finally:
loop.close()
class WorkThread(QtCore.QThread):
threadSignal = QtCore.pyqtSignal(int)
def __init__(self):
super().__init__()
def run(self):
i = ''
self.msleep(300)
self.threadSignal.connect(START)
self.threadSignal.emit(i)