From becee2b0ac1879ceca3ccd9d552c4c5fb2312f72 Mon Sep 17 00:00:00 2001 From: Giovanni Cardamone Date: Sat, 13 Jan 2018 14:54:16 +0100 Subject: [PATCH] added join method in TelegramClient --- telethon/telegram_client.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/telethon/telegram_client.py b/telethon/telegram_client.py index 674e6045..eb9d9a51 100644 --- a/telethon/telegram_client.py +++ b/telethon/telegram_client.py @@ -1403,3 +1403,13 @@ class TelegramClient(TelegramBareClient): ) # endregion + + def join (self): + """ + Join all the threads spwaned for read; + if there is no thread, join will return + """ + + # If there is no thread to join, just return + if self._recv_thread is None: return + else: self._recv_thread.join()