diff --git a/telethon/telegram_client.py b/telethon/telegram_client.py index a3d8da6b..8e0b2c52 100644 --- a/telethon/telegram_client.py +++ b/telethon/telegram_client.py @@ -167,6 +167,9 @@ class TelegramClient: if not issubclass(type(request), MTProtoRequest): raise ValueError('You can only invoke MtProtoRequests') + if not self.sender: + raise ValueError('You must be connected to invoke requests!') + try: self.sender.send(request) self.sender.receive(request, timeout)