Skip to content

Commit 54b2087

Browse files
Fix filters.create documentation (pyrogram#623)
Wrong documentation for filters.create, callable funcitions requires 3 positional arguments (filter, client, update) and not two.
1 parent f407fac commit 54b2087

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pyrogram/filters.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,12 @@ def create(func: Callable, name: str = None, **kwargs) -> Filter:
127127
128128
Parameters:
129129
func (``callable``):
130-
A function that accepts two positional arguments *(filter, update)* and returns a boolean: True if the
131-
update should be handled, False otherwise. The *filter* argument refers to the filter itself and can be used
132-
to access keyword arguments (read below). The *update* argument type will vary depending on which
133-
`Handler <handlers>`_ is coming from. For example, in a :obj:`~pyrogram.handlers.MessageHandler` the
134-
*update* argument will be a :obj:`~pyrogram.types.Message`; in a
135-
:obj:`~pyrogram.handlers.CallbackQueryHandler` the *update* will be a :obj:`~pyrogram.types.CallbackQuery`.
130+
A function that accepts three positional arguments *(filter, client, update)* and returns a boolean: True if the
131+
update should be handled, False otherwise.
132+
The *filter* argument refers to the filter itself and can be used to access keyword arguments (read below).
133+
The *client* argument refers to the :obj:`~pyrogram.Client` that received the update.
134+
The *update* argument type will vary depending on which `Handler <handlers>`_ is coming from.
135+
For example, in a :obj:`~pyrogram.handlers.MessageHandler` the *update* argument will be a :obj:`~pyrogram.types.Message`; in a :obj:`~pyrogram.handlers.CallbackQueryHandler` the *update* will be a :obj:`~pyrogram.types.CallbackQuery`.
136136
Your function body can then access the incoming update attributes and decide whether to allow it or not.
137137
138138
name (``str``, *optional*):

0 commit comments

Comments
 (0)