2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-28 21:07:59 +00:00

Updated Update Handling (markdown)

Dan 2017-12-25 13:32:07 +01:00
parent c8e327bd9e
commit f9b5806a5b

@ -19,13 +19,15 @@ client.start()
client.idle() client.idle()
``` ```
The last line, `client.idle()` is not strictly necessary but highly recommended; it will block your script execution until you press <kbd>CTRL+C</kbd> and automatically call the `stop` method which stops the Client and gently close the underlying connection. The last line, `client.idle()` is not strictly necessary but highly recommended; it will block your script execution until you press <kbd>CTRL</kbd><kbd>C</kbd> and automatically call the `stop` method which stops the Client and gently close the underlying connection.
# Examples # Examples
- Echo: - Echo:
``` python ``` python
from pyrogram.api import types
def callback(update): def callback(update):
if isinstance(update, types.UpdateShortMessage) and not update.out: if isinstance(update, types.UpdateShortMessage) and not update.out:
client.send_message(update.user_id, update.message) client.send_message(update.user_id, update.message)