Revert "PyroFork: Rebrand docs"

This reverts commit bec44280a4.

Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
wulan17 2023-03-20 08:06:14 +07:00
parent 3a39064e53
commit 9c94dac120
No known key found for this signature in database
GPG key ID: 318CD6CD3A6AC0A5
42 changed files with 179 additions and 140 deletions

View file

@ -1,7 +1,7 @@
PyroFork Client Pyrogram Client
=============== ===============
You have entered the API Reference section where you can find detailed information about PyroFork's API. The main Client You have entered the API Reference section where you can find detailed information about Pyrogram's API. The main Client
class, all available methods and types, filters, handlers, decorators and bound-methods detailed descriptions can be class, all available methods and types, filters, handlers, decorators and bound-methods detailed descriptions can be
found starting from this page. found starting from this page.

View file

@ -1,7 +1,7 @@
Enumerations Enumerations
============ ============
This page is about PyroFork enumerations. This page is about Pyrogram enumerations.
Enumerations are types that hold a group of related values to be used whenever a constant value is required. Enumerations are types that hold a group of related values to be used whenever a constant value is required.
They will help you deal with those values in a type-safe way and also enable code completion so that you can be sure They will help you deal with those values in a type-safe way and also enable code completion so that you can be sure
to apply only a valid value among the expected ones. to apply only a valid value among the expected ones.

View file

@ -1,8 +1,8 @@
RPC Errors RPC Errors
========== ==========
All PyroFork API errors live inside the ``errors`` sub-package: ``pyrogram.errors``. All Pyrogram API errors live inside the ``errors`` sub-package: ``pyrogram.errors``.
The errors ids listed here are shown as *UPPER_SNAKE_CASE*, but the actual exception names to import from PyroFork The errors ids listed here are shown as *UPPER_SNAKE_CASE*, but the actual exception names to import from Pyrogram
follow the usual *PascalCase* convention. follow the usual *PascalCase* convention.
.. code-block:: python .. code-block:: python

View file

@ -1,7 +1,7 @@
Update Handlers Update Handlers
=============== ===============
Handlers are used to instruct PyroFork about which kind of updates you'd like to handle with your callback functions. Handlers are used to instruct Pyrogram about which kind of updates you'd like to handle with your callback functions.
For a much more convenient way of registering callback functions have a look at :doc:`Decorators <decorators>` instead. For a much more convenient way of registering callback functions have a look at :doc:`Decorators <decorators>` instead.
.. code-block:: python .. code-block:: python

View file

@ -1,21 +1,20 @@
# PyroFork - Telegram MTProto API Client Library for Python # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan <https://github.com/delivrance> # Copyright (C) 2017-present Dan <https://github.com/delivrance>
# Copyright (C) 2022-present wulan17 <https://github.com/wulan17>
# #
# This file is part of PyroFork. # This file is part of Pyrogram.
# #
# PyroFork is free software: you can redistribute it and/or modify # Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published # it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or # by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.
# #
# PyroFork is distributed in the hope that it will be useful, # Pyrogram is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details. # GNU Lesser General Public License for more details.
# #
# You should have received a copy of the GNU Lesser General Public License # You should have received a copy of the GNU Lesser General Public License
# along with PyroFork. If not, see <http://www.gnu.org/licenses/>. # along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
import os import os
import sys import sys
@ -28,9 +27,9 @@ from pygments.styles.friendly import FriendlyStyle
FriendlyStyle.background_color = "#f3f2f1" FriendlyStyle.background_color = "#f3f2f1"
project = "PyroFork" project = "Pyrogram"
copyright = f"2022-present, wulan17" copyright = f"2017-present, Dan"
author = "wulan17" author = "Dan"
version = ".".join(__version__.split(".")[:-1]) version = ".".join(__version__.split(".")[:-1])
@ -62,7 +61,7 @@ copybutton_prompt_text = "$ "
suppress_warnings = ["image.not_readable"] suppress_warnings = ["image.not_readable"]
html_title = "PyroFork Documentation" html_title = "Pyrogram Documentation"
html_theme = "sphinx_rtd_theme" html_theme = "sphinx_rtd_theme"
html_static_path = ["../resources/static"] html_static_path = ["../resources/static"]
html_show_sourcelink = True html_show_sourcelink = True

View file

@ -2,11 +2,11 @@ Code hangs when calling stop, restart, add/remove_handler
========================================================= =========================================================
You tried to ``.stop()``, ``.restart()``, ``.add_handler()`` or ``.remove_handler()`` inside a running handler, but You tried to ``.stop()``, ``.restart()``, ``.add_handler()`` or ``.remove_handler()`` inside a running handler, but
that can't be done because the way PyroFork deals with handlers would make it hang. that can't be done because the way Pyrogram deals with handlers would make it hang.
When calling one of the methods above inside an event handler, PyroFork needs to wait for all running handlers to finish When calling one of the methods above inside an event handler, Pyrogram needs to wait for all running handlers to finish
in order to continue. Since your handler is blocking the execution by waiting for the called method to finish in order to continue. Since your handler is blocking the execution by waiting for the called method to finish
and since PyroFork needs to wait for your handler to finish, you are left with a deadlock. and since Pyrogram needs to wait for your handler to finish, you are left with a deadlock.
The solution to this problem is to pass ``block=False`` to such methods so that they return immediately and the actual The solution to this problem is to pass ``block=False`` to such methods so that they return immediately and the actual
code called asynchronously. code called asynchronously.

View file

@ -1,9 +1,9 @@
How to use webhooks? How to use webhooks?
==================== ====================
There is no webhook in PyroFork, simply because there is no HTTP involved. However, a similar technique is There is no webhook in Pyrogram, simply because there is no HTTP involved. However, a similar technique is
being used to make receiving updates efficient. being used to make receiving updates efficient.
PyroFork uses persistent connections via TCP sockets to interact with the server and instead of actively asking for Pyrogram uses persistent connections via TCP sockets to interact with the server and instead of actively asking for
updates every time (polling), PyroFork will sit down and wait for the server to send updates by itself the very moment updates every time (polling), Pyrogram will sit down and wait for the server to send updates by itself the very moment
they are available (server push). they are available (server push).

View file

@ -1,7 +1,7 @@
Frequently Asked Questions Frequently Asked Questions
========================== ==========================
This FAQ page provides answers to common questions about PyroFork and, to some extent, Telegram in general. This FAQ page provides answers to common questions about Pyrogram and, to some extent, Telegram in general.
**Contents** **Contents**

View file

@ -9,6 +9,6 @@ This error could mean several things:
- The chat id refers to a user or chat your current session hasn't met yet. - The chat id refers to a user or chat your current session hasn't met yet.
About the last point: in order for you to meet a user and thus communicate with them, you should ask yourself how to About the last point: in order for you to meet a user and thus communicate with them, you should ask yourself how to
contact people using official apps. The answer is the same for PyroFork too and involves normal usages such as searching contact people using official apps. The answer is the same for Pyrogram too and involves normal usages such as searching
for usernames, meeting them in a common group, having their phone contacts saved, getting a message mentioning them for usernames, meeting them in a common group, having their phone contacts saved, getting a message mentioning them
or obtaining the dialogs list. or obtaining the dialogs list.

