diff --git a/AUTHORS.rst b/AUTHORS.rst index 6dfff7c6733..e95a2b7a3f9 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -87,6 +87,7 @@ The following wonderful people contributed directly or indirectly to this projec - `Miguel C. R. `_ - `miles `_ - `Mischa Krüger `_ +- `Mohd Yusuf `_ - `naveenvhegde `_ - `neurrone `_ - `NikitaPirate `_ diff --git a/docs/source/telegram.games-tree.rst b/docs/source/telegram.games-tree.rst index 64f399d86a9..010c3c6d1fe 100644 --- a/docs/source/telegram.games-tree.rst +++ b/docs/source/telegram.games-tree.rst @@ -1,6 +1,21 @@ +.. _games-tree: + Games ----- +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 `_ 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. + +* Games are a new type of content on Telegram, represented by the :class:`telegram.Game` and :class:`telegram.InlineQueryResultGame` objects. +* Once you've created a game via `BotFather `_, you can send games to chats as regular messages using the :meth:`~telegram.Bot.sendGame` method, or use :ref:`inline mode ` with :class:`telegram.InlineQueryResultGame`. +* If you send the game message without any buttons, it will automatically have a 'Play ``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. +* You can manually add multiple buttons to your game message. Please note that the first button in the first row **must always** launch the game, using the field ``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. +* To make your game more attractive, you can upload a GIF animation that demonstrates the game to the users via `BotFather `_ (see `Lumberjack `_ for example). +* A game message will also display high scores for the current chat. Use :meth:`~telegram.Bot.setGameScore` to post high scores to the chat with the game, optionally add the :paramref:`~telegram.Bot.set_game_score.disable_edit_message` parameter if you don't want to automatically update the message with the current scoreboard. +* Use :meth:`~telegram.Bot.getGameHighScores` to get data for in-game high score tables. +* You can also add an extra sharing button for users to share their best score to different chats. +* For examples of what can be done using this new stuff, check the `@gamebot `_ and `@gamee `_ bots. + + .. toctree:: :titlesonly: diff --git a/docs/source/telegram.inline-tree.rst b/docs/source/telegram.inline-tree.rst index 7fa52a94b58..c187219e0f6 100644 --- a/docs/source/telegram.inline-tree.rst +++ b/docs/source/telegram.inline-tree.rst @@ -1,6 +1,14 @@ +.. _inline-tree: + Inline Mode ----------- +The following methods and objects allow your bot to work in `inline mode `_. +Please see Telegrams `Introduction to Inline bots `_ for more details. + +To enable this option, send the ``/setinline`` command to `@BotFather `_ and provide the placeholder text that the user will see in the input field after typing your bot's name. + + .. toctree:: :titlesonly: diff --git a/docs/source/telegram.passport-tree.rst b/docs/source/telegram.passport-tree.rst index fb4e3b4ffde..079ce948924 100644 --- a/docs/source/telegram.passport-tree.rst +++ b/docs/source/telegram.passport-tree.rst @@ -1,6 +1,9 @@ Passport -------- +Passport is a unified authorization method for services that require personal identification. Users can upload their documents once, then instantly share their data with services that require real-world ID (finance, ICOs, etc.). Please see the `manual `_ for details. + + .. toctree:: :titlesonly: diff --git a/docs/source/telegram.payments-tree.rst b/docs/source/telegram.payments-tree.rst index 0db0ba21959..ba4c838cae7 100644 --- a/docs/source/telegram.payments-tree.rst +++ b/docs/source/telegram.payments-tree.rst @@ -1,6 +1,11 @@ +.. _payments-tree: + Payments -------- +Your bot can accept payments from Telegram users. Please see the `introduction to payments `_ for more details on the process and how to set up payments for your bot. + + .. toctree:: :titlesonly: diff --git a/docs/source/telegram.stickers-tree.rst b/docs/source/telegram.stickers-tree.rst index 783b90ec0c7..2ea687183c0 100644 --- a/docs/source/telegram.stickers-tree.rst +++ b/docs/source/telegram.stickers-tree.rst @@ -1,6 +1,8 @@ Stickers -------- +The following methods and objects allow your bot to handle stickers and sticker sets. + .. toctree:: :titlesonly: diff --git a/telegram/_message.py b/telegram/_message.py index a705dc65934..d362e42f59f 100644 --- a/telegram/_message.py +++ b/telegram/_message.py @@ -359,7 +359,7 @@ class Message(MaybeInaccessibleMessage): about the animation. For backward compatibility, when this field is set, the document field will also be set. game (:class:`telegram.Game`, optional): Message is a game, information about the game. - `More about games >> `_. + :ref:`More about games >> `. photo (Sequence[:class:`telegram.PhotoSize`], optional): Message is a photo, available sizes of the photo. This list is empty if the message does not contain a photo. @@ -432,10 +432,10 @@ class Message(MaybeInaccessibleMessage): :class:`telegram.InaccessibleMessage`. invoice (:class:`telegram.Invoice`, optional): Message is an invoice for a payment, information about the invoice. - `More about payments >> `_. + :ref:`More about payments >> `. successful_payment (:class:`telegram.SuccessfulPayment`, optional): Message is a service message about a successful payment, information about the payment. - `More about payments >> `_. + :ref:`More about payments >> `. connected_website (:obj:`str`, optional): The domain name of the website on which the user has logged in. `More about Telegram Login >> `_. @@ -676,7 +676,7 @@ class Message(MaybeInaccessibleMessage): .. seealso:: :wiki:`Working with Files and Media ` game (:class:`telegram.Game`): Optional. Message is a game, information about the game. - `More about games >> `_. + :ref:`More about games >> `. photo (Tuple[:class:`telegram.PhotoSize`]): Optional. Message is a photo, available sizes of the photo. This list is empty if the message does not contain a photo. @@ -758,10 +758,10 @@ class Message(MaybeInaccessibleMessage): :class:`telegram.InaccessibleMessage`. invoice (:class:`telegram.Invoice`): Optional. Message is an invoice for a payment, information about the invoice. - `More about payments >> `_. + :ref:`More about payments >> `. successful_payment (:class:`telegram.SuccessfulPayment`): Optional. Message is a service message about a successful payment, information about the payment. - `More about payments >> `_. + :ref:`More about payments >> `. connected_website (:obj:`str`): Optional. The domain name of the website on which the user has logged in. `More about Telegram Login >> `_. diff --git a/telegram/_reply.py b/telegram/_reply.py index 0c15844c8d5..222e522a6a4 100644 --- a/telegram/_reply.py +++ b/telegram/_reply.py @@ -92,14 +92,13 @@ class ExternalReplyInfo(TelegramObject): about the contact. dice (:class:`telegram.Dice`, optional): Message is a dice with random value. game (:Class:`telegram.Game`. optional): Message is a game, information about the game. - `More about games >> `_. + :ref:`More about games >> `. giveaway (:class:`telegram.Giveaway`, optional): Message is a scheduled giveaway, information about the giveaway. giveaway_winners (:class:`telegram.GiveawayWinners`, optional): A giveaway with public winners was completed. invoice (:class:`telegram.Invoice`, optional): Message is an invoice for a payment, - information about the invoice. `More about payments >> - `_. + information about the invoice. :ref:`More about payments >> `. location (:class:`telegram.Location`, optional): Message is a shared location, information about the location. poll (:class:`telegram.Poll`, optional): Message is a native poll, information about the @@ -142,14 +141,13 @@ class ExternalReplyInfo(TelegramObject): about the contact. dice (:class:`telegram.Dice`): Optional. Message is a dice with random value. game (:Class:`telegram.Game`): Optional. Message is a game, information about the game. - `More about games >> `_. + :ref:`More about games >> `. giveaway (:class:`telegram.Giveaway`): Optional. Message is a scheduled giveaway, information about the giveaway. giveaway_winners (:class:`telegram.GiveawayWinners`): Optional. A giveaway with public winners was completed. invoice (:class:`telegram.Invoice`): Optional. Message is an invoice for a payment, - information about the invoice. `More about payments >> - `_. + information about the invoice. :ref:`More about payments >> `. location (:class:`telegram.Location`): Optional. Message is a shared location, information about the location. poll (:class:`telegram.Poll`): Optional. Message is a native poll, information about the