Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
a7a0a1c
Update API scheme to layer 195. (v4)
null-nick Dec 9, 2024
a0321d1
Update API scheme to layer 196.
null-nick Dec 9, 2024
feaea87
Update API scheme to layer 196.
null-nick Dec 29, 2024
57f6e5a
Merge remote-tracking branch 'origin/main' into beta
null-nick Jan 24, 2025
e44b98a
Update API scheme to layer 198.
null-nick Jan 24, 2025
e982b5a
(fix): AttributeError: module 'pyrogram.raw.types' has no attribute '…
null-nick Jan 24, 2025
c0097d3
Fix peerid invalid maybe. (#34)
annihilatorrrr Jan 24, 2025
cddf745
Merge branch 'main' into beta
null-nick Feb 22, 2025
d00ff1c
Update API scheme to layer 200.
null-nick Feb 28, 2025
5b6e0c7
Merge remote-tracking branch 'origin/main' into dev
null-nick Mar 23, 2025
d022379
Update API scheme to layer 201.
null-nick Mar 23, 2025
537f444
Update API scheme to layer 202.
null-nick May 2, 2025
c625ec4
Update API scheme to layer 203.
null-nick May 6, 2025
d9fdab3
Update API scheme to layer 203.
null-nick May 8, 2025
c38769f
fixed type hinting on raw methods
null-nick May 13, 2025
ee4e976
Update API scheme to layer 203.
null-nick May 13, 2025
1881777
Merge branch 'main' into dev
null-nick May 28, 2025
8ba7456
Update API scheme to layer 204.
null-nick May 28, 2025
e395ccc
Merge branch 'main' into dev
null-nick Jul 22, 2025
0834550
Update API scheme to layer 210.
null-nick Jul 22, 2025
7eb6bae
Update API scheme to layer 211.
null-nick Jul 31, 2025
e34c95b
Merge branch 'main' into dev
null-nick Sep 6, 2025
90cc96b
first implementation of download boost
null-nick Sep 6, 2025
e93b620
Update API scheme to layer 216.
null-nick Sep 30, 2025
357580f
Update API scheme to layer 216. (fixes)
null-nick Oct 3, 2025
985d4d2
attempt to add support for python 3.13
null-nick Oct 5, 2025
e246026
attempt pt.2
null-nick Oct 5, 2025
60dc8e0
Update API scheme to layer 216.
null-nick Oct 11, 2025
3d8b830
Merge branch 'main' into dev
null-nick Oct 11, 2025
352740f
fixes
null-nick Oct 11, 2025
7f2fe1a
Version Bump
null-nick Oct 11, 2025
a13b417
Merge branch 'main' into dev
null-nick Oct 13, 2025
4cda905
Update API scheme to layer 216.
Oct 13, 2025
71ab613
added `tagall` into makefile
Oct 13, 2025
bbf7c0c
Add send_streaming_text method for bots
Oct 21, 2025
88da0be
fixed `message_thread_id`
Oct 21, 2025
6915195
Add generic return type for method `invoke`
Oct 21, 2025
bf5383e
Add support for peer color and new chat/user fields
Oct 21, 2025
879bdfc
Add new error messages to TSV sources
Oct 21, 2025
d2f4fbd
Add streaming text example and update send_streaming_text
Oct 21, 2025
090b74e
Allow `send_streaming_text` to accept a single string
Oct 21, 2025
9b1d564
fix python3.14 support
Nov 1, 2025
c1b1731
test
Nov 1, 2025
3992515
Update API scheme to layer 217.
Nov 1, 2025
c34a169
fixed some issue with async, asyncio etc
Nov 1, 2025
25fecf9
fixed https://github.com/PyrogramMod/PyrogramMod/issues/36
Nov 1, 2025
0d59c51
Update API scheme to layer 217.
Nov 7, 2025
90cce9b
Update API scheme to layer 221.
Dec 30, 2025
339f70e
Update API scheme to layer 221.
Jan 3, 2026
020dc7f
Update API scheme to layer 221.
Jan 6, 2026
f034850
Update API scheme to layer 224.
Jan 29, 2026
d1ce977
Implement types for Layer 224 features.
Jan 29, 2026
3ad1b24
Add examples for Layer 224 features.
Jan 30, 2026
78b6c29
Fix type hints and parameters for styled inline keyboards.
Jan 30, 2026
01cbc36
fixes for python3.14
Feb 5, 2026
cf23438
Update API scheme to layer 223.
Feb 24, 2026
3263fc5
Update API scheme to layer 223.
Mar 1, 2026
4d96970
Update API scheme to layer 224.
Mar 27, 2026
ce60557
Update API scheme to layer 224. (v2)
Mar 28, 2026
a5c8ced
fixed https://t.me/pyrogramodchat/805
Mar 28, 2026
6d7f49d
attempt fixes for `https://t.me/pyrogramodchat/814` `https://t.me/pyr…
May 4, 2026
2fcd10a
Update API scheme to layer 225.
May 4, 2026
cba5dc9
added new message entity types
May 4, 2026
3b3d90f
fix(session): prevent reconnect deadlock that froze the event loop
Jun 1, 2026
2e9a2da
Update API scheme to layer 227.
Jun 4, 2026
c00e76f
feat(layer227): add new methods and expand ChatPermissions
Jun 4, 2026
f464583
feat(types): add missing bot fields to User, guard_bot_id to Chat
Jun 4, 2026
4744e4e
feat(privileges): add can_manage_direct_messages and can_manage_ranks
Jun 4, 2026
3ba7a61
feat(guard-bot): full guard bot query system
Jun 4, 2026
c56a31c
fix(session): reschedule restart when reconnect attempt fails
Jun 9, 2026
969ed45
Update API scheme to layer 227. (v2)
Jun 12, 2026
a33ef5a
build: migrate to uv, drop Python 3.9
Jun 12, 2026
84c4598
fix(compiler): remove legacy pagelistitemblocks.226 and fix makedirs …
Jun 12, 2026
d4955f9
feat(bot-api-10.1): implement Rich Messages, Join Request Queries and…
Jun 12, 2026
3611451
fix(methods): correct TL namespaces and InputUser conversion
Jun 12, 2026
95b4c01
chore(docs): regenerate docs.json for layer 225
Jun 12, 2026
017e42c
ci: migrate scrape-errors workflow to uv
Jun 12, 2026
26d8e89
ci(scrape-errors): fix uv pip --system on managed interpreter
Jun 12, 2026
0f3d51c
Update API scheme to layer 228.
Jun 26, 2026
1d75fbf
feat(layer-228): implement Communities, Ephemeral messages and layer …
Jun 26, 2026
3acbe41
docs(compiler): add layer 227-228 methods to docs categories
Jun 26, 2026
f1e27dd
update docs
Jun 26, 2026
74d733f
docs: add release notes section with RST pages for all versions
Jun 27, 2026
a51367d
docs: add VoIP referral section and fix PyrogramMod branding in suppo…
Jun 28, 2026
7e5bd56
docs: update VoIP referral code to PYRO
Jun 28, 2026
22b87ef
docs: remove delivrance sponsor links, keep only VoIP referral
Jun 28, 2026
a0401b4
fix(send_message): pass ephemeral_receiver_bot_id=0 to messages.SendM…
Jun 30, 2026
f3054e6
feat(layer228): sync TL schema and high-level types
Jul 12, 2026
e3bfc75
feat(transfer): add use_experimental_upload_boost and client-level bo…
Jul 12, 2026
55765ec
feat(send_message): add LinkPreviewOptions and link_preview_options p…
Jul 12, 2026
d0dd4bf
feat(edit_message_text): add link_preview_options parameter
Jul 12, 2026
6178df5
feat(send_*): add message_effect_id parameter to all send methods
Jul 12, 2026
1972df6
fix(session): wait for reconnect before retrying on OSError
Jul 12, 2026
af22a80
feat(communities): add add_chat_to_community() helper method
Jul 12, 2026
308dae3
fix(communities): resolve community IDs via joined-communities lookup
Jul 12, 2026
b425ad3
Add PEER_LINK_NOT_MODIFIED error and document community method raises
Jul 12, 2026
eb6b466
Document ChatAdminRequired in all community methods
Jul 12, 2026
2909002
temporary revert to layer 228 from https://github.com/telegramdesktop…
Jul 12, 2026
66d39c1
Replace t.me links with telegram.me across codebase and docs
Jul 14, 2026
2b13b04
Add ephemeral.editMessage and updateEphemeralBotCallbackQuery to TL s…
Jul 14, 2026
3e178a0
Add monoforum (Direct Messages) high-level methods
Jul 14, 2026
28e5551
Add ephemeral message edit methods and finalize v2.4.0 release notes
Jul 14, 2026
93ac7d3
Bump version to 2.4.0
Jul 14, 2026
61f7807
Merge branch 'main' into dev
null-nick Jul 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 8 additions & 13 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,24 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["3.10", "3.11", "3.12", "3.13"]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"

- name: Upgrade pip and install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade tox wheel setuptools
- name: Install dependencies
run: uv sync --extra dev

- name: Generate API
run: |
make venv
make api
run: make api

- name: Run tests with tox
- name: Run tests
env:
PYTHONWARNINGS: "ignore"
run: tox
run: uv run pytest
22 changes: 9 additions & 13 deletions .github/workflows/scrape-errors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,29 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Set up Python 3.9
uses: actions/setup-python@v3
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: '3.9'
python-version: "3.10"

- name: Install Python dependencies and run scripts
run: |
set -e # Exit immediately if a command exits with a non-zero status
echo "-------------------- Installing dependencies --------------------"
cd compiler/errors/
python -m pip install --upgrade pip setuptools wheel
python -m pip install requests==2.28.1
set -e
echo "-------------------- Running scrape script --------------------"
python sort.py scrape
uv run --with requests compiler/errors/sort.py scrape
echo "-------------------- Running sort script --------------------"
python sort.py sort
uv run --with requests compiler/errors/sort.py sort

- name: Check for changes and commit
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "GitHub Actions Bot"

if ! git diff --quiet; then # Check if there are any changes
if ! git diff --quiet; then
echo "Changes detected in error files."
git add .
git commit -m "Automated update of unknown_errors"
Expand All @@ -50,4 +46,4 @@ jobs:
echo "No changes detected in error files. Skipping commit and push."
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,8 @@ venv.bak/
docs_build.sh
.buildinfo
json_docs.py
/scripts
/tests
/uv.lock
/examples
/changelogs
50 changes: 31 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
VENV := venv
PYTHON := $(VENV)/bin/python
ifeq ($(OS),Windows_NT)
PYTHON := $(VENV)/Scripts/python.exe
endif

HOST := $(shell ifconfig | grep "inet " | tail -1 | cut -d\ -f2 2>/dev/null || echo "127.0.0.1")
TAG := v$(shell grep -E '__version__ = ".*"' pyrogram/__init__.py | cut -d\" -f2)

RM := rm -rf

NUM_CORES := $(shell $(PYTHON) -c "import os; print(os.cpu_count())")
NUM_CORES := $(shell uv run python -c "import os; print(os.cpu_count())" 2>/dev/null || echo 1)

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

venv:
$(RM) $(VENV)
python3 -m venv $(VENV)
$(PYTHON) -m pip install -U pip wheel setuptools
$(PYTHON) -m pip install -U -r requirements.txt -r dev-requirements.txt
@echo "Created venv with $$($(PYTHON) --version)"
uv sync --extra dev --extra docs
@echo "Synced venv with $$(uv run python --version)"

test:
uv run pytest

clean-build:
$(RM) *.egg-info build dist
Expand All @@ -40,18 +34,17 @@ clean-docs:
$(RM) docs/source/api/bound-methods docs/source/api/methods docs/source/api/types docs/source/telegram

api:
cd compiler/api && ../../$(PYTHON) compiler.py
cd compiler/errors && ../../$(PYTHON) compiler.py
cd compiler/api && uv run python compiler.py
cd compiler/errors && uv run python compiler.py

docs:
make clean-docs
cd compiler/docs && ../../$(PYTHON) compiler.py
$(PYTHON) -m sphinx -b html "docs/source" "docs/build/html" -j$(NUM_CORES)
cd compiler/docs && uv run python compiler.py
uv run python -m sphinx -b html "docs/source" "docs/build/html" -j$(NUM_CORES)

build:
make clean
$(PYTHON) setup.py sdist
$(PYTHON) setup.py bdist_wheel
uv build

tag:
git tag $(TAG)
Expand All @@ -60,3 +53,22 @@ tag:
dtag:
git tag -d $(TAG)
git push origin -d $(TAG)

tagall:
echo "Creating automatic tags for all version bumps..."
for hash in $$(git log --grep="Bump version\|Version bump\|v[0-9]\+\.[0-9]\+\.[0-9]\+" --format="%H"); do \
msg=$$(git log -1 --format="%s" $$hash); \
versions=$$(echo "$$msg" | grep -o "v[0-9]\+\.[0-9]\+\.[0-9]\+"); \
for version in $$versions; do \
if [ -n "$$version" ]; then \
if git show-ref --tags --quiet --verify "refs/tags/$$version"; then \
echo "Tag $$version already exists, skipping."; \
else \
echo "Creating tag $$version for commit $$hash"; \
git tag -a "$$version" "$$hash" -m "Automatic tag $$version"; \
fi; \
fi; \
done; \
done
echo "Pushing all tags to the remote..."
git push origin --tags
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
Documentation
</a>
<a href="https://t.me/pyrogrammodnews">
<a href="https://telegram.me/pyrogrammodnews">
News
</a>
</p>
Expand Down Expand Up @@ -67,8 +67,8 @@ pip3 install https://github.com/PyrogramMod/PyrogramMod/archive/refs/heads/main.
### Resources

- The docs contain lots of resources to help you get started with Pyrogram: https://docs.pyrogram.org.
- Seeking extra help? Come join and ask our community: https://t.me/pyrogrammodchat.
- For other kind of inquiries, you can send a [message](https://t.me/haskell) or an [e-mail](mailto:dan@pyrogram.org).
- Seeking extra help? Come join and ask our community: https://telegram.me/pyrogrammodchat.
- For other kind of inquiries, you can send a [message](https://telegram.me/haskell) or an [e-mail](mailto:dan@pyrogram.org).

### Copyright & License

Expand All @@ -78,16 +78,16 @@ pip3 install https://github.com/PyrogramMod/PyrogramMod/archive/refs/heads/main.
### INFO

- 📕 Official Repo: https://github.com/pyrogram/pyrogram
- 🗞 News: https://t.me/pyrogram
- 💭 Support Group: https://t.me/pyrogramchat
- 🗞 News: https://telegram.me/pyrogram
- 💭 Support Group: https://telegram.me/pyrogramchat
- 📚 Docs: https://docs.pyrogram.org
------------------------------------------------------------
- 📕 Un-Official Repo: https://github.com/PyrogramMod/PyrogramMod/
- 🗞 News: https://t.me/PyroGramModNews
- 💭 Support Group: https://t.me/pyrogramodchat
- 🗞 News: https://telegram.me/PyroGramModNews
- 💭 Support Group: https://telegram.me/pyrogramodchat
- 📚 Docs: https://pyrogrammod.readthedocs.io/en/latest/
------------------------------------------------------------

- Check out the docs at https://docs.pyrogram.org to learn more about Pyrogram, get started right
away and discover more in-depth material for building your client applications.
- Join the official channel at https://t.me/PyroGramModNews and stay tuned for news, updates and announcements.
- Join the official channel at https://telegram.me/PyroGramModNews and stay tuned for news, updates and announcements.
25 changes: 23 additions & 2 deletions compiler/api/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,19 @@ def camel(s: str):
return "".join([i[0].upper() + i[1:] for i in s.split("_")])


# noinspection PyShadowingBuiltins, PyShadowingNames
def get_return_type_hint(qualtype: str) -> str:
"""Get return type hint for generic TLObject"""
if qualtype.startswith("Vector"):
# Extract inner type from Vector<Type>
inner = qualtype.split("<")[1][:-1]
ns, name = inner.split(".") if "." in inner else ("", inner)
return f'"List[raw.base.{".".join([ns, name]).strip(".")}]"'
else:
ns, name = qualtype.split(".") if "." in qualtype else ("", qualtype)
return f'"raw.base.{".".join([ns, name]).strip(".")}"'


# noinspection PyShadowingBuiltins, PyShadowingNames
def get_type_hint(type: str) -> str:
is_flag = FLAGS_RE.match(type)
Expand Down Expand Up @@ -301,7 +314,7 @@ def start(format: bool = False):
d[qualtype].append(c.qualname)

if c.section == "types":
key = c.namespace
key = c.typespace if len(c.namespace) == 0 else c.namespace

if key not in namespaces_to_types:
namespaces_to_types[key] = []
Expand Down Expand Up @@ -548,6 +561,12 @@ def start(format: bool = False):
slots = ", ".join([f'"{i[0]}"' for i in sorted_args])
return_arguments = ", ".join([f"{i[0]}={i[0]}" for i in sorted_args])

# Generate generic type hint for functions
if c.section == "functions":
generic_type = f"[{get_return_type_hint(c.qualtype)}]"
else:
generic_type = ""

compiled_combinator = combinator_tmpl.format(
notice=notice,
warning=WARNING,
Expand All @@ -560,7 +579,8 @@ def start(format: bool = False):
fields=fields,
read_types=read_types,
write_types=write_types,
return_arguments=return_arguments
return_arguments=return_arguments,
generic_type=generic_type
)

directory = "types" if c.section == "types" else c.section
Expand All @@ -585,6 +605,7 @@ def start(format: bool = False):
d[c.namespace].append(c.name)

for namespace, types in namespaces_to_types.items():
os.makedirs(DESTINATION_PATH / "base" / namespace, exist_ok=True)
with open(DESTINATION_PATH / "base" / namespace / "__init__.py", "w") as f:
f.write(f"{notice}\n\n")
f.write(f"{WARNING}\n\n")
Expand Down
Loading
Loading