Update README.rst

This commit is contained in:
Dan 2018-01-02 16:29:15 +01:00 committed by GitHub
parent 98e0109dde
commit bf6604c655
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,9 +9,13 @@ Table of Contents
- `Requirements`_ - `Requirements`_
- `Getting Started`_
- `Installation`_ - `Installation`_
- `Getting Started`_ - `Setup`_
- `Usage`_
- `Development`_ - `Development`_
@ -64,18 +68,20 @@ Requirements
- A Telegram API key. - A Telegram API key.
Installation Getting Started
============ ===============
You can easily install and upgrade the library using standard Python tools: Installation
------------
- 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