run_until_disconnected() should disconnect() on finally

This commit is contained in:
Lonami Exo 2019-03-21 12:25:19 +01:00
parent 04ba2e1fc7
commit 347db79979

View File

@ -16,6 +16,8 @@ class UpdateMethods(UserMethods):
try:
await self.disconnected
except KeyboardInterrupt:
pass
finally:
await self.disconnect()
def run_until_disconnected(self):
@ -33,6 +35,8 @@ class UpdateMethods(UserMethods):
try:
return self.loop.run_until_complete(self.disconnected)
except KeyboardInterrupt:
pass
finally:
self.loop.run_until_complete(self.disconnect())
def on(self, event):