diff --git a/docs/source/conf.py b/docs/source/conf.py index 0cee2519c..4bd8397c9 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -209,6 +209,9 @@ htmlhelp_basename = 'PythonTelegramBotdoc' # -- Options for LaTeX output --------------------------------------------- latex_elements = { + 'preamble': '''\\setcounter{tocdepth}{2} +\\usepackage{enumitem} +\\setlistdepth{99}''', # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', diff --git a/docs/source/index.rst b/docs/source/index.rst index 79cd90b78..46ef952d5 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -10,7 +10,7 @@ Contents: telegram .. toctree:: - :maxdepth: 2 + telegram diff --git a/docs/source/modules.rst b/docs/source/modules.rst deleted file mode 100644 index bdc205346..000000000 --- a/docs/source/modules.rst +++ /dev/null @@ -1,7 +0,0 @@ -telegram -======== - -.. toctree:: - :maxdepth: 4 - - telegram diff --git a/docs/source/telegram.contrib.rst b/docs/source/telegram.contrib.rst new file mode 100644 index 000000000..58bdb5b07 --- /dev/null +++ b/docs/source/telegram.contrib.rst @@ -0,0 +1,17 @@ +telegram.contrib package +======================== + +Submodules +---------- + +.. toctree:: + + telegram.contrib.botan + +Module contents +--------------- + +.. automodule:: telegram.contrib + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/telegram.ext.rst b/docs/source/telegram.ext.rst index 3fa83b1b1..4da91810c 100644 --- a/docs/source/telegram.ext.rst +++ b/docs/source/telegram.ext.rst @@ -10,6 +10,7 @@ Submodules telegram.ext.dispatcher telegram.ext.jobqueue telegram.ext.handler + telegram.ext.callbackqueryhandler telegram.ext.choseninlineresulthandler telegram.ext.conversationhandler telegram.ext.commandhandler diff --git a/docs/source/telegram.inlinekeyboardbutton.rst b/docs/source/telegram.inlinekeyboardbutton.rst index 1d71fe458..13a5925a0 100644 --- a/docs/source/telegram.inlinekeyboardbutton.rst +++ b/docs/source/telegram.inlinekeyboardbutton.rst @@ -1,5 +1,5 @@ telegram.inlinekeyboardbutton module -=========================== +==================================== .. automodule:: telegram.inlinekeyboardbutton :members: diff --git a/docs/source/telegram.inlinekeyboardmarkup.rst b/docs/source/telegram.inlinekeyboardmarkup.rst index 3fbf80776..a2ef0719e 100644 --- a/docs/source/telegram.inlinekeyboardmarkup.rst +++ b/docs/source/telegram.inlinekeyboardmarkup.rst @@ -1,5 +1,5 @@ telegram.inlinekeyboardmarkup module -========================== +==================================== .. automodule:: telegram.inlinekeyboardmarkup :members: diff --git a/docs/source/telegram.inlinequeryresultarticle.rst b/docs/source/telegram.inlinequeryresultarticle.rst index 2f7370139..5840b1330 100644 --- a/docs/source/telegram.inlinequeryresultarticle.rst +++ b/docs/source/telegram.inlinequeryresultarticle.rst @@ -1,5 +1,5 @@ telegram.inlinequeryresultarticle module -================================= +======================================== .. automodule:: telegram.inlinequeryresultarticle :members: diff --git a/docs/source/telegram.inlinequeryresultaudio.rst b/docs/source/telegram.inlinequeryresultaudio.rst index 7458ef031..bfb3788ef 100644 --- a/docs/source/telegram.inlinequeryresultaudio.rst +++ b/docs/source/telegram.inlinequeryresultaudio.rst @@ -1,5 +1,5 @@ telegram.inlinequeryresultaudio module -================================= +====================================== .. automodule:: telegram.inlinequeryresultaudio :members: diff --git a/docs/source/telegram.inlinequeryresultcachedaudio.rst b/docs/source/telegram.inlinequeryresultcachedaudio.rst index 49eb0b853..13cac237b 100644 --- a/docs/source/telegram.inlinequeryresultcachedaudio.rst +++ b/docs/source/telegram.inlinequeryresultcachedaudio.rst @@ -1,5 +1,5 @@ telegram.inlinequeryresultcachedaudio module -================================= +============================================ .. automodule:: telegram.inlinequeryresultcachedaudio :members: diff --git a/docs/source/telegram.inlinequeryresultcacheddocument.rst b/docs/source/telegram.inlinequeryresultcacheddocument.rst index c574ed656..41054f1a9 100644 --- a/docs/source/telegram.inlinequeryresultcacheddocument.rst +++ b/docs/source/telegram.inlinequeryresultcacheddocument.rst @@ -1,5 +1,5 @@ telegram.inlinequeryresultcacheddocument module -================================= +=============================================== .. automodule:: telegram.inlinequeryresultcacheddocument :members: diff --git a/docs/source/telegram.inlinequeryresultcachedgif.rst b/docs/source/telegram.inlinequeryresultcachedgif.rst index d34692e52..d914d45ff 100644 --- a/docs/source/telegram.inlinequeryresultcachedgif.rst +++ b/docs/source/telegram.inlinequeryresultcachedgif.rst @@ -1,5 +1,5 @@ telegram.inlinequeryresultcachedgif module -================================= +========================================== .. automodule:: telegram.inlinequeryresultcachedgif :members: diff --git a/docs/source/telegram.inlinequeryresultcachedmpeg4gif.rst b/docs/source/telegram.inlinequeryresultcachedmpeg4gif.rst index 953f754b6..9a9fd2fe9 100644 --- a/docs/source/telegram.inlinequeryresultcachedmpeg4gif.rst +++ b/docs/source/telegram.inlinequeryresultcachedmpeg4gif.rst @@ -1,5 +1,5 @@ telegram.inlinequeryresultcachedmpeg4gif module -================================= +=============================================== .. automodule:: telegram.inlinequeryresultcachedmpeg4gif :members: diff --git a/docs/source/telegram.inlinequeryresultcachedphoto.rst b/docs/source/telegram.inlinequeryresultcachedphoto.rst index 2560e24c8..322ead576 100644 --- a/docs/source/telegram.inlinequeryresultcachedphoto.rst +++ b/docs/source/telegram.inlinequeryresultcachedphoto.rst @@ -1,5 +1,5 @@ telegram.inlinequeryresultcachedphoto module -================================= +============================================ .. automodule:: telegram.inlinequeryresultcachedphoto :members: diff --git a/docs/source/telegram.inlinequeryresultcachedsticker.rst b/docs/source/telegram.inlinequeryresultcachedsticker.rst index ca90b49a8..e277a9e78 100644 --- a/docs/source/telegram.inlinequeryresultcachedsticker.rst +++ b/docs/source/telegram.inlinequeryresultcachedsticker.rst @@ -1,5 +1,5 @@ telegram.inlinequeryresultcachedsticker module -================================= +============================================== .. automodule:: telegram.inlinequeryresultcachedsticker :members: diff --git a/docs/source/telegram.inlinequeryresultcachedvideo.rst b/docs/source/telegram.inlinequeryresultcachedvideo.rst index 242dc36ba..b66d9074f 100644 --- a/docs/source/telegram.inlinequeryresultcachedvideo.rst +++ b/docs/source/telegram.inlinequeryresultcachedvideo.rst @@ -1,5 +1,5 @@ telegram.inlinequeryresultcachedvideo module -================================= +============================================ .. automodule:: telegram.inlinequeryresultcachedvideo :members: diff --git a/docs/source/telegram.inlinequeryresultcachedvoice.rst b/docs/source/telegram.inlinequeryresultcachedvoice.rst index 5b9b362ed..ccb2a2106 100644 --- a/docs/source/telegram.inlinequeryresultcachedvoice.rst +++ b/docs/source/telegram.inlinequeryresultcachedvoice.rst @@ -1,5 +1,5 @@ telegram.inlinequeryresultcachedvoice module -================================= +============================================ .. automodule:: telegram.inlinequeryresultcachedvoice :members: diff --git a/docs/source/telegram.inlinequeryresultcontact.rst b/docs/source/telegram.inlinequeryresultcontact.rst index da5d91f08..f7b5470e8 100644 --- a/docs/source/telegram.inlinequeryresultcontact.rst +++ b/docs/source/telegram.inlinequeryresultcontact.rst @@ -1,5 +1,5 @@ telegram.inlinequeryresultcontact module -================================= +======================================== .. automodule:: telegram.inlinequeryresultcontact :members: diff --git a/docs/source/telegram.inlinequeryresultdocument.rst b/docs/source/telegram.inlinequeryresultdocument.rst index 08a8a44be..e81bd24ce 100644 --- a/docs/source/telegram.inlinequeryresultdocument.rst +++ b/docs/source/telegram.inlinequeryresultdocument.rst @@ -1,5 +1,5 @@ telegram.inlinequeryresultdocument module -================================= +========================================= .. automodule:: telegram.inlinequeryresultdocument :members: diff --git a/docs/source/telegram.inlinequeryresultgif.rst b/docs/source/telegram.inlinequeryresultgif.rst index 0fd6f06f7..0caddcb63 100644 --- a/docs/source/telegram.inlinequeryresultgif.rst +++ b/docs/source/telegram.inlinequeryresultgif.rst @@ -1,5 +1,5 @@ telegram.inlinequeryresultgif module -================================= +==================================== .. automodule:: telegram.inlinequeryresultgif :members: diff --git a/docs/source/telegram.inlinequeryresultlocation.rst b/docs/source/telegram.inlinequeryresultlocation.rst index 7c06a2df1..ddd80aaa4 100644 --- a/docs/source/telegram.inlinequeryresultlocation.rst +++ b/docs/source/telegram.inlinequeryresultlocation.rst @@ -1,5 +1,5 @@ telegram.inlinequeryresultlocation module -================================= +========================================= .. automodule:: telegram.inlinequeryresultlocation :members: diff --git a/docs/source/telegram.inlinequeryresultmpeg4gif.rst b/docs/source/telegram.inlinequeryresultmpeg4gif.rst index 9ed46db6c..cf6997bde 100644 --- a/docs/source/telegram.inlinequeryresultmpeg4gif.rst +++ b/docs/source/telegram.inlinequeryresultmpeg4gif.rst @@ -1,5 +1,5 @@ telegram.inlinequeryresultmpeg4gif module -================================= +========================================= .. automodule:: telegram.inlinequeryresultmpeg4gif :members: diff --git a/docs/source/telegram.inlinequeryresultphoto.rst b/docs/source/telegram.inlinequeryresultphoto.rst index 1162bd203..2c408cdfe 100644 --- a/docs/source/telegram.inlinequeryresultphoto.rst +++ b/docs/source/telegram.inlinequeryresultphoto.rst @@ -1,5 +1,5 @@ telegram.inlinequeryresultphoto module -================================= +====================================== .. automodule:: telegram.inlinequeryresultphoto :members: diff --git a/docs/source/telegram.inlinequeryresultvenue.rst b/docs/source/telegram.inlinequeryresultvenue.rst index bcd8e2354..dff8e6497 100644 --- a/docs/source/telegram.inlinequeryresultvenue.rst +++ b/docs/source/telegram.inlinequeryresultvenue.rst @@ -1,5 +1,5 @@ telegram.inlinequeryresultvenue module -================================= +====================================== .. automodule:: telegram.inlinequeryresultvenue :members: diff --git a/docs/source/telegram.inlinequeryresultvideo.rst b/docs/source/telegram.inlinequeryresultvideo.rst index 3245bcdc5..68e139425 100644 --- a/docs/source/telegram.inlinequeryresultvideo.rst +++ b/docs/source/telegram.inlinequeryresultvideo.rst @@ -1,5 +1,5 @@ telegram.inlinequeryresultvideo module -================================= +====================================== .. automodule:: telegram.inlinequeryresultvideo :members: diff --git a/docs/source/telegram.inlinequeryresultvoice.rst b/docs/source/telegram.inlinequeryresultvoice.rst index d33fc0e52..4271fb339 100644 --- a/docs/source/telegram.inlinequeryresultvoice.rst +++ b/docs/source/telegram.inlinequeryresultvoice.rst @@ -1,5 +1,5 @@ telegram.inlinequeryresultvoice module -================================= +====================================== .. automodule:: telegram.inlinequeryresultvoice :members: diff --git a/docs/source/telegram.nullhandler.rst b/docs/source/telegram.nullhandler.rst deleted file mode 100644 index 94d36b9de..000000000 --- a/docs/source/telegram.nullhandler.rst +++ /dev/null @@ -1,7 +0,0 @@ -telegram.nullhandler module -=========================== - -.. automodule:: telegram.nullhandler - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/telegram.rst b/docs/source/telegram.rst index abd4e6803..c1930fcb4 100644 --- a/docs/source/telegram.rst +++ b/docs/source/telegram.rst @@ -9,6 +9,8 @@ Submodules telegram.audio telegram.base telegram.bot + telegram.constants + telegram.contrib telegram.ext telegram.inlinequery telegram.inlinequeryresult @@ -37,14 +39,12 @@ Submodules telegram.chataction telegram.contact telegram.document - telegram.emoji telegram.error telegram.forcereply telegram.chat telegram.inputfile telegram.location telegram.message - telegram.nullhandler telegram.photosize telegram.replykeyboardhide telegram.replykeyboardmarkup diff --git a/telegram/bot.py b/telegram/bot.py index 5978afbe7..edc7d7654 100644 --- a/telegram/bot.py +++ b/telegram/bot.py @@ -347,13 +347,13 @@ class Bot(TelegramObject): Args: chat_id: Unique identifier for the message recipient - Chat id. - audio Audio file to send. You can either pass a file_id as String to resend an audio + audio: Audio file to send. You can either pass a file_id as String to resend an audio that is already on the Telegram servers, or upload a new audio file using multipart/form-data. duration (Optional[int]): Duration of sent audio in seconds. - performer: Performer of sent audio. [Optional] - title: Title of sent audio. [Optional] - caption: Audio caption [Optional] + performer (Optional[str]): Performer of sent audio. + title (Optional[str]): Title of sent audio. + caption (Optional[str]): Audio caption disable_notification (Optional[bool]): Sends the message silently. iOS users will not receive a notification, Android users will receive a notification with no sound. reply_to_message_id (Optional[int]): If the message is a reply, ID of the original @@ -405,8 +405,8 @@ class Bot(TelegramObject): chat_id: Unique identifier for the message recipient - Chat id. document: File to send. You can either pass a file_id as String to resend a file that is already on the Telegram servers, or upload a new file using multipart/form-data. - filename: File name that shows in telegram message (it is usefull when you send file - generated by temp module, for example). [Optional] + filename (Optional[str]): File name that shows in telegram message (it is usefull when + you send file generated by temp module, for example). caption (Optional[str]): Document caption (may also be used when resending documents by file_id), 0-200 characters. disable_notification (Optional[bool]): Sends the message silently. iOS users will not @@ -554,7 +554,7 @@ class Bot(TelegramObject): that is already on the Telegram servers, or upload a new audio file using multipart/form-data. duration (Optional[int]): Duration of sent audio in seconds. - caption: Voice caption [Optional] + caption (Optional[str]): Voice caption disable_notification (Optional[bool]): Sends the message silently. iOS users will not receive a notification, Android users will receive a notification with no sound. reply_to_message_id (Optional[int]): If the message is a reply, ID of the original @@ -777,6 +777,7 @@ class Bot(TelegramObject): chat_id: Unique identifier for the message recipient - Chat id. action: Type of action to broadcast. Choose one, depending on what the user is about to receive: + - ChatAction.TYPING for text messages, - ChatAction.UPLOAD_PHOTO for photos, - ChatAction.UPLOAD_VIDEO for videos, @@ -862,8 +863,8 @@ class Bot(TelegramObject): Args: user_id: Unique identifier of the target user. - offset (Optional[int]: Sequential number of the first photo to be returned. By default, - all photos are returned. + offset (Optional[int]): Sequential number of the first photo to be returned. By + default, all photos are returned. limit (Optional[int]): Limits the number of photos to be retrieved. Values between 1-100 are accepted. Defaults to 100. timeout (Optional[float]): If this value is specified, use it as the definitive timeout @@ -960,7 +961,7 @@ class Bot(TelegramObject): Args: chat_id: Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername). - user_id: Unique identifier of the target user. + user_id: Unique identifier of the target user. timeout (Optional[float]): If this value is specified, use it as the definitive timeout (in seconds) for urlopen() operations. **kwargs (dict): Arbitrary keyword arguments. diff --git a/telegram/ext/callbackqueryhandler.py b/telegram/ext/callbackqueryhandler.py index 850bacc3a..e20d5c085 100644 --- a/telegram/ext/callbackqueryhandler.py +++ b/telegram/ext/callbackqueryhandler.py @@ -39,7 +39,7 @@ class CallbackQueryHandler(Handler): pass_update_queue (optional[bool]): If set to ``True``, a keyword argument called ``update_queue`` will be passed to the callback function. It will be the ``Queue`` instance used by the ``Updater`` and ``Dispatcher`` that contains new updates which can - be used to insert updates. Default is ``False``. + be used to insert updates. Default is ``False``. pass_job_queue (optional[bool]): If set to ``True``, a keyword argument called ``job_queue`` will be passed to the callback function. It will be a ``JobQueue`` instance created by the ``Updater`` which can be used to schedule new jobs. diff --git a/telegram/ext/choseninlineresulthandler.py b/telegram/ext/choseninlineresulthandler.py index 4c9771955..060a2df2f 100644 --- a/telegram/ext/choseninlineresulthandler.py +++ b/telegram/ext/choseninlineresulthandler.py @@ -35,7 +35,7 @@ class ChosenInlineResultHandler(Handler): pass_update_queue (optional[bool]): If set to ``True``, a keyword argument called ``update_queue`` will be passed to the callback function. It will be the ``Queue`` instance used by the ``Updater`` and ``Dispatcher`` that contains new updates which can - be used to insert updates. Default is ``False``. + be used to insert updates. Default is ``False``. pass_job_queue (optional[bool]): If set to ``True``, a keyword argument called ``job_queue`` will be passed to the callback function. It will be a ``JobQueue`` instance created by the ``Updater`` which can be used to schedule new jobs. diff --git a/telegram/ext/commandhandler.py b/telegram/ext/commandhandler.py index 28dc767cc..79df50eaa 100644 --- a/telegram/ext/commandhandler.py +++ b/telegram/ext/commandhandler.py @@ -44,7 +44,7 @@ class CommandHandler(Handler): pass_update_queue (optional[bool]): If set to ``True``, a keyword argument called ``update_queue`` will be passed to the callback function. It will be the ``Queue`` instance used by the ``Updater`` and ``Dispatcher`` that contains new updates which can - be used to insert updates. Default is ``False``. + be used to insert updates. Default is ``False``. pass_job_queue (optional[bool]): If set to ``True``, a keyword argument called ``job_queue`` will be passed to the callback function. It will be a ``JobQueue`` instance created by the ``Updater`` which can be used to schedule new jobs. diff --git a/telegram/ext/dispatcher.py b/telegram/ext/dispatcher.py index 445a4e171..37e6c8a5c 100644 --- a/telegram/ext/dispatcher.py +++ b/telegram/ext/dispatcher.py @@ -309,7 +309,7 @@ class Dispatcher(object): which handlers were added to the group defines the priority. Args: - handler (Handler): A Handler instance + handler (telegram.ext.Handler): A Handler instance group (Optional[int]): The group identifier. Default is 0 """ @@ -330,7 +330,7 @@ class Dispatcher(object): Remove a handler from the specified group Args: - handler (Handler): A Handler instance + handler (telegram.ext.Handler): A Handler instance group (optional[object]): The group identifier. Default is 0 """ if handler in self.handlers[group]: diff --git a/telegram/ext/handler.py b/telegram/ext/handler.py index d1bb0d05f..f7ade0e0a 100644 --- a/telegram/ext/handler.py +++ b/telegram/ext/handler.py @@ -35,7 +35,7 @@ class Handler(object): pass_update_queue (optional[bool]): If set to ``True``, a keyword argument called ``update_queue`` will be passed to the callback function. It will be the ``Queue`` instance used by the ``Updater`` and ``Dispatcher`` that contains new updates which can - be used to insert updates. Default is ``False``. + be used to insert updates. Default is ``False``. pass_job_queue (optional[bool]): If set to ``True``, a keyword argument called ``job_queue`` will be passed to the callback function. It will be a ``JobQueue`` instance created by the ``Updater`` which can be used to schedule new jobs. @@ -85,7 +85,7 @@ class Handler(object): Args: update (object): The update to be handled - dispatcher (Dispatcher): The dispatcher to collect optional args + dispatcher (telegram.ext.Dispatcher): The dispatcher to collect optional args """ raise NotImplementedError @@ -96,7 +96,7 @@ class Handler(object): handlers Args: - dispatcher (Dispatcher): + dispatcher (telegram.ext.Dispatcher): """ optional_args = dict() diff --git a/telegram/ext/inlinequeryhandler.py b/telegram/ext/inlinequeryhandler.py index c346b9139..8827524bb 100644 --- a/telegram/ext/inlinequeryhandler.py +++ b/telegram/ext/inlinequeryhandler.py @@ -38,7 +38,7 @@ class InlineQueryHandler(Handler): pass_update_queue (optional[bool]): If set to ``True``, a keyword argument called ``update_queue`` will be passed to the callback function. It will be the ``Queue`` instance used by the ``Updater`` and ``Dispatcher`` that contains new updates which can - be used to insert updates. Default is ``False``. + be used to insert updates. Default is ``False``. pass_job_queue (optional[bool]): If set to ``True``, a keyword argument called ``job_queue`` will be passed to the callback function. It will be a ``JobQueue`` instance created by the ``Updater`` which can be used to schedule new jobs. diff --git a/telegram/ext/jobqueue.py b/telegram/ext/jobqueue.py index fb42d5be8..796e278bd 100644 --- a/telegram/ext/jobqueue.py +++ b/telegram/ext/jobqueue.py @@ -30,10 +30,10 @@ class JobQueue(object): Attributes: queue (PriorityQueue): - bot (Bot): + bot (telegram.Bot): Args: - bot (Bot): The bot instance that should be passed to the jobs + bot (telegram.Bot): The bot instance that should be passed to the jobs Deprecated: 5.2 prevent_autostart (Optional[bool]): Thread does not start during initialisation. @@ -60,7 +60,7 @@ class JobQueue(object): """Queue a new job. Args: - job (Job): The ``Job`` instance representing the new job + job (telegram.ext.Job): The ``Job`` instance representing the new job next_t (Optional[float]): Time in seconds in which the job should be executed first. Defaults to ``job.interval`` diff --git a/telegram/ext/regexhandler.py b/telegram/ext/regexhandler.py index 743648054..0e4cb0cc9 100644 --- a/telegram/ext/regexhandler.py +++ b/telegram/ext/regexhandler.py @@ -48,7 +48,7 @@ class RegexHandler(Handler): pass_update_queue (optional[bool]): If set to ``True``, a keyword argument called ``update_queue`` will be passed to the callback function. It will be the ``Queue`` instance used by the ``Updater`` and ``Dispatcher`` that contains new updates which can - be used to insert updates. Default is ``False``. + be used to insert updates. Default is ``False``. pass_job_queue (optional[bool]): If set to ``True``, a keyword argument called ``job_queue`` will be passed to the callback function. It will be a ``JobQueue`` instance created by the ``Updater`` which can be used to schedule new jobs. diff --git a/telegram/ext/stringcommandhandler.py b/telegram/ext/stringcommandhandler.py index eaf37055f..45826c7e7 100644 --- a/telegram/ext/stringcommandhandler.py +++ b/telegram/ext/stringcommandhandler.py @@ -40,7 +40,7 @@ class StringCommandHandler(Handler): pass_update_queue (optional[bool]): If set to ``True``, a keyword argument called ``update_queue`` will be passed to the callback function. It will be the ``Queue`` instance used by the ``Updater`` and ``Dispatcher`` that contains new updates which can - be used to insert updates. Default is ``False``. + be used to insert updates. Default is ``False``. pass_job_queue (optional[bool]): If set to ``True``, a keyword argument called ``job_queue`` will be passed to the callback function. It will be a ``JobQueue`` instance created by the ``Updater`` which can be used to schedule new jobs. diff --git a/telegram/ext/stringregexhandler.py b/telegram/ext/stringregexhandler.py index 468a4a987..75b555eb7 100644 --- a/telegram/ext/stringregexhandler.py +++ b/telegram/ext/stringregexhandler.py @@ -47,7 +47,7 @@ class StringRegexHandler(Handler): pass_update_queue (optional[bool]): If set to ``True``, a keyword argument called ``update_queue`` will be passed to the callback function. It will be the ``Queue`` instance used by the ``Updater`` and ``Dispatcher`` that contains new updates which can - be used to insert updates. Default is ``False``. + be used to insert updates. Default is ``False``. pass_job_queue (optional[bool]): If set to ``True``, a keyword argument called ``job_queue`` will be passed to the callback function. It will be a ``JobQueue`` instance created by the ``Updater`` which can be used to schedule new jobs. diff --git a/telegram/ext/typehandler.py b/telegram/ext/typehandler.py index 3f0c776a9..eab95c6f2 100644 --- a/telegram/ext/typehandler.py +++ b/telegram/ext/typehandler.py @@ -37,7 +37,7 @@ class TypeHandler(Handler): pass_update_queue (optional[bool]): If set to ``True``, a keyword argument called ``update_queue`` will be passed to the callback function. It will be the ``Queue`` instance used by the ``Updater`` and ``Dispatcher`` that contains new updates which can - be used to insert updates. Default is ``False``. + be used to insert updates. Default is ``False``. pass_job_queue (optional[bool]): If set to ``True``, a keyword argument called ``job_queue`` will be passed to the callback function. It will be a ``JobQueue`` instance created by the ``Updater`` which can be used to schedule new jobs. diff --git a/telegram/inlinequeryresultcachedmpeg4gif.py b/telegram/inlinequeryresultcachedmpeg4gif.py index 9cc977251..d13de13d5 100644 --- a/telegram/inlinequeryresultcachedmpeg4gif.py +++ b/telegram/inlinequeryresultcachedmpeg4gif.py @@ -44,7 +44,7 @@ class InlineQueryResultCachedMpeg4Gif(InlineQueryResult): caption (Optional[str]): reply_markup (Optional[:class:`telegram.InlineKeyboardMarkup`]): input_message_content (Optional[:class:`telegram.InputMessageContent`]): - **kwargs (dict): Arbitrary keyword arguments. + **kwargs (dict): Arbitrary keyword arguments. """ diff --git a/telegram/message.py b/telegram/message.py index 35f6db27b..da1b4e0d7 100644 --- a/telegram/message.py +++ b/telegram/message.py @@ -438,11 +438,10 @@ class Message(TelegramObject): def forward(self, chat_id, disable_notification=False): """Shortcut for - bot.forwardMessage(chat_id=chat_id, - from_chat_id=update.message.chat_id, - disable_notification=disable_notification, - message_id=update.message.message_id) - + >>> bot.forwardMessage(chat_id=chat_id, + ... from_chat_id=update.message.chat_id, + ... disable_notification=disable_notification, + ... message_id=update.message.message_id) """ return self.bot.forwardMessage( chat_id=chat_id, @@ -452,42 +451,48 @@ class Message(TelegramObject): def edit_text(self, *args, **kwargs): """ - Shortcut for ``bot.editMessageText(chat_id=message.chat_id, - message_id=message.message_id, - *args, **kwargs)`` + Shortcut for + + >>> bot.editMessageText(chat_id=message.chat_id, + ... message_id=message.message_id, + ... *args, **kwargs) Note: You can only edit messages that the bot sent itself, therefore this method can only be used on the - return value of the bot.send_* family of methods. + return value of the ``bot.send_*`` family of methods. """ return self.bot.edit_message_text( chat_id=self.chat_id, message_id=self.message_id, *args, **kwargs) def edit_caption(self, *args, **kwargs): """ - Shortcut for ``bot.editMessageCaption(chat_id=message.chat_id, - message_id=message.message_id, - *args, **kwargs)`` + Shortcut for + + >>> bot.editMessageCaption(chat_id=message.chat_id, + ... message_id=message.message_id, + ... *args, **kwargs) Note: You can only edit messages that the bot sent itself, therefore this method can only be used on the - return value of the bot.send_* family of methods. + return value of the ``bot.send_*`` family of methods. """ return self.bot.edit_message_caption( chat_id=self.chat_id, message_id=self.message_id, *args, **kwargs) def edit_reply_markup(self, *args, **kwargs): """ - Shortcut for ``bot.editReplyMarkup(chat_id=message.chat_id, - message_id=message.message_id, - *args, **kwargs)`` + Shortcut for + + >>> bot.editReplyMarkup(chat_id=message.chat_id, + ... message_id=message.message_id, + ... *args, **kwargs) Note: You can only edit messages that the bot sent itself, therefore this method can only be used on the - return value of the bot.send_* family of methods. + return value of the ``bot.send_*`` family of methods. """ return self.bot.edit_message_caption( chat_id=self.chat_id, message_id=self.message_id, *args, **kwargs)