2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-29 13:27:47 +00:00

Update docs

This commit is contained in:
Dan 2018-03-24 14:47:20 +01:00
parent deb5c17612
commit 4049886e7a
5 changed files with 33 additions and 62 deletions

View File

@ -2659,7 +2659,7 @@ button[disabled]{
background-color:#27AE60; background-color:#27AE60;
text-decoration:none; text-decoration:none;
font-weight:normal; font-weight:normal;
font-family:"Open Sans","proxima-nova","Helvetica Neue",Arial,sans-serif; font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;
box-shadow:0px 1px 2px -1px rgba(255,255,255,0.5) inset,0px -2px 0px 0px rgba(0,0,0,0.1) inset; box-shadow:0px 1px 2px -1px rgba(255,255,255,0.5) inset,0px -2px 0px 0px rgba(0,0,0,0.1) inset;
outline-none:false; outline-none:false;
vertical-align:middle; vertical-align:middle;
@ -3056,7 +3056,7 @@ input{
input[type="button"],input[type="reset"],input[type="submit"]{ input[type="button"],input[type="reset"],input[type="submit"]{
-webkit-appearance:button; -webkit-appearance:button;
cursor:pointer; cursor:pointer;
font-family:"Open Sans","proxima-nova","Helvetica Neue",Arial,sans-serif; font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;
*overflow:visible *overflow:visible
} }
input[type="text"],input[type="password"],input[type="email"],input[type="url"],input[type="date"],input[type="month"],input[type="time"],input[type="datetime"],input[type="datetime-local"],input[type="week"],input[type="number"],input[type="search"],input[type="tel"],input[type="color"]{ input[type="text"],input[type="password"],input[type="email"],input[type="url"],input[type="date"],input[type="month"],input[type="time"],input[type="datetime"],input[type="datetime-local"],input[type="week"],input[type="number"],input[type="search"],input[type="tel"],input[type="color"]{
@ -3065,7 +3065,7 @@ input[type="text"],input[type="password"],input[type="email"],input[type="url"],
display:inline-block; display:inline-block;
border:1px solid #ccc; border:1px solid #ccc;
font-size:80%; font-size:80%;
font-family:"Open Sans","proxima-nova","Helvetica Neue",Arial,sans-serif; font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;
box-shadow:inset 0 1px 3px #ddd; box-shadow:inset 0 1px 3px #ddd;
border-radius:0; border-radius:0;
-webkit-transition:border 0.3s linear; -webkit-transition:border 0.3s linear;
@ -3129,7 +3129,7 @@ textarea{
overflow:auto; overflow:auto;
vertical-align:top; vertical-align:top;
width:100%; width:100%;
font-family:"Open Sans","proxima-nova","Helvetica Neue",Arial,sans-serif font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif
} }
select,textarea{ select,textarea{
padding:.5em .625em; padding:.5em .625em;
@ -3490,7 +3490,7 @@ html{
overflow-x:hidden overflow-x:hidden
} }
body{ body{
font-family:"Open Sans","proxima-nova","Helvetica Neue",Arial,sans-serif; font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;
font-weight:normal; font-weight:normal;
color:#404040; color:#404040;
min-height:100%; min-height:100%;
@ -3606,7 +3606,8 @@ code.code-large,.rst-content tt.code-large{
} }
.wy-plain-list-disc li,.rst-content .section ul li,.rst-content .toctree-wrapper ul li,article ul li{ .wy-plain-list-disc li,.rst-content .section ul li,.rst-content .toctree-wrapper ul li,article ul li{
list-style:disc; list-style:disc;
margin-left:24px margin-left:24px;
margin-bottom: 6px;
} }
.wy-plain-list-disc li p:last-child,.rst-content .section ul li p:last-child,.rst-content .toctree-wrapper ul li p:last-child,article ul li p:last-child{ .wy-plain-list-disc li p:last-child,.rst-content .section ul li p:last-child,.rst-content .toctree-wrapper ul li p:last-child,article ul li p:last-child{
margin-bottom:0 margin-bottom:0
@ -4143,7 +4144,7 @@ footer span.commit code,footer span.commit .rst-content tt,.rst-content footer s
margin-left:0 margin-left:0
} }
.wy-nav-content-wrap .wy-nav-content{ .wy-nav-content-wrap .wy-nav-content{
padding:1.618em padding:1.2em
} }
.wy-nav-content-wrap.shift{ .wy-nav-content-wrap.shift{
position:fixed; position:fixed;
@ -4179,7 +4180,7 @@ footer span.commit code,footer span.commit .rst-content tt,.rst-content footer s
color:#fcfcfc; color:#fcfcfc;
background:#1f1d1d; background:#1f1d1d;
border-top:solid 10px #343131; border-top:solid 10px #343131;
font-family:"Open Sans","proxima-nova","Helvetica Neue",Arial,sans-serif; font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;
z-index:400 z-index:400
} }
.rst-versions a{ .rst-versions a{

View File

@ -87,7 +87,7 @@
<meta name="description" content="Telegram MTProto API Client Library for Python"> <meta name="description" content="Telegram MTProto API Client Library for Python">
<meta name="theme-color" content="#5c5a55"> <meta name="theme-color" content="#5c5a55">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600|Roboto+Slab:400" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Lato:400,400i,700,700i|Roboto+Slab:400" rel="stylesheet">
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-84734363-2"></script> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-84734363-2"></script>
<script> <script>

View File

@ -38,38 +38,8 @@ Welcome to Pyrogram
About About
----- -----
Pyrogram is a fully functional Telegram Client Library written from the ground up in Python. **Pyrogram** is a brand new Telegram_ Client Library written from the ground up in Python and C. It can be used for building
It offers **simple** and **complete** access to the Telegram Messenger API and is designed for Python developers custom Telegram applications in Python that interact with the MTProto API as both User and Bot.
keen on building custom Telegram applications.
Features
--------
- **Easy to setup**: Pyrogram can be easily installed and upgraded using **pip**, requires
a minimal set of dependencies (which are also automatically managed) and very few lines
of code to get started with.
- **Easy to use**: Pyrogram provides idiomatic, developer-friendly, clean and readable
Python code (either generated or hand-written) making the Telegram API simple to use.
- **High level**: Pyrogram automatically handles all the low-level details of
communication with the Telegram servers by implementing the
`MTProto Mobile Protocol v2.0`_ and the mechanisms needed for establishing
a reliable connection.
- **Fast**: Pyrogram's speed is boosted up by `TgCrypto`_, a high-performance, easy-to-install
Telegram Crypto Library written in C as a Python extension.
- **Updated**: Pyrogram makes use of the latest Telegram API version, currently `Layer 75`_.
- **Documented**: Pyrogram API public methods are documented and resemble the well
established Telegram Bot API, thus offering a familiar look to Bot developers.
- **Full API support**: Beside the simple, bot-like methods offered by the Pyrogram API,
the library also provides a complete, low-level access to every single Telegram API method.
Preview
-------
.. code-block:: python .. code-block:: python
@ -79,11 +49,27 @@ Preview
client.start() client.start()
client.send_message("me", "Hi there! I'm using Pyrogram") client.send_message("me", "Hi there! I'm using Pyrogram")
client.send_photo("me", "/home/dan/pic.jpg", "Nice photo!")
client.stop() client.stop()
To get started, press Next. Features
--------
- **Easy to setup**: Pyrogram can be easily installed using pip and requires very few lines of code to get started with.
- **Easy to use**: Pyrogram provides idiomatic, clean and readable Python code making the Telegram API simple to use.
- **High-level**: Pyrogram automatically handles all the low-level details of communication with Telegram servers.
- **Updated**: Pyrogram makes use of the latest Telegram MTProto API version, currently Layer 76.
- **Fast**: Pyrogram critical parts are boosted up by `TgCrypto`_, a high-performance Crypto Library written in pure C.
- **Documented**: Pyrogram API methods are documented and resemble the well established Telegram Bot API,
thus offering a familiar look to Bot developers.
- **Full API support**: Beside the simple Bot API-like methods, Pyrogram also provides an easy access to every single
Telegram MTProto API method allowing you to programmatically execute any action an official client is able to do, and more.
.. toctree:: .. toctree::
:hidden: :hidden:
@ -118,8 +104,6 @@ To get started, press Next.
functions/index functions/index
types/index types/index
.. _`MTProto Mobile Protocol v2.0`: https://core.telegram.org/mtproto .. _`Telegram`: https://telegram.org/
.. _TgCrypto: https://docs.pyrogram.ml/resources/TgCrypto/ .. _TgCrypto: https://docs.pyrogram.ml/resources/TgCrypto/
.. _`Layer 75`: https://github.com/pyrogram/pyrogram/blob/master/compiler/api/source/main_api.tl

View File

@ -15,7 +15,7 @@ Inline Bots
# Get bot results for "Fuzz Universe" from the inline bot @vid # Get bot results for "Fuzz Universe" from the inline bot @vid
bot_results = client.get_inline_bot_results("vid", "Fuzz Universe") bot_results = client.get_inline_bot_results("vid", "Fuzz Universe")
.. figure:: ../_images/get_inline_bot_results.png .. figure:: https://i.imgur.com/IAqLs54.png
:width: 90% :width: 90%
:align: center :align: center
:figwidth: 60% :figwidth: 60%
@ -31,7 +31,7 @@ Inline Bots
# Send the first result (bot_results.results[0]) to your own chat (Saved Messages) # Send the first result (bot_results.results[0]) to your own chat (Saved Messages)
client.send_inline_bot_result("me", bot_results.query_id, bot_results.results[0].id) client.send_inline_bot_result("me", bot_results.query_id, bot_results.results[0].id)
.. figure:: ../_images/send_inline_bot_result.png .. figure:: https://i.imgur.com/wwxr7B7.png
:width: 90% :width: 90%
:align: center :align: center
:figwidth: 60% :figwidth: 60%

View File

@ -7,12 +7,6 @@ The most straightforward and recommended way to install or upgrade Pyrogram is b
$ pip3 install --upgrade pyrogram $ pip3 install --upgrade pyrogram
Or, with TgCrypto_:
.. code-block:: bash
$ pip3 install --upgrade pyrogram[tgcrypto]
Bleeding Edge Bleeding Edge
------------- -------------
@ -22,14 +16,6 @@ If you want the latest development version of the library, you can either instal
$ pip3 install --upgrade git+https://github.com/pyrogram/pyrogram.git $ pip3 install --upgrade git+https://github.com/pyrogram/pyrogram.git
Or manually, using:
.. code-block:: bash
$ git clone https://github.com/pyrogram/pyrogram.git
$ cd pyrogram
$ python setup.py install
Verifying Verifying
--------- ---------