Skip to content

Commit

Permalink
New methods setGameScore and getGameHighScores.
Browse files Browse the repository at this point in the history
  • Loading branch information
eternnoir committed Oct 29, 2016
1 parent 1b76721 commit 54ed203
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion telebot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,8 @@ def send_photo(self, chat_id, photo, caption=None, reply_to_message_id=None, rep
apihelper.send_photo(self.token, chat_id, photo, caption, reply_to_message_id, reply_markup,
disable_notification))

def send_audio(self, chat_id, audio, caption=None, duration=None, performer=None, title=None, reply_to_message_id=None,
def send_audio(self, chat_id, audio, caption=None, duration=None, performer=None, title=None,
reply_to_message_id=None,
reply_markup=None, disable_notification=None, timeout=None):
"""
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.
Expand Down Expand Up @@ -559,6 +560,20 @@ def send_game(self, chat_id, game_short_name, disable_notification=None, reply_t
reply_markup)
return types.Message.de_json(result)

def set_game_score(self, user_id, score, chat_id=None, message_id=None, inline_message_id=None, edit_message=None):
result = apihelper.set_game_score(self.token, user_id, score, chat_id, message_id, inline_message_id,
edit_message)
if type(result) == bool:
return result
return types.Message.de_json(result)

def get_game_high_scores(self, user_id, chat_id=None, message_id=None, inline_message_id=None):
result = apihelper.get_game_high_scores(self.token, user_id, chat_id, message_id, inline_message_id)
ret = []
for r in result:
ret.append(types.GameHighScore.de_json(r))
return ret

def edit_message_caption(self, caption, chat_id=None, message_id=None, inline_message_id=None, reply_markup=None):
result = apihelper.edit_message_caption(self.token, caption, chat_id, message_id, inline_message_id,
reply_markup)
Expand Down

0 comments on commit 54ed203

Please sign in to comment.