mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-08 12:59:46 +00:00
Add Conversation to the sync magic module
This commit is contained in:
@@ -420,6 +420,9 @@ class Conversation(ChatGetter):
|
||||
except asyncio.CancelledError:
|
||||
pass
|
||||
|
||||
def __enter__(self):
|
||||
return self._client.loop.run_until_complete(self.__aenter__())
|
||||
|
||||
async def __aenter__(self):
|
||||
self._client._conversations[self._id] = self
|
||||
self._input_chat = \
|
||||
@@ -439,5 +442,8 @@ class Conversation(ChatGetter):
|
||||
|
||||
return self
|
||||
|
||||
def __exit__(self, *args):
|
||||
return self._client.loop.run_until_complete(self.__aexit__(*args))
|
||||
|
||||
async def __aexit__(self, *args):
|
||||
del self._client._conversations[self._id]
|
||||
|
Reference in New Issue
Block a user