View file

@ -6,7 +6,7 @@ Another reason could be because you are blocking the event loop for too long.
You can consider the following: You can consider the following:
- Use PyroFork asynchronously in its intended way. - Use Pyrogram asynchronously in its intended way.
- Use shorter non-asynchronous processing loops. - Use shorter non-asynchronous processing loops.
- Use ``asyncio.sleep()`` instead of ``time.sleep()``. - Use ``asyncio.sleep()`` instead of ``time.sleep()``.
- Use a stable network connection. - Use a stable network connection.

View file

@ -1,7 +1,7 @@
The account has been limited/deactivated The account has been limited/deactivated
======================================== ========================================
PyroFork is a framework that interfaces with Telegram; it is at your commands, meaning it only does what you tell it to Pyrogram is a framework that interfaces with Telegram; it is at your commands, meaning it only does what you tell it to
do, the rest is up to you and Telegram (see `Telegram's ToS`_). do, the rest is up to you and Telegram (see `Telegram's ToS`_).
If you found your account being limited/deactivated, it could be due spam/flood/abuse of the API or the usage of certain If you found your account being limited/deactivated, it could be due spam/flood/abuse of the API or the usage of certain

View file

@ -2,6 +2,6 @@ UnicodeEncodeError: '...' codec can't encode ...
================================================ ================================================
Where ``<encoding>`` might be *ascii*, *cp932*, *charmap* or anything else other than *utf-8*. This error usually Where ``<encoding>`` might be *ascii*, *cp932*, *charmap* or anything else other than *utf-8*. This error usually
shows up when you try to print something and has very little to do with PyroFork itself as it is strictly related to shows up when you try to print something and has very little to do with Pyrogram itself as it is strictly related to
your own terminal. To fix it, either find a way to change the encoding settings of your terminal to UTF-8 or switch to your own terminal. To fix it, either find a way to change the encoding settings of your terminal to UTF-8 or switch to
another terminal altogether. another terminal altogether.

View file

@ -1,12 +1,12 @@
Welcome to PyroFork Welcome to Pyrogram
=================== ===================
.. raw:: html .. raw:: html
<div align="center"> <div align="center">
<a href="/"> <a href="/">
<div class="pyrogram-logo-index"><img src="_static/pyrogram.png" alt="PyroFork"></div> <div class="pyrogram-logo-index"><img src="_static/pyrogram.png" alt="Pyrogram"></div>
<div class="pyrogram-text pyrogram-text-index">PyroFork</div> <div class="pyrogram-text pyrogram-text-index">Pyrogram</div>
</a> </a>
</div> </div>
@ -40,19 +40,19 @@ Welcome to PyroFork
@app.on_message(filters.private) @app.on_message(filters.private)
async def hello(client, message): async def hello(client, message):
await message.reply("Hello from PyroFork!") await message.reply("Hello from Pyrogram!")
app.run() app.run()
**PyroFork** is a modern, elegant and asynchronous :doc:`MTProto API <topics/mtproto-vs-botapi>` framework. **Pyrogram** is a modern, elegant and asynchronous :doc:`MTProto API <topics/mtproto-vs-botapi>` framework.
It enables you to easily interact with the main Telegram API through a user account (custom client) or a bot identity It enables you to easily interact with the main Telegram API through a user account (custom client) or a bot identity
(bot API alternative) using Python. (bot API alternative) using Python.
Support Support
------- -------
If you'd like to support PyroFork, you can consider: If you'd like to support Pyrogram, you can consider:
- `Become a GitHub sponsor <https://github.com/sponsors/delivrance>`_. - `Become a GitHub sponsor <https://github.com/sponsors/delivrance>`_.
- `Become a LiberaPay patron <https://liberapay.com/delivrance>`_. - `Become a LiberaPay patron <https://liberapay.com/delivrance>`_.
@ -75,7 +75,7 @@ First Steps
:columns: 1 :columns: 1
- :doc:`Quick Start <intro/quickstart>`: Overview to get you started quickly. - :doc:`Quick Start <intro/quickstart>`: Overview to get you started quickly.
- :doc:`Invoking Methods <start/invoking>`: How to call PyroFork's methods. - :doc:`Invoking Methods <start/invoking>`: How to call Pyrogram's methods.
- :doc:`Handling Updates <start/updates>`: How to handle Telegram updates. - :doc:`Handling Updates <start/updates>`: How to handle Telegram updates.
- :doc:`Error Handling <start/errors>`: How to handle API errors correctly. - :doc:`Error Handling <start/errors>`: How to handle API errors correctly.
@ -85,7 +85,7 @@ API Reference
.. hlist:: .. hlist::
:columns: 1 :columns: 1
- :doc:`PyroFork Client <api/client>`: Reference details about the Client class. - :doc:`Pyrogram Client <api/client>`: Reference details about the Client class.
- :doc:`Available Methods <api/methods/index>`: List of available high-level methods. - :doc:`Available Methods <api/methods/index>`: List of available high-level methods.
- :doc:`Available Types <api/types/index>`: List of available high-level types. - :doc:`Available Types <api/types/index>`: List of available high-level types.
- :doc:`Enumerations <api/enums/index>`: List of available enumerations. - :doc:`Enumerations <api/enums/index>`: List of available enumerations.
@ -97,9 +97,9 @@ Meta
.. hlist:: .. hlist::
:columns: 1 :columns: 1
- :doc:`PyroFork FAQ <faq/index>`: Answers to common PyroFork questions. - :doc:`Pyrogram FAQ <faq/index>`: Answers to common Pyrogram questions.
- :doc:`Support PyroFork <support>`: Ways to show your appreciation. - :doc:`Support Pyrogram <support>`: Ways to show your appreciation.
- :doc:`Release Notes <releases/index>`: Release notes for PyroFork releases. - :doc:`Release Notes <releases/index>`: Release notes for Pyrogram releases.
.. toctree:: .. toctree::
:hidden: :hidden:

View file

@ -1,7 +1,7 @@
Install Guide Install Guide
============= =============
Being a modern Python framework, PyroFork requires an up to date version of Python to be installed in your system. Being a modern Python framework, Pyrogram requires an up to date version of Python to be installed in your system.
We recommend using the latest versions of both Python 3 and pip. We recommend using the latest versions of both Python 3 and pip.
.. contents:: Contents .. contents:: Contents
@ -11,25 +11,34 @@ We recommend using the latest versions of both Python 3 and pip.
----- -----
Install PyroFork Install Pyrogram
---------------- ----------------
- The easiest way to install and upgrade PyroFork to its latest stable version is by using **pip**: - The easiest way to install and upgrade Pyrogram to its latest stable version is by using **pip**:
.. code-block:: text .. code-block:: text
$ pip3 install -U git+https://github.com/Mayuri-Chan/pyrofork@dev/pyrofork $ pip3 install -U pyrogram
- or, with :doc:`TgCrypto <../topics/speedups>` as extra requirement (recommended): - or, with :doc:`TgCrypto <../topics/speedups>` as extra requirement (recommended):
.. code-block:: text .. code-block:: text
$ pip3 install -U git+https://github.com/Mayuri-Chan/pyrofork@dev/pyrofork tgcrypto $ pip3 install -U pyrogram tgcrypto
Bleeding Edge
-------------
You can install the development version from the git ``master`` branch using this command:
.. code-block:: text
$ pip3 install -U https://github.com/pyrogram/pyrogram/archive/master.zip
Verifying Verifying
--------- ---------
To verify that PyroFork is correctly installed, open a Python shell and import it. To verify that Pyrogram is correctly installed, open a Python shell and import it.
If no error shows up you are good to go. If no error shows up you are good to go.
.. parsed-literal:: .. parsed-literal::
@ -38,4 +47,4 @@ If no error shows up you are good to go.
>>> pyrogram.__version__ >>> pyrogram.__version__
'x.y.z' 'x.y.z'
.. _`Github repo`: https://github.com/Mayuri-Chan/pyrofork .. _`Github repo`: http://github.com/pyrogram/pyrogram

