mirror of
https://github.com/pyrogram/pyrogram
synced 2025-09-02 07:15:23 +00:00
Document on_callback_query
This commit is contained in:
@@ -228,6 +228,19 @@ class Client:
|
|||||||
return decorator
|
return decorator
|
||||||
|
|
||||||
def on_callback_query(self, filters=None, group: int = 0):
|
def on_callback_query(self, filters=None, group: int = 0):
|
||||||
|
"""Use this decorator to automatically register a function for handling
|
||||||
|
callback queries. This does the same thing as :meth:`add_handler` using the
|
||||||
|
CallbackQueryHandler.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
filters (:obj:`Filters <pyrogram.Filters>`):
|
||||||
|
Pass one or more filters to allow only a subset of callback queries to be passed
|
||||||
|
in your function.
|
||||||
|
|
||||||
|
group (``int``, optional):
|
||||||
|
The group identifier, defaults to 0.
|
||||||
|
"""
|
||||||
|
|
||||||
def decorator(func):
|
def decorator(func):
|
||||||
self.add_handler(pyrogram.CallbackQueryHandler(func, filters), group)
|
self.add_handler(pyrogram.CallbackQueryHandler(func, filters), group)
|
||||||
return func
|
return func
|
||||||
|
Reference in New Issue
Block a user