From b2fb6b6a8e00d370ec2026e8567ce63d4a2ef003 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joscha=20G=C3=B6tzer?= Date: Tue, 13 Mar 2018 17:14:49 +0100 Subject: [PATCH] Update README.rst --- README.rst | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index a2e0d3de..7e45d7ef 100755 --- a/README.rst +++ b/README.rst @@ -41,8 +41,8 @@ Creating a client client.start() -Doing stuff ------------ +Working with Telethon +--------------------- .. code:: python @@ -54,6 +54,18 @@ Doing stuff client.download_profile_photo('me') messages = client.get_message_history('username') client.download_media(messages[0]) + + +Responding to events +-------------------- + +.. code:: python + + from telethon import events + + @client.on(events.NewMessage(incoming=True)) + def echo(event): + event.reply(event.text) Next steps