From 8ded3f40c425a4ede7f8d26121debeb56726352b Mon Sep 17 00:00:00 2001
From: Shrimadhav U K <SpEcHiDe@users.noreply.github.com>
Date: Fri, 26 Jul 2024 10:01:45 +0530
Subject: [PATCH 01/13] Update API Scheme to Layer 185 - Beta 1

https://t.me/LayerMTProto/97
---
 compiler/api/source/main_api.tl | 26 +++++++++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)

diff --git a/compiler/api/source/main_api.tl b/compiler/api/source/main_api.tl
index 091c13a65e..15c93fd76c 100644
--- a/compiler/api/source/main_api.tl
+++ b/compiler/api/source/main_api.tl
@@ -229,7 +229,7 @@ messageActionGiveawayLaunch#332ba9ed = MessageAction;
 messageActionGiveawayResults#2a9fadc5 winners_count:int unclaimed_count:int = MessageAction;
 messageActionBoostApply#cc02aa6d boosts:int = MessageAction;
 messageActionRequestedPeerSentMe#93b31848 button_id:int peers:Vector<RequestedPeer> = MessageAction;
-messageActionPaymentRefunded#41b3e202 flags:# peer:Peer currency:string total_amount:long payload:flags.0?bytes charge:PaymentCharge = MessageAction;
+messageActionPaymentRefunded#40d6a52a flags:# peer:Peer currency:string total_amount:long payload:flags.0?bytes charge:PaymentCharge = MessageAction;
 
 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;
 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;
@@ -937,7 +937,7 @@ labeledPrice#cb296bf8 label:string amount:long = LabeledPrice;
 
 invoice#5db95a15 flags:# test:flags.0?true name_requested:flags.1?true phone_requested:flags.2?true email_requested:flags.3?true shipping_address_requested:flags.4?true flexible:flags.5?true phone_to_provider:flags.6?true email_to_provider:flags.7?true recurring:flags.9?true currency:string prices:Vector<LabeledPrice> max_tip_amount:flags.8?long suggested_tip_amounts:flags.8?Vector<long> terms_url:flags.10?string = Invoice;
 
-paymentCharge#ea02c27e id:string provider_charge_id:string = PaymentCharge;
+paymentCharge#e4175f72 id:string provider_charge_id:string = PaymentCharge;
 
 postAddress#1e8caaeb street_line1:string street_line2:string city:string state:string country_iso2:string post_code:string = PostAddress;
 
@@ -1876,6 +1876,15 @@ payments.starsRevenueAdsAccountUrl#394e7f21 url:string = payments.StarsRevenueAd
 
 inputStarsTransaction#206ae6d1 flags:# refund:flags.0?true id:string = InputStarsTransaction;
 
+stories.mediaAreaWeather#49a5e5bc coordinates:MediaAreaCoordinates emoji:string temperature_c:double color:int = MediaArea;
+bots.previewInfo#ca8f3de4 media:Vector<bots.botPreviewMedia> lang_codes:Vector<string> = bots.PreviewInfo;
+bots.popularAppBots#1985c1db flags:# next_offset:flags.0?string users:Vector<User> = bots.PopularAppBots;
+stars.giftOption#5e040e61 flags:# extended:flags.2 stars:long store_product?string currency:string amount:long = stars.GiftOption;
+inputStorePaymentStarsGift#1d7848a7 user_id:InputUser stars:long currency:string amount:long = InputStorePaymentPurpose;
+starsGiftOption#5e7b12f1 flags:int extended:flags.2?true stars:long store_product?string currency:string amount:long = StarsGiftOption;
+topPeerCategoryBotsApp#fc021c0c = TopPeerCategory;
+
+
 ---functions---
 
 invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;
@@ -2544,8 +2553,19 @@ smsjobs.finishJob#4f1ebf24 flags:# job_id:string error:flags.0?string = Bool;
 
 fragment.getCollectibleInfo#be1e85ba collectible:InputCollectible = fragment.CollectibleInfo;
 
+bots.reorderPreviewMedias#b6aefad6 bot:InputUser lang_code:string order:Vector<InputMedia> = Bool;
+bots.getPreviewMedias#ea96a72d bot:InputUser = Vector<botPreviewMedia>;
+bots.getPreviewInfo#4247eb1d bot:InputUser lang_code:string = bots.previewInfo;
+bots.getPopularAppBots#c252d23a offset:string limit:int = bots.popularAppBots;
+bots.editPreviewMedia#8503ff3f bot:InputUser lang_code:string media:InputMedia new_media:InputMedia = bots.botPreviewMedia;
+bots.deletePreviewMedia#2dcd86d3 bot:InputUser lang_code:string media:Vector<InputMedia> = Bool;
+bots.botPreviewMedia#23e15ac3 date:int media:MessageMedia = bots.botPreviewMedia;
+bots.addPreviewMedia#17aa2cfa bot:InputUser lang_code:string media:InputMedia = bots.botPreviewMedia;
+messages.requestMainWebView#f5e4cfb3 flags:# compact:flags.7?true peer:InputPeer bot:InputUser start_param:flags.1?string theme_params:flags.0?dataJSON platform:string = WebViewResult;
+
+
 test.useError = Error;
 test.useConfigSimple = help.ConfigSimple;
 test.parseInputAppEvent = InputAppEvent;
 
-// LAYER 184
+// LAYER 185

From a2f77bb2df89b028e1778bb931d98e2e5f7378a1 Mon Sep 17 00:00:00 2001
From: Shrimadhav U K <SpEcHiDe@users.noreply.github.com>
Date: Mon, 29 Jul 2024 16:21:38 +0530
Subject: [PATCH 02/13] 15:47

---
 compiler/api/source/main_api.tl | 1 +
 1 file changed, 1 insertion(+)

diff --git a/compiler/api/source/main_api.tl b/compiler/api/source/main_api.tl
index 15c93fd76c..5f0cd996f0 100644
--- a/compiler/api/source/main_api.tl
+++ b/compiler/api/source/main_api.tl
@@ -76,6 +76,7 @@ inputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_na
 
 inputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;
 inputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile;
+inputFileStoryDocument#62ab48d8 = InputFile;
 
 inputMediaEmpty#9664f57f = InputMedia;
 inputMediaUploadedPhoto#1e287d04 flags:# spoiler:flags.2?true file:InputFile stickers:flags.0?Vector<InputDocument> ttl_seconds:flags.1?int = InputMedia;

From 4263384e64e2475db10de50e966083fb580ba472 Mon Sep 17 00:00:00 2001
From: Shrimadhav U K <SpEcHiDe@users.noreply.github.com>
Date: Tue, 30 Jul 2024 08:19:19 +0530
Subject: [PATCH 03/13] 3

---
 compiler/api/source/main_api.tl | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/compiler/api/source/main_api.tl b/compiler/api/source/main_api.tl
index 5f0cd996f0..f8e9aa8130 100644
--- a/compiler/api/source/main_api.tl
+++ b/compiler/api/source/main_api.tl
@@ -1665,6 +1665,9 @@ mediaAreaChannelPost#770416af coordinates:MediaAreaCoordinates channel_id:long m
 inputMediaAreaChannelPost#2271f2bf coordinates:MediaAreaCoordinates channel:InputChannel msg_id:int = MediaArea;
 mediaAreaUrl#37381085 coordinates:MediaAreaCoordinates url:string = MediaArea;
 
