docs/source/telegram.games-tree.rst
.. _games-tree:
Your bot can offer users HTML5 games to play solo or to compete against each other in groups and one-on-one chats. Create games via @BotFather <https://telegram.me/BotFather>_ using the /newgame command. Please note that this kind of power requires responsibility: you will need to accept the terms for each game that your bots will be offering.
telegram.Game and :class:telegram.InlineQueryResultGame objects.BotFather <https://t.me/botfather>_, you can send games to chats as regular messages using the :meth:~telegram.Bot.sendGame method, or use :ref:inline mode <inline-tree> with :class:telegram.InlineQueryResultGame.GameName' button. When this button is pressed, your bot gets a :class:telegram.CallbackQuery with the game_short_name of the requested game. You provide the correct URL for this particular user and the app opens the game in the in-app browser.callback_game in :class:telegram.InlineKeyboardButton. You can add extra buttons according to taste: e.g., for a description of the rules, or to open the game's official community.BotFather <https://t.me/botfather>_ (see Lumberjack <https://t.me/gamebot?game=lumberjack>_ for example).~telegram.Bot.setGameScore to post high scores to the chat with the game, add the :paramref:~telegram.Bot.set_game_score.disable_edit_message parameter to disable automatic update of the message with the current scoreboard.~telegram.Bot.getGameHighScores to get data for in-game high score tables.@gamebot <https://t.me/gamebot>_ and @gamee <https://t.me/gamee>_ bots... toctree:: :titlesonly:
telegram.callbackgame
telegram.game
telegram.gamehighscore