Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Docs fix/add introductory paragraphs to subsections #4389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 27 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
fafed73
Added introductory paragraph to payments section
mohdyusuf2312 Jul 17, 2024
a4e1514
Added introductory paragraph to passport section
mohdyusuf2312 Jul 17, 2024
7d4e4fa
Added introductory paragraph to games section
mohdyusuf2312 Jul 17, 2024
07501df
Added introductory paragraph to inline mode section
mohdyusuf2312 Jul 17, 2024
15b50aa
Added introductory paragraph to stickers section
mohdyusuf2312 Jul 17, 2024
fb7ef67
Added introductory paragraph to available types section
mohdyusuf2312 Jul 17, 2024
3cffbe7
Add my name to AUTHORS.rst file
mohdyusuf2312 Jul 18, 2024
57912f2
Update .gitignore to exclude myenv/
mohdyusuf2312 Jul 18, 2024
def2d30
Remove the introductory paragraph that I mistakenly added to passport…
mohdyusuf2312 Jul 18, 2024
47724df
Added introductory paragraph to Passport section
mohdyusuf2312 Jul 18, 2024
3bc4095
Address maintainer feedback: revert unnecessary changes
mohdyusuf2312 Jul 18, 2024
7f5643b
Address maintainer feedback: revert unnecessary changes
mohdyusuf2312 Jul 18, 2024
e45e9a5
Update games section to use internal Sphinx links
mohdyusuf2312 Jul 18, 2024
ec86323
Update inline mode section to use internal Sphinx links
mohdyusuf2312 Jul 18, 2024
9b48b2c
Update payment section to use internal Sphinx links
mohdyusuf2312 Jul 18, 2024
65966ce
Update passport section to use internal Sphinx links
mohdyusuf2312 Jul 18, 2024
30f7637
Address maintainer feedback: Inline mode points to https://core.teleg…
mohdyusuf2312 Jul 22, 2024
a50f90e
Address maintainer feedback: Update documentation links
mohdyusuf2312 Jul 22, 2024
3ce6714
Address maintainer feedback: Update more about links that ponit to th…
mohdyusuf2312 Jul 22, 2024
05b423c
Merge branch 'master' into docs-fix/add-introductory-paragraphs-to-su…
mohdyusuf2312 Jul 22, 2024
ddf6af1
Address maintainer feedback: Update links
mohdyusuf2312 Jul 23, 2024
187f750
Merge branch 'docs-fix/add-introductory-paragraphs-to-subsections' of…
mohdyusuf2312 Jul 23, 2024
bc9afd3
Made inline mode section reference-able
mohdyusuf2312 Jul 23, 2024
429b6dc
Made payments section reference-able
mohdyusuf2312 Jul 23, 2024
787f775
Address maintainer feedback: these links works with sphinx referencin…
mohdyusuf2312 Jul 23, 2024
60510c1
Address maintainer feedback: these links works with sphinx referencin…
mohdyusuf2312 Jul 23, 2024
3e2a899
Fix to small issues in the game paragraph
Bibo-Joshi Jul 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ The following wonderful people contributed directly or indirectly to this projec
- `Miguel C. R. <https://github.com/MiguelX413>`_
- `miles <https://github.com/miles170>`_
- `Mischa Krüger <https://github.com/Makman2>`_
- `Mohd Yusuf <https://github.com/mohdyusuf2312>`_
- `naveenvhegde <https://github.com/naveenvhegde>`_
- `neurrone <https://github.com/neurrone>`_
- `NikitaPirate <https://github.com/NikitaPirate>`_
Expand Down
15 changes: 15 additions & 0 deletions docs/source/telegram.games-tree.rst
Original file line number Diff line number Diff line change
@@ -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 <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.

