bot.py semantic fixes (#774)

offset for get_user_profile_photo can be zero.
edit_message_caption should raise ValueError in compliance with other methods. Also changed to snake_case
edit_message_reply_markup was even weirder
This commit is contained in:
Eldinnie 2017-08-07 23:13:32 +02:00 committed by Noam Meltzer
parent b04869f36a
commit 56f7d18853

View file

@ -1156,7 +1156,7 @@ class Bot(TelegramObject):
data = {'user_id': user_id}
if offset:
if offset is not None:
data['offset'] = offset
if limit:
data['limit'] = limit
@ -1438,8 +1438,8 @@ class Bot(TelegramObject):
"""
if inline_message_id is None and (chat_id is None or message_id is None):
raise TelegramError(
'editMessageCaption: Both chat_id and message_id are required when '
raise ValueError(
'edit_message_caption: Both chat_id and message_id are required when '
'inline_message_id is not specified')
url = '{0}/editMessageCaption'.format(self.base_url)
@ -1494,8 +1494,8 @@ class Bot(TelegramObject):
"""
if inline_message_id is None and (chat_id is None or message_id is None):
raise TelegramError(
'editMessageCaption: Both chat_id and message_id are required when '
raise ValueError(
'edit_message_reply_markup: Both chat_id and message_id are required when '
'inline_message_id is not specified')
url = '{0}/editMessageReplyMarkup'.format(self.base_url)