diff --git a/pyrogram/client/filters/filters.py b/pyrogram/client/filters/filters.py index 9c80d870..1d962e85 100644 --- a/pyrogram/client/filters/filters.py +++ b/pyrogram/client/filters/filters.py @@ -339,4 +339,15 @@ class Filters: and message.from_user.is_self and not message.outgoing))) + @staticmethod + def callback_data(data: str or bytes): + """Filter callback queries for their data. + + Parameters: + data (``str`` | ``bytes``): + Pass the data you want to filter for. + """ + + return create("CallbackData", lambda flt, cb: cb.data == flt.data, data=data) + dan = create("Dan", lambda _, m: bool(m.from_user and m.from_user.id == 23122162))