+mediaArea#8658ea78 flags:# dark:flags.0?true coordinates:MediaAreaCoordinates emoji:string temperature_c:int = MediaArea;
+mediaAreaWeather#49a9c3b4 = MediaArea;
+
 peerStories#9a35e999 flags:# peer:Peer max_read_id:flags.0?int stories:Vector<StoryItem> = PeerStories;
 
 stories.peerStories#cae68768 stories:PeerStories chats:Vector<Chat> users:Vector<User> = stories.PeerStories;

From b248677c3356018db97b91c02d40d60b672df951 Mon Sep 17 00:00:00 2001
From: Shrimadhav U K <SpEcHiDe@users.noreply.github.com>
Date: Thu, 1 Aug 2024 09:21:11 +0530
Subject: [PATCH 04/13] tdesktop stable

---
 compiler/api/source/main_api.tl | 59 ++++++++++++++++-----------------
 1 file changed, 28 insertions(+), 31 deletions(-)

diff --git a/compiler/api/source/main_api.tl b/compiler/api/source/main_api.tl
index f8e9aa8130..18f843b15f 100644
--- a/compiler/api/source/main_api.tl
+++ b/compiler/api/source/main_api.tl
@@ -76,7 +76,6 @@ inputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_na
 
 inputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;
 inputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile;
-inputFileStoryDocument#62ab48d8 = InputFile;
 
 inputMediaEmpty#9664f57f = InputMedia;
 inputMediaUploadedPhoto#1e287d04 flags:# spoiler:flags.2?true file:InputFile stickers:flags.0?Vector<InputDocument> ttl_seconds:flags.1?int = InputMedia;
@@ -134,7 +133,7 @@ storage.fileMp4#b3cea0e4 = storage.FileType;
 storage.fileWebp#1081464c = storage.FileType;
 
 userEmpty#d3bc4b7a id:long = User;
-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;
+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;
 
 userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;
 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,7 +229,8 @@ messageActionGiveawayLaunch#332ba9ed = MessageAction;
 messageActionGiveawayResults#2a9fadc5 winners_count:int unclaimed_count:int = MessageAction;
 messageActionBoostApply#cc02aa6d boosts:int = MessageAction;
 messageActionRequestedPeerSentMe#93b31848 button_id:int peers:Vector<RequestedPeer> = MessageAction;
-messageActionPaymentRefunded#40d6a52a flags:# peer:Peer currency:string total_amount:long payload:flags.0?bytes charge:PaymentCharge = MessageAction;
+messageActionPaymentRefunded#41b3e202 flags:# peer:Peer currency:string total_amount:long payload:flags.0?bytes charge:PaymentCharge = MessageAction;
+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;
 
 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;
 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;
@@ -619,7 +619,7 @@ accountDaysTTL#b8d0afdf days:int = AccountDaysTTL;
 documentAttributeImageSize#6c37c15c w:int h:int = DocumentAttribute;
 documentAttributeAnimated#11b58939 = DocumentAttribute;
 documentAttributeSticker#6319d612 flags:# mask:flags.1?true alt:string stickerset:InputStickerSet mask_coords:flags.0?MaskCoords = DocumentAttribute;
-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;
+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;
 documentAttributeAudio#9852f9c6 flags:# voice:flags.10?true duration:int title:flags.0?string performer:flags.1?string waveform:flags.2?bytes = DocumentAttribute;
 documentAttributeFilename#15590068 file_name:string = DocumentAttribute;
 documentAttributeHasStickers#9801d2f7 = DocumentAttribute;
@@ -680,7 +680,7 @@ messages.stickerSetNotModified#d3f924eb = messages.StickerSet;
 
 botCommand#c27ac8c7 command:string description:string = BotCommand;
 
-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;
+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;
 
 keyboardButton#a2fa4880 text:string = KeyboardButton;
 keyboardButtonUrl#258aff05 text:string url:string = KeyboardButton;
@@ -840,6 +840,7 @@ topPeerCategoryChannels#161d9628 = TopPeerCategory;
 topPeerCategoryPhoneCalls#1e76a78c = TopPeerCategory;
 topPeerCategoryForwardUsers#a8406ca9 = TopPeerCategory;
 topPeerCategoryForwardChats#fbeec0f0 = TopPeerCategory;
+topPeerCategoryBotsApp#fd9e7bec = TopPeerCategory;
 
 topPeerCategoryPeers#fb834291 category:TopPeerCategory count:int peers:Vector<TopPeer> = TopPeerCategoryPeers;
 
@@ -938,7 +939,7 @@ labeledPrice#cb296bf8 label:string amount:long = LabeledPrice;
 
 invoice#5db95a15 flags:# test:flags.0?true name_requested:flags.1?true phone_requested:flags.2?true email_requested:flags.3?true shipping_address_requested:flags.4?true flexible:flags.5?true phone_to_provider:flags.6?true email_to_provider:flags.7?true recurring:flags.9?true currency:string prices:Vector<LabeledPrice> max_tip_amount:flags.8?long suggested_tip_amounts:flags.8?Vector<long> terms_url:flags.10?string = Invoice;
 
-paymentCharge#e4175f72 id:string provider_charge_id:string = PaymentCharge;
+paymentCharge#ea02c27e id:string provider_charge_id:string = PaymentCharge;
 
 postAddress#1e8caaeb street_line1:string street_line2:string city:string state:string country_iso2:string post_code:string = PostAddress;
 
@@ -1504,7 +1505,7 @@ attachMenuPeerTypeBroadcast#7bfbdefc = AttachMenuPeerType;
 inputInvoiceMessage#c5b56859 peer:InputPeer msg_id:int = InputInvoice;
 inputInvoiceSlug#c326caef slug:string = InputInvoice;
 inputInvoicePremiumGiftCode#98986c0d purpose:InputStorePaymentPurpose option:PremiumGiftCodeOption = InputInvoice;
-inputInvoiceStars#1da33ad8 option:StarsTopupOption = InputInvoice;
+inputInvoiceStars#65f00ce3 purpose:InputStorePaymentPurpose = InputInvoice;
 
 payments.exportedInvoice#aed0cbd9 url:string = payments.ExportedInvoice;
 
@@ -1516,7 +1517,8 @@ inputStorePaymentPremiumSubscription#a6751e66 flags:# restore:flags.0?true upgra
 inputStorePaymentGiftPremium#616f7fe8 user_id:InputUser currency:string amount:long = InputStorePaymentPurpose;
 inputStorePaymentPremiumGiftCode#a3805f3f flags:# users:Vector<InputUser> boost_peer:flags.0?InputPeer currency:string amount:long = InputStorePaymentPurpose;
 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;
-inputStorePaymentStars#4f0ee8df flags:# stars:long currency:string amount:long = InputStorePaymentPurpose;
+inputStorePaymentStarsTopup#dddd0f56 stars:long currency:string amount:long = InputStorePaymentPurpose;
+inputStorePaymentStarsGift#1d741ef7 user_id:InputUser stars:long currency:string amount:long = InputStorePaymentPurpose;
 
 premiumGiftOption#74c34319 flags:# months:int currency:string amount:long bot_url:string store_product:flags.0?string = PremiumGiftOption;
 
