From 541f9ab0655d5a946e1cc1d5cc609889339cee86 Mon Sep 17 00:00:00 2001 From: SukkaW Date: Wed, 27 Apr 2022 08:37:05 +0800 Subject: [PATCH 1/2] Replace all `git.io` links with their actual URLs --- .github/ISSUE_TEMPLATE/question.yml | 4 ++-- CHANGES.rst | 4 ++-- docs/source/_static/dark.css | 2 +- examples/README.md | 4 ++-- examples/arbitrarycallbackdatabot.py | 3 ++- examples/inlinekeyboard.py | 2 +- examples/passportbot.py | 3 ++- setup.py | 2 +- telegram/dice.py | 2 +- telegram/ext/callbackcontext.py | 6 +++--- telegram/ext/callbackqueryhandler.py | 2 +- telegram/ext/chatjoinrequesthandler.py | 2 +- telegram/ext/chatmemberhandler.py | 2 +- telegram/ext/choseninlineresulthandler.py | 2 +- telegram/ext/commandhandler.py | 6 +++--- telegram/ext/contexttypes.py | 2 +- telegram/ext/conversationhandler.py | 2 +- telegram/ext/dispatcher.py | 4 ++-- telegram/ext/extbot.py | 3 ++- telegram/ext/handler.py | 4 ++-- telegram/ext/inlinequeryhandler.py | 2 +- telegram/ext/messagehandler.py | 8 ++++---- telegram/ext/messagequeue.py | 8 ++++---- telegram/ext/pollanswerhandler.py | 2 +- telegram/ext/pollhandler.py | 2 +- telegram/ext/precheckoutqueryhandler.py | 2 +- telegram/ext/regexhandler.py | 2 +- telegram/ext/shippingqueryhandler.py | 2 +- tests/test_commandhandler.py | 2 +- tests/test_messagehandler.py | 6 +++--- 30 files changed, 50 insertions(+), 47 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/question.yml b/.github/ISSUE_TEMPLATE/question.yml index 84b686d10f6..c3ad2fb6df3 100644 --- a/.github/ISSUE_TEMPLATE/question.yml +++ b/.github/ISSUE_TEMPLATE/question.yml @@ -9,9 +9,9 @@ body: value: | Hey there, you have a question? We are happy to answer. Please make sure no similar question was opened already. - To make it easier for us to help you, please read this [article](https://git.io/JURJO). + To make it easier for us to help you, please read this [article](https://github.com/python-telegram-bot/python-telegram-bot/wiki/Ask-Right). - Please mind that there is also a users' [Telegram group](https://t.me/pythontelegrambotgroup) for questions about the library. Questions asked there might be answered quicker than here. Moreover, [GitHub Discussions](https://git.io/JG3rk) offer a slightly better format to discuss usage questions. + Please mind that there is also a users' [Telegram group](https://t.me/pythontelegrambotgroup) for questions about the library. Questions asked there might be answered quicker than here. Moreover, [GitHub Discussions](https://github.com/python-telegram-bot/python-telegram-bot/discussions) offer a slightly better format to discuss usage questions. - type: textarea id: issue-faced diff --git a/CHANGES.rst b/CHANGES.rst index 32436cc7674..c91190584f3 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -895,7 +895,7 @@ Expect minor releases soon (mainly complete Bot API 4.4 support) - Error Handler now handles all types of exceptions (`#1485`_) - Return UTC from from_timestamp() (`#1485`_) -**See the wiki page at https://git.io/fxJuV for a detailed guide on how to migrate from version 11 to version 12.** +**See the wiki page at https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for a detailed guide on how to migrate from version 11 to version 12.** Context based callbacks (`#1100`_) ---------------------------------- @@ -1100,7 +1100,7 @@ Non Bot API 4.0 changes: .. _`#1172`: https://github.com/python-telegram-bot/python-telegram-bot/pull/1172 .. _`#1179`: https://github.com/python-telegram-bot/python-telegram-bot/pull/1179 .. _`#1184`: https://github.com/python-telegram-bot/python-telegram-bot/pull/1184 -.. _`our telegram passport wiki page`: https://git.io/fAvYd +.. _`our telegram passport wiki page`: https://github.com/python-telegram-bot/python-telegram-bot/wiki/Telegram-Passport Version 10.1.0 ============== diff --git a/docs/source/_static/dark.css b/docs/source/_static/dark.css index f8ec9fd0876..8be80d0cc45 100644 --- a/docs/source/_static/dark.css +++ b/docs/source/_static/dark.css @@ -2,7 +2,7 @@ /* Generated by https://darkreader.org Instructions: Install the extension on a Chromium-based browser - Then do this to export the CSS: https://git.io/JOM6t and drop it here + Then do this to export the CSS: https://github.com/darkreader/darkreader/issues/604#issuecomment-661107893 and drop it here Some color values where manually changed - just search for "/*" in this file and insert them in the new css */ /* User-Agent Style */ diff --git a/examples/README.md b/examples/README.md index 7deb05ff363..1ac157c76db 100644 --- a/examples/README.md +++ b/examples/README.md @@ -25,7 +25,7 @@ A even more complex example of a bot that uses the nested `ConversationHandler`s A basic example of a bot store conversation state and user_data over multiple restarts. ### [`inlinekeyboard.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/inlinekeyboard.py) -This example sheds some light on inline keyboards, callback queries and message editing. A wikipedia site explaining this examples lives at https://git.io/JOmFw. +This example sheds some light on inline keyboards, callback queries and message editing. A wikipedia site explaining this examples lives at https://github.com/python-telegram-bot/python-telegram-bot/wiki/InlineKeyboard-Example. ### [`inlinekeyboard2.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/inlinekeyboard2.py) A more complex example about inline keyboards, callback queries and message editing. This example showcases how an interactive menu could be build using inline keyboards. @@ -40,7 +40,7 @@ A basic example of an [inline bot](https://core.telegram.org/bots/inline). Don't This example sheds some light on polls, poll answers and the corresponding handlers. ### [`passportbot.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/passportbot.py) -A basic example of a bot that can accept passports. Use in combination with [`passportbot.html`](https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/passportbot.html). Don't forget to enable and configure payments with [@BotFather](https://telegram.me/BotFather). Check out this [guide](https://git.io/fAvYd) on Telegram passports in PTB. +A basic example of a bot that can accept passports. Use in combination with [`passportbot.html`](https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/passportbot.html). Don't forget to enable and configure payments with [@BotFather](https://telegram.me/BotFather). Check out this [guide](https://github.com/python-telegram-bot/python-telegram-bot/wiki/Telegram-Passport) on Telegram passports in PTB. ### [`paymentbot.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/paymentbot.py) A basic example of a bot that can accept payments. Don't forget to enable and configure payments with [@BotFather](https://telegram.me/BotFather). diff --git a/examples/arbitrarycallbackdatabot.py b/examples/arbitrarycallbackdatabot.py index 6d1139ce984..d598b218d15 100644 --- a/examples/arbitrarycallbackdatabot.py +++ b/examples/arbitrarycallbackdatabot.py @@ -4,7 +4,8 @@ """This example showcases how PTBs "arbitrary callback data" feature can be used. -For detailed info on arbitrary callback data, see the wiki page at https://git.io/JGBDI +For detailed info on arbitrary callback data, see the wiki page at +https://github.com/python-telegram-bot/python-telegram-bot/wiki/Arbitrary-callback_data """ import logging from typing import List, Tuple, cast diff --git a/examples/inlinekeyboard.py b/examples/inlinekeyboard.py index a3799d207ec..6d6767e43e5 100644 --- a/examples/inlinekeyboard.py +++ b/examples/inlinekeyboard.py @@ -4,7 +4,7 @@ """ Basic example for a bot that uses inline keyboards. For an in-depth explanation, check out - https://git.io/JOmFw. + https://github.com/python-telegram-bot/python-telegram-bot/wiki/InlineKeyboard-Example. """ import logging diff --git a/examples/passportbot.py b/examples/passportbot.py index dc563e90ba1..e799347d2e5 100644 --- a/examples/passportbot.py +++ b/examples/passportbot.py @@ -7,7 +7,8 @@ See https://telegram.org/blog/passport for info about what telegram passport is. -See https://git.io/fAvYd for how to use Telegram Passport properly with python-telegram-bot. +See https://github.com/python-telegram-bot/python-telegram-bot/wiki/Telegram-Passport +for how to use Telegram Passport properly with python-telegram-bot. """ import logging diff --git a/setup.py b/setup.py index acffecc18ea..dd866437227 100644 --- a/setup.py +++ b/setup.py @@ -65,7 +65,7 @@ def get_setup_kwargs(raw=False): author_email='devs@python-telegram-bot.org', license='LGPLv3', url='https://python-telegram-bot.org/', - # Keywords supported by PyPI can be found at https://git.io/JtLIZ + # Keywords supported by PyPI can be found at https://github.com/pypa/warehouse/blob/aafc5185e57e67d43487ce4faa95913dd4573e14/warehouse/templates/packaging/detail.html#L20-L58 project_urls={ "Documentation": "https://python-telegram-bot.readthedocs.io", "Bug Tracker": "https://github.com/python-telegram-bot/python-telegram-bot/issues", diff --git a/telegram/dice.py b/telegram/dice.py index 8836529b151..ca26077a2ca 100644 --- a/telegram/dice.py +++ b/telegram/dice.py @@ -50,7 +50,7 @@ class Dice(TelegramObject): Telegram. If :attr:`emoji` is "🎰", each value corresponds to a unique combination of symbols, which - can be found at our `wiki `_. However, this behaviour is undocumented + can be found at our `wiki `_. However, this behaviour is undocumented and might be changed by Telegram. Args: diff --git a/telegram/ext/callbackcontext.py b/telegram/ext/callbackcontext.py index 607ca9277eb..050195c9370 100644 --- a/telegram/ext/callbackcontext.py +++ b/telegram/ext/callbackcontext.py @@ -139,7 +139,7 @@ def bot_data(self) -> BD: @bot_data.setter def bot_data(self, value: object) -> NoReturn: raise AttributeError( - "You can not assign a new value to bot_data, see https://git.io/Jt6ic" + "You can not assign a new value to bot_data, see https://github.com/python-telegram-bot/python-telegram-bot/wiki/Storing-bot%2C-user-and-chat-related-data" ) @property @@ -160,7 +160,7 @@ def chat_data(self) -> Optional[CD]: @chat_data.setter def chat_data(self, value: object) -> NoReturn: raise AttributeError( - "You can not assign a new value to chat_data, see https://git.io/Jt6ic" + "You can not assign a new value to chat_data, see https://github.com/python-telegram-bot/python-telegram-bot/wiki/Storing-bot%2C-user-and-chat-related-data" ) @property @@ -175,7 +175,7 @@ def user_data(self) -> Optional[UD]: @user_data.setter def user_data(self, value: object) -> NoReturn: raise AttributeError( - "You can not assign a new value to user_data, see https://git.io/Jt6ic" + "You can not assign a new value to user_data, see https://github.com/python-telegram-bot/python-telegram-bot/wiki/Storing-bot%2C-user-and-chat-related-data" ) def refresh_data(self) -> None: diff --git a/telegram/ext/callbackqueryhandler.py b/telegram/ext/callbackqueryhandler.py index bb19fa73eb3..2cfff6f9773 100644 --- a/telegram/ext/callbackqueryhandler.py +++ b/telegram/ext/callbackqueryhandler.py @@ -55,7 +55,7 @@ class CallbackQueryHandler(Handler[Update, CCT]): user or in the same chat, it will be the same ``dict``. Note that this is DEPRECATED, and you should use context based callbacks. See - https://git.io/fxJuV for more info. + https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info. * If your bot allows arbitrary objects as ``callback_data``, it may happen that the original ``callback_data`` for the incoming :class:`telegram.CallbackQuery`` can not be found. This is the case when either a malicious client tempered with the diff --git a/telegram/ext/chatjoinrequesthandler.py b/telegram/ext/chatjoinrequesthandler.py index aafed54c075..b6a788c3efc 100644 --- a/telegram/ext/chatjoinrequesthandler.py +++ b/telegram/ext/chatjoinrequesthandler.py @@ -35,7 +35,7 @@ class ChatJoinRequestHandler(Handler[Update, CCT]): or in the same chat, it will be the same ``dict``. Note that this is DEPRECATED, and you should use context based callbacks. See - https://git.io/fxJuV for more info. + https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info. Warning: When setting ``run_async`` to :obj:`True`, you cannot rely on adding custom diff --git a/telegram/ext/chatmemberhandler.py b/telegram/ext/chatmemberhandler.py index eb9d91b0de5..e90ec7f6c79 100644 --- a/telegram/ext/chatmemberhandler.py +++ b/telegram/ext/chatmemberhandler.py @@ -39,7 +39,7 @@ class ChatMemberHandler(Handler[Update, CCT]): or in the same chat, it will be the same ``dict``. Note that this is DEPRECATED, and you should use context based callbacks. See - https://git.io/fxJuV for more info. + https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info. Warning: When setting ``run_async`` to :obj:`True`, you cannot rely on adding custom diff --git a/telegram/ext/choseninlineresulthandler.py b/telegram/ext/choseninlineresulthandler.py index 1d94b79a5af..30ee307586c 100644 --- a/telegram/ext/choseninlineresulthandler.py +++ b/telegram/ext/choseninlineresulthandler.py @@ -42,7 +42,7 @@ class ChosenInlineResultHandler(Handler[Update, CCT]): or in the same chat, it will be the same ``dict``. Note that this is DEPRECATED, and you should use context based callbacks. See - https://git.io/fxJuV for more info. + https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info. Warning: When setting ``run_async`` to :obj:`True`, you cannot rely on adding custom diff --git a/telegram/ext/commandhandler.py b/telegram/ext/commandhandler.py index 6f53d23c5cd..82ce9846a7b 100644 --- a/telegram/ext/commandhandler.py +++ b/telegram/ext/commandhandler.py @@ -55,7 +55,7 @@ class CommandHandler(Handler[Update, CCT]): user or in the same chat, it will be the same :obj:`dict`. Note that this is DEPRECATED, and you should use context based callbacks. See - https://git.io/fxJuV for more info. + https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info. Warning: When setting ``run_async`` to :obj:`True`, you cannot rely on adding custom @@ -169,7 +169,7 @@ def __init__( if allow_edited is not None: warnings.warn( - 'allow_edited is deprecated. See https://git.io/fxJuV for more info', + 'allow_edited is deprecated. See https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info', TelegramDeprecationWarning, stacklevel=2, ) @@ -288,7 +288,7 @@ class PrefixHandler(CommandHandler): user or in the same chat, it will be the same :obj:`dict`. Note that this is DEPRECATED, and you should use context based callbacks. See - https://git.io/fxJuV for more info. + https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info. Warning: When setting ``run_async`` to :obj:`True`, you cannot rely on adding custom diff --git a/telegram/ext/contexttypes.py b/telegram/ext/contexttypes.py index ee03037a9b2..bf5ace29bae 100644 --- a/telegram/ext/contexttypes.py +++ b/telegram/ext/contexttypes.py @@ -50,7 +50,7 @@ class ContextTypes(Generic[CCT, UD, CD, BD]): __slots__ = ('_context', '_bot_data', '_chat_data', '_user_data') - # overload signatures generated with https://git.io/JtJPj + # overload signatures generated with https://gist.github.com/Bibo-Joshi/399382cda537fb01bd86b13c3d03a956 @overload def __init__( diff --git a/telegram/ext/conversationhandler.py b/telegram/ext/conversationhandler.py index 23edf2f7576..e92f6582735 100644 --- a/telegram/ext/conversationhandler.py +++ b/telegram/ext/conversationhandler.py @@ -79,7 +79,7 @@ class ConversationHandler(Handler[Update, CCT]): Finally, ``ConversationHandler``, does *not* handle (edited) channel posts. - .. _`FAQ`: https://git.io/JtcyU + .. _`FAQ`: https://github.com/python-telegram-bot/python-telegram-bot/wiki/Frequently-Asked-Questions#what-do-the-per_-settings-in-conversationhandler-do The first collection, a ``list`` named :attr:`entry_points`, is used to initiate the conversation, for example with a :class:`telegram.ext.CommandHandler` or diff --git a/telegram/ext/dispatcher.py b/telegram/ext/dispatcher.py index af241882e6c..11f6bbcf627 100644 --- a/telegram/ext/dispatcher.py +++ b/telegram/ext/dispatcher.py @@ -241,7 +241,7 @@ def __init__( if not use_context: warnings.warn( - 'Old Handler API is deprecated - see https://git.io/fxJuV for details', + 'Old Handler API is deprecated - see https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for details', TelegramDeprecationWarning, stacklevel=3, ) @@ -763,7 +763,7 @@ def add_error_handler( asynchronously using :meth:`run_async`. Defaults to :obj:`False`. Note: - See https://git.io/fxJuV for more info about switching to context based API. + See https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info about switching to context based API. """ if callback in self.error_handlers: self.logger.debug('The callback is already registered as an error handler. Ignoring.') diff --git a/telegram/ext/extbot.py b/telegram/ext/extbot.py index f026191ee0c..738224131fb 100644 --- a/telegram/ext/extbot.py +++ b/telegram/ext/extbot.py @@ -62,7 +62,8 @@ class ExtBot(telegram.bot.Bot): arbitrary_callback_data (:obj:`bool` | :obj:`int`, optional): Whether to allow arbitrary objects as callback data for :class:`telegram.InlineKeyboardButton`. Pass an integer to specify the maximum number of objects cached in memory. For more - details, please see our `wiki `_. Defaults to :obj:`False`. + details, please see our `wiki `_. + Defaults to :obj:`False`. Attributes: arbitrary_callback_data (:obj:`bool` | :obj:`int`): Whether this bot instance diff --git a/telegram/ext/handler.py b/telegram/ext/handler.py index b6e3a636dd7..124ddd5d2bc 100644 --- a/telegram/ext/handler.py +++ b/telegram/ext/handler.py @@ -45,7 +45,7 @@ class Handler(Generic[UT, CCT], ABC): or in the same chat, it will be the same ``dict``. Note that this is DEPRECATED, and you should use context based callbacks. See - https://git.io/fxJuV for more info. + https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info. Warning: When setting ``run_async`` to :obj:`True`, you cannot rely on adding custom @@ -232,7 +232,7 @@ def collect_optional_args( it should subclass this method, but remember to call this super method. DEPRECATED: This method is being replaced by new context based callbacks. Please see - https://git.io/fxJuV for more info. + https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info. Args: dispatcher (:class:`telegram.ext.Dispatcher`): The dispatcher. diff --git a/telegram/ext/inlinequeryhandler.py b/telegram/ext/inlinequeryhandler.py index de43431b839..fff91f3f788 100644 --- a/telegram/ext/inlinequeryhandler.py +++ b/telegram/ext/inlinequeryhandler.py @@ -55,7 +55,7 @@ class InlineQueryHandler(Handler[Update, CCT]): or in the same chat, it will be the same ``dict``. Note that this is DEPRECATED, and you should use context based callbacks. See - https://git.io/fxJuV for more info. + https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info. Warning: * When setting ``run_async`` to :obj:`True`, you cannot rely on adding custom diff --git a/telegram/ext/messagehandler.py b/telegram/ext/messagehandler.py index 57faa3f0ea6..4d6f02e22f2 100644 --- a/telegram/ext/messagehandler.py +++ b/telegram/ext/messagehandler.py @@ -45,7 +45,7 @@ class MessageHandler(Handler[Update, CCT]): or in the same chat, it will be the same ``dict``. Note that this is DEPRECATED, and you should use context based callbacks. See - https://git.io/fxJuV for more info. + https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info. Warning: When setting ``run_async`` to :obj:`True`, you cannot rely on adding custom @@ -155,7 +155,7 @@ def __init__( self.filters = Filters.update if message_updates is not None: warnings.warn( - 'message_updates is deprecated. See https://git.io/fxJuV for more info', + 'message_updates is deprecated. See https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info', TelegramDeprecationWarning, stacklevel=2, ) @@ -164,7 +164,7 @@ def __init__( if channel_post_updates is not None: warnings.warn( - 'channel_post_updates is deprecated. See https://git.io/fxJuV ' 'for more info', + 'channel_post_updates is deprecated. See https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 ' 'for more info', TelegramDeprecationWarning, stacklevel=2, ) @@ -173,7 +173,7 @@ def __init__( if edited_updates is not None: warnings.warn( - 'edited_updates is deprecated. See https://git.io/fxJuV for more info', + 'edited_updates is deprecated. See https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info', TelegramDeprecationWarning, stacklevel=2, ) diff --git a/telegram/ext/messagequeue.py b/telegram/ext/messagequeue.py index da2a7348d46..b4efa6efa22 100644 --- a/telegram/ext/messagequeue.py +++ b/telegram/ext/messagequeue.py @@ -50,7 +50,7 @@ class DelayQueue(threading.Thread): .. deprecated:: 13.3 :class:`telegram.ext.DelayQueue` in its current form is deprecated and will be reinvented - in a future release. See `this thread `_ for a list of known bugs. + in a future release. See `this thread `_ for a list of known bugs. Args: queue (:obj:`Queue`, optional): Used to pass callbacks to thread. Creates ``Queue`` @@ -92,7 +92,7 @@ def __init__( ): warnings.warn( 'DelayQueue in its current form is deprecated and will be reinvented in a future ' - 'release. See https://git.io/JtDbF for a list of known bugs.', + 'release. See https://github.com/python-telegram-bot/python-telegram-bot/issues/2139 for a list of known bugs.', category=TelegramDeprecationWarning, ) @@ -194,7 +194,7 @@ class MessageQueue: .. deprecated:: 13.3 :class:`telegram.ext.MessageQueue` in its current form is deprecated and will be reinvented - in a future release. See `this thread `_ for a list of known bugs. + in a future release. See `this thread `_ for a list of known bugs. Args: all_burst_limit (:obj:`int`, optional): Number of maximum *all-type* callbacks to process @@ -226,7 +226,7 @@ def __init__( ): warnings.warn( 'MessageQueue in its current form is deprecated and will be reinvented in a future ' - 'release. See https://git.io/JtDbF for a list of known bugs.', + 'release. See https://github.com/python-telegram-bot/python-telegram-bot/issues/2139 for a list of known bugs.', category=TelegramDeprecationWarning, ) diff --git a/telegram/ext/pollanswerhandler.py b/telegram/ext/pollanswerhandler.py index 53172b2b908..128ef3f0153 100644 --- a/telegram/ext/pollanswerhandler.py +++ b/telegram/ext/pollanswerhandler.py @@ -35,7 +35,7 @@ class PollAnswerHandler(Handler[Update, CCT]): or in the same chat, it will be the same ``dict``. Note that this is DEPRECATED, and you should use context based callbacks. See - https://git.io/fxJuV for more info. + https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info. Warning: When setting ``run_async`` to :obj:`True`, you cannot rely on adding custom diff --git a/telegram/ext/pollhandler.py b/telegram/ext/pollhandler.py index 0e2dee60009..15c31af1bda 100644 --- a/telegram/ext/pollhandler.py +++ b/telegram/ext/pollhandler.py @@ -35,7 +35,7 @@ class PollHandler(Handler[Update, CCT]): or in the same chat, it will be the same ``dict``. Note that this is DEPRECATED, and you should use context based callbacks. See - https://git.io/fxJuV for more info. + https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info. Warning: When setting ``run_async`` to :obj:`True`, you cannot rely on adding custom diff --git a/telegram/ext/precheckoutqueryhandler.py b/telegram/ext/precheckoutqueryhandler.py index bbef18efc2b..58ea2ddb678 100644 --- a/telegram/ext/precheckoutqueryhandler.py +++ b/telegram/ext/precheckoutqueryhandler.py @@ -35,7 +35,7 @@ class PreCheckoutQueryHandler(Handler[Update, CCT]): or in the same chat, it will be the same ``dict``. Note that this is DEPRECATED, and you should use context based callbacks. See - https://git.io/fxJuV for more info. + https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info. Warning: When setting ``run_async`` to :obj:`True`, you cannot rely on adding custom diff --git a/telegram/ext/regexhandler.py b/telegram/ext/regexhandler.py index 8211d83f5ad..0b729771a9c 100644 --- a/telegram/ext/regexhandler.py +++ b/telegram/ext/regexhandler.py @@ -128,7 +128,7 @@ def __init__( run_async: Union[bool, DefaultValue] = DEFAULT_FALSE, ): warnings.warn( - 'RegexHandler is deprecated. See https://git.io/fxJuV for more info', + 'RegexHandler is deprecated. See https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info', TelegramDeprecationWarning, stacklevel=2, ) diff --git a/telegram/ext/shippingqueryhandler.py b/telegram/ext/shippingqueryhandler.py index d8b0218dab2..01eb9abe758 100644 --- a/telegram/ext/shippingqueryhandler.py +++ b/telegram/ext/shippingqueryhandler.py @@ -34,7 +34,7 @@ class ShippingQueryHandler(Handler[Update, CCT]): or in the same chat, it will be the same ``dict``. Note that this is DEPRECATED, and you should use context based callbacks. See - https://git.io/fxJuV for more info. + https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info. Warning: When setting ``run_async`` to :obj:`True`, you cannot rely on adding custom diff --git a/tests/test_commandhandler.py b/tests/test_commandhandler.py index 2e5aba44d25..691352252b6 100644 --- a/tests/test_commandhandler.py +++ b/tests/test_commandhandler.py @@ -204,7 +204,7 @@ def test_command_list(self): def test_deprecation_warning(self): """``allow_edited`` deprecated in favor of filters""" - with pytest.warns(TelegramDeprecationWarning, match='See https://git.io/fxJuV'): + with pytest.warns(TelegramDeprecationWarning, match='See https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0'): self.make_default_handler(allow_edited=True) def test_edited(self, command_message): diff --git a/tests/test_messagehandler.py b/tests/test_messagehandler.py index 302df24cbac..306435374c0 100644 --- a/tests/test_messagehandler.py +++ b/tests/test_messagehandler.py @@ -149,11 +149,11 @@ def test_basic(self, dp, message): assert self.test_flag def test_deprecation_warning(self): - with pytest.warns(TelegramDeprecationWarning, match='See https://git.io/fxJuV'): + with pytest.warns(TelegramDeprecationWarning, match='See https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0'): MessageHandler(None, self.callback_basic, edited_updates=True) - with pytest.warns(TelegramDeprecationWarning, match='See https://git.io/fxJuV'): + with pytest.warns(TelegramDeprecationWarning, match='See https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0'): MessageHandler(None, self.callback_basic, message_updates=False) - with pytest.warns(TelegramDeprecationWarning, match='See https://git.io/fxJuV'): + with pytest.warns(TelegramDeprecationWarning, match='See https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0'): MessageHandler(None, self.callback_basic, channel_post_updates=True) def test_edited_deprecated(self, message): From 3e7e7b7d3c0164f647a01e5f1ab06905989dab3f Mon Sep 17 00:00:00 2001 From: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com> Date: Wed, 25 May 2022 20:50:22 +0200 Subject: [PATCH 2/2] pre-commit fixes --- telegram/dice.py | 5 +++-- telegram/ext/callbackcontext.py | 12 +++++++++--- telegram/ext/callbackqueryhandler.py | 3 ++- telegram/ext/chatjoinrequesthandler.py | 3 ++- telegram/ext/chatmemberhandler.py | 3 ++- telegram/ext/choseninlineresulthandler.py | 3 ++- telegram/ext/commandhandler.py | 10 +++++++--- telegram/ext/contexttypes.py | 3 ++- telegram/ext/dispatcher.py | 7 +++++-- telegram/ext/extbot.py | 3 ++- telegram/ext/handler.py | 6 ++++-- telegram/ext/inlinequeryhandler.py | 3 ++- telegram/ext/messagehandler.py | 16 ++++++++++++---- telegram/ext/messagequeue.py | 12 ++++++++---- telegram/ext/pollanswerhandler.py | 3 ++- telegram/ext/pollhandler.py | 3 ++- telegram/ext/precheckoutqueryhandler.py | 3 ++- telegram/ext/regexhandler.py | 4 +++- telegram/ext/shippingqueryhandler.py | 3 ++- tests/test_commandhandler.py | 6 +++++- tests/test_messagehandler.py | 18 +++++++++++++++--- 21 files changed, 93 insertions(+), 36 deletions(-) diff --git a/telegram/dice.py b/telegram/dice.py index ca26077a2ca..3af06437c6f 100644 --- a/telegram/dice.py +++ b/telegram/dice.py @@ -50,8 +50,9 @@ class Dice(TelegramObject): Telegram. If :attr:`emoji` is "🎰", each value corresponds to a unique combination of symbols, which - can be found at our `wiki `_. However, this behaviour is undocumented - and might be changed by Telegram. + can be found at our `wiki `_. + However, this behaviour is undocumented and might be changed by Telegram. Args: value (:obj:`int`): Value of the dice. 1-6 for dice, darts and bowling balls, 1-5 for diff --git a/telegram/ext/callbackcontext.py b/telegram/ext/callbackcontext.py index 050195c9370..9e2b2541e30 100644 --- a/telegram/ext/callbackcontext.py +++ b/telegram/ext/callbackcontext.py @@ -139,7 +139,9 @@ def bot_data(self) -> BD: @bot_data.setter def bot_data(self, value: object) -> NoReturn: raise AttributeError( - "You can not assign a new value to bot_data, see https://github.com/python-telegram-bot/python-telegram-bot/wiki/Storing-bot%2C-user-and-chat-related-data" + "You can not assign a new value to bot_data, " + "see https://github.com/python-telegram-bot/python-telegram-bot/wiki/Storing-bot%2C" + "-user-and-chat-related-data " ) @property @@ -160,7 +162,9 @@ def chat_data(self) -> Optional[CD]: @chat_data.setter def chat_data(self, value: object) -> NoReturn: raise AttributeError( - "You can not assign a new value to chat_data, see https://github.com/python-telegram-bot/python-telegram-bot/wiki/Storing-bot%2C-user-and-chat-related-data" + "You can not assign a new value to chat_data, " + "see https://github.com/python-telegram-bot/python-telegram-bot/wiki/Storing-bot%2C" + "-user-and-chat-related-data " ) @property @@ -175,7 +179,9 @@ def user_data(self) -> Optional[UD]: @user_data.setter def user_data(self, value: object) -> NoReturn: raise AttributeError( - "You can not assign a new value to user_data, see https://github.com/python-telegram-bot/python-telegram-bot/wiki/Storing-bot%2C-user-and-chat-related-data" + "You can not assign a new value to user_data, " + "see https://github.com/python-telegram-bot/python-telegram-bot/wiki/Storing-bot%2C" + "-user-and-chat-related-data " ) def refresh_data(self) -> None: diff --git a/telegram/ext/callbackqueryhandler.py b/telegram/ext/callbackqueryhandler.py index 2cfff6f9773..eca674a70a8 100644 --- a/telegram/ext/callbackqueryhandler.py +++ b/telegram/ext/callbackqueryhandler.py @@ -55,7 +55,8 @@ class CallbackQueryHandler(Handler[Update, CCT]): user or in the same chat, it will be the same ``dict``. Note that this is DEPRECATED, and you should use context based callbacks. See - https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info. + https://github.com/python-telegram-bot/python-telegram-bot/wiki\ + /Transition-guide-to-Version-12.0 for more info. * If your bot allows arbitrary objects as ``callback_data``, it may happen that the original ``callback_data`` for the incoming :class:`telegram.CallbackQuery`` can not be found. This is the case when either a malicious client tempered with the diff --git a/telegram/ext/chatjoinrequesthandler.py b/telegram/ext/chatjoinrequesthandler.py index b6a788c3efc..93e7272b77f 100644 --- a/telegram/ext/chatjoinrequesthandler.py +++ b/telegram/ext/chatjoinrequesthandler.py @@ -35,7 +35,8 @@ class ChatJoinRequestHandler(Handler[Update, CCT]): or in the same chat, it will be the same ``dict``. Note that this is DEPRECATED, and you should use context based callbacks. See - https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info. + https://github.com/python-telegram-bot/python-telegram-bot/wiki\ + /Transition-guide-to-Version-12.0 for more info. Warning: When setting ``run_async`` to :obj:`True`, you cannot rely on adding custom diff --git a/telegram/ext/chatmemberhandler.py b/telegram/ext/chatmemberhandler.py index e90ec7f6c79..83d0cdf6d72 100644 --- a/telegram/ext/chatmemberhandler.py +++ b/telegram/ext/chatmemberhandler.py @@ -39,7 +39,8 @@ class ChatMemberHandler(Handler[Update, CCT]): or in the same chat, it will be the same ``dict``. Note that this is DEPRECATED, and you should use context based callbacks. See - https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info. + https://github.com/python-telegram-bot/python-telegram-bot/wiki\ + /Transition-guide-to-Version-12.0 for more info. Warning: When setting ``run_async`` to :obj:`True`, you cannot rely on adding custom diff --git a/telegram/ext/choseninlineresulthandler.py b/telegram/ext/choseninlineresulthandler.py index 30ee307586c..65507fcde10 100644 --- a/telegram/ext/choseninlineresulthandler.py +++ b/telegram/ext/choseninlineresulthandler.py @@ -42,7 +42,8 @@ class ChosenInlineResultHandler(Handler[Update, CCT]): or in the same chat, it will be the same ``dict``. Note that this is DEPRECATED, and you should use context based callbacks. See - https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info. + https://github.com/python-telegram-bot/python-telegram-bot/wiki\ + /Transition-guide-to-Version-12.0 for more info. Warning: When setting ``run_async`` to :obj:`True`, you cannot rely on adding custom diff --git a/telegram/ext/commandhandler.py b/telegram/ext/commandhandler.py index 82ce9846a7b..3dd190fd92f 100644 --- a/telegram/ext/commandhandler.py +++ b/telegram/ext/commandhandler.py @@ -55,7 +55,8 @@ class CommandHandler(Handler[Update, CCT]): user or in the same chat, it will be the same :obj:`dict`. Note that this is DEPRECATED, and you should use context based callbacks. See - https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info. + https://github.com/python-telegram-bot/python-telegram-bot/wiki\ + /Transition-guide-to-Version-12.0 for more info. Warning: When setting ``run_async`` to :obj:`True`, you cannot rely on adding custom @@ -169,7 +170,9 @@ def __init__( if allow_edited is not None: warnings.warn( - 'allow_edited is deprecated. See https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info', + 'allow_edited is deprecated. See ' + 'https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition' + '-guide-to-Version-12.0 for more info', TelegramDeprecationWarning, stacklevel=2, ) @@ -288,7 +291,8 @@ class PrefixHandler(CommandHandler): user or in the same chat, it will be the same :obj:`dict`. Note that this is DEPRECATED, and you should use context based callbacks. See - https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info. + https://github.com/python-telegram-bot/python-telegram-bot/wiki\ + /Transition-guide-to-Version-12.0 for more info. Warning: When setting ``run_async`` to :obj:`True`, you cannot rely on adding custom diff --git a/telegram/ext/contexttypes.py b/telegram/ext/contexttypes.py index bf5ace29bae..fbde7f3c9f5 100644 --- a/telegram/ext/contexttypes.py +++ b/telegram/ext/contexttypes.py @@ -50,7 +50,8 @@ class ContextTypes(Generic[CCT, UD, CD, BD]): __slots__ = ('_context', '_bot_data', '_chat_data', '_user_data') - # overload signatures generated with https://gist.github.com/Bibo-Joshi/399382cda537fb01bd86b13c3d03a956 + # overload signatures generated with + # https://gist.github.com/Bibo-Joshi/399382cda537fb01bd86b13c3d03a956 @overload def __init__( diff --git a/telegram/ext/dispatcher.py b/telegram/ext/dispatcher.py index 11f6bbcf627..5d2bcb046e3 100644 --- a/telegram/ext/dispatcher.py +++ b/telegram/ext/dispatcher.py @@ -241,7 +241,9 @@ def __init__( if not use_context: warnings.warn( - 'Old Handler API is deprecated - see https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for details', + 'Old Handler API is deprecated - see ' + 'https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition' + '-guide-to-Version-12.0 for details', TelegramDeprecationWarning, stacklevel=3, ) @@ -763,7 +765,8 @@ def add_error_handler( asynchronously using :meth:`run_async`. Defaults to :obj:`False`. Note: - See https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info about switching to context based API. + See https://github.com/python-telegram-bot/python-telegram-bot/wiki\ + /Transition-guide-to-Version-12.0 for more info about switching to context based API. """ if callback in self.error_handlers: self.logger.debug('The callback is already registered as an error handler. Ignoring.') diff --git a/telegram/ext/extbot.py b/telegram/ext/extbot.py index 738224131fb..ff2de0830d7 100644 --- a/telegram/ext/extbot.py +++ b/telegram/ext/extbot.py @@ -62,7 +62,8 @@ class ExtBot(telegram.bot.Bot): arbitrary_callback_data (:obj:`bool` | :obj:`int`, optional): Whether to allow arbitrary objects as callback data for :class:`telegram.InlineKeyboardButton`. Pass an integer to specify the maximum number of objects cached in memory. For more - details, please see our `wiki `_. + details, please see our `wiki `_. Defaults to :obj:`False`. Attributes: diff --git a/telegram/ext/handler.py b/telegram/ext/handler.py index 124ddd5d2bc..9a42f9bd744 100644 --- a/telegram/ext/handler.py +++ b/telegram/ext/handler.py @@ -45,7 +45,8 @@ class Handler(Generic[UT, CCT], ABC): or in the same chat, it will be the same ``dict``. Note that this is DEPRECATED, and you should use context based callbacks. See - https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info. + https://github.com/python-telegram-bot/python-telegram-bot/wiki\ + /Transition-guide-to-Version-12.0 for more info. Warning: When setting ``run_async`` to :obj:`True`, you cannot rely on adding custom @@ -232,7 +233,8 @@ def collect_optional_args( it should subclass this method, but remember to call this super method. DEPRECATED: This method is being replaced by new context based callbacks. Please see - https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info. + https://github.com/python-telegram-bot/python-telegram-bot/wiki\ + /Transition-guide-to-Version-12.0 for more info. Args: dispatcher (:class:`telegram.ext.Dispatcher`): The dispatcher. diff --git a/telegram/ext/inlinequeryhandler.py b/telegram/ext/inlinequeryhandler.py index fff91f3f788..bb6dab0390b 100644 --- a/telegram/ext/inlinequeryhandler.py +++ b/telegram/ext/inlinequeryhandler.py @@ -55,7 +55,8 @@ class InlineQueryHandler(Handler[Update, CCT]): or in the same chat, it will be the same ``dict``. Note that this is DEPRECATED, and you should use context based callbacks. See - https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info. + https://github.com/python-telegram-bot/python-telegram-bot/wiki\ + /Transition-guide-to-Version-12.0 for more info. Warning: * When setting ``run_async`` to :obj:`True`, you cannot rely on adding custom diff --git a/telegram/ext/messagehandler.py b/telegram/ext/messagehandler.py index 4d6f02e22f2..7909d98e8d6 100644 --- a/telegram/ext/messagehandler.py +++ b/telegram/ext/messagehandler.py @@ -45,7 +45,8 @@ class MessageHandler(Handler[Update, CCT]): or in the same chat, it will be the same ``dict``. Note that this is DEPRECATED, and you should use context based callbacks. See - https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info. + https://github.com/python-telegram-bot/python-telegram-bot/wiki\ + /Transition-guide-to-Version-12.0 for more info. Warning: When setting ``run_async`` to :obj:`True`, you cannot rely on adding custom @@ -155,7 +156,9 @@ def __init__( self.filters = Filters.update if message_updates is not None: warnings.warn( - 'message_updates is deprecated. See https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info', + 'message_updates is deprecated. See ' + 'https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition' + '-guide-to-Version-12.0 for more info', TelegramDeprecationWarning, stacklevel=2, ) @@ -164,7 +167,10 @@ def __init__( if channel_post_updates is not None: warnings.warn( - 'channel_post_updates is deprecated. See https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 ' 'for more info', + 'channel_post_updates is deprecated. See ' + 'https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition' + '-guide-to-Version-12.0 ' + 'for more info', TelegramDeprecationWarning, stacklevel=2, ) @@ -173,7 +179,9 @@ def __init__( if edited_updates is not None: warnings.warn( - 'edited_updates is deprecated. See https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info', + 'edited_updates is deprecated. See ' + 'https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition' + '-guide-to-Version-12.0 for more info', TelegramDeprecationWarning, stacklevel=2, ) diff --git a/telegram/ext/messagequeue.py b/telegram/ext/messagequeue.py index b4efa6efa22..1d61b1eb750 100644 --- a/telegram/ext/messagequeue.py +++ b/telegram/ext/messagequeue.py @@ -50,7 +50,8 @@ class DelayQueue(threading.Thread): .. deprecated:: 13.3 :class:`telegram.ext.DelayQueue` in its current form is deprecated and will be reinvented - in a future release. See `this thread `_ for a list of known bugs. + in a future release. See `this thread `_ for a list of known bugs. Args: queue (:obj:`Queue`, optional): Used to pass callbacks to thread. Creates ``Queue`` @@ -92,7 +93,8 @@ def __init__( ): warnings.warn( 'DelayQueue in its current form is deprecated and will be reinvented in a future ' - 'release. See https://github.com/python-telegram-bot/python-telegram-bot/issues/2139 for a list of known bugs.', + 'release. See https://github.com/python-telegram-bot/python-telegram-bot/issues/2139 ' + 'for a list of known bugs.', category=TelegramDeprecationWarning, ) @@ -194,7 +196,8 @@ class MessageQueue: .. deprecated:: 13.3 :class:`telegram.ext.MessageQueue` in its current form is deprecated and will be reinvented - in a future release. See `this thread `_ for a list of known bugs. + in a future release. See `this thread `_ for a list of known bugs. Args: all_burst_limit (:obj:`int`, optional): Number of maximum *all-type* callbacks to process @@ -226,7 +229,8 @@ def __init__( ): warnings.warn( 'MessageQueue in its current form is deprecated and will be reinvented in a future ' - 'release. See https://github.com/python-telegram-bot/python-telegram-bot/issues/2139 for a list of known bugs.', + 'release. See https://github.com/python-telegram-bot/python-telegram-bot/issues/2139 ' + 'for a list of known bugs.', category=TelegramDeprecationWarning, ) diff --git a/telegram/ext/pollanswerhandler.py b/telegram/ext/pollanswerhandler.py index 128ef3f0153..cb9e5e97e89 100644 --- a/telegram/ext/pollanswerhandler.py +++ b/telegram/ext/pollanswerhandler.py @@ -35,7 +35,8 @@ class PollAnswerHandler(Handler[Update, CCT]): or in the same chat, it will be the same ``dict``. Note that this is DEPRECATED, and you should use context based callbacks. See - https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info. + https://github.com/python-telegram-bot/python-telegram-bot/wiki\ + /Transition-guide-to-Version-12.0 for more info. Warning: When setting ``run_async`` to :obj:`True`, you cannot rely on adding custom diff --git a/telegram/ext/pollhandler.py b/telegram/ext/pollhandler.py index 15c31af1bda..6c59a12e1a2 100644 --- a/telegram/ext/pollhandler.py +++ b/telegram/ext/pollhandler.py @@ -35,7 +35,8 @@ class PollHandler(Handler[Update, CCT]): or in the same chat, it will be the same ``dict``. Note that this is DEPRECATED, and you should use context based callbacks. See - https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info. + https://github.com/python-telegram-bot/python-telegram-bot/wiki\ + /Transition-guide-to-Version-12.0 for more info. Warning: When setting ``run_async`` to :obj:`True`, you cannot rely on adding custom diff --git a/telegram/ext/precheckoutqueryhandler.py b/telegram/ext/precheckoutqueryhandler.py index 58ea2ddb678..9e5940c4bd4 100644 --- a/telegram/ext/precheckoutqueryhandler.py +++ b/telegram/ext/precheckoutqueryhandler.py @@ -35,7 +35,8 @@ class PreCheckoutQueryHandler(Handler[Update, CCT]): or in the same chat, it will be the same ``dict``. Note that this is DEPRECATED, and you should use context based callbacks. See - https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info. + https://github.com/python-telegram-bot/python-telegram-bot/wiki\ + /Transition-guide-to-Version-12.0 for more info. Warning: When setting ``run_async`` to :obj:`True`, you cannot rely on adding custom diff --git a/telegram/ext/regexhandler.py b/telegram/ext/regexhandler.py index 0b729771a9c..5dcff58de27 100644 --- a/telegram/ext/regexhandler.py +++ b/telegram/ext/regexhandler.py @@ -128,7 +128,9 @@ def __init__( run_async: Union[bool, DefaultValue] = DEFAULT_FALSE, ): warnings.warn( - 'RegexHandler is deprecated. See https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info', + 'RegexHandler is deprecated. See ' + 'https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to' + '-Version-12.0 for more info', TelegramDeprecationWarning, stacklevel=2, ) diff --git a/telegram/ext/shippingqueryhandler.py b/telegram/ext/shippingqueryhandler.py index 01eb9abe758..fdc8873c6d6 100644 --- a/telegram/ext/shippingqueryhandler.py +++ b/telegram/ext/shippingqueryhandler.py @@ -34,7 +34,8 @@ class ShippingQueryHandler(Handler[Update, CCT]): or in the same chat, it will be the same ``dict``. Note that this is DEPRECATED, and you should use context based callbacks. See - https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for more info. + https://github.com/python-telegram-bot/python-telegram-bot/wiki\ + /Transition-guide-to-Version-12.0 for more info. Warning: When setting ``run_async`` to :obj:`True`, you cannot rely on adding custom diff --git a/tests/test_commandhandler.py b/tests/test_commandhandler.py index 691352252b6..f28cbebde09 100644 --- a/tests/test_commandhandler.py +++ b/tests/test_commandhandler.py @@ -204,7 +204,11 @@ def test_command_list(self): def test_deprecation_warning(self): """``allow_edited`` deprecated in favor of filters""" - with pytest.warns(TelegramDeprecationWarning, match='See https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0'): + with pytest.warns( + TelegramDeprecationWarning, + match='See https://github.com/python-telegram-bot/python-telegram-bot/wiki' + '/Transition-guide-to-Version-12.0', + ): self.make_default_handler(allow_edited=True) def test_edited(self, command_message): diff --git a/tests/test_messagehandler.py b/tests/test_messagehandler.py index 306435374c0..123fd1420ab 100644 --- a/tests/test_messagehandler.py +++ b/tests/test_messagehandler.py @@ -149,11 +149,23 @@ def test_basic(self, dp, message): assert self.test_flag def test_deprecation_warning(self): - with pytest.warns(TelegramDeprecationWarning, match='See https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0'): + with pytest.warns( + TelegramDeprecationWarning, + match='See https://github.com/python-telegram-bot/python-telegram-bot/wiki' + '/Transition-guide-to-Version-12.0', + ): MessageHandler(None, self.callback_basic, edited_updates=True) - with pytest.warns(TelegramDeprecationWarning, match='See https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0'): + with pytest.warns( + TelegramDeprecationWarning, + match='See https://github.com/python-telegram-bot/python-telegram-bot/wiki' + '/Transition-guide-to-Version-12.0', + ): MessageHandler(None, self.callback_basic, message_updates=False) - with pytest.warns(TelegramDeprecationWarning, match='See https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0'): + with pytest.warns( + TelegramDeprecationWarning, + match='See https://github.com/python-telegram-bot/python-telegram-bot/wiki' + '/Transition-guide-to-Version-12.0', + ): MessageHandler(None, self.callback_basic, channel_post_updates=True) def test_edited_deprecated(self, message):