Compare commits

..

95 commits
main ... 2.1.8

Author SHA1 Message Date
wulan17
5bc419ce2c
PyroFork: Bump version to 2.1.8
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-05-17 18:32:49 +07:00
Animesh Murmu
955db61bc3
fix: Fix ValueError: Invalid peer type (Issue #2)
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-05-17 18:31:37 +07:00
Animesh Murmu
b27d18c640
fix: Fix ValueError: Invalid peer type (Issue #2)
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-05-17 18:31:19 +07:00
wulan17
578b438804
PyroFork: Bump version to 2.1.7
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-05-10 19:36:47 +07:00
Animesh Murmu
c646595adb
Pyrofork: Add Mongodb Session Storage
Signed-off-by: wulan17 <wulan17@nusantararom.org>
Co-authored-by: wulan17 <wulan17@nusantararom.org>
2023-05-10 19:36:46 +07:00
Dan
91ff2dc82d
Move the CDN DC IPv6 to the correct mapping
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-05-10 19:10:10 +07:00
Dan
c3eddf234c
Add RSA public keys & IP addresses for some CDN DCs
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-05-10 19:10:10 +07:00
Dan
fadd6bc147
Update API schema to Layer 158
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-05-10 19:10:09 +07:00
ff4ee9dae8
Update FUNDING.yml 2023-05-09 22:58:41 +07:00
wulan17
c0d9564843
PyroFork: Bump version to 2.1.6
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-04-15 01:36:43 +07:00
MrMissx
2378fb7800
Fix AttributeError when received ChatForbidden
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-04-15 01:28:39 +07:00
Alisson Lauffer
5c78995343
Bump aiosqlite to latest version
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-04-15 01:28:39 +07:00
reaitten
344256d92b
InputMessageContent.write is a coroutine
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-04-15 01:28:39 +07:00
Deshdeepak
08248222bb
Add file_name where missing and pass thumb as Union
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-04-15 01:28:39 +07:00
Devesh Pal
9bb83e9319
Add bound method stop() to the Poll object
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-04-15 01:28:38 +07:00
Hitalo
c35e60de94
Move to aiosqlite and enable WAL
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-04-15 01:28:38 +07:00
Alisson Lauffer
5d5e4b4845
Make some methods static
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-04-15 01:28:38 +07:00
wulan17
1cfad73e95
PyroFork: Add usernames field to User
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-04-15 01:28:38 +07:00
664b525530
Merge pull request #1 from DoellBarr/master
Fix NameError on line 240
2023-04-12 17:21:59 +07:00
Shohih Abdul
1d4948309f
Fix NameError on line 240 2023-04-12 14:03:22 +07:00
wulan17
caf80f239b
PyroFork: Fix derps
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-04-10 23:11:14 +07:00
wulan17
d5b2a76fc6
PyroFork: Bump version to 2.1.5
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-04-10 22:29:36 +07:00
wulan17
f38d90cc0a
PyroFork: Add AddStickerToSet Methods
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-04-10 22:28:56 +07:00
wulan17
7a58c865b5
PyroFork: Add CreateStickerSet Methods
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-04-10 22:28:56 +07:00
wulan17
9966bd92a5
PyroFork: Add GetStickerSet methods and StickerSet types
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-04-10 22:28:56 +07:00
wulan17
2cd117f301
PyroFork: Add usernames field to Chat
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-04-10 22:28:56 +07:00
Alisson Lauffer
4401c62244
Add full_name property to User and Chat objects
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-04-10 22:28:56 +07:00
Nick
2afbe7f4fd
Update API schema to Layer 157
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-04-10 22:28:55 +07:00
Nick
66c7d64b6b
Update API schema to Layer 156
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-04-10 22:28:55 +07:00
wulan17
cbbd0e0dd2
PyroFork: Build docs only on new release
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-03-17 19:29:46 +07:00
wulan17
99e3f3e317
PyroFork: Bump version to 2.1.4
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-03-17 01:04:07 +07:00
Nick
ab1dde5f79
Update API schema to Layer 155
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-03-17 01:01:56 +07:00
Nick
252a49332d
Update API schema to Layer 154
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-03-17 01:01:56 +07:00
Dan
d398b5b29c
Separate cases between Channel and ChannelForbidden
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-03-17 00:59:21 +07:00
Dan
8940c7d1f6
Update chat username parsing in case of multiple usernames
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-03-17 00:59:20 +07:00
Dan
3163030574
Update send_inline_bot_result return type hint
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-03-17 00:59:20 +07:00
Jins Mathew
cb7ba4f821
Add missing has_spoiler parameter to reply_{animation,photo,video}
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-03-17 00:58:52 +07:00
wulan17
cb60c6ae8d
PyroFork: Update API schema to Layer 152
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-02-04 20:08:24 +07:00
wulan17
84b4d2181b
PyroFork: Bump version to 2.1.3
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-01-30 01:22:44 +07:00
ab7ab16356
Pyrofork: Release to pypi 2023-01-30 01:21:53 +07:00
wulan17
6331a5500e
PyroFork: Update README.md and setup,py
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-01-30 01:21:53 +07:00
wulan17
fbe56d5426
PyroFork: Bump version to 2.1.2
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-01-30 01:20:48 +07:00
kkwilllo
1d113f8aa4
add min & max id support
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-01-17 22:13:54 +07:00
wulan17
034a4d6041
PyroFork: More cleanup
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-01-17 20:45:50 +07:00
wulan17
42a2f04d8e
Revert "PyroFork: Add listen and ask"
This reverts commit e39fdcca0e.

Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-01-17 20:43:44 +07:00
wulan17
f55d75d3bb
PyroFork: Add support to send animation in media group
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-01-14 01:02:14 +07:00
Dan
c484e82810
Sort the lists of known errors 2023-01-11 21:43:31 +07:00
Mahesh
30822dabff
Add BUTTON_USER_PRIVACY_RESTRICTED to the list of known errors (#1193)
* Add BUTTON_USER_PRIVACY_RESTRICTED to known errors

* Update 400_BAD_REQUEST.tsv

Co-authored-by: Dan <14043624+delivrance@users.noreply.github.com>
2023-01-11 21:43:31 +07:00
Dan
3a88297a9a
Add INVITE_REQUEST_SENT to known errors 2023-01-11 21:43:31 +07:00
Nick
231f1a1620
Add BOT_ONESIDE_NOT_AVAIL to known errors (#1073)
* `BOT_ONESIDE_NOT_AVAIL`

* Update 400_BAD_REQUEST.tsv

Co-authored-by: Dan <14043624+delivrance@users.noreply.github.com>
2023-01-11 21:43:17 +07:00
wulan17
0f60e05fce
PyroFork: Bump version to 2.1.1
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-01-05 01:59:32 +07:00
Cezar Pauxis
e39fdcca0e
PyroFork: Add listen and ask
Co-authored-by: wulan17 <wulan17@nusantararom.org>
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-01-05 01:58:09 +07:00
wulan17
00fb071215
PyroFork: docs: Add missing ChatJoinedByRequest, PeerUser and PeerChannel
and some cleanup

Signed-off-by: wulan17 <galihgustip@gmail.com>
2023-01-04 11:02:48 +07:00
wulan17
609d8985d4
PyroFork: Cleanup parameter description
Signed-off-by: wulan17 <galihgustip@gmail.com>
2023-01-04 09:52:13 +07:00
wulan17
e15e3d7d50
PyroFork: Add get_forum_topic and get_forum_topic_by_id methods
Signed-off-by: wulan17 <galihgustip@gmail.com>
2023-01-03 15:52:31 +07:00
wulan17
b1354d5579
PyroFork: docs: Add usable by
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-01-02 18:50:49 +07:00
wulan17
2a8a01aeb5
PyroFork: Update READNE
Signed-off-by: wulan17 <galihgustip@gmail.com>
2023-01-02 15:49:05 +07:00
wulan17
bec44280a4
PyroFork: Rebrand docs
Signed-off-by: wulan17 <galihgustip@gmail.com>
2023-01-02 15:49:05 +07:00
wulan17
41b771f4bf
PyroFork: Update docs
Signed-off-by: wulan17 <galihgustip@gmail.com>
2023-01-02 15:49:03 +07:00
wulan17
d91b933715
PyroFork: Bring back docs
Signed-off-by: wulan17 <galihgustip@gmail.com>
2023-01-02 15:04:23 +07:00
wulan17
b2158f702a
PyroFork: Cleanup
Signed-off-by: wulan17 <galihgustip@gmail.com>
2023-01-02 10:00:36 +07:00
wulan17
97f0ecc7c9
PyroFork: Add CloseGeneralTopic, EditGeneralTopic, ReopenGeneralTopic, HideGeneralTopic. UnhideGeneralTopic, and some cleanup
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-01-02 00:40:04 +07:00
wulan17
b64d33dca0
PyroFork: rebrand
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-01-01 23:41:56 +07:00
Dan
482798c2fc
Set has_media_spoiler only in case of Photo, Video or Animation media 2023-01-01 23:12:45 +07:00
Dan
64177b533c
Fix resolving peers for users with multiple usernames
This currently makes it work for the first available username only
2023-01-01 23:12:45 +07:00
Dan
3c0e86a167
Add support for email sign in codes
Fixes #1183
2023-01-01 23:12:45 +07:00
Dan
09ad827374
Add media spoiler support for other relevant methods
- send_media_group()
- edit_message_media()
- edit_inline_media()
2023-01-01 23:12:45 +07:00
Dan
94c589ed43
Add the field is_persistent to the class ReplyKeyboardMarkup 2023-01-01 23:12:44 +07:00
Dan
77cfaa0ff4
Add the field has_spoiler to relevant InputMedia* classes
- InputMediaPhoto
- InputMediaVideo
- InputMediaAnimation
2023-01-01 23:12:44 +07:00
Dan
28307ca58e
Add media_spoiler filter 2023-01-01 23:12:44 +07:00
Dan
65b045ff2d
Add the parameter has_spoiler to relevant send_* media methods
- send_photo()
- send_video()
- send_animation()
2023-01-01 23:11:28 +07:00
Dan
b865512c68
Add the field has_media_spoiler to the class Message 2023-01-01 23:11:15 +07:00
KyMaP13
b0ac808f2e
Add VOICE_MESSAGES_FORBIDDEN (#1151)
* add VOICE_MESSAGES_FORBIDDEN

* Update 400_BAD_REQUEST.tsv

Co-authored-by: onefedov <onefedov@yandex-team.ru>
Co-authored-by: Dan <14043624+delivrance@users.noreply.github.com>
2023-01-01 23:11:07 +07:00
omg-xtao
3e219771bd
Add support for Fragment SMS codes (#1170) 2023-01-01 23:11:07 +07:00
wulan17
aedade2ff2
Pyrogram: add message_thread_id parameter to send_chat_action
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-01-01 22:53:36 +07:00
wulan17
8428de1722
Pyrogram: add GeneralTopicHidden and GeneralTopicUnhidden service messages types
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2023-01-01 22:48:39 +07:00
Nick
85184be318
Update API schema to Layer 151
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2022-12-28 01:04:35 +07:00
wulan17
d89b083bf0
Pyrogram: Add message_thread_id parameter to send_inline_bot_result()
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2022-12-17 15:39:11 +07:00
wulan17
ede9af3e00
Pyrogram: types: Message: Add error handling and is_topic_message
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2022-12-17 15:30:58 +07:00
Dan
abf1b2fece
Update Pyrogram to v2.0.70 2022-12-14 13:36:53 +07:00
Anton Kovalevich
b038890745
Handle all given updates, avoid short circuit (#1162) 2022-12-14 13:36:52 +07:00
wulan17
e0b7576418
Pyrogram: Add chat_joined_by_request
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2022-12-14 13:36:52 +07:00
wulan17
86883a3b91
Pyrogram: Cleanup
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2022-12-14 13:34:43 +07:00
wulan17
e38ceb08cc
Pyrogram: utils: Check if messages has topics atribut
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2022-12-10 13:52:57 +07:00
wulan17
b76bf48862
Pyrogram: Add {CREATED,EDITED,DELETED}_FORUM_TOPIC ChatEvent
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2022-12-09 23:41:40 +07:00
wulan17
9f32305c3a
Pyrogram: Add message_thread_id parameter to copy_message method
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2022-12-09 23:41:40 +07:00
wulan17
6edc4256c3
Pyrogram: Add {create,close,reopen,edit,delete}_forum_topic methods
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2022-12-09 23:41:39 +07:00
wulan17
a1aa281614
Pyrogram: Add ForumTopic and some cleanup
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2022-12-09 18:24:31 +07:00
wulan17
00520678f6
Pyrogram: Add message_thread_id parameter to send_game() method and copy() bound method
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2022-12-09 18:12:06 +07:00
wulan17
f22cc34c9a
Pyrogram: Add message_thread_id parameter to forward_message() method and forward() bound method
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2022-12-09 18:12:05 +07:00
wulan17
9b92492553
Pyrogram: Add message_thread_id parameter to send_{animation,audio,cached_media,contact,dice,document,location,media_group,message,photo,poll,sticker,venue,video,video_note,voice} methods
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2022-12-09 18:07:36 +07:00
wulan17
c9e36cc150
Pyrogram: Add manage_topics parameter to promote_chat_member, restrict_chat_member, and set_chat_permissions methods
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2022-12-09 18:07:36 +07:00
wulan17
eeb1338c48
Pyrogram: Add can_manage_topics fields to ChatPrivileges and ChatPermissions class
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2022-12-09 18:07:35 +07:00
wulan17
115b9877b6
Pyrogram: Add ForumTopicCreated, ForumTopicClosed, ForumTopicReopened, ForumTopicEdited service message types
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2022-12-09 18:07:35 +07:00
wulan17
6f8aaa449c
Pyrogram: Add message_thread_id and is_topic_message fields to Message class, and is_forum fields to Chat class
Signed-off-by: wulan17 <wulan17@nusantararom.org>
2022-12-09 18:07:27 +07:00
772 changed files with 5304 additions and 37053 deletions

4
.github/FUNDING.yml vendored
View file

@ -1,2 +1,2 @@
github: Mayuri-Chan
custom: ["https://t.me/Mayuri17_bot?start=donate"]
ko_fi: wulan17
custom: ["https://saweria.co/wulan17", "https://paypal.me/wulan17", "https://trakteer.id/wulan17"]

View file

@ -4,13 +4,12 @@ body:
- type: checkboxes
attributes:
label: Checklist
description: Invalid, incomplete or inadequate issue reports may not be taken into consideration
options:
- label: I am sure the error is coming from Pyrofork's code and not elsewhere
- label: I am sure the error is coming from Pyrogram's code and not elsewhere
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 git+https://github.com/Mayuri-Chan/pyrofork` and reproduced the issue using the latest development version
- label: I ran `pip3 install -U https://github.com/pyrogram/pyrogram/archive/master.zip` and reproduced the issue using the latest development version
required: true
- type: textarea
@ -35,7 +34,7 @@ body:
- type: textarea
attributes:
label: Code example
description: Provide a [minimal, complete, consistently reproducible](https://stackoverflow.com/help/minimal-reproducible-example) and properly formatted example involving normal usages (if applicable)
description: Provide a [minimal, reproducible](https://stackoverflow.com/help/minimal-reproducible-example) and properly formatted example (if applicable)
placeholder: |
from pyrogram import Client
...

View file

@ -1,8 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Ask Pyrofork related questions
url: https://stackoverflow.com/questions/tagged/pyrofork
about: This place is only for reporting issues about Pyrofork. You can ask questions at StackOverflow.
- name: Join the Telegram Chat
url: https://t.me/MayuriChan_Chat
about: Join the official Chat and stay tuned for news, updates and announcements.
- 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.
- name: Join the Telegram channel
url: https://t.me/pyrogram
about: Join the official channel and stay tuned for news, updates and announcements.

View file

@ -1,8 +0,0 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
time: "22:00"
open-pull-requests-limit: 10

View file

@ -1,12 +1,8 @@
name: Build-docs
on:
push:
tags:
- "*"
branches:
- staging
- dev/*
release:
types: [published]
jobs:
build:
@ -14,25 +10,8 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Configure
run: bash build-docs.sh configure
- name: Cleanup
run: bash build-docs.sh cleanup
- name: Create virtual environment
run: bash build-docs.sh virtualenv
- uses: actions/checkout@v3
- name: Build
run: bash build-docs.sh build
- name: Clone gh-pages repository
run: bash build-docs.sh clone
run: bash build-docs.sh
env:
DOCS_KEY: ${{ secrets.DOCS_KEY }}
- name: Push changes
run: bash build-docs.sh push

View file

@ -9,9 +9,8 @@
name: Upload Python Package
on:
push:
tags:
- '*'
release:
types: [published]
permissions:
contents: read
@ -20,21 +19,22 @@ jobs:
deploy:
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e '.[dev]'
pip install build twine
- name: Build package
run: hatch build
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
twine upload dist/*

View file

@ -1,4 +1,4 @@
name: Pyrofork
name: Pyrogram
on: [push, pull_request]
@ -9,13 +9,13 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
@ -31,4 +31,4 @@ jobs:
- name: Run tests
run: |
tox
tox

651
.pylintrc
View file

@ -1,651 +0,0 @@
[MAIN]
# Analyse import fallback blocks. This can be used to support both Python 2 and
# 3 compatible code, which means that the block might have code that exists
# only in one or another interpreter, leading to false positives when analysed.
analyse-fallback-blocks=no
# Clear in-memory caches upon conclusion of linting. Useful if running pylint
# in a server-like mode.
clear-cache-post-run=no
# Load and enable all available extensions. Use --list-extensions to see a list
# all available extensions.
#enable-all-extensions=
# In error mode, messages with a category besides ERROR or FATAL are
# suppressed, and no reports are done by default. Error mode is compatible with
# disabling specific errors.
#errors-only=
# Always return a 0 (non-error) status code, even if lint errors are found.
# This is primarily useful in continuous integration scripts.
#exit-zero=
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code.
extension-pkg-allow-list=
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code. (This is an alternative name to extension-pkg-allow-list
# for backward compatibility.)
extension-pkg-whitelist=
# Return non-zero exit code if any of these messages/categories are detected,
# even if score is above --fail-under value. Syntax same as enable. Messages
# specified are enabled, while categories only check already-enabled messages.
fail-on=
# Specify a score threshold under which the program will exit with error.
fail-under=10
# Interpret the stdin as a python script, whose filename needs to be passed as
# the module_or_package argument.
#from-stdin=
# Files or directories to be skipped. They should be base names, not paths.
ignore=CVS
# Add files or directories matching the regular expressions patterns to the
# ignore-list. The regex matches against paths and can be in Posix or Windows
# format. Because '\\' represents the directory delimiter on Windows systems,
# it can't be used as an escape character.
ignore-paths=
# Files or directories matching the regular expression patterns are skipped.
# The regex matches against base names, not paths. The default value ignores
# Emacs file locks
ignore-patterns=^\.#
# List of module names for which member attributes should not be checked and
# will not be imported (useful for modules/projects where namespaces are
# manipulated during runtime and thus existing member attributes cannot be
# deduced by static analysis). It supports qualified module names, as well as
# Unix pattern matching.
ignored-modules=
# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
#init-hook=
# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the
# number of processors available to use, and will cap the count on Windows to
# avoid hangs.
jobs=1
# Control the amount of potential inferred values when inferring a single
# object. This can help the performance when dealing with large functions or
# complex, nested conditions.
limit-inference-results=100
# List of plugins (as comma separated values of python module names) to load,
# usually to register additional checkers.
load-plugins=
# Pickle collected data for later comparisons.
persistent=yes
# Resolve imports to .pyi stubs if available. May reduce no-member messages and
# increase not-an-iterable messages.
prefer-stubs=no
# Minimum Python version to use for version dependent checks. Will default to
# the version used to run pylint.
py-version=3.13
# Discover python modules and packages in the file system subtree.
recursive=no
# Add paths to the list of the source roots. Supports globbing patterns. The
# source root is an absolute path or a path relative to the current working
# directory used to determine a package namespace for modules located under the
# source root.
source-roots=
# When enabled, pylint would attempt to guess common misconfiguration and emit
# user-friendly hints instead of false-positive error messages.
suggestion-mode=yes
# Allow loading of arbitrary C extensions. Extensions are imported into the
# active Python interpreter and may run arbitrary code.
unsafe-load-any-extension=no
# In verbose mode, extra non-checker-related info will be displayed.
#verbose=
[BASIC]
# Naming style matching correct argument names.
argument-naming-style=snake_case
# Regular expression matching correct argument names. Overrides argument-
# naming-style. If left empty, argument names will be checked with the set
# naming style.
#argument-rgx=
# Naming style matching correct attribute names.
attr-naming-style=snake_case
# Regular expression matching correct attribute names. Overrides attr-naming-
# style. If left empty, attribute names will be checked with the set naming
# style.
#attr-rgx=
# Bad variable names which should always be refused, separated by a comma.
bad-names=foo,
bar,
baz,
toto,
tutu,
tata
# Bad variable names regexes, separated by a comma. If names match any regex,
# they will always be refused
bad-names-rgxs=
# Naming style matching correct class attribute names.
class-attribute-naming-style=any
# Regular expression matching correct class attribute names. Overrides class-
# attribute-naming-style. If left empty, class attribute names will be checked
# with the set naming style.
#class-attribute-rgx=
# Naming style matching correct class constant names.
class-const-naming-style=UPPER_CASE
# Regular expression matching correct class constant names. Overrides class-
# const-naming-style. If left empty, class constant names will be checked with
# the set naming style.
#class-const-rgx=
# Naming style matching correct class names.
class-naming-style=PascalCase
# Regular expression matching correct class names. Overrides class-naming-
# style. If left empty, class names will be checked with the set naming style.
#class-rgx=
# Naming style matching correct constant names.
const-naming-style=UPPER_CASE
# Regular expression matching correct constant names. Overrides const-naming-
# style. If left empty, constant names will be checked with the set naming
# style.
#const-rgx=
# Minimum line length for functions/classes that require docstrings, shorter
# ones are exempt.
docstring-min-length=-1
# Naming style matching correct function names.
function-naming-style=snake_case
# Regular expression matching correct function names. Overrides function-
# naming-style. If left empty, function names will be checked with the set
# naming style.
#function-rgx=
# Good variable names which should always be accepted, separated by a comma.
good-names=i,
j,
k,
ex,
Run,
_
# Good variable names regexes, separated by a comma. If names match any regex,
# they will always be accepted
good-names-rgxs=
# Include a hint for the correct naming format with invalid-name.
include-naming-hint=no
# Naming style matching correct inline iteration names.
inlinevar-naming-style=any
# Regular expression matching correct inline iteration names. Overrides
# inlinevar-naming-style. If left empty, inline iteration names will be checked
# with the set naming style.
#inlinevar-rgx=
# Naming style matching correct method names.
method-naming-style=snake_case
# Regular expression matching correct method names. Overrides method-naming-
# style. If left empty, method names will be checked with the set naming style.
#method-rgx=
# Naming style matching correct module names.
module-naming-style=snake_case
# Regular expression matching correct module names. Overrides module-naming-
# style. If left empty, module names will be checked with the set naming style.
#module-rgx=
# Colon-delimited sets of names that determine each other's naming style when
# the name regexes allow several styles.
name-group=
# Regular expression which should only match function or class names that do
# not require a docstring.
no-docstring-rgx=^_
# List of decorators that produce properties, such as abc.abstractproperty. Add
# to this list to register other decorators that produce valid properties.
# These decorators are taken in consideration only for invalid-name.
property-classes=abc.abstractproperty
# Regular expression matching correct type alias names. If left empty, type
# alias names will be checked with the set naming style.
#typealias-rgx=
# Regular expression matching correct type variable names. If left empty, type
# variable names will be checked with the set naming style.
#typevar-rgx=
# Naming style matching correct variable names.
variable-naming-style=snake_case
# Regular expression matching correct variable names. Overrides variable-
# naming-style. If left empty, variable names will be checked with the set
# naming style.
#variable-rgx=
[CLASSES]
# Warn about protected attribute access inside special methods
check-protected-access-in-special-methods=no
# List of method names used to declare (i.e. assign) instance attributes.
defining-attr-methods=__init__,
__new__,
setUp,
asyncSetUp,
__post_init__
# List of member names, which should be excluded from the protected access
# warning.
exclude-protected=_asdict,_fields,_replace,_source,_make,os._exit
# List of valid names for the first argument in a class method.
valid-classmethod-first-arg=cls
# List of valid names for the first argument in a metaclass class method.
valid-metaclass-classmethod-first-arg=mcs
[DESIGN]
# List of regular expressions of class ancestor names to ignore when counting
# public methods (see R0903)
exclude-too-few-public-methods=
# List of qualified class names to ignore when counting class parents (see
# R0901)
ignored-parents=
# Maximum number of arguments for function / method.
max-args=5
# Maximum number of attributes for a class (see R0902).
max-attributes=7
# Maximum number of boolean expressions in an if statement (see R0916).
max-bool-expr=5
# Maximum number of branch for function / method body.
max-branches=12
# Maximum number of locals for function / method body.
max-locals=15
# Maximum number of parents for a class (see R0901).
max-parents=7
# Maximum number of positional arguments for function / method.
max-positional-arguments=5
# Maximum number of public methods for a class (see R0904).
max-public-methods=20
# Maximum number of return / yield for function / method body.
max-returns=6
# Maximum number of statements in function / method body.
max-statements=50
# Minimum number of public methods for a class (see R0903).
min-public-methods=2
[EXCEPTIONS]
# Exceptions that will emit a warning when caught.
overgeneral-exceptions=builtins.BaseException,builtins.Exception
[FORMAT]
# Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
expected-line-ending-format=
# Regexp for a line that is allowed to be longer than the limit.
ignore-long-lines=^\s*(# )?<?https?://\S+>?$
# Number of spaces of indent required inside a hanging or continued line.
indent-after-paren=4
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
# tab).
indent-string=' '
# Maximum number of characters on a single line.
max-line-length=100
# Maximum number of lines in a module.
max-module-lines=1000
# Allow the body of a class to be on the same line as the declaration if body
# contains single statement.
single-line-class-stmt=no
# Allow the body of an if to be on the same line as the test if there is no
# else.
single-line-if-stmt=no
[IMPORTS]
# List of modules that can be imported at any level, not just the top level
# one.
allow-any-import-level=
# Allow explicit reexports by alias from a package __init__.
allow-reexport-from-package=no
# Allow wildcard imports from modules that define __all__.
allow-wildcard-with-all=no
# Deprecated modules which should not be used, separated by a comma.
deprecated-modules=
# Output a graph (.gv or any supported image format) of external dependencies
# to the given file (report RP0402 must not be disabled).
ext-import-graph=
# Output a graph (.gv or any supported image format) of all (i.e. internal and
# external) dependencies to the given file (report RP0402 must not be
# disabled).
import-graph=
# Output a graph (.gv or any supported image format) of internal dependencies
# to the given file (report RP0402 must not be disabled).
int-import-graph=
# Force import order to recognize a module as part of the standard
# compatibility libraries.
known-standard-library=
# Force import order to recognize a module as part of a third party library.
known-third-party=enchant
# Couples of modules and preferred modules, separated by a comma.
preferred-modules=
[LOGGING]
# The type of string formatting that logging methods do. `old` means using %
# formatting, `new` is for `{}` formatting.
logging-format-style=old
# Logging modules to check that the string format arguments are in logging
# function parameter format.
logging-modules=logging
[MESSAGES CONTROL]
# Only show warnings with the listed confidence levels. Leave empty to show
# all. Valid levels: HIGH, CONTROL_FLOW, INFERENCE, INFERENCE_FAILURE,
# UNDEFINED.
confidence=HIGH,
CONTROL_FLOW,
INFERENCE,
INFERENCE_FAILURE,
UNDEFINED
# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifiers separated by comma (,) or put this
# option multiple times (only on the command line, not in the configuration
# file where it should appear only once). You can also use "--disable=all" to
# disable everything first and then re-enable specific checks. For example, if
# you want to run only the similarities checker, you can use "--disable=all
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use "--disable=all --enable=classes
# --disable=W".
disable=raw-checker-failed,
bad-inline-option,
locally-disabled,
file-ignored,
suppressed-message,
useless-suppression,
deprecated-pragma,
use-implicit-booleaness-not-comparison-to-string,
use-implicit-booleaness-not-comparison-to-zero,
use-symbolic-message-instead,
missing-module-docstring,
missing-class-docstring,
missing-function-docstring,
redefined-builtin
# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
# multiple time (only on the command line, not in the configuration file where
# it should appear only once). See also the "--disable" option for examples.
enable=
[METHOD_ARGS]
# List of qualified names (i.e., library.method) which require a timeout
# parameter e.g. 'requests.api.get,requests.api.post'
timeout-methods=requests.api.delete,requests.api.get,requests.api.head,requests.api.options,requests.api.patch,requests.api.post,requests.api.put,requests.api.request
[MISCELLANEOUS]
# List of note tags to take in consideration, separated by a comma.
notes=FIXME,
XXX,
TODO
# Regular expression of note tags to take in consideration.
notes-rgx=
[REFACTORING]
# Maximum number of nested blocks for function / method body
max-nested-blocks=5
# Complete name of functions that never returns. When checking for
# inconsistent-return-statements if a never returning function is called then
# it will be considered as an explicit return statement and no message will be
# printed.
never-returning-functions=sys.exit,argparse.parse_error
# Let 'consider-using-join' be raised when the separator to join on would be
# non-empty (resulting in expected fixes of the type: ``"- " + " -
# ".join(items)``)
suggest-join-with-non-empty-separator=yes
[REPORTS]
# Python expression which should return a score less than or equal to 10. You
# have access to the variables 'fatal', 'error', 'warning', 'refactor',
# 'convention', and 'info' which contain the number of messages in each
# category, as well as 'statement' which is the total number of statements
# analyzed. This score is used by the global evaluation report (RP0004).
evaluation=max(0, 0 if fatal else 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10))
# Template used to display messages. This is a python new-style format string
# used to format the message information. See doc for all details.
msg-template=
# Set the output format. Available formats are: 'text', 'parseable',
# 'colorized', 'json2' (improved json format), 'json' (old json format), msvs
# (visual studio) and 'github' (GitHub actions). You can also give a reporter
# class, e.g. mypackage.mymodule.MyReporterClass.
#output-format=
# Tells whether to display a full report or only the messages.
reports=no
# Activate the evaluation score.
score=yes
[SIMILARITIES]
# Comments are removed from the similarity computation
ignore-comments=yes
# Docstrings are removed from the similarity computation
ignore-docstrings=yes
# Imports are removed from the similarity computation
ignore-imports=yes
# Signatures are removed from the similarity computation
ignore-signatures=yes
# Minimum lines number of a similarity.
min-similarity-lines=4
[SPELLING]
# Limits count of emitted suggestions for spelling mistakes.
max-spelling-suggestions=4
# Spelling dictionary name. No available dictionaries : You need to install
# both the python package and the system dependency for enchant to work.
spelling-dict=
# List of comma separated words that should be considered directives if they
# appear at the beginning of a comment and should not be checked.
spelling-ignore-comment-directives=fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy:
# List of comma separated words that should not be checked.
spelling-ignore-words=
# A path to a file that contains the private dictionary; one word per line.
spelling-private-dict-file=
# Tells whether to store unknown words to the private dictionary (see the
# --spelling-private-dict-file option) instead of raising a message.
spelling-store-unknown-words=no
[STRING]
# This flag controls whether inconsistent-quotes generates a warning when the
# character used as a quote delimiter is used inconsistently within a module.
check-quote-consistency=no
# This flag controls whether the implicit-str-concat should generate a warning
# on implicit string concatenation in sequences defined over several lines.
check-str-concat-over-line-jumps=no
[TYPECHECK]
# List of decorators that produce context managers, such as
# contextlib.contextmanager. Add to this list to register other decorators that
# produce valid context managers.
contextmanager-decorators=contextlib.contextmanager
# List of members which are set dynamically and missed by pylint inference
# system, and so shouldn't trigger E1101 when accessed. Python regular
# expressions are accepted.
generated-members=
# Tells whether to warn about missing members when the owner of the attribute
# is inferred to be None.
ignore-none=yes
# This flag controls whether pylint should warn about no-member and similar
# checks whenever an opaque object is returned when inferring. The inference
# can return multiple potential results while evaluating a Python object, but
# some branches might not be evaluated, which results in partial inference. In
# that case, it might be useful to still emit no-member and other checks for
# the rest of the inferred objects.
ignore-on-opaque-inference=yes
# List of symbolic message names to ignore for Mixin members.
ignored-checks-for-mixins=no-member,
not-async-context-manager,
not-context-manager,
attribute-defined-outside-init
# List of class names for which member attributes should not be checked (useful
# for classes with dynamically set attributes). This supports the use of
# qualified names.
ignored-classes=optparse.Values,thread._local,_thread._local,argparse.Namespace
# Show a hint with possible names when a member name was not found. The aspect
# of finding the hint is based on edit distance.
missing-member-hint=yes
# The minimum edit distance a name should have in order to be considered a
# similar match for a missing member name.
missing-member-hint-distance=1
# The total number of similar names that should be taken in consideration when
# showing a hint for a missing member.
missing-member-max-choices=1
# Regex pattern to define which classes are considered mixins.
mixin-class-rgx=.*[Mm]ixin
# List of decorators that change the signature of a decorated function.
signature-mutators=
[VARIABLES]
# List of additional names supposed to be defined in builtins. Remember that
# you should avoid defining new builtins when possible.
additional-builtins=
# Tells whether unused global variables should be treated as a violation.
allow-global-unused-variables=yes
# List of names allowed to shadow builtins
allowed-redefined-builtins=
# List of strings which can identify a callback function by name. A callback
# name must start or end with one of those strings.
callbacks=cb_,
_cb
# A regular expression matching the name of dummy variables (i.e. expected to
# not be used).
dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_
# Argument names that match this expression will be ignored.
ignored-argument-names=_.*|^ignored_|^unused_
# Tells whether we should check for unused import in __init__ files.
init-import=no
# List of qualified module names which can have objects that can redefine
# builtins.
redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io

View file

@ -1,5 +1,5 @@
## Include
include README.md COPYING COPYING.lesser NOTICE
include README.md COPYING COPYING.lesser NOTICE requirements.txt
recursive-include compiler *.py *.tl *.tsv *.txt
recursive-include tests *.py

View file

@ -11,7 +11,7 @@ venv:
$(RM) $(VENV)
python3 -m venv $(VENV)
$(PYTHON) -m pip install -U pip wheel setuptools
$(PYTHON) -m pip install -U -e .
$(PYTHON) -m pip install -U -r requirements.txt -r dev-requirements.txt
@echo "Created venv with $$($(PYTHON) --version)"
clean-docs:

11
NOTICE
View file

@ -1,18 +1,17 @@
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) 2022-present Mayuri-Chan <https://github.com/Mayuri-Chan>
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
by the Free Software Foundation, either version 3 of the License, or
(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
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
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/>.

View file

@ -1,32 +1,20 @@
<p align="center">
<a href="https://github.com/Mayuri-Chan/pyrofok">
<img src="https://docs.pyrogram.org/_static/pyrogram.png" alt="Pyrofork" width="128">
<a href="https://github.com/Mayuri-Chan/pyrofork">
<img src="https://docs.pyrogram.org/_static/pyrogram.png" alt="PyroFork" width="128">
</a>
<br>
<b>Telegram MTProto API Framework for Python</b>
<br>
<a href="https://github.com/Mayuri-Chan">
<a href="https://pyrofork.mayuri.my.id">
Homepage
</a>
<a href="https://pyrofork.wulan17.dev">
<a href="https://pyrofork.mayuri.my.id">
Documentation
</a>
<a href="https://github.com/Mayuri-Chan/pyrofork/issues">
Issues
</a>
<a href="https://t.me/MayuriChan_Chat">
Support Chat
</a>
<a href="https://t.me/Pyrofork_CH">
News/Releases
</a>
</p>
## Pyrofork
## PyroFork
> Elegant, modern and asynchronous Telegram MTProto API framework in Python for users and bots
@ -38,25 +26,23 @@ app = Client("my_account")
@app.on_message(filters.private)
async def hello(client, message):
await message.reply("Hello from Pyrofork!")
await message.reply("Hello from Pyrogram!")
app.run()
```
**Pyrofork** is a modern, elegant and asynchronous [MTProto API](https://pyrofork.wulan17.dev/main/topics/mtproto-vs-botapi)
**PyroFork** is a modern, elegant and asynchronous [MTProto API](https://docs.pyrogram.org/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 Pyrofork, you can consider:
- [Become a GitHub sponsor](https://github.com/sponsors/Mayuri-Chan).
If you'd like to support Pyrogram, you can consider:
### Key Features
- **Ready**: Install Pyrofork with pip and start building your applications right away.
- **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.
@ -72,6 +58,6 @@ pip3 install pyrofork
### Resources
- Check out the docs at https://pyrofork.wulan17.dev to learn more about Pyrofork, get started right
- Check out the docs at https://pyrofork.mayuri.my.id to learn more about PyroFork, get started right
away and discover more in-depth material for building your client applications.
- Join the official group at https://t.me/MayuriChan_Chat and stay tuned for news, updates and announcements.

View file

@ -1,87 +1,20 @@
#!/bin/bash
export DOCS_KEY
export VENV=$(pwd)/venv
# Check if config.sh exists
if [ -f config.sh ]; then
source config.sh
fi
function parse_parameters() {
while (($#)); do
case $1 in
all | configure | cleanup | virtualenv | build | clone | push ) action=$1 ;;
*) exit 33 ;;
esac
shift
done
}
function do_configure() {
echo "#!/bin/bash" > config.sh
echo "export VENV=\"$(pwd)/venv\"" >> config.sh
if [[ "$(echo "$GITHUB_REF" | cut -d '/' -f "1 2")" == "refs/tags" ]]; then
echo "export BRANCH=\"main\"" >> config.sh
elif [[ "$GITHUB_REF" == "refs/heads/staging" ]]; then
echo "export BRANCH=\"staging\"" >> config.sh
else
b="$(echo "$GITHUB_REF" | cut -d '/' -f '3 4')"
if [[ $(echo "$b" | cut -d '/' -f 1 ) == "dev" ]]; then
b="$(echo "$b" | cut -d '/' -f 2)"
if [[ "$b" =~ ^[0-9]\.[0-9]\.x ]]; then
echo "export BRANCH=\"$b\"" >> config.sh
else
exit 0
fi
else
exit 0
fi
fi
chmod +x config.sh
}
function do_cleanup() {
make clean
make clean-docs
}
function do_virtualenv() {
make venv
make api
"$VENV"/bin/pip install -e '.[docs]'
}
function do_build() {
cd compiler/docs || exit 1 && "$VENV"/bin/python compiler.py
cd ../.. || exit 1
"$VENV"/bin/sphinx-build -b html "docs/source" "docs/build/html" -j auto
}
function do_clone() {
git clone https://wulan17:"$DOCS_KEY"@github.com/Mayuri-Chan/pyrofork-docs.git
}
function do_push() {
cd pyrofork-docs || exit 1
mkdir -p "$BRANCH"
cd "$BRANCH" || exit 1
rm -rf _includes api genindex.html intro py-modindex.html sitemap.xml support.html topics _static faq index.html objects.inv searchindex.js start telegram
cp -r ../../docs/build/html/* .
git config --local user.name "Mayuri-Chan"
git config --local user.email "mayuri@mayuri.my.id"
git add --all
git commit -a -m "docs: $BRANCH: Update docs $(date '+%Y-%m-%d | %H:%m:%S %p %Z')" --signoff
git push -u origin --all
}
function do_all() {
do_configure
source config.sh
do_cleanup
do_virtualenv
do_build
do_clone
do_push
}
parse_parameters "$@"
do_"${action:=all}"
make clean
make clean-docs
make venv
make api
"$VENV"/bin/pip install -r docs/requirements.txt
cd compiler/docs && "$VENV"/bin/python compiler.py
cd ../..
"$VENV"/bin/sphinx-build -b html "docs/source" "docs/build/html" -j auto
git clone https://wulan17:"$DOCS_KEY"@github.com/Mayuri-Chan/pyrofork-docs.git
cp -r docs/build/html/* pyrofork-docs
cd pyrofork-docs
git config --local user.name "Mayuri-Chan"
git config --local user.email "mayuri@mayuri.my.id"
git add --all
git commit -a -m "docs: Update docs $(date '+%Y-%m-%d | %H:%m:%S %p %Z')" --signoff
git push -u origin --all

View file

@ -1,18 +1,17 @@
# 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) 2022-present Mayuri-Chan <https://github.com/Mayuri-Chan>
#
# 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
# by the Free Software Foundation, either version 3 of the License, or
# (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
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# 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/>.

View file

@ -1,18 +1,17 @@
# 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) 2022-present Mayuri-Chan <https://github.com/Mayuri-Chan>
#
# 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
# by the Free Software Foundation, either version 3 of the License, or
# (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
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# 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/>.

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) 2022-present Mayuri-Chan <https://github.com/Mayuri-Chan>
#
# 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
# by the Free Software Foundation, either version 3 of the License, or
# (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
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# 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 json
import os
@ -130,7 +129,7 @@ def get_type_hint(type: str) -> str:
return f"Optional[{type}] = None" if is_flag else type
else:
ns, name = type.split(".") if "." in type else ("", type)
type = '"raw.base.' + ".".join([ns, name]).strip(".") + '"'
type = f'"raw.base.' + ".".join([ns, name]).strip(".") + '"'
return f'{type}{" = None" if is_flag else ""}'
@ -259,14 +258,11 @@ def start(format: bool = False):
args = ARGS_RE.findall(line)
# Fix arg name being reserved python keyword
# Fix arg name being "self" (reserved python keyword)
for i, item in enumerate(args):
if item[0] == "self":
args[i] = ("is_self", item[1])
if item[0] == "from":
args[i] = ("from_peer", item[1])
combinator = Combinator(
section=section,
qualname=qualname,
@ -430,11 +426,11 @@ def start(format: bool = False):
if function_docs:
docstring += function_docs["desc"] + "\n"
else:
docstring += "Telegram API function."
docstring += f"Telegram API function."
docstring += f"\n\n Details:\n - Layer: ``{layer}``\n - ID: ``{c.id[2:].upper()}``\n\n"
docstring += " Parameters:\n " + \
("\n ".join(docstring_args) if docstring_args else "No parameters required.\n")
docstring += f" Parameters:\n " + \
(f"\n ".join(docstring_args) if docstring_args else "No parameters required.\n")
if c.section == "functions":
docstring += "\n Returns:\n " + get_docstring_arg_type(c.qualtype)
@ -442,12 +438,12 @@ def start(format: bool = False):
references, count = get_references(c.qualname, "constructors")
if references:
docstring += "\n Functions:\n This object can be returned by " \
docstring += f"\n Functions:\n This object can be returned by " \
f"{count} function{'s' if count > 1 else ''}.\n\n" \
" .. currentmodule:: pyrogram.raw.functions\n\n" \
" .. autosummary::\n" \
" :nosignatures:\n\n" \
" " + references
f" .. currentmodule:: pyrogram.raw.functions\n\n" \
f" .. autosummary::\n" \
f" :nosignatures:\n\n" \
f" " + references
write_types = read_types = "" if c.has_flags else "# No flags\n "

File diff suppressed because it is too large Load diff

View file

@ -20,4 +20,4 @@ class {name}: # type: ignore
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://pyrofork.wulan17.dev/telegram/base/{doc_name}")
"More info: https://docs.pyrogram.org/telegram/base/{doc_name}")

View file

@ -1,18 +1,17 @@
# 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) 2022-present Mayuri-Chan <https://github.com/Mayuri-Chan>
#
# 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
# by the Free Software Foundation, either version 3 of the License, or
# (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
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# 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/>.

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) 2022-present Mayuri-Chan <https://github.com/Mayuri-Chan>
#
# 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
# by the Free Software Foundation, either version 3 of the License, or
# (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
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# 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 ast
import os
@ -139,35 +138,16 @@ def pyrogram_api():
start
stop
run
run_sync
restart
add_handler
remove_handler
stop_transmission
export_session_string
set_parse_mode
ping
""",
conversation="""
Conversation
ask
listen
get_listener_matching_with_data
get_listener_matching_with_identifier_pattern
get_many_listeners_matching_with_data
get_many_listeners_matching_with_identifier_pattern
register_next_step_handler
remove_listener
stop_listener
stop_listening
wait_for_callback_query
wait_for_message
""",
messages="""
Messages
add_task_to_todo
send_message
forward_media_group
forward_messages
copy_message
copy_media_group
@ -175,19 +155,16 @@ def pyrogram_api():
send_audio
send_document
send_sticker
send_todo
send_video
send_animation
send_voice
send_video_note
send_web_page
send_media_group
send_location
send_venue
send_contact
send_cached_media
send_reaction
set_todo_tasks_completion
edit_message_text
edit_message_caption
edit_message_media
@ -198,11 +175,7 @@ def pyrogram_api():
edit_inline_reply_markup
send_chat_action
delete_messages
delete_scheduled_messages
get_available_effects
get_messages
get_message_read_participants
get_scheduled_messages
get_media_group
get_chat_history
get_chat_history_count
@ -216,18 +189,12 @@ def pyrogram_api():
search_messages_count
search_global
search_global_count
search_global_hashtag_messages
search_global_hashtag_messages_count
download_media
stream_media
get_discussion_message
get_discussion_replies
get_discussion_replies_count
get_custom_emoji_stickers
transcribe_audio
translate_message_text
start_bot
delete_chat_history
""",
chats="""
Chats
@ -240,9 +207,6 @@ def pyrogram_api():
set_administrator_title
set_chat_photo
delete_chat_photo
delete_folder
export_folder_link
update_folder
set_chat_title
set_chat_description
set_chat_permissions
@ -255,11 +219,10 @@ def pyrogram_api():
get_chat_members_count
get_dialogs
get_dialogs_count
get_folders
get_forum_topics
get_forum_topics_by_id
get_forum_topics_count
set_chat_username
get_nearby_chats
archive_chats
unarchive_chats
add_chat_members
@ -285,10 +248,7 @@ def pyrogram_api():
hide_general_topic
reopen_forum_topic
reopen_general_topic
transfer_chat_ownership
unhide_general_topic
update_color
update_folder
""",
users="""
Users
@ -299,8 +259,6 @@ def pyrogram_api():
set_profile_photo
delete_profile_photos
set_username
update_birthday
update_personal_chat
update_profile
block_user
unblock_user
@ -308,18 +266,6 @@ def pyrogram_api():
get_default_emoji_statuses
set_emoji_status
""",
stories="""
Stories
delete_stories
edit_story
export_story_link
forward_story
get_all_stories
get_stories
get_stories_history
get_peer_stories
send_story
""",
stickers="""
Stickers
add_sticker_to_set
@ -354,39 +300,6 @@ def pyrogram_api():
get_contacts
get_contacts_count
""",
payments="""
Payments
apply_gift_code
check_gift_code
convert_gift
create_invoice_link
get_payment_form
get_stars_transactions
get_stars_transactions_by_id
get_available_gifts
get_upgraded_gift
get_chat_gifts_count
get_chat_gifts
hide_gift
refund_star_payment
search_gifts_for_resale
send_invoice
send_paid_media
send_paid_reaction
send_payment_form
send_gift
send_resold_gift
set_gift_resale_price
set_pinned_gifts
show_gift
transfer_gift
upgrade_gift
get_stars_balance
""",
phone="""
Phone
get_call_members
""",
password="""
Password
enable_cloud_password
@ -411,21 +324,6 @@ def pyrogram_api():
set_chat_menu_button
get_chat_menu_button
answer_web_app_query
get_bot_info
set_bot_info
get_collectible_item_info
get_owned_bots
get_similar_bots
""",
business="""
Telegram Business
answer_pre_checkout_query
answer_shipping_query
delete_business_messages
get_business_connection
get_business_account_gifts
get_business_account_star_balance
transfer_business_account_stars
""",
authorization="""
Authorization
@ -437,13 +335,13 @@ def pyrogram_api():
resend_code
sign_in
sign_in_bot
sign_in_qrcode
sign_up
get_password_hint
check_password
send_recovery_code
recover_password
accept_terms_of_service
log_out
get_active_sessions
""",
advanced="""
Advanced
@ -465,7 +363,7 @@ def pyrogram_api():
fmt_keys = {}
for k, v in categories.items():
_, *methods = get_title_list(v)
name, *methods = get_title_list(v)
fmt_keys.update({k: "\n ".join("{0} <{0}>".format(m) for m in methods)})
for method in methods:
@ -491,15 +389,7 @@ def pyrogram_api():
categories = dict(
users_chats="""
Users & Chats
Birthday
BusinessInfo
BusinessMessage
BusinessRecipients
BusinessSchedule
BusinessWeeklyOpen
BusinessWorkingHours
User
Username
Chat
ChatPreview
ChatPhoto
@ -512,44 +402,23 @@ def pyrogram_api():
ChatEventFilter
ChatMemberUpdated
ChatJoinRequest
ChatJoinedByRequest
ChatJoiner
ChatJoinedByRequest
Dialog
Folder
Restriction
EmojiStatus
ExportedFolderLink
ForumTopic
PeerUser
PeerChannel
BotInfo
GroupCallMember
ChatColor
CollectibleItemInfo
BotVerification
""",
messages_media="""
Messages & Media
Message
MessageEntity
MessageOriginChannel
MessageOriginChat
MessageOriginHiddenUser
MessageOriginImport
MessageOriginUser
MessageOrigin
Photo
Thumbnail
TodoList
TodoTask
TodoTasksAdded
TodoTasksCompleted
TodoTasksIncompleted
Audio
AvailableEffect
Document
ExternalReplyInfo
AlternativeVideo
Animation
Video
Voice
@ -560,18 +429,7 @@ def pyrogram_api():
Sticker
StickerSet
Game
Gift
GiftAttribute
Giveaway
GiveawayLaunched
GiveawayResult
MessageStory
WebPage
WebPageEmpty
WebPagePreview
TranscribedAudio
TranslatedText
TextQuote
Poll
PollOption
Dice
@ -582,70 +440,13 @@ def pyrogram_api():
VideoChatMembersInvited
WebAppData
MessageReactions
MessageReactor
ChatReactions
ForumTopicCreated
ForumTopicEdited
ForumTopicClosed
ForumTopicDeleted
ForumTopicReopened
GeneralTopicHidden
GeneralTopicUnhidden
Reaction
MessageReactionUpdated
MessageReactionCountUpdated
ExportedStoryLink
ChatTheme
ChatWallpaper
ContactRegistered
ReadParticipant
ScreenshotTaken
Wallpaper
WallpaperSettings
""",
stories="""
Stories
Story
StoryDeleted
StoryForwardHeader
StorySkipped
StoriesPrivacyRules
StoryViews
MediaArea
MediaAreaChannelPost
MediaAreaCoordinates
InputMediaArea
InputMediaAreaChannelPost
""",
payment="""
Payment
CheckedGiftCode
ExtendedMediaPreview
GiftCode
GiftedPremium
InputStarsTransaction
Invoice
LabeledPrice
PaidMedia
PaidMessagePriceChanged
PaymentForm
PaymentInfo
PaymentRefunded
PurchasedPaidMedia
StarsStatus
StarsTransaction
SuccessfulPayment
""",
pyromod="""
Pyromod
Identifier
Listener
""",
bot="""
Bot
BotAllowed
BotApp
BotBusinessConnection
""",
bot_keyboards="""
Bot keyboards
@ -654,13 +455,6 @@ def pyrogram_api():
ReplyKeyboardRemove
InlineKeyboardMarkup
InlineKeyboardButton
InlineKeyboardButtonBuy
RequestPeerTypeChannel
RequestPeerTypeChat
RequestPeerTypeUser
RequestedChats
RequestedChat
RequestedUser
LoginUrl
ForceReply
CallbackQuery
@ -685,13 +479,6 @@ def pyrogram_api():
BotCommandScopeChatAdministrators
BotCommandScopeChatMember
""",
business="""
Telegram Business
PreCheckoutQuery
ShippingAddress
ShippingOption
ShippingQuery
""",
input_media="""
Input Media
InputMedia
@ -725,32 +512,13 @@ def pyrogram_api():
InlineQueryResultVoice
ChosenInlineResult
""",
pre_checkout_query="""
PreCheckoutQuery
PreCheckoutQuery.answer
""",
shipping_query="""
ShippingQuery
ShippingQuery.answer
""",
input_message_content="""
InputMessageContent
InputMessageContent
InputReplyToMessage
InputReplyToMonoforum
InputReplyToStory
InputTextMessageContent
InputLocationMessageContent
InputVenueMessageContent
InputContactMessageContent
InputInvoiceMessageContent
InputTodoTask
""",
authorization="""
Authorization
ActiveSession
ActiveSessions
LoginToken
SentCode
TermsOfService
"""
@ -768,7 +536,7 @@ def pyrogram_api():
fmt_keys = {}
for k, v in categories.items():
_, *types = get_title_list(v)
name, *types = get_title_list(v)
fmt_keys.update({k: "\n ".join(types)})
@ -787,7 +555,6 @@ def pyrogram_api():
categories = dict(
message="""
Message
Message.ask
Message.click
Message.delete
Message.download
@ -819,18 +586,11 @@ def pyrogram_api():
Message.reply_video
Message.reply_video_note
Message.reply_voice
Message.reply_web_page
Message.get_media_group
Message.react
Message.transcribe
Message.translate
Message.wait_for_click
""",
chat="""
Chat
Chat.ask
Chat.listen
Chat.stop_listening
Chat.archive
Chat.unarchive
Chat.set_title
@ -851,57 +611,11 @@ def pyrogram_api():
""",
user="""
User
User.ask
User.listen
User.stop_listening
User.archive
User.unarchive
User.block
User.unblock
""",
story="""
Story
Story.delete
Story.download
Story.edit
Story.edit_animation
Story.edit_caption
Story.edit_photo
Story.edit_privacy
Story.edit_video
Story.export_link
Story.forward
Story.reply_text
Story.reply_animation
Story.reply_audio
Story.reply_cached_media
Story.reply_media_group
Story.reply_photo
Story.reply_sticker
Story.reply_video
Story.reply_video_note
Story.reply_voice
""",
folder="""
Folder
Folder.delete
Folder.update
Folder.include_chat
Folder.exclude_chat
Folder.update_color
Folder.pin_chat
Folder.remove_chat
Folder.export_link
""",
gift="""
Gift
Gift.show
Gift.hide
Gift.convert
Gift.upgrade
Gift.transfer
Gift.wear
""",
callback_query="""
Callback Query
CallbackQuery.answer
@ -914,14 +628,6 @@ def pyrogram_api():
InlineQuery
InlineQuery.answer
""",
pre_checkout_query="""
PreCheckoutQuery
PreCheckoutQuery.answer
""",
shipping_query="""
ShippingQuery
ShippingQuery.answer
""",
chat_join_request="""
ChatJoinRequest
ChatJoinRequest.approve

View file

@ -1,7 +1,7 @@
Bound Methods
=============
Some Pyrofork types define what are called bound methods. Bound methods are functions attached to a type which are
Some Pyrogram types define what are called bound methods. Bound methods are functions attached to a type which are
accessed via an instance of that type. They make it even easier to call specific methods by automatically inferring
some of the required arguments.
@ -36,19 +36,6 @@ Message
{message_toctree}
Story
-----
.. hlist::
:columns: 3
{story_hlist}
.. toctree::
:hidden:
{story_toctree}
Chat
----
@ -101,32 +88,6 @@ InlineQuery
{inline_query_toctree}
PreCheckoutQuery
----------------
.. hlist::
:columns: 2
{pre_checkout_query_hlist}
.. toctree::
:hidden:
{pre_checkout_query_toctree}
ShippingQuery
-------------
.. hlist::
:columns: 2
{shipping_query_hlist}
.. toctree::
:hidden:
{shipping_query_toctree}
ChatJoinRequest
---------------
@ -140,28 +101,3 @@ ChatJoinRequest
{chat_join_request_toctree}
Folder
---------------
.. hlist::
:columns: 2
{folder_hlist}
.. toctree::
:hidden:
{folder_toctree}
Gift
---------------
.. hlist::
:columns: 2
{gift_hlist}
.. toctree::
:hidden:
{gift_toctree}

View file

@ -1,7 +1,7 @@
Available Methods
=================
This page is about Pyrofork methods. All the methods listed here are bound to a :class:`~pyrogram.Client` instance,
This page is about Pyrogram methods. All the methods listed here are bound to a :class:`~pyrogram.Client` instance,
except for :meth:`~pyrogram.idle()` and :meth:`~pyrogram.compose()`, which are special functions that can be found in
the main package directly.
@ -47,19 +47,6 @@ Utilities
.. currentmodule:: pyrogram.Client
Conversation
------------
.. autosummary::
:nosignatures:
{conversation}
.. toctree::
:hidden:
{conversation}
Messages
--------
@ -73,19 +60,6 @@ Messages
{messages}
Stories
-------
.. autosummary::
:nosignatures:
{stories}
.. toctree::
:hidden:
{stories}
Chats
-----
@ -100,7 +74,7 @@ Chats
{chats}
Stickers
--------
-----
.. autosummary::
:nosignatures:
@ -112,19 +86,6 @@ Stickers
{stickers}
Telegram Business
-------------
.. autosummary::
:nosignatures:
{business}
.. toctree::
:hidden:
{business}
Users
-----
@ -190,19 +151,6 @@ Bots
{bots}
Payments
----
.. autosummary::
:nosignatures:
{payments}
.. toctree::
:hidden:
{payments}
Authorization
-------------
@ -230,4 +178,4 @@ Learn more about how to use the raw API at :doc:`Advanced Usage <../../topics/ad
.. toctree::
:hidden:
{advanced}
{advanced}

View file

@ -1,7 +1,7 @@
Available Types
===============
This page is about Pyrofork Types. All types listed here are available through the ``pyrogram.types`` package.
This page is about Pyrogram Types. All types listed here are available through the ``pyrogram.types`` package.
Unless required as argument to a client method, most of the types don't need to be manually instantiated because they
are only returned by other methods. You also don't need to import them, unless you want to type-hint your variables.
@ -47,45 +47,6 @@ Messages & Media
{messages_media}
Stories
-------
.. autosummary::
:nosignatures:
{stories}
.. toctree::
:hidden:
{stories}
Pyromod
-------
.. autosummary::
:nosignatures:
{pyromod}
.. toctree::
:hidden:
{pyromod}
Bot
---
.. autosummary::
:nosignatures:
{bot}
.. toctree::
:hidden:
{bot}
Bot keyboards
-------------
@ -112,19 +73,6 @@ Bot commands
{bot_commands}
Telegram Business
-------------
.. autosummary::
:nosignatures:
{business}
.. toctree::
:hidden:
{business}
Input Media
-----------
@ -164,45 +112,6 @@ InputMessageContent
{input_message_content}
ShippingQuery
-------------------
.. autosummary::
:nosignatures:
{shipping_query}
.. toctree::
:hidden:
{shipping_query}
PreCheckoutQuery
-------------------
.. autosummary::
:nosignatures:
{pre_checkout_query}
.. toctree::
:hidden:
{pre_checkout_query}
Payment
-------------------
.. autosummary::
:nosignatures:
{payment}
.. toctree::
:hidden:
{payment}
Authorization
-------------
@ -214,4 +123,4 @@ Authorization
.. toctree::
:hidden:
{authorization}
{authorization}

View file

@ -1,18 +1,17 @@
# 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) 2022-present Mayuri-Chan <https://github.com/Mayuri-Chan>
#
# 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
# by the Free Software Foundation, either version 3 of the License, or
# (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
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# 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/>.

View file

@ -1,23 +1,21 @@
# 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) 2022-present Mayuri-Chan <https://github.com/Mayuri-Chan>
#
# 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
# by the Free Software Foundation, either version 3 of the License, or
# (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
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# 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 ast
import csv
import os
import re
@ -38,13 +36,6 @@ def caml(s):
s = snek(s).split("_")
return "".join([str(i.title()) for i in s])
def get_classes_from_file(file_path):
with open(file_path, "r", encoding="utf-8") as f:
tree = ast.parse(f.read())
classes = [node.name for node in ast.walk(tree) if isinstance(node, ast.ClassDef)]
return classes
def start():
shutil.rmtree(DEST, ignore_errors=True)
@ -135,20 +126,6 @@ def start():
f_all.write(" },\n")
f_all.write("}\n")
with open(init, "a", encoding="utf-8") as f_init:
f_init.write("\n")
all_classes = []
for i in files:
code, name = re.search(r"(\d+)_([A-Z_]+)", i).groups()
classes = get_classes_from_file("{}/{}_{}.py".format(DEST, name.lower(), code))
for j in classes:
if j not in ["BaseException", "Exception", "PyrogramException"]:
all_classes.append(j)
f_init.write("__all__ = [\n")
all_classes = sorted(set(all_classes))
for i in all_classes:
f_init.write(" \"{}\",\n".format(i))
f_init.write("]\n")
with open("{}/all.py".format(DEST), encoding="utf-8") as f:
content = f.read()

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) 2022-present Mayuri-Chan <https://github.com/Mayuri-Chan>
#
# 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
# by the Free Software Foundation, either version 3 of the License, or
# (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
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# 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 csv
from pathlib import Path

View file

@ -2,40 +2,30 @@ id message
ABOUT_TOO_LONG The provided about/bio text is too long
ACCESS_TOKEN_EXPIRED The bot token has expired
ACCESS_TOKEN_INVALID The bot access token is invalid
ADDRESS_INVALID The specified geopoint address is invalid.
ADMINS_TOO_MUCH The chat has too many administrators
ADMIN_ID_INVALID The specified admin ID is invalid
ADMIN_RANK_EMOJI_NOT_ALLOWED Emoji are not allowed in custom administrator titles
ADMIN_RANK_INVALID The custom administrator title is invalid or too long
ADMIN_RIGHTS_EMPTY The chatAdminRights constructor passed in keyboardButtonRequestPeer.peer_type.user_admin_rights has no rights set (i.e. flags is 0).
ALBUM_PHOTOS_TOO_MANY Too many photos were included in the album
API_ID_INVALID The api_id/api_hash combination is invalid
API_ID_PUBLISHED_FLOOD You are using an API key that is limited on the server side because it was published somewhere
ARTICLE_TITLE_EMPTY The article title is empty
AUDIO_CONTENT_URL_EMPTY The remote URL specified in the content field is empty
AUDIO_TITLE_EMPTY The title attribute of the audio is empty
AUTH_BYTES_INVALID The authorization bytes are invalid
AUTH_TOKEN_ALREADY_ACCEPTED The authorization token was already used
AUTH_TOKEN_EXCEPTION An error occurred while importing the auth token
AUTH_TOKEN_EXPIRED The provided authorization token has expired and the updated QR-code must be re-scanned
AUTH_TOKEN_INVALID An invalid authorization token was provided
AUTH_TOKEN_INVALID2 An invalid authorization token was provided
AUTH_TOKEN_INVALIDX The specified auth token is invalid
AUTOARCHIVE_NOT_AVAILABLE This feature is not yet enabled for your account due to it not receiving too many private messages from strangers
BANK_CARD_NUMBER_INVALID The credit card number is invalid
BANNED_RIGHTS_INVALID You provided a set of restrictions that is invalid
BASE_PORT_LOC_INVALID The base port location is invalid
BIRTHDAY_INVALID The age should be less than 150 year old in Telegram
BOTS_TOO_MUCH The chat has too many bots
BOT_CHANNELS_NA Bots can't edit admin privileges
BOT_COMMAND_DESCRIPTION_INVALID The command description was empty, too long or had invalid characters
BOT_COMMAND_INVALID The specified command is invalid
BOT_DOMAIN_INVALID The domain used for the auth button does not match the one configured in @BotFather
BOT_GAMES_DISABLED Bot games cannot be used in this type of chat
BOT_GROUPS_BLOCKED This bot can't be added to groups
BOT_INLINE_DISABLED The inline feature of the bot is disabled
BOT_INVALID This is not a valid bot
BOT_INVOICE_INVALID The provided invoice is invalid
BOT_METHOD_INVALID The method can't be used by bots
BOT_MISSING This method can only be run by a bot
BOT_ONESIDE_NOT_AVAIL Bots can't pin messages for one side only in private chats
@ -43,14 +33,10 @@ BOT_PAYMENTS_DISABLED This method can only be run by a bot
BOT_POLLS_DISABLED Sending polls by bots has been disabled
BOT_RESPONSE_TIMEOUT The bot did not answer to the callback query in time
BOT_SCORE_NOT_MODIFIED The bot score was not modified
BROADCAST_CALLS_DISABLED Broadcast calls disabled
BROADCAST_ID_INVALID The channel is invalid
BROADCAST_PUBLIC_VOTERS_FORBIDDEN Polls with public voters cannot be sent in channels
BROADCAST_REQUIRED The request can only be used with a channel
BUSINESS_BOT_MISSING Business bot missing
BUTTON_DATA_INVALID The button callback data is invalid or too large
BUTTON_ID_INVALID The button_id parameter is invalid
BUTTON_TEXT_INVALID The specified button text is invalid
BUTTON_TYPE_INVALID The type of one of the buttons you provided is invalid
BUTTON_URL_INVALID The button url is invalid
BUTTON_USER_PRIVACY_RESTRICTED The privacy settings of the user specified in a keyboard button do not allow creating such button
@ -59,24 +45,16 @@ CALL_ALREADY_DECLINED The call is already declined
CALL_PEER_INVALID The provided call peer object is invalid
CALL_PROTOCOL_FLAGS_INVALID Call protocol flags invalid
CDN_METHOD_INVALID The method can't be used on CDN DCs
CHANNELS_ADMIN_LOCATED_TOO_MUCH The user has reached the limit of public geogroups
CHANNELS_ADMIN_PUBLIC_TOO_MUCH You are an administrator of too many public channels
CHANNELS_TOO_MUCH You have joined too many channels or supergroups, leave some and try again
CHANNEL_ADD_INVALID Internal error.
CHANNEL_BANNED The channel is banned
CHANNEL_ID_INVALID The specified supergroup ID is invalid.
CHANNEL_INVALID The channel parameter is invalid
CHANNEL_PARICIPANT_MISSING The current user is not in the channel
CHANNEL_PRIVATE The channel/supergroup is not accessible
CHANNEL_TOO_BIG The channel too big
CHANNEL_TOO_LARGE "Channel is too large to be deleted; this error is issued when trying to delete channels with more than 1000 members (subject to change)."
CHARGE_ALREADY_REFUNDED The charge id was already used for a refund.
CHARGE_NOT_FOUND The charge id was not found.
CHATLIST_EXCLUDE_INVALID The specified `exclude_peers` are invalid.
CHANNEL_TOO_LARGE The channel is too large
CHAT_ABOUT_NOT_MODIFIED The chat about text was not modified because you tried to edit it using the same content
CHAT_ABOUT_TOO_LONG The chat about text is too long
CHAT_ADMIN_REQUIRED The method requires chat admin privileges
CHAT_DISCUSSION_UNALLOWED The chat discussion is not allowed
CHAT_FORWARDS_RESTRICTED The chat restricts forwarding content
CHAT_ID_EMPTY The provided chat id is empty
CHAT_ID_INVALID The chat id being used is invalid or not known yet. Make sure you see the chat before interacting with it
@ -85,14 +63,12 @@ CHAT_INVITE_PERMANENT The chat invite link is primary
CHAT_LINK_EXISTS The action failed because the supergroup is linked to a channel
CHAT_NOT_MODIFIED The chat settings (title, permissions, photo, etc..) were not modified because you tried to edit them using the same content
CHAT_RESTRICTED The chat is restricted and cannot be used
CHAT_REVOKE_DATE_UNSUPPORTED `min_date` and `max_date` are not available for using with non-user peers
CHAT_SEND_INLINE_FORBIDDEN You cannot use inline bots to send messages in this chat
CHAT_TITLE_EMPTY The chat title is empty
CHAT_TOO_BIG The chat is too big for this action
CODE_EMPTY The provided code is empty
CODE_HASH_INVALID The provided code hash invalid
CODE_INVALID The provided code is invalid (i.e. from email)
COLOR_INVALID The provided color is invalid
CONNECTION_API_ID_INVALID The provided API id is invalid
CONNECTION_APP_VERSION_EMPTY App version is empty
CONNECTION_DEVICE_MODEL_EMPTY The device model is empty
@ -103,11 +79,8 @@ CONNECTION_SYSTEM_EMPTY The connection to the system is empty
CONNECTION_SYSTEM_LANG_CODE_EMPTY The system language code is empty
CONTACT_ADD_MISSING Contact to add is missing
CONTACT_ID_INVALID The provided contact id is invalid
CONTACT_MISSING The specified user is not a contact.
CONTACT_NAME_EMPTY The provided contact name is empty
CONTACT_REQ_MISSING Missing contact request
CREATE_CALL_FAILED An error occurred while creating the call
CURRENCY_TOTAL_AMOUNT_INVALID The total amount of all prices is invalid
DATA_INVALID The encrypted data is invalid
DATA_JSON_INVALID The provided JSON data is invalid
DATA_TOO_LONG Data too long
@ -117,14 +90,9 @@ DH_G_A_INVALID The g_a parameter invalid
DOCUMENT_INVALID The document is invalid
EMAIL_HASH_EXPIRED The email hash expired and cannot be used to verify it
EMAIL_INVALID The email provided is invalid
EMAIL_NOT_ALLOWED This email is not allowed
EMAIL_NOT_SETUP In order to change the login email with emailVerifyPurposeLoginChange, an existing login email must already be set using emailVerifyPurposeLoginSetup.
EMAIL_UNCONFIRMED Email unconfirmed
EMAIL_UNCONFIRMED_X The provided email isn't confirmed, {value} is the length of the verification code that was just sent to the email
EMAIL_VERIFY_EXPIRED The verification email has expired
EMOJI_INVALID The specified theme emoji is valid
EMOJI_MARKUP_INVALID The specified `video_emoji_markup` was invalid.
EMOJI_NOT_MODIFIED The theme wasn't changed
EMOTICON_EMPTY The emoticon parameter is empty
EMOTICON_INVALID The emoticon parameter is invalid
EMOTICON_STICKERPACK_MISSING The emoticon sticker pack you are trying to obtain is missing
@ -138,20 +106,13 @@ ENTITY_BOUNDS_INVALID The message entity bounds are invalid
ENTITY_MENTION_USER_INVALID The mentioned entity is not an user
ERROR_TEXT_EMPTY The provided error message is empty
EXPIRE_DATE_INVALID The expiration date is invalid
EXPIRE_FORBIDDEN Expire forbidden
EXPORT_CARD_INVALID The provided card is invalid
EXTENDED_MEDIA_AMOUNT_INVALID The maximum amount of `star_count` should be less than the `stars_paid_post_amount_max`
EXTENDED_MEDIA_PEER_INVALID The specified chat type is invalid.
EXTENDED_MEDIA_TYPE_INVALID The specified extended media type is unsupported.
EXTERNAL_URL_INVALID The external media URL is invalid
FIELD_NAME_EMPTY The field with the name FIELD_NAME is missing
FIELD_NAME_INVALID The field with the name FIELD_NAME is invalid
FILE_CONTENT_TYPE_INVALID File content-type is invalid
FILE_EMTPY An empty file was provided
FILE_ID_INVALID The file id is invalid
FILE_MIGRATE_X The file is in Data Center No. {value}
FILE_PARTS_INVALID Invalid number of parts.
FILE_PART_0_MISSING File part 0 missing
FILE_PART_EMPTY The file part sent is empty
FILE_PART_INVALID The file part number is invalid.
FILE_PART_LENGTH_INVALID The length of a file part is invalid
@ -162,38 +123,23 @@ FILE_PART_X_MISSING Part {value} of the file is missing from storage
FILE_REFERENCE_EMPTY The file id contains an empty file reference, you must obtain a valid one by fetching the message from the origin context
FILE_REFERENCE_EXPIRED The file id contains an expired file reference, you must obtain a valid one by fetching the message from the origin context
FILE_REFERENCE_INVALID The file id contains an invalid file reference, you must obtain a valid one by fetching the message from the origin context
FILE_TITLE_EMPTY An empty file title was specified
FILTER_ID_INVALID The specified filter ID is invalid
FILTER_INCLUDE_EMPTY The filter include is empty
FILTER_NOT_SUPPORTED The specified filter cannot be used in this context
FILTER_TITLE_EMPTY The title field of the filter is empty
FIRSTNAME_INVALID The first name is invalid
FOLDER_ID_EMPTY The folder you tried to delete was already empty
FOLDER_ID_INVALID The folder id is invalid
FORM_ID_EXPIRED The specified id has expired.
FORUM_ENABLED You can't execute the specified action because the group is a [forum](https://core.telegram.org/api/forum), disable forum functionality to continue.
FRESH_CHANGE_ADMINS_FORBIDDEN You can't change administrator settings in this chat because your session was logged-in recently
FROM_MESSAGE_BOT_DISABLED Bots can't use fromMessage min constructors
FROM_PEER_INVALID The from peer value is invalid
GAME_BOT_INVALID You cannot send that game with the current bot
GENERAL_MODIFY_ICON_FORBIDDEN You can't modify the icon of the General topic.
GEO_POINT_INVALID Invalid geo point provided
GIF_CONTENT_TYPE_INVALID GIF content-type invalid
GIF_ID_INVALID The provided gif/animation id is invalid
GIFT_SLUG_INVALID The specified slug is invalid.
GIFT_SLUG_EXPIRED The gift slug is expired
GRAPH_EXPIRED_RELOAD This graph has expired, please obtain a new graph token
GRAPH_INVALID_RELOAD Invalid graph token provided, please reload the stats and provide the updated token
GRAPH_OUTDATED_RELOAD The graph data is outdated
GROUPCALL_ALREADY_DISCARDED The group call was already discarded
GROUPCALL_INVALID The specified group call is invalid
GROUPCALL_JOIN_MISSING You haven't joined this group call
GROUPCALL_NOT_MODIFIED Group call settings weren't modified
GROUPCALL_SSRC_DUPLICATE_MUCH Too many group call synchronization source duplicates
GROUPED_MEDIA_INVALID The album contains invalid media
GROUP_CALL_INVALID The group call is invalid
HASH_INVALID The provided hash is invalid
HIDE_REQUESTER_MISSING The join request was missing or was already handled
IMAGE_PROCESS_FAILED The server failed to process your image
IMPORT_FILE_INVALID The imported file is invalid
IMPORT_FORMAT_UNRECOGNIZED The imported format is unrecognized
@ -206,40 +152,25 @@ INPUT_FILTER_INVALID The filter is invalid for this query
INPUT_LAYER_INVALID The provided layer is invalid
INPUT_METHOD_INVALID The method invoked is invalid in the current schema
INPUT_REQUEST_TOO_LONG The input request is too long
INPUT_TEXT_EMPTY The specified text is empty
INPUT_TEXT_TOO_LONG The specified text is too long.
INPUT_USER_DEACTIVATED The target user has been deleted/deactivated
INVITES_TOO_MUCH The maximum number of per-folder invites specified by the `chatlist_invites_limit_default`/`chatlist_invites_limit_premium` was reached.
INVITE_FORBIDDEN_WITH_JOINAS If the user has anonymously joined a group call as a channel, they can't invite other users to the group call because that would cause deanonymization, because the invite would be sent using the original user ID, not the anonymized channel ID
INVITE_HASH_EMPTY The invite hash is empty
INVITE_HASH_EXPIRED The chat invite link is no longer valid
INVITE_HASH_INVALID The invite link hash is invalid
INVITE_REQUEST_SENT The request to join this chat or channel has been successfully sent
INVITE_REVOKED_MISSING The action required a chat invite link to be revoked first
INVITE_SLUG_EMPTY The invite slug is empty
INVITE_SLUG_EXPIRED The invite slug is expired
INVOICE_PAYLOAD_INVALID The specified invoice payload is invalid
JOIN_AS_PEER_INVALID The specified peer cannot be used to join a group call
LANG_CODE_INVALID The specified language code is invalid
LANG_CODE_NOT_SUPPORTED The specified language code is not supported
LANG_PACK_INVALID The provided language pack is invalid
LASTNAME_INVALID The last name is invalid
LIMIT_INVALID The limit parameter is invalid
LINK_NOT_MODIFIED The chat link was not modified because you tried to link to the same target
LOCATION_INVALID The file location is invalid
MAX_DATE_INVALID The specified maximum date is invalid
MAX_ID_INVALID The max_id parameter is invalid
MAX_QTS_INVALID The provided QTS is invalid
MD5_CHECKSUM_INVALID The file's checksum did not match the md5_checksum parameter
MEDIA_CAPTION_TOO_LONG The media caption is too long
MEDIA_EMPTY The media you tried to send is invalid
MEDIA_FILE_INVALID The provided media file is invalid
MEDIA_GROUPED_INVALID You tried to send media of different types in an album
MEDIA_INVALID The media is invalid
MEDIA_NEW_INVALID The new media to edit the message with is invalid
MEDIA_PREV_INVALID The previous media cannot be edited with anything else
MEDIA_TTL_INVALID The media ttl is invalid
MEDIA_VIDEO_STORY_MISSING The media does not have a photo or a video
MEGAGROUP_ID_INVALID The supergroup is invalid
MEGAGROUP_PREHISTORY_HIDDEN The action failed because the supergroup has the pre-history hidden
MEGAGROUP_REQUIRED The request can only be used with a supergroup
@ -251,16 +182,11 @@ MESSAGE_NOT_MODIFIED The message was not modified because you tried to edit it u
MESSAGE_POLL_CLOSED You can't interact with a closed poll
MESSAGE_TOO_LONG The message text is too long
METHOD_INVALID The API method is invalid and cannot be used
MIN_DATE_INVALID The specified minimum date is invalid
MSG_ID_INVALID The message ID used in the peer was invalid
MSG_TOO_OLD chat_read_mark_expire_period have passed since the message was sent, read receipts were deleted
MSG_VOICE_MISSING The message does not contain a voice message
MSG_WAIT_FAILED A waiting call returned an error
MULTI_MEDIA_TOO_LONG The album/media group contains too many items
NEW_SALT_INVALID The new salt is invalid
NEW_SETTINGS_EMPTY No password is set on the current account, and no new password was specified in `new_settings`
NEW_SETTINGS_INVALID The new settings are invalid
NOGENERAL_HIDE_FORBIDDEN The hidden parameter is only valid for the General topic message_thread_id=1
NEXT_OFFSET_INVALID The next offset value is invalid
OFFSET_INVALID The offset parameter is invalid
OFFSET_PEER_ID_INVALID The provided offset peer is invalid
@ -270,8 +196,6 @@ PACK_SHORT_NAME_INVALID Invalid sticker pack name. It must begin with a letter,
PACK_SHORT_NAME_OCCUPIED A sticker pack with this name already exists
PACK_TITLE_INVALID The sticker pack title is invalid
PARTICIPANTS_TOO_FEW The chat doesn't have enough participants
PARTICIPANT_ID_INVALID The specified participant ID is invalid
PARTICIPANT_JOIN_MISSING Trying to enable a presentation, when the user hasn't joined the Video Chat with phone.joinGroupCall
PARTICIPANT_VERSION_OUTDATED The other participant is using an outdated Telegram app version
PASSWORD_EMPTY The password provided is empty
PASSWORD_HASH_INVALID The two-step verification password is invalid
@ -281,7 +205,6 @@ PASSWORD_REQUIRED The two-step verification password is required for this method
PASSWORD_TOO_FRESH_X The two-step verification password was added recently and you are required to wait {value} seconds
PAYMENT_PROVIDER_INVALID The payment provider was not recognised or its token was invalid
PEER_FLOOD The method can't be used because your account is currently limited
PEER_HISTORY_EMPTY Peer history empty
PEER_ID_INVALID The peer id being used is invalid or not known yet. Make sure you meet the peer before interacting with it
PEER_ID_NOT_SUPPORTED The provided peer id is not supported
PERSISTENT_TIMESTAMP_EMPTY The pts argument is empty
@ -290,8 +213,6 @@ PHONE_CODE_EMPTY The phone code is missing
PHONE_CODE_EXPIRED The confirmation code has expired
PHONE_CODE_HASH_EMPTY The phone code hash is missing
PHONE_CODE_INVALID The confirmation code is invalid
PHONE_HASH_EXPIRED An invalid or expired phone_code_hash was provided
PHONE_NOT_OCCUPIED No user is associated to the specified phone number
PHONE_NUMBER_APP_SIGNUP_FORBIDDEN You can't sign up using this app
PHONE_NUMBER_BANNED The phone number is banned from Telegram and cannot be used
PHONE_NUMBER_FLOOD This number has tried to login too many times
@ -312,26 +233,19 @@ PHOTO_SAVE_FILE_INVALID The photo you tried to send cannot be saved by Telegram
PHOTO_THUMB_URL_EMPTY The photo thumb URL is empty
PHOTO_THUMB_URL_INVALID The photo thumb URL is invalid
PINNED_DIALOGS_TOO_MUCH Too many pinned dialogs
PINNED_TOPIC_NOT_MODIFIED The pinned topic was not modified.
PIN_RESTRICTED You can't pin messages in private chats with other people
POLL_ANSWERS_INVALID The poll answers are invalid
POLL_ANSWER_INVALID One of the poll answers is not acceptable
POLL_OPTION_DUPLICATE A duplicate option was sent in the same poll
POLL_OPTION_INVALID A poll option used invalid data (the data may be too long)
POLL_QUESTION_INVALID The poll question is invalid
POLL_UNSUPPORTED This layer does not support polls in the invoked method
POLL_VOTE_REQUIRED Cast a vote in the poll before calling this method
PREMIUM_ACCOUNT_REQUIRED The method requires a premium user account
PREMIUM_GIFTCODE_WAS_REFUNDED This gift code can't be redeemed because the giveaway organizer requested a refund
PRICING_CHAT_INVALID This chat chat doesn't support subscription link.
PRIVACY_KEY_INVALID The privacy key is invalid
PRIVACY_TOO_LONG Your privacy exception list has exceeded the maximum capacity
PRIVACY_VALUE_INVALID The privacy value is invalid
PUBLIC_KEY_REQUIRED A public key is required
QUERY_ID_EMPTY The query ID is empty
QUERY_ID_INVALID The callback query id is invalid
QUERY_TOO_SHORT The query is too short
QUIZ_ANSWER_MISSING You can forward a quiz while hiding the original author only after choosing an option in the quiz
QUIZ_CORRECT_ANSWERS_EMPTY The correct answers of the quiz are empty
QUIZ_CORRECT_ANSWERS_TOO_MUCH The quiz contains too many correct answers
QUIZ_CORRECT_ANSWER_INVALID The correct answers of the quiz are invalid
@ -347,46 +261,33 @@ REPLY_MARKUP_BUY_EMPTY Reply markup for buy button empty
REPLY_MARKUP_GAME_EMPTY The provided reply markup for the game is empty
REPLY_MARKUP_INVALID The provided reply markup is invalid
REPLY_MARKUP_TOO_LONG The reply markup is too long
REPLY_MESSAGE_ID_INVALID The reply message id is invalid
RESET_REQUEST_MISSING No password reset is in progress
RESULTS_TOO_MUCH The result contains too many items
RESULT_ID_DUPLICATE The result contains items with duplicated identifiers
RESULT_ID_EMPTY Result ID empty
RESULT_ID_INVALID The given result cannot be used to send the selection to the bot
REACTIONS_TOO_MANY Currently, non-premium users, can set up to one reaction per message
RESULT_TYPE_INVALID The result type is invalid
REVOTE_NOT_ALLOWED You cannot change your vote
RIGHTS_NOT_MODIFIED The new admin rights are equal to the old rights, no change was made
RSA_DECRYPT_FAILED Internal RSA decryption failed
SCHEDULE_BOT_NOT_ALLOWED Bots are not allowed to schedule messages
SCHEDULE_DATE_INVALID Invalid schedule date provided
SCHEDULE_DATE_TOO_LATE The date you tried to schedule is too far in the future (more than one year)
SCHEDULE_STATUS_PRIVATE You cannot schedule a message until the person comes online if their privacy does not show this information
SCHEDULE_TOO_MUCH You tried to schedule too many messages in this chat
SCORE_INVALID The specified game score is invalid
SEARCH_QUERY_EMPTY The search query is empty
SEARCH_WITH_LINK_NOT_SUPPORTED You cannot provide a search query and an invite link at the same time
SECONDS_INVALID The seconds interval is invalid
SEND_AS_PEER_INVALID You can't send messages as the specified peer
SEND_MESSAGE_MEDIA_INVALID The message media is invalid
SEND_MESSAGE_TYPE_INVALID The message type is invalid
SESSION_TOO_FRESH_X You can't do this action because the current session was logged-in recently
SETTINGS_INVALID Invalid settings were provided
SHA256_HASH_INVALID The provided SHA256 hash is invalid
SHORTNAME_OCCUPY_FAILED An error occurred when trying to register the short-name used for the sticker pack. Try a different name
SHORT_NAME_INVALID The specified short name is invalid
SHORT_NAME_OCCUPIED The specified short name is already in use
SLOWMODE_MULTI_MSGS_DISABLED Slowmode is enabled, you cannot forward multiple messages to this group
SMS_CODE_CREATE_FAILED An error occurred while creating the SMS code
SRP_ID_INVALID Invalid SRP ID provided
SRP_PASSWORD_CHANGED The password has changed
STARGIFT_ALREADY_CONVERTED The provided star gift already converted to stars
STARGIFT_ALREADY_UPGRADED This star gift was already upgraded before
STARGIFT_USAGE_LIMITED The star gift usage is limited
START_PARAM_EMPTY The start parameter is empty
START_PARAM_INVALID The start parameter is invalid
START_PARAM_TOO_LONG The start parameter is too long
STICKERPACK_STICKERS_TOO_MUCH There are too many stickers in this stickerpack, you can't add any more
STICKERSET_INVALID The requested sticker set is invalid
STICKERSET_NOT_MODIFIED The sticker set is not modified
STICKERS_EMPTY The sticker provided is empty
@ -394,55 +295,27 @@ STICKERS_TOO_MUCH Too many stickers in the set
STICKER_DOCUMENT_INVALID The sticker document is invalid
STICKER_EMOJI_INVALID The sticker emoji is invalid
STICKER_FILE_INVALID The sticker file is invalid
STICKER_GIF_DIMENSIONS The specified video sticker has invalid dimensions
STICKER_ID_INVALID The provided sticker id is invalid
STICKER_INVALID The provided sticker is invalid
STICKER_MIME_INVALID Make sure to pass a valid image file for the right InputFile parameter
STICKER_PNG_DIMENSIONS The sticker png dimensions are invalid
STICKER_PNG_NOPNG Stickers must be png files but the provided image was not a png
STICKER_TGS_NODOC You must send the animated sticker as a document
STICKER_TGS_NOTGS A tgs sticker file was expected, but something else was provided
STICKER_THUMB_PNG_NOPNG A png sticker thumbnail file was expected, but something else was provided
STICKER_VIDEO_BIG The specified video sticker is too big
STICKER_VIDEO_NODOC You must send the video sticker as a document
STICKER_VIDEO_NOWEBM A webm video file was expected, but something else was provided
STORY_ID_EMPTY You specified no story IDs.
STORY_ID_INVALID The specified story ID is invalid.
STORY_NOT_MODIFIED The new story information you passed is equal to the previous story information, thus it wasn't modified.
STORY_PERIOD_INVALID The specified story period is invalid for this account.
STORIES_TOO_MUCH Too many stories in the current account
STORY_SEND_FLOOD_WEEKLY_X You've hit the weekly story limit, wait for the specified number of seconds before posting a new story.
STORY_SEND_FLOOD_MONTHLY_X You've hit the monthly story limit, wait for the specified number of seconds before posting a new story.
STORY_PERIOD_INVALID The story period is invalid
SUBSCRIPTION_PERIOD_INVALID The subscription period is invalid.
SWITCH_PM_TEXT_EMPTY The switch_pm.text field was empty
TAKEOUT_INVALID The takeout id is invalid
TAKEOUT_REQUIRED The method must be invoked inside a takeout session
TEMP_AUTH_KEY_ALREADY_BOUND The passed temporary key is already bound to another perm_auth_key_id
TEMP_AUTH_KEY_EMPTY The temporary auth key provided is empty
THEME_FILE_INVALID Invalid theme file provided
THEME_FORMAT_INVALID Invalid theme format provided
THEME_INVALID Invalid theme provided
THEME_MIME_INVALID You cannot create this theme because the mime-type is invalid
THEME_TITLE_INVALID The specified theme title is invalid
TITLE_INVALID The specified stickerpack title is invalid
TMP_PASSWORD_DISABLED The temporary password is disabled
TMP_PASSWORD_INVALID The temporary password is invalid
TOKEN_INVALID The provided token is invalid
TOPIC_CLOSED The topic was closed
TOPIC_DELETED The topic was deleted
TOPIC_CLOSE_SEPARATELY The close flag cannot be provided together with any of the other flags.
TOPIC_HIDE_SEPARATELY The hide flag cannot be provided together with any of the other flags.
TOPIC_ID_INVALID The provided topic ID is invalid
TOPIC_NOT_MODIFIED The topic was not modified
TOPIC_TITLE_EMPTY The specified topic title is empty.
TO_LANG_INVALID The specified destination language is invalid
TRANSCRIPTION_FAILED Telegram is having internal problems. Please try again later to transcribe the audio.
TTL_DAYS_INVALID The provided TTL days is invalid
TTL_MEDIA_INVALID The media does not support self-destruction
TYPES_EMPTY The types parameter is empty
TYPE_CONSTRUCTOR_INVALID The type constructor is invalid
UNKNOWN_ERROR Unknown error
UNTIL_DATE_INVALID That date parameter is invalid
URL_INVALID The URL provided is invalid
USAGE_LIMIT_INVALID The usage limit is invalid
@ -450,12 +323,10 @@ USERNAME_INVALID The username is invalid
USERNAME_NOT_MODIFIED The username was not modified because you tried to edit it using the same one
USERNAME_NOT_OCCUPIED The username is not occupied by anyone
USERNAME_OCCUPIED The username is already in use by someone else
USERNAME_PURCHASE_AVAILABLE The username is available for purchase on fragment.com
USERPIC_UPLOAD_REQUIRED You are required to upload a profile picture for this action
USERS_TOO_FEW Not enough users (to create a chat, for example)
USERS_TOO_MUCH The maximum number of users has been exceeded (to create a chat, for example)
USER_ADMIN_INVALID The action requires admin privileges. Probably you tried to edit admin privileges on someone you don't have rights to
USER_ALREADY_INVITED You have already invited this user
USER_ALREADY_PARTICIPANT The user is already a participant of this chat
USER_BANNED_IN_CHANNEL You are limited from sending messages in supergroups/channels, check @SpamBot for details
USER_BLOCKED The user is blocked
@ -471,17 +342,13 @@ USER_IS_BOT A bot cannot send messages to other bots or to itself
USER_KICKED This user was kicked from this chat
USER_NOT_MUTUAL_CONTACT The user is not a mutual contact
USER_NOT_PARTICIPANT The user is not a member of this chat
USER_PUBLIC_MISSING The accounts username is missing
USER_VOLUME_INVALID The specified user volume is invalid
VIDEO_CONTENT_TYPE_INVALID The video content type is invalid (i.e.: not streamable)
VIDEO_FILE_INVALID The video file is invalid
VIDEO_TITLE_EMPTY The specified video title is empty
VOICE_MESSAGES_FORBIDDEN This user's privacy settings forbid you from sending voice messages
VOICE_MESSAGES_FORBIDDEN Voice messages are restricted
VOLUME_LOC_NOT_FOUND The volume location can't be found
WALLPAPER_FILE_INVALID The provided file cannot be used as a wallpaper
WALLPAPER_INVALID The input wallpaper was not valid
WALLPAPER_MIME_INVALID The wallpaper mime type is invalid
WALLPAPER_NOT_FOUND The specified wallpaper could not be found.
WC_CONVERT_URL_INVALID WC convert URL invalid
WEBDOCUMENT_INVALID The web document is invalid
WEBDOCUMENT_MIME_INVALID The web document mime type is invalid
@ -490,19 +357,4 @@ WEBDOCUMENT_URL_EMPTY The web document URL is empty
WEBDOCUMENT_URL_INVALID The web document URL is invalid
WEBPAGE_CURL_FAILED Telegram server could not fetch the provided URL
WEBPAGE_MEDIA_EMPTY The URL doesn't contain any valid media
WEBPAGE_NOT_FOUND Webpage not found
WEBPAGE_URL_INVALID Webpage url invalid
WEBPUSH_AUTH_INVALID The specified web push authentication secret is invalid
WEBPUSH_KEY_INVALID The specified web push elliptic curve Diffie-Hellman public key is invalid
WEBPUSH_TOKEN_INVALID The specified web push token is invalid
YOU_BLOCKED_USER You blocked this user
STORIES_NEVER_CREATED You have never created any stories
MEDIA_FILE_INVALID The provided media file is invalid
CHANNEL_FORUM_MISSING The channel forum is missing
TTL_PERIOD_INVALID The provided TTL period is invalid
BOOSTS_REQUIRED The specified channel must first be boosted by its users in order to perform this action
BOOSTS_EMPTY You can't modify the icon of the General topic.
BOOST_NOT_MODIFIED You're already boosting the specified channel.
PAYMENT_REQUIRED The payment is required
BOOST_PEER_INVALID The specified `boost_peer` is invalid.
STARS_AMOUNT_INVALID The specified `amount` is invalid.
YOU_BLOCKED_USER You blocked this user
1 id message
2 ABOUT_TOO_LONG The provided about/bio text is too long
3 ACCESS_TOKEN_EXPIRED The bot token has expired
4 ACCESS_TOKEN_INVALID The bot access token is invalid
ADDRESS_INVALID The specified geopoint address is invalid.
5 ADMINS_TOO_MUCH The chat has too many administrators
ADMIN_ID_INVALID The specified admin ID is invalid
6 ADMIN_RANK_EMOJI_NOT_ALLOWED Emoji are not allowed in custom administrator titles
7 ADMIN_RANK_INVALID The custom administrator title is invalid or too long
ADMIN_RIGHTS_EMPTY The chatAdminRights constructor passed in keyboardButtonRequestPeer.peer_type.user_admin_rights has no rights set (i.e. flags is 0).
8 ALBUM_PHOTOS_TOO_MANY Too many photos were included in the album
9 API_ID_INVALID The api_id/api_hash combination is invalid
10 API_ID_PUBLISHED_FLOOD You are using an API key that is limited on the server side because it was published somewhere
11 ARTICLE_TITLE_EMPTY The article title is empty
AUDIO_CONTENT_URL_EMPTY The remote URL specified in the content field is empty
12 AUDIO_TITLE_EMPTY The title attribute of the audio is empty
13 AUTH_BYTES_INVALID The authorization bytes are invalid
14 AUTH_TOKEN_ALREADY_ACCEPTED The authorization token was already used
AUTH_TOKEN_EXCEPTION An error occurred while importing the auth token
15 AUTH_TOKEN_EXPIRED The provided authorization token has expired and the updated QR-code must be re-scanned
16 AUTH_TOKEN_INVALID An invalid authorization token was provided
AUTH_TOKEN_INVALID2 An invalid authorization token was provided
AUTH_TOKEN_INVALIDX The specified auth token is invalid
17 AUTOARCHIVE_NOT_AVAILABLE This feature is not yet enabled for your account due to it not receiving too many private messages from strangers
18 BANK_CARD_NUMBER_INVALID The credit card number is invalid
19 BANNED_RIGHTS_INVALID You provided a set of restrictions that is invalid
20 BASE_PORT_LOC_INVALID The base port location is invalid
BIRTHDAY_INVALID The age should be less than 150 year old in Telegram
21 BOTS_TOO_MUCH The chat has too many bots
22 BOT_CHANNELS_NA Bots can't edit admin privileges
23 BOT_COMMAND_DESCRIPTION_INVALID The command description was empty, too long or had invalid characters
BOT_COMMAND_INVALID The specified command is invalid
24 BOT_DOMAIN_INVALID The domain used for the auth button does not match the one configured in @BotFather
25 BOT_GAMES_DISABLED Bot games cannot be used in this type of chat
26 BOT_GROUPS_BLOCKED This bot can't be added to groups
27 BOT_INLINE_DISABLED The inline feature of the bot is disabled
28 BOT_INVALID This is not a valid bot
BOT_INVOICE_INVALID The provided invoice is invalid
29 BOT_METHOD_INVALID The method can't be used by bots
30 BOT_MISSING This method can only be run by a bot
31 BOT_ONESIDE_NOT_AVAIL Bots can't pin messages for one side only in private chats
33 BOT_POLLS_DISABLED Sending polls by bots has been disabled
34 BOT_RESPONSE_TIMEOUT The bot did not answer to the callback query in time
35 BOT_SCORE_NOT_MODIFIED The bot score was not modified
BROADCAST_CALLS_DISABLED Broadcast calls disabled
36 BROADCAST_ID_INVALID The channel is invalid
37 BROADCAST_PUBLIC_VOTERS_FORBIDDEN Polls with public voters cannot be sent in channels
38 BROADCAST_REQUIRED The request can only be used with a channel
BUSINESS_BOT_MISSING Business bot missing
39 BUTTON_DATA_INVALID The button callback data is invalid or too large
BUTTON_ID_INVALID The button_id parameter is invalid
BUTTON_TEXT_INVALID The specified button text is invalid
40 BUTTON_TYPE_INVALID The type of one of the buttons you provided is invalid
41 BUTTON_URL_INVALID The button url is invalid
42 BUTTON_USER_PRIVACY_RESTRICTED The privacy settings of the user specified in a keyboard button do not allow creating such button
45 CALL_PEER_INVALID The provided call peer object is invalid
46 CALL_PROTOCOL_FLAGS_INVALID Call protocol flags invalid
47 CDN_METHOD_INVALID The method can't be used on CDN DCs
CHANNELS_ADMIN_LOCATED_TOO_MUCH The user has reached the limit of public geogroups
48 CHANNELS_ADMIN_PUBLIC_TOO_MUCH You are an administrator of too many public channels
49 CHANNELS_TOO_MUCH You have joined too many channels or supergroups, leave some and try again
50 CHANNEL_ADD_INVALID Internal error.
51 CHANNEL_BANNED The channel is banned
CHANNEL_ID_INVALID The specified supergroup ID is invalid.
52 CHANNEL_INVALID The channel parameter is invalid
CHANNEL_PARICIPANT_MISSING The current user is not in the channel
53 CHANNEL_PRIVATE The channel/supergroup is not accessible
54 CHANNEL_TOO_BIG CHANNEL_TOO_LARGE The channel too big The channel is too large
CHANNEL_TOO_LARGE Channel is too large to be deleted; this error is issued when trying to delete channels with more than 1000 members (subject to change).
CHARGE_ALREADY_REFUNDED The charge id was already used for a refund.
CHARGE_NOT_FOUND The charge id was not found.
CHATLIST_EXCLUDE_INVALID The specified `exclude_peers` are invalid.
55 CHAT_ABOUT_NOT_MODIFIED The chat about text was not modified because you tried to edit it using the same content
56 CHAT_ABOUT_TOO_LONG The chat about text is too long
57 CHAT_ADMIN_REQUIRED The method requires chat admin privileges
CHAT_DISCUSSION_UNALLOWED The chat discussion is not allowed
58 CHAT_FORWARDS_RESTRICTED The chat restricts forwarding content
59 CHAT_ID_EMPTY The provided chat id is empty
60 CHAT_ID_INVALID The chat id being used is invalid or not known yet. Make sure you see the chat before interacting with it
63 CHAT_LINK_EXISTS The action failed because the supergroup is linked to a channel
64 CHAT_NOT_MODIFIED The chat settings (title, permissions, photo, etc..) were not modified because you tried to edit them using the same content
65 CHAT_RESTRICTED The chat is restricted and cannot be used
CHAT_REVOKE_DATE_UNSUPPORTED `min_date` and `max_date` are not available for using with non-user peers
66 CHAT_SEND_INLINE_FORBIDDEN You cannot use inline bots to send messages in this chat
67 CHAT_TITLE_EMPTY The chat title is empty
68 CHAT_TOO_BIG The chat is too big for this action
69 CODE_EMPTY The provided code is empty
70 CODE_HASH_INVALID The provided code hash invalid
71 CODE_INVALID The provided code is invalid (i.e. from email)
COLOR_INVALID The provided color is invalid
72 CONNECTION_API_ID_INVALID The provided API id is invalid
73 CONNECTION_APP_VERSION_EMPTY App version is empty
74 CONNECTION_DEVICE_MODEL_EMPTY The device model is empty
79 CONNECTION_SYSTEM_LANG_CODE_EMPTY The system language code is empty
80 CONTACT_ADD_MISSING Contact to add is missing
81 CONTACT_ID_INVALID The provided contact id is invalid
CONTACT_MISSING The specified user is not a contact.
82 CONTACT_NAME_EMPTY The provided contact name is empty
83 CONTACT_REQ_MISSING Missing contact request
CREATE_CALL_FAILED An error occurred while creating the call
CURRENCY_TOTAL_AMOUNT_INVALID The total amount of all prices is invalid
84 DATA_INVALID The encrypted data is invalid
85 DATA_JSON_INVALID The provided JSON data is invalid
86 DATA_TOO_LONG Data too long
90 DOCUMENT_INVALID The document is invalid
91 EMAIL_HASH_EXPIRED The email hash expired and cannot be used to verify it
92 EMAIL_INVALID The email provided is invalid
EMAIL_NOT_ALLOWED This email is not allowed
EMAIL_NOT_SETUP In order to change the login email with emailVerifyPurposeLoginChange, an existing login email must already be set using emailVerifyPurposeLoginSetup.
93 EMAIL_UNCONFIRMED Email unconfirmed
94 EMAIL_UNCONFIRMED_X The provided email isn't confirmed, {value} is the length of the verification code that was just sent to the email
95 EMAIL_VERIFY_EXPIRED The verification email has expired
EMOJI_INVALID The specified theme emoji is valid
EMOJI_MARKUP_INVALID The specified `video_emoji_markup` was invalid.
EMOJI_NOT_MODIFIED The theme wasn't changed
96 EMOTICON_EMPTY The emoticon parameter is empty
97 EMOTICON_INVALID The emoticon parameter is invalid
98 EMOTICON_STICKERPACK_MISSING The emoticon sticker pack you are trying to obtain is missing
106 ENTITY_MENTION_USER_INVALID The mentioned entity is not an user
107 ERROR_TEXT_EMPTY The provided error message is empty
108 EXPIRE_DATE_INVALID The expiration date is invalid
EXPIRE_FORBIDDEN Expire forbidden
109 EXPORT_CARD_INVALID The provided card is invalid
EXTENDED_MEDIA_AMOUNT_INVALID The maximum amount of `star_count` should be less than the `stars_paid_post_amount_max`
EXTENDED_MEDIA_PEER_INVALID The specified chat type is invalid.
EXTENDED_MEDIA_TYPE_INVALID The specified extended media type is unsupported.
110 EXTERNAL_URL_INVALID The external media URL is invalid
111 FIELD_NAME_EMPTY The field with the name FIELD_NAME is missing
112 FIELD_NAME_INVALID The field with the name FIELD_NAME is invalid
FILE_CONTENT_TYPE_INVALID File content-type is invalid
FILE_EMTPY An empty file was provided
113 FILE_ID_INVALID The file id is invalid
114 FILE_MIGRATE_X The file is in Data Center No. {value}
115 FILE_PARTS_INVALID Invalid number of parts.
FILE_PART_0_MISSING File part 0 missing
116 FILE_PART_EMPTY The file part sent is empty
117 FILE_PART_INVALID The file part number is invalid.
118 FILE_PART_LENGTH_INVALID The length of a file part is invalid
123 FILE_REFERENCE_EMPTY The file id contains an empty file reference, you must obtain a valid one by fetching the message from the origin context
124 FILE_REFERENCE_EXPIRED The file id contains an expired file reference, you must obtain a valid one by fetching the message from the origin context
125 FILE_REFERENCE_INVALID The file id contains an invalid file reference, you must obtain a valid one by fetching the message from the origin context
FILE_TITLE_EMPTY An empty file title was specified
126 FILTER_ID_INVALID The specified filter ID is invalid
FILTER_INCLUDE_EMPTY The filter include is empty
FILTER_NOT_SUPPORTED The specified filter cannot be used in this context
FILTER_TITLE_EMPTY The title field of the filter is empty
127 FIRSTNAME_INVALID The first name is invalid
128 FOLDER_ID_EMPTY The folder you tried to delete was already empty
129 FOLDER_ID_INVALID The folder id is invalid
FORM_ID_EXPIRED The specified id has expired.
FORUM_ENABLED You can't execute the specified action because the group is a [forum](https://core.telegram.org/api/forum), disable forum functionality to continue.
130 FRESH_CHANGE_ADMINS_FORBIDDEN You can't change administrator settings in this chat because your session was logged-in recently
131 FROM_MESSAGE_BOT_DISABLED Bots can't use fromMessage min constructors
132 FROM_PEER_INVALID The from peer value is invalid
133 GAME_BOT_INVALID You cannot send that game with the current bot
GENERAL_MODIFY_ICON_FORBIDDEN You can't modify the icon of the General topic.
134 GEO_POINT_INVALID Invalid geo point provided
135 GIF_CONTENT_TYPE_INVALID GIF content-type invalid
136 GIF_ID_INVALID The provided gif/animation id is invalid
GIFT_SLUG_INVALID The specified slug is invalid.
GIFT_SLUG_EXPIRED The gift slug is expired
GRAPH_EXPIRED_RELOAD This graph has expired, please obtain a new graph token
137 GRAPH_INVALID_RELOAD Invalid graph token provided, please reload the stats and provide the updated token
138 GRAPH_OUTDATED_RELOAD The graph data is outdated
GROUPCALL_ALREADY_DISCARDED The group call was already discarded
GROUPCALL_INVALID The specified group call is invalid
GROUPCALL_JOIN_MISSING You haven't joined this group call
GROUPCALL_NOT_MODIFIED Group call settings weren't modified
139 GROUPCALL_SSRC_DUPLICATE_MUCH Too many group call synchronization source duplicates
140 GROUPED_MEDIA_INVALID The album contains invalid media
141 GROUP_CALL_INVALID The group call is invalid
142 HASH_INVALID The provided hash is invalid
HIDE_REQUESTER_MISSING The join request was missing or was already handled
143 IMAGE_PROCESS_FAILED The server failed to process your image
144 IMPORT_FILE_INVALID The imported file is invalid
145 IMPORT_FORMAT_UNRECOGNIZED The imported format is unrecognized
152 INPUT_LAYER_INVALID The provided layer is invalid
153 INPUT_METHOD_INVALID The method invoked is invalid in the current schema
154 INPUT_REQUEST_TOO_LONG The input request is too long
INPUT_TEXT_EMPTY The specified text is empty
INPUT_TEXT_TOO_LONG The specified text is too long.
155 INPUT_USER_DEACTIVATED The target user has been deleted/deactivated
INVITES_TOO_MUCH The maximum number of per-folder invites specified by the `chatlist_invites_limit_default`/`chatlist_invites_limit_premium` was reached.
INVITE_FORBIDDEN_WITH_JOINAS If the user has anonymously joined a group call as a channel, they can't invite other users to the group call because that would cause deanonymization, because the invite would be sent using the original user ID, not the anonymized channel ID
156 INVITE_HASH_EMPTY The invite hash is empty
157 INVITE_HASH_EXPIRED The chat invite link is no longer valid
158 INVITE_HASH_INVALID The invite link hash is invalid
159 INVITE_REQUEST_SENT The request to join this chat or channel has been successfully sent
160 INVITE_REVOKED_MISSING The action required a chat invite link to be revoked first
INVITE_SLUG_EMPTY The invite slug is empty
INVITE_SLUG_EXPIRED The invite slug is expired
INVOICE_PAYLOAD_INVALID The specified invoice payload is invalid
JOIN_AS_PEER_INVALID The specified peer cannot be used to join a group call
LANG_CODE_INVALID The specified language code is invalid
LANG_CODE_NOT_SUPPORTED The specified language code is not supported
161 LANG_PACK_INVALID The provided language pack is invalid
162 LASTNAME_INVALID The last name is invalid
163 LIMIT_INVALID The limit parameter is invalid
164 LINK_NOT_MODIFIED The chat link was not modified because you tried to link to the same target
165 LOCATION_INVALID The file location is invalid
MAX_DATE_INVALID The specified maximum date is invalid
166 MAX_ID_INVALID The max_id parameter is invalid
167 MAX_QTS_INVALID The provided QTS is invalid
168 MD5_CHECKSUM_INVALID The file's checksum did not match the md5_checksum parameter
169 MEDIA_CAPTION_TOO_LONG The media caption is too long
170 MEDIA_EMPTY The media you tried to send is invalid
MEDIA_FILE_INVALID The provided media file is invalid
MEDIA_GROUPED_INVALID You tried to send media of different types in an album
171 MEDIA_INVALID The media is invalid
172 MEDIA_NEW_INVALID The new media to edit the message with is invalid
173 MEDIA_PREV_INVALID The previous media cannot be edited with anything else
MEDIA_TTL_INVALID The media ttl is invalid
MEDIA_VIDEO_STORY_MISSING The media does not have a photo or a video
174 MEGAGROUP_ID_INVALID The supergroup is invalid
175 MEGAGROUP_PREHISTORY_HIDDEN The action failed because the supergroup has the pre-history hidden
176 MEGAGROUP_REQUIRED The request can only be used with a supergroup
182 MESSAGE_POLL_CLOSED You can't interact with a closed poll
183 MESSAGE_TOO_LONG The message text is too long
184 METHOD_INVALID The API method is invalid and cannot be used
MIN_DATE_INVALID The specified minimum date is invalid
185 MSG_ID_INVALID The message ID used in the peer was invalid
MSG_TOO_OLD chat_read_mark_expire_period have passed since the message was sent, read receipts were deleted
MSG_VOICE_MISSING The message does not contain a voice message
186 MSG_WAIT_FAILED A waiting call returned an error
187 MULTI_MEDIA_TOO_LONG The album/media group contains too many items
188 NEW_SALT_INVALID The new salt is invalid
NEW_SETTINGS_EMPTY No password is set on the current account, and no new password was specified in `new_settings`
189 NEW_SETTINGS_INVALID The new settings are invalid
NOGENERAL_HIDE_FORBIDDEN The hidden parameter is only valid for the General topic message_thread_id=1
190 NEXT_OFFSET_INVALID The next offset value is invalid
191 OFFSET_INVALID The offset parameter is invalid
192 OFFSET_PEER_ID_INVALID The provided offset peer is invalid
196 PACK_SHORT_NAME_OCCUPIED A sticker pack with this name already exists
197 PACK_TITLE_INVALID The sticker pack title is invalid
198 PARTICIPANTS_TOO_FEW The chat doesn't have enough participants
PARTICIPANT_ID_INVALID The specified participant ID is invalid
PARTICIPANT_JOIN_MISSING Trying to enable a presentation, when the user hasn't joined the Video Chat with phone.joinGroupCall
199 PARTICIPANT_VERSION_OUTDATED The other participant is using an outdated Telegram app version
200 PASSWORD_EMPTY The password provided is empty
201 PASSWORD_HASH_INVALID The two-step verification password is invalid
205 PASSWORD_TOO_FRESH_X The two-step verification password was added recently and you are required to wait {value} seconds
206 PAYMENT_PROVIDER_INVALID The payment provider was not recognised or its token was invalid
207 PEER_FLOOD The method can't be used because your account is currently limited
PEER_HISTORY_EMPTY Peer history empty
208 PEER_ID_INVALID The peer id being used is invalid or not known yet. Make sure you meet the peer before interacting with it
209 PEER_ID_NOT_SUPPORTED The provided peer id is not supported
210 PERSISTENT_TIMESTAMP_EMPTY The pts argument is empty
213 PHONE_CODE_EXPIRED The confirmation code has expired
214 PHONE_CODE_HASH_EMPTY The phone code hash is missing
215 PHONE_CODE_INVALID The confirmation code is invalid
PHONE_HASH_EXPIRED An invalid or expired phone_code_hash was provided
PHONE_NOT_OCCUPIED No user is associated to the specified phone number
216 PHONE_NUMBER_APP_SIGNUP_FORBIDDEN You can't sign up using this app
217 PHONE_NUMBER_BANNED The phone number is banned from Telegram and cannot be used
218 PHONE_NUMBER_FLOOD This number has tried to login too many times
233 PHOTO_THUMB_URL_EMPTY The photo thumb URL is empty
234 PHOTO_THUMB_URL_INVALID The photo thumb URL is invalid
235 PINNED_DIALOGS_TOO_MUCH Too many pinned dialogs
PINNED_TOPIC_NOT_MODIFIED The pinned topic was not modified.
236 PIN_RESTRICTED You can't pin messages in private chats with other people
237 POLL_ANSWERS_INVALID The poll answers are invalid
POLL_ANSWER_INVALID One of the poll answers is not acceptable
238 POLL_OPTION_DUPLICATE A duplicate option was sent in the same poll
239 POLL_OPTION_INVALID A poll option used invalid data (the data may be too long)
240 POLL_QUESTION_INVALID The poll question is invalid
241 POLL_UNSUPPORTED This layer does not support polls in the invoked method
242 POLL_VOTE_REQUIRED Cast a vote in the poll before calling this method
PREMIUM_ACCOUNT_REQUIRED The method requires a premium user account
PREMIUM_GIFTCODE_WAS_REFUNDED This gift code can't be redeemed because the giveaway organizer requested a refund
PRICING_CHAT_INVALID This chat chat doesn't support subscription link.
243 PRIVACY_KEY_INVALID The privacy key is invalid
244 PRIVACY_TOO_LONG Your privacy exception list has exceeded the maximum capacity
245 PRIVACY_VALUE_INVALID The privacy value is invalid
PUBLIC_KEY_REQUIRED A public key is required
246 QUERY_ID_EMPTY The query ID is empty
247 QUERY_ID_INVALID The callback query id is invalid
248 QUERY_TOO_SHORT The query is too short
QUIZ_ANSWER_MISSING You can forward a quiz while hiding the original author only after choosing an option in the quiz
249 QUIZ_CORRECT_ANSWERS_EMPTY The correct answers of the quiz are empty
250 QUIZ_CORRECT_ANSWERS_TOO_MUCH The quiz contains too many correct answers
251 QUIZ_CORRECT_ANSWER_INVALID The correct answers of the quiz are invalid
261 REPLY_MARKUP_GAME_EMPTY The provided reply markup for the game is empty
262 REPLY_MARKUP_INVALID The provided reply markup is invalid
263 REPLY_MARKUP_TOO_LONG The reply markup is too long
REPLY_MESSAGE_ID_INVALID The reply message id is invalid
RESET_REQUEST_MISSING No password reset is in progress
264 RESULTS_TOO_MUCH The result contains too many items
265 RESULT_ID_DUPLICATE The result contains items with duplicated identifiers
266 RESULT_ID_EMPTY Result ID empty
267 RESULT_ID_INVALID The given result cannot be used to send the selection to the bot
REACTIONS_TOO_MANY Currently, non-premium users, can set up to one reaction per message
268 RESULT_TYPE_INVALID The result type is invalid
269 REVOTE_NOT_ALLOWED You cannot change your vote
RIGHTS_NOT_MODIFIED The new admin rights are equal to the old rights, no change was made
270 RSA_DECRYPT_FAILED Internal RSA decryption failed
271 SCHEDULE_BOT_NOT_ALLOWED Bots are not allowed to schedule messages
272 SCHEDULE_DATE_INVALID Invalid schedule date provided
273 SCHEDULE_DATE_TOO_LATE The date you tried to schedule is too far in the future (more than one year)
274 SCHEDULE_STATUS_PRIVATE You cannot schedule a message until the person comes online if their privacy does not show this information
275 SCHEDULE_TOO_MUCH You tried to schedule too many messages in this chat
SCORE_INVALID The specified game score is invalid
276 SEARCH_QUERY_EMPTY The search query is empty
SEARCH_WITH_LINK_NOT_SUPPORTED You cannot provide a search query and an invite link at the same time
277 SECONDS_INVALID The seconds interval is invalid
SEND_AS_PEER_INVALID You can't send messages as the specified peer
278 SEND_MESSAGE_MEDIA_INVALID The message media is invalid
279 SEND_MESSAGE_TYPE_INVALID The message type is invalid
280 SESSION_TOO_FRESH_X You can't do this action because the current session was logged-in recently
281 SETTINGS_INVALID Invalid settings were provided
282 SHA256_HASH_INVALID The provided SHA256 hash is invalid
283 SHORTNAME_OCCUPY_FAILED An error occurred when trying to register the short-name used for the sticker pack. Try a different name
SHORT_NAME_INVALID The specified short name is invalid
SHORT_NAME_OCCUPIED The specified short name is already in use
284 SLOWMODE_MULTI_MSGS_DISABLED Slowmode is enabled, you cannot forward multiple messages to this group
285 SMS_CODE_CREATE_FAILED An error occurred while creating the SMS code
286 SRP_ID_INVALID Invalid SRP ID provided
287 SRP_PASSWORD_CHANGED The password has changed
STARGIFT_ALREADY_CONVERTED The provided star gift already converted to stars
STARGIFT_ALREADY_UPGRADED This star gift was already upgraded before
STARGIFT_USAGE_LIMITED The star gift usage is limited
288 START_PARAM_EMPTY The start parameter is empty
289 START_PARAM_INVALID The start parameter is invalid
290 START_PARAM_TOO_LONG The start parameter is too long
STICKERPACK_STICKERS_TOO_MUCH There are too many stickers in this stickerpack, you can't add any more
291 STICKERSET_INVALID The requested sticker set is invalid
292 STICKERSET_NOT_MODIFIED The sticker set is not modified
293 STICKERS_EMPTY The sticker provided is empty
295 STICKER_DOCUMENT_INVALID The sticker document is invalid
296 STICKER_EMOJI_INVALID The sticker emoji is invalid
297 STICKER_FILE_INVALID The sticker file is invalid
STICKER_GIF_DIMENSIONS The specified video sticker has invalid dimensions
298 STICKER_ID_INVALID The provided sticker id is invalid
299 STICKER_INVALID The provided sticker is invalid
STICKER_MIME_INVALID Make sure to pass a valid image file for the right InputFile parameter
300 STICKER_PNG_DIMENSIONS The sticker png dimensions are invalid
301 STICKER_PNG_NOPNG Stickers must be png files but the provided image was not a png
STICKER_TGS_NODOC You must send the animated sticker as a document
302 STICKER_TGS_NOTGS A tgs sticker file was expected, but something else was provided
303 STICKER_THUMB_PNG_NOPNG A png sticker thumbnail file was expected, but something else was provided
STICKER_VIDEO_BIG The specified video sticker is too big
STICKER_VIDEO_NODOC You must send the video sticker as a document
304 STICKER_VIDEO_NOWEBM A webm video file was expected, but something else was provided
STORY_ID_EMPTY You specified no story IDs.
STORY_ID_INVALID The specified story ID is invalid.
STORY_NOT_MODIFIED The new story information you passed is equal to the previous story information, thus it wasn't modified.
STORY_PERIOD_INVALID The specified story period is invalid for this account.
STORIES_TOO_MUCH Too many stories in the current account
STORY_SEND_FLOOD_WEEKLY_X You've hit the weekly story limit, wait for the specified number of seconds before posting a new story.
STORY_SEND_FLOOD_MONTHLY_X You've hit the monthly story limit, wait for the specified number of seconds before posting a new story.
STORY_PERIOD_INVALID The story period is invalid
SUBSCRIPTION_PERIOD_INVALID The subscription period is invalid.
SWITCH_PM_TEXT_EMPTY The switch_pm.text field was empty
305 TAKEOUT_INVALID The takeout id is invalid
306 TAKEOUT_REQUIRED The method must be invoked inside a takeout session
TEMP_AUTH_KEY_ALREADY_BOUND The passed temporary key is already bound to another perm_auth_key_id
307 TEMP_AUTH_KEY_EMPTY The temporary auth key provided is empty
308 THEME_FILE_INVALID Invalid theme file provided
309 THEME_FORMAT_INVALID Invalid theme format provided
310 THEME_INVALID Invalid theme provided
311 THEME_MIME_INVALID You cannot create this theme because the mime-type is invalid
THEME_TITLE_INVALID The specified theme title is invalid
TITLE_INVALID The specified stickerpack title is invalid
312 TMP_PASSWORD_DISABLED The temporary password is disabled
313 TMP_PASSWORD_INVALID The temporary password is invalid
314 TOKEN_INVALID The provided token is invalid
TOPIC_CLOSED The topic was closed
TOPIC_DELETED The topic was deleted
TOPIC_CLOSE_SEPARATELY The close flag cannot be provided together with any of the other flags.
TOPIC_HIDE_SEPARATELY The hide flag cannot be provided together with any of the other flags.
TOPIC_ID_INVALID The provided topic ID is invalid
TOPIC_NOT_MODIFIED The topic was not modified
TOPIC_TITLE_EMPTY The specified topic title is empty.
TO_LANG_INVALID The specified destination language is invalid
TRANSCRIPTION_FAILED Telegram is having internal problems. Please try again later to transcribe the audio.
315 TTL_DAYS_INVALID The provided TTL days is invalid
316 TTL_MEDIA_INVALID The media does not support self-destruction
317 TYPES_EMPTY The types parameter is empty
318 TYPE_CONSTRUCTOR_INVALID The type constructor is invalid
UNKNOWN_ERROR Unknown error
319 UNTIL_DATE_INVALID That date parameter is invalid
320 URL_INVALID The URL provided is invalid
321 USAGE_LIMIT_INVALID The usage limit is invalid
323 USERNAME_NOT_MODIFIED The username was not modified because you tried to edit it using the same one
324 USERNAME_NOT_OCCUPIED The username is not occupied by anyone
325 USERNAME_OCCUPIED The username is already in use by someone else
USERNAME_PURCHASE_AVAILABLE The username is available for purchase on fragment.com
326 USERPIC_UPLOAD_REQUIRED You are required to upload a profile picture for this action
327 USERS_TOO_FEW Not enough users (to create a chat, for example)
328 USERS_TOO_MUCH The maximum number of users has been exceeded (to create a chat, for example)
329 USER_ADMIN_INVALID The action requires admin privileges. Probably you tried to edit admin privileges on someone you don't have rights to
USER_ALREADY_INVITED You have already invited this user
330 USER_ALREADY_PARTICIPANT The user is already a participant of this chat
331 USER_BANNED_IN_CHANNEL You are limited from sending messages in supergroups/channels, check @SpamBot for details
332 USER_BLOCKED The user is blocked
342 USER_KICKED This user was kicked from this chat
343 USER_NOT_MUTUAL_CONTACT The user is not a mutual contact
344 USER_NOT_PARTICIPANT The user is not a member of this chat
USER_PUBLIC_MISSING The accounts username is missing
USER_VOLUME_INVALID The specified user volume is invalid
345 VIDEO_CONTENT_TYPE_INVALID The video content type is invalid (i.e.: not streamable)
346 VIDEO_FILE_INVALID The video file is invalid
347 VIDEO_TITLE_EMPTY VOICE_MESSAGES_FORBIDDEN The specified video title is empty Voice messages are restricted
VOICE_MESSAGES_FORBIDDEN This user's privacy settings forbid you from sending voice messages
348 VOLUME_LOC_NOT_FOUND The volume location can't be found
349 WALLPAPER_FILE_INVALID The provided file cannot be used as a wallpaper
350 WALLPAPER_INVALID The input wallpaper was not valid
351 WALLPAPER_MIME_INVALID The wallpaper mime type is invalid
WALLPAPER_NOT_FOUND The specified wallpaper could not be found.
352 WC_CONVERT_URL_INVALID WC convert URL invalid
353 WEBDOCUMENT_INVALID The web document is invalid
354 WEBDOCUMENT_MIME_INVALID The web document mime type is invalid
357 WEBDOCUMENT_URL_INVALID The web document URL is invalid
358 WEBPAGE_CURL_FAILED Telegram server could not fetch the provided URL
359 WEBPAGE_MEDIA_EMPTY The URL doesn't contain any valid media
360 WEBPAGE_NOT_FOUND YOU_BLOCKED_USER Webpage not found You blocked this user
WEBPAGE_URL_INVALID Webpage url invalid
WEBPUSH_AUTH_INVALID The specified web push authentication secret is invalid
WEBPUSH_KEY_INVALID The specified web push elliptic curve Diffie-Hellman public key is invalid
WEBPUSH_TOKEN_INVALID The specified web push token is invalid
YOU_BLOCKED_USER You blocked this user
STORIES_NEVER_CREATED You have never created any stories
MEDIA_FILE_INVALID The provided media file is invalid
CHANNEL_FORUM_MISSING The channel forum is missing
TTL_PERIOD_INVALID The provided TTL period is invalid
BOOSTS_REQUIRED The specified channel must first be boosted by its users in order to perform this action
BOOSTS_EMPTY You can't modify the icon of the General topic.
BOOST_NOT_MODIFIED You're already boosting the specified channel.
PAYMENT_REQUIRED The payment is required
BOOST_PEER_INVALID The specified `boost_peer` is invalid.
STARS_AMOUNT_INVALID The specified `amount` is invalid.

View file

@ -4,44 +4,25 @@ CHANNEL_PUBLIC_GROUP_NA The channel/supergroup is not available
CHAT_ADMIN_INVITE_REQUIRED You don't have rights to invite other users
CHAT_ADMIN_REQUIRED The method requires chat admin privileges
CHAT_FORBIDDEN You cannot write in this chat
CHAT_GUEST_SEND_FORBIDDEN You need to join the discussion group before commentingr
CHAT_SEND_GIFS_FORBIDDEN You can't send animations in this chat
CHAT_SEND_INLINE_FORBIDDEN You cannot use inline bots to send messages in this chat
CHAT_SEND_MEDIA_FORBIDDEN You can't send media messages in this chat
CHAT_SEND_POLL_FORBIDDEN You can't send polls in this chat
CHAT_SEND_STICKERS_FORBIDDEN You can't send stickers in this chat
CHAT_WRITE_FORBIDDEN You don't have rights to send messages in this chat
EDIT_BOT_INVITE_FORBIDDEN Bots' chat invite links can't be edited
INLINE_BOT_REQUIRED The action must be performed through an inline bot callback
MESSAGE_AUTHOR_REQUIRED You are not the author of this message
MESSAGE_DELETE_FORBIDDEN You don't have rights to delete messages in this chat, most likely because you are not the author of them
NOT_ALLOWED Not allowed
NOT_ELIGIBLE You are not eligible for this action
PARTICIPANT_JOIN_MISSING Trying to enable a presentation, when the user hasn't joined the Video Chat with phone.joinGroupCall
POLL_VOTE_REQUIRED Cast a vote in the poll before calling this method
PREMIUM_ACCOUNT_REQUIRED This action requires a premium account
PRIVACY_PREMIUM_REQUIRED The user has restricted from sending messages OR This action requires a premium account
PUBLIC_CHANNEL_MISSING You can only export group call invite links for public chats or channels
RIGHT_FORBIDDEN You don't have enough rights for this action, or you tried to set one or more admin rights that can't be applied to this kind of chat (channel or supergroup)
SENSITIVE_CHANGE_FORBIDDEN Your sensitive content settings can't be changed at this time
TAKEOUT_REQUIRED The method must be invoked inside a takeout session
USER_BOT_INVALID This method can only be called by a bot
USER_CHANNELS_TOO_MUCH One of the users you tried to add is already in too many channels/supergroups
USER_DELETED You can't send this secret message because the other participant deleted their account
USER_INVALID The provided user is invalid
USER_IS_BLOCKED The user is blocked
USER_NOT_MUTUAL_CONTACT The provided user is not a mutual contact
USER_PRIVACY_RESTRICTED The user's privacy settings is preventing you to perform this action
USER_RESTRICTED You are limited/restricted. You can't perform this action
CHAT_SEND_AUDIOS_FORBIDDEN You can't send audio messages in this chat
CHAT_SEND_DOCS_FORBIDDEN You can't send a documents to this chat
CHAT_SEND_GAME_FORBIDDEN You can't send a game to this chat
CHAT_SEND_GIFS_FORBIDDEN You can't send gifs in this chat
CHAT_SEND_INLINE_FORBIDDEN You can't use inline bot to send messages in this chat
CHAT_SEND_MEDIA_FORBIDDEN You can't send media in this chat
CHAT_SEND_PHOTOS_FORBIDDEN You can't send photos in this chat
CHAT_SEND_PLAIN_FORBIDDEN You can't send non-media (text) messages in this chat
CHAT_SEND_POLL_FORBIDDEN You can't send polls in this chat
CHAT_SEND_STICKERS_FORBIDDEN You can't send stickers in this chat
CHAT_SEND_VIDEOS_FORBIDDEN You can't send videos in this chat
CHAT_SEND_VOICES_FORBIDDEN You can't send voice recordings in this chat
CHAT_WRITE_FORBIDDEN You can't write in this chat
GROUPCALL_ALREADY_STARTED The groupcall has already started, you can join directly using phone.joinGroupCall
GROUPCALL_FORBIDDEN The group call has already ended
LIVE_DISABLED Story is disabled server-side
CHAT_GUEST_SEND_FORBIDDEN You need to join the discussion group before commenting
ALLOW_PAYMENT_REQUIRED_X Payment of {value} stars is required to perform this action
USER_RESTRICTED You are limited/restricted. You can't perform this action
1 id message
4 CHAT_ADMIN_INVITE_REQUIRED You don't have rights to invite other users
5 CHAT_ADMIN_REQUIRED The method requires chat admin privileges
6 CHAT_FORBIDDEN You cannot write in this chat
7 CHAT_GUEST_SEND_FORBIDDEN CHAT_SEND_GIFS_FORBIDDEN You need to join the discussion group before commentingr You can't send animations in this chat
8 CHAT_SEND_INLINE_FORBIDDEN You cannot use inline bots to send messages in this chat
9 CHAT_SEND_MEDIA_FORBIDDEN You can't send media messages in this chat
10 CHAT_SEND_POLL_FORBIDDEN You can't send polls in this chat
11 CHAT_SEND_STICKERS_FORBIDDEN You can't send stickers in this chat
12 CHAT_WRITE_FORBIDDEN You don't have rights to send messages in this chat
13 EDIT_BOT_INVITE_FORBIDDEN Bots' chat invite links can't be edited
14 INLINE_BOT_REQUIRED The action must be performed through an inline bot callback
15 MESSAGE_AUTHOR_REQUIRED You are not the author of this message
16 MESSAGE_DELETE_FORBIDDEN You don't have rights to delete messages in this chat, most likely because you are not the author of them
NOT_ALLOWED Not allowed
NOT_ELIGIBLE You are not eligible for this action
PARTICIPANT_JOIN_MISSING Trying to enable a presentation, when the user hasn't joined the Video Chat with phone.joinGroupCall
17 POLL_VOTE_REQUIRED Cast a vote in the poll before calling this method
18 PREMIUM_ACCOUNT_REQUIRED This action requires a premium account
PRIVACY_PREMIUM_REQUIRED The user has restricted from sending messages OR This action requires a premium account
PUBLIC_CHANNEL_MISSING You can only export group call invite links for public chats or channels
19 RIGHT_FORBIDDEN You don't have enough rights for this action, or you tried to set one or more admin rights that can't be applied to this kind of chat (channel or supergroup)
20 SENSITIVE_CHANGE_FORBIDDEN Your sensitive content settings can't be changed at this time
21 TAKEOUT_REQUIRED The method must be invoked inside a takeout session
22 USER_BOT_INVALID This method can only be called by a bot
23 USER_CHANNELS_TOO_MUCH One of the users you tried to add is already in too many channels/supergroups
USER_DELETED You can't send this secret message because the other participant deleted their account
24 USER_INVALID The provided user is invalid
25 USER_IS_BLOCKED The user is blocked
26 USER_NOT_MUTUAL_CONTACT The provided user is not a mutual contact
27 USER_PRIVACY_RESTRICTED The user's privacy settings is preventing you to perform this action
28 USER_RESTRICTED You are limited/restricted. You can't perform this action
CHAT_SEND_AUDIOS_FORBIDDEN You can't send audio messages in this chat
CHAT_SEND_DOCS_FORBIDDEN You can't send a documents to this chat
CHAT_SEND_GAME_FORBIDDEN You can't send a game to this chat
CHAT_SEND_GIFS_FORBIDDEN You can't send gifs in this chat
CHAT_SEND_INLINE_FORBIDDEN You can't use inline bot to send messages in this chat
CHAT_SEND_MEDIA_FORBIDDEN You can't send media in this chat
CHAT_SEND_PHOTOS_FORBIDDEN You can't send photos in this chat
CHAT_SEND_PLAIN_FORBIDDEN You can't send non-media (text) messages in this chat
CHAT_SEND_POLL_FORBIDDEN You can't send polls in this chat
CHAT_SEND_STICKERS_FORBIDDEN You can't send stickers in this chat
CHAT_SEND_VIDEOS_FORBIDDEN You can't send videos in this chat
CHAT_SEND_VOICES_FORBIDDEN You can't send voice recordings in this chat
CHAT_WRITE_FORBIDDEN You can't write in this chat
GROUPCALL_ALREADY_STARTED The groupcall has already started, you can join directly using phone.joinGroupCall
GROUPCALL_FORBIDDEN The group call has already ended
LIVE_DISABLED Story is disabled server-side
CHAT_GUEST_SEND_FORBIDDEN You need to join the discussion group before commenting
ALLOW_PAYMENT_REQUIRED_X Payment of {value} stars is required to perform this action

View file

@ -1,23 +1,13 @@
id message
AUTH_KEY_DUPLICATED The same authorization key (session file) was used in more than one place simultaneously. You must delete your session file and log in again with your phone number or bot token
CHANNEL_PRIVATE The channel/supergroup is not accessible
CHANNEL_TOO_LARGE Сhannel is too large to be deleted. Contact support for removal
CHAT_FORWARDS_RESTRICTED You can't forward messages from a protected chat
FILEREF_UPGRADE_NEEDED The file reference has expired and you must use a refreshed one by obtaining the original media message
FRESH_CHANGE_ADMINS_FORBIDDEN You were just elected admin, you can't add or modify other admins yet
FRESH_CHANGE_PHONE_FORBIDDEN You can't change your phone number because your session was logged-in recently
FRESH_RESET_AUTHORISATION_FORBIDDEN You can't terminate other authorized sessions because the current was logged-in recently
GIFTCODE_NOT_ALLOWED Giftcode not allowed
INVITE_HASH_EXPIRED The chat the user tried to join has expired and is not valid anymore
PHONE_NUMBER_INVALID The phone number is invalid
PHONE_PASSWORD_FLOOD You have tried to log-in too many times
PREMIUM_CURRENTLY_UNAVAILABLE Premium currently unavailable
PREVIOUS_CHAT_IMPORT_ACTIVE_WAIT_XMIN Similar to a flood wait, must wait {value} minutes
SEND_CODE_UNAVAILABLE Returned when all available options for this type of number were already used (e.g. flash-call, then SMS, then this error might be returned to trigger a second resend)
PREMIUM_GIFTCODE_WAS_REFUNDED This gift code can't be redeemed because the giveaway organizer requested a refund
STICKERSET_INVALID The sticker set is invalid
STICKERSET_OWNER_ANONYMOUS This sticker set can't be used as the group's sticker set because it was created by one of its anonymous admins
UPDATE_APP_TO_LOGIN Update app to login
USERPIC_PRIVACY_REQUIRED You need to disable privacy settings for your profile picture in order to make your geolocation public
USERPIC_UPLOAD_REQUIRED You must have a profile picture to publish your geolocation
USER_RESTRICTED You are limited/restricted. You can't perform this action
USER_RESTRICTED You are limited/restricted. You can't perform this action
1 id message
2 AUTH_KEY_DUPLICATED The same authorization key (session file) was used in more than one place simultaneously. You must delete your session file and log in again with your phone number or bot token
3 CHANNEL_PRIVATE The channel/supergroup is not accessible
CHANNEL_TOO_LARGE Сhannel is too large to be deleted. Contact support for removal
CHAT_FORWARDS_RESTRICTED You can't forward messages from a protected chat
4 FILEREF_UPGRADE_NEEDED The file reference has expired and you must use a refreshed one by obtaining the original media message
5 FRESH_CHANGE_ADMINS_FORBIDDEN You were just elected admin, you can't add or modify other admins yet
6 FRESH_CHANGE_PHONE_FORBIDDEN You can't change your phone number because your session was logged-in recently
7 FRESH_RESET_AUTHORISATION_FORBIDDEN You can't terminate other authorized sessions because the current was logged-in recently
GIFTCODE_NOT_ALLOWED Giftcode not allowed
INVITE_HASH_EXPIRED The chat the user tried to join has expired and is not valid anymore
8 PHONE_NUMBER_INVALID The phone number is invalid
9 PHONE_PASSWORD_FLOOD You have tried to log-in too many times
PREMIUM_CURRENTLY_UNAVAILABLE Premium currently unavailable
PREVIOUS_CHAT_IMPORT_ACTIVE_WAIT_XMIN Similar to a flood wait, must wait {value} minutes
SEND_CODE_UNAVAILABLE Returned when all available options for this type of number were already used (e.g. flash-call, then SMS, then this error might be returned to trigger a second resend)
PREMIUM_GIFTCODE_WAS_REFUNDED This gift code can't be redeemed because the giveaway organizer requested a refund
10 STICKERSET_INVALID The sticker set is invalid
11 STICKERSET_OWNER_ANONYMOUS This sticker set can't be used as the group's sticker set because it was created by one of its anonymous admins
UPDATE_APP_TO_LOGIN Update app to login
USERPIC_PRIVACY_REQUIRED You need to disable privacy settings for your profile picture in order to make your geolocation public
12 USERPIC_UPLOAD_REQUIRED You must have a profile picture to publish your geolocation
13 USER_RESTRICTED You are limited/restricted. You can't perform this action

View file

@ -2,8 +2,5 @@ id message
2FA_CONFIRM_WAIT_X A wait of {value} seconds is required because this account is active and protected by a 2FA password
FLOOD_TEST_PHONE_WAIT_X A wait of {value} seconds is required in the test servers
FLOOD_WAIT_X A wait of {value} seconds is required
FLOOD_PREMIUM_WAIT_X A wait of {value} seconds is required
PREMIUM_SUB_ACTIVE_UNTIL_X A wait of {value} seconds is required
SLOWMODE_WAIT_X A wait of {value} seconds is required to send messages in this chat
STORY_SEND_FLOOD_X A wait of {value} seconds is required to continue posting stories
SLOWMODE_WAIT_X A wait of {value} seconds is required to send messages in this chat.
TAKEOUT_INIT_DELAY_X You have to confirm the data export request using one of your mobile devices or wait {value} seconds
1 id message
2 2FA_CONFIRM_WAIT_X A wait of {value} seconds is required because this account is active and protected by a 2FA password
3 FLOOD_TEST_PHONE_WAIT_X A wait of {value} seconds is required in the test servers
4 FLOOD_WAIT_X A wait of {value} seconds is required
5 FLOOD_PREMIUM_WAIT_X SLOWMODE_WAIT_X A wait of {value} seconds is required A wait of {value} seconds is required to send messages in this chat.
PREMIUM_SUB_ACTIVE_UNTIL_X A wait of {value} seconds is required
SLOWMODE_WAIT_X A wait of {value} seconds is required to send messages in this chat
STORY_SEND_FLOOD_X A wait of {value} seconds is required to continue posting stories
6 TAKEOUT_INIT_DELAY_X You have to confirm the data export request using one of your mobile devices or wait {value} seconds

View file

@ -38,11 +38,8 @@ RPC_MCGET_FAIL Telegram is having internal problems. Please try again later
SIGN_IN_FAILED Failure while signing in due to Telegram having internal problems. Please try again later
STORAGE_CHECK_FAILED Server storage check failed due to Telegram having internal problems. Please try again later
STORE_INVALID_SCALAR_TYPE Telegram is having internal problems. Please try again later
TIMEOUT A timeout occurred while fetching data from the worker
UNKNOWN_METHOD The method you tried to call cannot be called on non-CDN DCs
UPLOAD_NO_VOLUME Telegram is having internal problems. Please try again later
VOLUME_LOC_NOT_FOUND Telegram is having internal problems. Please try again later
WORKER_BUSY_TOO_LONG_RETRY Server workers are too busy right now due to Telegram having internal problems. Please try again later
WP_ID_GENERATE_FAILED Telegram is having internal problems. Please try again later
FILE_WRITE_FAILED Telegram is having internal problems. Please try again later
CHAT_FROM_CALL_CHANGED
WP_ID_GENERATE_FAILED Telegram is having internal problems. Please try again later
1 id message
38 SIGN_IN_FAILED Failure while signing in due to Telegram having internal problems. Please try again later
39 STORAGE_CHECK_FAILED Server storage check failed due to Telegram having internal problems. Please try again later
40 STORE_INVALID_SCALAR_TYPE Telegram is having internal problems. Please try again later
TIMEOUT A timeout occurred while fetching data from the worker
41 UNKNOWN_METHOD The method you tried to call cannot be called on non-CDN DCs
42 UPLOAD_NO_VOLUME Telegram is having internal problems. Please try again later
43 VOLUME_LOC_NOT_FOUND Telegram is having internal problems. Please try again later
44 WORKER_BUSY_TOO_LONG_RETRY Server workers are too busy right now due to Telegram having internal problems. Please try again later
45 WP_ID_GENERATE_FAILED Telegram is having internal problems. Please try again later
FILE_WRITE_FAILED Telegram is having internal problems. Please try again later
CHAT_FROM_CALL_CHANGED

View file

@ -1,4 +1,3 @@
id message
ApiCallError Telegram is having internal problems. Please try again later.
Timeout Telegram is having internal problems. Please try again later.
Timedout Telegram is having internal problems. Please try again later.
Timeout Telegram is having internal problems. Please try again later.
1 id message
2 ApiCallError Telegram is having internal problems. Please try again later.
3 Timeout Telegram is having internal problems. Please try again later.
Timedout Telegram is having internal problems. Please try again later.

6
dev-requirements.txt Normal file
View file

@ -0,0 +1,6 @@
-r requirements.txt
pytest
pytest-asyncio
pytest-cov
twine

8
docs/requirements.txt Normal file
View file

@ -0,0 +1,8 @@
pyston_lite-autoload
sphinx
sphinx_rtd_theme==1.0.0
sphinx-rtd-dark-mode
sphinx_copybutton
sphinx-autobuild
tgcrypto
sphinx-autobuild

View file

@ -1,7 +1,5 @@
.. raw:: html
<blockquote>
<strong>Usable by</strong>
<span class="usable-by"><i class="fa-solid fa-xmark" style="color: var(--color-red)"></i> Users</span>
<span class="usable-by"><i class="fa-solid fa-check" style="color: var(--color-green)"></i> Bots</span>
</blockquote>
<strong>Usable by</strong>
<span class="usable-by"><i class="fa-solid fa-xmark" style="color: var(--color-red)"></i> Users</span>
<span class="usable-by"><i class="fa-solid fa-check" style="color: var(--color-green)"></i> Bots</span>

View file

@ -1,7 +1,5 @@
.. raw:: html
<blockquote>
<strong>Usable by</strong>
<span class="usable-by"><i class="fa-solid fa-check" style="color: var(--color-green)"></i> Users</span>
<span class="usable-by"><i class="fa-solid fa-check" style="color: var(--color-green)"></i> Bots</span>
</blockquote>
<strong>Usable by</strong>
<span class="usable-by"><i class="fa-solid fa-check" style="color: var(--color-green)"></i> Users</span>
<span class="usable-by"><i class="fa-solid fa-check" style="color: var(--color-green)"></i> Bots</span>

View file

@ -1,7 +1,5 @@
.. raw:: html
<blockquote>
<strong>Usable by</strong>
<span class="usable-by"><i class="fa-solid fa-check" style="color: var(--color-green)"></i> Users</span>
<span class="usable-by"><i class="fa-solid fa-xmark" style="color: var(--color-red)"></i> Bots</span>
</blockquote>
<strong>Usable by</strong>
<span class="usable-by"><i class="fa-solid fa-check" style="color: var(--color-green)"></i> Users</span>
<span class="usable-by"><i class="fa-solid fa-xmark" style="color: var(--color-red)"></i> Bots</span>

View file

@ -1 +0,0 @@
@import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.2/css/all.min.css");

View file

@ -1,24 +0,0 @@
body{
--color-green: darkgreen;
--color-red: darkred;
}
.usable-by {
border: 1px ;
border-radius: .2em;
padding: 2px 5px;
background-color: #1a1c1e;
}
a .pre{
color:lightgrey;
}
.md-main a {
text-decoration: underline;
color:lightgrey;
}
.md-sidebar a {
text-decoration: none;
}

View file

@ -0,0 +1,3 @@
.pre{
color: #bfbfbf;
}

View file

@ -1,7 +1,7 @@
Pyrofork Client
PyroFork 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 PyroFork's API. The main Client
class, all available methods and types, filters, handlers, decorators and bound-methods detailed descriptions can be
found starting from this page.

View file

@ -35,28 +35,18 @@ Index
.. hlist::
:columns: 3
- :meth:`~Client.on_bot_business_connect`
- :meth:`~Client.on_message`
- :meth:`~Client.on_bot_business_message`
- :meth:`~Client.on_edited_message`
- :meth:`~Client.on_edited_bot_business_message`
- :meth:`~Client.on_callback_query`
- :meth:`~Client.on_shipping_query`
- :meth:`~Client.on_pre_checkout_query`
- :meth:`~Client.on_message_reaction_updated`
- :meth:`~Client.on_message_reaction_count_updated`
- :meth:`~Client.on_inline_query`
- :meth:`~Client.on_chosen_inline_result`
- :meth:`~Client.on_chat_member_updated`
- :meth:`~Client.on_chat_join_request`
- :meth:`~Client.on_deleted_messages`
- :meth:`~Client.on_deleted_bot_business_message`
- :meth:`~Client.on_user_status`
- :meth:`~Client.on_story`
- :meth:`~Client.on_poll`
- :meth:`~Client.on_disconnect`
- :meth:`~Client.on_raw_update`
- :meth:`~Client.on_error`
-----
@ -64,25 +54,15 @@ Details
-------
.. Decorators
.. autodecorator:: pyrogram.Client.on_bot_business_connect()
.. autodecorator:: pyrogram.Client.on_message()
.. autodecorator:: pyrogram.Client.on_bot_business_message()
.. autodecorator:: pyrogram.Client.on_edited_message()
.. autodecorator:: pyrogram.Client.on_edited_bot_business_message()
.. autodecorator:: pyrogram.Client.on_callback_query()
.. autodecorator:: pyrogram.Client.on_shipping_query()
.. autodecorator:: pyrogram.Client.on_pre_checkout_query()
.. autodecorator:: pyrogram.Client.on_message_reaction_updated()
.. autodecorator:: pyrogram.Client.on_message_reaction_count_updated()
.. autodecorator:: pyrogram.Client.on_inline_query()
.. autodecorator:: pyrogram.Client.on_chosen_inline_result()
.. autodecorator:: pyrogram.Client.on_chat_member_updated()
.. autodecorator:: pyrogram.Client.on_chat_join_request()
.. autodecorator:: pyrogram.Client.on_deleted_messages()
.. autodecorator:: pyrogram.Client.on_deleted_bot_business_message()
.. autodecorator:: pyrogram.Client.on_user_status()
.. autodecorator:: pyrogram.Client.on_story()
.. autodecorator:: pyrogram.Client.on_poll()
.. autodecorator:: pyrogram.Client.on_disconnect()
.. autodecorator:: pyrogram.Client.on_raw_update()
.. autodecorator:: pyrogram.Client.on_error()

View file

@ -1,8 +0,0 @@
BusinessSchedule
==========
.. autoclass:: pyrogram.enums.BusinessSchedule()
:members:
.. raw:: html
:file: ./cleanup.html

View file

@ -1,8 +0,0 @@
ChatJoinType
==========
.. autoclass:: pyrogram.enums.ChatJoinType()
:members:
.. raw:: html
:file: ./cleanup.html

View file

@ -1,8 +0,0 @@
ClientPlatform
==========
.. autoclass:: pyrogram.enums.ClientPlatform()
:members:
.. raw:: html
:file: ./cleanup.html

View file

@ -1,8 +0,0 @@
FolderColor
===========
.. autoclass:: pyrogram.enums.FolderColor()
:members:
.. raw:: html
:file: ./cleanup.html

View file

@ -1,8 +0,0 @@
GiftAttributeType
==========
.. autoclass:: pyrogram.enums.GiftAttributeType()
:members:
.. raw:: html
:file: ./cleanup.html

View file

@ -1,8 +0,0 @@
GiftAttributeType
=================
.. autoclass:: pyrogram.enums.GiftForResaleOrder()
:members:
.. raw:: html
:file: ./cleanup.html

View file

@ -1,8 +0,0 @@
ListenerTypes
=============
.. autoclass:: pyrogram.enums.ListenerTypes()
:members:
.. raw:: html
:file: ./cleanup.html

View file

@ -1,8 +0,0 @@
MessageOriginType
=================
.. autoclass:: pyrogram.enums.MessageOriginType()
:members:
.. raw:: html
:file: ./cleanup.html

View file

@ -1,8 +0,0 @@
ProfileColor
==========
.. autoclass:: pyrogram.enums.ProfileColor()
:members:
.. raw:: html
:file: ./cleanup.html

View file

@ -1,8 +0,0 @@
ReactionType
============
.. autoclass:: pyrogram.enums.ReactionType()
:members:
.. raw:: html
:file: ./cleanup.html

View file

@ -1,8 +0,0 @@
ReplyColor
==========
.. autoclass:: pyrogram.enums.ReplyColor()
:members:
.. raw:: html
:file: ./cleanup.html

View file

@ -1,8 +0,0 @@
StoriesPrivacyRules
===================
.. autoclass:: pyrogram.enums.StoriesPrivacyRules()
:members:
.. raw:: html
:file: ./cleanup.html

View file

@ -1,8 +0,0 @@
StoryPrivacy
============
.. autoclass:: pyrogram.enums.StoryPrivacy()
:members:
.. raw:: html
:file: ./cleanup.html

View file

@ -1,7 +1,7 @@
Enumerations
============
This page is about Pyrofork enumerations.
This page is about PyroFork enumerations.
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
to apply only a valid value among the expected ones.
@ -13,57 +13,35 @@ to apply only a valid value among the expected ones.
.. autosummary::
:nosignatures:
BusinessSchedule
ChatAction
ChatEventAction
ChatJoinType
ChatMemberStatus
ChatMembersFilter
ChatType
ClientPlatform
FolderColor
GiftAttributeType
ListenerTypes
MessageEntityType
MessageMediaType
MessageServiceType
MessagesFilter
ParseMode
PollType
ProfileColor
SentCodeType
NextCodeType
UserStatus
ReactionType
ReplyColor
StoriesPrivacyRules
StoryPrivacy
.. toctree::
:hidden:
BusinessSchedule
ChatAction
ChatEventAction
ChatJoinType
ChatMemberStatus
ChatMembersFilter
ChatType
ClientPlatform
FolderColor
GiftAttributeType
ListenerTypes
MessageEntityType
MessageMediaType
MessageServiceType
MessagesFilter
ParseMode
PollType
ProfileColor
SentCodeType
NextCodeType
UserStatus
ReactionType
ReplyColor
StoriesPrivacyRules
StoryPrivacy
UserStatus

View file

@ -1,8 +1,8 @@
RPC Errors
==========
All Pyrofork 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
All PyroFork 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
follow the usual *PascalCase* convention.
.. code-block:: python

View file

@ -1,7 +1,7 @@
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 PyroFork 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.
.. code-block:: python
@ -35,27 +35,17 @@ Index
.. hlist::
:columns: 3
- :class:`BotBusinessConnectHandler`
- :class:`MessageHandler`
- :class:`BotBusinessMessageHandler`
- :class:`EditedMessageHandler`
- :class:`EditedBotBusinessMessageHandler`
- :class:`DeletedMessagesHandler`
- :class:`DeletedBotBusinessMessagesHandler`
- :class:`CallbackQueryHandler`
- :class:`PreCheckoutQueryHandler`
- :class:`ShippingQueryHandler`
- :class:`MessageReactionUpdatedHandler`
- :class:`MessageReactionCountUpdatedHandler`
- :class:`InlineQueryHandler`
- :class:`ChosenInlineResultHandler`
- :class:`ChatMemberUpdatedHandler`
- :class:`UserStatusHandler`
- :class:`StoryHandler`
- :class:`PollHandler`
- :class:`DisconnectHandler`
- :class:`RawUpdateHandler`
- :class:`ErrorHandler`
-----
@ -63,24 +53,14 @@ Details
-------
.. Handlers
.. autoclass:: BotBusinessConnectHandler()
.. autoclass:: MessageHandler()
.. autoclass:: BotBusinessMessageHandler()
.. autoclass:: EditedMessageHandler()
.. autoclass:: EditedBotBusinessMessageHandler()
.. autoclass:: DeletedMessagesHandler()
.. autoclass:: DeletedBotBusinessMessagesHandler()
.. autoclass:: CallbackQueryHandler()
.. autoclass:: ShippingQueryHandler()
.. autoclass:: PreCheckoutQueryHandler()
.. autoclass:: MessageReactionUpdatedHandler()
.. autoclass:: MessageReactionCountUpdatedHandler()
.. autoclass:: InlineQueryHandler()
.. autoclass:: ChosenInlineResultHandler()
.. autoclass:: ChatMemberUpdatedHandler()
.. autoclass:: UserStatusHandler()
.. autoclass:: StoryHandler()
.. autoclass:: PollHandler()
.. autoclass:: DisconnectHandler()
.. autoclass:: RawUpdateHandler()
.. autoclass:: ErrorHandler()

View file

@ -1,21 +1,21 @@
# Pyrofork - Telegram MTProto API Client Library for Python
# PyroFork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan <https://github.com/delivrance>
# Copyright (C) 2022-present Mayuri-Chan <https://github.com/Mayuri-Chan>
# Copyright (C) 2022-present wulan17 <https://github.com/wulan17>
#
# This file is part of Pyrofork.
# This file is part of PyroFork.
#
# Pyrofork is free software: you can redistribute it and/or modify
# PyroFork is free software: you can redistribute it and/or modify
# 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
# (at your option) any later version.
#
# Pyrofork is distributed in the hope that it will be useful,
# PyroFork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# 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 PyroFork. If not, see <http://www.gnu.org/licenses/>.
import os
import sys
@ -28,9 +28,9 @@ from pygments.styles.friendly import FriendlyStyle
FriendlyStyle.background_color = "#f3f2f1"
project = "Pyrofork"
copyright = "2022-present, Mayuri-Chan"
author = "Mayuri-Chan"
project = "PyroFork"
copyright = f"2022-present, wulan17"
author = "wulan17"
version = ".".join(__version__.split(".")[:-1])
@ -40,7 +40,7 @@ extensions = [
"sphinx.ext.autosummary",
"sphinx.ext.intersphinx",
"sphinx_copybutton",
"sphinx_immaterial"
"sphinx_rtd_dark_mode"
]
intersphinx_mapping = {
@ -63,43 +63,18 @@ copybutton_prompt_text = "$ "
suppress_warnings = ["image.not_readable"]
html_title = "Pyrofork Documentation"
html_theme = "sphinx_immaterial"
html_title = "PyroFork Documentation"
html_theme = "sphinx_rtd_theme"
html_static_path = ["../resources/static","_static"]
html_show_sourcelink = True
html_show_copyright = False
html_theme_options = {
"icon": {
"repo": "fontawesome/brands/github",
"edit": "material/file-edit-outline",
},
"site_url": "https://pyrofork.wulan17.dev/",
"repo_url": "https://github.com/Mayuri-Chan/pyrofork/",
"repo_name": "pyrofork",
"globaltoc_collapse": True,
"features": [
"navigation.expand",
"navigation.tabs",
"navigation.sections",
"navigation.top",
"search.share",
"toc.follow",
"toc.sticky",
"content.tabs.link",
"announce.dismiss",
],
"palette": [
{
"media": "(prefers-color-scheme: dark)",
"scheme": "slate"
}
],
"toc_title_is_page_title": True,
"version_dropdown": True,
"version_info": [
{"version": "main", "title": "main", "aliases": ["latest"]},
{"version": "staging", "title": "staging", "aliases": []},
],
"canonical_url": "https://docs.pyrogram.org/",
"collapse_navigation": True,
"sticky_navigation": False,
"logo_only": True,
"display_version": False,
"style_external_links": True
}
html_logo = "../resources/static/img/pyrogram.png"
@ -118,6 +93,7 @@ latex_elements = {
}
html_css_files = [
"css/custom.css",
"css/all.min.css",
]
"css/my.css",
"https://docs.pyrogram.org/_static/css/custom.css",
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.2/css/all.min.css",
]

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
that can't be done because the way Pyrofork deals with handlers would make it hang.
that can't be done because the way PyroFork 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, PyroFork 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
and since Pyrofork needs to wait for your handler to finish, you are left with a deadlock.
and since PyroFork 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
code called asynchronously.

View file

@ -1,9 +1,9 @@
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 PyroFork, simply because there is no HTTP involved. However, a similar technique is
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
updates every time (polling), Pyrofork will sit down and wait for the server to send updates by itself the very moment
PyroFork 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
they are available (server push).

View file

@ -1,7 +1,7 @@
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 PyroFork and, to some extent, Telegram in general.
**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.
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 PyroFork 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
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:
- Use Pyrofork asynchronously in its intended way.
- Use PyroFork asynchronously in its intended way.
- Use shorter non-asynchronous processing loops.
- Use ``asyncio.sleep()`` instead of ``time.sleep()``.
- Use a stable network connection.

View file

@ -1,7 +1,7 @@
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
PyroFork 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`_).
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
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 PyroFork 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
another terminal altogether.

View file

@ -1,11 +1,12 @@
Welcome to Pyrofork
Welcome to PyroFork
===================
.. raw:: html
<div align="center">
<a href="/">
<h1 class="pyrogram-text pyrogram-text-index">PyroFork</h1>
<div class="pyrogram-logo-index"><img src="_static/pyrogram.png" alt="PyroFork"></div>
<div class="pyrogram-text pyrogram-text-index">PyroFork</div>
</a>
</div>
@ -13,24 +14,20 @@ Welcome to Pyrofork
<b>Telegram MTProto API Framework for Python</b>
<br>
<a href="https://github.com/Mayuri-Chan">
<a href="https://pyrogram.org">
Homepage
</a>
<a href="https://github.com/Mayuri-Chan/pyrofork">
<a href="https://github.com/pyrogram/pyrogram">
Development
</a>
<a href="https://github.com/Mayuri-Chan/pyrofork/issues">
Issues
<a href="https://docs.pyrogram.org/releases">
Releases
</a>
<a href="https://t.me/MayuriChan_Chat">
Support Chat
</a>
<a href="https://t.me/Pyrofork_CH">
News/Releases
<a href="https://t.me/pyrogram">
News
</a>
</p>
@ -43,21 +40,23 @@ Welcome to Pyrofork
@app.on_message(filters.private)
async def hello(client, message):
await message.reply("Hello from Pyrofork!")
await message.reply("Hello from PyroFork!")
app.run()
**Pyrofork** is a modern, elegant and asynchronous :doc:`MTProto API <topics/mtproto-vs-botapi>` framework.
**PyroFork** 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
(bot API alternative) using Python.
Support
-------
If you'd like to support Pyrofork, you can consider:
If you'd like to support PyroFork, you can consider:
- `Become a GitHub sponsor <https://github.com/sponsors/Mayuri-Chan>`_.
- `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>`_.
How the Documentation is Organized
----------------------------------
@ -76,7 +75,7 @@ First Steps
:columns: 1
- :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 PyroFork's methods.
- :doc:`Handling Updates <start/updates>`: How to handle Telegram updates.
- :doc:`Error Handling <start/errors>`: How to handle API errors correctly.
@ -86,7 +85,7 @@ API Reference
.. hlist::
:columns: 1
- :doc:`Pyrofork Client <api/client>`: Reference details about the Client class.
- :doc:`PyroFork Client <api/client>`: Reference details about the Client class.
- :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:`Enumerations <api/enums/index>`: List of available enumerations.
@ -98,8 +97,9 @@ Meta
.. hlist::
:columns: 1
- :doc:`Pyrofork FAQ <faq/index>`: Answers to common Pyrofork questions.
- :doc:`Support Pyrofork <support>`: Ways to show your appreciation.
- :doc:`PyroFork FAQ <faq/index>`: Answers to common PyroFork questions.
- :doc:`Support PyroFork <support>`: Ways to show your appreciation.
- :doc:`Release Notes <releases/index>`: Release notes for PyroFork releases.
.. toctree::
:hidden:
@ -161,6 +161,7 @@ Meta
faq/index
support
releases/index
.. toctree::
:hidden:
@ -168,4 +169,4 @@ Meta
telegram/functions/index
telegram/types/index
telegram/base/index
telegram/base/index

View file

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

View file

@ -1,9 +1,9 @@
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 PyroFork in action as fast as possible.
Get Pyrofork Real Fast
Get PyroFork Real Fast
----------------------
.. 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
`this link <https://hetzner.cloud/?ref=9CyT92gZEINU>`_ to get €20 in cloud credits.
1. Install Pyrofork with ``pip3 install -U pyrofork``.
1. Install PyroFork with ``pip3 install -U pyrogram``.
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 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 **PyroFork**!")
asyncio.run(main())
@ -42,7 +42,7 @@ Get Pyrofork Real Fast
7. Follow the instructions on your terminal to login.
8. Watch Pyrofork send a message to yourself.
8. Watch PyroFork send a message to yourself.
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
later to learn some more details.
.. _community: https://t.me/MayuriChan-Chat
.. _community: https://t.me/PyroFork

View file

@ -1,7 +1,7 @@
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 PyroFork to make
API calls. This section provides all the information you need in order to authorize yourself as user or bot.
.. contents:: Contents
@ -15,7 +15,7 @@ User Authorization
------------------
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
PyroFork 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
the :meth:`~pyrogram.Client.run` method:
@ -41,7 +41,7 @@ authorized or via SMS:
Enter phone code: 12345
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 PyroFork to
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.
@ -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
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 PyroFork, even when using bots.
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

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.
Pyrofork errors all live inside the ``errors`` package:
PyroFork errors all live inside the ``errors`` package:
.. code-block:: python
@ -33,7 +33,7 @@ This error is raised every time a method call against Telegram's API was unsucce
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, PyroFork
provides categories of errors, which are named after the common HTTP errors and are subclass-ed from the ``RPCError``:
.. code-block:: python
@ -51,7 +51,7 @@ provides categories of errors, which are named after the common HTTP errors and
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, PyroFork does also expose errors that deal each with a specific
issue. For example:
.. code-block:: python
@ -77,7 +77,7 @@ These errors subclass directly from the category of errors they belong to, which
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 PyroFork 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
whole category of errors and be sure to also handle these unknown errors.

View file

@ -47,7 +47,7 @@ like send_audio(), send_document(), send_location(), etc...
),
InlineKeyboardButton( # Opens a web URL
"URL",
url="https://pyrofork.wulan17.dev"
url="https://docs.pyrogram.org"
),
],
[ # Second row

View file

@ -14,7 +14,7 @@ This example demonstrates a basic API usage
async def main():
async with app:
# 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 **PyroFork**")
app.run(main())

View file

@ -1,7 +1,7 @@
Examples
========
This page contains example scripts to show you how Pyrofork looks like.
This page contains example scripts to show you how PyroFork looks like.
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.
@ -18,7 +18,7 @@ to give you a basic idea.
:doc:`hello_world`, "Demonstration of basic API usage"
:doc:`echo_bot`, "Echo every private text message"
:doc:`welcome_bot`, "The Welcome Bot in @PyroforkChat"
:doc:`welcome_bot`, "The Welcome Bot in @PyroForkChat"
: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_dialogs`, "Get all of your dialog chats"

View file

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

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 = -100123456789
# Welcome message template
MESSAGE = "{} Welcome to [Pyrofork](https://pyrofork.wulan17.dev/)'s group chat {}!"
MESSAGE = "{} Welcome to [PyroFork](https://docs.pyrogram.org/)'s group chat {}!"
app = Client("my_account")

View file

@ -1,7 +1,7 @@
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 PyroFork <../intro/install>` and :doc:`authorized <auth>` our
account; we are now aiming towards the core of the framework.
.. contents:: Contents
@ -14,7 +14,7 @@ account; we are now aiming towards the core of the framework.
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 PyroFork is very simple. Here's a basic example we are going to examine step by step:
.. code-block:: python
@ -55,7 +55,7 @@ Step-by-step
async with app:
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 PyroFork's :meth:`~pyrogram.Client.run`
method.
.. code-block:: python

View file

@ -1,7 +1,7 @@
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 PyroFork <../intro/install>`. In this page we'll discuss what you need to do in order to set up a
project with the framework.
.. contents:: Contents
@ -28,7 +28,7 @@ The first step requires you to obtain a valid Telegram API key (api_id and api_h
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 PyroFork project: pass your API key to PyroFork by using the *api_id* and *api_hash* parameters of the Client class:
.. code-block:: python

View file

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

View file

@ -1,4 +1,4 @@
Support Pyrofork
Support PyroFork
================
.. raw:: html
@ -10,34 +10,23 @@ Support Pyrofork
href="https://github.com/Mayuri-Chan/pyrofork"
data-color-scheme="no-preference: light; light: light; dark: dark;"
data-icon="octicon-star" data-size="large" data-show-count="true"
aria-label="Star Mayuri-Chan/pyrofork on GitHub">Star</a>
aria-label="Star pyrogram/pyrogram on GitHub">Star</a>
<a class="github-button"
href="https://github.com/Mayuri-Chan/pyrofork/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 Mayuri-Chan/pyrofok on GitHub">Fork</a>
data-show-count="true" aria-label="Fork pyrogram/pyrogram on GitHub">Fork</a>
</div>
<br style="clear: both"/>
Pyrofork is a free and open source project.
If you enjoy Pyrofork 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:
PyroFork is a free and open source project.
If you enjoy PyroFork 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:
-----
GitHub Sponsor
--------------
`Become a GitHub sponsor <https://github.com/sponsors/Mayuri-Chan>`_.
.. raw:: html
<a class="github-button"
href="https://github.com/sponsors/Mayuri-Chan"
data-color-scheme="no-preference: light; light: light; dark: dark;"
data-icon="octicon-heart" data-size="large"
aria-label="Sponsor @Mayuri-Chan on GitHub">Sponsor</a>
-----
<script src="https://opencollective.com/pyrogram/banner.js"></script>

View file

@ -1,10 +1,10 @@
Advanced Usage
==============
Pyrofork's API -- which consists of well documented :doc:`methods <../api/methods/index>` and
PyroFork'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.
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 PyroFork: the main "raw"
Telegram API with its functions and types.
.. contents:: Contents
@ -25,12 +25,12 @@ take into consideration when working with the raw API.
.. tip::
Every available high-level method in Pyrofork is built on top of these raw functions.
Every available high-level method in PyroFork is built on top of these raw 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 PyroFork'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.
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.
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. PyroFork allows
sending messages with IDs only thanks to cached access hashes.
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.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 PyroFork already provides
:meth:`~pyrogram.Client.resolve_peer` as a convenience utility method that returns the correct InputPeer
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
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
collisions, and that's why Pyrofork uses a slightly different representation for each kind of ID.
Things are different when working with PyroFork'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.
For example, given the ID *123456789*, here's how Pyrofork can tell entities apart:
For example, given the ID *123456789*, here's how PyroFork can tell entities apart:
- ``+ID`` User: *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
high-level method.
.. _Community: https://t.me/MayuriChan-Chat
.. _Community: https://t.me/PyroFork

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:
- Device Model: ``CPython x.y.z``
- Application: ``Pyrofork x.y.z``
- Application: ``PyroFork x.y.z``
- System Version: ``Linux x.y.z``
.. contents:: Contents

View file

@ -1,7 +1,7 @@
Creating Filters
================
Pyrofork already provides lots of built-in :class:`~pyrogram.filters` to work with, but in case you can't find a
PyroFork 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
:meth:`filters.create() <pyrogram.filters.create>`.
@ -27,7 +27,7 @@ button:
await app.send_message(
"username", # Change this to your username or id
"Pyrofork custom filter test",
"PyroFork custom filter test",
reply_markup=InlineKeyboardMarkup(
[[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
to actually worry about since Pyrofork provides some commodities to help you in this.
to actually worry about since PyroFork provides some commodities to help you in this.
.. contents:: Contents
:backlinks: none
@ -19,7 +19,7 @@ Caveman Debugging
-- 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
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. PyroFork goodness in this
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.
@ -46,7 +46,7 @@ This will show a JSON representation of the object returned by :meth:`~pyrogram.
"is_verified": false,
"is_restricted": false,
"is_support": false,
"first_name": "Pyrofork",
"first_name": "PyroFork",
"photo": {
"_": "ChatPhoto",
"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, PyroFork 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.
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 PyroFork types are
fully-fledged Python objects and the correct way to access any attribute of them is by using the dot notation ``.``:
.. 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
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, PyroFork will still
continue to propagate the same update to the next groups until all the handlers are done. Example:
.. code-block:: python

View file

@ -1,9 +1,9 @@
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
API. This means that Pyrofork 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
PyroFork 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
therefore show you why PyroFork 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.
.. 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
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
Pyrofork, implement all these details.
PyroFork, implement all these details.
.. _MTProto: https://core.telegram.org/mtproto
.. _binary data serialized: https://core.telegram.org/mtproto/serialize
@ -45,8 +45,8 @@ servers using MTProto.
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
the official HTTP Bot API. Using Pyrofork you can:
Here is a non-exhaustive list of all the advantages in using MTProto-based libraries -- such as PyroFork -- instead of
the official HTTP Bot API. Using PyroFork you can:
.. hlist::
:columns: 1

View file

@ -1,7 +1,7 @@
Proxy Settings
==============
Pyrofork supports proxies with and without authentication. This feature allows Pyrofork to exchange data with Telegram
PyroFork supports proxies with and without authentication. This feature allows PyroFork to exchange data with Telegram
through an intermediate SOCKS 4/5 or HTTP (CONNECT) proxy server.
.. contents:: Contents
@ -14,7 +14,7 @@ through an intermediate SOCKS 4/5 or HTTP (CONNECT) proxy server.
Usage
-----
To use Pyrofork with a proxy, use the *proxy* parameter in the Client class. If your proxy doesn't require authorization
To use PyroFork with a proxy, use the *proxy* parameter in the Client class. If your proxy doesn't require authorization
you can omit ``username`` and ``password``.
.. 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
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 PyroFork with ``apscheduler`` in both asynchronous and
non-asynchronous contexts. For more detailed information, you can visit and learn from the library documentation.
.. contents:: Contents

View file

@ -1,8 +1,8 @@
Object Serialization
====================
Serializing means converting a Pyrofork 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
Serializing means converting a PyroFork 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
humans and another more compact for machines that is able to recover the original structures.
.. contents:: Contents
@ -28,7 +28,7 @@ If you want a nicely formatted, human readable JSON representation of any object
.. tip::
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 PyroFork object to JSON.
For Machines - repr(obj)
------------------------
@ -53,4 +53,4 @@ as the process requires the package to be in scope.
.. note::
Type definitions are subject to changes between versions. You should make sure to store and load objects using the
same Pyrofork version.
same PyroFork version.

View file

@ -1,9 +1,9 @@
Smart Plugins
=============
Pyrofork embeds a smart, lightweight yet powerful plugin system that is meant to further simplify the organization
PyroFork 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
different Pyrofork applications with minimal boilerplate code.
different PyroFork applications with minimal boilerplate code.
.. 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
text message you sent and the other containing the reversed text message.
Example: *"Pyrofork"* replies with *"Pyrofork"* and *"margoryP"*
Example: *"PyroFork"* replies with *"PyroFork"* and *"margoryP"*
.. 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
-------------------
Setting up your Pyrofork project to accommodate Smart Plugins is pretty straightforward:
Setting up your PyroFork project to accommodate Smart Plugins is pretty straightforward:
#. 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.
@ -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
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 *root* value must match the name of your plugins root folder. Your Pyrofork Client instance will **automatically**
The second thing is telling PyroFork 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**
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

View file

@ -1,7 +1,7 @@
Speedups
========
Pyrofork's speed can be boosted up by using TgCrypto and uvloop.
PyroFork's speed can be boosted up by using TgCrypto and uvloop.
.. contents:: Contents
:backlinks: none
@ -10,10 +10,10 @@ Pyrofork's speed can be boosted up by using TgCrypto and uvloop.
-----
TgCrypto-pyrofork
TgCrypto
--------
TgCrypto-pyrofork_ 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 PyroFork as a Python
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.
@ -22,12 +22,12 @@ Installation
.. code-block:: bash
$ pip3 install -U tgcrypto-pyrofork
$ pip3 install -U tgcrypto
Usage
^^^^^
Pyrofork will automatically make use of TgCrypto when detected, all you need to do is to install it.
PyroFork will automatically make use of TgCrypto when detected, all you need to do is to install it.
uvloop
------

View file

@ -1,7 +1,7 @@
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, PyroFork
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.
@ -16,12 +16,12 @@ Persisting Sessions
-------------------
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, PyroFork needs to store the generated session data somewhere.
Different Storage Engines
-------------------------
Pyrofork offers two different types of storage engines: a **File Storage** and a **Memory Storage**.
PyroFork 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:
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())
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 PyroFork search for a file named that way and the
session database will be automatically loaded.
Memory Storage
@ -67,42 +67,17 @@ Mongodb Storage
In case you want to have persistent session but you don't have persistent storage you can use mongodb storage by passing
mongodb config as ``dict`` to the ``mongodb`` parameter of the :obj:`~pyrogram.Client` constructor:
Using async_pymongo (Recommended for python3.9+):
.. code-block:: python
from async_pymongo import AsyncClient
from pyrogram import Client
conn = AsyncClient("mongodb://...")
async with Client("my_account", mongodb=dict(connection=conn, remove_peers=False)) as app:
print(await app.get_me())
Using official mongodb driver:
.. code-block:: python
from pymongo import AsyncMongoClient
from pyrogram import Client
conn = AsyncMongoClient("mongodb://...")
async with Client("my_account", mongodb=dict(connection=conn, remove_peers=False)) as app:
print(await app.get_me())
Using motor (Deprecated, but still works):
.. code-block:: python
from motor.motor_asyncio import AsyncIOMotorClient
from pyrogram import Client
conn = AsyncIOMotorClient("mongodb://...")
async with Client("my_account", mongodb=dict(connection=conn, remove_peers=False)) as app:
# uri (``str``):
# mongodb database uri
# db_name (``str``, *optional*):
# custom database name, default = pyrofork-session
# remove_peers (``bool``, *optional*):
# remove peers collection on logout, default = False
async with Client("my_account", mongodb=dict(uri="mongodb://...", db_name="pyrofork-session", remove_peers=False)) as app:
print(await app.get_me())
This storage engine is backed by MongoDB, a session will be created and saved to mongodb database. Any subsequent client
@ -133,5 +108,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:
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 PyroFork clients on platforms where their ephemeral
filesystems makes it harder for a file-based storage engine to properly work as intended.

View file

@ -1,13 +1,13 @@
Synchronous Usage
=================
Pyrofork is an asynchronous framework and as such is subject to the asynchronous rules. It can, however, run in
PyroFork 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
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**.
You can use Pyrofork 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.
You can use PyroFork 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.
.. warning::
@ -26,7 +26,7 @@ Synchronous Invocations
-----------------------
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.
PyroFork is being used inside the main function with its asynchronous interface.
.. code-block:: python
@ -43,7 +43,7 @@ Pyrofork is being used inside the main function with its asynchronous interface.
asyncio.run(main())
To run Pyrofork synchronously, use the non-async context manager as shown in the following example.
To run PyroFork synchronously, use the non-async context manager as shown in the following example.
As you can see, the non-async example becomes less cluttered.
.. code-block:: python
@ -75,8 +75,8 @@ possible.
uvloop usage
------------
When using Pyrofork in its synchronous mode combined with uvloop, you need to call ``uvloop.install()`` before importing
Pyrofork.
When using PyroFork in its synchronous mode combined with uvloop, you need to call ``uvloop.install()`` before importing
PyroFork.
.. code-block:: python

View file

@ -1,7 +1,7 @@
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, PyroFork 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
``test_mode=True``:

View file

@ -13,7 +13,7 @@ Text Formatting
.. role:: strike-italic
:class: strike-italic
Pyrofork uses a custom Markdown dialect for text formatting which adds some unique features that make writing styled
PyroFork 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
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
list of the basic styles currently supported by Pyrofork.
list of the basic styles currently supported by PyroFork.
- **bold**
- *italic*
@ -37,106 +37,16 @@ list of the basic styles currently supported by Pyrofork.
- spoiler
- `text URL <https://pyrogram.org>`_
- `user text mention <tg://user?id=123456789>`_
- :emoji:`🔥`
- ``inline fixed-width code``
- .. code-block:: text
pre-formatted
fixed-width
code block
- > Quoted text
- > Quoted text with collapse/expand button
HTML Style
----------
To strictly use this mode, pass :obj:`~pyrogram.enums.HTML` to the *parse_mode* parameter when using
:meth:`~pyrogram.Client.send_message`. The following tags are currently supported:
.. code-block:: text
<b>bold</b>, <strong>bold</strong>
<i>italic</i>, <em>italic</em>
<u>underline</u>
<s>strike</s>, <del>strike</del>, <strike>strike</strike>
<spoiler>spoiler</spoiler>
<a href="https://pyrogram.org/">text URL</a>
<a href="tg://user?id=123456789">inline mention</a>
<emoji id="12345678901234567890">🔥</emoji>
<code>inline fixed-width code</code>
<pre>
pre-formatted
fixed-width
code block
</pre>
<blockquote>Quoted text</blockquote>
<blockquote expandable>Quoted text with collapse/expand button</blockquote>
**Example**:
.. code-block:: python
from pyrogram import enums
await app.send_message(
"me",
(
"<b>bold</b>, "
"<i>italic</i>, "
"<u>underline</u>, "
"<s>strike</s>, "
"<spoiler>spoiler</spoiler>, "
"<a href=\"https://pyrogram.org/\">URL</a>, "
"<code>code</code>\n\n"
"<pre>"
"for i in range(10):\n"
" print(i)"
"</pre>"
"<blockquote>quote</blockquote>"
),
parse_mode=enums.ParseMode.HTML
)
.. note::
All ``<``, ``>`` and ``&`` symbols that are not a part of a tag or an HTML entity must be replaced with the
corresponding HTML entities (``<`` with ``&lt;``, ``>`` with ``&gt;`` and ``&`` with ``&amp;``). You can use this
snippet to quickly escape those characters:
.. code-block:: python
import html
text = "<my text>"
text = html.escape(text)
print(text)
.. code-block:: text
&lt;my text&gt;
Markdown Style
--------------
.. warning::
The Markdown style is not recommended for complex text formatting.
If you want to use complex text formatting such as nested entities, overlapping entities use the HTML style instead.
To strictly use this mode, pass :obj:`~pyrogram.enums.ParseMode.MARKDOWN` to the *parse_mode* parameter when using
:meth:`~pyrogram.Client.send_message`. Use the following syntax in your message:
@ -156,8 +66,6 @@ To strictly use this mode, pass :obj:`~pyrogram.enums.ParseMode.MARKDOWN` to the
[text user mention](tg://user?id=123456789)
![🔥](tg://emoji?id=12345678901234567890)
`inline fixed-width code`
```
@ -166,10 +74,6 @@ To strictly use this mode, pass :obj:`~pyrogram.enums.ParseMode.MARKDOWN` to the
code block
```
> Quoted text
**> Quoted text with collapse/expand button
**Example**:
.. code-block:: python
@ -194,6 +98,81 @@ To strictly use this mode, pass :obj:`~pyrogram.enums.ParseMode.MARKDOWN` to the
parse_mode=enums.ParseMode.MARKDOWN
)
HTML Style
----------
To strictly use this mode, pass :obj:`~pyrogram.enums.HTML` to the *parse_mode* parameter when using
:meth:`~pyrogram.Client.send_message`. The following tags are currently supported:
.. code-block:: text
<b>bold</b>, <strong>bold</strong>
<i>italic</i>, <em>italic</em>
<u>underline</u>
<s>strike</s>, <del>strike</del>, <strike>strike</strike>
<spoiler>spoiler</spoiler>
<a href="https://pyrogram.org/">text URL</a>
<a href="tg://user?id=123456789">inline mention</a>
<code>inline fixed-width code</code>
<emoji id="12345678901234567890">🔥</emoji>
<pre>
pre-formatted
fixed-width
code block
</pre>
**Example**:
.. code-block:: python
from pyrogram import enums
await app.send_message(
"me",
(
"<b>bold</b>, "
"<i>italic</i>, "
"<u>underline</u>, "
"<s>strike</s>, "
"<spoiler>spoiler</spoiler>, "
"<a href=\"https://pyrogram.org/\">URL</a>, "
"<code>code</code>\n\n"
"<pre>"
"for i in range(10):\n"
" print(i)"
"</pre>"
),
parse_mode=enums.ParseMode.HTML
)
.. note::
All ``<``, ``>`` and ``&`` symbols that are not a part of a tag or an HTML entity must be replaced with the
corresponding HTML entities (``<`` with ``&lt;``, ``>`` with ``&gt;`` and ``&`` with ``&amp;``). You can use this
snippet to quickly escape those characters:
.. code-block:: python
import html
text = "<my text>"
text = html.escape(text)
print(text)
.. code-block:: text
&lt;my text&gt;
Different Styles
----------------
@ -246,18 +225,18 @@ strike` styles, and you can still combine both Markdown and HTML together.
Here there are some example texts you can try sending:
**Markdown**:
- ``**bold, --underline--**``
- ``**bold __italic --underline ~~strike~~--__**``
- ``**bold __and** italic__``
**HTML**:
- ``<b>bold, <u>underline</u></b>``
- ``<b>bold <i>italic <u>underline <s>strike</s></u></i></b>``
- ``<b>bold <i>and</b> italic</i>``
**Markdown (Not Recommended)**:
- ``**bold, --underline--**``
- ``**bold __italic --underline ~~strike~~--__**``
- ``**bold __and** italic__``
**Combined**:
- ``--you can combine <i>HTML</i> with **Markdown**--``

View file

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

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
with Pyrofork.
with PyroFork.
Libraries
---------

View file

@ -1,40 +0,0 @@
# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2023-present Hydrogram <https://hydrogram.org>
# Copyright (C) 2022-present Mayuri-Chan <https://github.com/Mayuri-Chan>
#
# This file is part of Pyrofork.
#
# Pyrofork is free software: you can redistribute it and/or modify
# 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
# (at your option) any later version.
#
# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrofork. If not, see <http://www.gnu.org/licenses/>.
import sys
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
# Add the current directory to the path, so we can import the compiler.
sys.path.insert(0, ".")
class CustomHook(BuildHookInterface):
"""A custom build hook for pyrofork."""
def initialize(self, version, build_data):
"""Initialize the hook."""
if self.target_name not in ["wheel", "install"]:
return
from compiler.api.compiler import start as compile_api
from compiler.errors.compiler import start as compile_errors
compile_api()
compile_errors()

View file

@ -1,93 +0,0 @@
[project]
name = "pyrofork"
dynamic = ["version"]
description = "Fork of pyrogram. Elegant, modern and asynchronous Telegram MTProto API framework in Python for users and bots"
authors = [{ name = "wulan17", email = "mayuri@mayuri.my.id" }]
dependencies = ["pyaes==1.6.1", "pysocks==1.7.1", "pymediainfo-pyrofork>=6.0.1,<7.0.0"]
readme = "README.md"
license = "LGPL-3.0-or-later"
requires-python = "~=3.10"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Natural Language :: English",
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Implementation",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Internet",
"Topic :: Communications",
"Topic :: Communications :: Chat",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Libraries :: Application Frameworks",
]
keywords = ["telegram chat messenger mtproto api client library python"]
[tool.hatch.version]
path = "pyrogram/__init__.py"
# Used to call hatch_build.py
[tool.hatch.build.hooks.custom]
[project.urls]
Homepage = "https://github.com/Mayuri-Chan"
Tracker = "https://github.com/Mayuri-Chan/pyrofork/issues"
Community = "https://t.me/MayuriChan_Chat"
Source = "https://github.com/Mayuri-Chan/pyrofork"
Documentation = "https://pyrofork.wulan17.dev"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project.optional-dependencies]
dev = [
"hatch>=1.7.0",
"pytest>=7.4.3",
"pytest-asyncio>=0.21.1",
"pytest-cov>=4.1.0",
"twine>=4.0.2"
]
docs = [
"sphinx",
"sphinx-immaterial==0.12.5",
"sphinx_copybutton",
"sphinx-autobuild",
"tornado>=6.3.3"
]
speedup = [
"tgcrypto-pyrofork>=1.2.6",
"uvloop>=0.19.0"
]
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.build.targets.sdist]
exclude = [
".github/",
"docs/",
"tests/",
".editorconfig",
".gitignore",
".pre-commit-config.yaml",
"CODE_OF_CONDUCT.rst",
"CONTRIBUTING.rst",
"requirements.lock",
"requirements-dev.lock",
]
[tool.hatch.build.targets.wheel]
ignore-vcs = true
packages = ["pyrogram"]

View file

@ -1,26 +1,25 @@
# 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) 2022-present Mayuri-Chan <https://github.com/Mayuri-Chan>
#
# 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
# by the Free Software Foundation, either version 3 of the License, or
# (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
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# 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/>.
__fork_name__ = "PyroFork"
__version__ = "2.3.69"
__version__ = "2.1.8"
__license__ = "GNU Lesser General Public License v3.0 (LGPL-3.0)"
__copyright__ = "Copyright (C) 2022-present Mayuri-Chan <https://github.com/Mayuri-Chan>"
__copyright__ = "Copyright (C) 2017-present Dan <https://github.com/delivrance>"
from concurrent.futures.thread import ThreadPoolExecutor
@ -37,24 +36,8 @@ class ContinuePropagation(StopAsyncIteration):
pass
from . import raw, types, filters, handlers, emoji, enums # pylint: disable=wrong-import-position
from .client import Client # pylint: disable=wrong-import-position
from .sync import idle, compose # pylint: disable=wrong-import-position
from . import raw, types, filters, handlers, emoji, enums
from .client import Client
from .sync import idle, compose
crypto_executor = ThreadPoolExecutor(1, thread_name_prefix="CryptoWorker")
__all__ = [
"Client",
"idle",
"compose",
"crypto_executor",
"StopTransmission",
"StopPropagation",
"ContinuePropagation",
"raw",
"types",
"filters",
"handlers",
"emoji",
"enums",
]

Some files were not shown because too many files have changed in this diff Show more