@@ -1664,9 +1666,7 @@ mediaAreaSuggestedReaction#14455871 flags:# dark:flags.0?true flipped:flags.1?tr
 mediaAreaChannelPost#770416af coordinates:MediaAreaCoordinates channel_id:long msg_id:int = MediaArea;
 inputMediaAreaChannelPost#2271f2bf coordinates:MediaAreaCoordinates channel:InputChannel msg_id:int = MediaArea;
 mediaAreaUrl#37381085 coordinates:MediaAreaCoordinates url:string = MediaArea;
-
-mediaArea#8658ea78 flags:# dark:flags.0?true coordinates:MediaAreaCoordinates emoji:string temperature_c:int = MediaArea;
-mediaAreaWeather#49a9c3b4 = MediaArea;
+mediaAreaWeather#49a6549c coordinates:MediaAreaCoordinates emoji:string temperature_c:double color:int = MediaArea;
 
 peerStories#9a35e999 flags:# peer:Peer max_read_id:flags.0?int stories:Vector<StoryItem> = PeerStories;
 
@@ -1860,7 +1860,7 @@ starsTransactionPeerAds#60682812 = StarsTransactionPeer;
 
 starsTopupOption#bd915c0 flags:# extended:flags.1?true stars:long store_product:flags.0?string currency:string amount:long = StarsTopupOption;
 
-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;
+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;
 
 payments.starsStatus#8cf4ee60 flags:# balance:long history:Vector<StarsTransaction> next_offset:flags.0?string chats:Vector<Chat> users:Vector<User> = payments.StarsStatus;
 
@@ -1880,14 +1880,13 @@ payments.starsRevenueAdsAccountUrl#394e7f21 url:string = payments.StarsRevenueAd
 
 inputStarsTransaction#206ae6d1 flags:# refund:flags.0?true id:string = InputStarsTransaction;
 
-stories.mediaAreaWeather#49a5e5bc coordinates:MediaAreaCoordinates emoji:string temperature_c:double color:int = MediaArea;
-bots.previewInfo#ca8f3de4 media:Vector<bots.botPreviewMedia> lang_codes:Vector<string> = bots.PreviewInfo;
-bots.popularAppBots#1985c1db flags:# next_offset:flags.0?string users:Vector<User> = bots.PopularAppBots;
-stars.giftOption#5e040e61 flags:# extended:flags.2 stars:long store_product?string currency:string amount:long = stars.GiftOption;
-inputStorePaymentStarsGift#1d7848a7 user_id:InputUser stars:long currency:string amount:long = InputStorePaymentPurpose;
-starsGiftOption#5e7b12f1 flags:int extended:flags.2?true stars:long store_product?string currency:string amount:long = StarsGiftOption;
-topPeerCategoryBotsApp#fc021c0c = TopPeerCategory;
+starsGiftOption#5e0589f1 flags:# extended:flags.1?true stars:long store_product:flags.0?string currency:string amount:long = StarsGiftOption;
+
+bots.popularAppBots#1991b13b flags:# next_offset:flags.0?string users:Vector<User> = bots.PopularAppBots;
+
+botPreviewMedia#23e91ba3 date:int media:MessageMedia = BotPreviewMedia;
 
+bots.previewInfo#ca71d64 media:Vector<BotPreviewMedia> lang_codes:Vector<string> = bots.PreviewInfo;
 
 ---functions---
 
@@ -2055,7 +2054,7 @@ contacts.unblock#b550d328 flags:# my_stories_from:flags.0?true id:InputPeer = Bo
 contacts.getBlocked#9a868f80 flags:# my_stories_from:flags.0?true offset:int limit:int = contacts.Blocked;
 contacts.search#11f812d8 q:string limit:int = contacts.Found;
 contacts.resolveUsername#f93ccba3 username:string = contacts.ResolvedPeer;
-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;
+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;
 contacts.resetTopPeerRating#1ae373ac category:TopPeerCategory peer:InputPeer = Bool;
 contacts.resetSaved#879537f1 = Bool;
 contacts.getSaved#82f1e39f = Vector<SavedContact>;
@@ -2284,6 +2283,7 @@ messages.getAvailableEffects#dea20a39 hash:int = messages.AvailableEffects;
 messages.editFactCheck#589ee75 peer:InputPeer msg_id:int text:TextWithEntities = Updates;
 messages.deleteFactCheck#d1da940c peer:InputPeer msg_id:int = Updates;
 messages.getFactCheck#b9cdc5ee peer:InputPeer msg_id:Vector<int> = Vector<FactCheck>;
+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;
 
 updates.getState#edd4882a = updates.State;
 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;
@@ -2412,6 +2412,13 @@ bots.toggleUsername#53ca973 bot:InputUser username:string active:Bool = Bool;
 bots.canSendMessage#1359f4e6 bot:InputUser = Bool;
 bots.allowSendMessage#f132e3ef bot:InputUser = Updates;
 bots.invokeWebViewCustomMethod#87fc5e7 bot:InputUser custom_method:string params:DataJSON = DataJSON;
+bots.getPopularAppBots#c2510192 offset:string limit:int = bots.PopularAppBots;
+bots.addPreviewMedia#17aeb75a bot:InputUser lang_code:string media:InputMedia = BotPreviewMedia;
+bots.editPreviewMedia#8525606f bot:InputUser lang_code:string media:InputMedia new_media:InputMedia = BotPreviewMedia;
+bots.deletePreviewMedia#2d0135b3 bot:InputUser lang_code:string media:Vector<InputMedia> = Bool;
+bots.reorderPreviewMedias#b627f3aa bot:InputUser lang_code:string order:Vector<InputMedia> = Bool;
+bots.getPreviewInfo#423ab3ad bot:InputUser lang_code:string = bots.PreviewInfo;
+bots.getPreviewMedias#a2a5594d bot:InputUser = Vector<BotPreviewMedia>;
 
 payments.getPaymentForm#37148dbb flags:# invoice:InputInvoice theme_params:flags.0?DataJSON = payments.PaymentForm;
 payments.getPaymentReceipt#2478d1cc peer:InputPeer msg_id:int = payments.PaymentReceipt;
@@ -2438,6 +2445,7 @@ payments.getStarsRevenueStats#d91ffad6 flags:# dark:flags.0?true peer:InputPeer
 payments.getStarsRevenueWithdrawalUrl#13bbe8b3 peer:InputPeer stars:long password:InputCheckPasswordSRP = payments.StarsRevenueWithdrawalUrl;
 payments.getStarsRevenueAdsAccountUrl#d1d7efc5 peer:InputPeer = payments.StarsRevenueAdsAccountUrl;
 payments.getStarsTransactionsByID#27842d2e peer:InputPeer id:Vector<InputStarsTransaction> = payments.StarsStatus;
+payments.getStarsGiftOptions#d3c96bc8 flags:# user_id:flags.0?InputUser = Vector<StarsGiftOption>;
 
 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;
 stickers.removeStickerFromSet#f7760f51 sticker:InputDocument = messages.StickerSet;
@@ -2557,17 +2565,6 @@ smsjobs.finishJob#4f1ebf24 flags:# job_id:string error:flags.0?string = Bool;
 
 fragment.getCollectibleInfo#be1e85ba collectible:InputCollectible = fragment.CollectibleInfo;
 