View file

@ -1,9 +1,9 @@
Quick Start Quick Start
=========== ===========
The next few steps serve as a quick start to see PyroFork in action as fast as possible. The next few steps serve as a quick start to see Pyrogram in action as fast as possible.
Get PyroFork Real Fast Get Pyrogram Real Fast
---------------------- ----------------------
.. admonition :: Cloud Credits .. admonition :: Cloud Credits
@ -12,7 +12,7 @@ Get PyroFork Real Fast
If you need a cloud server to host your applications, try Hetzner Cloud. You can sign up with If you need a cloud server to host your applications, try Hetzner Cloud. You can sign up with
`this link <https://hetzner.cloud/?ref=9CyT92gZEINU>`_ to get €20 in cloud credits. `this link <https://hetzner.cloud/?ref=9CyT92gZEINU>`_ to get €20 in cloud credits.
1. Install PyroFork with ``pip3 install -U pyrogram``. 1. Install Pyrogram with ``pip3 install -U pyrogram``.
2. Get your own Telegram API key from https://my.telegram.org/apps. 2. Get your own Telegram API key from https://my.telegram.org/apps.
@ -29,7 +29,7 @@ Get PyroFork Real Fast
async def main(): async def main():
async with Client("my_account", api_id, api_hash) as app: async with Client("my_account", api_id, api_hash) as app:
await app.send_message("me", "Greetings from **PyroFork**!") await app.send_message("me", "Greetings from **Pyrogram**!")
asyncio.run(main()) asyncio.run(main())
@ -42,7 +42,7 @@ Get PyroFork Real Fast
7. Follow the instructions on your terminal to login. 7. Follow the instructions on your terminal to login.
8. Watch PyroFork send a message to yourself. 8. Watch Pyrogram send a message to yourself.
Enjoy the API Enjoy the API
------------- -------------
@ -53,4 +53,4 @@ we have just done above.
If you are feeling eager to continue you can take a shortcut to :doc:`../start/invoking` and come back If you are feeling eager to continue you can take a shortcut to :doc:`../start/invoking` and come back
later to learn some more details. later to learn some more details.
.. _community: https://t.me/PyroFork .. _community: https://t.me/Pyrogram

View file

@ -1,7 +1,7 @@
Authorization Authorization
============= =============
Once a :doc:`project is set up <setup>`, you will still have to follow a few steps before you can actually use PyroFork to make Once a :doc:`project is set up <setup>`, you will still have to follow a few steps before you can actually use Pyrogram to make
API calls. This section provides all the information you need in order to authorize yourself as user or bot. API calls. This section provides all the information you need in order to authorize yourself as user or bot.
.. contents:: Contents .. contents:: Contents
@ -15,7 +15,7 @@ User Authorization
------------------ ------------------
In order to use the API, Telegram requires that users be authorized via their phone numbers. In order to use the API, Telegram requires that users be authorized via their phone numbers.
PyroFork automatically manages this process, all you need to do is create an instance of the Pyrogram automatically manages this process, all you need to do is create an instance of the
:class:`~pyrogram.Client` class by passing to it a ``name`` of your choice (e.g.: "my_account") and call :class:`~pyrogram.Client` class by passing to it a ``name`` of your choice (e.g.: "my_account") and call
the :meth:`~pyrogram.Client.run` method: the :meth:`~pyrogram.Client.run` method:
@ -41,7 +41,7 @@ authorized or via SMS:
Enter phone code: 12345 Enter phone code: 12345
Logged in successfully Logged in successfully
After successfully authorizing yourself, a new file called ``my_account.session`` will be created allowing PyroFork to After successfully authorizing yourself, a new file called ``my_account.session`` will be created allowing Pyrogram to
execute API calls with your identity. This file is personal and will be loaded again when you restart your app. execute API calls with your identity. This file is personal and will be loaded again when you restart your app.
You can now remove the api_id and api_hash values from the code as they are not needed anymore. You can now remove the api_id and api_hash values from the code as they are not needed anymore.
@ -55,7 +55,7 @@ Bot Authorization
Bots are a special kind of users that are authorized via their tokens (instead of phone numbers), which are created by Bots are a special kind of users that are authorized via their tokens (instead of phone numbers), which are created by
the `Bot Father`_. Bot tokens replace the users' phone numbers only — you still need to the `Bot Father`_. Bot tokens replace the users' phone numbers only — you still need to
:doc:`configure a Telegram API key <../start/setup>` with PyroFork, even when using bots. :doc:`configure a Telegram API key <../start/setup>` with Pyrogram, even when using bots.
The authorization process is automatically managed. All you need to do is choose a ``name`` (can be anything, The authorization process is automatically managed. All you need to do is choose a ``name`` (can be anything,
usually your bot username) and pass your bot token using the ``bot_token`` parameter. The session file will be named usually your bot username) and pass your bot token using the ``bot_token`` parameter. The session file will be named

View file

@ -2,7 +2,7 @@ Error Handling
============== ==============
Errors can be correctly handled with ``try...except`` blocks in order to control the behaviour of your application. Errors can be correctly handled with ``try...except`` blocks in order to control the behaviour of your application.
PyroFork errors all live inside the ``errors`` package: Pyrogram errors all live inside the ``errors`` package:
.. code-block:: python .. code-block:: python
@ -33,7 +33,7 @@ This error is raised every time a method call against Telegram's API was unsucce
Error Categories Error Categories
---------------- ----------------
The ``RPCError`` packs together all the possible errors Telegram could raise, but to make things tidier, PyroFork The ``RPCError`` packs together all the possible errors Telegram could raise, but to make things tidier, Pyrogram
provides categories of errors, which are named after the common HTTP errors and are subclass-ed from the ``RPCError``: provides categories of errors, which are named after the common HTTP errors and are subclass-ed from the ``RPCError``:
.. code-block:: python .. code-block:: python
@ -51,7 +51,7 @@ provides categories of errors, which are named after the common HTTP errors and
Single Errors Single Errors
------------- -------------
For a fine-grained control over every single error, PyroFork does also expose errors that deal each with a specific For a fine-grained control over every single error, Pyrogram does also expose errors that deal each with a specific
issue. For example: issue. For example:
.. code-block:: python .. code-block:: python
@ -77,7 +77,7 @@ These errors subclass directly from the category of errors they belong to, which
Unknown Errors Unknown Errors
-------------- --------------
In case PyroFork does not know anything about a specific error yet, it raises a generic error from its known category, In case Pyrogram does not know anything about a specific error yet, it raises a generic error from its known category,
for example, an unknown error with error code ``400``, will be raised as a ``BadRequest``. This way you can catch the for example, an unknown error with error code ``400``, will be raised as a ``BadRequest``. This way you can catch the
whole category of errors and be sure to also handle these unknown errors. whole category of errors and be sure to also handle these unknown errors.

