mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-06-18 19:16:43 +00:00
Fix run_until_disconnected disconnect with telethon.sync
This commit is contained in:
parent
ad01bda503
commit
c0412e4410
@ -37,7 +37,12 @@ class UpdateMethods(UserMethods):
|
|||||||
try:
|
try:
|
||||||
return self.loop.run_until_complete(self.disconnected)
|
return self.loop.run_until_complete(self.disconnected)
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
self.loop.run_until_complete(self.disconnect())
|
# Importing the magic sync module turns disconnect into sync.
|
||||||
|
# TODO Maybe disconnect() should not need the magic module...
|
||||||
|
if inspect.iscoroutinefunction(self.disconnect):
|
||||||
|
self.loop.run_until_complete(self.disconnect())
|
||||||
|
else:
|
||||||
|
self.disconnect()
|
||||||
|
|
||||||
def on(self, event):
|
def on(self, event):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user