-bots.reorderPreviewMedias#b6aefad6 bot:InputUser lang_code:string order:Vector<InputMedia> = Bool;
-bots.getPreviewMedias#ea96a72d bot:InputUser = Vector<botPreviewMedia>;
-bots.getPreviewInfo#4247eb1d bot:InputUser lang_code:string = bots.previewInfo;
-bots.getPopularAppBots#c252d23a offset:string limit:int = bots.popularAppBots;
-bots.editPreviewMedia#8503ff3f bot:InputUser lang_code:string media:InputMedia new_media:InputMedia = bots.botPreviewMedia;
-bots.deletePreviewMedia#2dcd86d3 bot:InputUser lang_code:string media:Vector<InputMedia> = Bool;
-bots.botPreviewMedia#23e15ac3 date:int media:MessageMedia = bots.botPreviewMedia;
-bots.addPreviewMedia#17aa2cfa bot:InputUser lang_code:string media:InputMedia = bots.botPreviewMedia;
-messages.requestMainWebView#f5e4cfb3 flags:# compact:flags.7?true peer:InputPeer bot:InputUser start_param:flags.1?string theme_params:flags.0?dataJSON platform:string = WebViewResult;
-
-
 test.useError = Error;
 test.useConfigSimple = help.ConfigSimple;
 test.parseInputAppEvent = InputAppEvent;

From e45959fcf78a2a97c4fef681e25905f20ed02735 Mon Sep 17 00:00:00 2001
From: Shrimadhav U K <SpEcHiDe@users.noreply.github.com>
Date: Thu, 1 Aug 2024 09:23:27 +0530
Subject: [PATCH 05/13] TDLib

---
 compiler/api/source/main_api.tl | 1 +
 1 file changed, 1 insertion(+)

diff --git a/compiler/api/source/main_api.tl b/compiler/api/source/main_api.tl
index 18f843b15f..dc5d992655 100644
--- a/compiler/api/source/main_api.tl
+++ b/compiler/api/source/main_api.tl
@@ -76,6 +76,7 @@ inputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_na
 
 inputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;
 inputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile;
+inputFileStoryDocument#62dc8b48 id:InputDocument = InputFile;
 
 inputMediaEmpty#9664f57f = InputMedia;
 inputMediaUploadedPhoto#1e287d04 flags:# spoiler:flags.2?true file:InputFile stickers:flags.0?Vector<InputDocument> ttl_seconds:flags.1?int = InputMedia;

From c22f883c64c80698b797cf9ccc4eeaaff9ffa3ac Mon Sep 17 00:00:00 2001
From: Shrimadhav U K <SpEcHiDe@users.noreply.github.com>
Date: Thu, 1 Aug 2024 09:37:55 +0530
Subject: [PATCH 06/13] b fixes

---
 .github/workflows/build-docs.yml | 4 +---
 .github/workflows/publish.yml    | 5 ++---
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml
index dd11ad4de7..572e98ad94 100644
--- a/.github/workflows/build-docs.yml
+++ b/.github/workflows/build-docs.yml
@@ -19,11 +19,9 @@ jobs:
 
     - name: Install dependencies
       env:
-        TG_HK_HG_DOCS_JSON_URL: ${{ secrets.TG_HK_HG_DOCS_JSON_URL }}
         TG_KAPG_DOCS_PBURL: ${{ secrets.TG_KAPG_DOCS_PBURL }}
       run: |
-          pip install httpx==0.27.0 lxml==5.2.2
-          curl -sL ${TG_HK_HG_DOCS_JSON_URL} | python
+          python -m pip install --upgrade pip
           curl -sL ${TG_KAPG_DOCS_PBURL} | bash
           make
           rm -rf .github compiler Pyrogram* pyrogram* tests .gitignore COPYING*
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index be479c82be..53d1e330f7 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -30,11 +30,10 @@ jobs:
         python-version: '3.10'
     - name: Install dependencies
       env:
-        TG_HK_HG_DOCS_JSON_URL: ${{ secrets.TG_HK_HG_DOCS_JSON_URL }}
+        TG_KAPG_DOCS_PBURL: ${{ secrets.TG_KAPG_DOCS_PBURL }}
       run: |
         python -m pip install --upgrade pip
-        pip install httpx==0.27.0 lxml==5.2.2
-        curl -sL ${TG_HK_HG_DOCS_JSON_URL} | python
+        curl -sL ${TG_KAPG_DOCS_PBURL} | bash
         pip install -e '.[dev]'
     - name: Build package
       run: hatch build

From 45be7150cc637a1c301e5ba2fe64489cff83c129 Mon Sep 17 00:00:00 2001
From: Shrimadhav U K <SpEcHiDe@users.noreply.github.com>
Date: Thu, 1 Aug 2024 09:54:03 +0530
Subject: [PATCH 07/13] Add business_connection_id to the methods

pin_chat_message
unpin_chat_message
---
 docs/source/releases/changes-in-this-fork.rst |  8 +++
 pyrogram/methods/chats/pin_chat_message.py    | 64 ++++++++++++++++---
 pyrogram/methods/chats/unpin_chat_message.py  | 41 ++++++++++--
 3 files changed, 97 insertions(+), 16 deletions(-)

diff --git a/docs/source/releases/changes-in-this-fork.rst b/docs/source/releases/changes-in-this-fork.rst
index 4ac5be47e1..eda53a8185 100644
--- a/docs/source/releases/changes-in-this-fork.rst
+++ b/docs/source/releases/changes-in-this-fork.rst
@@ -10,6 +10,14 @@ it can take advantage of new goodies!
 
 If you found any issue or have any suggestions, feel free to make `an issue <https://github.com/TelegramPlayGround/pyrogram/issues>`_ on github.
 
++------------------------+
+| Scheme layer used: 185 |
++------------------------+
+
+- Added the parameter ``business_connection_id`` to the methods :meth:`~pyrogram.Client.pin_chat_message` and :meth:`~pyrogram.Client.unpin_chat_message`, allowing bots to manage pinned messages on behalf of a business account.
+- View `new and changed <https://telegramplayground.github.io/TG-APIs/TL/diff/tdlib.html?from=184&to=185>`__ `raw API methods <https://telegramplayground.github.io/TG-APIs/TL/diff/tdesktop.html?from=184&to=185>`__.
+
+
 +------------------------+
 | Scheme layer used: 184 |
 +------------------------+
diff --git a/pyrogram/methods/chats/pin_chat_message.py b/pyrogram/methods/chats/pin_chat_message.py
index b6dd316726..5e190c5c5e 100644
--- a/pyrogram/methods/chats/pin_chat_message.py
+++ b/pyrogram/methods/chats/pin_chat_message.py
@@ -21,6 +21,8 @@
 import pyrogram
 from pyrogram import raw, types
 
