diff --git a/AUTHORS.rst b/AUTHORS.rst index b39f7fed45d..ae47d4ef9dd 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -21,6 +21,7 @@ The following wonderful people contributed directly or indirectly to this projec - `Eugene Lisitsky `_ - `franciscod `_ - `Hugo Damer `_ +- `Iulian Onofrei `_ - `Jacob Bom `_ - `JASON0916 `_ - `jh0ker `_ diff --git a/telegram/ext/filters.py b/telegram/ext/filters.py index 4b3cbd48244..b6da4137bbb 100644 --- a/telegram/ext/filters.py +++ b/telegram/ext/filters.py @@ -26,7 +26,7 @@ class BaseFilter(object): And: - >>> (Filters.text & Filters.entity(MENTION)) + >>> (Filters.text & Filters.entity(MessageEntity.MENTION)) Or: @@ -38,7 +38,11 @@ class BaseFilter(object): Also works with more than two filters: - >>> (Filters.text & (Filters.entity(URL) | Filters.entity(TEXT_LINK))) + >>> ( + ... Filters.text & ( + ... Filters.entity(MessageEntity.URL) | Filters.entity(MessageEntity.TEXT_LINK) + ... ) + ... ) >>> Filters.text & (~ Filters.forwarded) If you want to create your own filters create a class inheriting from this class and implement