From d94fdea30fb89ffed63fa013bb4d254f40ffd927 Mon Sep 17 00:00:00 2001 From: Iulian Onofrei Date: Fri, 21 Apr 2017 03:08:28 +0300 Subject: [PATCH 1/4] Fix Filters documentation --- telegram/ext/filters.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telegram/ext/filters.py b/telegram/ext/filters.py index 4b3cbd48244..811a69105d6 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,7 @@ 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 From ac8ccc8b3a9a550eb36b7647574a1544b80e8168 Mon Sep 17 00:00:00 2001 From: Iulian Onofrei Date: Tue, 25 Apr 2017 12:39:00 +0300 Subject: [PATCH 2/4] Update filters.py Ignore long line for flake --- telegram/ext/filters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telegram/ext/filters.py b/telegram/ext/filters.py index 811a69105d6..a4961a64675 100644 --- a/telegram/ext/filters.py +++ b/telegram/ext/filters.py @@ -38,7 +38,7 @@ class BaseFilter(object): Also works with more than two filters: - >>> (Filters.text & (Filters.entity(MessageEntity.URL) | Filters.entity(MessageEntity.TEXT_LINK))) + >>> (Filters.text & (Filters.entity(MessageEntity.URL) | Filters.entity(MessageEntity.TEXT_LINK))) .. # noqa: E501 >>> Filters.text & (~ Filters.forwarded) If you want to create your own filters create a class inheriting from this class and implement From ca431b0ded5fd671a6c762c9c7085ae646d398b8 Mon Sep 17 00:00:00 2001 From: Iulian Onofrei Date: Tue, 25 Apr 2017 13:47:28 +0300 Subject: [PATCH 3/4] Added myself as a contributor --- AUTHORS.rst | 1 + 1 file changed, 1 insertion(+) 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 `_ From f57e5a469dbaf2f77732d26de8eec83006ff781b Mon Sep 17 00:00:00 2001 From: Iulian Onofrei Date: Tue, 25 Apr 2017 18:24:47 +0300 Subject: [PATCH 4/4] Break long line to pass flake validation --- telegram/ext/filters.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/telegram/ext/filters.py b/telegram/ext/filters.py index a4961a64675..b6da4137bbb 100644 --- a/telegram/ext/filters.py +++ b/telegram/ext/filters.py @@ -38,7 +38,11 @@ class BaseFilter(object): Also works with more than two filters: - >>> (Filters.text & (Filters.entity(MessageEntity.URL) | Filters.entity(MessageEntity.TEXT_LINK))) .. # noqa: E501 + >>> ( + ... 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