mirror of
https://github.com/myned/modufur.git
synced 2024-12-24 22:27:28 +00:00
Checked for session creation before closing, formatting change
This commit is contained in:
parent
b3435e3316
commit
a3d906e63e
1 changed files with 5 additions and 3 deletions
|
@ -32,11 +32,12 @@ class Bot:
|
||||||
# loop = self.bot.loop.all_tasks()
|
# loop = self.bot.loop.all_tasks()
|
||||||
# for task in loop:
|
# for task in loop:
|
||||||
# task.cancel()
|
# task.cancel()
|
||||||
|
if u.session:
|
||||||
await u.session.close()
|
await u.session.close()
|
||||||
await self.bot.logout()
|
await self.bot.logout()
|
||||||
await self.bot.close()
|
await self.bot.close()
|
||||||
print('- - - - - - -')
|
print('- - - - - - -')
|
||||||
print('CLOSED')
|
print('DISCONNECTED')
|
||||||
|
|
||||||
@commands.command(name=',restart', aliases=[',res', ',r'], hidden=True)
|
@commands.command(name=',restart', aliases=[',res', ',r'], hidden=True)
|
||||||
@commands.is_owner()
|
@commands.is_owner()
|
||||||
|
@ -49,6 +50,7 @@ class Bot:
|
||||||
# loop = self.bot.loop.all_tasks()
|
# loop = self.bot.loop.all_tasks()
|
||||||
# for task in loop:
|
# for task in loop:
|
||||||
# task.cancel()
|
# task.cancel()
|
||||||
|
if u.session:
|
||||||
await u.session.close()
|
await u.session.close()
|
||||||
await self.bot.logout()
|
await self.bot.logout()
|
||||||
await self.bot.close()
|
await self.bot.close()
|
||||||
|
|
Loading…
Reference in a new issue