From 1f9d3163dd52ca22f6982784767b19baf63e685e Mon Sep 17 00:00:00 2001 From: Noam Meltzer Date: Tue, 4 Oct 2016 02:13:24 +0300 Subject: [PATCH] Game: use explicit keyword args + added docmentation --- telegram/game.py | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/telegram/game.py b/telegram/game.py index ebfadf5c4..fd24e0c43 100644 --- a/telegram/game.py +++ b/telegram/game.py @@ -24,14 +24,40 @@ from telegram import MessageEntity, TelegramObject, Animation, PhotoSize class Game(TelegramObject): + """This object represents a Telegram Game. - def __init__(self, title, description, photo, **kwargs): + Attributes: + title (str): Title of the game. + description (str): Description of the game. + photo (list[:class:`telegram.PhotoSize`]): List of photos that will be displayed in the + game message in chats. + + Keyword Args: + text (Optional[str]): Brief description of the game or high scores included in the game + message. Can be automatically edited to include current high scores for the game when + the bot calls setGameScore, or manually edited using editMessageText. + 0-4096 characters. + text_entities (Optional[list[:class:`telegram.MessageEntity`]]): Special entities that + appear in text, such as usernames, URLs, bot commands, etc. + animation (Optional[:class:`telegram.Animation`]): Animation that will be displayed in the + game message in chats. Upload via BotFather. + + """ + + def __init__(self, + title, + description, + photo, + text=None, + text_entities=None, + animation=None, + **kwargs): self.title = title self.description = description self.photo = photo - self.text = kwargs.get('text') - self.text_entities = kwargs.get('text_entities') - self.animation = kwargs.get('animation') + self.text = text + self.text_entities = text_entities + self.animation = animation @staticmethod def de_json(data, bot):