mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-31 20:54:51 +00:00
Merge pull request #248 from ColinTheShark/develop
Add Filter for Callback_Query.data
This commit is contained in:
commit
c0a2b4601a
1 changed files with 11 additions and 0 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Reference in a new issue