Slightly change docs for events (#668)

This commit is contained in:
Lonami Exo
2018-03-24 12:41:42 +01:00
parent 69d283a296
commit 13e59983af
2 changed files with 24 additions and 2 deletions

View File

@@ -66,6 +66,26 @@ Basic Usage
**More details**: :ref:`telegram-client`
Handling Updates
****************
.. code-block:: python
from telethon import events
# We need to have some worker running
client.updates.workers = 1
@client.on(events.NewMessage(incoming=True, pattern='(?i)hi'))
def handler(event):
event.reply('Hello!')
# If you want to handle updates you can't let the script end.
input('Press enter to exit.')
**More details**: :ref:`working-with-updates`
----------
You can continue by clicking on the "More details" link below each