From 255d33cefc5628085f58c32a9a4012521458d79f Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Thu, 12 Apr 2018 14:13:58 +0200 Subject: [PATCH] Update snippet --- docs/source/index.rst | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/docs/source/index.rst b/docs/source/index.rst index fc3ede99..38403c58 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -35,6 +35,22 @@ Welcome to Pyrogram

+.. code-block:: python + + from pyrogram import Client, Filters + + app = Client("my_account") + + + @app.on_message(Filters.private) + def hello(client, message): + client.send_message( + message.chat.id, "Hello {}".format(message.from_user.first_name)) + + + app.start() + app.idle() + About ----- @@ -45,16 +61,6 @@ button at the end of each page. But first, here's a brief overview of what is th **Pyrogram** is a brand new Telegram_ Client Library written from the ground up in Python and C. It can be used for building custom Telegram applications in Python that interact with the MTProto API as both User and Bot. -.. code-block:: python - - from pyrogram import Client - - client = Client("example") - client.start() - - client.send_message("me", "Hi there! I'm using Pyrogram") - - client.stop() Features --------