Skip to content

Commit 54ed203

Browse files
committed
New methods setGameScore and getGameHighScores.
1 parent 1b76721 commit 54ed203

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

‎telebot/__init__.py‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,8 @@ def send_photo(self, chat_id, photo, caption=None, reply_to_message_id=None, rep
397397
apihelper.send_photo(self.token, chat_id, photo, caption, reply_to_message_id, reply_markup,
398398
disable_notification))
399399

400-
def send_audio(self, chat_id, audio, caption=None, duration=None, performer=None, title=None, reply_to_message_id=None,
400+
def send_audio(self, chat_id, audio, caption=None, duration=None, performer=None, title=None,
401+
reply_to_message_id=None,
401402
reply_markup=None, disable_notification=None, timeout=None):
402403
"""
403404
Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .mp3 format.
@@ -559,6 +560,20 @@ def send_game(self, chat_id, game_short_name, disable_notification=None, reply_t
559560
reply_markup)
560561
return types.Message.de_json(result)
561562

563+
def set_game_score(self, user_id, score, chat_id=None, message_id=None, inline_message_id=None, edit_message=None):
564+
result = apihelper.set_game_score(self.token, user_id, score, chat_id, message_id, inline_message_id,
565+
edit_message)
566+
if type(result) == bool:
567+
return result
568+
return types.Message.de_json(result)
569+
570+
def get_game_high_scores(self, user_id, chat_id=None, message_id=None, inline_message_id=None):
571+
result = apihelper.get_game_high_scores(self.token, user_id, chat_id, message_id, inline_message_id)
572+
ret = []
573+
for r in result:
574+
ret.append(types.GameHighScore.de_json(r))
575+
return ret
576+
562577
def edit_message_caption(self, caption, chat_id=None, message_id=None, inline_message_id=None, reply_markup=None):
563578
result = apihelper.edit_message_caption(self.token, caption, chat_id, message_id, inline_message_id,
564579
reply_markup)

0 commit comments

Comments
 (0)