Hint about decorators on handlers' docstrings

This commit is contained in:
Dan 2018-06-22 12:46:35 +02:00
parent 2f80a0ba7f
commit ac47ffad8f
5 changed files with 15 additions and 1 deletions

View File

@ -23,6 +23,9 @@ 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>`
For a nicer way to register this handler, have a look at the
:meth:`on_callback_query() <pyrogram.Client.on_callback_query>` decorator.
Args:
callback (``callable``):
Pass a function that will be called when a new CallbackQuery arrives. It takes *(client, callback_query)*

View File

@ -20,10 +20,13 @@ from .handler import Handler
class DeletedMessagesHandler(Handler):
"""The Deleted Messages handler class. Used to handle deleted messages coming from any chat
"""The deleted Messages handler class. Used to handle deleted messages coming from any chat
(private, group, channel). It is intended to be used with
:meth:`add_handler() <pyrogram.Client.add_handler>`
For a nicer way to register this handler, have a look at the
:meth:`on_deleted_messages() <pyrogram.Client.on_deleted_messages>` decorator.
Args:
callback (``callable``):
Pass a function that will be called when one or more Messages have been deleted.

View File

@ -23,6 +23,8 @@ class DisconnectHandler(Handler):
"""The Disconnect handler class. Used to handle disconnections. It is intended to be used with
:meth:`add_handler() <pyrogram.Client.add_handler>`
For a nicer way to register this handler, have a look at the
:meth:`on_disconnect() <pyrogram.Client.on_disconnect>` decorator.
Args:
callback (``callable``):

View File

@ -24,6 +24,9 @@ class MessageHandler(Handler):
any chat (private, group, channel). It is intended to be used with
:meth:`add_handler() <pyrogram.Client.add_handler>`
For a nicer way to register this handler, have a look at the
:meth:`on_message() <pyrogram.Client.on_message>` decorator.
Args:
callback (``callable``):
Pass a function that will be called when a new Message arrives. It takes *(client, message)*

View File

@ -23,6 +23,9 @@ class RawUpdateHandler(Handler):
"""The Raw Update handler class. Used to handle raw updates. It is intended to be used with
:meth:`add_handler() <pyrogram.Client.add_handler>`
For a nicer way to register this handler, have a look at the
:meth:`on_raw_update() <pyrogram.Client.on_raw_update>` decorator.
Args:
callback (``callable``):
A function that will be called when a new update is received from the server. It takes