Skip to content

Commit bf0e912

Browse files
committed
Merge remote-tracking branch 'KurimuzonAkuma/dev' into dev
# Conflicts: # Makefile # pyproject.toml
2 parents acc3dea + 8158216 commit bf0e912

53 files changed

Lines changed: 6597 additions & 2287 deletions

Some content is hidden

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

Makefile

Lines changed: 45 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,74 @@
11
VENV := venv
22
PYTHON := $(VENV)/bin/python
3-
HOST = $(shell ifconfig | grep "inet " | tail -1 | cut -d\ -f2)
3+
PIP := $(PYTHON) -m pip
44
TAG = v$(shell grep -E '__version__ = ".*"' pyrogram/__init__.py | cut -d\" -f2)
55

66
RM := rm -rf
77

8-
.PHONY: venv clean-build clean-api clean api build tag dtag
8+
GREEN := \033[0;32m
9+
RED := \033[0;31m
10+
YELLOW := \033[0;33m
11+
BLUE := \033[0;34m
12+
BOLD := \033[1m
13+
RESET := \033[0m
14+
15+
.PHONY: venv venv-docs clean-venv clean-build clean-api clean-docs clean api docs docs-archive build tag dtag
916

1017
venv:
18+
@if [ ! -d "$(VENV)" ]; then \
19+
python3 -m venv $(VENV); \
20+
$(PIP) install -U pip wheel setuptools; \
21+
fi
22+
23+
$(PIP) install -U -e .
24+
@printf "$(YELLOW)Created venv with %s$(RESET)\n" "$$($(PYTHON) --version)"
25+
26+
venv-docs:
27+
@if [ ! -d "$(VENV)" ]; then \
28+
python3 -m venv $(VENV); \
29+
$(PIP) install -U pip wheel setuptools; \
30+
fi
31+
32+
$(PIP) install -U -e .[docs]
33+
@printf "$(YELLOW)Created docs venv with %s$(RESET)\n" "$$($(PYTHON) --version)"
34+
35+
clean-venv:
1136
$(RM) $(VENV)
12-
python3 -m venv $(VENV)
13-
$(PYTHON) -m pip install -U pip wheel setuptools
14-
$(PYTHON) -m pip install -U -r requirements.txt -r dev-requirements.txt
15-
@echo "Created venv with $$($(PYTHON) --version)"
37+
@printf "$(YELLOW)Cleaned venv directory$(RESET)\n"
1638

1739
clean-build:
1840
$(RM) *.egg-info build dist
41+
@printf "$(YELLOW)Cleaned build directory$(RESET)\n"
1942

2043
clean-api:
2144
$(RM) pyrogram/errors/exceptions pyrogram/raw/all.py pyrogram/raw/base pyrogram/raw/functions pyrogram/raw/types
45+
@printf "$(YELLOW)Cleaned api directory$(RESET)\n"
46+
47+
clean-docs:
48+
$(RM) docs/build docs/source/api/bound-methods docs/source/api/methods docs/source/api/types docs/source/api/enums docs/source/telegram
49+
@printf "$(YELLOW)Cleaned docs directory$(RESET)\n"
2250

23-
clean:
24-
make clean-build
25-
make clean-api
51+
clean: clean-venv clean-build clean-api clean-docs
52+
@printf "$(GREEN)Cleaned all directories$(RESET)\n"
2653

2754
api:
2855
cd compiler/api && ../../$(PYTHON) compiler.py
2956
cd compiler/errors && ../../$(PYTHON) compiler.py
3057

58+
docs:
59+
cd compiler/docs && ../../$(PYTHON) compiler.py
60+
$(VENV)/bin/sphinx-build -b dirhtml "docs/source" "docs/build/html" -j auto
61+
62+
docs-archive:
63+
cd docs/build/html && zip -r ../docs.zip ./
64+
3165
build:
32-
make clean
33-
$(PYTHON) setup.py sdist
34-
$(PYTHON) setup.py bdist_wheel
66+
hatch build
3567

3668
tag:
3769
git tag $(TAG)
3870
git push origin $(TAG)
3971

4072
dtag:
4173
git tag -d $(TAG)
42-
git push origin -d $(TAG)
74+
git push origin -d $(TAG)

compiler/api/source/main_api.tl

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ inputMediaStory#89fdd778 peer:InputPeer id:int = InputMedia;
5656
inputMediaWebPage#c21b8849 flags:# force_large_media:flags.0?true force_small_media:flags.1?true optional:flags.2?true url:string = InputMedia;
5757
inputMediaPaidMedia#c4103386 flags:# stars_amount:long extended_media:Vector<InputMedia> payload:flags.0?string = InputMedia;
5858
inputMediaTodo#9fc55fde todo:TodoList = InputMedia;
59+
inputMediaStakeDice#f3a9244a game_hash:string ton_amount:long client_seed:bytes = InputMedia;
5960

6061
inputChatPhotoEmpty#1ca48f57 = InputChatPhoto;
6162
inputChatUploadedPhoto#bdcdaec0 flags:# file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double video_emoji_markup:flags.3?VideoSize = InputChatPhoto;
@@ -126,7 +127,7 @@ chatPhotoEmpty#37c1011c = ChatPhoto;
126127
chatPhoto#1c6e1c11 flags:# has_video:flags.0?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = ChatPhoto;
127128

128129
messageEmpty#90a6ca84 flags:# id:int peer_id:flags.0?Peer = Message;
129-
message#b92f76cf flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true noforwards:flags.26?true invert_media:flags.27?true flags2:# offline:flags2.1?true video_processing_pending:flags2.4?true paid_suggested_post_stars:flags2.8?true paid_suggested_post_ton:flags2.9?true id:int from_id:flags.8?Peer from_boosts_applied:flags.29?int peer_id:Peer saved_peer_id:flags.28?Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long via_business_bot_id:flags2.0?long reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long reactions:flags.20?MessageReactions restriction_reason:flags.22?Vector<RestrictionReason> ttl_period:flags.25?int quick_reply_shortcut_id:flags.30?int effect:flags2.2?long factcheck:flags2.3?FactCheck report_delivery_until_date:flags2.5?int paid_message_stars:flags2.6?long suggested_post:flags2.7?SuggestedPost schedule_repeat_period:flags2.10?int = Message;
130+
message#9cb490e9 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true noforwards:flags.26?true invert_media:flags.27?true flags2:# offline:flags2.1?true video_processing_pending:flags2.4?true paid_suggested_post_stars:flags2.8?true paid_suggested_post_ton:flags2.9?true id:int from_id:flags.8?Peer from_boosts_applied:flags.29?int peer_id:Peer saved_peer_id:flags.28?Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long via_business_bot_id:flags2.0?long reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long reactions:flags.20?MessageReactions restriction_reason:flags.22?Vector<RestrictionReason> ttl_period:flags.25?int quick_reply_shortcut_id:flags.30?int effect:flags2.2?long factcheck:flags2.3?FactCheck report_delivery_until_date:flags2.5?int paid_message_stars:flags2.6?long suggested_post:flags2.7?SuggestedPost schedule_repeat_period:flags2.10?int summary_from_language:flags2.11?string = Message;
130131
messageService#7a800e0a flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true reactions_are_possible:flags.9?true silent:flags.13?true post:flags.14?true legacy:flags.19?true id:int from_id:flags.8?Peer peer_id:Peer saved_peer_id:flags.28?Peer reply_to:flags.3?MessageReplyHeader date:int action:MessageAction reactions:flags.20?MessageReactions ttl_period:flags.25?int = Message;
131132

132133
messageMediaEmpty#3ded6320 = MessageMedia;
@@ -141,7 +142,7 @@ messageMediaGame#fdb19008 game:Game = MessageMedia;
141142
messageMediaInvoice#f6a548d3 flags:# shipping_address_requested:flags.1?true test:flags.3?true title:string description:string photo:flags.0?WebDocument receipt_msg_id:flags.2?int currency:string total_amount:long start_param:string extended_media:flags.4?MessageExtendedMedia = MessageMedia;
142143
messageMediaGeoLive#b940c666 flags:# geo:GeoPoint heading:flags.0?int period:int proximity_notification_radius:flags.1?int = MessageMedia;
143144
messageMediaPoll#4bd6e798 poll:Poll results:PollResults = MessageMedia;
144-
messageMediaDice#3f7ee58b value:int emoticon:string = MessageMedia;
145+
messageMediaDice#8cbec07 flags:# value:int emoticon:string game_outcome:flags.0?messages.EmojiGameOutcome = MessageMedia;
145146
messageMediaStory#68cb6283 flags:# via_mention:flags.1?true peer:Peer id:int story:flags.0?StoryItem = MessageMedia;
146147
messageMediaGiveaway#aa073beb flags:# only_new_subscribers:flags.0?true winners_are_visible:flags.2?true channels:Vector<long> countries_iso2:flags.1?Vector<string> prize_description:flags.3?string quantity:int months:flags.4?int stars:flags.5?long until_date:int = MessageMedia;
147148
messageMediaGiveawayResults#ceaa3ea1 flags:# only_new_subscribers:flags.0?true refunded:flags.2?true channel_id:long additional_peers_count:flags.3?int launch_msg_id:int winners_count:int unclaimed_count:int winners:Vector<long> months:flags.4?int stars:flags.5?long prize_description:flags.1?string until_date:int = MessageMedia;
@@ -461,6 +462,7 @@ updatePinnedForumTopics#def143d0 flags:# peer:Peer order:flags.0?Vector<int> = U
461462
updateDeleteGroupCallMessages#3e85e92c call:InputGroupCall messages:Vector<int> = Update;
462463
updateStarGiftAuctionState#48e246c2 gift_id:long state:StarGiftAuctionState = Update;
463464
updateStarGiftAuctionUserState#dc58f31e gift_id:long user_state:StarGiftAuctionUserState = Update;
465+
updateEmojiGameInfo#fb9c547a info:messages.EmojiGameInfo = Update;
464466

465467
updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;
466468

@@ -2106,6 +2108,7 @@ inputPasskeyResponseRegister#3e63935c client_data:DataJSON attestation_data:byte
21062108
inputPasskeyResponseLogin#c31fc14a client_data:DataJSON authenticator_data:bytes signature:bytes user_handle:string = InputPasskeyResponse;
21072109

21082110
inputPasskeyCredentialPublicKey#3c27b78f id:string raw_id:string response:InputPasskeyResponse = InputPasskeyCredential;
2111+
inputPasskeyCredentialFirebasePNV#5b1ccb28 pnv_token:string = InputPasskeyCredential;
21092112

21102113
starGiftBackground#aff56398 center_color:int edge_color:int text_color:int = StarGiftBackground;
21112114

@@ -2114,6 +2117,11 @@ starGiftAuctionRoundExtendable#aa021e5 num:int duration:int extend_top:int exten
21142117

21152118
payments.starGiftUpgradeAttributes#46c6e36f attributes:Vector<StarGiftAttribute> = payments.StarGiftUpgradeAttributes;
21162119

2120+
messages.emojiGameOutcome#da2ad647 seed:bytes stake_ton_amount:long ton_amount:long = messages.EmojiGameOutcome;
2121+
2122+
messages.emojiGameUnavailable#59e65335 = messages.EmojiGameInfo;
2123+
messages.emojiGameDiceInfo#44e56023 flags:# game_hash:string prev_stake:long current_streak:int params:Vector<int> plays_left:flags.0?int = messages.EmojiGameInfo;
2124+
21172125
---functions---
21182126

21192127
invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;
@@ -2553,6 +2561,8 @@ messages.updatePinnedForumTopic#175df251 peer:InputPeer topic_id:int pinned:Bool
25532561
messages.reorderPinnedForumTopics#e7841f0 flags:# force:flags.0?true peer:InputPeer order:Vector<int> = Updates;
25542562
messages.createForumTopic#2f98c3d5 flags:# title_missing:flags.4?true peer:InputPeer title:string icon_color:flags.0?int icon_emoji_id:flags.3?long random_id:long send_as:flags.2?InputPeer = Updates;
25552563
messages.deleteTopicHistory#d2816f10 peer:InputPeer top_msg_id:int = messages.AffectedHistory;
2564+
messages.getEmojiGameInfo#fb7e8ca7 = messages.EmojiGameInfo;
2565+
messages.summarizeText#9d4104e2 flags:# peer:InputPeer id:int to_lang:flags.0?string = TextWithEntities;
25562566

25572567
updates.getState#edd4882a = updates.State;
25582568
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;
@@ -2888,4 +2898,4 @@ smsjobs.finishJob#4f1ebf24 flags:# job_id:string error:flags.0?string = Bool;
28882898

28892899
fragment.getCollectibleInfo#be1e85ba collectible:InputCollectible = fragment.CollectibleInfo;
28902900

2891-
// LAYER 220
2901+
// LAYER 221

compiler/docs/compiler.py

Lines changed: 73 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,6 @@ def get_title_list(s: str) -> list:
298298
get_direct_messages_chat_topic_history
299299
delete_direct_messages_chat_topic_history
300300
set_direct_messages_chat_topic_is_marked_as_unread
301-
send_web_page
302301
start_bot
303302
delete_chat_history
304303
send_paid_media
@@ -307,6 +306,7 @@ def get_title_list(s: str) -> list:
307306
approve_suggested_post
308307
decline_suggested_post
309308
add_checklist_tasks
309+
summarize_message
310310
""",
311311
chats="""
312312
Chats
@@ -362,6 +362,7 @@ def get_title_list(s: str) -> list:
362362
get_forum_topics
363363
get_forum_topics_by_id
364364
update_color
365+
set_upgraded_gift_colors
365366
update_chat_notifications
366367
toggle_forum_topics
367368
create_folder_invite_link
@@ -444,6 +445,7 @@ def get_title_list(s: str) -> list:
444445
convert_gift_to_stars
445446
get_available_gifts
446447
get_chat_gifts
448+
get_gift_auction_state
447449
get_chat_gifts_count
448450
add_collection_gifts
449451
create_gift_collection
@@ -457,13 +459,16 @@ def get_title_list(s: str) -> list:
457459
reuse_star_subscription
458460
set_gift_collection_name
459461
get_gift_upgrade_preview
462+
get_gift_upgrade_variants
460463
get_payment_form
461464
get_stars_balance
462465
get_ton_balance
463466
get_upgraded_gift_value_info
464467
get_upgraded_gift
465468
gift_premium_with_stars
466469
hide_gift
470+
increase_gift_auction_bid
471+
place_gift_auction_bid
467472
search_gifts_for_resale
468473
send_gift
469474
send_payment_form
@@ -474,6 +479,8 @@ def get_title_list(s: str) -> list:
474479
suggest_birthday
475480
transfer_gift
476481
upgrade_gift
482+
process_gift_purchase_offer
483+
send_gift_purchase_offer
477484
""",
478485
phone="""
479486
Phone
@@ -750,6 +757,7 @@ def get_title_list(s: str) -> list:
750757
GiftResalePriceTon
751758
GiftUpgradePreview
752759
GiftUpgradePrice
760+
GiftUpgradeVariants
753761
CheckedGiftCode
754762
ChecklistTask
755763
ChecklistTasksAdded
@@ -794,13 +802,22 @@ def get_title_list(s: str) -> list:
794802
GiftedTon
795803
UpgradedGiftValueInfo
796804
UpgradedGiftAttributeId
805+
UpgradedGiftPurchaseOffer
806+
UpgradedGiftPurchaseOfferRejected
797807
UpgradedGiftAttributeIdModel
798808
UpgradedGiftAttributeIdSymbol
799809
UpgradedGiftAttributeIdBackdrop
800810
InputChatPhoto
801811
InputChatPhotoPrevious
802812
InputChatPhotoStatic
803813
InputChatPhotoAnimation
814+
AuctionBid
815+
AuctionRound
816+
AuctionState
817+
AuctionStateActive
818+
AuctionStateFinished
819+
GiftAuctionState
820+
GiftAuction
804821
""",
805822
bot_keyboards="""
806823
Bot keyboards
@@ -948,46 +965,76 @@ def get_title_list(s: str) -> list:
948965
categories = dict(
949966
message="""
950967
Message
951-
Message.click
952-
Message.delete
953-
Message.download
954-
Message.forward
955-
Message.copy
956-
Message.copy_media_group
957-
Message.pin
958-
Message.unpin
959-
Message.edit
960-
Message.edit_text
961-
Message.edit_caption
962-
Message.edit_media
963-
Message.edit_checklist
964-
Message.edit_reply_markup
965-
Message.reply
966-
Message.reply_text
967968
Message.reply_animation
969+
Message.answer_animation
968970
Message.reply_audio
969-
Message.reply_cached_media
970-
Message.reply_chat_action
971+
Message.answer_audio
971972
Message.reply_contact
973+
Message.answer_contact
972974
Message.reply_document
975+
Message.answer_document
973976
Message.reply_game
974-
Message.reply_inline_bot_result
977+
Message.answer_game
978+
Message.reply_invoice
979+
Message.answer_invoice
975980
Message.reply_location
981+
Message.answer_location
976982
Message.reply_media_group
983+
Message.answer_media_group
984+
Message.reply
985+
Message.reply_text
986+
Message.answer
977987
Message.reply_photo
988+
Message.answer_photo
978989
Message.reply_poll
990+
Message.answer_poll
991+
Message.reply_dice
992+
Message.answer_dice
979993
Message.reply_sticker
994+
Message.answer_sticker
980995
Message.reply_venue
996+
Message.answer_venue
981997
Message.reply_video
998+
Message.answer_video
982999
Message.reply_video_note
1000+
Message.answer_video_note
9831001
Message.reply_voice
984-
Message.reply_web_page
985-
Message.reply_checklist
1002+
Message.answer_voice
1003+
Message.reply_paid_media
1004+
Message.answer_paid_media
1005+
Message.reply_cached_media
1006+
Message.answer_cached_media
9861007
Message.get_media_group
1008+
Message.reply_chat_action
1009+
Message.reply_inline_bot_result
1010+
Message.answer_inline_bot_result
1011+
Message.reply_checklist
1012+
Message.answer_checklist
1013+
Message.edit_text
1014+
Message.edit
1015+
Message.edit_caption
1016+
Message.edit_media
1017+
Message.edit_checklist
1018+
Message.edit_reply_markup
1019+
Message.edit_live_location
1020+
Message.stop_live_location
1021+
Message.forward
1022+
Message.copy
1023+
Message.copy_media_group
1024+
Message.delete
1025+
Message.click
9871026
Message.react
1027+
Message.retract_vote
1028+
Message.download
1029+
Message.vote
1030+
Message.pin
1031+
Message.unpin
9881032
Message.read
9891033
Message.view
9901034
Message.pay
1035+
Message.accept_gift_purchase_offer
1036+
Message.reject_gift_purchase_offer
1037+
Message.summarize
9911038
""",
9921039
chat="""
9931040
Chat
@@ -1095,6 +1142,8 @@ def get_title_list(s: str) -> list:
10951142
Gift.wear
10961143
Gift.buy
10971144
Gift.send
1145+
Gift.get_auction_state
1146+
Gift.send_purchase_offer
10981147
""",
10991148
animation="""
11001149
Animation
@@ -1152,6 +1201,7 @@ def get_title_list(s: str) -> list:
11521201
MessageServiceType
11531202
MessagesFilter
11541203
NextCodeType
1204+
PaidReactionPrivacy
11551205
ParseMode
11561206
PhoneCallDiscardReason
11571207
PollType
@@ -1166,6 +1216,7 @@ def get_title_list(s: str) -> list:
11661216
MediaAreaType
11671217
PrivacyRuleType
11681218
GiftForResaleOrder
1219+
GiftPurchaseOfferState
11691220
PaymentFormType
11701221
StickerType
11711222
MaskPointType

compiler/errors/source/400_BAD_REQUEST.tsv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ INPUT_LAYER_INVALID The specified layer is invalid.
266266
INPUT_METHOD_INVALID The method invoked is invalid in the current schema.
267267
INPUT_PEERS_EMPTY The specified peer array is empty.
268268
INPUT_REQUEST_TOO_LONG The request payload is too long.
269+
INPUT_STARS_NANOS_INVALID The specified stars nano amount is invalid.
269270
INPUT_TEXT_EMPTY The specified text is empty.
270271
INPUT_TEXT_TOO_LONG The specified text is too long.
271272
INPUT_USER_DEACTIVATED The target user has been deleted/deactivated.

pyproject.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ keywords = [
5050
]
5151

5252
[project.urls]
53-
Homepage = "https://kurigram.live"
54-
Documentation = "https://docs.kurigram.live"
53+
Homepage = "https://kurigram.icu"
54+
Documentation = "https://docs.kurigram.icu"
5555
Source = "https://github.com/KurimuzonAkuma/pyrogram"
5656
Issues = "https://github.com/KurimuzonAkuma/pyrogram/issues"
5757
Community = "https://t.me/kurigram_chat"
@@ -72,6 +72,8 @@ docs = [
7272
"sphinx-autobuild",
7373
"sphinx-copybutton",
7474
"pygments",
75+
"sphinx-iconify",
76+
"sphinx-design"
7577
]
7678

7779
fast = [

0 commit comments

Comments
 (0)