From 6f820cce97997d317292d3a5973555d8ef3921bb Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Sat, 17 Mar 2018 17:07:56 +0100 Subject: [PATCH] Mention add_event_handler in the docs and fix small nit --- readthedocs/extra/basic/working-with-updates.rst | 14 ++++++++++++++ .../developing/telegram-api-in-other-languages.rst | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/readthedocs/extra/basic/working-with-updates.rst b/readthedocs/extra/basic/working-with-updates.rst index 105e11bd..308c3a79 100644 --- a/readthedocs/extra/basic/working-with-updates.rst +++ b/readthedocs/extra/basic/working-with-updates.rst @@ -140,6 +140,20 @@ random number, while if you say ``'eval 4+4'``, you will reply with the solution. Try it! +Events without decorators +************************* + +If for any reason you can't use the ``@client.on`` syntax, don't worry. +You can call ``client.add_event_handler(callback, event)`` to achieve +the same effect. + +Similar to that method, you also have :meth:`client.remove_event_handler` +and :meth:`client.list_event_handlers` which do as they names indicate. + +The ``event`` type is optional in all methods and defaults to ``events.Raw`` +for adding, and ``None`` when removing (so all callbacks would be removed). + + Stopping propagation of Updates ******************************* diff --git a/readthedocs/extra/developing/telegram-api-in-other-languages.rst b/readthedocs/extra/developing/telegram-api-in-other-languages.rst index 7637282e..22bb416a 100644 --- a/readthedocs/extra/developing/telegram-api-in-other-languages.rst +++ b/readthedocs/extra/developing/telegram-api-in-other-languages.rst @@ -38,9 +38,9 @@ Kotlin ****** `Kotlogram `__ is a Telegram -implementation written in Kotlin (the now +implementation written in Kotlin (one of the `official `__ -language for +languages for `Android `__) by `@badoualy `__, currently as a beta– yet working.