mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-03-17 04:39:55 +01:00
Notes on Filters.text accepting command messages (#1902)
This commit is contained in:
parent
314f87ec44
commit
57546795c5
1 changed files with 11 additions and 5 deletions
|
@ -273,8 +273,11 @@ class Filters(object):
|
|||
MessageHandler(Filters.text(buttons), callback_method)
|
||||
|
||||
Note:
|
||||
Dice messages don't have text. If you want to filter either text or dice messages, use
|
||||
``Filters.text | Filters.dice``.
|
||||
* Dice messages don't have text. If you want to filter either text or dice messages, use
|
||||
``Filters.text | Filters.dice``.
|
||||
* Messages containing a command are accepted by this filter. Use
|
||||
``Filters.text & (~Filters.command)``, if you want to filter only text messages without
|
||||
commands.
|
||||
|
||||
Args:
|
||||
update (List[:obj:`str`] | Tuple[:obj:`str`], optional): Which messages to allow. Only
|
||||
|
@ -350,6 +353,9 @@ class Filters(object):
|
|||
MessageHandler(Filters.command, command_at_start_callback)
|
||||
MessageHandler(Filters.command(False), command_anywhere_callback)
|
||||
|
||||
Note:
|
||||
``Filters.text`` also accepts messages containing a command.
|
||||
|
||||
Args:
|
||||
update (:obj:`bool`, optional): Whether to only allow messages that `start` with a bot
|
||||
command. Defaults to ``True``.
|
||||
|
@ -998,9 +1004,9 @@ officedocument.wordprocessingml.document")``-
|
|||
update (:obj:`int` | List[:obj:`int`], optional): Which values to allow. If not
|
||||
specified, will allow any dice message.
|
||||
|
||||
Note:
|
||||
Dice messages don't have text. If you want to filter either text or dice messages, use
|
||||
``Filters.text | Filters.dice``.
|
||||
Note:
|
||||
Dice messages don't have text. If you want to filter either text or dice messages, use
|
||||
``Filters.text | Filters.dice``.
|
||||
"""
|
||||
|
||||
class language(BaseFilter):
|
||||
|
|
Loading…
Add table
Reference in a new issue