mirror of
https://github.com/pyrogram/pyrogram
synced 2025-09-01 06:45:39 +00:00
Update README.rst
This commit is contained in:
34
README.rst
34
README.rst
@@ -13,12 +13,10 @@ Table of Contents
|
|||||||
|
|
||||||
- `Installation`_
|
- `Installation`_
|
||||||
|
|
||||||
- `Setup`_
|
- `Configuration`_
|
||||||
|
|
||||||
- `Usage`_
|
- `Usage`_
|
||||||
|
|
||||||
- `Development`_
|
|
||||||
|
|
||||||
- `Documentation`_
|
- `Documentation`_
|
||||||
|
|
||||||
- `Contribution`_
|
- `Contribution`_
|
||||||
@@ -80,8 +78,8 @@ Installation
|
|||||||
|
|
||||||
$ pip install --upgrade pyrogram
|
$ pip install --upgrade pyrogram
|
||||||
|
|
||||||
Setup
|
Configuration
|
||||||
-----
|
-------------
|
||||||
|
|
||||||
- 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`_:
|
||||||
@@ -95,23 +93,18 @@ Setup
|
|||||||
Usage
|
Usage
|
||||||
-----
|
-----
|
||||||
|
|
||||||
- You can now start by running the code below from a new Python file.
|
- And here's how Pyrogram looks:
|
||||||
|
|
||||||
.. code:: python
|
.. code:: python
|
||||||
|
|
||||||
from pyrogram import Client
|
from pyrogram import Client
|
||||||
|
|
||||||
# Create and start a new Client
|
client = Client("example")
|
||||||
client = Client(session_name="example")
|
|
||||||
client.start()
|
client.start()
|
||||||
|
|
||||||
# Send a text message to yourself (Saved Messages)
|
client.send_message("me", "Hi there! I'm using Pyrogram")
|
||||||
client.send_message(
|
client.send_photo("me", "/home/dan/pic.jpg", "Nice photo!")
|
||||||
chat_id="me",
|
|
||||||
text="Hi there! I'm using Pyrogram"
|
|
||||||
)
|
|
||||||
|
|
||||||
# When done, stop the Client
|
|
||||||
client.stop()
|
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,
|
||||||
@@ -119,23 +112,12 @@ please refer to the documentation:
|
|||||||
|
|
||||||
- Docs: https://docs.pyrogram.ml.
|
- Docs: https://docs.pyrogram.ml.
|
||||||
|
|
||||||
Development
|
|
||||||
===========
|
|
||||||
|
|
||||||
The library is still in its early stages, thus lots of functionalities aiming to
|
|
||||||
make working with Telegram's API easy are yet to be added and documented.
|
|
||||||
|
|
||||||
However, being the core functionalities already implemented, every Telegram API
|
|
||||||
method listed in the API scheme can be used right away; the goal is therefore to
|
|
||||||
build a powerful, simple to use, `bot-like`_ interface on top of those low-level
|
|
||||||
functions.
|
|
||||||
|
|
||||||
|
|
||||||
Documentation
|
Documentation
|
||||||
=============
|
=============
|
||||||
|
|
||||||
- The entire Pyrogram's documentation resides at https://docs.pyrogram.ml.
|
- The entire Pyrogram's documentation resides at https://docs.pyrogram.ml.
|
||||||
|
|
||||||
|
|
||||||
Contribution
|
Contribution
|
||||||
============
|
============
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user