View file

@ -14,7 +14,7 @@ This example demonstrates a basic API usage
async def main(): async def main():
async with app: async with app:
# Send a message, Markdown is enabled by default # Send a message, Markdown is enabled by default
await app.send_message("me", "Hi there! I'm using **PyroFork**") await app.send_message("me", "Hi there! I'm using **Pyrogram**")
app.run(main()) app.run(main())

View file

@ -1,7 +1,7 @@
Examples Examples
======== ========
This page contains example scripts to show you how PyroFork looks like. This page contains example scripts to show you how Pyrogram looks like.
Every script is working right away (provided you correctly set up your credentials), meaning you can simply copy-paste Every script is working right away (provided you correctly set up your credentials), meaning you can simply copy-paste
and run. The only things you have to change are session names and target chats, where applicable. and run. The only things you have to change are session names and target chats, where applicable.
@ -18,7 +18,7 @@ to give you a basic idea.
:doc:`hello_world`, "Demonstration of basic API usage" :doc:`hello_world`, "Demonstration of basic API usage"
:doc:`echo_bot`, "Echo every private text message" :doc:`echo_bot`, "Echo every private text message"
:doc:`welcome_bot`, "The Welcome Bot in @PyroForkChat" :doc:`welcome_bot`, "The Welcome Bot in @PyrogramChat"
:doc:`get_chat_history`, "Get the full message history of a chat" :doc:`get_chat_history`, "Get the full message history of a chat"
:doc:`get_chat_members`, "Get all the members of a chat" :doc:`get_chat_members`, "Get all the members of a chat"
:doc:`get_dialogs`, "Get all of your dialog chats" :doc:`get_dialogs`, "Get all of your dialog chats"

View file

