From ed05c56f5236e15dbe3922ae50eb522d361607a5 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sun, 19 Aug 2018 17:22:28 +0200 Subject: [PATCH] Clearer Filters docs. Add create to Filters' namespace --- pyrogram/client/filters/filters.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pyrogram/client/filters/filters.py b/pyrogram/client/filters/filters.py index ba8e7c4b..043f29ff 100644 --- a/pyrogram/client/filters/filters.py +++ b/pyrogram/client/filters/filters.py @@ -31,8 +31,14 @@ def create(name: str, func: callable, **kwargs) -> type: class Filters: - """This class provides access to all Filters available in Pyrogram. - Filters are intended to be used with the :obj:`MessageHandler `.""" + """This class provides access to all library-defined Filters available in Pyrogram. + + The Filters listed here are intended to be used with the :obj:`MessageHandler ` only. + At the moment, if you want to filter updates coming from different `Handlers `_ you have to create + your own filters with :meth:`Filters.create` and use them in the same way. + """ + + create = create bot = create("Bot", lambda _, m: bool(m.from_user and m.from_user.is_bot)) """Filter messages coming from bots"""