mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-03-16 12:25:45 +01:00
setGameScore: fixes
- fix copy/paste errors - return Message object
This commit is contained in:
parent
34748ec228
commit
36192912c2
2 changed files with 10 additions and 4 deletions
|
@ -1517,6 +1517,12 @@ class Bot(TelegramObject):
|
|||
inline_message_id=None,
|
||||
edit_message=None,
|
||||
**kwargs):
|
||||
"""Use this method to set the score of the specified user in a game.
|
||||
|
||||
Returns:
|
||||
:class:`telegram.Message`: The edited message.
|
||||
|
||||
"""
|
||||
url = '{0}/setGameScore'.format(self.base_url)
|
||||
|
||||
data = {'user_id': user_id, 'score': score}
|
||||
|
@ -1524,15 +1530,14 @@ class Bot(TelegramObject):
|
|||
if chat_id:
|
||||
data['chat_id'] = chat_id
|
||||
if message_id:
|
||||
data['chat_id'] = chat_id
|
||||
data['message_id'] = message_id
|
||||
if inline_message_id:
|
||||
data['chat_id'] = inline_message_id
|
||||
data['inline_message_id'] = inline_message_id
|
||||
if edit_message:
|
||||
data['edit_message'] = edit_message
|
||||
|
||||
result = self._request.post(url, data, timeout=kwargs.get('timeout'))
|
||||
del result # To satisfy flake8
|
||||
# Help: Result is either Message or True or an error
|
||||
return Message.de_json(result, self)
|
||||
|
||||
def getGameHighScores(self,
|
||||
user_id,
|
||||
|
|
|
@ -42,6 +42,7 @@ class Game(TelegramObject):
|
|||
|
||||
Returns:
|
||||
telegram.Game:
|
||||
|
||||
"""
|
||||
if not data:
|
||||
return None
|
||||
|
|
Loading…
Add table
Reference in a new issue