Skip to content

Commit 56f7d18

Browse files
Eldinnietsnoam
authored andcommitted
bot.py semantic fixes (python-telegram-bot#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
1 parent b04869f commit 56f7d18

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

telegram/bot.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,7 @@ def get_user_profile_photos(self, user_id, offset=None, limit=100, timeout=None,
11561156

11571157
data = {'user_id': user_id}
11581158

1159-
if offset:
1159+
if offset is not None:
11601160
data['offset'] = offset
11611161
if limit:
11621162
data['limit'] = limit
@@ -1438,8 +1438,8 @@ def edit_message_caption(self,
14381438
"""
14391439

14401440
if inline_message_id is None and (chat_id is None or message_id is None):
1441-
raise TelegramError(
1442-
'editMessageCaption: Both chat_id and message_id are required when '
1441+
raise ValueError(
1442+
'edit_message_caption: Both chat_id and message_id are required when '
14431443
'inline_message_id is not specified')
14441444

14451445
url = '{0}/editMessageCaption'.format(self.base_url)
@@ -1494,8 +1494,8 @@ def edit_message_reply_markup(self,
14941494
"""
14951495

14961496
if inline_message_id is None and (chat_id is None or message_id is None):
1497-
raise TelegramError(
1498-
'editMessageCaption: Both chat_id and message_id are required when '
1497+
raise ValueError(
1498+
'edit_message_reply_markup: Both chat_id and message_id are required when '
14991499
'inline_message_id is not specified')
15001500

15011501
url = '{0}/editMessageReplyMarkup'.format(self.base_url)

0 commit comments

Comments
 (0)