Skip to content

Commit 8c82884

Browse files
committed
Various improvements
1 parent 80d0966 commit 8c82884

File tree

135 files changed

+836
-1416
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+836
-1416
lines changed

Diff for: .github/FUNDING.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
github: delivrance
2-
custom: https://docs.pyrogram.org/support
2+
liberapay: delivrance
3+
open_collective: pyrogram

Diff for: .github/ISSUE_TEMPLATE/bug_report.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: Bug Report
3-
about: Create a bug report affecting the library or the documentation
3+
about: Create a bug report affecting the framework or the documentation
44
---
55

66
<!-- WARNING: Ignoring or altering this template could lead to the issue being closed as invalid -->

Diff for: .github/ISSUE_TEMPLATE/config.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ blank_issues_enabled: false
22
contact_links:
33
- name: Ask Pyrogram related questions
44
url: https://stackoverflow.com/questions/tagged/pyrogram
5-
about: This place is for issues about Pyrogram. If you'd like to ask a question, please do so at StackOverflow.
6-
- name: Join the Telegram community
5+
about: This place is only for reporting issues about Pyrogram. You can ask questions at StackOverflow.
6+
- name: Join the Telegram channel
77
url: https://t.me/pyrogram
8-
about: Join the official channel to stay tuned for news and updates.
8+
about: Join the official channel and stay tuned for news, updates and announcements.

Diff for: .github/ISSUE_TEMPLATE/feature_request.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ labels: "enhancement"
77
<!-- WARNING: Ignoring or altering this template could lead to the issue being closed as invalid -->
88

99
## Checklist
10-
- [ ] I believe the idea is awesome and would benefit the library.
10+
- [ ] I believe the idea is awesome and would benefit the framework.
1111
- [ ] I have searched in the issue tracker for similar requests, including closed ones.
1212

1313
## Description

Diff for: README.md

+27-31
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<p align="center">
22
<a href="https://github.com/pyrogram/pyrogram">
3-
<img src="https://i.imgur.com/BOgY9ai.png" alt="Pyrogram">
3+
<img src="https://docs.pyrogram.org/_static/pyrogram.png" alt="Pyrogram" width="128">
44
</a>
55
<br>
66
<b>Telegram MTProto API Framework for Python</b>
@@ -9,17 +9,19 @@
99
Documentation
1010
</a>
1111
12-
<a href="https://github.com/pyrogram/pyrogram/releases">
12+
<a href="https://docs.pyrogram.org/releases">
1313
Releases
1414
</a>
1515
16-
<a href="https://t.me/Pyrogram">
17-
Community
16+
<a href="https://t.me/pyrogram">
17+
News
1818
</a>
1919
</p>
2020

2121
## Pyrogram
2222

23+
> Elegant, modern and asynchronous Telegram MTProto API framework in Python for users and bots
24+
2325
``` python
2426
from pyrogram import Client, filters
2527

@@ -28,34 +30,33 @@ app = Client("my_account")
2830

2931
@app.on_message(filters.private)
3032
async def hello(client, message):
31-
await message.reply_text(f"Hello {message.from_user.mention}")
33+
await message.reply("Hello from Pyrogram!")
3234

3335

3436
app.run()
3537
```
3638

