Skip to content

Commit

Permalink
Rebrand and Update Pyrogram to 2.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
SpEcHiDe committed Dec 24, 2024
1 parent a2b8b51 commit 0b2cffb
Show file tree
Hide file tree
Showing 22 changed files with 62 additions and 161 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ body:
required: true
- label: I have searched in the issue tracker for similar bug reports, including closed ones
required: true
- label: I ran `pip3 install -U https://github.com/pyrogram/pyrogram/archive/master.zip` and reproduced the issue using the latest development version
- label: I ran `pip3 install https://github.com/TelegramPlayground/pyrogram/archive/dev.zip --force-reinstall` and reproduced the issue using the latest development version
required: true

- type: textarea
Expand Down Expand Up @@ -49,4 +49,4 @@ body:
Traceback (most recent call last):
File "main.py", line 1, in <module>
...
render: shell
render: shell
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
blank_issues_enabled: false
blank_issues_enabled: true
contact_links:
- name: Ask Pyrogram related questions
url: https://stackoverflow.com/questions/tagged/pyrogram
about: This place is only for reporting issues about Pyrogram. You can ask questions at StackOverflow.
about: This place is only for reporting issues about Pyrogram. You can ask questions on StackOverflow.
- name: Join the Telegram channel
url: https://t.me/pyrogram
about: Join the official channel and stay tuned for news, updates and announcements.
url: https://t.me/PyroTGFork
about: Join the official channel and stay tuned for news, updates and announcements.
8 changes: 5 additions & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
## Include
# Include files
include README.md COPYING COPYING.lesser NOTICE requirements.txt
recursive-include compiler *.py *.tl *.tsv *.txt
recursive-include tests *.py

## Exclude
# Exclude files
exclude pyrogram/raw/all.py