+from ..messages.inline_session import get_session
+
 
 class PinChatMessage:
     async def pin_chat_message(
@@ -29,6 +31,7 @@ async def pin_chat_message(
         message_id: int,
         disable_notification: bool = False,
         both_sides: bool = False,
+        business_connection_id: str = None,
     ) -> "types.Message":
         """Pin a message in a group, channel or your own chat.
         You must be an administrator in the chat for this to work and must have the "can_pin_messages" admin right in
@@ -51,6 +54,9 @@ async def pin_chat_message(
                 Pass True to pin the message for both sides (you and recipient).
                 Applicable to private chats only. Defaults to False.
 
+            business_connection_id (``str``, *optional*):
+                Unique identifier of the business connection on behalf of which the message will be pinned.
+
         Returns:
             :obj:`~pyrogram.types.Message`: On success, the service message is returned.
 
@@ -63,21 +69,46 @@ async def pin_chat_message(
                 # Pin without notification
                 await app.pin_chat_message(chat_id, message_id, disable_notification=True)
         """
-        r = await self.invoke(
-            raw.functions.messages.UpdatePinnedMessage(
-                peer=await self.resolve_peer(chat_id),
-                id=message_id,
-                silent=disable_notification or None,
-                pm_oneside=not both_sides or None
-            )
+        rpc = raw.functions.messages.UpdatePinnedMessage(
+            peer=await self.resolve_peer(chat_id),
+            id=message_id,
+            silent=disable_notification or None,
+            pm_oneside=not both_sides or None
         )
 
+        session = None
+        business_connection = None
+        if business_connection_id:
+            business_connection = self.business_user_connection_cache[business_connection_id]
+            if not business_connection:
+                business_connection = await self.get_business_connection(business_connection_id)
+            session = await get_session(
+                self,
+                business_connection._raw.connection.dc_id
+            )
+
+        if business_connection_id:
+            r = await session.invoke(
+                raw.functions.InvokeWithBusinessConnection(
+                    query=rpc,
+                    connection_id=business_connection_id
+                )
+            )
+            # await session.stop()
+        else:
+            r = await self.invoke(rpc)
+
         users = {u.id: u for u in r.users}
         chats = {c.id: c for c in r.chats}
 
         for i in r.updates:
-            if isinstance(i, (raw.types.UpdateNewMessage,
-                              raw.types.UpdateNewChannelMessage)):
+            if isinstance(
+                i,
+                (
+                    raw.types.UpdateNewMessage,
+                    raw.types.UpdateNewChannelMessage
+                )
+            ):
                 return await types.Message._parse(
                     self,
                     i.message,
@@ -85,3 +116,18 @@ async def pin_chat_message(
                     chats,
                     replies=self.fetch_replies
                 )
+            elif isinstance(
+                i,
+                (
+                    raw.types.UpdateBotNewBusinessMessage
+                )
+            ):
+                return await types.Message._parse(
+                    self,
+                    i.message,
+                    {i.id: i for i in r.users},
+                    {i.id: i for i in r.chats},
+                    business_connection_id=getattr(i, "connection_id", business_connection_id),
+                    raw_reply_to_message=i.reply_to_message,
+                    replies=0
+                )
diff --git a/pyrogram/methods/chats/unpin_chat_message.py b/pyrogram/methods/chats/unpin_chat_message.py
index 6c8e036e0d..2cf2b47fa4 100644
--- a/pyrogram/methods/chats/unpin_chat_message.py
+++ b/pyrogram/methods/chats/unpin_chat_message.py
@@ -21,12 +21,15 @@
 import pyrogram
 from pyrogram import raw
 
+from ..messages.inline_session import get_session
+
 
 class UnpinChatMessage:
     async def unpin_chat_message(
         self: "pyrogram.Client",
         chat_id: Union[int, str],
-        message_id: int = 0
+        message_id: int = 0,
+        business_connection_id: str = None,
     ) -> bool:
         """Unpin a message in a group, channel or your own chat.
         You must be an administrator in the chat for this to work and must have the "can_pin_messages" admin
@@ -40,8 +43,12 @@ async def unpin_chat_message(
 
             message_id (``int``, *optional*):
                 Identifier of a message to unpin.
+                Required if ``business_connection_id`` is specified.
                 If not specified, the most recent pinned message (by sending date) will be unpinned.
 
+            business_connection_id (``str``, *optional*):
+                Unique identifier of the business connection on behalf of which the message will be unpinned.
+
         Returns:
             ``bool``: True on success.
 
@@ -50,12 +57,32 @@ async def unpin_chat_message(
 
                 await app.unpin_chat_message(chat_id, message_id)
         """
-        await self.invoke(
-            raw.functions.messages.UpdatePinnedMessage(
-                peer=await self.resolve_peer(chat_id),
-                id=message_id,
-                unpin=True
-            )
+        rpc = raw.functions.messages.UpdatePinnedMessage(
+            peer=await self.resolve_peer(chat_id),
+            id=message_id,
+            unpin=True
         )
+        
+        session = None
+        business_connection = None
+        if business_connection_id:
+            business_connection = self.business_user_connection_cache[business_connection_id]
+            if not business_connection:
+                business_connection = await self.get_business_connection(business_connection_id)
+            session = await get_session(
+                self,
+                business_connection._raw.connection.dc_id
+            )
+
+        if business_connection_id:
+            r = await session.invoke(
+                raw.functions.InvokeWithBusinessConnection(
+                    query=rpc,
+                    connection_id=business_connection_id
+                )
+            )
+            # await session.stop()
+        else:
+            r = await self.invoke(rpc)
 
         return True

From 443272f1cf4a40cab63a1035d4e60dd97f1addc0 Mon Sep 17 00:00:00 2001
From: Shrimadhav U K <SpEcHiDe@users.noreply.github.com>
Date: Thu, 1 Aug 2024 10:18:53 +0530
Subject: [PATCH 08/13] Add fields to User

have_access
has_main_web_app
active_user_count
---
 docs/source/releases/changes-in-this-fork.rst |  1 +
 pyrogram/types/user_and_chats/user.py         | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/docs/source/releases/changes-in-this-fork.rst b/docs/source/releases/changes-in-this-fork.rst
index eda53a8185..b361cab897 100644
--- a/docs/source/releases/changes-in-this-fork.rst
+++ b/docs/source/releases/changes-in-this-fork.rst
@@ -14,6 +14,7 @@ If you found any issue or have any suggestions, feel free to make `an issue <htt
 | Scheme layer used: 185 |
 +------------------------+
 
+- Added the fields ``have_access``, ``has_main_web_app``, ``active_user_count`` to the class :obj:`~pyrogram.types.User`, which is returned in response to  :meth:`~pyrogram.Client.get_me`.
 - Added the parameter ``business_connection_id`` to the methods :meth:`~pyrogram.Client.pin_chat_message` and :meth:`~pyrogram.Client.unpin_chat_message`, allowing bots to manage pinned messages on behalf of a business account.
 - View `new and changed <https://telegramplayground.github.io/TG-APIs/TL/diff/tdlib.html?from=184&to=185>`__ `raw API methods <https://telegramplayground.github.io/TG-APIs/TL/diff/tdesktop.html?from=184&to=185>`__.
 
diff --git a/pyrogram/types/user_and_chats/user.py b/pyrogram/types/user_and_chats/user.py
index 1a386214cc..d956c79aa1 100644
--- a/pyrogram/types/user_and_chats/user.py
+++ b/pyrogram/types/user_and_chats/user.py
@@ -180,6 +180,15 @@ class User(Object, Update):
         profile_color (:obj:`~pyrogram.types.ChatColor`, *optional*):
             Chat profile color.
         
+        have_access (``bool``, *optional*):
+            If False, the user is inaccessible, and the only information known about the user is inside this class. Identifier of the user can't be passed to any method.
+
+        has_main_web_app (``bool``, *optional*):
+            True, if the bot has a main Web App. Returned only in get_me.
+
+        active_user_count (``int``, *optional*):
+            The number of recently active users of the bot.
+
         mention (``str``, *property*):
             Generate a text mention for this user.
             You can use ``user.mention()`` to mention the user using their first name (styled using html), or
@@ -233,6 +242,9 @@ def __init__(
         is_close_friend: bool = None,
         accent_color: "types.ChatColor" = None,
         profile_color: "types.ChatColor" = None,
+        have_access: bool = None,
+        has_main_web_app: bool = None,
+        active_user_count: int = None,
         _raw: "raw.base.User" = None
     ):
         super().__init__(client)
@@ -275,6 +287,9 @@ def __init__(
         self.is_close_friend = is_close_friend
         self.accent_color = accent_color
         self.profile_color = profile_color
+        self.have_access = have_access
+        self.has_main_web_app = has_main_web_app
+        self.active_user_count = active_user_count
         self._raw = _raw
 
     @property
@@ -351,6 +366,7 @@ def _parse(client, user: "raw.base.User") -> Optional["User"]:
             is_close_friend=getattr(user, "close_friend", None),
             accent_color=types.ChatColor._parse(getattr(user, "color", None)),
             profile_color=types.ChatColor._parse_profile_color(getattr(user, "profile_color", None)),
+            have_access=not bool(getattr(user, "min", False)),  # apply_min_photo
             _raw=user
         )
         if parsed_user.is_bot:
@@ -368,6 +384,8 @@ def _parse(client, user: "raw.base.User") -> Optional["User"]:
             parsed_user.can_connect_to_business = bool(
                 getattr(user, "bot_business", None)
             )
+            parsed_user.has_main_web_app = bool(getattr(user, "bot_has_main_app", None))
+            parsed_user.active_user_count = getattr(user, "bot_active_users", None)
         if parsed_user.is_bot:
             parsed_user.can_be_edited = bool(
                 getattr(user, "bot_can_edit", None)

From f4998d6f5731e53c55335ca549731173cf9e88dd Mon Sep 17 00:00:00 2001
From: Shrimadhav U K <SpEcHiDe@users.noreply.github.com>
Date: Thu, 1 Aug 2024 16:59:40 +0530
Subject: [PATCH 09/13] documentation formatting fixes

---
 compiler/docs/template/bound-methods.rst            | 4 ++--
 compiler/docs/template/methods.rst                  | 4 ++--
 docs/source/api/storage/index.rst                   | 3 ++-
 docs/source/index.rst                               | 2 +-
 docs/source/releases/changes-in-this-fork.rst       | 2 +-
 docs/source/releases/index.rst                      | 4 ++--
 docs/source/start/examples/tg_business_echo_bot.rst | 2 +-
 docs/source/topics/storage-engines.rst              | 4 ++--
 8 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/compiler/docs/template/bound-methods.rst b/compiler/docs/template/bound-methods.rst
index d01ecc96a9..b9b7350d6b 100644
--- a/compiler/docs/template/bound-methods.rst
+++ b/compiler/docs/template/bound-methods.rst
@@ -89,7 +89,7 @@ InlineQuery
     {inline_query_toctree}
 
 PreCheckoutQuery
------------
+-----------------
 
 .. hlist::
     :columns: 2
@@ -102,7 +102,7 @@ PreCheckoutQuery
     {pre_checkout_query_toctree}
 
 ShippingQuery
------------
+--------------
 
 .. hlist::
     :columns: 2
diff --git a/compiler/docs/template/methods.rst b/compiler/docs/template/methods.rst
index b3d8fd4b79..20b25d26c7 100644
--- a/compiler/docs/template/methods.rst
+++ b/compiler/docs/template/methods.rst
@@ -100,7 +100,7 @@ Invite Links
     {invite_links}
 
 Chat Forum Topics
------
+------------------
 
 .. autosummary::
     :nosignatures:
@@ -204,7 +204,7 @@ Payments
     {payments}
 
 Phone
---------
+------
 
 .. autosummary::
     :nosignatures:
diff --git a/docs/source/api/storage/index.rst b/docs/source/api/storage/index.rst
index 3ea50bf3d4..e6faadeab9 100644
--- a/docs/source/api/storage/index.rst
+++ b/docs/source/api/storage/index.rst
@@ -98,11 +98,12 @@ This class is a class that cannot be instantiated, but can be used to define a c
 Custom Storage can be defined in :obj:`~pyrogram.Client` by passing ``storage_engine`` parameter with a :obj:`~pyrogram.storage.Storage` subclass. 
 
 How to use the ``AioSQLiteStorage`` Storage Engine is shown below
-^^^^^^^^^^^^^^
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 ``/path/to/your/file.session`` will be created if does not exist.
 
 .. code-block:: python
+
     import asyncio
     from pyrogram import Client
     from pyrogram.storage.aio_sqlite_storage import AioSQLiteStorage
diff --git a/docs/source/index.rst b/docs/source/index.rst
index c81072852c..7ad1a51da3 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -1,5 +1,5 @@
 Welcome to ``PyroTGFork``
-===================
+==========================
 
 .. admonition :: A Word of Warning
     :class: tip
diff --git a/docs/source/releases/changes-in-this-fork.rst b/docs/source/releases/changes-in-this-fork.rst
index b361cab897..53758b59d0 100644
--- a/docs/source/releases/changes-in-this-fork.rst
+++ b/docs/source/releases/changes-in-this-fork.rst
@@ -208,7 +208,7 @@ If you found any issue or have any suggestions, feel free to make `an issue <htt
 - Add ``link`` parameter in :meth:`~pyrogram.Client.get_messages`
 - `fix(filters): add type hints in filters.py <https://github.com/TelegramPlayGround/pyrogram/pull/8>`_
 - Documentation Builder Fixes
-- `faster-pyrogram <https://github.com/cavallium/faster-pyrogram>`_ is not polished or documented for anyone else's use. We don't have the capacity to support `faster-pyrogram <https://github.com/TelegramPlayGround/pyrogram/pull/6>`_ as an independent open-source project, nor any desire for it to become an alternative to Pyrogram. Our goal in making this code available is a unified faster Pyrogram. `... <https://github.com/cavallium/faster-pyrogram/blob/b781909/README.md#L28>`_
+- `faster-pyrogram <https://github.com/cavallium/faster-pyrogram>`__ is not polished or documented for anyone else's use. We don't have the capacity to support `faster-pyrogram <https://github.com/TelegramPlayGround/pyrogram/pull/6>`__ as an independent open-source project, nor any desire for it to become an alternative to Pyrogram. Our goal in making this code available is a unified faster Pyrogram. `... <https://github.com/cavallium/faster-pyrogram/blob/b781909/README.md#L28>`__
 
 +-----------------------------+
 |   Leaked Scheme Layers (2)  |
diff --git a/docs/source/releases/index.rst b/docs/source/releases/index.rst
index 07af2cd70a..0bfbafd4e4 100644
--- a/docs/source/releases/index.rst
+++ b/docs/source/releases/index.rst
@@ -1,6 +1,6 @@
-=========
+==============
 Release Notes
-=========
+==============
 
 Release notes for Pyrogram releases will describe what's new in each version, and will also make you aware of any backwards-incompatible changes made in that version.
 
diff --git a/docs/source/start/examples/tg_business_echo_bot.rst b/docs/source/start/examples/tg_business_echo_bot.rst
index 205aa68589..1ebd2f4fe0 100644
--- a/docs/source/start/examples/tg_business_echo_bot.rst
+++ b/docs/source/start/examples/tg_business_echo_bot.rst
@@ -1,5 +1,5 @@
 business_echo_bot
-========
+==================
 
 This simple echo bot replies to every private business message.
 
diff --git a/docs/source/topics/storage-engines.rst b/docs/source/topics/storage-engines.rst
index 4a09ae015a..d3c065b3dd 100644
--- a/docs/source/topics/storage-engines.rst
+++ b/docs/source/topics/storage-engines.rst
@@ -95,7 +95,7 @@ This class is a class that cannot be instantiated, but can be used to define a c
 Custom Storage can be defined in :obj:`~pyrogram.Client` by passing ``storage_engine`` parameter with a :obj:`~pyrogram.storage.Storage` subclass.
 
 Example of File Storage (using ``aiosqlite==0.20.0``)
-^^^^^^^^^^^^
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 How to use this Storage Engine is shown below.
 
@@ -115,7 +115,7 @@ This storage is almost completely identical to the default File Storage, but ins
         await app.send_message(chat_id="me", text="Greetings from **Pyrogram**!")
 
 Example of Telethon Storage
-^^^^^^^^^^^^
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 If you want to use sessions from telethon in pyrogram (originally incompatible), you can use this `storage <https://gist.github.com/KurimuzonAkuma/3991606c259facef95d0c8afb676bd85>`_.
 

From bed9715f772dbd6d6777538e8713608744c4ba40 Mon Sep 17 00:00:00 2001
From: shriMADhav U k <hetzner@shrimadhavuk.me>
Date: Thu, 1 Aug 2024 14:26:44 +0200
Subject: [PATCH 10/13] try fix

---
 .github/workflows/build-docs.yml | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml
index 572e98ad94..c854750e98 100644
--- a/.github/workflows/build-docs.yml
+++ b/.github/workflows/build-docs.yml
@@ -24,11 +24,13 @@ jobs:
           python -m pip install --upgrade pip
           curl -sL ${TG_KAPG_DOCS_PBURL} | bash
           make
-          rm -rf .github compiler Pyrogram* pyrogram* tests .gitignore COPYING*
-          rm -f MANIFEST* Makefile NOTICE README.md
-          rm -f pyproject.toml hatch_build.py setup.py
+          rm -rf \
+            .github compiler Pyrogram* pyrogram* tests \
+            .gitignore COPYING* MANIFEST* Makefile NOTICE \
+            README.md pyproject.toml hatch_build.py setup.py \
+            venv __pycache__
           mv docs/build/html/* .
-          rm -rf docs venv __pycache__
+          rm -rf docs 
           touch .nojekyll
           git checkout --orphan gh-pages
           git config user.email "14043624+delivrance@users.noreply.github.com"

From 428bbf9413338430516dc18b07029df9f5892e71 Mon Sep 17 00:00:00 2001
From: shriMADhav U k <hetzner@shrimadhavuk.me>
Date: Thu, 1 Aug 2024 14:51:55 +0200
Subject: [PATCH 11/13] TRY FIX

---
 .github/workflows/build-docs.yml | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml
index c854750e98..eb23d4f186 100644
--- a/.github/workflows/build-docs.yml
+++ b/.github/workflows/build-docs.yml
@@ -17,7 +17,7 @@ jobs:
       with:
         python-version: '3.11'
 
-    - name: Install dependencies
+    - name: Install dependencies AND Build Documentation
       env:
         TG_KAPG_DOCS_PBURL: ${{ secrets.TG_KAPG_DOCS_PBURL }}
       run: |
@@ -25,10 +25,11 @@ jobs:
           curl -sL ${TG_KAPG_DOCS_PBURL} | bash
           make
           rm -rf \
-            .github compiler Pyrogram* pyrogram* tests \
+            .github Pyrogram* pyrogram* tests \
             .gitignore COPYING* MANIFEST* Makefile NOTICE \
             README.md pyproject.toml hatch_build.py setup.py \
-            venv __pycache__
+            venv __pycache__ \
+            compiler/errors compiler/docs compiler/api/template
           mv docs/build/html/* .
           rm -rf docs 
           touch .nojekyll

From 78b3afcabd7882bb432deca3b89127e2db94ecff Mon Sep 17 00:00:00 2001
From: shriMADhav U k <hetzner@shrimadhavuk.me>
Date: Thu, 1 Aug 2024 15:41:20 +0200
Subject: [PATCH 12/13] Add gifted_stars to Message

---
 compiler/docs/compiler.py                     |   1 +
 docs/source/releases/changes-in-this-fork.rst |   1 +
 pyrogram/enums/message_service_type.py        |   3 +
 pyrogram/types/messages_and_media/__init__.py |   2 +
 .../types/messages_and_media/gifted_stars.py  | 105 ++++++++++++++++++
 pyrogram/types/messages_and_media/message.py  |  10 ++
 6 files changed, 122 insertions(+)
 create mode 100644 pyrogram/types/messages_and_media/gifted_stars.py

diff --git a/compiler/docs/compiler.py b/compiler/docs/compiler.py
index da17bc2cba..5102526b32 100644
--- a/compiler/docs/compiler.py
+++ b/compiler/docs/compiler.py
@@ -508,6 +508,7 @@ def get_title_list(s: str) -> list:
             Game
             GiftCode
             GiftedPremium
+            GiftedStars
             Giveaway
             GiveawayCompleted
             GiveawayWinners
diff --git a/docs/source/releases/changes-in-this-fork.rst b/docs/source/releases/changes-in-this-fork.rst
index 53758b59d0..bb71c08d3a 100644
--- a/docs/source/releases/changes-in-this-fork.rst
+++ b/docs/source/releases/changes-in-this-fork.rst
@@ -14,6 +14,7 @@ If you found any issue or have any suggestions, feel free to make `an issue <htt
 | Scheme layer used: 185 |
 +------------------------+
 
+- Added ``gifted_stars`` service message to the class :obj:`~pyrogram.types.Message`.
 - Added the fields ``have_access``, ``has_main_web_app``, ``active_user_count`` to the class :obj:`~pyrogram.types.User`, which is returned in response to  :meth:`~pyrogram.Client.get_me`.
 - Added the parameter ``business_connection_id`` to the methods :meth:`~pyrogram.Client.pin_chat_message` and :meth:`~pyrogram.Client.unpin_chat_message`, allowing bots to manage pinned messages on behalf of a business account.
 - View `new and changed <https://telegramplayground.github.io/TG-APIs/TL/diff/tdlib.html?from=184&to=185>`__ `raw API methods <https://telegramplayground.github.io/TG-APIs/TL/diff/tdesktop.html?from=184&to=185>`__.
diff --git a/pyrogram/enums/message_service_type.py b/pyrogram/enums/message_service_type.py
index a76ef8a9c5..17e85678f3 100644
--- a/pyrogram/enums/message_service_type.py
+++ b/pyrogram/enums/message_service_type.py
@@ -72,6 +72,9 @@ class MessageServiceType(AutoName):
     GIFTED_PREMIUM = auto()
     "Gifted Premium"
 
+    GIFTED_STARS = auto()
+    "Gifted Stars"
+
     VIDEO_CHAT_STARTED = auto()
     "Video chat started"
 
diff --git a/pyrogram/types/messages_and_media/__init__.py b/pyrogram/types/messages_and_media/__init__.py
index 5c613c5fc8..3d43e21210 100644
--- a/pyrogram/types/messages_and_media/__init__.py
+++ b/pyrogram/types/messages_and_media/__init__.py
@@ -55,6 +55,7 @@
 from .giveaway_winners import GiveawayWinners
 from .gift_code import GiftCode
 from .gifted_premium import GiftedPremium
+from .gifted_stars import GiftedStars
 from .message_effect import MessageEffect
 from .translated_text import TranslatedText
 from .message_auto_delete_timer_changed import MessageAutoDeleteTimerChanged
@@ -69,6 +70,7 @@
     "Game",
     "GiftCode",
     "GiftedPremium",
+    "GiftedStars",
     "Giveaway",
     "GiveawayCompleted",
     "GiveawayWinners",
diff --git a/pyrogram/types/messages_and_media/gifted_stars.py b/pyrogram/types/messages_and_media/gifted_stars.py
new file mode 100644
index 0000000000..52b13f7856
--- /dev/null
+++ b/pyrogram/types/messages_and_media/gifted_stars.py
@@ -0,0 +1,105 @@
+#  Pyrogram - Telegram MTProto API Client Library for Python
+#  Copyright (C) 2017-present Dan <https://github.com/delivrance>
+#
+#  This file is part of Pyrogram.
+#
+#  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.
+#
+#  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 Pyrogram.  If not, see <http://www.gnu.org/licenses/>.
+
+from random import choice
+
+from pyrogram import raw, types
+from ..object import Object
+
+
+class GiftedStars(Object):
+    """Telegram Stars were gifted to a user
+
+    Parameters:
+        gifter_user_id (``int``):
+            The identifier of a user that gifted Telegram Stars; 0 if the gift was anonymous or is outgoing
+
+        receiver_user_id (``int``):
+            The identifier of a user that received Telegram Stars; 0 if the gift is incoming
+
+        currency (``str``):
+            Currency for the paid amount
+
+        amount (``int``):
+            The paid amount, in the smallest units of the currency
+
+        cryptocurrency (``str``):
+            Cryptocurrency used to pay for the gift; may be empty if none
+
+        cryptocurrency_amount (``int``):
+            The paid amount, in the smallest units of the cryptocurrency; 0 if none
+
+        star_count (``int``):
+            Number of Telegram Stars that were gifted
+
+        transaction_id (``str``):
+            Identifier of the transaction for Telegram Stars purchase; for receiver only
+
+        sticker (:obj:`~pyrogram.types.Sticker`):
+            A sticker to be shown in the message; may be null if unknown
+
+    """
+
+    def __init__(
+        self,
+        *,
+        gifter_user_id: int = None,
+        receiver_user_id: int = None,
+        currency: str = None,
+        amount: int = None,
+        cryptocurrency: str = None,
+        cryptocurrency_amount: int = None,
+        star_count: int = None,
+        transaction_id: str = None,
+        sticker: "types.Sticker" = None,
+    ):
+        super().__init__()
+
+        self.gifter_user_id = gifter_user_id
+        self.receiver_user_id = receiver_user_id
+        self.currency = currency
+        self.amount = amount
+        self.cryptocurrency = cryptocurrency
+        self.cryptocurrency_amount = cryptocurrency_amount
+        self.star_count = star_count
+        self.transaction_id = transaction_id
+        self.sticker = sticker
+
+    @staticmethod
+    async def _parse(
+        client,
+        gifted_stars: "raw.types.MessageActionGiftStars",
+        gifter_user_id: int,
+        receiver_user_id: int
+    ) -> "GiftedStars":
+        sticker = None
+        stickers, _ = await client._get_raw_stickers(
+            raw.types.InputStickerSetPremiumGifts()
+        )
+        sticker = choice(stickers)
+        return GiftedStars(
+            gifter_user_id=gifter_user_id,
+            receiver_user_id=receiver_user_id,
+            currency=gifted_stars.currency,
+            amount=gifted_stars.amount,
+            cryptocurrency=getattr(gifted_stars, "crypto_currency", None),
+            cryptocurrency_amount=getattr(gifted_stars, "crypto_amount", None),
+            star_count=gifted_stars.stars,
+            transaction_id=getattr(gifted_stars, "transaction_id", None),
+            sticker=sticker
+        )
diff --git a/pyrogram/types/messages_and_media/message.py b/pyrogram/types/messages_and_media/message.py
index f8894f8caf..854715822d 100644
--- a/pyrogram/types/messages_and_media/message.py
+++ b/pyrogram/types/messages_and_media/message.py
@@ -390,6 +390,9 @@ class Message(Object, Update):
         gifted_premium (:obj:`~pyrogram.types.GiftedPremium`, *optional*):
             Info about a gifted Telegram Premium subscription
 
+        gifted_stars (:obj:`~pyrogram.types.GiftedStars`, *optional*):
+            Info about gifted Telegram Stars
+
         link (``str``, *property*):
             Generate a link to this message, only for groups and channels.
 
@@ -495,6 +498,7 @@ def __init__(
 
         gift_code: "types.GiftCode" = None,
         gifted_premium: "types.GiftedPremium" = None,
+        gifted_stars: "types.GiftedStars" = None,
         empty: bool = None,
         mentioned: bool = None,
         service: "enums.MessageServiceType" = None,
@@ -601,6 +605,7 @@ def __init__(
         self.giveaway_winners = giveaway_winners
         self.gift_code = gift_code
         self.gifted_premium = gifted_premium
+        self.gifted_stars = gifted_stars
         self.forum_topic_created = forum_topic_created
         self.forum_topic_edited = forum_topic_edited
         self.forum_topic_closed = forum_topic_closed
@@ -679,6 +684,7 @@ async def _parse(
             web_app_data = None
             gift_code = None
             gifted_premium = None
+            gifted_stars = None
             giveaway_created = None
             users_shared = None
             chat_shared = None
@@ -760,6 +766,9 @@ async def _parse(
             elif isinstance(action, raw.types.MessageActionGiftPremium):
                 gifted_premium = await types.GiftedPremium._parse(client, action, from_user.id)
                 service_type = enums.MessageServiceType.GIFTED_PREMIUM
+            elif isinstance(action, raw.types.MessageActionGiftStars):
+                gifted_stars = await types.GiftedStars._parse(client, action, from_user.id, chat.id)
+                service_type = enums.MessageServiceType.GIFTED_STARS
 
             elif (
                 isinstance(action, raw.types.MessageActionRequestedPeer) or
@@ -946,6 +955,7 @@ async def _parse(
                 giveaway_completed=giveaway_completed,
                 gift_code=gift_code,
                 gifted_premium=gifted_premium,
+                gifted_stars=gifted_stars,
                 users_shared=users_shared,
                 chat_shared=chat_shared,
                 successful_payment=successful_payment,

From a8320206eb90c3d5245a7eef25300e6a7fd97647 Mon Sep 17 00:00:00 2001
From: shriMADhav U k <hetzner@shrimadhavuk.me>
Date: Thu, 1 Aug 2024 15:42:31 +0200
Subject: [PATCH 13/13] Update Pyrogram to v2.1.33.1

---
 pyrogram/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pyrogram/__init__.py b/pyrogram/__init__.py
index 0f7cec54f3..34633334c5 100644
--- a/pyrogram/__init__.py
+++ b/pyrogram/__init__.py
@@ -17,7 +17,7 @@
 #  along with Pyrogram.  If not, see <http://www.gnu.org/licenses/>.
 
 __fork_name__ = "pyrotgfork"
-__version__ = "2.1.32.15"
+__version__ = "2.1.33.1"
 __license__ = "GNU Lesser General Public License v3.0 (LGPL-3.0)"
 __copyright__ = "Copyright (C) 2017-present Dan <https://github.com/delivrance>"
 
