Skip to content

Commit 9e71533

Browse files
ysravankumarKurimuzonAkumaCometovArtAliwotoKroks4502
authored
merge commit from KurimuzonAkuma/pyrogram (#2) to develop branch
* Added color and background_emoji_id to `User` and `Chat` * Fix update_color chat parsing * Fix Story.copy method * Add quote support * Fix quote if quote is not in reply * Add quote filter * Update Pyrogram to v2.0.106.8 * Add message_thread_id to forward_messages * Add BOOSTS_REQUIRED to known errors * Fix Story.copy * Fix quote filter * Add QUOTE_TEXT_INVALID to known errors * Update Pyrogram to v2.0.106.9 * Fix missing spoiler in get_input_media_from_file_id * Prevent connection to dc every time in save_file * Fix missing has_spoiler * Fix send_reaction for stories * Add support for cross-chat replies * Update Pyrogram to v2.0.106.10 * Fixed "ChannelPrivate" exception on parse param "reply_to_message" (#9) * Add message copy arguments: reply_to_chat_id, quote_text, quote_entities (#10) Co-authored-by: KurimuzonAkuma <31959970+KurimuzonAkuma@users.noreply.github.com> * Add giveaway type * Add giveaway_launched to service messages * Add get_boosts_status method * Add support for spoilers in copy_message * Fix parsing of pinned stories in case of channel * Update Pyrogram to v2.0.106.11 * Request GetChannels as required * Improve speed of stories parsing * Fix reply_to_peer wrongly be set to the target chat_id * Delete comment added by mistake * Add update_chat_notifications method * Update Pyrogram to v2.0.106.12 * Add `quote_text` & `quote_entities` on message copy (#11) * Add some errors to known errors * Add is_admin field to Chat object * Add is_deactivated field to Chat object * Add filters.admin * Add toggle_forum_topics method * Update Pyrogram to v2.0.106.13 * Fix update_chat_notifications * Add force_large_media, force_small_media, manual fields to WebPage object (#12) * Move force_large_media, force_small_media, manual fields closer to each other * Add high-lvl for folders * Add read bound method for Story * Add giveaway filter * Update Pyrogram to v2.0.106.14 * Add custom_action to service messages * Fix misspelling function name in get_chat_history_count example * Fix username field for users with multiple usernames * Add mute/unmute bound method to Chat object * Fix typehints for update_chat_notifications * Allow Custom Storage Engines * Fix async generator typehints * Update Pyrogram to v2.0.106.15 * Make reply bound methods send to the same topic * Add gift_code type Co-authored-by: ZeN <artaganmalsagov07@gmail.com> * Refactor ForumTopic * Add link property to GiftCode * Add gift_code filter * Update Pyrogram to v2.0.106.16 * Add reply_to_chat_id to copy_message (pyrogram#14) * Update chat username parsing in case of multiple usernames * Update MIN_CHAT_ID * Update Pyrogram to v2.0.106.17 * Update docs compiler * Remove timedelta in update_chat_notifications * Update description of update_color * Add requested_chat to service messages * Add new keyboard buttons * Add ProfileColor enum * Update Python Version (#16) * Fix requested_chat parsing and new buttons * Add some errors to known errors * Fix update_color enum * Update Pyrogram to v2.0.106.18 * Fix typehints for enums * Changed requested_chat_id to requested_chat * Remove url uploading from send_story/edit_story * Update Pyrogram to v2.0.106.19 * Update API schema to Layer 167 * Add some errors to known errors * Fix api compiling * Update some methods and types to new layer * Update Pyrogram to v2.0.106.20 * Update get_raw_peer_id and get_peer_id * Refactor folders * Fix usable-by description * Add get_similar_channels to high-lvl * Update topic parsing * Fix chat color parsing * Fix KeyboardButton * Update Pyrogram to v2.0.106.21 * Docstrings for storage class * Remove StorySkipped and StoryDeleted type * Refactor ChatColor * Remove MessageStory type * Fix get_stories * Remove StoryViews type * Add some errors to known errors * Update story methods description * Remove edit_story method * Fix color description * Return bool from update_color * Fix reply_color * Fix story forward_from * Remove StoryViews from compiler * Update story method description * Fix story parsing * Update send_reaction description * Add is_premium to Sticker * Add tests for markdown * Add some errors to known errors * Update forum topic parsing in Message object * Add forum filter * Add edit_hidden field to Message object * Add missing schedule_date to edit_message methods * Update start_bot method * Add topic_id to read_mentions and read_reactions method * Fix is_forum field for supergroups only * Fix read_stories in case max_id is missing * Add update_color to compiler * Update Pyrogram to v2.1.0 * Add support for multiple reactions in send_reaction * Update Pyrogram to v2.1.1 * Update API schema to Layer 169 * Update Pyrogram to v2.1.2 * Ignore KeyError in get_dialogs and get_folders * Fix requested chats * Fix message.download in case of Story * Add max_quantity to request_peer buttons * Rename is_participants_hidden to is_members_hidden * Update Pyrogram to v2.1.3 * Added filters `requested_chat` and `story` (pyrogram#18) Add requested_chats and story filter --------- Co-authored-by: KurimuzonAkuma <31959970+KurimuzonAkuma@users.noreply.github.com> * Add missing optional to some methods description * Add missing attributes to the Giveaway type * Add some errors to known errors * Update Pyrogram to v2.1.4 * Raise exception if auth key not found * Add GiveawayResult type * Update Pyrogram to v2.1.5 * Add missing privileges to the ChatPrivileges type * Add missing privileges to the promote_chat_member method * Add privileges to RequestPeer buttons * Fix max_quantity error if it is None * Refactor download_media * Revert changes related to the Story.download * Add invert_media parameter to send_message method * Add new method send_web_page * Update some methods and types description * Update Pyrogram to v2.1.6 * Update API schema to Layer 170 * Update Pyrogram to v2.1.7 * Add support for self-destructing voice notes * Add invert_media parameter to Message.reply_text method * Update description of some methods * Add missing attributes to the WebPage type * Update Pyrogram to v2.1.8 * Update usable-by in send_reaction * Add missing attributes to the Chat type * Update description of some methods * Add new method set_chat_ttl * Add max_quantity parameter to KeyboardButton constructor * Add new methods join/leave_folder * Update Pyrogram to v2.1.9 * Fix update_folder method * Update Pyrogram to v2.1.10 * Fix message.topic parsing in some cases * Remove blockquote unparsing from markdown parser * Add FloodWait except to media download (pyrogram#19) Add FloodWait except to media download to handle this error from the script. Before this change the exception would only be printed and the script would continue without a way to detect this error. Co-authored-by: KNF Apps <jordyamc@users.noreply.github.com> * Fix message.story parsing in some cases * Remove export_story_link method * Make Storage class an abstract base class * Allow to specify a language pack * Update Pyrogram to v2.1.11 * Update API schema to Layer 171 * Make url parameter optional for send_web_page * Add reply_web_page bound method * Update API schema to Layer 172 * Fix vectors deserialization * Add some errors to known errors * Fix session not getting saved to media_sessions in save_file method. (pyrogram#20) Signed-off-by: Aliwoto <aminnimaj@gmail.com> * Add support for self-destructing video notes * Rename some attributes https://t.me/pyrogramchat/102 * Add protect_content parameter to reply_document method * Update Pyrogram to v2.1.12 * Update python.yml * Increase watchdog interval to 15 minutes https://core.telegram.org/api/updates#recovering-gaps * Fix MyBoost parsing * Update API schema to Layer 173 * Move emoji argument above story_id * Fix history TTL Service Message Parse (#21) Co-authored-by: Colin <colin@colinshark.de> Co-authored-by: Dan <14043624+delivrance@users.noreply.github.com> Co-authored-by: Akkia <AkkiaS7@outlook.com> * Fix increment_story_views * Add toggle_join_to_send method (#22) Signed-off-by: Aliwoto <aminnimaj@gmail.com> * Fix `send_audio` not working as expected (pyrogram#23) * Fix ConnectionResetError when only ping task (pyrogram#24) * Update API schema to Layer 174 * Various improvements * Add deleted parameter to ForumTopic class * Update Pyrogram to v2.1.13 * Add `Str.html` and `Str.markdown` typing (#26) * Add new method check_username * Add RequestedChats type * Fix message parsing in case of reply to story * Update reply filter to work with stories * Add is_contact_require_premium attribute to User class * Add system_lang_code to Client and missing enums to SentCodeType (#27) * Add init_connection_params parameter to Client class * Add support for ApplyBoost service messages * Add new parameters to send_code method * Add raw attribute to Message class * Add raw attribute to Story class * Add ttl_seconds attribute to Voice and VideoNote class * Fix parameter descriptions * Update Pyrogram to v2.1.14 * Fix get_folders * Add show_above_text to Message.edit bound method * Add quotes to markdown * Add custom emojis to markdown * Update check_username method * Add skip_updates parameter to Client class * Fix message parsing in case of reply from private chat * Fix max_concurrent_transmissions typing (#31) * Allow to specify a limit to message cache size * Recover updates in date ascending order * Update API schema to Layer 176 * Add business_info attribute to Chat type * Update Pyrogram to v2.1.15 * Remove unnecessary types from docs compiler * Fix recovering gaps in case of private channel * Add color attribute to Folder * Add new toggle_folder_tags method * Fix get_folders * Refactor download_media * Refactor sqlite storage * Add missing methods to docs compiler * Add hide_sender_name and hide_captions parameters to forward * Add no_sound parameter to send_video methods * Add new get_stickers method * Add sender_boost_count attribute to Message class * Add new get_scheduled_messages method * Add typehints to all of the decorators classes (#34) * Update Pyrogram to v2.1.16 * Renamed ttl_seconds to view_once in send_video_note and send_voice * Add is_public parameter to set_profile_photo and minor fixes (#35) * Fix invalid usage of input_message_content.write method (without await). Signed-off-by: Aliwoto <aminnimaj@gmail.com> * Fix promote_chat_member using can_post_stories for edit_story permission. Signed-off-by: Aliwoto <aminnimaj@gmail.com> * Refactor get_forum_topics_by_id method and make sure to pass messages parameter to it (if it exists). Signed-off-by: Aliwoto <aminnimaj@gmail.com> * Add fallback parameter to set_profile_photo method. Signed-off-by: Aliwoto <aminnimaj@gmail.com> * Fix download_media method not checking for file_id. Signed-off-by: Aliwoto <aminnimaj@gmail.com> * Rename fallback to is_public * Revert get_forum_topics_by_id.py --------- Signed-off-by: Aliwoto <aminnimaj@gmail.com> Co-authored-by: KurimuzonAkuma <31959970+KurimuzonAkuma@users.noreply.github.com> * Fix get_scheduled_messages * Update API schema to Layer 177 * Add birthday attribute to Chat class * Add new update_birthday method * Add some errors to known errors --------- Signed-off-by: Aliwoto <aminnimaj@gmail.com> Co-authored-by: KurimuzonAkuma <arturgayauskas@gmail.com> Co-authored-by: KurimuzonAkuma <31959970+KurimuzonAkuma@users.noreply.github.com> Co-authored-by: CometovArt <cometovart@ya.ru> Co-authored-by: Aliwoto <woto@kaizoku.cyou> Co-authored-by: Kroks4502 <99325746+Kroks4502@users.noreply.github.com> Co-authored-by: Albert Zuev <63642425+iamnalinor@users.noreply.github.com> Co-authored-by: ZeN <artaganmalsagov07@gmail.com> Co-authored-by: CometovArt <62966578+CometovArt@users.noreply.github.com> Co-authored-by: Pranav Saraswat <85411336+Pranav-Saraswat@users.noreply.github.com> Co-authored-by: Yehuda lev <94082865+yehuda-lev@users.noreply.github.com> Co-authored-by: aoleg94 <aoleg94@users.noreply.github.com> Co-authored-by: KNF Apps <jordyamc@users.noreply.github.com> Co-authored-by: AmarnathCJD <amarnathc2026@cs.ajce.in> Co-authored-by: ALi.w <aminnimaj@gmail.com> Co-authored-by: omg-xtao <100690902+omg-xtao@users.noreply.github.com> Co-authored-by: Colin <colin@colinshark.de> Co-authored-by: Dan <14043624+delivrance@users.noreply.github.com> Co-authored-by: Akkia <AkkiaS7@outlook.com> Co-authored-by: Shrimadhav U K <SpEcHiDe@users.noreply.github.com> Co-authored-by: sliva0 <48382801+sliva0@users.noreply.github.com> Co-authored-by: Gor <47748749+ke1io@users.noreply.github.com> Co-authored-by: L <60060180+zawsq@users.noreply.github.com> Co-authored-by: tg:@mars_hall <mars.hall.tg.fck@gmail.com>
1 parent efac171 commit 9e71533

203 files changed

Lines changed: 13085 additions & 493 deletions

File tree

Some content is hidden

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

.github/workflows/python.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ jobs:
99
strategy:
1010
matrix:
1111
os: [ubuntu-latest, macos-latest]
12-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
12+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
1313

1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1616

1717
- name: Set up Python ${{ matrix.python-version }}
18-
uses: actions/setup-python@v2
18+
uses: actions/setup-python@v5
1919
with:
2020
python-version: ${{ matrix.python-version }}
2121

@@ -31,4 +31,4 @@ jobs:
3131
3232
- name: Run tests
3333
run: |
34-
tox
34+
tox

compiler/api/compiler.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,11 +258,14 @@ def start(format: bool = False):
258258

259259
args = ARGS_RE.findall(line)
260260

261-
# Fix arg name being "self" (reserved python keyword)
261+
# Fix arg name being reserved python keyword
262262
for i, item in enumerate(args):
263263
if item[0] == "self":
264264
args[i] = ("is_self", item[1])
265265

266+
if item[0] == "from":
267+
args[i] = ("from_peer", item[1])
268+
266269
combinator = Combinator(
267270
section=section,
268271
qualname=qualname,

compiler/api/source/main_api.tl

Lines changed: 472 additions & 102 deletions
Large diffs are not rendered by default.

compiler/docs/compiler.py

Lines changed: 114 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ def get_title_list(s: str) -> list:
176176
send_chat_action
177177
delete_messages
178178
get_messages
179+
get_scheduled_messages
180+
get_stickers
179181
get_media_group
180182
get_chat_history
181183
get_chat_history_count
@@ -195,6 +197,9 @@ def get_title_list(s: str) -> list:
195197
get_discussion_replies
196198
get_discussion_replies_count
197199
get_custom_emoji_stickers
200+
send_web_page
201+
start_bot
202+
update_color
198203
""",
199204
chats="""
200205
Chats
@@ -237,6 +242,25 @@ def get_title_list(s: str) -> list:
237242
get_send_as_chats
238243
set_send_as_chat
239244
set_chat_protected_content
245+
close_forum_topic
246+
create_forum_topic
247+
delete_forum_topic
248+
edit_forum_topic
249+
get_forum_topics
250+
get_forum_topics_by_id
251+
update_color
252+
update_chat_notifications
253+
toggle_forum_topics
254+
delete_folder
255+
export_folder_link
256+
get_folders
257+
update_folder
258+
get_similar_channels
259+
join_folder
260+
leave_folder
261+
toggle_join_to_send
262+
toggle_folder_tags
263+
set_chat_ttl
240264
""",
241265
users="""
242266
Users
@@ -253,6 +277,9 @@ def get_title_list(s: str) -> list:
253277
get_common_chats
254278
get_default_emoji_statuses
255279
set_emoji_status
280+
update_status
281+
check_username
282+
update_birthday
256283
""",
257284
invite_links="""
258285
Invite Links
@@ -330,6 +357,32 @@ def get_title_list(s: str) -> list:
330357
invoke
331358
resolve_peer
332359
save_file
360+
""",
361+
stories="""
362+
Stories
363+
can_send_story
364+
copy_story
365+
delete_stories
366+
edit_story_caption
367+
edit_story_media
368+
edit_story_privacy
369+
forward_story
370+
get_all_stories
371+
get_chat_stories
372+
get_pinned_stories
373+
get_stories_archive
374+
get_stories
375+
hide_stories
376+
increment_story_views
377+
pin_stories
378+
read_stories
379+
send_story
380+
""",
381+
premium="""
382+
Premium
383+
apply_boost
384+
get_boosts
385+
get_boosts_status
333386
"""
334387
)
335388

@@ -371,7 +424,14 @@ def get_title_list(s: str) -> list:
371424
categories = dict(
372425
users_chats="""
373426
Users & Chats
427+
Birthday
428+
BusinessInfo
429+
BusinessMessage
430+
BusinessRecipients
431+
BusinessWeeklyOpen
432+
BusinessWorkingHours
374433
User
434+
Username
375435
Chat
376436
ChatPreview
377437
ChatPhoto
@@ -388,6 +448,8 @@ def get_title_list(s: str) -> list:
388448
Dialog
389449
Restriction
390450
EmojiStatus
451+
Folder
452+
ChatColor
391453
""",
392454
messages_media="""
393455
Messages & Media
@@ -418,6 +480,12 @@ def get_title_list(s: str) -> list:
418480
WebAppData
419481
MessageReactions
420482
ChatReactions
483+
Story
484+
MyBoost
485+
BoostsStatus
486+
Giveaway
487+
GiveawayResult
488+
GiftCode
421489
""",
422490
bot_keyboards="""
423491
Bot keyboards
@@ -437,6 +505,11 @@ def get_title_list(s: str) -> list:
437505
MenuButtonWebApp
438506
MenuButtonDefault
439507
SentWebAppMessage
508+
ForumTopic
509+
RequestChannelInfo
510+
RequestChatInfo
511+
RequestUserInfo
512+
RequestPollInfo
440513
""",
441514
bot_commands="""
442515
Bot commands
@@ -557,6 +630,7 @@ def get_title_list(s: str) -> list:
557630
Message.reply_video
558631
Message.reply_video_note
559632
Message.reply_voice
633+
Message.reply_web_page
560634
Message.get_media_group
561635
Message.react
562636
""",
@@ -567,25 +641,30 @@ def get_title_list(s: str) -> list:
567641
Chat.set_title
568642
Chat.set_description
569643
Chat.set_photo
644+
Chat.set_ttl
570645
Chat.ban_member
571646
Chat.unban_member
572647
Chat.restrict_member
573648
Chat.promote_member
649+
Chat.join
650+
Chat.leave
651+
Chat.export_invite_link
574652
Chat.get_member
575653
Chat.get_members
576654
Chat.add_members
577-
Chat.join
578-
Chat.leave
579655
Chat.mark_unread
580656
Chat.set_protected_content
581657
Chat.unpin_all_messages
658+
Chat.mute
659+
Chat.unmute
582660
""",
583661
user="""
584662
User
585663
User.archive
586664
User.unarchive
587665
User.block
588666
User.unblock
667+
User.get_common_chats
589668
""",
590669
callback_query="""
591670
Callback Query
@@ -603,6 +682,39 @@ def get_title_list(s: str) -> list:
603682
ChatJoinRequest
604683
ChatJoinRequest.approve
605684
ChatJoinRequest.decline
685+
""",
686+
story="""
687+
Story
688+
Story.reply_text
689+
Story.reply_animation
690+
Story.reply_audio
691+
Story.reply_cached_media
692+
Story.reply_media_group
693+
Story.reply_photo
694+
Story.reply_sticker
695+
Story.reply_video
696+
Story.reply_video_note
697+
Story.reply_voice
698+
Story.copy
699+
Story.delete
700+
Story.edit_media
701+
Story.edit_caption
702+
Story.edit_privacy
703+
Story.react
704+
Story.forward
705+
Story.download
706+
Story.read
707+
""",
708+
folder="""
709+
Folder
710+
Folder.delete
711+
Folder.update
712+
Folder.include_chat
713+
Folder.exclude_chat
714+
Folder.update_color
715+
Folder.pin_chat
716+
Folder.remove_chat
717+
Folder.export_link
606718
"""
607719
)
608720

compiler/docs/template/bound-methods.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,28 @@ ChatJoinRequest
101101

102102
{chat_join_request_toctree}
103103

104+
Story
105+
---------------
106+
107+
.. hlist::
108+
:columns: 3
109+
110+
{story_hlist}
111+
112+
.. toctree::
113+
:hidden:
114+
115+
{story_toctree}
116+
117+
Folder
118+
---------------
119+
120+
.. hlist::
121+
:columns: 2
122+
123+
{folder_hlist}
124+
125+
.. toctree::
126+
:hidden:
127+
128+
{folder_toctree}

compiler/docs/template/methods.rst

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,32 @@ Authorization
151151

152152
{authorization}
153153

154+
Stories
155+
-------------
156+
157+
.. autosummary::
158+
:nosignatures:
159+
160+
{stories}
161+
162+
.. toctree::
163+
:hidden:
164+
165+
{stories}
166+
167+
Premium
168+
-------------
169+
170+
.. autosummary::
171+
:nosignatures:
172+
173+
{premium}
174+
175+
.. toctree::
176+
:hidden:
177+
178+
{premium}
179+
154180
Advanced
155181
--------
156182

@@ -165,4 +191,4 @@ Learn more about how to use the raw API at :doc:`Advanced Usage <../../topics/ad
165191
.. toctree::
166192
:hidden:
167193

168-
{advanced}
194+
{advanced}

0 commit comments

Comments
 (0)