From 910959b672d4c007dcee5d013caa9f14a20a4776 Mon Sep 17 00:00:00 2001 From: leandrotoledo Date: Fri, 4 Sep 2015 17:15:44 -0300 Subject: [PATCH] Raises error when chat_id is not set --- telegram/bot.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/telegram/bot.py b/telegram/bot.py index 502c35b39..b09907c91 100644 --- a/telegram/bot.py +++ b/telegram/bot.py @@ -146,6 +146,9 @@ class Bot(TelegramObject): """ url, data = func(self, *args, **kwargs) + if not kwargs.get('chat_id'): + raise TelegramError('Invalid chat_id.') + if kwargs.get('reply_to_message_id'): reply_to_message_id = kwargs.get('reply_to_message_id') data['reply_to_message_id'] = reply_to_message_id