37-
**Pyrogram** is a modern, elegant and easy-to-use [Telegram](https://telegram.org/) client library framework written
38-
from the ground up in Python and C. It enables you to easily create custom Telegram client applications for both user
39-
and bot identities (bot API alternative) via the [MTProto API](https://docs.pyrogram.org/topics/mtproto-vs-botapi).
39+
**Pyrogram** is a modern, elegant and asynchronous [MTProto API](https://docs.pyrogram.org/topics/mtproto-vs-botapi)
40+
framework. It enables you to easily interact with the main Telegram API through a user account (custom client) or a bot
41+
identity (bot API alternative) using Python.
4042

41-
### Features
43+
### Support
4244

43-
- **Easy**: You can install Pyrogram with pip and start building your applications right away.
44-
- **Elegant**: Low-level details are abstracted and re-presented in a much nicer and easier way.
45-
- **Fast**: Crypto parts are boosted up by [TgCrypto](https://github.com/pyrogram/tgcrypto), a high-performance library
46-
written in pure C.
47-
- **Asynchronous**: Allows both synchronous and asynchronous models to fit all usage needs.
48-
- **Documented**: API methods, types and public interfaces are all [well documented](https://docs.pyrogram.org).
49-
- **Type-hinted**: Types and methods are all type-hinted, enabling excellent editor support.
50-
- **Updated**, to make use of the latest Telegram API version and features.
51-
- **Bot API-like**: Similar to the Bot API in its simplicity, but much more powerful and detailed.
52-
- **Pluggable**: The Smart Plugin system allows to write components with minimal boilerplate code.
53-
- **Comprehensive**: Execute any advanced action an official client is able to do, and even more.
45+
If you'd like to support Pyrogram, you can consider:
46+
47+
- [Become a GitHub sponsor](https://github.com/sponsors/delivrance).
48+
- [Become a LiberaPay patron](https://liberapay.com/delivrance).
49+
- [Become an OpenCollective backer](https://opencollective.com/pyrogram>).
5450

55-
### Requirements
51+
### Key Features
5652

57-
- Python 3.6 or higher.
58-
- A [Telegram API key](https://docs.pyrogram.org/intro/setup#api-keys).
53+
- **Ready**: Install Pyrogram with pip and start building your applications right away.
54+
- **Easy**: Makes the Telegram API simple and intuitive, while still allowing advanced usages.
55+
- **Elegant**: Low-level details are abstracted and re-presented in a more convenient way.
56+
- **Fast**: Boosted up by [TgCrypto](https://github.com/pyrogram/tgcrypto), a high-performance crypto library written in pure C.
57+
- **Type-hinted**: Types and methods are all type-hinted, enabling excellent editor support.
58+
- **Async**: Fully asynchronous (also usable synchronously if wanted, for convenience).
59+
- **Powerful**: Full access to Telegram's API to execute any official client action and more.
5960

6061
### Installing
6162

@@ -65,11 +66,6 @@ pip3 install pyrogram
6566

6667
### Resources
6768

68-
- The docs contain lots of resources to help you get started with Pyrogram: https://docs.pyrogram.org.
69-
- Seeking extra help? Come join and ask our community: https://t.me/pyrogram.
70-
- For other kind of inquiries, you can send a [message](https://t.me/haskell) or an [e-mail](mailto:[email protected]).
71-
72-
### Copyright & License
73-
74-
- Copyright (C) 2017-2021 Dan <<https://github.com/delivrance>>
75-
- Licensed under the terms of the [GNU Lesser General Public License v3 or later (LGPLv3+)](COPYING.lesser)
69+
- Check out the docs at https://docs.pyrogram.org to learn more about Pyrogram, get started right
70+
away and discover more in-depth material for building your client applications.
71+
- Join the official channel at https://t.me/pyrogram and stay tuned for news, updates and announcements.

Diff for: compiler/docs/compiler.py

+8
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ def get_title_list(s: str) -> list:
158158
send_venue
159159
send_contact
160160
send_cached_media
161+
send_reaction
161162
edit_message_text
162163
edit_message_caption
163164
edit_message_media
@@ -180,7 +181,9 @@ def get_title_list(s: str) -> list:
180181
retract_vote
181182
send_dice
182183
search_messages
184+
search_messages_count
183185
search_global
186+
search_global_count
184187
download_media
185188
get_discussion_message
186189
""",
@@ -284,6 +287,7 @@ def get_title_list(s: str) -> list:
284287
send_game
285288
set_game_score
286289
get_game_high_scores
290+
set_bot_commands
287291
""",
288292
authorization="""
289293
Authorization
@@ -360,6 +364,7 @@ def get_title_list(s: str) -> list:
360364
ChatEvent
361365
ChatEventFilter
362366
ChatMemberUpdated
367+
ChatJoinRequest
363368
Dialog
364369
Restriction
365370
""",
@@ -384,6 +389,7 @@ def get_title_list(s: str) -> list:
384389
Poll
385390
PollOption
386391
Dice
392+
Reaction
387393
VoiceChatScheduled
388394
VoiceChatStarted
389395
VoiceChatEnded
@@ -420,6 +426,8 @@ def get_title_list(s: str) -> list:
420426
InlineQueryResultArticle
421427
InlineQueryResultPhoto
422428
InlineQueryResultAnimation
429+
InlineQueryResultAudio
430+
InlineQueryResultVideo
423431
ChosenInlineResult
424432
""",
425433
input_message_content="""

Diff for: compiler/docs/template/bound-methods.rst

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
Bound Methods
22
=============
33

4-
Some Pyrogram types define what are called bound methods. Bound methods are functions attached to a class which are
5-
accessed via an instance of that class. They make it even easier to call specific methods by automatically inferring
4+
Some Pyrogram types define what are called bound methods. Bound methods are functions attached to a type which are
5+
accessed via an instance of that type. They make it even easier to call specific methods by automatically inferring
66
some of the required arguments.
77

88
.. code-block:: python
9-
:emphasize-lines: 8
109
1110
from pyrogram import Client
1211
@@ -15,7 +14,7 @@ some of the required arguments.
1514
1615
@app.on_message()
1716
def hello(client, message)
18-
message.reply_text("hi")
17+
message.reply("hi")
1918
2019
2120
app.run()

Diff for: compiler/docs/template/methods.rst

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
Available Methods
22
=================
33

4-
This page is about Pyrogram methods. All the methods listed here are bound to a :class:`~pyrogram.Client` instance,
5-
except for :meth:`~pyrogram.idle()`, which is a special function that can be found in the main package directly.
4+
This page is about Pyrogram methods. All the methods listed here are bound to a :class:`~pyrogram.Client` instance.
5+
Some other utility functions can instead be found in the main package directly.
66

77
.. code-block:: python
8-
:emphasize-lines: 6
98
109
from pyrogram import Client
1110
1211
app = Client("my_account")
1312
1413
with app:
15-
app.send_message("haskell", "hi")
14+
app.send_message("me", "hi")
1615
1716
.. contents:: Contents
1817
:backlinks: none

Diff for: compiler/docs/template/types.rst

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ Unless required as argument to a client method, most of the types don't need to
66
are only returned by other methods. You also don't need to import them, unless you want to type-hint your variables.
77

88
.. code-block:: python
9-
:emphasize-lines: 1
109
1110
from pyrogram.types import User, Message, ...
1211

Diff for: compiler/errors/source/400_BAD_REQUEST.tsv

+2-1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ CHAT_NOT_MODIFIED The chat settings (title, permissions, photo, etc..) were not
6262
CHAT_RESTRICTED The chat is restricted and cannot be used
6363
CHAT_SEND_INLINE_FORBIDDEN You cannot use inline bots to send messages in this chat
6464
CHAT_TITLE_EMPTY The chat title is empty
65+
CHAT_TOO_BIG The chat is too big for this action
6566
CODE_EMPTY The provided code is empty
6667
CODE_HASH_INVALID The provided code hash invalid
6768
CODE_INVALID The provided code is invalid (i.e. from email)
@@ -347,4 +348,4 @@ WEBDOCUMENT_URL_EMPTY The web document URL is empty
347348
WEBDOCUMENT_URL_INVALID The web document URL is invalid
348349
WEBPAGE_CURL_FAILED Telegram server could not fetch the provided URL
349350
WEBPAGE_MEDIA_EMPTY The URL doesn't contain any valid media
350-
YOU_BLOCKED_USER You blocked this user
351+
YOU_BLOCKED_USER You blocked this user

Diff for: compiler/errors/source/401_UNAUTHORIZED.tsv

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ id message
22
ACTIVE_USER_REQUIRED The method is only available to already activated users
33
AUTH_KEY_INVALID The key is invalid
44
AUTH_KEY_PERM_EMPTY The method is unavailable for temporary authorization key, not bound to permanent
5-
AUTH_KEY_UNREGISTERED The key is not registered in the system
5+
AUTH_KEY_UNREGISTERED The key is not registered in the system. Delete your session file and login again
66
SESSION_EXPIRED The authorization has expired
77
SESSION_PASSWORD_NEEDED The two-step verification is enabled and a password is required
88
SESSION_REVOKED The authorization has been invalidated, because of the user terminating all sessions

Diff for: docs/README.md

-8
This file was deleted.

Diff for: docs/requirements.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
sphinx
2-
sphinx_rtd_theme
2+
sphinx_rtd_theme==1.0.0
33
sphinx_copybutton
44
pypandoc
55
requests
6-
sphinx-autobuild
6+
sphinx-autobuild

Diff for: docs/robots.txt

-7
This file was deleted.

Diff for: docs/scripts/releases.py

-84
This file was deleted.

0 commit comments

Comments
 (0)