From 4eed29393364f70d8f4edbc9459d32884fe4e184 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sun, 29 Apr 2018 18:46:35 +0200 Subject: [PATCH] Document on_callback_query --- pyrogram/client/client.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index e5360dd8..af776471 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -228,6 +228,19 @@ class Client: return decorator 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 `): + 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): self.add_handler(pyrogram.CallbackQueryHandler(func, filters), group) return func