@@ -9,9 +9,13 @@ Table of Contents
99
1010 - `Requirements `_
1111
12- - `Installation `_
13-
1412- `Getting Started `_
13+
14+ - `Installation `_
15+
16+ - `Setup `_
17+
18+ - `Usage `_
1519
1620- `Development `_
1721
@@ -62,20 +66,22 @@ Requirements
6266- Python 3.3 or higher.
6367
6468- A Telegram API key.
69+
6570
71+ Getting Started
72+ ===============
6673
6774Installation
68- ============
75+ ------------
6976
70- You can easily install and upgrade the library using standard Python tools:
77+ - You can easily install and upgrade the library using standard Python tools:
7178
72- .. code :: shell
79+ .. code :: shell
7380
74- $ pip install --upgrade pyrogram
75-
81+ $ pip install --upgrade pyrogram
7682
77- Getting Started
78- ===============
83+ Setup
84+ -----
7985
8086- Create a new ``config.ini `` file at the root of your working directory, copy-paste
8187 the following and replace the **api_id ** and **api_hash ** values with `your own `_:
@@ -86,20 +92,27 @@ Getting Started
8692 api_id = 12345
8793 api_hash = 0123456789abcdef0123456789abcdef
8894
89- - Then you can start with this:
95+ Usage
96+ -----
97+
98+ - You can now start by running the code below from a new Python file.
9099
91100 .. code :: python
92101
93102 from pyrogram import Client
94-
103+
104+ # Create and start a new Client
95105 client = Client(session_name = " example" )
96106 client.start()
97-
98- # Send a message to yourself (Saved Messages)
107+
108+ # Send a text message to yourself (Saved Messages)
99109 client.send_message(
100110 chat_id = " me" ,
101111 text = " Hi there! I'm using Pyrogram"
102112 )
113+
114+ # When done, stop the Client
115+ client.stop()
103116
104117 That's all you need for getting started with Pyrogram. For more detailed information,
105118please refer to the documentation:
@@ -165,7 +178,7 @@ License
165178
166179.. _`Introduction` : https://github.com/pyrogram/pyrogram/wiki/Getting-Started
167180
168- .. _`Telegram` : https://t.me/joinchat/AWDQ8lK2HgBN7ka4OyWVTw
181+ .. _`Telegram` : https://t.me/haskell
169182
170183.. _`bot-like` : https://core.telegram.org/bots/api#available-methods
171184
0 commit comments