2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-09-02 23:35:17 +00:00

Add CallbackQuery to docs

This commit is contained in:
Dan
2018-04-29 19:06:35 +02:00
parent 4eed293933
commit d3472fd052
9 changed files with 46 additions and 6 deletions

View File

@@ -37,7 +37,7 @@ class MessageHandler(Handler):
client (:obj:`Client <pyrogram.Client>`):
The Client itself, useful when you want to call other API methods inside the message handler.
message (:obj:`Message <pyrogram.api.types.pyrogram.Message>`):
message (:obj:`Message <pyrogram.Message>`):
The received message.
"""
@@ -53,6 +53,26 @@ class MessageHandler(Handler):
class CallbackQueryHandler(Handler):
"""The CallbackQuery handler class. Used to handle callback queries coming from inline buttons.
It is intended to be used with :meth:`add_handler() <pyrogram.Client.add_handler>`
Args:
callback (``callable``):
Pass a function that will be called when a new CallbackQuery arrives. It takes *(client, callback_query)*
as positional arguments (look at the section below for a detailed description).
filters (:obj:`Filters <pyrogram.Filters>`):
Pass one or more filters to allow only a subset of callback queries to be passed
in your callback function.
Other parameters:
client (:obj:`Client <pyrogram.Client>`):
The Client itself, useful when you want to call other API methods inside the message handler.
callback_query (:obj:`CallbackQuery <pyrogram.CallbackQuery>`):
The received callback query.
"""
def __init__(self, callback: callable, filters=None):
super().__init__(callback, filters)

View File

@@ -32,14 +32,14 @@ class CallbackQuery(Object):
id (``str``):
Unique identifier for this query.
from_user (:obj:`User <pyrogram.types.User>`):
from_user (:obj:`User <pyrogram.User>`):
Sender.
chat_instance (``str``, optional):
Message with the callback button that originated the query. Note that message content and message date will
not be available if the message is too old.
message (:obj:`Message <pyrogram.types.Message>`, optional):
message (:obj:`Message <pyrogram.Message>`, optional):
Identifier of the message sent via the bot in inline mode, that originated the query.
inline_message_id (``str``):