@ -22,10 +22,10 @@ It uses the @on_inline_query decorator to register an InlineQueryHandler.
InlineQueryResultArticle( InlineQueryResultArticle(
title="Installation", title="Installation",
input_message_content=InputTextMessageContent( input_message_content=InputTextMessageContent(
"Here's how to install **PyroFork**" "Here's how to install **Pyrogram**"
), ),
url="https://docs.pyrogram.org/intro/install", url="https://docs.pyrogram.org/intro/install",
description="How to install PyroFork", description="How to install Pyrogram",
reply_markup=InlineKeyboardMarkup( reply_markup=InlineKeyboardMarkup(
[ [
[InlineKeyboardButton( [InlineKeyboardButton(
@ -38,10 +38,10 @@ It uses the @on_inline_query decorator to register an InlineQueryHandler.
InlineQueryResultArticle( InlineQueryResultArticle(
title="Usage", title="Usage",
input_message_content=InputTextMessageContent( input_message_content=InputTextMessageContent(
"Here's how to use **PyroFork**" "Here's how to use **Pyrogram**"
), ),
url="https://docs.pyrogram.org/start/invoking", url="https://docs.pyrogram.org/start/invoking",
description="How to use PyroFork", description="How to use Pyrogram",
reply_markup=InlineKeyboardMarkup( reply_markup=InlineKeyboardMarkup(
[ [
[InlineKeyboardButton( [InlineKeyboardButton(

View file

@ -11,7 +11,7 @@ to make it only work for specific messages in a specific chat.
# Target chat. Can also be a list of multiple chat ids/usernames # Target chat. Can also be a list of multiple chat ids/usernames
TARGET = -100123456789 TARGET = -100123456789
# Welcome message template # Welcome message template
MESSAGE = "{} Welcome to [PyroFork](https://docs.pyrogram.org/)'s group chat {}!" MESSAGE = "{} Welcome to [Pyrogram](https://docs.pyrogram.org/)'s group chat {}!"
app = Client("my_account") app = Client("my_account")

View file

@ -1,7 +1,7 @@
Invoking Methods Invoking Methods
================ ================
At this point, we have successfully :doc:`installed PyroFork <../intro/install>` and :doc:`authorized <auth>` our At this point, we have successfully :doc:`installed Pyrogram <../intro/install>` and :doc:`authorized <auth>` our
account; we are now aiming towards the core of the framework. account; we are now aiming towards the core of the framework.
.. contents:: Contents .. contents:: Contents
@ -14,7 +14,7 @@ account; we are now aiming towards the core of the framework.
Basic Usage Basic Usage
----------- -----------
Making API calls with PyroFork is very simple. Here's a basic example we are going to examine step by step: Making API calls with Pyrogram is very simple. Here's a basic example we are going to examine step by step:
.. code-block:: python .. code-block:: python
@ -55,7 +55,7 @@ Step-by-step
async with app: async with app:
await app.send_message("me", "Hi!") await app.send_message("me", "Hi!")
#. Finally, we tell Python to schedule our ``main()`` async function by using PyroFork's :meth:`~pyrogram.Client.run` #. Finally, we tell Python to schedule our ``main()`` async function by using Pyrogram's :meth:`~pyrogram.Client.run`
method. method.
.. code-block:: python .. code-block:: python

View file

@ -1,7 +1,7 @@
Project Setup Project Setup
============= =============
We have just :doc:`installed PyroFork <../intro/install>`. In this page we'll discuss what you need to do in order to set up a We have just :doc:`installed Pyrogram <../intro/install>`. In this page we'll discuss what you need to do in order to set up a
project with the framework. project with the framework.
.. contents:: Contents .. contents:: Contents
@ -28,7 +28,7 @@ The first step requires you to obtain a valid Telegram API key (api_id and api_h
Configuration Configuration
------------- -------------
Having the API key from the previous step in handy, we can now begin to configure a PyroFork project: pass your API key to PyroFork by using the *api_id* and *api_hash* parameters of the Client class: Having the API key from the previous step in handy, we can now begin to configure a Pyrogram project: pass your API key to Pyrogram by using the *api_id* and *api_hash* parameters of the Client class:
.. code-block:: python .. code-block:: python

View file

@ -1,8 +1,8 @@
Handling Updates Handling Updates
================ ================
:doc:`Invoking API methods <invoking>` sequentially is one way to use PyroFork. This page deals with Telegram updates :doc:`Invoking API methods <invoking>` sequentially is one way to use Pyrogram. This page deals with Telegram updates
and how to handle new incoming messages or other events in PyroFork. and how to handle new incoming messages or other events in Pyrogram.
.. contents:: Contents .. contents:: Contents
:backlinks: none :backlinks: none

View file

@ -1,4 +1,4 @@
Support PyroFork Support Pyrogram
================ ================
.. raw:: html .. raw:: html
@ -7,13 +7,13 @@ Support PyroFork
<div style="float: right; margin-bottom: 10px"> <div style="float: right; margin-bottom: 10px">
<a class="github-button" <a class="github-button"
href="https://github.com/Mayuri-Chan/pyrofork" href="https://github.com/pyrogram/pyrogram"
data-color-scheme="no-preference: light; light: light; dark: dark;" data-color-scheme="no-preference: light; light: light; dark: dark;"
data-icon="octicon-star" data-size="large" data-show-count="true" data-icon="octicon-star" data-size="large" data-show-count="true"
aria-label="Star pyrogram/pyrogram on GitHub">Star</a> aria-label="Star pyrogram/pyrogram on GitHub">Star</a>
<a class="github-button" <a class="github-button"
href="https://github.com/Mayuri-Chan/pyrofork/fork" href="https://github.com/pyrogram/pyrogram/fork"
data-color-scheme="no-preference: light; light: light; dark: dark;" data-color-scheme="no-preference: light; light: light; dark: dark;"
data-icon="octicon-repo-forked" data-size="large" data-icon="octicon-repo-forked" data-size="large"
data-show-count="true" aria-label="Fork pyrogram/pyrogram on GitHub">Fork</a> data-show-count="true" aria-label="Fork pyrogram/pyrogram on GitHub">Fork</a>
@ -21,12 +21,43 @@ Support PyroFork
<br style="clear: both"/> <br style="clear: both"/>
PyroFork is a free and open source project. Pyrogram is a free and open source project.
If you enjoy PyroFork and would like to show your appreciation, consider donating or becoming If you enjoy Pyrogram and would like to show your appreciation, consider donating or becoming
a sponsor of the project. You can support PyroFork via the ways shown below: a sponsor of the project. You can support Pyrogram via the ways shown below:
----- -----
GitHub Sponsor
--------------
`Become a GitHub sponsor <https://github.com/sponsors/delivrance>`_.
.. raw:: html .. raw:: html
<script src="https://opencollective.com/pyrogram/banner.js"></script> <a class="github-button"
href="https://github.com/sponsors/delivrance"
data-color-scheme="no-preference: light; light: light; dark: dark;"
data-icon="octicon-heart" data-size="large"
aria-label="Sponsor @delivrance on GitHub">Sponsor</a>
-----
LiberaPay Patron
----------------
`Become a LiberaPay patron <https://liberapay.com/delivrance>`_.
.. raw:: html
<script src="https://liberapay.com/delivrance/widgets/button.js"></script>
-----
OpenCollective Backer
---------------------
`Become an OpenCollective backer <https://opencollective.com/pyrogram>`_
.. raw:: html
<script src="https://opencollective.com/pyrogram/banner.js"></script>

View file

@ -1,10 +1,10 @@
Advanced Usage Advanced Usage
============== ==============
PyroFork's API -- which consists of well documented :doc:`methods <../api/methods/index>` and Pyrogram's API -- which consists of well documented :doc:`methods <../api/methods/index>` and
:doc:`types <../api/types/index>` -- exists to provide an easier interface to the more complex Telegram API. :doc:`types <../api/types/index>` -- exists to provide an easier interface to the more complex Telegram API.
In this section, you'll be shown the alternative way of communicating with Telegram using PyroFork: the main "raw" In this section, you'll be shown the alternative way of communicating with Telegram using Pyrogram: the main "raw"
Telegram API with its functions and types. Telegram API with its functions and types.
.. contents:: Contents .. contents:: Contents
@ -25,12 +25,12 @@ take into consideration when working with the raw API.
.. tip:: .. tip::
Every available high-level method in PyroFork is built on top of these raw functions. Every available high-level method in Pyrogram is built on top of these raw functions.
Invoking Functions Invoking Functions
------------------ ------------------
Unlike the :doc:`methods <../api/methods/index>` found in PyroFork's API, which can be called in the usual simple way, Unlike the :doc:`methods <../api/methods/index>` found in Pyrogram's API, which can be called in the usual simple way,
functions to be invoked from the raw Telegram API have a different way of usage. functions to be invoked from the raw Telegram API have a different way of usage.
First of all, both :doc:`raw functions <../telegram/functions/index>` and :doc:`raw types <../telegram/types/index>` First of all, both :doc:`raw functions <../telegram/functions/index>` and :doc:`raw types <../telegram/types/index>`
@ -92,7 +92,7 @@ Chat IDs
-------- --------
The way Telegram works makes it not possible to directly send a message to a user or a chat by using their IDs only. The way Telegram works makes it not possible to directly send a message to a user or a chat by using their IDs only.
Instead, a pair of ``id`` and ``access_hash`` wrapped in a so called ``InputPeer`` is always needed. PyroFork allows Instead, a pair of ``id`` and ``access_hash`` wrapped in a so called ``InputPeer`` is always needed. Pyrogram allows
sending messages with IDs only thanks to cached access hashes. sending messages with IDs only thanks to cached access hashes.
There are three different InputPeer types, one for each kind of Telegram entity. There are three different InputPeer types, one for each kind of Telegram entity.
@ -102,17 +102,17 @@ Whenever an InputPeer is needed you must pass one of these:
- :class:`~pyrogram.raw.types.InputPeerChat` - Basic Chats - :class:`~pyrogram.raw.types.InputPeerChat` - Basic Chats
- :class:`~pyrogram.raw.types.InputPeerChannel` - Channels & Supergroups - :class:`~pyrogram.raw.types.InputPeerChannel` - Channels & Supergroups
But you don't necessarily have to manually instantiate each object because PyroFork already provides But you don't necessarily have to manually instantiate each object because Pyrogram already provides
:meth:`~pyrogram.Client.resolve_peer` as a convenience utility method that returns the correct InputPeer :meth:`~pyrogram.Client.resolve_peer` as a convenience utility method that returns the correct InputPeer
by accepting a peer ID only. by accepting a peer ID only.
Another thing to take into consideration about chat IDs is the way they are represented: they are all integers and Another thing to take into consideration about chat IDs is the way they are represented: they are all integers and
all positive within their respective raw types. all positive within their respective raw types.
Things are different when working with PyroFork's API because having them in the same space could lead to Things are different when working with Pyrogram's API because having them in the same space could lead to
collisions, and that's why PyroFork uses a slightly different representation for each kind of ID. collisions, and that's why Pyrogram uses a slightly different representation for each kind of ID.
For example, given the ID *123456789*, here's how PyroFork can tell entities apart: For example, given the ID *123456789*, here's how Pyrogram can tell entities apart:
- ``+ID`` User: *123456789* - ``+ID`` User: *123456789*
- ``-ID`` Chat: *-123456789* - ``-ID`` Chat: *-123456789*
@ -121,4 +121,4 @@ For example, given the ID *123456789*, here's how PyroFork can tell entities apa
So, every time you take a raw ID, make sure to translate it into the correct ID when you want to use it with an So, every time you take a raw ID, make sure to translate it into the correct ID when you want to use it with an
high-level method. high-level method.
.. _Community: https://t.me/PyroFork .. _Community: https://t.me/Pyrogram

View file

@ -5,7 +5,7 @@ You can control the way your client appears in the Active Sessions menu of an of
settings. By default you will see something like the following: settings. By default you will see something like the following:
- Device Model: ``CPython x.y.z`` - Device Model: ``CPython x.y.z``
- Application: ``PyroFork x.y.z`` - Application: ``Pyrogram x.y.z``
- System Version: ``Linux x.y.z`` - System Version: ``Linux x.y.z``
.. contents:: Contents .. contents:: Contents

View file

@ -1,7 +1,7 @@
Creating Filters Creating Filters
================ ================
PyroFork already provides lots of built-in :class:`~pyrogram.filters` to work with, but in case you can't find a Pyrogram already provides lots of built-in :class:`~pyrogram.filters` to work with, but in case you can't find a
specific one for your needs or want to build a custom filter by yourself you can use specific one for your needs or want to build a custom filter by yourself you can use
:meth:`filters.create() <pyrogram.filters.create>`. :meth:`filters.create() <pyrogram.filters.create>`.
@ -27,7 +27,7 @@ button:
await app.send_message( await app.send_message(
"username", # Change this to your username or id "username", # Change this to your username or id
"PyroFork custom filter test", "Pyrogram custom filter test",
reply_markup=InlineKeyboardMarkup( reply_markup=InlineKeyboardMarkup(
[[InlineKeyboardButton("Press me", "pyrogram")]] [[InlineKeyboardButton("Press me", "pyrogram")]]
) )

View file

@ -2,7 +2,7 @@ Debugging
========= =========
When working with the API, chances are you'll stumble upon bugs, get stuck and start wondering how to continue. Nothing When working with the API, chances are you'll stumble upon bugs, get stuck and start wondering how to continue. Nothing
to actually worry about since PyroFork provides some commodities to help you in this. to actually worry about since Pyrogram provides some commodities to help you in this.
.. contents:: Contents .. contents:: Contents
:backlinks: none :backlinks: none
@ -19,7 +19,7 @@ Caveman Debugging
-- Brian Kernighan, "Unix for Beginners" (1979) -- Brian Kernighan, "Unix for Beginners" (1979)
Adding ``print()`` statements in crucial parts of your code is by far the most ancient, yet efficient technique for Adding ``print()`` statements in crucial parts of your code is by far the most ancient, yet efficient technique for
debugging programs, especially considering the concurrent nature of the framework itself. PyroFork goodness in this debugging programs, especially considering the concurrent nature of the framework itself. Pyrogram goodness in this
respect comes with the fact that any object can be nicely printed just by calling ``print(obj)``, thus giving to you respect comes with the fact that any object can be nicely printed just by calling ``print(obj)``, thus giving to you
an insight of all its inner details. an insight of all its inner details.
@ -46,7 +46,7 @@ This will show a JSON representation of the object returned by :meth:`~pyrogram.
"is_verified": false, "is_verified": false,
"is_restricted": false, "is_restricted": false,
"is_support": false, "is_support": false,
"first_name": "PyroFork", "first_name": "Pyrogram",
"photo": { "photo": {
"_": "ChatPhoto", "_": "ChatPhoto",
"small_file_id": "AbCdE...EdCbA", "small_file_id": "AbCdE...EdCbA",
@ -56,13 +56,13 @@ This will show a JSON representation of the object returned by :meth:`~pyrogram.
} }
} }
As you've probably guessed already, PyroFork objects can be nested. That's how compound data are built, and nesting As you've probably guessed already, Pyrogram objects can be nested. That's how compound data are built, and nesting
keeps going until we are left with base data types only, such as ``str``, ``int``, ``bool``, etc. keeps going until we are left with base data types only, such as ``str``, ``int``, ``bool``, etc.
Accessing Attributes Accessing Attributes
-------------------- --------------------
Even though you see a JSON output, it doesn't mean we are dealing with dictionaries; in fact, all PyroFork types are Even though you see a JSON output, it doesn't mean we are dealing with dictionaries; in fact, all Pyrogram types are
fully-fledged Python objects and the correct way to access any attribute of them is by using the dot notation ``.``: fully-fledged Python objects and the correct way to access any attribute of them is by using the dot notation ``.``:
.. code-block:: python .. code-block:: python

View file

@ -62,7 +62,7 @@ Update propagation
Registering multiple handlers, each in a different group, becomes useful when you want to handle the same update more Registering multiple handlers, each in a different group, becomes useful when you want to handle the same update more
than once. Any incoming update will be sequentially processed by all of your registered functions by respecting the than once. Any incoming update will be sequentially processed by all of your registered functions by respecting the
groups priority policy described above. Even in case any handler raises an unhandled exception, PyroFork will still groups priority policy described above. Even in case any handler raises an unhandled exception, Pyrogram will still
continue to propagate the same update to the next groups until all the handlers are done. Example: continue to propagate the same update to the next groups until all the handlers are done. Example:
.. code-block:: python .. code-block:: python

View file

@ -1,9 +1,9 @@
MTProto vs. Bot API MTProto vs. Bot API
=================== ===================
PyroFork is a framework written from the ground up that acts as a fully-fledged Telegram client based on the MTProto Pyrogram is a framework written from the ground up that acts as a fully-fledged Telegram client based on the MTProto
API. This means that PyroFork is able to execute any official client and bot API action and more. This page will API. This means that Pyrogram is able to execute any official client and bot API action and more. This page will
therefore show you why PyroFork might be a better choice for your project by comparing the two APIs, but first, let's therefore show you why Pyrogram might be a better choice for your project by comparing the two APIs, but first, let's
make it clear what actually is the MTProto and the Bot API. make it clear what actually is the MTProto and the Bot API.
.. contents:: Contents .. contents:: Contents
@ -23,7 +23,7 @@ The MTProto API on the other hand, is what people for convenience call the main
from the Bot API. The main Telegram API is able to authorize both users and bots and is built on top of the MTProto from the Bot API. The main Telegram API is able to authorize both users and bots and is built on top of the MTProto
encryption protocol by means of `binary data serialized`_ in a specific way, as described by the `TL language`_, and encryption protocol by means of `binary data serialized`_ in a specific way, as described by the `TL language`_, and
delivered using UDP, TCP or even HTTP as transport-layer protocol. Clients that make use of Telegram's main API, such as delivered using UDP, TCP or even HTTP as transport-layer protocol. Clients that make use of Telegram's main API, such as
PyroFork, implement all these details. Pyrogram, implement all these details.
.. _MTProto: https://core.telegram.org/mtproto .. _MTProto: https://core.telegram.org/mtproto
.. _binary data serialized: https://core.telegram.org/mtproto/serialize .. _binary data serialized: https://core.telegram.org/mtproto/serialize
@ -45,8 +45,8 @@ servers using MTProto.
Advantages of the MTProto API Advantages of the MTProto API
----------------------------- -----------------------------
Here is a non-exhaustive list of all the advantages in using MTProto-based libraries -- such as PyroFork -- instead of Here is a non-exhaustive list of all the advantages in using MTProto-based libraries -- such as Pyrogram -- instead of
the official HTTP Bot API. Using PyroFork you can: the official HTTP Bot API. Using Pyrogram you can:
.. hlist:: .. hlist::
:columns: 1 :columns: 1

View file

@ -1,7 +1,7 @@
Proxy Settings Proxy Settings
============== ==============
PyroFork supports proxies with and without authentication. This feature allows PyroFork to exchange data with Telegram Pyrogram supports proxies with and without authentication. This feature allows Pyrogram to exchange data with Telegram
through an intermediate SOCKS 4/5 or HTTP (CONNECT) proxy server. through an intermediate SOCKS 4/5 or HTTP (CONNECT) proxy server.
.. contents:: Contents .. contents:: Contents
@ -14,7 +14,7 @@ through an intermediate SOCKS 4/5 or HTTP (CONNECT) proxy server.
Usage Usage
----- -----
To use PyroFork with a proxy, use the *proxy* parameter in the Client class. If your proxy doesn't require authorization To use Pyrogram with a proxy, use the *proxy* parameter in the Client class. If your proxy doesn't require authorization
you can omit ``username`` and ``password``. you can omit ``username`` and ``password``.
.. code-block:: python .. code-block:: python

View file

@ -4,7 +4,7 @@ Scheduling Tasks
Scheduling tasks means executing one or more functions periodically at pre-defined intervals or after a delay. This is Scheduling tasks means executing one or more functions periodically at pre-defined intervals or after a delay. This is
useful, for example, to send recurring messages to specific chats or users. useful, for example, to send recurring messages to specific chats or users.
This page will show examples on how to integrate PyroFork with ``apscheduler`` in both asynchronous and This page will show examples on how to integrate Pyrogram with ``apscheduler`` in both asynchronous and
non-asynchronous contexts. For more detailed information, you can visit and learn from the library documentation. non-asynchronous contexts. For more detailed information, you can visit and learn from the library documentation.
.. contents:: Contents .. contents:: Contents

View file

@ -1,8 +1,8 @@
Object Serialization Object Serialization
==================== ====================
Serializing means converting a PyroFork object, which exists as Python class instance, to a text string that can be Serializing means converting a Pyrogram object, which exists as Python class instance, to a text string that can be
easily shared and stored anywhere. PyroFork provides two formats for serializing its objects: one good looking for easily shared and stored anywhere. Pyrogram provides two formats for serializing its objects: one good looking for
humans and another more compact for machines that is able to recover the original structures. humans and another more compact for machines that is able to recover the original structures.
.. contents:: Contents .. contents:: Contents
@ -28,7 +28,7 @@ If you want a nicely formatted, human readable JSON representation of any object
.. tip:: .. tip::
When using ``print()`` you don't actually need to use ``str()`` on the object because it is called automatically, we When using ``print()`` you don't actually need to use ``str()`` on the object because it is called automatically, we
have done that above just to show you how to explicitly convert a PyroFork object to JSON. have done that above just to show you how to explicitly convert a Pyrogram object to JSON.
For Machines - repr(obj) For Machines - repr(obj)
------------------------ ------------------------
@ -53,4 +53,4 @@ as the process requires the package to be in scope.
.. note:: .. note::
Type definitions are subject to changes between versions. You should make sure to store and load objects using the Type definitions are subject to changes between versions. You should make sure to store and load objects using the
same PyroFork version. same Pyrogram version.

View file

@ -1,9 +1,9 @@
Smart Plugins Smart Plugins
============= =============
PyroFork embeds a smart, lightweight yet powerful plugin system that is meant to further simplify the organization Pyrogram embeds a smart, lightweight yet powerful plugin system that is meant to further simplify the organization
of large projects and to provide a way for creating pluggable (modular) components that can be easily shared across of large projects and to provide a way for creating pluggable (modular) components that can be easily shared across
different PyroFork applications with minimal boilerplate code. different Pyrogram applications with minimal boilerplate code.
.. tip:: .. tip::
@ -28,7 +28,7 @@ after importing your modules, like this:
This is an example application that replies in private chats with two messages: one containing the same This is an example application that replies in private chats with two messages: one containing the same
text message you sent and the other containing the reversed text message. text message you sent and the other containing the reversed text message.
Example: *"PyroFork"* replies with *"PyroFork"* and *"margoryP"* Example: *"Pyrogram"* replies with *"Pyrogram"* and *"margoryP"*
.. code-block:: text .. code-block:: text
@ -79,7 +79,7 @@ So, what if you could? Smart Plugins solve this issue by taking care of handlers
Using Smart Plugins Using Smart Plugins
------------------- -------------------
Setting up your PyroFork project to accommodate Smart Plugins is pretty straightforward: Setting up your Pyrogram project to accommodate Smart Plugins is pretty straightforward:
#. Create a new folder to store all the plugins (e.g.: "plugins", "handlers", ...). #. Create a new folder to store all the plugins (e.g.: "plugins", "handlers", ...).
#. Put your python files full of plugins inside. Organize them as you wish. #. Put your python files full of plugins inside. Organize them as you wish.
@ -127,8 +127,8 @@ The first important thing to note is the new ``plugins`` folder. You can put *an
each file can contain *any decorated function* (handlers) with one limitation: within a single module (file) you must each file can contain *any decorated function* (handlers) with one limitation: within a single module (file) you must
use different names for each decorated function. use different names for each decorated function.
The second thing is telling PyroFork where to look for your plugins: you can use the Client parameter "plugins"; The second thing is telling Pyrogram where to look for your plugins: you can use the Client parameter "plugins";
the *root* value must match the name of your plugins root folder. Your PyroFork Client instance will **automatically** the *root* value must match the name of your plugins root folder. Your Pyrogram Client instance will **automatically**
scan the folder upon starting to search for valid handlers and register them for you. scan the folder upon starting to search for valid handlers and register them for you.
Then you'll notice you can now use decorators. That's right, you can apply the usual decorators to your callback Then you'll notice you can now use decorators. That's right, you can apply the usual decorators to your callback

View file

@ -1,7 +1,7 @@
Speedups Speedups
======== ========
PyroFork's speed can be boosted up by using TgCrypto and uvloop. Pyrogram's speed can be boosted up by using TgCrypto and uvloop.
.. contents:: Contents .. contents:: Contents
:backlinks: none :backlinks: none
@ -13,7 +13,7 @@ PyroFork's speed can be boosted up by using TgCrypto and uvloop.
TgCrypto TgCrypto
-------- --------
TgCrypto_ is a high-performance, easy-to-install cryptography library specifically written in C for PyroFork as a Python TgCrypto_ is a high-performance, easy-to-install cryptography library specifically written in C for Pyrogram as a Python
extension. It is a replacement for a slower Python-only alternative and implements the cryptographic algorithms Telegram extension. It is a replacement for a slower Python-only alternative and implements the cryptographic algorithms Telegram
requires, namely: AES-256-IGE, AES-256-CTR and AES-256-CBC. requires, namely: AES-256-IGE, AES-256-CTR and AES-256-CBC.
@ -27,7 +27,7 @@ Installation
Usage Usage
^^^^^ ^^^^^
PyroFork will automatically make use of TgCrypto when detected, all you need to do is to install it. Pyrogram will automatically make use of TgCrypto when detected, all you need to do is to install it.
uvloop uvloop
------ ------

View file

@ -1,7 +1,7 @@
Storage Engines Storage Engines
=============== ===============
Every time you login to Telegram, some personal piece of data are created and held by both parties (the client, PyroFork Every time you login to Telegram, some personal piece of data are created and held by both parties (the client, Pyrogram
and the server, Telegram). This session data is uniquely bound to your own account, indefinitely (until you logout or and the server, Telegram). This session data is uniquely bound to your own account, indefinitely (until you logout or
decide to manually terminate it) and is used to authorize a client to execute API calls on behalf of your identity. decide to manually terminate it) and is used to authorize a client to execute API calls on behalf of your identity.
@ -16,12 +16,12 @@ Persisting Sessions
------------------- -------------------
In order to make a client reconnect successfully between restarts, that is, without having to start a new In order to make a client reconnect successfully between restarts, that is, without having to start a new
authorization process from scratch each time, PyroFork needs to store the generated session data somewhere. authorization process from scratch each time, Pyrogram needs to store the generated session data somewhere.
Different Storage Engines Different Storage Engines
------------------------- -------------------------
PyroFork offers two different types of storage engines: a **File Storage** and a **Memory Storage**. Pyrogram offers two different types of storage engines: a **File Storage** and a **Memory Storage**.
These engines are well integrated in the framework and require a minimal effort to set up. Here's how they work: These engines are well integrated in the framework and require a minimal effort to set up. Here's how they work:
File Storage File Storage
@ -42,7 +42,7 @@ To use this type of engine, simply pass any name of your choice to the ``name``
print(await app.get_me()) print(await app.get_me())
Once you successfully log in (either with a user or a bot identity), a session file will be created and saved to disk as Once you successfully log in (either with a user or a bot identity), a session file will be created and saved to disk as
``my_account.session``. Any subsequent client restart will make PyroFork search for a file named that way and the ``my_account.session``. Any subsequent client restart will make Pyrogram search for a file named that way and the
session database will be automatically loaded. session database will be automatically loaded.
Memory Storage Memory Storage
@ -86,5 +86,5 @@ login using the same session; the storage used will still be in-memory:
async with Client("my_account", session_string=session_string) as app: async with Client("my_account", session_string=session_string) as app:
print(await app.get_me()) print(await app.get_me())
Session strings are useful when you want to run authorized PyroFork clients on platforms where their ephemeral Session strings are useful when you want to run authorized Pyrogram clients on platforms where their ephemeral
filesystems makes it harder for a file-based storage engine to properly work as intended. filesystems makes it harder for a file-based storage engine to properly work as intended.

View file

@ -1,13 +1,13 @@
Synchronous Usage Synchronous Usage
================= =================
PyroFork is an asynchronous framework and as such is subject to the asynchronous rules. It can, however, run in Pyrogram is an asynchronous framework and as such is subject to the asynchronous rules. It can, however, run in
synchronous mode (also known as non-asynchronous or sync/non-async for short). This mode exists mainly as a convenience synchronous mode (also known as non-asynchronous or sync/non-async for short). This mode exists mainly as a convenience
way for invoking methods without the need of ``async``/``await`` keywords and the extra boilerplate, but **it's not the way for invoking methods without the need of ``async``/``await`` keywords and the extra boilerplate, but **it's not the
intended way to use the framework**. intended way to use the framework**.
You can use PyroFork in this synchronous mode when you want to write something short and contained without the You can use Pyrogram in this synchronous mode when you want to write something short and contained without the
async boilerplate or in case you want to combine PyroFork with other libraries that are not async. async boilerplate or in case you want to combine Pyrogram with other libraries that are not async.
.. warning:: .. warning::
@ -26,7 +26,7 @@ Synchronous Invocations
----------------------- -----------------------
The following is a standard example of running asynchronous functions with Python's asyncio. The following is a standard example of running asynchronous functions with Python's asyncio.
PyroFork is being used inside the main function with its asynchronous interface. Pyrogram is being used inside the main function with its asynchronous interface.
.. code-block:: python .. code-block:: python
@ -43,7 +43,7 @@ PyroFork is being used inside the main function with its asynchronous interface.
asyncio.run(main()) asyncio.run(main())
To run PyroFork synchronously, use the non-async context manager as shown in the following example. To run Pyrogram synchronously, use the non-async context manager as shown in the following example.
As you can see, the non-async example becomes less cluttered. As you can see, the non-async example becomes less cluttered.
.. code-block:: python .. code-block:: python
@ -75,8 +75,8 @@ possible.
uvloop usage uvloop usage
------------ ------------
When using PyroFork in its synchronous mode combined with uvloop, you need to call ``uvloop.install()`` before importing When using Pyrogram in its synchronous mode combined with uvloop, you need to call ``uvloop.install()`` before importing
PyroFork. Pyrogram.
.. code-block:: python .. code-block:: python

View file

@ -1,7 +1,7 @@
Test Servers Test Servers
============ ============
If you wish to test your application in a separate environment, PyroFork is able to authorize your account into If you wish to test your application in a separate environment, Pyrogram is able to authorize your account into
Telegram's test servers without hassle. All you need to do is start a new session (e.g.: "my_account_test") using Telegram's test servers without hassle. All you need to do is start a new session (e.g.: "my_account_test") using
``test_mode=True``: ``test_mode=True``:

View file

@ -13,7 +13,7 @@ Text Formatting
.. role:: strike-italic .. role:: strike-italic
:class: strike-italic :class: strike-italic
PyroFork uses a custom Markdown dialect for text formatting which adds some unique features that make writing styled Pyrogram uses a custom Markdown dialect for text formatting which adds some unique features that make writing styled
texts easier in both Markdown and HTML. You can send sophisticated text messages and media captions using a texts easier in both Markdown and HTML. You can send sophisticated text messages and media captions using a
variety of decorations that can also be nested in order to combine multiple styles together. variety of decorations that can also be nested in order to combine multiple styles together.
@ -28,7 +28,7 @@ Basic Styles
------------ ------------
When formatting your messages, you can choose between Markdown-style, HTML-style or both (default). The following is a When formatting your messages, you can choose between Markdown-style, HTML-style or both (default). The following is a
list of the basic styles currently supported by PyroFork. list of the basic styles currently supported by Pyrogram.
- **bold** - **bold**
- *italic* - *italic*

View file

@ -109,6 +109,6 @@ More handlers using different filters can also live together.
print("This is the /help command") print("This is the /help command")
@app.on_message(filters.chat("PyroForkChat")) @app.on_message(filters.chat("PyrogramChat"))
async def from_pyrogramchat(client, message): async def from_pyrogramchat(client, message):
print("New message in @PyroForkChat") print("New message in @PyrogramChat")

View file

@ -2,7 +2,7 @@ Voice Calls
=========== ===========
Both private voice calls and group voice calls are currently supported by third-party, external libraries that integrate Both private voice calls and group voice calls are currently supported by third-party, external libraries that integrate
with PyroFork. with Pyrogram.
Libraries Libraries
--------- ---------