mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-28 21:07:59 +00:00
Merge pull request #248 from ColinTheShark/develop
Add Filter for Callback_Query.data
This commit is contained in:
commit
c0a2b4601a
@ -339,4 +339,15 @@ class Filters:
|
|||||||
and message.from_user.is_self
|
and message.from_user.is_self
|
||||||
and not message.outgoing)))
|
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))
|
dan = create("Dan", lambda _, m: bool(m.from_user and m.from_user.id == 23122162))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user