# Prune directories
prune pyrogram/errors/exceptions
prune pyrogram/raw/functions
prune pyrogram/raw/types
prune pyrogram/raw/base
exclude pyrogram/raw/all.py
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ TAG = v$(shell grep -E '__version__ = ".*"' pyrogram/__init__.py | cut -d\" -f2)

RM := rm -rf

.PHONY: venv clean-build clean-api clean api build clean-docs docs
.PHONY: venv clean-build clean-api clean api build tag dtag clean-docs docs

all: clean venv build
echo Done
Expand Down
41 changes: 10 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,19 @@
## [Fork Documentation](https://telegramplayground.github.io/pyrogram/)

## Installing this Fork

```bash
pip install PyroTGFork
```


<p align="center">
<a href="https://github.com/pyrogram/pyrogram">
<img src="https://docs.pyrogram.org/_static/pyrogram.png" alt="Pyrogram" width="128">
<a href="https://github.com/TelegramPlayground/pyrogram">
<img src="https://raw.githubusercontent.com/pyrogram/artwork/master/artwork/pyrogram-logo.png" alt="Pyrogram" width="128">
</a>
<br>
<b>Telegram MTProto API Framework for Python</b>
<br>
<a href="https://pyrogram.org">
Homepage
</a>
<a href="https://docs.pyrogram.org">
<a href="https://telegramplayground.github.io/pyrogram/">
Documentation
</a>
<a href="https://docs.pyrogram.org/releases">
<a href="https://telegramplayground.github.io/pyrogram/releases/changes-in-this-fork.html">
Releases
</a>
<a href="https://t.me/pyrogram">
<a href="https://t.me/PyroTGFork">
News
</a>
</p>
Expand All @@ -49,36 +36,28 @@ async def hello(client, message):
app.run()
```

**Pyrogram** is a modern, elegant and asynchronous [MTProto API](https://docs.pyrogram.org/topics/mtproto-vs-botapi)
**Pyrogram** is a modern, elegant and asynchronous [MTProto API](https://telegramplayground.github.io/pyrogram/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 (bot API alternative) using Python.

### Support

If you'd like to support Pyrogram, you can consider:

- [Become a GitHub sponsor](https://github.com/sponsors/delivrance).
- [Become a LiberaPay patron](https://liberapay.com/delivrance).
- [Become an OpenCollective backer](https://opencollective.com/pyrogram).

### Key Features

- **Ready**: Install Pyrogram with pip and start building your applications right away.
- **Easy**: Makes the Telegram API simple and intuitive, while still allowing advanced usages.
- **Elegant**: Low-level details are abstracted and re-presented in a more convenient way.
- **Fast**: Boosted up by [TgCrypto](https://github.com/pyrogram/tgcrypto), a high-performance cryptography library written in C.
- **Fast**: Boosted up by [TgCrypto](https://github.com/TelegramPlayGround/pyrogram-tgcrypto), a high-performance cryptography library written in C.
- **Type-hinted**: Types and methods are all type-hinted, enabling excellent editor support.
- **Async**: Fully asynchronous (also usable synchronously if wanted, for convenience).
- **Powerful**: Full access to Telegram's API to execute any official client action and more.

### Installing

``` bash
pip3 install pyrogram
pip3 install pyrotgfork
```

### Resources

- Check out the docs at https://docs.pyrogram.org to learn more about Pyrogram, get started right
- Check out [the docs](https://telegramplayground.github.io/pyrogram) to learn more about Pyrogram, get started right
away and discover more in-depth material for building your client applications.
- Join the official channel at https://t.me/pyrogram and stay tuned for news, updates and announcements.
- Join the official channel at [PyroTGFork](https://t.me/PyroTGFork) and stay tuned for news, updates and announcements.
10 changes: 6 additions & 4 deletions compiler/api/template/type.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ class {name}: # type: ignore
QUALNAME = "pyrogram.raw.base.{qualname}"

def __init__(self):
raise TypeError("Base types can only be used for type checking purposes: "
"you tried to use a base type instance as argument, "
"but you need to instantiate one of its constructors instead. "
"More info: https://docs.pyrogram.org/telegram/base/{doc_name}")
raise TypeError(
"Base types can only be used for type checking purposes: "
"you tried to use a base type instance as argument, "
"but you need to instantiate one of its constructors instead. "
"More info: https://telegramplayground.github.io/pyrogram/telegram/base/{doc_name}"
)
2 changes: 1 addition & 1 deletion docs/source/intro/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ If no error shows up you are good to go.
>>> __version__
'2.0.106-TL-158'
.. _`Github repo`: http://github.com/pyrogram/pyrogram
.. _`Github repo`: http://github.com/TelegramPlayGround/pyrogram
2 changes: 1 addition & 1 deletion docs/source/releases/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ Release notes for Pyrogram releases will describe what's new in each version, an
When upgrading to a new version of Pyrogram, you will need to check all the changes in order to find incompatible code in your application, but also to take advantage of new features and improvements.

- :doc:`Changes in this Fork <changes-in-this-fork>`
- `Previous Changes <https://docs.pyrogram.org/releases/>`_.
- `Previous Changes <https://web.archive.org/web/20241127113824/https://docs.pyrogram.org/releases/>`_.
2 changes: 1 addition & 1 deletion docs/source/start/examples/bot_keyboards.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ like :meth:`~pyrogram.Client.send_audio`, :meth:`~pyrogram.Client.send_document`
),
InlineKeyboardButton( # Opens a web URL
"URL",
url="https://docs.pyrogram.org"
url="https://telegramplayground.github.io/pyrogram/"
),
],
[ # Second row
Expand Down
8 changes: 4 additions & 4 deletions docs/source/start/examples/inline_queries.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ It uses the :meth:`~pyrogram.Client.on_inline_query` decorator to register an :o
input_message_content=InputTextMessageContent(
"Here's how to install **Pyrogram**"
),
url="https://docs.pyrogram.org/intro/install",
url="https://telegramplayground.github.io/pyrogram/intro/install",
description="How to install Pyrogram",
reply_markup=InlineKeyboardMarkup(
[
[InlineKeyboardButton(
"Open website",
url="https://docs.pyrogram.org/intro/install"
url="https://telegramplayground.github.io/pyrogram/intro/install"
)]
]
)
Expand All @@ -42,13 +42,13 @@ It uses the :meth:`~pyrogram.Client.on_inline_query` decorator to register an :o
input_message_content=InputTextMessageContent(
"Here's how to use **Pyrogram**"
),
url="https://docs.pyrogram.org/start/invoking",
url="https://telegramplayground.github.io/pyrogram/start/invoking",
description="How to use Pyrogram",
reply_markup=InlineKeyboardMarkup(
[
[InlineKeyboardButton(
"Open website",
url="https://docs.pyrogram.org/start/invoking"
url="https://telegramplayground.github.io/pyrogram/start/invoking"
)]
]
)
Expand Down
2 changes: 1 addition & 1 deletion docs/source/start/examples/welcome_bot.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,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 = -100123456789
# Welcome message template
MESSAGE = "{} Welcome to [Pyrogram](https://docs.pyrogram.org/)'s group chat {}!"
MESSAGE = "{} Welcome to [Pyrogram](https://telegramplayground.github.io/pyrogram/)'s group chat {}!"
app = Client("my_account")
Expand Down
8 changes: 4 additions & 4 deletions docs/source/support.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ Support Pyrogram

<div style="float: right; margin-bottom: 10px">
<a class="github-button"
href="https://github.com/pyrogram/pyrogram"
href="https://github.com/TelegramPlayGround/pyrogram"
data-color-scheme="no-preference: light; light: light; dark: dark;"
data-icon="octicon-star" data-size="large" data-show-count="true"
aria-label="Star pyrogram/pyrogram on GitHub">Star</a>
aria-label="Star TelegramPlayGround/pyrogram on GitHub">Star</a>

<a class="github-button"
href="https://github.com/pyrogram/pyrogram/fork"
href="https://github.com/TelegramPlayGround/pyrogram/fork"
data-color-scheme="no-preference: light; light: light; dark: dark;"
data-icon="octicon-repo-forked" data-size="large"
data-show-count="true" aria-label="Fork pyrogram/pyrogram on GitHub">Fork</a>
Expand Down Expand Up @@ -60,4 +60,4 @@ OpenCollective Backer

.. raw:: html

<script src="https://opencollective.com/pyrogram/banner.js"></script>
<script src="https://opencollective.com/pyrogram/banner.js"></script>
2 changes: 1 addition & 1 deletion docs/source/topics/speedups.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,5 @@ The ``uvloop.install()`` call also needs to be placed before creating a Client i
app.run()
.. _TgCrypto: https://github.com/pyrogram/tgcrypto
.. _TgCrypto: https://github.com/TelegramPlayGround/pyrogram-tgcrypto
.. _uvloop: https://github.com/MagicStack/uvloop
10 changes: 5 additions & 5 deletions docs/source/topics/text-formatting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ list of the basic styles currently supported by Pyrogram.
fixed-width
code block
- spoiler
- `text URL <https://docs.pyrogram.org>`_
- `text URL <https://telegramplayground.github.io/pyrogram/>`_
- `user text mention <tg://user?id=123456789>`_


Expand Down Expand Up @@ -71,7 +71,7 @@ To strictly use this mode, pass :obj:`~pyrogram.enums.ParseMode.MARKDOWN` to the
||spoiler||
[text URL](https://docs.pyrogram.org/)
[text URL](https://telegramplayground.github.io/pyrogram/)
[text user mention](tg://user?id=123456789)
Expand All @@ -90,7 +90,7 @@ To strictly use this mode, pass :obj:`~pyrogram.enums.ParseMode.MARKDOWN` to the
"--underline--, "
"~~strike~~, "
"||spoiler||, "
"[URL](https://docs.pyrogram.org), "
"[URL](https://telegramplayground.github.io/pyrogram/), "
"`code`, "
"```"
"for i in range(10):\n"
Expand Down Expand Up @@ -118,7 +118,7 @@ To strictly use this mode, pass :obj:`~pyrogram.enums.HTML` to the *parse_mode*
<spoiler>spoiler</spoiler>
<a href="https://docs.pyrogram.org">text URL</a>
<a href="https://telegramplayground.github.io/pyrogram/">text URL</a>
<a href="tg://user?id=123456789">inline mention</a>
Expand Down Expand Up @@ -146,7 +146,7 @@ To strictly use this mode, pass :obj:`~pyrogram.enums.HTML` to the *parse_mode*
"<u>underline</u>, "
"<s>strike</s>, "
"<spoiler>spoiler</spoiler>, "
"<a href=\"https://docs.pyrogram.org\">URL</a>, "
"<a href=\"https://telegramplayground.github.io/pyrogram/\">URL</a>, "
"<code>code</code>\n\n"
"<pre language='py'>"
"for i in range(10):\n"
Expand Down
2 changes: 1 addition & 1 deletion pyrogram/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.

__fork_name__ = "pyrotgfork"
__version__ = "2.1.37"
__version__ = "2.2.1"
__license__ = "GNU Lesser General Public License v3.0 (LGPL-3.0)"
__copyright__ = "Copyright (C) 2017-present Dan <https://github.com/delivrance>"

Expand Down
6 changes: 4 additions & 2 deletions pyrogram/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -812,8 +812,10 @@ async def load_session(self):

if session_empty:
if not self.api_id or not self.api_hash:
raise AttributeError("The API key is required for new authorizations. "
"More info: https://docs.pyrogram.org/start/auth")
raise AttributeError(
"The API key is required for new authorizations. "
"More info: https://telegramplayground.github.io/pyrogram/start/auth"
)

await self.storage.api_id(self.api_id)

Expand Down
2 changes: 1 addition & 1 deletion pyrogram/crypto/aes.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def xor(a: bytes, b: bytes) -> bytes:
log.warning(
"TgCrypto is missing! "
"Pyrogram will work the same, but at a much slower speed. "
"More info: https://docs.pyrogram.org/topics/speedups"
"More info: https://telegramplayground.github.io/pyrogram/topics/speedups"
)


Expand Down
2 changes: 1 addition & 1 deletion pyrogram/methods/chat_topics/edit_forum_topic.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async def edit_forum_topic(
message = await app.create_forum_topic(chat, "Topic Title")
# Edit the Topic
await app.edit_forum_topic(chat, message.id, "New Topic Title")
# TODO: there is `a bug <https://github.com/pyrogram/pyrogram/issues/1280>`_ here!
"""

r = await self.invoke(
Expand Down
2 changes: 1 addition & 1 deletion pyrogram/methods/messages/get_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,4 +220,4 @@ async def get_messages(
message_ids=message_id
)

raise ValueError("No valid argument supplied. https://docs.pyrogram.org/api/methods/get_messages")
raise ValueError("No valid argument supplied. https://telegramplayground.github.io/pyrogram/api/methods/get_messages")
10 changes: 7 additions & 3 deletions pyrogram/methods/messages/send_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ async def send_message(
# Disable web page previews
await app.send_message(
chat_id="me", text="https://docs.pyrogram.org",
chat_id="me", text="https://github.com/TelegramPlayground/pyrogram",
link_preview_options=types.LinkPreviewOptions(
is_disabled=True
)
Expand All @@ -149,8 +149,12 @@ async def send_message(
chat_id=chat_id, text="These are inline buttons",
reply_markup=InlineKeyboardMarkup(
[
[InlineKeyboardButton("Data", callback_data="callback_data")],
[InlineKeyboardButton("Docs", url="https://docs.pyrogram.org")]
[
InlineKeyboardButton("Data", callback_data="callback_data")
],
[
InlineKeyboardButton("Docs", url="https://telegramplayground.github.io/pyrogram/")
]
]))
"""
if disable_web_page_preview and link_preview_options:
Expand Down
2 changes: 1 addition & 1 deletion pyrogram/methods/users/update_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ async def update_profile(
await app.update_profile(first_name="Pyrogram")
# Update first name and bio
await app.update_profile(first_name="Pyrogram", bio="https://docs.pyrogram.org/")
await app.update_profile(first_name="Pyrogram", bio="https://github.com/TelegramPlayground/pyrogram")
# Remove the last name
await app.update_profile(last_name="")
Expand Down
Loading

0 comments on commit 0b2cffb

Please sign in to comment.