mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-03-30 19:28:20 +02:00
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com> Co-authored-by: Poolitzer <github@poolitzer.eu> Co-authored-by: Pawan <pawanrai9999@gmail.com> Co-authored-by: Aditya Yadav <69784758+aditya-yadav-27@users.noreply.github.com>
This commit is contained in:
parent
741a50ab97
commit
a983a89964
42 changed files with 420 additions and 186 deletions
|
@ -86,6 +86,7 @@ The following wonderful people contributed directly or indirectly to this projec
|
||||||
- `Paradox <https://github.com/paradox70>`_
|
- `Paradox <https://github.com/paradox70>`_
|
||||||
- `Patrick Hofmann <https://github.com/PH89>`_
|
- `Patrick Hofmann <https://github.com/PH89>`_
|
||||||
- `Paul Larsen <https://github.com/PaulSonOfLars>`_
|
- `Paul Larsen <https://github.com/PaulSonOfLars>`_
|
||||||
|
- `Pawan <https://github.com/pawanrai9999>`_
|
||||||
- `Pieter Schutz <https://github.com/eldinnie>`_
|
- `Pieter Schutz <https://github.com/eldinnie>`_
|
||||||
- `Piraty <https://github.com/piraty>`_
|
- `Piraty <https://github.com/piraty>`_
|
||||||
- `Poolitzer <https://github.com/Poolitzer>`_
|
- `Poolitzer <https://github.com/Poolitzer>`_
|
||||||
|
|
|
@ -49,7 +49,7 @@ this library, we introduced the
|
||||||
:class:`telegram.ext.ConversationHandler`
|
:class:`telegram.ext.ConversationHandler`
|
||||||
for that exact purpose. This example uses it to retrieve
|
for that exact purpose. This example uses it to retrieve
|
||||||
user-information in a conversation-like style. To get a better
|
user-information in a conversation-like style. To get a better
|
||||||
understanding, take a look at the :ref:`state diagrem <conversationbot-diagram>`.
|
understanding, take a look at the :ref:`state diagram <conversationbot-diagram>`.
|
||||||
|
|
||||||
:any:`examples.conversationbot2`
|
:any:`examples.conversationbot2`
|
||||||
--------------------------------
|
--------------------------------
|
||||||
|
|
7
docs/source/telegram.ext.acd-tree.rst
Normal file
7
docs/source/telegram.ext.acd-tree.rst
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
Arbitrary Callback Data
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
|
||||||
|
telegram.ext.callbackdatacache
|
||||||
|
telegram.ext.invalidcallbackdata
|
23
docs/source/telegram.ext.handlers-tree.rst
Normal file
23
docs/source/telegram.ext.handlers-tree.rst
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
Handlers
|
||||||
|
--------
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
|
||||||
|
telegram.ext.basehandler
|
||||||
|
telegram.ext.callbackqueryhandler
|
||||||
|
telegram.ext.chatjoinrequesthandler
|
||||||
|
telegram.ext.chatmemberhandler
|
||||||
|
telegram.ext.choseninlineresulthandler
|
||||||
|
telegram.ext.commandhandler
|
||||||
|
telegram.ext.conversationhandler
|
||||||
|
telegram.ext.filters
|
||||||
|
telegram.ext.inlinequeryhandler
|
||||||
|
telegram.ext.messagehandler
|
||||||
|
telegram.ext.pollanswerhandler
|
||||||
|
telegram.ext.pollhandler
|
||||||
|
telegram.ext.precheckoutqueryhandler
|
||||||
|
telegram.ext.prefixhandler
|
||||||
|
telegram.ext.shippingqueryhandler
|
||||||
|
telegram.ext.stringcommandhandler
|
||||||
|
telegram.ext.stringregexhandler
|
||||||
|
telegram.ext.typehandler
|
9
docs/source/telegram.ext.persistence-tree.rst
Normal file
9
docs/source/telegram.ext.persistence-tree.rst
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
Persistence
|
||||||
|
-----------
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
|
||||||
|
telegram.ext.basepersistence
|
||||||
|
telegram.ext.dictpersistence
|
||||||
|
telegram.ext.persistenceinput
|
||||||
|
telegram.ext.picklepersistence
|
7
docs/source/telegram.ext.rate-limiting-tree.rst
Normal file
7
docs/source/telegram.ext.rate-limiting-tree.rst
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
Rate Limiting
|
||||||
|
-------------
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
|
||||||
|
telegram.ext.baseratelimiter
|
||||||
|
telegram.ext.aioratelimiter
|
|
@ -13,53 +13,7 @@ telegram.ext package
|
||||||
telegram.ext.job
|
telegram.ext.job
|
||||||
telegram.ext.jobqueue
|
telegram.ext.jobqueue
|
||||||
telegram.ext.updater
|
telegram.ext.updater
|
||||||
|
telegram.ext.handlers-tree.rst
|
||||||
Handlers
|
telegram.ext.persistence-tree.rst
|
||||||
--------
|
telegram.ext.acd-tree.rst
|
||||||
|
telegram.ext.rate-limiting-tree.rst
|
||||||
.. toctree::
|
|
||||||
|
|
||||||
telegram.ext.basehandler
|
|
||||||
telegram.ext.callbackqueryhandler
|
|
||||||
telegram.ext.chatjoinrequesthandler
|
|
||||||
telegram.ext.chatmemberhandler
|
|
||||||
telegram.ext.choseninlineresulthandler
|
|
||||||
telegram.ext.commandhandler
|
|
||||||
telegram.ext.conversationhandler
|
|
||||||
telegram.ext.filters
|
|
||||||
telegram.ext.inlinequeryhandler
|
|
||||||
telegram.ext.messagehandler
|
|
||||||
telegram.ext.pollanswerhandler
|
|
||||||
telegram.ext.pollhandler
|
|
||||||
telegram.ext.precheckoutqueryhandler
|
|
||||||
telegram.ext.prefixhandler
|
|
||||||
telegram.ext.shippingqueryhandler
|
|
||||||
telegram.ext.stringcommandhandler
|
|
||||||
telegram.ext.stringregexhandler
|
|
||||||
telegram.ext.typehandler
|
|
||||||
|
|
||||||
Persistence
|
|
||||||
-----------
|
|
||||||
|
|
||||||
.. toctree::
|
|
||||||
|
|
||||||
telegram.ext.basepersistence
|
|
||||||
telegram.ext.dictpersistence
|
|
||||||
telegram.ext.persistenceinput
|
|
||||||
telegram.ext.picklepersistence
|
|
||||||
|
|
||||||
Arbitrary Callback Data
|
|
||||||
-----------------------
|
|
||||||
|
|
||||||
.. toctree::
|
|
||||||
|
|
||||||
telegram.ext.callbackdatacache
|
|
||||||
telegram.ext.invalidcallbackdata
|
|
||||||
|
|
||||||
Rate Limiting
|
|
||||||
-------------
|
|
||||||
|
|
||||||
.. toctree::
|
|
||||||
|
|
||||||
telegram.ext.baseratelimiter
|
|
||||||
telegram.ext.aioratelimiter
|
|
8
docs/source/telegram.games-tree.rst
Normal file
8
docs/source/telegram.games-tree.rst
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
Games
|
||||||
|
-----
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
|
||||||
|
telegram.callbackgame
|
||||||
|
telegram.game
|
||||||
|
telegram.gamehighscore
|
34
docs/source/telegram.inline-tree.rst
Normal file
34
docs/source/telegram.inline-tree.rst
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
Inline Mode
|
||||||
|
-----------
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
|
||||||
|
telegram.choseninlineresult
|
||||||
|
telegram.inlinequery
|
||||||
|
telegram.inlinequeryresult
|
||||||
|
telegram.inlinequeryresultarticle
|
||||||
|
telegram.inlinequeryresultaudio
|
||||||
|
telegram.inlinequeryresultcachedaudio
|
||||||
|
telegram.inlinequeryresultcacheddocument
|
||||||
|
telegram.inlinequeryresultcachedgif
|
||||||
|
telegram.inlinequeryresultcachedmpeg4gif
|
||||||
|
telegram.inlinequeryresultcachedphoto
|
||||||
|
telegram.inlinequeryresultcachedsticker
|
||||||
|
telegram.inlinequeryresultcachedvideo
|
||||||
|
telegram.inlinequeryresultcachedvoice
|
||||||
|
telegram.inlinequeryresultcontact
|
||||||
|
telegram.inlinequeryresultdocument
|
||||||
|
telegram.inlinequeryresultgame
|
||||||
|
telegram.inlinequeryresultgif
|
||||||
|
telegram.inlinequeryresultlocation
|
||||||
|
telegram.inlinequeryresultmpeg4gif
|
||||||
|
telegram.inlinequeryresultphoto
|
||||||
|
telegram.inlinequeryresultvenue
|
||||||
|
telegram.inlinequeryresultvideo
|
||||||
|
telegram.inlinequeryresultvoice
|
||||||
|
telegram.inputmessagecontent
|
||||||
|
telegram.inputtextmessagecontent
|
||||||
|
telegram.inputlocationmessagecontent
|
||||||
|
telegram.inputvenuemessagecontent
|
||||||
|
telegram.inputcontactmessagecontent
|
||||||
|
telegram.inputinvoicemessagecontent
|
27
docs/source/telegram.passport-tree.rst
Normal file
27
docs/source/telegram.passport-tree.rst
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
Passport
|
||||||
|
--------
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
|
||||||
|
telegram.credentials
|
||||||
|
telegram.datacredentials
|
||||||
|
telegram.encryptedcredentials
|
||||||
|
telegram.encryptedpassportelement
|
||||||
|
telegram.filecredentials
|
||||||
|
telegram.iddocumentdata
|
||||||
|
telegram.passportdata
|
||||||
|
telegram.passportelementerror
|
||||||
|
telegram.passportelementerrordatafield
|
||||||
|
telegram.passportelementerrorfile
|
||||||
|
telegram.passportelementerrorfiles
|
||||||
|
telegram.passportelementerrorfrontside
|
||||||
|
telegram.passportelementerrorreverseside
|
||||||
|
telegram.passportelementerrorselfie
|
||||||
|
telegram.passportelementerrortranslationfile
|
||||||
|
telegram.passportelementerrortranslationfiles
|
||||||
|
telegram.passportelementerrorunspecified
|
||||||
|
telegram.passportfile
|
||||||
|
telegram.personaldetails
|
||||||
|
telegram.residentialaddress
|
||||||
|
telegram.securedata
|
||||||
|
telegram.securevalue
|
13
docs/source/telegram.payments-tree.rst
Normal file
13
docs/source/telegram.payments-tree.rst
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
Payments
|
||||||
|
--------
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
|
||||||
|
telegram.invoice
|
||||||
|
telegram.labeledprice
|
||||||
|
telegram.orderinfo
|
||||||
|
telegram.precheckoutquery
|
||||||
|
telegram.shippingaddress
|
||||||
|
telegram.shippingoption
|
||||||
|
telegram.shippingquery
|
||||||
|
telegram.successfulpayment
|
|
@ -89,98 +89,9 @@ Available Types
|
||||||
telegram.webappdata
|
telegram.webappdata
|
||||||
telegram.webappinfo
|
telegram.webappinfo
|
||||||
telegram.webhookinfo
|
telegram.webhookinfo
|
||||||
|
telegram.stickers-tree.rst
|
||||||
|
telegram.inline-tree.rst
|
||||||
|
telegram.payments-tree.rst
|
||||||
|
telegram.games-tree.rst
|
||||||
|
telegram.passport-tree.rst
|
||||||
|
|
||||||
Stickers
|
|
||||||
--------
|
|
||||||
|
|
||||||
.. toctree::
|
|
||||||
|
|
||||||
telegram.maskposition
|
|
||||||
telegram.sticker
|
|
||||||
telegram.stickerset
|
|
||||||
|
|
||||||
Inline Mode
|
|
||||||
-----------
|
|
||||||
|
|
||||||
.. toctree::
|
|
||||||
|
|
||||||
telegram.choseninlineresult
|
|
||||||
telegram.inlinequery
|
|
||||||
telegram.inlinequeryresult
|
|
||||||
telegram.inlinequeryresultarticle
|
|
||||||
telegram.inlinequeryresultaudio
|
|
||||||
telegram.inlinequeryresultcachedaudio
|
|
||||||
telegram.inlinequeryresultcacheddocument
|
|
||||||
telegram.inlinequeryresultcachedgif
|
|
||||||
telegram.inlinequeryresultcachedmpeg4gif
|
|
||||||
telegram.inlinequeryresultcachedphoto
|
|
||||||
telegram.inlinequeryresultcachedsticker
|
|
||||||
telegram.inlinequeryresultcachedvideo
|
|
||||||
telegram.inlinequeryresultcachedvoice
|
|
||||||
telegram.inlinequeryresultcontact
|
|
||||||
telegram.inlinequeryresultdocument
|
|
||||||
telegram.inlinequeryresultgame
|
|
||||||
telegram.inlinequeryresultgif
|
|
||||||
telegram.inlinequeryresultlocation
|
|
||||||
telegram.inlinequeryresultmpeg4gif
|
|
||||||
telegram.inlinequeryresultphoto
|
|
||||||
telegram.inlinequeryresultvenue
|
|
||||||
telegram.inlinequeryresultvideo
|
|
||||||
telegram.inlinequeryresultvoice
|
|
||||||
telegram.inputmessagecontent
|
|
||||||
telegram.inputtextmessagecontent
|
|
||||||
telegram.inputlocationmessagecontent
|
|
||||||
telegram.inputvenuemessagecontent
|
|
||||||
telegram.inputcontactmessagecontent
|
|
||||||
telegram.inputinvoicemessagecontent
|
|
||||||
|
|
||||||
Payments
|
|
||||||
--------
|
|
||||||
|
|
||||||
.. toctree::
|
|
||||||
|
|
||||||
telegram.invoice
|
|
||||||
telegram.labeledprice
|
|
||||||
telegram.orderinfo
|
|
||||||
telegram.precheckoutquery
|
|
||||||
telegram.shippingaddress
|
|
||||||
telegram.shippingoption
|
|
||||||
telegram.shippingquery
|
|
||||||
telegram.successfulpayment
|
|
||||||
|
|
||||||
Games
|
|
||||||
-----
|
|
||||||
|
|
||||||
.. toctree::
|
|
||||||
|
|
||||||
telegram.callbackgame
|
|
||||||
telegram.game
|
|
||||||
telegram.gamehighscore
|
|
||||||
|
|
||||||
Passport
|
|
||||||
--------
|
|
||||||
|
|
||||||
.. toctree::
|
|
||||||
|
|
||||||
telegram.credentials
|
|
||||||
telegram.datacredentials
|
|
||||||
telegram.encryptedcredentials
|
|
||||||
telegram.encryptedpassportelement
|
|
||||||
telegram.filecredentials
|
|
||||||
telegram.iddocumentdata
|
|
||||||
telegram.passportdata
|
|
||||||
telegram.passportelementerror
|
|
||||||
telegram.passportelementerrordatafield
|
|
||||||
telegram.passportelementerrorfile
|
|
||||||
telegram.passportelementerrorfiles
|
|
||||||
telegram.passportelementerrorfrontside
|
|
||||||
telegram.passportelementerrorreverseside
|
|
||||||
telegram.passportelementerrorselfie
|
|
||||||
telegram.passportelementerrortranslationfile
|
|
||||||
telegram.passportelementerrortranslationfiles
|
|
||||||
telegram.passportelementerrorunspecified
|
|
||||||
telegram.passportfile
|
|
||||||
telegram.personaldetails
|
|
||||||
telegram.residentialaddress
|
|
||||||
telegram.securedata
|
|
||||||
telegram.securevalue
|
|
||||||
|
|
8
docs/source/telegram.stickers-tree.rst
Normal file
8
docs/source/telegram.stickers-tree.rst
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
Stickers
|
||||||
|
--------
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
|
||||||
|
telegram.maskposition
|
||||||
|
telegram.sticker
|
||||||
|
telegram.stickerset
|
191
telegram/_bot.py
191
telegram/_bot.py
|
@ -139,6 +139,10 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
serialized instance will not reflect that change. Trying to pickle a bot instance will
|
serialized instance will not reflect that change. Trying to pickle a bot instance will
|
||||||
raise :exc:`pickle.PicklingError`.
|
raise :exc:`pickle.PicklingError`.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.ext.Application.bot`,
|
||||||
|
:attr:`telegram.ext.CallbackContext.bot`,
|
||||||
|
:attr:`telegram.ext.Updater.bot`
|
||||||
|
|
||||||
.. versionadded:: 13.2
|
.. versionadded:: 13.2
|
||||||
Objects of this class are comparable in terms of equality. Two objects of this class are
|
Objects of this class are comparable in terms of equality. Two objects of this class are
|
||||||
considered equal, if their :attr:`bot` is equal.
|
considered equal, if their :attr:`bot` is equal.
|
||||||
|
@ -590,6 +594,9 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
) -> Message:
|
) -> Message:
|
||||||
"""Use this method to send text messages.
|
"""Use this method to send text messages.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Message.reply_text`, :attr:`telegram.Chat.send_message`,
|
||||||
|
:attr:`telegram.User.send_message`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
||||||
of the target channel (in the format ``@channelusername``).
|
of the target channel (in the format ``@channelusername``).
|
||||||
|
@ -694,6 +701,9 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
- If the bot has :attr:`~telegram.ChatMemberAdministrator.can_delete_messages`
|
- If the bot has :attr:`~telegram.ChatMemberAdministrator.can_delete_messages`
|
||||||
permission in a supergroup or a channel, it can delete any message there.
|
permission in a supergroup or a channel, it can delete any message there.
|
||||||
|
|
||||||
|
.. seealso:: :meth:`telegram.Message.delete`,
|
||||||
|
:meth:`telegram.CallbackQuery.delete_message`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
||||||
of the target channel (in the format ``@channelusername``).
|
of the target channel (in the format ``@channelusername``).
|
||||||
|
@ -760,6 +770,9 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
As a workaround, it is still possible to use :meth:`copy_message`. However, this
|
As a workaround, it is still possible to use :meth:`copy_message`. However, this
|
||||||
behaviour is undocumented and might be changed by Telegram.
|
behaviour is undocumented and might be changed by Telegram.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Message.forward`, :attr:`telegram.Chat.forward_to`,
|
||||||
|
:attr:`telegram.Chat.forward_from`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
||||||
of the target channel (in the format ``@channelusername``).
|
of the target channel (in the format ``@channelusername``).
|
||||||
|
@ -842,6 +855,9 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
The photo argument can be either a file_id, an URL or a file from disk
|
The photo argument can be either a file_id, an URL or a file from disk
|
||||||
``open(filename, 'rb')``
|
``open(filename, 'rb')``
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Message.reply_photo`, :attr:`telegram.Chat.send_photo`,
|
||||||
|
:attr:`telegram.User.send_photo`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
||||||
of the target channel (in the format ``@channelusername``).
|
of the target channel (in the format ``@channelusername``).
|
||||||
|
@ -972,6 +988,9 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
The audio argument can be either a file_id, an URL or a file from disk
|
The audio argument can be either a file_id, an URL or a file from disk
|
||||||
``open(filename, 'rb')``
|
``open(filename, 'rb')``
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Message.reply_audio`, :attr:`telegram.Chat.send_audio`,
|
||||||
|
:attr:`telegram.User.send_audio`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
||||||
of the target channel (in the format ``@channelusername``).
|
of the target channel (in the format ``@channelusername``).
|
||||||
|
@ -1119,6 +1138,9 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
|
|
||||||
* Sending by URL will currently only work ``GIF``, ``PDF`` & ``ZIP`` files.
|
* Sending by URL will currently only work ``GIF``, ``PDF`` & ``ZIP`` files.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Message.reply_document`, :attr:`telegram.Chat.send_document`,
|
||||||
|
:attr:`telegram.User.send_document`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
||||||
of the target channel (in the format ``@channelusername``).
|
of the target channel (in the format ``@channelusername``).
|
||||||
|
@ -1247,6 +1269,9 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
The :paramref:`sticker` argument can be either a file_id, an URL or a file from disk
|
The :paramref:`sticker` argument can be either a file_id, an URL or a file from disk
|
||||||
``open(filename, 'rb')``
|
``open(filename, 'rb')``
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Message.reply_sticker`, :attr:`telegram.Chat.send_sticker`,
|
||||||
|
:attr:`telegram.User.send_sticker`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
||||||
of the target channel (in the format ``@channelusername``).
|
of the target channel (in the format ``@channelusername``).
|
||||||
|
@ -1354,6 +1379,9 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
easily generate thumbnails. However, this behaviour is undocumented and might be
|
easily generate thumbnails. However, this behaviour is undocumented and might be
|
||||||
changed by Telegram.
|
changed by Telegram.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Message.reply_video`, :attr:`telegram.Chat.send_video`,
|
||||||
|
:attr:`telegram.User.send_video`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
||||||
of the target channel (in the format ``@channelusername``).
|
of the target channel (in the format ``@channelusername``).
|
||||||
|
@ -1500,6 +1528,10 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
easily generate thumbnails. However, this behaviour is undocumented and might be
|
easily generate thumbnails. However, this behaviour is undocumented and might be
|
||||||
changed by Telegram.
|
changed by Telegram.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Message.reply_video_note`,
|
||||||
|
:attr:`telegram.Chat.send_video_note`,
|
||||||
|
:attr:`telegram.User.send_video_note`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
||||||
of the target channel (in the format ``@channelusername``).
|
of the target channel (in the format ``@channelusername``).
|
||||||
|
@ -1630,6 +1662,10 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
generate thumb nails. However, this behaviour is undocumented and might be changed
|
generate thumb nails. However, this behaviour is undocumented and might be changed
|
||||||
by Telegram.
|
by Telegram.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Message.reply_animation`,
|
||||||
|
:attr:`telegram.Chat.send_animation`,
|
||||||
|
:attr:`telegram.User.send_animation`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
||||||
of the target channel (in the format ``@channelusername``).
|
of the target channel (in the format ``@channelusername``).
|
||||||
|
@ -1777,6 +1813,9 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
* To use this method, the file must have the type :mimetype:`audio/ogg` and be no more
|
* To use this method, the file must have the type :mimetype:`audio/ogg` and be no more
|
||||||
than ``1MB`` in size. ``1-20MB`` voice notes will be sent as files.
|
than ``1MB`` in size. ``1-20MB`` voice notes will be sent as files.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Message.reply_voice`, :attr:`telegram.Chat.send_voice`,
|
||||||
|
:attr:`telegram.User.send_voice`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
||||||
of the target channel (in the format ``@channelusername``).
|
of the target channel (in the format ``@channelusername``).
|
||||||
|
@ -1891,6 +1930,10 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
) -> List[Message]:
|
) -> List[Message]:
|
||||||
"""Use this method to send a group of photos or videos as an album.
|
"""Use this method to send a group of photos or videos as an album.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Message.reply_media_group`,
|
||||||
|
:attr:`telegram.Chat.send_media_group`,
|
||||||
|
:attr:`telegram.User.send_media_group`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
||||||
of the target channel (in the format ``@channelusername``).
|
of the target channel (in the format ``@channelusername``).
|
||||||
|
@ -1982,6 +2025,9 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
You can either supply a :paramref:`latitude` and :paramref:`longitude` or a
|
You can either supply a :paramref:`latitude` and :paramref:`longitude` or a
|
||||||
:paramref:`location`.
|
:paramref:`location`.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Message.reply_location`, :attr:`telegram.Chat.send_location`,
|
||||||
|
:attr:`telegram.User.send_location`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
||||||
of the target channel (in the format ``@channelusername``).
|
of the target channel (in the format ``@channelusername``).
|
||||||
|
@ -2106,6 +2152,9 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
You can either supply a :paramref:`latitude` and :paramref:`longitude` or a
|
You can either supply a :paramref:`latitude` and :paramref:`longitude` or a
|
||||||
:paramref:`location`.
|
:paramref:`location`.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Message.edit_live_location`,
|
||||||
|
:attr:`telegram.CallbackQuery.edit_message_live_location`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`, optional): Required if inline_message_id is not
|
chat_id (:obj:`int` | :obj:`str`, optional): Required if inline_message_id is not
|
||||||
specified. Unique identifier for the target chat or username of the target channel
|
specified. Unique identifier for the target chat or username of the target channel
|
||||||
|
@ -2206,6 +2255,9 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
"""Use this method to stop updating a live location message sent by the bot or via the bot
|
"""Use this method to stop updating a live location message sent by the bot or via the bot
|
||||||
(for inline bots) before live_period expires.
|
(for inline bots) before live_period expires.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Message.stop_live_location`
|
||||||
|
:attr:`telegram.CallbackQuery.stop_message_live_location`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Required if inline_message_id is not specified.
|
chat_id (:obj:`int` | :obj:`str`): Required if inline_message_id is not specified.
|
||||||
Unique identifier for the target chat or username of the target channel
|
Unique identifier for the target chat or username of the target channel
|
||||||
|
@ -2292,6 +2344,9 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
* Foursquare details and Google Place details are mutually exclusive. However, this
|
* Foursquare details and Google Place details are mutually exclusive. However, this
|
||||||
behaviour is undocumented and might be changed by Telegram.
|
behaviour is undocumented and might be changed by Telegram.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Message.reply_venue`, :attr:`telegram.Chat.send_venue`,
|
||||||
|
:attr:`telegram.User.send_venue`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
||||||
of the target channel (in the format ``@channelusername``).
|
of the target channel (in the format ``@channelusername``).
|
||||||
|
@ -2430,6 +2485,9 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
:paramref:`first_name` with optionally :paramref:`last_name` and optionally
|
:paramref:`first_name` with optionally :paramref:`last_name` and optionally
|
||||||
:paramref:`vcard`.
|
:paramref:`vcard`.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Message.reply_contact`, :attr:`telegram.Chat.send_contact`,
|
||||||
|
:attr:`telegram.User.send_contact`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
||||||
of the target channel (in the format ``@channelusername``).
|
of the target channel (in the format ``@channelusername``).
|
||||||
|
@ -2541,6 +2599,9 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
) -> Message:
|
) -> Message:
|
||||||
"""Use this method to send a game.
|
"""Use this method to send a game.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Message.reply_game`, :attr:`telegram.Chat.send_game`,
|
||||||
|
:attr:`telegram.User.send_game`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat.
|
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat.
|
||||||
game_short_name (:obj:`str`): Short name of the game, serves as the unique identifier
|
game_short_name (:obj:`str`): Short name of the game, serves as the unique identifier
|
||||||
|
@ -2618,6 +2679,9 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
Telegram clients clear its typing status). Telegram only recommends using this method when
|
Telegram clients clear its typing status). Telegram only recommends using this method when
|
||||||
a response from the bot will take a noticeable amount of time to arrive.
|
a response from the bot will take a noticeable amount of time to arrive.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Message.reply_chat_action`, :attr:`telegram.Chat.send_action`,
|
||||||
|
:attr:`telegram.User.send_chat_action`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
||||||
of the target channel (in the format ``@channelusername``).
|
of the target channel (in the format ``@channelusername``).
|
||||||
|
@ -2767,6 +2831,8 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
:paramref:`telegram.InlineQuery.answer.auto_pagination` set to :obj:`True`, which will
|
:paramref:`telegram.InlineQuery.answer.auto_pagination` set to :obj:`True`, which will
|
||||||
take care of passing the correct value.
|
take care of passing the correct value.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.InlineQuery.answer`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
inline_query_id (:obj:`str`): Unique identifier for the answered query.
|
inline_query_id (:obj:`str`): Unique identifier for the answered query.
|
||||||
results (List[:class:`telegram.InlineQueryResult`] | Callable): A list of results for
|
results (List[:class:`telegram.InlineQueryResult`] | Callable): A list of results for
|
||||||
|
@ -2874,6 +2940,8 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
) -> UserProfilePhotos:
|
) -> UserProfilePhotos:
|
||||||
"""Use this method to get a list of profile pictures for a user.
|
"""Use this method to get a list of profile pictures for a user.
|
||||||
|
|
||||||
|
.. seealso:: :meth:`telegram.User.get_profile_photos`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
user_id (:obj:`int`): Unique identifier of the target user.
|
user_id (:obj:`int`): Unique identifier of the target user.
|
||||||
offset (:obj:`int`, optional): Sequential number of the first photo to be returned.
|
offset (:obj:`int`, optional): Sequential number of the first photo to be returned.
|
||||||
|
@ -3028,6 +3096,8 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
using invite links, etc., unless unbanned first. The bot must be an administrator in the
|
using invite links, etc., unless unbanned first. The bot must be an administrator in the
|
||||||
chat for this to work and must have the appropriate admin rights.
|
chat for this to work and must have the appropriate admin rights.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Chat.ban_member`
|
||||||
|
|
||||||
.. versionadded:: 13.7
|
.. versionadded:: 13.7
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
@ -3109,6 +3179,8 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
their channels**. The bot must be an administrator in the supergroup or channel for this
|
their channels**. The bot must be an administrator in the supergroup or channel for this
|
||||||
to work and must have the appropriate administrator rights.
|
to work and must have the appropriate administrator rights.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Chat.ban_chat`, :attr:`telegram.Chat.ban_sender_chat`
|
||||||
|
|
||||||
.. versionadded:: 13.9
|
.. versionadded:: 13.9
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
@ -3174,6 +3246,8 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
join it. So if the user is a member of the chat they will also be *removed* from the chat.
|
join it. So if the user is a member of the chat they will also be *removed* from the chat.
|
||||||
If you don't want this, use the parameter :paramref:`only_if_banned`.
|
If you don't want this, use the parameter :paramref:`only_if_banned`.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Chat.unban_member`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
||||||
of the target supergroup or channel (in the format ``@channelusername``).
|
of the target supergroup or channel (in the format ``@channelusername``).
|
||||||
|
@ -3236,6 +3310,8 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
The bot must be an administrator for this to work and must have the
|
The bot must be an administrator for this to work and must have the
|
||||||
appropriate administrator rights.
|
appropriate administrator rights.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Chat.unban_chat`
|
||||||
|
|
||||||
.. versionadded:: 13.9
|
.. versionadded:: 13.9
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
@ -3304,6 +3380,8 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
and accept the terms. Otherwise, you may use links like t.me/your_bot?start=XXXX that open
|
and accept the terms. Otherwise, you may use links like t.me/your_bot?start=XXXX that open
|
||||||
your bot with a parameter.
|
your bot with a parameter.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.CallbackQuery.answer`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
callback_query_id (:obj:`str`): Unique identifier for the query to be answered.
|
callback_query_id (:obj:`str`): Unique identifier for the query to be answered.
|
||||||
text (:obj:`str`, optional): Text of the notification. If not specified, nothing will
|
text (:obj:`str`, optional): Text of the notification. If not specified, nothing will
|
||||||
|
@ -3392,6 +3470,9 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
It is currently only possible to edit messages without
|
It is currently only possible to edit messages without
|
||||||
:attr:`telegram.Message.reply_markup` or with inline keyboards.
|
:attr:`telegram.Message.reply_markup` or with inline keyboards.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Message.edit_text`,
|
||||||
|
:attr:`telegram.CallbackQuery.edit_message_text`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`, optional): Required if inline_message_id is not
|
chat_id (:obj:`int` | :obj:`str`, optional): Required if inline_message_id is not
|
||||||
specified. Unique identifier for the target chat or username of the target channel
|
specified. Unique identifier for the target chat or username of the target channel
|
||||||
|
@ -3488,6 +3569,9 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
It is currently only possible to edit messages without
|
It is currently only possible to edit messages without
|
||||||
:attr:`telegram.Message.reply_markup` or with inline keyboards
|
:attr:`telegram.Message.reply_markup` or with inline keyboards
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Message.edit_caption`,
|
||||||
|
:attr:`telegram.CallbackQuery.edit_message_caption`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`, optional): Required if inline_message_id is not
|
chat_id (:obj:`int` | :obj:`str`, optional): Required if inline_message_id is not
|
||||||
specified. Unique identifier for the target chat or username of the target channel
|
specified. Unique identifier for the target chat or username of the target channel
|
||||||
|
@ -3582,6 +3666,9 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
It is currently only possible to edit messages without
|
It is currently only possible to edit messages without
|
||||||
:attr:`telegram.Message.reply_markup` or with inline keyboards
|
:attr:`telegram.Message.reply_markup` or with inline keyboards
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Message.edit_media`,
|
||||||
|
:attr:`telegram.CallbackQuery.edit_message_media`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
media (:class:`telegram.InputMedia`): An object for a new media content
|
media (:class:`telegram.InputMedia`): An object for a new media content
|
||||||
of the message.
|
of the message.
|
||||||
|
@ -3660,6 +3747,9 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
It is currently only possible to edit messages without
|
It is currently only possible to edit messages without
|
||||||
:attr:`telegram.Message.reply_markup` or with inline keyboards
|
:attr:`telegram.Message.reply_markup` or with inline keyboards
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Message.edit_reply_markup`,
|
||||||
|
:attr:`telegram.CallbackQuery.edit_message_reply_markup`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`, optional): Required if inline_message_id is not
|
chat_id (:obj:`int` | :obj:`str`, optional): Required if inline_message_id is not
|
||||||
specified. Unique identifier for the target chat or username of the target channel
|
specified. Unique identifier for the target chat or username of the target channel
|
||||||
|
@ -4016,6 +4106,8 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
) -> bool:
|
) -> bool:
|
||||||
"""Use this method for your bot to leave a group, supergroup or channel.
|
"""Use this method for your bot to leave a group, supergroup or channel.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Chat.leave`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
||||||
of the target supergroup or channel (in the format ``@channelusername``).
|
of the target supergroup or channel (in the format ``@channelusername``).
|
||||||
|
@ -4127,6 +4219,8 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
"""
|
"""
|
||||||
Use this method to get a list of administrators in a chat.
|
Use this method to get a list of administrators in a chat.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Chat.get_administrators`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
||||||
of the target supergroup or channel (in the format ``@channelusername``).
|
of the target supergroup or channel (in the format ``@channelusername``).
|
||||||
|
@ -4182,6 +4276,8 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
) -> int:
|
) -> int:
|
||||||
"""Use this method to get the number of members in a chat.
|
"""Use this method to get the number of members in a chat.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Chat.get_member_count`
|
||||||
|
|
||||||
.. versionadded:: 13.7
|
.. versionadded:: 13.7
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
@ -4237,6 +4333,8 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
) -> ChatMember:
|
) -> ChatMember:
|
||||||
"""Use this method to get information about a member of a chat.
|
"""Use this method to get information about a member of a chat.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Chat.get_member`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
||||||
of the target supergroup or channel (in the format ``@channelusername``).
|
of the target supergroup or channel (in the format ``@channelusername``).
|
||||||
|
@ -4447,6 +4545,8 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
"""
|
"""
|
||||||
Use this method to set the score of the specified user in a game message.
|
Use this method to set the score of the specified user in a game message.
|
||||||
|
|
||||||
|
.. seealso::`telegram.CallbackQuery.set_game_score`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
user_id (:obj:`int`): User identifier.
|
user_id (:obj:`int`): User identifier.
|
||||||
score (:obj:`int`): New score, must be non-negative.
|
score (:obj:`int`): New score, must be non-negative.
|
||||||
|
@ -4532,6 +4632,8 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
closest neighbors on each side. Will also return the top three users if the user and
|
closest neighbors on each side. Will also return the top three users if the user and
|
||||||
his neighbors are not among them. Please note that this behavior is subject to change.
|
his neighbors are not among them. Please note that this behavior is subject to change.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.CallbackQuery.get_game_high_scores`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
user_id (:obj:`int`): Target user id.
|
user_id (:obj:`int`): Target user id.
|
||||||
chat_id (:obj:`int` | :obj:`str`, optional): Required if inline_message_id is not
|
chat_id (:obj:`int` | :obj:`str`, optional): Required if inline_message_id is not
|
||||||
|
@ -4629,6 +4731,9 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
order of the arguments had to be changed. Use keyword arguments to make sure that the
|
order of the arguments had to be changed. Use keyword arguments to make sure that the
|
||||||
arguments are passed correctly.
|
arguments are passed correctly.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Message.reply_invoice`, :attr:`telegram.Chat.send_invoice`,
|
||||||
|
:attr:`telegram.User.send_invoice`
|
||||||
|
|
||||||
.. versionchanged:: 13.5
|
.. versionchanged:: 13.5
|
||||||
As of Bot API 5.2, the parameter :paramref:`start_parameter` is optional.
|
As of Bot API 5.2, the parameter :paramref:`start_parameter` is optional.
|
||||||
|
|
||||||
|
@ -4812,6 +4917,8 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
:class:`telegram.Update` with a :attr:`telegram.Update.shipping_query` field to the bot.
|
:class:`telegram.Update` with a :attr:`telegram.Update.shipping_query` field to the bot.
|
||||||
Use this method to reply to shipping queries.
|
Use this method to reply to shipping queries.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.ShippingQuery.answer`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
shipping_query_id (:obj:`str`): Unique identifier for the query to be answered.
|
shipping_query_id (:obj:`str`): Unique identifier for the query to be answered.
|
||||||
ok (:obj:`bool`): Specify :obj:`True` if delivery to the specified address is possible
|
ok (:obj:`bool`): Specify :obj:`True` if delivery to the specified address is possible
|
||||||
|
@ -4889,6 +4996,8 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
The Bot API must receive an answer within 10 seconds after the pre-checkout
|
The Bot API must receive an answer within 10 seconds after the pre-checkout
|
||||||
query was sent.
|
query was sent.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.PreCheckoutQuery.answer`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
pre_checkout_query_id (:obj:`str`): Unique identifier for the query to be answered.
|
pre_checkout_query_id (:obj:`str`): Unique identifier for the query to be answered.
|
||||||
ok (:obj:`bool`): Specify :obj:`True` if everything is alright
|
ok (:obj:`bool`): Specify :obj:`True` if everything is alright
|
||||||
|
@ -5019,7 +5128,8 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
the supergroup for this to work and must have the appropriate admin rights. Pass
|
the supergroup for this to work and must have the appropriate admin rights. Pass
|
||||||
:obj:`True` for all boolean parameters to lift restrictions from a user.
|
:obj:`True` for all boolean parameters to lift restrictions from a user.
|
||||||
|
|
||||||
.. seealso:: :meth:`telegram.ChatPermissions.all_permissions`
|
.. seealso:: :meth:`telegram.ChatPermissions.all_permissions`,
|
||||||
|
:attr:`telegram.Chat.restrict_member`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
||||||
|
@ -5106,6 +5216,8 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
an administrator in the chat for this to work and must have the appropriate admin rights.
|
an administrator in the chat for this to work and must have the appropriate admin rights.
|
||||||
Pass :obj:`False` for all boolean parameters to demote a user.
|
Pass :obj:`False` for all boolean parameters to demote a user.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Chat.promote_member`
|
||||||
|
|
||||||
.. versionchanged:: 20.0
|
.. versionchanged:: 20.0
|
||||||
The argument ``can_manage_voice_chats`` was renamed to
|
The argument ``can_manage_voice_chats`` was renamed to
|
||||||
:paramref:`can_manage_video_chats` in accordance to Bot API 6.0.
|
:paramref:`can_manage_video_chats` in accordance to Bot API 6.0.
|
||||||
|
@ -5224,6 +5336,8 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
administrator in the group or a supergroup for this to work and must have the
|
administrator in the group or a supergroup for this to work and must have the
|
||||||
:attr:`telegram.ChatMemberAdministrator.can_restrict_members` admin rights.
|
:attr:`telegram.ChatMemberAdministrator.can_restrict_members` admin rights.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Chat.set_permissions`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username of
|
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username of
|
||||||
the target supergroup (in the format `@supergroupusername`).
|
the target supergroup (in the format `@supergroupusername`).
|
||||||
|
@ -5281,6 +5395,8 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
Use this method to set a custom title for administrators promoted by the bot in a
|
Use this method to set a custom title for administrators promoted by the bot in a
|
||||||
supergroup. The bot must be an administrator for this to work.
|
supergroup. The bot must be an administrator for this to work.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Chat.set_administrator_custom_title`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username of
|
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username of
|
||||||
the target supergroup (in the format `@supergroupusername`).
|
the target supergroup (in the format `@supergroupusername`).
|
||||||
|
@ -5341,6 +5457,8 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
link is revoked. The bot must be an administrator in the chat for this to work and must
|
link is revoked. The bot must be an administrator in the chat for this to work and must
|
||||||
have the appropriate admin rights.
|
have the appropriate admin rights.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Chat.export_invite_link`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
||||||
of the target channel (in the format ``@channelusername``).
|
of the target channel (in the format ``@channelusername``).
|
||||||
|
@ -5407,6 +5525,8 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
administrator in the chat for this to work and must have the appropriate admin rights.
|
administrator in the chat for this to work and must have the appropriate admin rights.
|
||||||
The link can be revoked using the method :meth:`revoke_chat_invite_link`.
|
The link can be revoked using the method :meth:`revoke_chat_invite_link`.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Chat.create_invite_link`
|
||||||
|
|
||||||
.. versionadded:: 13.4
|
.. versionadded:: 13.4
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
@ -5505,6 +5625,8 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
parameters to the default values. However, since not documented, this behaviour may
|
parameters to the default values. However, since not documented, this behaviour may
|
||||||
change unbeknown to PTB.
|
change unbeknown to PTB.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Chat.edit_invite_link`
|
||||||
|
|
||||||
.. versionadded:: 13.4
|
.. versionadded:: 13.4
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
@ -5599,6 +5721,8 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
revoked, a new link is automatically generated. The bot must be an administrator in the
|
revoked, a new link is automatically generated. The bot must be an administrator in the
|
||||||
chat for this to work and must have the appropriate admin rights.
|
chat for this to work and must have the appropriate admin rights.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Chat.revoke_invite_link`
|
||||||
|
|
||||||
.. versionadded:: 13.4
|
.. versionadded:: 13.4
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
@ -5664,6 +5788,9 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
The bot must be an administrator in the chat for this to work and must have the
|
The bot must be an administrator in the chat for this to work and must have the
|
||||||
:attr:`telegram.ChatPermissions.can_invite_users` administrator right.
|
:attr:`telegram.ChatPermissions.can_invite_users` administrator right.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Chat.approve_join_request`,
|
||||||
|
:attr:`telegram.ChatJoinRequest.approve`, :attr:`telegram.User.approve_join_request`
|
||||||
|
|
||||||
.. versionadded:: 13.8
|
.. versionadded:: 13.8
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
@ -5724,6 +5851,9 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
The bot must be an administrator in the chat for this to work and must have the
|
The bot must be an administrator in the chat for this to work and must have the
|
||||||
:attr:`telegram.ChatPermissions.can_invite_users` administrator right.
|
:attr:`telegram.ChatPermissions.can_invite_users` administrator right.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Chat.decline_join_request`,
|
||||||
|
:attr:`telegram.ChatJoinRequest.decline`, :attr:`telegram.User.decline_join_request`
|
||||||
|
|
||||||
.. versionadded:: 13.8
|
.. versionadded:: 13.8
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
@ -5784,6 +5914,8 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
Photos can't be changed for private chats. The bot must be an administrator in the chat
|
Photos can't be changed for private chats. The bot must be an administrator in the chat
|
||||||
for this to work and must have the appropriate admin rights.
|
for this to work and must have the appropriate admin rights.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Chat.set_photo`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
||||||
of the target channel (in the format ``@channelusername``).
|
of the target channel (in the format ``@channelusername``).
|
||||||
|
@ -5843,6 +5975,8 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
must be an administrator in the chat for this to work and must have the appropriate admin
|
must be an administrator in the chat for this to work and must have the appropriate admin
|
||||||
rights.
|
rights.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Chat.delete_photo`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
||||||
of the target channel (in the format ``@channelusername``).
|
of the target channel (in the format ``@channelusername``).
|
||||||
|
@ -5899,6 +6033,8 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
The bot must be an administrator in the chat for this to work and must have the appropriate
|
The bot must be an administrator in the chat for this to work and must have the appropriate
|
||||||
admin rights.
|
admin rights.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Chat.set_title`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
||||||
of the target channel (in the format ``@channelusername``).
|
of the target channel (in the format ``@channelusername``).
|
||||||
|
@ -5956,6 +6092,8 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
must be an administrator in the chat for this to work and must have the appropriate admin
|
must be an administrator in the chat for this to work and must have the appropriate admin
|
||||||
rights.
|
rights.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Chat.set_description`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
||||||
of the target channel (in the format ``@channelusername``).
|
of the target channel (in the format ``@channelusername``).
|
||||||
|
@ -6019,6 +6157,8 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
right in a supergroup or :attr:`~telegram.ChatMemberAdministrator.can_edit_messages` admin
|
right in a supergroup or :attr:`~telegram.ChatMemberAdministrator.can_edit_messages` admin
|
||||||
right in a channel.
|
right in a channel.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Chat.pin_message`, :attr:`telegram.User.pin_message`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
||||||
of the target channel (in the format ``@channelusername``).
|
of the target channel (in the format ``@channelusername``).
|
||||||
|
@ -6085,6 +6225,8 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
right in a supergroup or :attr:`~telegram.ChatMemberAdministrator.can_edit_messages` admin
|
right in a supergroup or :attr:`~telegram.ChatMemberAdministrator.can_edit_messages` admin
|
||||||
right in a channel.
|
right in a channel.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Chat.unpin_message`, :attr:`telegram.User.unpin_message`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
||||||
of the target channel (in the format ``@channelusername``).
|
of the target channel (in the format ``@channelusername``).
|
||||||
|
@ -6147,6 +6289,9 @@ class Bot(TelegramObject, AbstractAsyncContextManager):
|
||||||
admin right in a supergroup or :attr:`~telegram.ChatMemberAdministrator.can_edit_messages`
|
admin right in a supergroup or :attr:`~telegram.ChatMemberAdministrator.can_edit_messages`
|
||||||
admin right in a channel.
|
admin right in a channel.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Chat.unpin_all_messages`,
|
||||||
|
:attr:`telegram.User.unpin_all_messages`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
||||||
of the target channel (in the format ``@channelusername``).
|
of the target channel (in the format ``@channelusername``).
|
||||||
|
@ -6870,6 +7015,9 @@ CUSTOM_EMOJI_IDENTIFIER_LIMIT` custom emoji identifiers can be specified.
|
||||||
"""
|
"""
|
||||||
Use this method to send a native poll.
|
Use this method to send a native poll.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Message.reply_poll`, :attr:`telegram.Chat.send_poll`,
|
||||||
|
:attr:`telegram.User.send_poll`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
||||||
of the target channel (in the format ``@channelusername``).
|
of the target channel (in the format ``@channelusername``).
|
||||||
|
@ -7002,6 +7150,8 @@ CUSTOM_EMOJI_IDENTIFIER_LIMIT` custom emoji identifiers can be specified.
|
||||||
"""
|
"""
|
||||||
Use this method to stop a poll which was sent by the bot.
|
Use this method to stop a poll which was sent by the bot.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Message.stop_poll`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
||||||
of the target channel (in the format ``@channelusername``).
|
of the target channel (in the format ``@channelusername``).
|
||||||
|
@ -7068,9 +7218,20 @@ CUSTOM_EMOJI_IDENTIFIER_LIMIT` custom emoji identifiers can be specified.
|
||||||
"""
|
"""
|
||||||
Use this method to send an animated emoji that will display a random value.
|
Use this method to send an animated emoji that will display a random value.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Message.reply_dice`, :attr:`telegram.Chat.send_dice`,
|
||||||
|
:attr:`telegram.User.send_dice`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
||||||
of the target channel (in the format ``@channelusername``).
|
of the target channel (in the format ``@channelusername``).
|
||||||
|
disable_notification (:obj:`bool`, optional): Sends the message silently. Users will
|
||||||
|
receive a notification with no sound.
|
||||||
|
reply_to_message_id (:obj:`int`, optional): If the message is a reply, ID of the
|
||||||
|
original message.
|
||||||
|
reply_markup (:class:`InlineKeyboardMarkup` | :class:`ReplyKeyboardMarkup` | \
|
||||||
|
:class:`ReplyKeyboardRemove` | :class:`ForceReply`, optional):
|
||||||
|
Additional interface options. An object for an inline keyboard, custom reply
|
||||||
|
keyboard, instructions to remove reply keyboard or to force a reply from the user
|
||||||
emoji (:obj:`str`, optional): Emoji on which the dice throw animation is based.
|
emoji (:obj:`str`, optional): Emoji on which the dice throw animation is based.
|
||||||
Currently, must be one of :class:`telegram.constants.DiceEmoji`. Dice can have
|
Currently, must be one of :class:`telegram.constants.DiceEmoji`. Dice can have
|
||||||
values 1-6 for :tg-const:`telegram.constants.DiceEmoji.DICE`,
|
values 1-6 for :tg-const:`telegram.constants.DiceEmoji.DICE`,
|
||||||
|
@ -7082,23 +7243,14 @@ CUSTOM_EMOJI_IDENTIFIER_LIMIT` custom emoji identifiers can be specified.
|
||||||
:tg-const:`telegram.constants.DiceEmoji.DICE`.
|
:tg-const:`telegram.constants.DiceEmoji.DICE`.
|
||||||
|
|
||||||
.. versionchanged:: 13.4
|
.. versionchanged:: 13.4
|
||||||
Added the :tg-const:`telegram.constants.DiceEmoji.BOWLING` emoji.
|
Added the :tg-const:`telegram.constants.DiceEmoji.BOWLING` emoji..
|
||||||
disable_notification (:obj:`bool`, optional): Sends the message silently. Users will
|
allow_sending_without_reply (:obj:`bool`, optional): Pass :obj:`True`, if the message
|
||||||
receive a notification with no sound.
|
should be sent even if the specified replied-to message is not found.
|
||||||
protect_content (:obj:`bool`, optional): Protects the contents of the sent message from
|
protect_content (:obj:`bool`, optional): Protects the contents of the sent message from
|
||||||
forwarding and saving.
|
forwarding and saving.
|
||||||
|
|
||||||
.. versionadded:: 13.10
|
.. versionadded:: 13.10
|
||||||
|
|
||||||
reply_to_message_id (:obj:`int`, optional): If the message is a reply, ID of the
|
|
||||||
original message.
|
|
||||||
allow_sending_without_reply (:obj:`bool`, optional): Pass :obj:`True`, if the message
|
|
||||||
should be sent even if the specified replied-to message is not found.
|
|
||||||
reply_markup (:class:`InlineKeyboardMarkup` | :class:`ReplyKeyboardMarkup` | \
|
|
||||||
:class:`ReplyKeyboardRemove` | :class:`ForceReply`, optional):
|
|
||||||
Additional interface options. An object for an inline keyboard, custom reply
|
|
||||||
keyboard, instructions to remove reply keyboard or to force a reply from the user.
|
|
||||||
|
|
||||||
Keyword Args:
|
Keyword Args:
|
||||||
read_timeout (:obj:`float` | :obj:`None`, optional): Value to pass to
|
read_timeout (:obj:`float` | :obj:`None`, optional): Value to pass to
|
||||||
:paramref:`telegram.request.BaseRequest.post.read_timeout`. Defaults to
|
:paramref:`telegram.request.BaseRequest.post.read_timeout`. Defaults to
|
||||||
|
@ -7616,6 +7768,10 @@ CUSTOM_EMOJI_IDENTIFIER_LIMIT` custom emoji identifiers can be specified.
|
||||||
be copied. The method is analogous to the method :meth:`forward_message`, but the copied
|
be copied. The method is analogous to the method :meth:`forward_message`, but the copied
|
||||||
message doesn't have a link to the original message.
|
message doesn't have a link to the original message.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.Message.copy`, :attr:`telegram.Chat.send_copy`,
|
||||||
|
:attr:`telegram.Chat.copy_message`, :attr:`telegram.User.send_copy`,
|
||||||
|
:attr:`telegram.User.copy_message`
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
|
||||||
of the target channel (in the format ``@channelusername``).
|
of the target channel (in the format ``@channelusername``).
|
||||||
|
@ -7667,6 +7823,7 @@ CUSTOM_EMOJI_IDENTIFIER_LIMIT` custom emoji identifiers can be specified.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`telegram.error.TelegramError`
|
:class:`telegram.error.TelegramError`
|
||||||
|
|
||||||
"""
|
"""
|
||||||
data: JSONDict = {
|
data: JSONDict = {
|
||||||
"chat_id": chat_id,
|
"chat_id": chat_id,
|
||||||
|
@ -7713,7 +7870,8 @@ CUSTOM_EMOJI_IDENTIFIER_LIMIT` custom emoji identifiers can be specified.
|
||||||
button.
|
button.
|
||||||
|
|
||||||
.. seealso:: :meth:`get_chat_menu_button`, :meth:`telegram.Chat.set_menu_button`,
|
.. seealso:: :meth:`get_chat_menu_button`, :meth:`telegram.Chat.set_menu_button`,
|
||||||
:meth:`telegram.User.set_menu_button`
|
:meth:`telegram.Chat.get_menu_button`, meth:`telegram.User.set_menu_button`,
|
||||||
|
:meth:`telegram.User.get_menu_button`
|
||||||
|
|
||||||
.. versionadded:: 20.0
|
.. versionadded:: 20.0
|
||||||
|
|
||||||
|
@ -7741,6 +7899,7 @@ CUSTOM_EMOJI_IDENTIFIER_LIMIT` custom emoji identifiers can be specified.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
:obj:`bool`: On success, :obj:`True` is returned.
|
:obj:`bool`: On success, :obj:`True` is returned.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
data: JSONDict = {}
|
data: JSONDict = {}
|
||||||
if chat_id is not None:
|
if chat_id is not None:
|
||||||
|
@ -7773,7 +7932,8 @@ CUSTOM_EMOJI_IDENTIFIER_LIMIT` custom emoji identifiers can be specified.
|
||||||
the default menu button.
|
the default menu button.
|
||||||
|
|
||||||
.. seealso:: :meth:`set_chat_menu_button`, :meth:`telegram.Chat.get_menu_button`,
|
.. seealso:: :meth:`set_chat_menu_button`, :meth:`telegram.Chat.get_menu_button`,
|
||||||
:meth:`telegram.User.get_menu_button`
|
:meth:`telegram.Chat.set_menu_button`, :meth:`telegram.User.get_menu_button`,
|
||||||
|
:meth:`telegram.User.set_menu_button`
|
||||||
|
|
||||||
.. versionadded:: 20.0
|
.. versionadded:: 20.0
|
||||||
|
|
||||||
|
@ -7799,6 +7959,7 @@ CUSTOM_EMOJI_IDENTIFIER_LIMIT` custom emoji identifiers can be specified.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
:class:`telegram.MenuButton`: On success, the current menu button is returned.
|
:class:`telegram.MenuButton`: On success, the current menu button is returned.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
data = {}
|
data = {}
|
||||||
if chat_id is not None:
|
if chat_id is not None:
|
||||||
|
|
|
@ -2389,7 +2389,7 @@ class Chat(TelegramObject):
|
||||||
Caution:
|
Caution:
|
||||||
Can only work, if the chat is a private chat.
|
Can only work, if the chat is a private chat.
|
||||||
|
|
||||||
..seealso:: :meth:`get_menu_button`
|
.. seealso:: :meth:`get_menu_button`
|
||||||
|
|
||||||
.. versionadded:: 20.0
|
.. versionadded:: 20.0
|
||||||
|
|
||||||
|
@ -2425,7 +2425,7 @@ class Chat(TelegramObject):
|
||||||
Caution:
|
Caution:
|
||||||
Can only work, if the chat is a private chat.
|
Can only work, if the chat is a private chat.
|
||||||
|
|
||||||
..seealso:: :meth:`set_menu_button`
|
.. seealso:: :meth:`set_menu_button`
|
||||||
|
|
||||||
.. versionadded:: 20.0
|
.. versionadded:: 20.0
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,8 @@ class ChatMember(TelegramObject):
|
||||||
Objects of this class are comparable in terms of equality. Two objects of this class are
|
Objects of this class are comparable in terms of equality. Two objects of this class are
|
||||||
considered equal, if their :attr:`user` and :attr:`status` are equal.
|
considered equal, if their :attr:`user` and :attr:`status` are equal.
|
||||||
|
|
||||||
|
.. seealso:: `Chat Member Example <examples.chatmemberbot.html>`_
|
||||||
|
|
||||||
.. versionchanged:: 20.0
|
.. versionchanged:: 20.0
|
||||||
|
|
||||||
* As of Bot API 5.3, :class:`ChatMember` is nothing but the base class for the subclasses
|
* As of Bot API 5.3, :class:`ChatMember` is nothing but the base class for the subclasses
|
||||||
|
|
|
@ -111,7 +111,7 @@ class File(TelegramObject):
|
||||||
original filename as reported by Telegram. If the file has no filename, it the file ID will
|
original filename as reported by Telegram. If the file has no filename, it the file ID will
|
||||||
be used as filename. If a :paramref:`custom_path` is supplied, it will be saved to that
|
be used as filename. If a :paramref:`custom_path` is supplied, it will be saved to that
|
||||||
path instead. If :paramref:`out` is defined, the file contents will be saved to that object
|
path instead. If :paramref:`out` is defined, the file contents will be saved to that object
|
||||||
using the ``out.write`` method.
|
using the :obj:`out.write<io.BufferedWriter.write>` method.
|
||||||
|
|
||||||
Note:
|
Note:
|
||||||
* :paramref:`custom_path` and :paramref:`out` are mutually exclusive.
|
* :paramref:`custom_path` and :paramref:`out` are mutually exclusive.
|
||||||
|
|
|
@ -62,6 +62,10 @@ class InlineKeyboardButton(TelegramObject):
|
||||||
|
|
||||||
* After Bot API 6.1, only ``HTTPS`` links will be allowed in :paramref:`login_url`.
|
* After Bot API 6.1, only ``HTTPS`` links will be allowed in :paramref:`login_url`.
|
||||||
|
|
||||||
|
.. seealso:: `Inline Keyboard Example 1 <examples.inlinekeyboard.html>`_,
|
||||||
|
`Inline Keyboard Example 2 <examples.inlinekeyboard2.html>`_,
|
||||||
|
:class:`telegram.InlineKeyboardMarkup`
|
||||||
|
|
||||||
.. versionchanged:: 20.0
|
.. versionchanged:: 20.0
|
||||||
:attr:`web_app` is considered as well when comparing objects of this type in terms of
|
:attr:`web_app` is considered as well when comparing objects of this type in terms of
|
||||||
equality.
|
equality.
|
||||||
|
|
|
@ -36,6 +36,9 @@ class InlineKeyboardMarkup(TelegramObject):
|
||||||
Objects of this class are comparable in terms of equality. Two objects of this class are
|
Objects of this class are comparable in terms of equality. Two objects of this class are
|
||||||
considered equal, if their size of :attr:`inline_keyboard` and all the buttons are equal.
|
considered equal, if their size of :attr:`inline_keyboard` and all the buttons are equal.
|
||||||
|
|
||||||
|
.. seealso:: `Inline Keyboard Example 1 <examples.inlinekeyboard.html>`_,
|
||||||
|
`Inline Keyboard Example 2 <examples.inlinekeyboard2.html>`_
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
inline_keyboard (List[List[:class:`telegram.InlineKeyboardButton`]]): List of button rows,
|
inline_keyboard (List[List[:class:`telegram.InlineKeyboardButton`]]): List of button rows,
|
||||||
each represented by a list of InlineKeyboardButton objects.
|
each represented by a list of InlineKeyboardButton objects.
|
||||||
|
|
|
@ -31,6 +31,8 @@ if TYPE_CHECKING:
|
||||||
class InlineQueryResultArticle(InlineQueryResult):
|
class InlineQueryResultArticle(InlineQueryResult):
|
||||||
"""This object represents a Telegram InlineQueryResultArticle.
|
"""This object represents a Telegram InlineQueryResultArticle.
|
||||||
|
|
||||||
|
.. seealso:: `Inline Example <examples.inlinebot.html>`_
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
id (:obj:`str`): Unique identifier for this result, 1-64 Bytes.
|
id (:obj:`str`): Unique identifier for this result, 1-64 Bytes.
|
||||||
title (:obj:`str`): Title of the result.
|
title (:obj:`str`): Title of the result.
|
||||||
|
|
|
@ -33,6 +33,8 @@ class InputTextMessageContent(InputMessageContent):
|
||||||
Objects of this class are comparable in terms of equality. Two objects of this class are
|
Objects of this class are comparable in terms of equality. Two objects of this class are
|
||||||
considered equal, if their :attr:`message_text` is equal.
|
considered equal, if their :attr:`message_text` is equal.
|
||||||
|
|
||||||
|
.. seealso:: `Inline Example <examples.inlinebot.html>`_
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
message_text (:obj:`str`): Text of the message to be sent,
|
message_text (:obj:`str`): Text of the message to be sent,
|
||||||
1-:tg-const:`telegram.constants.MessageLimit.TEXT_LENGTH` characters after entities
|
1-:tg-const:`telegram.constants.MessageLimit.TEXT_LENGTH` characters after entities
|
||||||
|
|
|
@ -29,6 +29,8 @@ class KeyboardButtonPollType(TelegramObject):
|
||||||
Objects of this class are comparable in terms of equality. Two objects of this class are
|
Objects of this class are comparable in terms of equality. Two objects of this class are
|
||||||
considered equal, if their :attr:`type` is equal.
|
considered equal, if their :attr:`type` is equal.
|
||||||
|
|
||||||
|
.. seealso:: `Pollbot Example <examples.pollbot.html>`_
|
||||||
|
|
||||||
Attributes:
|
Attributes:
|
||||||
type (:obj:`str`): Optional. If :tg-const:`telegram.Poll.QUIZ` is passed, the user will be
|
type (:obj:`str`): Optional. If :tg-const:`telegram.Poll.QUIZ` is passed, the user will be
|
||||||
allowed to create only polls in the quiz mode. If :tg-const:`telegram.Poll.REGULAR` is
|
allowed to create only polls in the quiz mode. If :tg-const:`telegram.Poll.REGULAR` is
|
||||||
|
|
|
@ -29,6 +29,8 @@ class LabeledPrice(TelegramObject):
|
||||||
Objects of this class are comparable in terms of equality. Two objects of this class are
|
Objects of this class are comparable in terms of equality. Two objects of this class are
|
||||||
considered equal, if their :attr:`label` and :attr:`amount` are equal.
|
considered equal, if their :attr:`label` and :attr:`amount` are equal.
|
||||||
|
|
||||||
|
.. seealso:: `Paymentbot Example <examples.paymentbot.html>`_
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
label (:obj:`str`): Portion label.
|
label (:obj:`str`): Portion label.
|
||||||
amount (:obj:`int`): Price of the product in the smallest units of the currency (integer,
|
amount (:obj:`int`): Price of the product in the smallest units of the currency (integer,
|
||||||
|
|
|
@ -33,6 +33,8 @@ class ShippingOption(TelegramObject):
|
||||||
Objects of this class are comparable in terms of equality. Two objects of this class are
|
Objects of this class are comparable in terms of equality. Two objects of this class are
|
||||||
considered equal, if their :attr:`id` is equal.
|
considered equal, if their :attr:`id` is equal.
|
||||||
|
|
||||||
|
.. seealso:: `Paymentbot Example <examples.paymentbot.html>`_
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
id (:obj:`str`): Shipping option identifier.
|
id (:obj:`str`): Shipping option identifier.
|
||||||
title (:obj:`str`): Option title.
|
title (:obj:`str`): Option title.
|
||||||
|
|
|
@ -112,6 +112,8 @@ class Poll(TelegramObject):
|
||||||
Objects of this class are comparable in terms of equality. Two objects of this class are
|
Objects of this class are comparable in terms of equality. Two objects of this class are
|
||||||
considered equal, if their :attr:`id` is equal.
|
considered equal, if their :attr:`id` is equal.
|
||||||
|
|
||||||
|
.. seealso:: `Pollbot Example <examples.pollbot.html>`_
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
id (:obj:`str`): Unique poll identifier.
|
id (:obj:`str`): Unique poll identifier.
|
||||||
question (:obj:`str`): Poll question, 1-300 characters.
|
question (:obj:`str`): Poll question, 1-300 characters.
|
||||||
|
|
|
@ -1463,7 +1463,7 @@ class User(TelegramObject):
|
||||||
For the documentation of the arguments, please see
|
For the documentation of the arguments, please see
|
||||||
:meth:`telegram.Bot.set_chat_menu_button`.
|
:meth:`telegram.Bot.set_chat_menu_button`.
|
||||||
|
|
||||||
..seealso:: :meth:`get_menu_button`
|
.. seealso:: :meth:`get_menu_button`
|
||||||
|
|
||||||
.. versionadded:: 20.0
|
.. versionadded:: 20.0
|
||||||
|
|
||||||
|
@ -1496,7 +1496,7 @@ class User(TelegramObject):
|
||||||
For the documentation of the arguments, please see
|
For the documentation of the arguments, please see
|
||||||
:meth:`telegram.Bot.get_chat_menu_button`.
|
:meth:`telegram.Bot.get_chat_menu_button`.
|
||||||
|
|
||||||
..seealso:: :meth:`set_menu_button`
|
.. seealso:: :meth:`set_menu_button`
|
||||||
|
|
||||||
.. versionadded:: 20.0
|
.. versionadded:: 20.0
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,8 @@ class WebAppData(TelegramObject):
|
||||||
Objects of this class are comparable in terms of equality. Two objects of this class are
|
Objects of this class are comparable in terms of equality. Two objects of this class are
|
||||||
considered equal, if their :attr:`data` and :attr:`button_text` are equal.
|
considered equal, if their :attr:`data` and :attr:`button_text` are equal.
|
||||||
|
|
||||||
|
.. seealso:: `Webappbot Example <examples.webappbot.html>`_
|
||||||
|
|
||||||
.. versionadded:: 20.0
|
.. versionadded:: 20.0
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
|
|
@ -30,6 +30,8 @@ class WebAppInfo(TelegramObject):
|
||||||
Objects of this class are comparable in terms of equality. Two objects of this class are
|
Objects of this class are comparable in terms of equality. Two objects of this class are
|
||||||
considered equal, if their :attr:`url` are equal.
|
considered equal, if their :attr:`url` are equal.
|
||||||
|
|
||||||
|
.. seealso:: `Webappbot Example <examples.webappbot.html>`_
|
||||||
|
|
||||||
.. versionadded:: 20.0
|
.. versionadded:: 20.0
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
|
|
@ -708,7 +708,8 @@ class Application(Generic[BT, CCT, UD, CD, BD, JQ], AbstractAsyncContextManager)
|
||||||
listen (:obj:`str`, optional): IP-Address to listen on. Defaults to
|
listen (:obj:`str`, optional): IP-Address to listen on. Defaults to
|
||||||
`127.0.0.1 <https://en.wikipedia.org/wiki/Localhost>`_.
|
`127.0.0.1 <https://en.wikipedia.org/wiki/Localhost>`_.
|
||||||
port (:obj:`int`, optional): Port the bot should be listening on. Must be one of
|
port (:obj:`int`, optional): Port the bot should be listening on. Must be one of
|
||||||
:attr:`telegram.constants.SUPPORTED_WEBHOOK_PORTS`. Defaults to ``80``.
|
:attr:`telegram.constants.SUPPORTED_WEBHOOK_PORTS` unless the bot is running
|
||||||
|
behind a proxy. Defaults to ``80``.
|
||||||
url_path (:obj:`str`, optional): Path inside url. Defaults to `` '' ``
|
url_path (:obj:`str`, optional): Path inside url. Defaults to `` '' ``
|
||||||
cert (:class:`pathlib.Path` | :obj:`str`, optional): Path to the SSL certificate file.
|
cert (:class:`pathlib.Path` | :obj:`str`, optional): Path to the SSL certificate file.
|
||||||
key (:class:`pathlib.Path` | :obj:`str`, optional): Path to the SSL key file.
|
key (:class:`pathlib.Path` | :obj:`str`, optional): Path to the SSL key file.
|
||||||
|
@ -1417,6 +1418,8 @@ class Application(Generic[BT, CCT, UD, CD, BD, JQ], AbstractAsyncContextManager)
|
||||||
Note:
|
Note:
|
||||||
Attempts to add the same callback multiple times will be ignored.
|
Attempts to add the same callback multiple times will be ignored.
|
||||||
|
|
||||||
|
.. seealso:: `Errorhandler Example <examples.errorhandlerbot.py>`_
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
callback (:term:`coroutine function`): The callback function for this error handler.
|
callback (:term:`coroutine function`): The callback function for this error handler.
|
||||||
Will be called when an error is raised. Callback signature::
|
Will be called when an error is raised. Callback signature::
|
||||||
|
|
|
@ -94,6 +94,11 @@ class CallbackDataCache:
|
||||||
sent via inline mode.
|
sent via inline mode.
|
||||||
If necessary, will drop the least recently used items.
|
If necessary, will drop the least recently used items.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.ext.ExtBot.callback_data_cache`,
|
||||||
|
`Arbitrary callback_data <https://github.com/python-telegram-bot/
|
||||||
|
python-telegram-bot/wiki/Arbitrary-callback_data>`_,
|
||||||
|
Arbitrary Callback Data Example <examples.arbitrarycallbackdatabot.html>
|
||||||
|
|
||||||
.. versionadded:: 13.6
|
.. versionadded:: 13.6
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
|
|
@ -31,12 +31,14 @@ RT = TypeVar("RT")
|
||||||
class ChatMemberHandler(BaseHandler[Update, CCT]):
|
class ChatMemberHandler(BaseHandler[Update, CCT]):
|
||||||
"""BaseHandler class to handle Telegram updates that contain a chat member update.
|
"""BaseHandler class to handle Telegram updates that contain a chat member update.
|
||||||
|
|
||||||
.. versionadded:: 13.4
|
|
||||||
|
|
||||||
Warning:
|
Warning:
|
||||||
When setting :paramref:`block` to :obj:`False`, you cannot rely on adding custom
|
When setting :paramref:`block` to :obj:`False`, you cannot rely on adding custom
|
||||||
attributes to :class:`telegram.ext.CallbackContext`. See its docs for more info.
|
attributes to :class:`telegram.ext.CallbackContext`. See its docs for more info.
|
||||||
|
|
||||||
|
.. seealso:: `Chat Member Example <examples.chatmemberbot.html>`_
|
||||||
|
|
||||||
|
.. versionadded:: 13.4
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
callback (:term:`coroutine function`): The callback function for this handler. Will be
|
callback (:term:`coroutine function`): The callback function for this handler. Will be
|
||||||
called when :meth:`check_update` has determined that an update should be processed by
|
called when :meth:`check_update` has determined that an update should be processed by
|
||||||
|
|
|
@ -33,6 +33,8 @@ class ContextTypes(Generic[CCT, UD, CD, BD]):
|
||||||
Convenience class to gather customizable types of the :class:`telegram.ext.CallbackContext`
|
Convenience class to gather customizable types of the :class:`telegram.ext.CallbackContext`
|
||||||
interface.
|
interface.
|
||||||
|
|
||||||
|
.. seealso:: `ContextTypes Example <examples.contexttypesbot.html>`_
|
||||||
|
|
||||||
.. versionadded:: 13.6
|
.. versionadded:: 13.6
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
|
|
@ -184,7 +184,12 @@ class ConversationHandler(BaseHandler[Update, CCT]):
|
||||||
states to continue the parent conversation after the child conversation has ended or even
|
states to continue the parent conversation after the child conversation has ended or even
|
||||||
map a state to :attr:`END` to end the *parent* conversation from within the child
|
map a state to :attr:`END` to end the *parent* conversation from within the child
|
||||||
conversation. For an example on nested :class:`ConversationHandler` s, see
|
conversation. For an example on nested :class:`ConversationHandler` s, see
|
||||||
:any:`examples.conversationbot`.
|
:any:`examples.nestedconversationbot`.
|
||||||
|
|
||||||
|
.. seealso:: `Conversation Example <examples.conversationbot.html>`_,
|
||||||
|
`Conversation Example 2 <examples.conversationbot2.html>`_,
|
||||||
|
`Nested Conversation Example <examples.nestedconversationbot.html>`_,
|
||||||
|
`Persistent Conversation Example <examples.persistentconversationbot.html>`_
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
entry_points (List[:class:`telegram.ext.BaseHandler`]): A list of :obj:`BaseHandler`
|
entry_points (List[:class:`telegram.ext.BaseHandler`]): A list of :obj:`BaseHandler`
|
||||||
|
|
|
@ -118,6 +118,10 @@ class ExtBot(Bot, Generic[RLARGS]):
|
||||||
* The method :meth:`~telegram.Bot.get_updates` is the only method that does not have the
|
* The method :meth:`~telegram.Bot.get_updates` is the only method that does not have the
|
||||||
additional argument, as this method will never be rate limited.
|
additional argument, as this method will never be rate limited.
|
||||||
|
|
||||||
|
.. seealso:: `Arbitrary Callback Example <examples.arbitrarycallbackdatabot.html>`_,
|
||||||
|
`Arbitrary callback_data <https://github.com/python-telegram-bot/
|
||||||
|
python-telegram-bot/wiki/Arbitrary-callback_data>`_
|
||||||
|
|
||||||
.. versionadded:: 13.6
|
.. versionadded:: 13.6
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
|
|
@ -46,6 +46,8 @@ class InlineQueryHandler(BaseHandler[Update, CCT]):
|
||||||
chats and may not be set for inline queries coming from third-party clients. These
|
chats and may not be set for inline queries coming from third-party clients. These
|
||||||
updates won't be handled, if :attr:`chat_types` is passed.
|
updates won't be handled, if :attr:`chat_types` is passed.
|
||||||
|
|
||||||
|
.. seealso:: `Inlinebot Example <examples.inlinebot.html>`_
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
callback (:term:`coroutine function`): The callback function for this handler. Will be
|
callback (:term:`coroutine function`): The callback function for this handler. Will be
|
||||||
called when :meth:`check_update` has determined that an update should be processed by
|
called when :meth:`check_update` has determined that an update should be processed by
|
||||||
|
|
|
@ -40,6 +40,12 @@ class JobQueue:
|
||||||
"""This class allows you to periodically perform tasks with the bot. It is a convenience
|
"""This class allows you to periodically perform tasks with the bot. It is a convenience
|
||||||
wrapper for the APScheduler library.
|
wrapper for the APScheduler library.
|
||||||
|
|
||||||
|
.. seealso:: :attr:`telegram.ext.Application.job_queue`,
|
||||||
|
:attr:`telegram.ext.CallbackContext.job_queue`,
|
||||||
|
`Timerbot Example <examples.timerbot.html>`_,
|
||||||
|
`Job Queue <https://github.com/python-telegram-bot/
|
||||||
|
python-telegram-bot/wiki/Extensions-%E2%80%93-JobQueue>`_
|
||||||
|
|
||||||
Attributes:
|
Attributes:
|
||||||
scheduler (:class:`apscheduler.schedulers.asyncio.AsyncIOScheduler`): The scheduler.
|
scheduler (:class:`apscheduler.schedulers.asyncio.AsyncIOScheduler`): The scheduler.
|
||||||
|
|
||||||
|
@ -47,7 +53,6 @@ class JobQueue:
|
||||||
Uses :class:`~apscheduler.schedulers.asyncio.AsyncIOScheduler` instead of
|
Uses :class:`~apscheduler.schedulers.asyncio.AsyncIOScheduler` instead of
|
||||||
:class:`~apscheduler.schedulers.background.BackgroundScheduler`
|
:class:`~apscheduler.schedulers.background.BackgroundScheduler`
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__slots__ = ("_application", "scheduler", "_executor")
|
__slots__ = ("_application", "scheduler", "_executor")
|
||||||
|
@ -567,7 +572,11 @@ class JobQueue:
|
||||||
await asyncio.sleep(0.01)
|
await asyncio.sleep(0.01)
|
||||||
|
|
||||||
def jobs(self) -> Tuple["Job", ...]:
|
def jobs(self) -> Tuple["Job", ...]:
|
||||||
"""Returns a tuple of all *scheduled* jobs that are currently in the :class:`JobQueue`."""
|
"""Returns a tuple of all *scheduled* jobs that are currently in the :class:`JobQueue`.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Tuple[:class:`Job`]: Tuple of all *scheduled* jobs.
|
||||||
|
"""
|
||||||
return tuple(
|
return tuple(
|
||||||
Job._from_aps_job(job) # pylint: disable=protected-access
|
Job._from_aps_job(job) # pylint: disable=protected-access
|
||||||
for job in self.scheduler.get_jobs()
|
for job in self.scheduler.get_jobs()
|
||||||
|
@ -576,6 +585,9 @@ class JobQueue:
|
||||||
def get_jobs_by_name(self, name: str) -> Tuple["Job", ...]:
|
def get_jobs_by_name(self, name: str) -> Tuple["Job", ...]:
|
||||||
"""Returns a tuple of all *pending/scheduled* jobs with the given name that are currently
|
"""Returns a tuple of all *pending/scheduled* jobs with the given name that are currently
|
||||||
in the :class:`JobQueue`.
|
in the :class:`JobQueue`.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Tuple[:class:`Job`]: Tuple of all *pending* or *scheduled* jobs matching the name.
|
||||||
"""
|
"""
|
||||||
return tuple(job for job in self.jobs() if job.name == name)
|
return tuple(job for job in self.jobs() if job.name == name)
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,8 @@ class PollAnswerHandler(BaseHandler[Update, CCT]):
|
||||||
When setting :paramref:`block` to :obj:`False`, you cannot rely on adding custom
|
When setting :paramref:`block` to :obj:`False`, you cannot rely on adding custom
|
||||||
attributes to :class:`telegram.ext.CallbackContext`. See its docs for more info.
|
attributes to :class:`telegram.ext.CallbackContext`. See its docs for more info.
|
||||||
|
|
||||||
|
.. seealso:: `Pollbot EXample <examples.pollbot.html>`_
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
callback (:term:`coroutine function`): The callback function for this handler. Will be
|
callback (:term:`coroutine function`): The callback function for this handler. Will be
|
||||||
called when :meth:`check_update` has determined that an update should be processed by
|
called when :meth:`check_update` has determined that an update should be processed by
|
||||||
|
|
|
@ -32,6 +32,8 @@ class PollHandler(BaseHandler[Update, CCT]):
|
||||||
When setting :paramref:`block` to :obj:`False`, you cannot rely on adding custom
|
When setting :paramref:`block` to :obj:`False`, you cannot rely on adding custom
|
||||||
attributes to :class:`telegram.ext.CallbackContext`. See its docs for more info.
|
attributes to :class:`telegram.ext.CallbackContext`. See its docs for more info.
|
||||||
|
|
||||||
|
.. seealso:: `Pollbot Example <examples.pollbot.html>`_
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
callback (:term:`coroutine function`): The callback function for this handler. Will be
|
callback (:term:`coroutine function`): The callback function for this handler. Will be
|
||||||
called when :meth:`check_update` has determined that an update should be processed by
|
called when :meth:`check_update` has determined that an update should be processed by
|
||||||
|
|
|
@ -31,6 +31,8 @@ class PreCheckoutQueryHandler(BaseHandler[Update, CCT]):
|
||||||
When setting :paramref:`block` to :obj:`False`, you cannot rely on adding custom
|
When setting :paramref:`block` to :obj:`False`, you cannot rely on adding custom
|
||||||
attributes to :class:`telegram.ext.CallbackContext`. See its docs for more info.
|
attributes to :class:`telegram.ext.CallbackContext`. See its docs for more info.
|
||||||
|
|
||||||
|
.. seealso:: `Paymentbot Example <examples.paymentbot.html>`_
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
callback (:term:`coroutine function`): The callback function for this handler. Will be
|
callback (:term:`coroutine function`): The callback function for this handler. Will be
|
||||||
called when :meth:`check_update` has determined that an update should be processed by
|
called when :meth:`check_update` has determined that an update should be processed by
|
||||||
|
|
|
@ -31,6 +31,8 @@ class ShippingQueryHandler(BaseHandler[Update, CCT]):
|
||||||
When setting :paramref:`block` to :obj:`False`, you cannot rely on adding custom
|
When setting :paramref:`block` to :obj:`False`, you cannot rely on adding custom
|
||||||
attributes to :class:`telegram.ext.CallbackContext`. See its docs for more info.
|
attributes to :class:`telegram.ext.CallbackContext`. See its docs for more info.
|
||||||
|
|
||||||
|
.. seealso:: `Paymentbot Example <examples.paymentbot.html>`_
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
callback (:term:`coroutine function`): The callback function for this handler. Will be
|
callback (:term:`coroutine function`): The callback function for this handler. Will be
|
||||||
called when :meth:`check_update` has determined that an update should be processed by
|
called when :meth:`check_update` has determined that an update should be processed by
|
||||||
|
|
|
@ -389,7 +389,8 @@ class Updater(AbstractAsyncContextManager):
|
||||||
listen (:obj:`str`, optional): IP-Address to listen on. Defaults to
|
listen (:obj:`str`, optional): IP-Address to listen on. Defaults to
|
||||||
`127.0.0.1 <https://en.wikipedia.org/wiki/Localhost>`_.
|
`127.0.0.1 <https://en.wikipedia.org/wiki/Localhost>`_.
|
||||||
port (:obj:`int`, optional): Port the bot should be listening on. Must be one of
|
port (:obj:`int`, optional): Port the bot should be listening on. Must be one of
|
||||||
:attr:`telegram.constants.SUPPORTED_WEBHOOK_PORTS`. Defaults to ``80``.
|
:attr:`telegram.constants.SUPPORTED_WEBHOOK_PORTS` unless the bot is running
|
||||||
|
behind a proxy. Defaults to ``80``.
|
||||||
url_path (:obj:`str`, optional): Path inside url (http(s)://listen:port/<url_path>).
|
url_path (:obj:`str`, optional): Path inside url (http(s)://listen:port/<url_path>).
|
||||||
Defaults to ``''``.
|
Defaults to ``''``.
|
||||||
cert (:class:`pathlib.Path` | :obj:`str`, optional): Path to the SSL certificate file.
|
cert (:class:`pathlib.Path` | :obj:`str`, optional): Path to the SSL certificate file.
|
||||||
|
|
|
@ -146,6 +146,8 @@ def create_deep_linked_url(bot_username: str, payload: str = None, group: bool =
|
||||||
Examples:
|
Examples:
|
||||||
``create_deep_linked_url(bot.get_me().username, "some-params")``
|
``create_deep_linked_url(bot.get_me().username, "some-params")``
|
||||||
|
|
||||||
|
.. seealso:: `Deeplinking Example <examples.deeplinking.html>`_
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
bot_username (:obj:`str`): The username to link to
|
bot_username (:obj:`str`): The username to link to
|
||||||
payload (:obj:`str`, optional): Parameters to encode in the created URL
|
payload (:obj:`str`, optional): Parameters to encode in the created URL
|
||||||
|
|
Loading…
Add table
Reference in a new issue