mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-10-23 17:36:26 +02:00
Revert "Updated Frequently Asked Questions (markdown)"
This reverts commit 4e2d4dc6ea6379697788af03ba7f332abf05a13c.
parent
e1ec745217
commit
ed71db96b3
1 changed files with 0 additions and 14 deletions
|
@ -13,7 +13,6 @@
|
|||
- [I want to handle updates from an external service in addition to the Telegram updates. How do I do that?](#i-want-to-handle-updates-from-an-external-service-in-addition-to-the-telegram-updates-how-do-i-do-that)
|
||||
- [Why am I getting `ImportError: cannot import name 'XY' from 'telegram'`?](#why-am-i-getting-importerror-cannot-import-name-xy-from-telegram)
|
||||
- [What do the `per_*` settings in `ConversationHandler` do?](#what-do-the-per_-settings-in-conversationhandler-do)
|
||||
- [How can I disable the `per_*` settings warnings?](#how-can-i-disable-these-warnings-though)
|
||||
- [Can I check, if a `ConversationHandler` is currently active for a user?](#can-i-check-if-a-conversationhandler-is-currently-active-for-a-user)
|
||||
- [How can I list all messages of a particular chat or search through them based on a search query?](#how-can-i-list-all-messages-of-a-particular-chat-or-search-through-them-based-on-a-search-query)
|
||||
- [Why am I getting an error `The following arguments have not been supplied`?](#why-am-i-getting-an-error-the-following-arguments-have-not-been-supplied)
|
||||
|
@ -119,19 +118,6 @@ Note that this approach can only work, if all the handlers in the conversation a
|
|||
|
||||
**Note:** If you have a `CallbackQueryHandler` in your `ConversationHandler`, you will see a warning `If 'per_message=True/False', …`. It is a *warning*, not an error. If you're sure that you set `per_message` to the correct value, you can just ignore it.
|
||||
|
||||
### How can I disable these warnings though
|
||||
|
||||
They are generated with the [warnings](https://docs.python.org/3/library/warnings.html) module, so we can disable them using the module as well. For this example, we will use the [filterwarnings](https://docs.python.org/3/library/warnings.html#warnings.filterwarnings) method. So in your code, before you initiate the `ConversationHandler`, do the following:
|
||||
|
||||
```python
|
||||
from warnings import filterwarnings
|
||||
from telegram.warnings import PTBUserWarning
|
||||
|
||||
filterwarnings(action="ignore", message=r".*CallbackQueryHandler", category=PTBUserWarning)
|
||||
```
|
||||
|
||||
Depending on your use case, you might have to change the message, but all other warnings shouldn't be raised without a reason, don't say we didn't do our best to warn you.
|
||||
|
||||
### Can I check, if a `ConversationHandler` is currently active for a user?
|
||||
|
||||
There is no built-in way to do that. You can however easily set a flag as e.g. `context.user_data['in_conversation'] = True` in your `entry_points`s and set it to `False` before returning `ConversationHandler.END`.
|
||||
|
|
Loading…
Reference in a new issue