Skip to content
This repository has been archived by the owner on Aug 29, 2021. It is now read-only.

Commit

Permalink
Merge branch 'patch-1' of https://github.com/AutumnClove/MusicBot int…
Browse files Browse the repository at this point in the history
…o patch-1
  • Loading branch information
AutumnClove committed Aug 26, 2021
2 parents 72cd6d4 + 70645f1 commit 4607f7f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions musicbot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1049,19 +1049,19 @@ async def send_typing(self, destination):

async def restart(self):
self.exit_signal = exceptions.RestartSignal()
await self.close()
await self.logout()

def restart_threadsafe(self):
asyncio.run_coroutine_threadsafe(self.restart(), self.loop)

def _cleanup(self):
try:
self.loop.run_until_complete(self.logout())
self.loop.run_until_complete(self.aiosession.close())
self.loop.run_until_complete(self.aiosession.logout())
except:
pass

pending = asyncio.all_tasks()
pending = asyncio.Task.all_tasks()
gathered = asyncio.gather(*pending)

try:
Expand Down Expand Up @@ -1095,7 +1095,7 @@ def run(self):

async def logout(self):
await self.disconnect_all_voice_clients()
return await super().close()
return await super().logout()

async def on_error(self, event, *args, **kwargs):
ex_type, ex, stack = sys.exc_info()
Expand Down

0 comments on commit 4607f7f

Please sign in to comment.