1
0
Fork 0
mirror of https://github.com/myned/modufur.git synced 2024-12-23 22:27:27 +00:00

Checked for session creation before closing, formatting change

This commit is contained in:
Myned 2017-10-14 15:29:35 -04:00
parent b3435e3316
commit a3d906e63e

View file

@ -32,11 +32,12 @@ class Bot:
# loop = self.bot.loop.all_tasks()
# for task in loop:
# task.cancel()
await u.session.close()
if u.session:
await u.session.close()
await self.bot.logout()
await self.bot.close()
print('- - - - - - -')
print('CLOSED')
print('DISCONNECTED')
@commands.command(name=',restart', aliases=[',res', ',r'], hidden=True)
@commands.is_owner()
@ -49,7 +50,8 @@ class Bot:
# loop = self.bot.loop.all_tasks()
# for task in loop:
# task.cancel()
await u.session.close()
if u.session:
await u.session.close()
await self.bot.logout()
await self.bot.close()
os.execl(sys.executable, 'python3', 'run.py')