Update README.rst
This commit is contained in:
parent
98e0109dde
commit
bf6604c655
35
README.rst
35
README.rst
@ -9,10 +9,14 @@ Table of Contents
|
|||||||
|
|
||||||
- `Requirements`_
|
- `Requirements`_
|
||||||
|
|
||||||
- `Installation`_
|
|
||||||
|
|
||||||
- `Getting Started`_
|
- `Getting Started`_
|
||||||
|
|
||||||
|
- `Installation`_
|
||||||
|
|
||||||
|
- `Setup`_
|
||||||
|
|
||||||
|
- `Usage`_
|
||||||
|
|
||||||
- `Development`_
|
- `Development`_
|
||||||
|
|
||||||
- `Documentation`_
|
- `Documentation`_
|
||||||
@ -64,18 +68,20 @@ Requirements
|
|||||||
- A Telegram API key.
|
- A Telegram API key.
|
||||||
|
|
||||||
|
|
||||||
|
Getting Started
|
||||||
|
===============
|
||||||
|
|
||||||
Installation
|
Installation
|
||||||
============
|
------------
|
||||||
|
|
||||||
You can easily install and upgrade the library using standard Python tools:
|
- You can easily install and upgrade the library using standard Python tools:
|
||||||
|
|
||||||
.. code:: shell
|
.. code:: shell
|
||||||
|
|
||||||
$ pip install --upgrade pyrogram
|
$ pip install --upgrade pyrogram
|
||||||
|
|
||||||
|
Setup
|
||||||
Getting Started
|
-----
|
||||||
===============
|
|
||||||
|
|
||||||
- Create a new ``config.ini`` file at the root of your working directory, copy-paste
|
- Create a new ``config.ini`` file at the root of your working directory, copy-paste
|
||||||
the following and replace the **api_id** and **api_hash** values with `your own`_:
|
the following and replace the **api_id** and **api_hash** values with `your own`_:
|
||||||
@ -86,21 +92,28 @@ Getting Started
|
|||||||
api_id = 12345
|
api_id = 12345
|
||||||
api_hash = 0123456789abcdef0123456789abcdef
|
api_hash = 0123456789abcdef0123456789abcdef
|
||||||
|
|
||||||
- Then you can start with this:
|
Usage
|
||||||
|
-----
|
||||||
|
|
||||||
|
- You can now start by running the code below from a new Python file.
|
||||||
|
|
||||||
.. code:: python
|
.. code:: python
|
||||||
|
|
||||||
from pyrogram import Client
|
from pyrogram import Client
|
||||||
|
|
||||||
|
# Create and start a new Client
|
||||||
client = Client(session_name="example")
|
client = Client(session_name="example")
|
||||||
client.start()
|
client.start()
|
||||||
|
|
||||||
# Send a message to yourself (Saved Messages)
|
# Send a text message to yourself (Saved Messages)
|
||||||
client.send_message(
|
client.send_message(
|
||||||
chat_id="me",
|
chat_id="me",
|
||||||
text="Hi there! I'm using Pyrogram"
|
text="Hi there! I'm using Pyrogram"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# When done, stop the Client
|
||||||
|
client.stop()
|
||||||
|
|
||||||
That's all you need for getting started with Pyrogram. For more detailed information,
|
That's all you need for getting started with Pyrogram. For more detailed information,
|
||||||
please refer to the documentation:
|
please refer to the documentation:
|
||||||
|
|
||||||
@ -165,7 +178,7 @@ License
|
|||||||
|
|
||||||
.. _`Introduction`: https://github.com/pyrogram/pyrogram/wiki/Getting-Started
|
.. _`Introduction`: https://github.com/pyrogram/pyrogram/wiki/Getting-Started
|
||||||
|
|
||||||
.. _`Telegram`: https://t.me/joinchat/AWDQ8lK2HgBN7ka4OyWVTw
|
.. _`Telegram`: https://t.me/haskell
|
||||||
|
|
||||||
.. _`bot-like`: https://core.telegram.org/bots/api#available-methods
|
.. _`bot-like`: https://core.telegram.org/bots/api#available-methods
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user