mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-01-06 10:44:42 +01:00
Fix docstring according to Jannes' commentns.
This commit is contained in:
parent
79bdfe4c5d
commit
ca5e3146c6
1 changed files with 9 additions and 3 deletions
|
@ -26,7 +26,7 @@ class BaseFilter(object):
|
||||||
|
|
||||||
And:
|
And:
|
||||||
|
|
||||||
>>> (Filters.text & Filters.entity(MENTION)
|
>>> (Filters.text & Filters.entity(MENTION))
|
||||||
|
|
||||||
Or:
|
Or:
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ class BaseFilter(object):
|
||||||
|
|
||||||
Also works with more than two filters:
|
Also works with more than two filters:
|
||||||
|
|
||||||
>>> (Filters.text & (Filters.entity(URL |Filters.entity(TEXT_LINK))))
|
>>> (Filters.text & (Filters.entity(URL) | Filters.entity(TEXT_LINK)))
|
||||||
|
|
||||||
If you want to create your own filters create a class inheriting from this class and implement
|
If you want to create your own filters create a class inheriting from this class and implement
|
||||||
a `filter` method that returns a boolean: `True` if the message should be handled, `False`
|
a `filter` method that returns a boolean: `True` if the message should be handled, `False`
|
||||||
|
@ -56,7 +56,13 @@ class BaseFilter(object):
|
||||||
|
|
||||||
|
|
||||||
class MergedFilter(BaseFilter):
|
class MergedFilter(BaseFilter):
|
||||||
"""Represents a filter consisting of two other filters."""
|
"""Represents a filter consisting of two other filters.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
base_filter: Filter 1 of the merged filter
|
||||||
|
and_filter: Optional filter to "and" with base_filter. Mutually exclusive with or_filter.
|
||||||
|
or_filter: Optional filter to "or" with base_filter. Mutually exclusive with and_filter.
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(self, base_filter, and_filter=None, or_filter=None):
|
def __init__(self, base_filter, and_filter=None, or_filter=None):
|
||||||
self.base_filter = base_filter
|
self.base_filter = base_filter
|
||||||
|
|
Loading…
Reference in a new issue