From 999e8046c8045a6826f571c6c1f9695622ee0cc7 Mon Sep 17 00:00:00 2001 From: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com> Date: Thu, 12 May 2022 13:20:21 +0200 Subject: [PATCH 1/2] Update a number of github links to point to the v13.x branch --- README.rst | 6 ++-- README_RAW.rst | 2 +- examples/README.md | 46 ++++++++++++++--------------- telegram/ext/conversationhandler.py | 2 +- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/README.rst b/README.rst index 9839d10c170..89dd1c0f321 100644 --- a/README.rst +++ b/README.rst @@ -99,7 +99,7 @@ In addition to the pure API implementation, this library features a number of hi make the development of bots easy and straightforward. These classes are contained in the ``telegram.ext`` submodule. -A pure API implementation *without* ``telegram.ext`` is available as the standalone package ``python-telegram-bot-raw``. `See here for details. `_ +A pure API implementation *without* ``telegram.ext`` is available as the standalone package ``python-telegram-bot-raw``. `See here for details. `_ ---- Note @@ -171,7 +171,7 @@ look at ``echobot.py``, it is the de facto base for most of the bots out there. the code for these examples are released to the public domain, so you can start by grabbing the code and building on top of it. -Visit `this page `_ to discover the official examples or look at the examples on the `wiki `_ to see other bots the community has built. +Visit `this page `_ to discover the official examples or look at the examples on the `wiki `_ to see other bots the community has built. ------- Logging @@ -226,7 +226,7 @@ You can get help in several ways: Contributing ============ -Contributions of all sizes are welcome. Please review our `contribution guidelines `_ to get started. You can also help by `reporting bugs `_. +Contributions of all sizes are welcome. Please review our `contribution guidelines `_ to get started. You can also help by `reporting bugs `_. ======== Donating diff --git a/README_RAW.rst b/README_RAW.rst index d7b2fa37e7a..567a2089efd 100644 --- a/README_RAW.rst +++ b/README_RAW.rst @@ -208,7 +208,7 @@ You can get help in several ways: Contributing ============ -Contributions of all sizes are welcome. Please review our `contribution guidelines `_ to get started. You can also help by `reporting bugs `_. +Contributions of all sizes are welcome. Please review our `contribution guidelines `_ to get started. You can also help by `reporting bugs `_. ======== Donating diff --git a/examples/README.md b/examples/README.md index 7deb05ff363..ca4af2dd905 100644 --- a/examples/README.md +++ b/examples/README.md @@ -2,60 +2,60 @@ In this folder are small examples to show what a bot written with `python-telegram-bot` looks like. Some bots focus on one specific aspect of the Telegram Bot API while others focus on one of the mechanics of this library. Except for the [`rawapibot.py`](#pure-api) example, they all use the high-level framework this library provides with the [`telegram.ext`](https://python-telegram-bot.readthedocs.io/en/latest/telegram.ext.html) submodule. -All examples are licensed under the [CC0 License](https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/LICENSE.txt) and are therefore fully dedicated to the public domain. You can use them as the base for your own bots without worrying about copyrights. +All examples are licensed under the [CC0 License](https://github.com/python-telegram-bot/python-telegram-bot/blob/v13.x/examples/LICENSE.txt) and are therefore fully dedicated to the public domain. You can use them as the base for your own bots without worrying about copyrights. Do note that we ignore one pythonic convention. Best practice would dictate, in many handler callbacks function signatures, to replace the argument `context` with an underscore, since `context` is an unused local variable in those callbacks. However, since these are examples and not having a name for that argument confuses beginners, we decided to have it present. -### [`echobot.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/echobot.py) +### [`echobot.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/v13.x/examples/echobot.py) This is probably the base for most of the bots made with `python-telegram-bot`. It simply replies to each text message with a message that contains the same text. -### [`timerbot.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/timerbot.py) +### [`timerbot.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/v13.x/examples/timerbot.py) This bot uses the [`JobQueue`](https://python-telegram-bot.readthedocs.io/en/latest/telegram.ext.jobqueue.html) class to send timed messages. The user sets a timer by using `/set` command with a specific time, for example `/set 30`. The bot then sets up a job to send a message to that user after 30 seconds. The user can also cancel the timer by sending `/unset`. To learn more about the `JobQueue`, read [this wiki article](https://github.com/python-telegram-bot/python-telegram-bot/wiki/Extensions-%E2%80%93-JobQueue). -### [`conversationbot.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/conversationbot.py) -A common task for a bot is to ask information from the user. In v5.0 of this library, we introduced the [`ConversationHandler`](https://python-telegram-bot.readthedocs.io/en/latest/telegram.ext.conversationhandler.html) for that exact purpose. This example uses it to retrieve user-information in a conversation-like style. To get a better understanding, take a look at the [state diagram](https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/conversationbot.png). +### [`conversationbot.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/v13.x/examples/conversationbot.py) +A common task for a bot is to ask information from the user. In v5.0 of this library, we introduced the [`ConversationHandler`](https://python-telegram-bot.readthedocs.io/en/latest/telegram.ext.conversationhandler.html) for that exact purpose. This example uses it to retrieve user-information in a conversation-like style. To get a better understanding, take a look at the [state diagram](https://github.com/python-telegram-bot/python-telegram-bot/blob/v13.x/examples/conversationbot.png). -### [`conversationbot2.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/conversationbot2.py) -A more complex example of a bot that uses the `ConversationHandler`. It is also more confusing. Good thing there is a [fancy state diagram](https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/conversationbot2.png) for this one, too! +### [`conversationbot2.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/v13.x/examples/conversationbot2.py) +A more complex example of a bot that uses the `ConversationHandler`. It is also more confusing. Good thing there is a [fancy state diagram](https://github.com/python-telegram-bot/python-telegram-bot/blob/v13.x/examples/conversationbot2.png) for this one, too! -### [`nestedconversationbot.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/nestedconversationbot.py) -A even more complex example of a bot that uses the nested `ConversationHandler`s. While it's certainly not that complex that you couldn't built it without nested `ConversationHanldler`s, it gives a good impression on how to work with them. Of course, there is a [fancy state diagram](https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/nestedconversationbot.png) for this example, too! +### [`nestedconversationbot.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/v13.x/examples/nestedconversationbot.py) +A even more complex example of a bot that uses the nested `ConversationHandler`s. While it's certainly not that complex that you couldn't built it without nested `ConversationHanldler`s, it gives a good impression on how to work with them. Of course, there is a [fancy state diagram](https://github.com/python-telegram-bot/python-telegram-bot/blob/v13.x/examples/nestedconversationbot.png) for this example, too! -### [`persistentconversationbot.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/persistentconversationbot.py) +### [`persistentconversationbot.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/v13.x/examples/persistentconversationbot.py) 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) +### [`inlinekeyboard.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/v13.x/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. -### [`inlinekeyboard2.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/inlinekeyboard2.py) +### [`inlinekeyboard2.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/v13.x/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. -### [`deeplinking.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/deeplinking.py) +### [`deeplinking.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/v13.x/examples/deeplinking.py) A basic example on how to use deeplinking with inline keyboards. -### [`inlinebot.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/inlinebot.py) +### [`inlinebot.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/v13.x/examples/inlinebot.py) A basic example of an [inline bot](https://core.telegram.org/bots/inline). Don't forget to enable inline mode with [@BotFather](https://telegram.me/BotFather). -### [`pollbot.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/pollbot.py) +### [`pollbot.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/v13.x/examples/pollbot.py) 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. +### [`passportbot.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/v13.x/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/v13.x/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. -### [`paymentbot.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/paymentbot.py) +### [`paymentbot.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/v13.x/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). -### [`errorhandlerbot.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/errorhandlerbot.py) +### [`errorhandlerbot.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/v13.x/examples/errorhandlerbot.py) A basic example on how to set up a custom error handler. -### [`chatmemberbot.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/chatmemberbot.py) +### [`chatmemberbot.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/v13.x/examples/chatmemberbot.py) A basic example on how `(my_)chat_member` updates can be used. -### [`contexttypesbot.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/contexttypesbot.py) +### [`contexttypesbot.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/v13.x/examples/contexttypesbot.py) This example showcases how `telegram.ext.ContextTypes` can be used to customize the `context` argument of handler and job callbacks. -### [`arbitrarycallbackdatabot.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/arbitrarycallbackdatabot.py) +### [`arbitrarycallbackdatabot.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/v13.x/examples/arbitrarycallbackdatabot.py) This example showcases how PTBs "arbitrary callback data" feature can be used. ## Pure API -The [`rawapibot.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/rawapibot.py) example uses only the pure, "bare-metal" API wrapper. +The [`rawapibot.py`](https://github.com/python-telegram-bot/python-telegram-bot/blob/v13.x/examples/rawapibot.py) example uses only the pure, "bare-metal" API wrapper. diff --git a/telegram/ext/conversationhandler.py b/telegram/ext/conversationhandler.py index 23edf2f7576..d5c765902d1 100644 --- a/telegram/ext/conversationhandler.py +++ b/telegram/ext/conversationhandler.py @@ -119,7 +119,7 @@ class ConversationHandler(Handler[Update, CCT]): :attr:`END` to end the *parent* conversation from within the nested one. For an example on nested :class:`ConversationHandler` s, see our `examples`_. - .. _`examples`: https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples + .. _`examples`: https://github.com/python-telegram-bot/python-telegram-bot/blob/v13.x/examples Args: entry_points (List[:class:`telegram.ext.Handler`]): A list of ``Handler`` objects that can From 01f99799132babb62051888fcde5dd995852570c Mon Sep 17 00:00:00 2001 From: Sukka Date: Thu, 26 May 2022 02:57:12 +0800 Subject: [PATCH 2/2] Replace all `git.io` links with their actual URLs (#2973) * Replace all `git.io` links with their actual URLs * pre-commit fixes Co-authored-by: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com> --- .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 | 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/conversationhandler.py | 3 ++- telegram/ext/dispatcher.py | 7 +++++-- telegram/ext/extbot.py | 4 +++- 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 +++++++++++++++--- 30 files changed, 109 insertions(+), 48 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 ca4af2dd905..2e3bf11394e 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/v13.x/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/v13.x/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/v13.x/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/v13.x/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/v13.x/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/v13.x/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 ffe564b507b..f4fced0de76 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..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 607ca9277eb..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://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 +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://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 +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://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..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://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..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://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..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://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..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://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..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://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 +170,9 @@ 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 +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://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..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://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 d5c765902d1..91c913de27b 100644 --- a/telegram/ext/conversationhandler.py +++ b/telegram/ext/conversationhandler.py @@ -79,7 +79,8 @@ 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..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://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 +765,8 @@ 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..ff2de0830d7 100644 --- a/telegram/ext/extbot.py +++ b/telegram/ext/extbot.py @@ -62,7 +62,9 @@ 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..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://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 +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://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..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://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..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://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 +156,9 @@ 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 +167,10 @@ 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 +179,9 @@ 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..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://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 +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://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..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://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..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://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..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://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..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://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..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://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..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://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..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://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):