* 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 <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`.
* 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 <https://t.me/botfather>`_ (see `Lumberjack <https://t.me/gamebot?game=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 <https://t.me/gamebot>`_ and `@gamee <https://t.me/gamee>`_ bots.


.. toctree::
:titlesonly:

Expand Down
8 changes: 8 additions & 0 deletions docs/source/telegram.inline-tree.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
.. _inline-tree:

Inline Mode
-----------

The following methods and objects allow your bot to work in `inline mode <https://core.telegram.org/bots/inline>`_.
Please see Telegrams `Introduction to Inline bots <https://core.telegram.org/bots/inline>`_ for more details.

To enable this option, send the ``/setinline`` command to `@BotFather <https://t.me/botfather>`_ and provide the placeholder text that the user will see in the input field after typing your bot's name.


.. toctree::
:titlesonly:

Expand Down
3 changes: 3 additions & 0 deletions docs/source/telegram.passport-tree.rst
Original file line number Diff line number Diff line change
@@ -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 <https://core.telegram.org/passport>`_ for details.


.. toctree::
:titlesonly:

Expand Down
5 changes: 5 additions & 0 deletions docs/source/telegram.payments-tree.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
.. _payments-tree:

Payments
--------

Your bot can accept payments from Telegram users. Please see the `introduction to payments <https://core.telegram.org/bots/payments>`_ for more details on the process and how to set up payments for your bot.


.. toctree::
:titlesonly:

Expand Down
2 changes: 2 additions & 0 deletions docs/source/telegram.stickers-tree.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Stickers
--------

The following methods and objects allow your bot to handle stickers and sticker sets.

.. toctree::
:titlesonly:

Expand Down
12 changes: 6 additions & 6 deletions telegram/_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 >> <https://core.telegram.org/bots/api#games>`_.
:ref:`More about games >> <games-tree>`.
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.

Expand Down Expand Up @@ -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 >> <https://core.telegram.org/bots/api#payments>`_.
:ref:`More about payments >> <payments-tree>`.
successful_payment (:class:`telegram.SuccessfulPayment`, optional): Message is a service
message about a successful payment, information about the payment.
`More about payments >> <https://core.telegram.org/bots/api#payments>`_.
:ref:`More about payments >> <payments-tree>`.
connected_website (:obj:`str`, optional): The domain name of the website on which the user
has logged in.
`More about Telegram Login >> <https://core.telegram.org/widgets/login>`_.
Expand Down Expand Up @@ -676,7 +676,7 @@ class Message(MaybeInaccessibleMessage):

.. seealso:: :wiki:`Working with Files and Media <Working-with-Files-and-Media>`
game (:class:`telegram.Game`): Optional. Message is a game, information about the game.
`More about games >> <https://core.telegram.org/bots/api#games>`_.
:ref:`More about games >> <games-tree>`.
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.

Expand Down Expand Up @@ -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 >> <https://core.telegram.org/bots/api#payments>`_.
:ref:`More about payments >> <payments-tree>`.
successful_payment (:class:`telegram.SuccessfulPayment`): Optional. Message is a service
message about a successful payment, information about the payment.
`More about payments >> <https://core.telegram.org/bots/api#payments>`_.
:ref:`More about payments >> <payments-tree>`.
connected_website (:obj:`str`): Optional. The domain name of the website on which the user
has logged in.
`More about Telegram Login >> <https://core.telegram.org/widgets/login>`_.
Expand Down
10 changes: 4 additions & 6 deletions telegram/_reply.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 >> <https://core.telegram.org/bots/api#games>`_.
:ref:`More about games >> <games-tree>`.
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 >>
<https://core.telegram.org/bots/api#payments>`_.
information about the invoice. :ref:`More about payments >> <payments-tree>`.
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
Expand Down Expand Up @@ -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 >> <https://core.telegram.org/bots/api#games>`_.
:ref:`More about games >> <games-tree>`.
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 >>
<https://core.telegram.org/bots/api#payments>`_.
information about the invoice. :ref:`More about payments >> <payments-tree>`.
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
Expand Down
Loading