Skip to content

Commit 4b25a80

Browse files
committed
Update API Scheme to Layer 185 (TelegramPlayground#68)
Update Pyrogram to v2.1.33.1
1 parent e9fe111 commit 4b25a80

File tree

20 files changed

+293
-48
lines changed

20 files changed

+293
-48
lines changed

.github/workflows/build-docs.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,21 @@ jobs:
1717
with:
1818
python-version: '3.11'
1919

20-
- name: Install dependencies
20+
- name: Install dependencies AND Build Documentation
2121
env:
22-
TG_HK_HG_DOCS_JSON_URL: ${{ secrets.TG_HK_HG_DOCS_JSON_URL }}
2322
TG_KAPG_DOCS_PBURL: ${{ secrets.TG_KAPG_DOCS_PBURL }}
2423
run: |
25-
pip install httpx==0.27.0 lxml==5.2.2
26-
curl -sL ${TG_HK_HG_DOCS_JSON_URL} | python
24+
python -m pip install --upgrade pip
2725
curl -sL ${TG_KAPG_DOCS_PBURL} | bash
2826
make
29-
rm -rf .github compiler Pyrogram* pyrogram* tests .gitignore COPYING*
30-
rm -f MANIFEST* Makefile NOTICE README.md
31-
rm -f pyproject.toml hatch_build.py setup.py
27+
rm -rf \
28+
.github Pyrogram* pyrogram* tests \
29+
.gitignore COPYING* MANIFEST* Makefile NOTICE \
30+
README.md pyproject.toml hatch_build.py setup.py \
31+
venv __pycache__ \
32+
compiler/errors compiler/docs compiler/api/template
3233
mv docs/build/html/* .
33-
rm -rf docs venv __pycache__
34+
rm -rf docs
3435
touch .nojekyll
3536
git checkout --orphan gh-pages
3637
git config user.email "14043624+delivrance@users.noreply.github.com"

.github/workflows/publish.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@ jobs:
3030
python-version: '3.10'
3131
- name: Install dependencies
3232
env:
33-
TG_HK_HG_DOCS_JSON_URL: ${{ secrets.TG_HK_HG_DOCS_JSON_URL }}
33+
TG_KAPG_DOCS_PBURL: ${{ secrets.TG_KAPG_DOCS_PBURL }}
3434
run: |
3535
python -m pip install --upgrade pip
36-
pip install httpx==0.27.0 lxml==5.2.2
37-
curl -sL ${TG_HK_HG_DOCS_JSON_URL} | python
36+
curl -sL ${TG_KAPG_DOCS_PBURL} | bash
3837
pip install -e '.[dev]'
3938
- name: Build package
4039
run: hatch build

compiler/api/source/main_api.tl

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ inputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_na
7676

7777
inputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;
7878
inputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile;
79+
inputFileStoryDocument#62dc8b48 id:InputDocument = InputFile;
7980

8081
inputMediaEmpty#9664f57f = InputMedia;
8182
inputMediaUploadedPhoto#1e287d04 flags:# spoiler:flags.2?true file:InputFile stickers:flags.0?Vector<InputDocument> ttl_seconds:flags.1?int = InputMedia;
@@ -133,7 +134,7 @@ storage.fileMp4#b3cea0e4 = storage.FileType;
133134
storage.fileWebp#1081464c = storage.FileType;
134135

135136
userEmpty#d3bc4b7a id:long = User;
136-
user#215c4438 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true fake:flags.26?true bot_attach_menu:flags.27?true premium:flags.28?true attach_menu_enabled:flags.29?true flags2:# bot_can_edit:flags2.1?true close_friend:flags2.2?true stories_hidden:flags2.3?true stories_unavailable:flags2.4?true contact_require_premium:flags2.10?true bot_business:flags2.11?true id:long access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector<RestrictionReason> bot_inline_placeholder:flags.19?string lang_code:flags.22?string emoji_status:flags.30?EmojiStatus usernames:flags2.0?Vector<Username> stories_max_id:flags2.5?int color:flags2.8?PeerColor profile_color:flags2.9?PeerColor = User;
137+
user#83314fca flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true fake:flags.26?true bot_attach_menu:flags.27?true premium:flags.28?true attach_menu_enabled:flags.29?true flags2:# bot_can_edit:flags2.1?true close_friend:flags2.2?true stories_hidden:flags2.3?true stories_unavailable:flags2.4?true contact_require_premium:flags2.10?true bot_business:flags2.11?true bot_has_main_app:flags2.13?true id:long access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector<RestrictionReason> bot_inline_placeholder:flags.19?string lang_code:flags.22?string emoji_status:flags.30?EmojiStatus usernames:flags2.0?Vector<Username> stories_max_id:flags2.5?int color:flags2.8?PeerColor profile_color:flags2.9?PeerColor bot_active_users:flags2.12?int = User;
137138

138139
userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;
139140
userProfilePhoto#82d1f706 flags:# has_video:flags.0?true personal:flags.2?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = UserProfilePhoto;
@@ -230,6 +231,7 @@ messageActionGiveawayResults#2a9fadc5 winners_count:int unclaimed_count:int = Me
230231
messageActionBoostApply#cc02aa6d boosts:int = MessageAction;
231232
messageActionRequestedPeerSentMe#93b31848 button_id:int peers:Vector<RequestedPeer> = MessageAction;
232233
messageActionPaymentRefunded#41b3e202 flags:# peer:Peer currency:string total_amount:long payload:flags.0?bytes charge:PaymentCharge = MessageAction;
234+
messageActionGiftStars#45d5b021 flags:# currency:string amount:long stars:long crypto_currency:flags.0?string crypto_amount:flags.0?long transaction_id:flags.1?string = MessageAction;
233235

234236
dialog#d58a08c6 flags:# pinned:flags.2?true unread_mark:flags.3?true view_forum_as_messages:flags.6?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?int ttl_period:flags.5?int = Dialog;
235237
dialogFolder#71bd134c flags:# pinned:flags.2?true folder:Folder peer:Peer top_message:int unread_muted_peers_count:int unread_unmuted_peers_count:int unread_muted_messages_count:int unread_unmuted_messages_count:int = Dialog;
@@ -618,7 +620,7 @@ accountDaysTTL#b8d0afdf days:int = AccountDaysTTL;
618620
documentAttributeImageSize#6c37c15c w:int h:int = DocumentAttribute;
619621
documentAttributeAnimated#11b58939 = DocumentAttribute;
620622
documentAttributeSticker#6319d612 flags:# mask:flags.1?true alt:string stickerset:InputStickerSet mask_coords:flags.0?MaskCoords = DocumentAttribute;
621-
documentAttributeVideo#d38ff1c2 flags:# round_message:flags.0?true supports_streaming:flags.1?true nosound:flags.3?true duration:double w:int h:int preload_prefix_size:flags.2?int = DocumentAttribute;
623+
documentAttributeVideo#17399fad flags:# round_message:flags.0?true supports_streaming:flags.1?true nosound:flags.3?true duration:double w:int h:int preload_prefix_size:flags.2?int video_start_ts:flags.4?double = DocumentAttribute;
622624
documentAttributeAudio#9852f9c6 flags:# voice:flags.10?true duration:int title:flags.0?string performer:flags.1?string waveform:flags.2?bytes = DocumentAttribute;
623625
documentAttributeFilename#15590068 file_name:string = DocumentAttribute;
624626
documentAttributeHasStickers#9801d2f7 = DocumentAttribute;
@@ -679,7 +681,7 @@ messages.stickerSetNotModified#d3f924eb = messages.StickerSet;
679681

680682
botCommand#c27ac8c7 command:string description:string = BotCommand;
681683

682-
botInfo#8f300b57 flags:# user_id:flags.0?long description:flags.1?string description_photo:flags.4?Photo description_document:flags.5?Document commands:flags.2?Vector<BotCommand> menu_button:flags.3?BotMenuButton = BotInfo;
684+
botInfo#8f300b57 flags:# has_preview_medias:flags.6?true user_id:flags.0?long description:flags.1?string description_photo:flags.4?Photo description_document:flags.5?Document commands:flags.2?Vector<BotCommand> menu_button:flags.3?BotMenuButton = BotInfo;
683685

684686
keyboardButton#a2fa4880 text:string = KeyboardButton;
685687
keyboardButtonUrl#258aff05 text:string url:string = KeyboardButton;
@@ -839,6 +841,7 @@ topPeerCategoryChannels#161d9628 = TopPeerCategory;
839841
topPeerCategoryPhoneCalls#1e76a78c = TopPeerCategory;
840842
topPeerCategoryForwardUsers#a8406ca9 = TopPeerCategory;
841843
topPeerCategoryForwardChats#fbeec0f0 = TopPeerCategory;
844+
topPeerCategoryBotsApp#fd9e7bec = TopPeerCategory;
842845

843846
topPeerCategoryPeers#fb834291 category:TopPeerCategory count:int peers:Vector<TopPeer> = TopPeerCategoryPeers;
844847

@@ -1503,7 +1506,7 @@ attachMenuPeerTypeBroadcast#7bfbdefc = AttachMenuPeerType;
15031506
inputInvoiceMessage#c5b56859 peer:InputPeer msg_id:int = InputInvoice;
15041507
inputInvoiceSlug#c326caef slug:string = InputInvoice;
15051508
inputInvoicePremiumGiftCode#98986c0d purpose:InputStorePaymentPurpose option:PremiumGiftCodeOption = InputInvoice;
1506-
inputInvoiceStars#1da33ad8 option:StarsTopupOption = InputInvoice;
1509+
inputInvoiceStars#65f00ce3 purpose:InputStorePaymentPurpose = InputInvoice;
15071510

15081511
payments.exportedInvoice#aed0cbd9 url:string = payments.ExportedInvoice;
15091512

@@ -1515,7 +1518,8 @@ inputStorePaymentPremiumSubscription#a6751e66 flags:# restore:flags.0?true upgra
15151518
inputStorePaymentGiftPremium#616f7fe8 user_id:InputUser currency:string amount:long = InputStorePaymentPurpose;
15161519
inputStorePaymentPremiumGiftCode#a3805f3f flags:# users:Vector<InputUser> boost_peer:flags.0?InputPeer currency:string amount:long = InputStorePaymentPurpose;
15171520
inputStorePaymentPremiumGiveaway#160544ca flags:# only_new_subscribers:flags.0?true winners_are_visible:flags.3?true boost_peer:InputPeer additional_peers:flags.1?Vector<InputPeer> countries_iso2:flags.2?Vector<string> prize_description:flags.4?string random_id:long until_date:int currency:string amount:long = InputStorePaymentPurpose;
1518-
inputStorePaymentStars#4f0ee8df flags:# stars:long currency:string amount:long = InputStorePaymentPurpose;
1521+
inputStorePaymentStarsTopup#dddd0f56 stars:long currency:string amount:long = InputStorePaymentPurpose;
1522+
inputStorePaymentStarsGift#1d741ef7 user_id:InputUser stars:long currency:string amount:long = InputStorePaymentPurpose;
15191523

15201524
premiumGiftOption#74c34319 flags:# months:int currency:string amount:long bot_url:string store_product:flags.0?string = PremiumGiftOption;
15211525

@@ -1663,6 +1667,7 @@ mediaAreaSuggestedReaction#14455871 flags:# dark:flags.0?true flipped:flags.1?tr
16631667
mediaAreaChannelPost#770416af coordinates:MediaAreaCoordinates channel_id:long msg_id:int = MediaArea;
16641668
inputMediaAreaChannelPost#2271f2bf coordinates:MediaAreaCoordinates channel:InputChannel msg_id:int = MediaArea;
16651669
mediaAreaUrl#37381085 coordinates:MediaAreaCoordinates url:string = MediaArea;
1670+
mediaAreaWeather#49a6549c coordinates:MediaAreaCoordinates emoji:string temperature_c:double color:int = MediaArea;
16661671

16671672
peerStories#9a35e999 flags:# peer:Peer max_read_id:flags.0?int stories:Vector<StoryItem> = PeerStories;
16681673

@@ -1856,7 +1861,7 @@ starsTransactionPeerAds#60682812 = StarsTransactionPeer;
18561861

18571862
starsTopupOption#bd915c0 flags:# extended:flags.1?true stars:long store_product:flags.0?string currency:string amount:long = StarsTopupOption;
18581863

1859-
starsTransaction#2db5418f flags:# refund:flags.3?true pending:flags.4?true failed:flags.6?true id:string stars:long date:int peer:StarsTransactionPeer title:flags.0?string description:flags.1?string photo:flags.2?WebDocument transaction_date:flags.5?int transaction_url:flags.5?string bot_payload:flags.7?bytes msg_id:flags.8?int extended_media:flags.9?Vector<MessageMedia> = StarsTransaction;
1864+
starsTransaction#2db5418f flags:# refund:flags.3?true pending:flags.4?true failed:flags.6?true gift:flags.10?true id:string stars:long date:int peer:StarsTransactionPeer title:flags.0?string description:flags.1?string photo:flags.2?WebDocument transaction_date:flags.5?int transaction_url:flags.5?string bot_payload:flags.7?bytes msg_id:flags.8?int extended_media:flags.9?Vector<MessageMedia> = StarsTransaction;
18601865

18611866
payments.starsStatus#8cf4ee60 flags:# balance:long history:Vector<StarsTransaction> next_offset:flags.0?string chats:Vector<Chat> users:Vector<User> = payments.StarsStatus;
18621867

@@ -1876,6 +1881,14 @@ payments.starsRevenueAdsAccountUrl#394e7f21 url:string = payments.StarsRevenueAd
18761881

18771882
inputStarsTransaction#206ae6d1 flags:# refund:flags.0?true id:string = InputStarsTransaction;
18781883

1884+
starsGiftOption#5e0589f1 flags:# extended:flags.1?true stars:long store_product:flags.0?string currency:string amount:long = StarsGiftOption;
1885+
1886+
bots.popularAppBots#1991b13b flags:# next_offset:flags.0?string users:Vector<User> = bots.PopularAppBots;
1887+
1888+
botPreviewMedia#23e91ba3 date:int media:MessageMedia = BotPreviewMedia;
1889+
1890+
bots.previewInfo#ca71d64 media:Vector<BotPreviewMedia> lang_codes:Vector<string> = bots.PreviewInfo;
1891+
18791892
---functions---
18801893

18811894
invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;
@@ -2042,7 +2055,7 @@ contacts.unblock#b550d328 flags:# my_stories_from:flags.0?true id:InputPeer = Bo
20422055
contacts.getBlocked#9a868f80 flags:# my_stories_from:flags.0?true offset:int limit:int = contacts.Blocked;
20432056
contacts.search#11f812d8 q:string limit:int = contacts.Found;
20442057
contacts.resolveUsername#f93ccba3 username:string = contacts.ResolvedPeer;
2045-
contacts.getTopPeers#973478b6 flags:# correspondents:flags.0?true bots_pm:flags.1?true bots_inline:flags.2?true phone_calls:flags.3?true forward_users:flags.4?true forward_chats:flags.5?true groups:flags.10?true channels:flags.15?true offset:int limit:int hash:long = contacts.TopPeers;
2058+
contacts.getTopPeers#973478b6 flags:# correspondents:flags.0?true bots_pm:flags.1?true bots_inline:flags.2?true phone_calls:flags.3?true forward_users:flags.4?true forward_chats:flags.5?true groups:flags.10?true channels:flags.15?true bots_app:flags.16?true offset:int limit:int hash:long = contacts.TopPeers;
20462059
contacts.resetTopPeerRating#1ae373ac category:TopPeerCategory peer:InputPeer = Bool;
20472060
contacts.resetSaved#879537f1 = Bool;
20482061
contacts.getSaved#82f1e39f = Vector<SavedContact>;
@@ -2271,6 +2284,7 @@ messages.getAvailableEffects#dea20a39 hash:int = messages.AvailableEffects;
22712284
messages.editFactCheck#589ee75 peer:InputPeer msg_id:int text:TextWithEntities = Updates;
22722285
messages.deleteFactCheck#d1da940c peer:InputPeer msg_id:int = Updates;
22732286
messages.getFactCheck#b9cdc5ee peer:InputPeer msg_id:Vector<int> = Vector<FactCheck>;
2287+
messages.requestMainWebView#c9e01e7b flags:# compact:flags.7?true peer:InputPeer bot:InputUser start_param:flags.1?string theme_params:flags.0?DataJSON platform:string = WebViewResult;
22742288

22752289
updates.getState#edd4882a = updates.State;
22762290
updates.getDifference#19c2f763 flags:# pts:int pts_limit:flags.1?int pts_total_limit:flags.0?int date:int qts:int qts_limit:flags.2?int = updates.Difference;
@@ -2399,6 +2413,13 @@ bots.toggleUsername#53ca973 bot:InputUser username:string active:Bool = Bool;
23992413
bots.canSendMessage#1359f4e6 bot:InputUser = Bool;
24002414
bots.allowSendMessage#f132e3ef bot:InputUser = Updates;
24012415
bots.invokeWebViewCustomMethod#87fc5e7 bot:InputUser custom_method:string params:DataJSON = DataJSON;
2416+
bots.getPopularAppBots#c2510192 offset:string limit:int = bots.PopularAppBots;
2417+
bots.addPreviewMedia#17aeb75a bot:InputUser lang_code:string media:InputMedia = BotPreviewMedia;
2418+
bots.editPreviewMedia#8525606f bot:InputUser lang_code:string media:InputMedia new_media:InputMedia = BotPreviewMedia;
2419+
bots.deletePreviewMedia#2d0135b3 bot:InputUser lang_code:string media:Vector<InputMedia> = Bool;
2420+
bots.reorderPreviewMedias#b627f3aa bot:InputUser lang_code:string order:Vector<InputMedia> = Bool;
2421+
bots.getPreviewInfo#423ab3ad bot:InputUser lang_code:string = bots.PreviewInfo;
2422+
bots.getPreviewMedias#a2a5594d bot:InputUser = Vector<BotPreviewMedia>;
24022423

24032424
payments.getPaymentForm#37148dbb flags:# invoice:InputInvoice theme_params:flags.0?DataJSON = payments.PaymentForm;
24042425
payments.getPaymentReceipt#2478d1cc peer:InputPeer msg_id:int = payments.PaymentReceipt;
@@ -2425,6 +2446,7 @@ payments.getStarsRevenueStats#d91ffad6 flags:# dark:flags.0?true peer:InputPeer
24252446
payments.getStarsRevenueWithdrawalUrl#13bbe8b3 peer:InputPeer stars:long password:InputCheckPasswordSRP = payments.StarsRevenueWithdrawalUrl;
24262447
payments.getStarsRevenueAdsAccountUrl#d1d7efc5 peer:InputPeer = payments.StarsRevenueAdsAccountUrl;
24272448
payments.getStarsTransactionsByID#27842d2e peer:InputPeer id:Vector<InputStarsTransaction> = payments.StarsStatus;
2449+
payments.getStarsGiftOptions#d3c96bc8 flags:# user_id:flags.0?InputUser = Vector<StarsGiftOption>;
24282450

24292451
stickers.createStickerSet#9021ab67 flags:# masks:flags.0?true emojis:flags.5?true text_color:flags.6?true user_id:InputUser title:string short_name:string thumb:flags.2?InputDocument stickers:Vector<InputStickerSetItem> software:flags.3?string = messages.StickerSet;
24302452
stickers.removeStickerFromSet#f7760f51 sticker:InputDocument = messages.StickerSet;
@@ -2548,4 +2570,4 @@ test.useError = Error;
25482570
test.useConfigSimple = help.ConfigSimple;
25492571
test.parseInputAppEvent = InputAppEvent;
25502572

2551-
// LAYER 184
2573+
// LAYER 185

compiler/docs/compiler.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,7 @@ def get_title_list(s: str) -> list:
508508
Game
509509
GiftCode
510510
GiftedPremium
511+
GiftedStars
511512
Giveaway
512513
GiveawayCompleted
513514
GiveawayWinners

compiler/docs/template/bound-methods.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ InlineQuery
8989
{inline_query_toctree}
9090

9191
PreCheckoutQuery
92-
-----------
92+
-----------------
9393

9494
.. hlist::
9595
:columns: 2
@@ -102,7 +102,7 @@ PreCheckoutQuery
102102
{pre_checkout_query_toctree}
103103

104104
ShippingQuery
105-
-----------
105+
--------------
106106

107107
.. hlist::
108108
:columns: 2

compiler/docs/template/methods.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Invite Links
100100
{invite_links}
101101

102102
Chat Forum Topics
103-
-----
103+
------------------
104104

105105
.. autosummary::
106106
:nosignatures:
@@ -204,7 +204,7 @@ Payments
204204
{payments}
205205

206206
Phone
207-
--------
207+
------
208208

209209
.. autosummary::
210210
:nosignatures:

docs/source/api/storage/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,12 @@ This class is a class that cannot be instantiated, but can be used to define a c
9898
Custom Storage can be defined in :obj:`~pyrogram.Client` by passing ``storage_engine`` parameter with a :obj:`~pyrogram.storage.Storage` subclass.
9999

100100
How to use the ``AioSQLiteStorage`` Storage Engine is shown below
101-
^^^^^^^^^^^^^^
101+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
102102

103103
``/path/to/your/file.session`` will be created if does not exist.
104104

105105
.. code-block:: python
106+
106107
import asyncio
107108
from pyrogram import Client
108109
from pyrogram.storage.aio_sqlite_storage import AioSQLiteStorage

docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Welcome to ``PyroTGFork``
2-
===================
2+
==========================
33

44
.. admonition :: A Word of Warning
55
:class: tip

0 commit comments

Comments
 (0)