Compare commits

...

19 commits

Author SHA1 Message Date
NekoChan
6e880e661b
Merge 38cde8d556 into cb38d6a02b 2025-07-13 19:57:37 +03:00
wulan17
cb38d6a02b
pyrofork: docs: storage: Add example for official async mongodb driver
Some checks failed
Pyrofork / build (macos-latest, 3.10) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.11) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.12) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.13) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.9) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.10) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.11) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.12) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.13) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.9) (push) Has been cancelled
Signed-off-by: wulan17 <wulan17@komodos.id>
2025-07-11 20:31:21 +07:00
wulan17
cf6141feb4
pyrofork: Bump version to 2.3.68
Some checks are pending
Pyrofork / build (macos-latest, 3.10) (push) Waiting to run
Pyrofork / build (macos-latest, 3.11) (push) Waiting to run
Pyrofork / build (macos-latest, 3.12) (push) Waiting to run
Pyrofork / build (macos-latest, 3.13) (push) Waiting to run
Pyrofork / build (macos-latest, 3.9) (push) Waiting to run
Pyrofork / build (ubuntu-latest, 3.10) (push) Waiting to run
Pyrofork / build (ubuntu-latest, 3.11) (push) Waiting to run
Pyrofork / build (ubuntu-latest, 3.12) (push) Waiting to run
Pyrofork / build (ubuntu-latest, 3.13) (push) Waiting to run
Pyrofork / build (ubuntu-latest, 3.9) (push) Waiting to run
Signed-off-by: wulan17 <wulan17@komodos.id>
2025-07-10 19:58:10 +07:00
wulan17
8acc457458
pyrofork: types: Chat: _parse_dialog: Handle InputPeerUser and InputPeerChat
Signed-off-by: wulan17 <wulan17@komodos.id>
2025-07-10 19:56:53 +07:00
wulan17
413556a3f2
pyrofork: Refactor folders
Signed-off-by: wulan17 <wulan17@komodos.id>
2025-07-10 19:56:52 +07:00
wulan17
4a109b3dc2
pyrofork: Adapt filters.linked_channel to latest changes
Signed-off-by: wulan17 <wulan17@komodos.id>
2025-07-10 19:56:52 +07:00
wulan17
46e755f297
pyrofork: client: fix looping prompt when use qrcode as input
Signed-off-by: wulan17 <wulan17@komodos.id>
2025-07-10 19:56:52 +07:00
wulan17
c8b22bb5e7
pyrofork: Add resale_amount field to Gift (#144)
Signed-off-by: wulan17 <wulan17@komodos.id>
2025-07-10 19:56:51 +07:00
Hentinel
9b670a78b3
pyrofork: Allow to specify system_lang_code and lang_pack (#129)
Signed-off-by: wulan17 <wulan17@komodos.id>
2025-07-10 19:56:51 +07:00
Otazuki
621c690e55
pyrofork: Add transfer_chat_ownership method (#145)
Signed-off-by: wulan17 <wulan17@komodos.id>
2025-07-10 19:56:51 +07:00
wulan17
07bdefb017
pyrofork: Add todolist implementation
Signed-off-by: wulan17 <wulan17@komodos.id>
2025-07-10 19:56:51 +07:00
wulan17
9d795911b4
pyrofork: Update API schema to Layer 207
Signed-off-by: wulan17 <wulan17@komodos.id>
2025-07-10 19:56:50 +07:00
wulan17
cb19b742ad
pyrofork: Update API schema to Layer 206
Signed-off-by: wulan17 <wulan17@komodos.id>
2025-07-10 19:56:50 +07:00
wulan17
1ba1a051c4
pyrofork: Update API schema to Layer 205
Signed-off-by: wulan17 <wulan17@komodos.id>
2025-07-10 19:56:50 +07:00
6151813555
Merge pull request #121 from Mayuri-Chan/dependabot/pip/sphinx-immaterial-0.13.4
Some checks are pending
Pyrofork / build (macos-latest, 3.10) (push) Waiting to run
Pyrofork / build (macos-latest, 3.11) (push) Waiting to run
Pyrofork / build (macos-latest, 3.12) (push) Waiting to run
Pyrofork / build (macos-latest, 3.13) (push) Waiting to run
Pyrofork / build (macos-latest, 3.9) (push) Waiting to run
Pyrofork / build (ubuntu-latest, 3.10) (push) Waiting to run
Pyrofork / build (ubuntu-latest, 3.11) (push) Waiting to run
Pyrofork / build (ubuntu-latest, 3.12) (push) Waiting to run
Pyrofork / build (ubuntu-latest, 3.13) (push) Waiting to run
Pyrofork / build (ubuntu-latest, 3.9) (push) Waiting to run
build(deps): bump sphinx-immaterial from 0.12.4 to 0.13.4
2025-07-09 22:18:02 +07:00
dependabot[bot]
cc4eb21b84
build(deps): bump sphinx-immaterial from 0.12.4 to 0.13.4
Bumps [sphinx-immaterial](https://github.com/jbms/sphinx-immaterial) from 0.12.4 to 0.13.4.
- [Release notes](https://github.com/jbms/sphinx-immaterial/releases)
- [Commits](https://github.com/jbms/sphinx-immaterial/compare/v0.12.4...v0.13.4)

---
updated-dependencies:
- dependency-name: sphinx-immaterial
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-09 15:11:37 +00:00
Ling-ex
38cde8d556 Fix: typo enums.MessageServiceType.ChatShared in pyrogram/types/messages_and_media/message.
Signed-off-by: Ling-ex <nekochan@rizkiofficial.com>
2025-05-24 18:02:07 +00:00
Ling-ex
b2ca66bb9e Update Gift class: add ton_address and clarify owner info.
Signed-off-by: Ling-ex <nekochan@rizkiofficial.com>
2025-05-24 18:01:40 +00:00
Ling-ex
a10dd419d7 Fix: Register RawUpdateHandler and Refactor Dispatcher for Better Modularity.
Signed-off-by: Ling-ex <nekochan@rizkiofficial.com>
2025-05-24 18:01:07 +00:00
30 changed files with 906 additions and 72 deletions

View file

@ -55,6 +55,7 @@ inputMediaDice#e66fbf7b emoticon:string = InputMedia;
inputMediaStory#89fdd778 peer:InputPeer id:int = InputMedia;
inputMediaWebPage#c21b8849 flags:# force_large_media:flags.0?true force_small_media:flags.1?true optional:flags.2?true url:string = InputMedia;
inputMediaPaidMedia#c4103386 flags:# stars_amount:long extended_media:Vector<InputMedia> payload:flags.0?string = InputMedia;
inputMediaTodo#9fc55fde todo:TodoList = InputMedia;
inputChatPhotoEmpty#1ca48f57 = InputChatPhoto;
inputChatUploadedPhoto#bdcdaec0 flags:# file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double video_emoji_markup:flags.3?VideoSize = InputChatPhoto;
@ -112,7 +113,7 @@ channel#fe685355 flags:# creator:flags.0?true left:flags.2?true broadcast:flags.
channelForbidden#17d493d5 flags:# broadcast:flags.5?true megagroup:flags.8?true id:long access_hash:long title:string until_date:flags.16?int = Chat;
chatFull#2633421b flags:# can_set_username:flags.7?true has_scheduled:flags.8?true translations_disabled:flags.19?true id:long about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:flags.13?ExportedChatInvite bot_info:flags.3?Vector<BotInfo> pinned_msg_id:flags.6?int folder_id:flags.11?int call:flags.12?InputGroupCall ttl_period:flags.14?int groupcall_default_join_as:flags.15?Peer theme_emoticon:flags.16?string requests_pending:flags.17?int recent_requesters:flags.17?Vector<long> available_reactions:flags.18?ChatReactions reactions_limit:flags.20?int = ChatFull;
channelFull#52d6806b flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true flags2:# can_delete_channel:flags2.0?true antispam:flags2.1?true participants_hidden:flags2.2?true translations_disabled:flags2.3?true stories_pinned_available:flags2.5?true view_forum_as_messages:flags2.6?true restricted_sponsored:flags2.11?true can_view_revenue:flags2.12?true paid_media_allowed:flags2.14?true can_view_stars_revenue:flags2.15?true paid_reactions_available:flags2.16?true stargifts_available:flags2.19?true paid_messages_available:flags2.20?true id:long about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?long migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?long location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector<string> groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string requests_pending:flags.28?int recent_requesters:flags.28?Vector<long> default_send_as:flags.29?Peer available_reactions:flags.30?ChatReactions reactions_limit:flags2.13?int stories:flags2.4?PeerStories wallpaper:flags2.7?WallPaper boosts_applied:flags2.8?int boosts_unrestrict:flags2.9?int emojiset:flags2.10?StickerSet bot_verification:flags2.17?BotVerification stargifts_count:flags2.18?int = ChatFull;
channelFull#e07429de flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true flags2:# can_delete_channel:flags2.0?true antispam:flags2.1?true participants_hidden:flags2.2?true translations_disabled:flags2.3?true stories_pinned_available:flags2.5?true view_forum_as_messages:flags2.6?true restricted_sponsored:flags2.11?true can_view_revenue:flags2.12?true paid_media_allowed:flags2.14?true can_view_stars_revenue:flags2.15?true paid_reactions_available:flags2.16?true stargifts_available:flags2.19?true paid_messages_available:flags2.20?true id:long about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?long migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?long location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector<string> groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string requests_pending:flags.28?int recent_requesters:flags.28?Vector<long> default_send_as:flags.29?Peer available_reactions:flags.30?ChatReactions reactions_limit:flags2.13?int stories:flags2.4?PeerStories wallpaper:flags2.7?WallPaper boosts_applied:flags2.8?int boosts_unrestrict:flags2.9?int emojiset:flags2.10?StickerSet bot_verification:flags2.17?BotVerification stargifts_count:flags2.18?int send_paid_messages_stars:flags2.21?long = ChatFull;
chatParticipant#c02d4007 user_id:long inviter_id:long date:int = ChatParticipant;
chatParticipantCreator#e46bcee4 user_id:long = ChatParticipant;
@ -125,8 +126,8 @@ chatPhotoEmpty#37c1011c = ChatPhoto;
chatPhoto#1c6e1c11 flags:# has_video:flags.0?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = ChatPhoto;
messageEmpty#90a6ca84 flags:# id:int peer_id:flags.0?Peer = Message;
message#eabcdd4d 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 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 = Message;
messageService#d3d28540 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 reply_to:flags.3?MessageReplyHeader date:int action:MessageAction reactions:flags.20?MessageReactions ttl_period:flags.25?int = Message;
message#9815cec8 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 = Message;
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;
messageMediaEmpty#3ded6320 = MessageMedia;
messageMediaPhoto#695150d7 flags:# spoiler:flags.3?true photo:flags.0?Photo ttl_seconds:flags.2?int = MessageMedia;
@ -145,6 +146,7 @@ messageMediaStory#68cb6283 flags:# via_mention:flags.1?true peer:Peer id:int sto
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;
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;
messageMediaPaidMedia#a8852491 stars_amount:long extended_media:Vector<MessageExtendedMedia> = MessageMedia;
messageMediaToDo#8a53b014 flags:# todo:TodoList completions:flags.0?Vector<TodoCompletion> = MessageMedia;
messageActionEmpty#b6aef7b0 = MessageAction;
messageActionChatCreate#bd47cbad title:string users:Vector<long> = MessageAction;
@ -197,6 +199,12 @@ messageActionStarGiftUnique#2e3ae60e flags:# upgrade:flags.0?true transferred:fl
messageActionPaidMessagesRefunded#ac1f1fcd count:int stars:long = MessageAction;
messageActionPaidMessagesPrice#84b88578 flags:# broadcast_messages_allowed:flags.0?true stars:long = MessageAction;
messageActionConferenceCall#2ffe2f7a flags:# missed:flags.0?true active:flags.1?true video:flags.4?true call_id:long duration:flags.2?int other_participants:flags.3?Vector<Peer> = MessageAction;
messageActionTodoCompletions#cc7c5c89 completed:Vector<int> incompleted:Vector<int> = MessageAction;
messageActionTodoAppendTasks#c7edbc83 list:Vector<TodoItem> = MessageAction;
messageActionSuggestedPostApproval#ee7a1596 flags:# rejected:flags.0?true balance_too_low:flags.1?true reject_comment:flags.2?string schedule_date:flags.3?int price:flags.4?StarsAmount = MessageAction;
messageActionSuggestedPostSuccess#95ddcf69 price:StarsAmount = MessageAction;
messageActionSuggestedPostRefund#69f916f8 flags:# payer_initiated:flags.0?true = MessageAction;
messageActionGiftTon#a8a3c699 flags:# currency:string amount:long crypto_currency:string crypto_amount:long transaction_id:flags.0?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;
@ -434,7 +442,6 @@ updateBotNewBusinessMessage#9ddb347c flags:# connection_id:string message:Messag
updateBotEditBusinessMessage#7df587c flags:# connection_id:string message:Message reply_to_message:flags.0?Message qts:int = Update;
updateBotDeleteBusinessMessage#a02a982e connection_id:string peer:Peer messages:Vector<int> qts:int = Update;
updateNewStoryReaction#1824e40b story_id:int peer:Peer reaction:Reaction = Update;
updateBroadcastRevenueTransactions#dfd961f5 peer:Peer balances:BroadcastRevenueBalances = Update;
updateStarsBalance#4e80a379 balance:StarsAmount = Update;
updateBusinessBotCallbackQuery#1ea2fda7 flags:# query_id:long user_id:long connection_id:string message:Message reply_to_message:flags.2?Message chat_instance:long data:flags.0?bytes = Update;
updateStarsRevenueStatus#a584b019 peer:Peer status:StarsRevenueStatus = Update;
@ -444,6 +451,7 @@ updateSentPhoneCode#504aa18f sent_code:auth.SentCode = Update;
updateGroupCallChainBlocks#a477288f call:InputGroupCall sub_chain_id:int blocks:Vector<bytes> next_offset:int = Update;
updateReadMonoForumInbox#77b0e372 channel_id:long saved_peer_id:Peer read_max_id:int = Update;
updateReadMonoForumOutbox#a4a79376 channel_id:long saved_peer_id:Peer read_max_id:int = Update;
updateMonoForumNoPaidException#9f812b08 flags:# exception:flags.0?true channel_id:long saved_peer_id:Peer = Update;
updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;
@ -653,6 +661,7 @@ inputStickerSetEmojiGenericAnimations#4c4d4ce = InputStickerSet;
inputStickerSetEmojiDefaultStatuses#29d0f5ee = InputStickerSet;
inputStickerSetEmojiDefaultTopicIcons#44c1f8e9 = InputStickerSet;
inputStickerSetEmojiChannelDefaultStatuses#49748553 = InputStickerSet;
inputStickerSetTonGifts#1cf671a0 = InputStickerSet;
stickerSet#2dd14edc flags:# archived:flags.1?true official:flags.2?true masks:flags.3?true emojis:flags.7?true text_color:flags.9?true channel_emoji_status:flags.10?true creator:flags.11?true installed_date:flags.0?int id:long access_hash:long title:string short_name:string thumbs:flags.4?Vector<PhotoSize> thumb_dc_id:flags.4?int thumb_version:flags.4?int thumb_document_id:flags.8?long count:int hash:int = StickerSet;
@ -831,7 +840,7 @@ contacts.topPeers#70b772a8 categories:Vector<TopPeerCategoryPeers> chats:Vector<
contacts.topPeersDisabled#b52c939d = contacts.TopPeers;
draftMessageEmpty#1b0c841a flags:# date:flags.0?int = DraftMessage;
draftMessage#2d65321f flags:# no_webpage:flags.1?true invert_media:flags.6?true reply_to:flags.4?InputReplyTo message:string entities:flags.3?Vector<MessageEntity> media:flags.5?InputMedia date:int effect:flags.7?long = DraftMessage;
draftMessage#96eaa5eb flags:# no_webpage:flags.1?true invert_media:flags.6?true reply_to:flags.4?InputReplyTo message:string entities:flags.3?Vector<MessageEntity> media:flags.5?InputMedia date:int effect:flags.7?long suggested_post:flags.8?SuggestedPost = DraftMessage;
messages.featuredStickersNotModified#c6dc0c66 count:int = messages.FeaturedStickers;
messages.featuredStickers#be382906 flags:# premium:flags.0?true hash:long count:int sets:Vector<StickerSetCovered> unread:Vector<long> = messages.FeaturedStickers;
@ -1211,7 +1220,7 @@ chatOnlines#f041e250 onlines:int = ChatOnlines;
statsURL#47a971e0 url:string = StatsURL;
chatAdminRights#5fb224d5 flags:# change_info:flags.0?true post_messages:flags.1?true edit_messages:flags.2?true delete_messages:flags.3?true ban_users:flags.4?true invite_users:flags.5?true pin_messages:flags.7?true add_admins:flags.9?true anonymous:flags.10?true manage_call:flags.11?true other:flags.12?true manage_topics:flags.13?true post_stories:flags.14?true edit_stories:flags.15?true delete_stories:flags.16?true = ChatAdminRights;
chatAdminRights#5fb224d5 flags:# change_info:flags.0?true post_messages:flags.1?true edit_messages:flags.2?true delete_messages:flags.3?true ban_users:flags.4?true invite_users:flags.5?true pin_messages:flags.7?true add_admins:flags.9?true anonymous:flags.10?true manage_call:flags.11?true other:flags.12?true manage_topics:flags.13?true post_stories:flags.14?true edit_stories:flags.15?true delete_stories:flags.16?true manage_direct_messages:flags.17?true = ChatAdminRights;
chatBannedRights#9f120418 flags:# view_messages:flags.0?true send_messages:flags.1?true send_media:flags.2?true send_stickers:flags.3?true send_gifs:flags.4?true send_games:flags.5?true send_inline:flags.6?true embed_links:flags.7?true send_polls:flags.8?true change_info:flags.10?true invite_users:flags.15?true pin_messages:flags.17?true manage_topics:flags.18?true send_photos:flags.19?true send_videos:flags.20?true send_roundvideos:flags.21?true send_audios:flags.22?true send_voices:flags.23?true send_docs:flags.24?true send_plain:flags.25?true until_date:int = ChatBannedRights;
@ -1416,9 +1425,9 @@ account.resetPasswordFailedWait#e3779861 retry_date:int = account.ResetPasswordR
account.resetPasswordRequestedWait#e9effc7d until_date:int = account.ResetPasswordResult;
account.resetPasswordOk#e926d63e = account.ResetPasswordResult;
sponsoredMessage#4d93a990 flags:# recommended:flags.5?true can_report:flags.12?true random_id:bytes url:string title:string message:string entities:flags.1?Vector<MessageEntity> photo:flags.6?Photo media:flags.14?MessageMedia color:flags.13?PeerColor button_text:string sponsor_info:flags.7?string additional_info:flags.8?string = SponsoredMessage;
sponsoredMessage#7dbf8673 flags:# recommended:flags.5?true can_report:flags.12?true random_id:bytes url:string title:string message:string entities:flags.1?Vector<MessageEntity> photo:flags.6?Photo media:flags.14?MessageMedia color:flags.13?PeerColor button_text:string sponsor_info:flags.7?string additional_info:flags.8?string min_display_duration:flags.15?int max_display_duration:flags.15?int = SponsoredMessage;
messages.sponsoredMessages#c9ee1d87 flags:# posts_between:flags.0?int messages:Vector<SponsoredMessage> chats:Vector<Chat> users:Vector<User> = messages.SponsoredMessages;
messages.sponsoredMessages#ffda656d flags:# posts_between:flags.0?int start_delay:flags.1?int between_delay:flags.2?int messages:Vector<SponsoredMessage> chats:Vector<Chat> users:Vector<User> = messages.SponsoredMessages;
messages.sponsoredMessagesEmpty#1839490f = messages.SponsoredMessages;
searchResultsCalendarPeriod#c9b0539f date:int min_msg_id:int max_msg_id:int count:int = SearchResultsCalendarPeriod;
@ -1724,7 +1733,7 @@ storyReactionPublicRepost#cfcd0f13 peer_id:Peer story:StoryItem = StoryReaction;
stories.storyReactionsList#aa5f789c flags:# count:int reactions:Vector<StoryReaction> chats:Vector<Chat> users:Vector<User> next_offset:flags.0?string = stories.StoryReactionsList;
savedDialog#bd87cb6c flags:# pinned:flags.2?true peer:Peer top_message:int = SavedDialog;
monoForumDialog#64407ea7 flags:# unread_mark:flags.3?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_reactions_count:int draft:flags.1?DraftMessage = SavedDialog;
monoForumDialog#64407ea7 flags:# unread_mark:flags.3?true nopaid_messages_exception:flags.4?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_reactions_count:int draft:flags.1?DraftMessage = SavedDialog;
messages.savedDialogs#f83ae221 dialogs:Vector<SavedDialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.SavedDialogs;
messages.savedDialogsSlice#44ba9dd9 count:int dialogs:Vector<SavedDialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.SavedDialogs;
@ -1829,23 +1838,11 @@ channels.sponsoredMessageReportResultChooseOption#846f9e42 title:string options:
channels.sponsoredMessageReportResultAdsHidden#3e3bcf2f = channels.SponsoredMessageReportResult;
channels.sponsoredMessageReportResultReported#ad798849 = channels.SponsoredMessageReportResult;
stats.broadcastRevenueStats#5407e297 top_hours_graph:StatsGraph revenue_graph:StatsGraph balances:BroadcastRevenueBalances usd_rate:double = stats.BroadcastRevenueStats;
stats.broadcastRevenueWithdrawalUrl#ec659737 url:string = stats.BroadcastRevenueWithdrawalUrl;
broadcastRevenueTransactionProceeds#557e2cc4 amount:long from_date:int to_date:int = BroadcastRevenueTransaction;
broadcastRevenueTransactionWithdrawal#5a590978 flags:# pending:flags.0?true failed:flags.2?true amount:long date:int provider:string transaction_date:flags.1?int transaction_url:flags.1?string = BroadcastRevenueTransaction;
broadcastRevenueTransactionRefund#42d30d2e amount:long date:int provider:string = BroadcastRevenueTransaction;
stats.broadcastRevenueTransactions#87158466 count:int transactions:Vector<BroadcastRevenueTransaction> = stats.BroadcastRevenueTransactions;
reactionNotificationsFromContacts#bac3a61a = ReactionNotificationsFrom;
reactionNotificationsFromAll#4b9e22a0 = ReactionNotificationsFrom;
reactionsNotifySettings#56e34970 flags:# messages_notify_from:flags.0?ReactionNotificationsFrom stories_notify_from:flags.1?ReactionNotificationsFrom sound:NotificationSound show_previews:Bool = ReactionsNotifySettings;
broadcastRevenueBalances#c3ff71e7 flags:# withdrawal_enabled:flags.0?true current_balance:long available_balance:long overall_revenue:long = BroadcastRevenueBalances;
availableEffect#93c3e27e flags:# premium_required:flags.2?true id:long emoticon:string static_icon_id:flags.0?long effect_sticker_id:long effect_animation_id:flags.1?long = AvailableEffect;
messages.availableEffectsNotModified#d1ed9a5b = messages.AvailableEffects;
@ -1864,7 +1861,7 @@ starsTransactionPeerAPI#f9677aad = StarsTransactionPeer;
starsTopupOption#bd915c0 flags:# extended:flags.1?true stars:long store_product:flags.0?string currency:string amount:long = StarsTopupOption;
starsTransaction#a39fd94a flags:# refund:flags.3?true pending:flags.4?true failed:flags.6?true gift:flags.10?true reaction:flags.11?true stargift_upgrade:flags.18?true business_transfer:flags.21?true stargift_resale:flags.22?true id:string stars:StarsAmount 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> subscription_period:flags.12?int giveaway_post_id:flags.13?int stargift:flags.14?StarGift floodskip_number:flags.15?int starref_commission_permille:flags.16?int starref_peer:flags.17?Peer starref_amount:flags.17?StarsAmount paid_messages:flags.19?int premium_gift_months:flags.20?int = StarsTransaction;
starsTransaction#13659eb0 flags:# refund:flags.3?true pending:flags.4?true failed:flags.6?true gift:flags.10?true reaction:flags.11?true stargift_upgrade:flags.18?true business_transfer:flags.21?true stargift_resale:flags.22?true id:string amount:StarsAmount 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> subscription_period:flags.12?int giveaway_post_id:flags.13?int stargift:flags.14?StarGift floodskip_number:flags.15?int starref_commission_permille:flags.16?int starref_peer:flags.17?Peer starref_amount:flags.17?StarsAmount paid_messages:flags.19?int premium_gift_months:flags.20?int ads_proceeds_from_date:flags.23?int ads_proceeds_to_date:flags.23?int = StarsTransaction;
payments.starsStatus#6c9ce8ed flags:# balance:StarsAmount subscriptions:flags.1?Vector<StarsSubscription> subscriptions_next_offset:flags.2?string subscriptions_missing_balance:flags.4?long history:flags.3?Vector<StarsTransaction> next_offset:flags.0?string chats:Vector<Chat> users:Vector<User> = payments.StarsStatus;
@ -1876,7 +1873,7 @@ geoPointAddress#de4c5d93 flags:# country_iso2:string state:flags.0?string city:f
starsRevenueStatus#febe5491 flags:# withdrawal_enabled:flags.0?true current_balance:StarsAmount available_balance:StarsAmount overall_revenue:StarsAmount next_withdrawal_at:flags.1?int = StarsRevenueStatus;
payments.starsRevenueStats#c92bb73b revenue_graph:StatsGraph status:StarsRevenueStatus usd_rate:double = payments.StarsRevenueStats;
payments.starsRevenueStats#6c207376 flags:# top_hours_graph:flags.0?StatsGraph revenue_graph:StatsGraph status:StarsRevenueStatus usd_rate:double = payments.StarsRevenueStats;
payments.starsRevenueWithdrawalUrl#1dab80b7 url:string = payments.StarsRevenueWithdrawalUrl;
@ -1902,11 +1899,11 @@ starsGiveawayOption#94ce852a flags:# extended:flags.0?true default:flags.1?true
starsGiveawayWinnersOption#54236209 flags:# default:flags.0?true users:int per_user_stars:long = StarsGiveawayWinnersOption;
starGift#c62aca28 flags:# limited:flags.0?true sold_out:flags.1?true birthday:flags.2?true id:long sticker:Document stars:long availability_remains:flags.0?int availability_total:flags.0?int availability_resale:flags.4?long convert_stars:long first_sale_date:flags.1?int last_sale_date:flags.1?int upgrade_stars:flags.3?long resell_min_stars:flags.4?long title:flags.5?string = StarGift;
starGiftUnique#6411db89 flags:# id:long title:string slug:string num:int owner_id:flags.0?Peer owner_name:flags.1?string owner_address:flags.2?string attributes:Vector<StarGiftAttribute> availability_issued:int availability_total:int gift_address:flags.3?string resell_stars:flags.4?long = StarGift;
starGift#7f853c12 flags:# limited:flags.0?true sold_out:flags.1?true birthday:flags.2?true id:long sticker:Document stars:long availability_remains:flags.0?int availability_total:flags.0?int availability_resale:flags.4?long convert_stars:long first_sale_date:flags.1?int last_sale_date:flags.1?int upgrade_stars:flags.3?long resell_min_stars:flags.4?long title:flags.5?string released_by:flags.6?Peer = StarGift;
starGiftUnique#f63778ae flags:# id:long title:string slug:string num:int owner_id:flags.0?Peer owner_name:flags.1?string owner_address:flags.2?string attributes:Vector<StarGiftAttribute> availability_issued:int availability_total:int gift_address:flags.3?string resell_stars:flags.4?long released_by:flags.5?Peer = StarGift;
payments.starGiftsNotModified#a388a368 = payments.StarGifts;
payments.starGifts#901689ea hash:int gifts:Vector<StarGift> = payments.StarGifts;
payments.starGifts#2ed82995 hash:int gifts:Vector<StarGift> chats:Vector<Chat> users:Vector<User> = payments.StarGifts;
messageReportOption#7903e3d9 text:string option:bytes = MessageReportOption;
@ -1929,6 +1926,7 @@ payments.connectedStarRefBots#98d5ea1d count:int connected_bots:Vector<Connected
payments.suggestedStarRefBots#b4d5d859 flags:# count:int suggested_bots:Vector<StarRefProgram> users:Vector<User> next_offset:flags.0?string = payments.SuggestedStarRefBots;
starsAmount#bbb6b4a3 amount:long nanos:int = StarsAmount;
starsTonAmount#74aee3e0 amount:long = StarsAmount;
messages.foundStickersNotModified#6010c534 flags:# next_offset:flags.0?int = messages.FoundStickers;
messages.foundStickers#82c9e290 flags:# next_offset:flags.0?int hash:long stickers:Vector<Document> = messages.FoundStickers;
@ -1992,6 +1990,14 @@ stories.canSendStoryCount#c387c04e count_remains:int = stories.CanSendStoryCount
pendingSuggestion#e7e82e12 suggestion:string title:TextWithEntities description:TextWithEntities url:string = PendingSuggestion;
todoItem#cba9a52f id:int title:TextWithEntities = TodoItem;
todoList#49b92a26 flags:# others_can_append:flags.0?true others_can_complete:flags.1?true title:TextWithEntities list:Vector<TodoItem> = TodoList;
todoCompletion#4cc120b7 id:int completed_by:long date:int = TodoCompletion;
suggestedPost#e8e37e5 flags:# accepted:flags.1?true rejected:flags.2?true price:flags.3?StarsAmount schedule_date:flags.0?int = SuggestedPost;
---functions---
invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;
@ -2143,8 +2149,8 @@ account.toggleSponsoredMessages#b9d9a38d enabled:Bool = Bool;
account.getReactionsNotifySettings#6dd654c = ReactionsNotifySettings;
account.setReactionsNotifySettings#316ce548 settings:ReactionsNotifySettings = ReactionsNotifySettings;
account.getCollectibleEmojiStatuses#2e7b4543 hash:long = account.EmojiStatuses;
account.addNoPaidMessagesException#6f688aa7 flags:# refund_charged:flags.0?true user_id:InputUser = Bool;
account.getPaidMessagesRevenue#f1266f38 user_id:InputUser = account.PaidMessagesRevenue;
account.getPaidMessagesRevenue#19ba4a67 flags:# parent_peer:flags.0?InputPeer user_id:InputUser = account.PaidMessagesRevenue;
account.toggleNoPaidMessagesException#fe2eda76 flags:# refund_charged:flags.0?true require_payment:flags.2?true parent_peer:flags.1?InputPeer user_id:InputUser = Bool;
users.getUsers#d91a548 id:Vector<InputUser> = Vector<User>;
users.getFullUser#b60f5918 id:InputUser = users.UserFull;
@ -2188,9 +2194,9 @@ messages.deleteHistory#b08f922a flags:# just_clear:flags.0?true revoke:flags.1?t
messages.deleteMessages#e58e95d2 flags:# revoke:flags.0?true id:Vector<int> = messages.AffectedMessages;
messages.receivedMessages#5a954c0 max_id:int = Vector<ReceivedNotifyMessage>;
messages.setTyping#58943ee2 flags:# peer:InputPeer top_msg_id:flags.0?int action:SendMessageAction = Bool;
messages.sendMessage#fbf2340a flags:# no_webpage:flags.1?true silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true invert_media:flags.16?true allow_paid_floodskip:flags.19?true peer:InputPeer reply_to:flags.0?InputReplyTo message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long allow_paid_stars:flags.21?long = Updates;
messages.sendMedia#a550cd78 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true invert_media:flags.16?true allow_paid_floodskip:flags.19?true peer:InputPeer reply_to:flags.0?InputReplyTo media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long allow_paid_stars:flags.21?long = Updates;
messages.forwardMessages#38f0188c flags:# silent:flags.5?true background:flags.6?true with_my_score:flags.8?true drop_author:flags.11?true drop_media_captions:flags.12?true noforwards:flags.14?true allow_paid_floodskip:flags.19?true from_peer:InputPeer id:Vector<int> random_id:Vector<long> to_peer:InputPeer top_msg_id:flags.9?int reply_to:flags.22?InputReplyTo schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut video_timestamp:flags.20?int allow_paid_stars:flags.21?long = Updates;
messages.sendMessage#fe05dc9a flags:# no_webpage:flags.1?true silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true invert_media:flags.16?true allow_paid_floodskip:flags.19?true peer:InputPeer reply_to:flags.0?InputReplyTo message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long allow_paid_stars:flags.21?long suggested_post:flags.22?SuggestedPost = Updates;
messages.sendMedia#ac55d9c1 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true invert_media:flags.16?true allow_paid_floodskip:flags.19?true peer:InputPeer reply_to:flags.0?InputReplyTo media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long allow_paid_stars:flags.21?long suggested_post:flags.22?SuggestedPost = Updates;
messages.forwardMessages#978928ca flags:# silent:flags.5?true background:flags.6?true with_my_score:flags.8?true drop_author:flags.11?true drop_media_captions:flags.12?true noforwards:flags.14?true allow_paid_floodskip:flags.19?true from_peer:InputPeer id:Vector<int> random_id:Vector<long> to_peer:InputPeer top_msg_id:flags.9?int reply_to:flags.22?InputReplyTo schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut video_timestamp:flags.20?int allow_paid_stars:flags.21?long suggested_post:flags.23?SuggestedPost = Updates;
messages.reportSpam#cf1592db peer:InputPeer = Bool;
messages.getPeerSettings#efd9a6a2 peer:InputPeer = messages.PeerSettings;
messages.report#fc78af9b peer:InputPeer id:Vector<int> option:bytes message:string = ReportResult;
@ -2240,7 +2246,7 @@ messages.editInlineBotMessage#83557dba flags:# no_webpage:flags.1?true invert_me
messages.getBotCallbackAnswer#9342ca07 flags:# game:flags.1?true peer:InputPeer msg_id:int data:flags.0?bytes password:flags.2?InputCheckPasswordSRP = messages.BotCallbackAnswer;
messages.setBotCallbackAnswer#d58f130a flags:# alert:flags.1?true query_id:long message:flags.0?string url:flags.2?string cache_time:int = Bool;
messages.getPeerDialogs#e470bcfd peers:Vector<InputDialogPeer> = messages.PeerDialogs;
messages.saveDraft#d372c5ce flags:# no_webpage:flags.1?true invert_media:flags.6?true reply_to:flags.4?InputReplyTo peer:InputPeer message:string entities:flags.3?Vector<MessageEntity> media:flags.5?InputMedia effect:flags.7?long = Bool;
messages.saveDraft#54ae308e flags:# no_webpage:flags.1?true invert_media:flags.6?true reply_to:flags.4?InputReplyTo peer:InputPeer message:string entities:flags.3?Vector<MessageEntity> media:flags.5?InputMedia effect:flags.7?long suggested_post:flags.8?SuggestedPost = Bool;
messages.getAllDrafts#6a3f8d65 = Updates;
messages.getFeaturedStickers#64780b14 hash:long = messages.FeaturedStickers;
messages.readFeaturedStickers#5b118126 id:Vector<long> = Bool;
@ -2399,13 +2405,16 @@ messages.getPaidReactionPrivacy#472455aa = Updates;
messages.viewSponsoredMessage#269e3643 random_id:bytes = Bool;
messages.clickSponsoredMessage#8235057e flags:# media:flags.0?true fullscreen:flags.1?true random_id:bytes = Bool;
messages.reportSponsoredMessage#12cbf0c4 random_id:bytes option:bytes = channels.SponsoredMessageReportResult;
messages.getSponsoredMessages#9bd2f439 peer:InputPeer = messages.SponsoredMessages;
messages.getSponsoredMessages#3d6ce850 flags:# peer:InputPeer msg_id:flags.0?int = messages.SponsoredMessages;
messages.savePreparedInlineMessage#f21f7f2f flags:# result:InputBotInlineResult user_id:InputUser peer_types:flags.0?Vector<InlineQueryPeerType> = messages.BotPreparedInlineMessage;
messages.getPreparedInlineMessage#857ebdb8 bot:InputUser id:string = messages.PreparedInlineMessage;
messages.searchStickers#29b1c66a flags:# emojis:flags.0?true q:string emoticon:string lang_code:Vector<string> offset:int limit:int hash:long = messages.FoundStickers;
messages.reportMessagesDelivery#5a6d7395 flags:# push:flags.0?true peer:InputPeer id:Vector<int> = Bool;
messages.getSavedDialogsByID#6f6f9c96 flags:# parent_peer:flags.1?InputPeer ids:Vector<InputPeer> = messages.SavedDialogs;
messages.readSavedHistory#ba4a3b5b parent_peer:InputPeer peer:InputPeer max_id:int = Bool;
messages.toggleTodoCompleted#d3e03124 peer:InputPeer msg_id:int completed:Vector<int> incompleted:Vector<int> = Updates;
messages.appendTodoList#21a61057 peer:InputPeer msg_id:int list:Vector<TodoItem> = Updates;
messages.toggleSuggestedPostApproval#8107455c flags:# reject:flags.1?true peer:InputPeer msg_id:int schedule_date:flags.0?int reject_comment:flags.2?string = Updates;
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;
@ -2564,14 +2573,14 @@ payments.applyGiftCode#f6e26854 slug:string = Updates;
payments.getGiveawayInfo#f4239425 peer:InputPeer msg_id:int = payments.GiveawayInfo;
payments.launchPrepaidGiveaway#5ff58f20 peer:InputPeer giveaway_id:long purpose:InputStorePaymentPurpose = Updates;
payments.getStarsTopupOptions#c00ec7d3 = Vector<StarsTopupOption>;
payments.getStarsStatus#104fcfa7 peer:InputPeer = payments.StarsStatus;
payments.getStarsTransactions#69da4557 flags:# inbound:flags.0?true outbound:flags.1?true ascending:flags.2?true subscription_id:flags.3?string peer:InputPeer offset:string limit:int = payments.StarsStatus;
payments.getStarsStatus#4ea9b3bf flags:# ton:flags.0?true peer:InputPeer = payments.StarsStatus;
payments.getStarsTransactions#69da4557 flags:# inbound:flags.0?true outbound:flags.1?true ascending:flags.2?true ton:flags.4?true subscription_id:flags.3?string peer:InputPeer offset:string limit:int = payments.StarsStatus;
payments.sendStarsForm#7998c914 form_id:long invoice:InputInvoice = payments.PaymentResult;
payments.refundStarsCharge#25ae8f4a user_id:InputUser charge_id:string = Updates;
payments.getStarsRevenueStats#d91ffad6 flags:# dark:flags.0?true peer:InputPeer = payments.StarsRevenueStats;
payments.getStarsRevenueWithdrawalUrl#13bbe8b3 peer:InputPeer stars:long password:InputCheckPasswordSRP = payments.StarsRevenueWithdrawalUrl;
payments.getStarsRevenueStats#d91ffad6 flags:# dark:flags.0?true ton:flags.1?true peer:InputPeer = payments.StarsRevenueStats;
payments.getStarsRevenueWithdrawalUrl#2433dc92 flags:# ton:flags.0?true peer:InputPeer amount:flags.1?long password:InputCheckPasswordSRP = payments.StarsRevenueWithdrawalUrl;
payments.getStarsRevenueAdsAccountUrl#d1d7efc5 peer:InputPeer = payments.StarsRevenueAdsAccountUrl;
payments.getStarsTransactionsByID#27842d2e peer:InputPeer id:Vector<InputStarsTransaction> = payments.StarsStatus;
payments.getStarsTransactionsByID#2dca16b8 flags:# ton:flags.0?true peer:InputPeer id:Vector<InputStarsTransaction> = payments.StarsStatus;
payments.getStarsGiftOptions#d3c96bc8 flags:# user_id:flags.0?InputUser = Vector<StarsGiftOption>;
payments.getStarsSubscriptions#32512c5 flags:# missing_balance:flags.0?true peer:InputPeer offset:string = payments.StarsStatus;
payments.changeStarsSubscription#c7770878 flags:# peer:InputPeer subscription_id:string canceled:flags.0?Bool = Bool;
@ -2664,9 +2673,6 @@ stats.getMessagePublicForwards#5f150144 channel:InputChannel msg_id:int offset:s
stats.getMessageStats#b6e0a3f5 flags:# dark:flags.0?true channel:InputChannel msg_id:int = stats.MessageStats;
stats.getStoryStats#374fef40 flags:# dark:flags.0?true peer:InputPeer id:int = stats.StoryStats;
stats.getStoryPublicForwards#a6437ef6 peer:InputPeer id:int offset:string limit:int = stats.PublicForwards;
stats.getBroadcastRevenueStats#f788ee19 flags:# dark:flags.0?true peer:InputPeer = stats.BroadcastRevenueStats;
stats.getBroadcastRevenueWithdrawalUrl#9df4faad peer:InputPeer password:InputCheckPasswordSRP = stats.BroadcastRevenueWithdrawalUrl;
stats.getBroadcastRevenueTransactions#70990b6d peer:InputPeer offset:int limit:int = stats.BroadcastRevenueTransactions;
chatlists.exportChatlistInvite#8472478e chatlist:InputChatlist title:string peers:Vector<InputPeer> = chatlists.ExportedChatlistInvite;
chatlists.deleteExportedInvite#719c5c5e chatlist:InputChatlist slug:string = Bool;
@ -2723,4 +2729,4 @@ smsjobs.finishJob#4f1ebf24 flags:# job_id:string error:flags.0?string = Bool;
fragment.getCollectibleInfo#be1e85ba collectible:InputCollectible = fragment.CollectibleInfo;
// LAYER 204
// LAYER 207

View file

@ -165,6 +165,7 @@ def pyrogram_api():
""",
messages="""
Messages
add_task_to_todo
send_message
forward_media_group
forward_messages
@ -174,6 +175,7 @@ def pyrogram_api():
send_audio
send_document
send_sticker
send_todo
send_video
send_animation
send_voice
@ -185,6 +187,7 @@ def pyrogram_api():
send_contact
send_cached_media
send_reaction
set_todo_tasks_completion
edit_message_text
edit_message_caption
edit_message_media
@ -282,6 +285,7 @@ def pyrogram_api():
hide_general_topic
reopen_forum_topic
reopen_general_topic
transfer_chat_ownership
unhide_general_topic
update_color
update_folder
@ -535,6 +539,11 @@ def pyrogram_api():
MessageOrigin
Photo
Thumbnail
TodoList
TodoTask
TodoTasksAdded
TodoTasksCompleted
TodoTasksIncompleted
Audio
AvailableEffect
Document
@ -734,6 +743,7 @@ def pyrogram_api():
InputVenueMessageContent
InputContactMessageContent
InputInvoiceMessageContent
InputTodoTask
""",
authorization="""
Authorization

View file

@ -80,7 +80,20 @@ Using async_pymongo (Recommended for python3.9+):
print(await app.get_me())
Using motor:
Using official mongodb driver:
.. code-block:: python
from pymongo import AsyncMongoClient
from pyrogram import Client
conn = AsyncMongoClient("mongodb://...")
async with Client("my_account", mongodb=dict(connection=conn, remove_peers=False)) as app:
print(await app.get_me())
Using motor (Deprecated, but still works):
.. code-block:: python

View file

@ -60,7 +60,7 @@ dev = [
docs = [
"sphinx",
"sphinx-immaterial==0.12.4",
"sphinx-immaterial==0.12.5",
"sphinx_copybutton",
"sphinx-autobuild",
"tornado>=6.3.3"

View file

@ -18,7 +18,7 @@
# along with Pyrofork. If not, see <http://www.gnu.org/licenses/>.
__fork_name__ = "PyroFork"
__version__ = "2.3.67"
__version__ = "2.3.68"
__license__ = "GNU Lesser General Public License v3.0 (LGPL-3.0)"
__copyright__ = "Copyright (C) 2022-present Mayuri-Chan <https://github.com/Mayuri-Chan>"

View file

@ -227,6 +227,8 @@ class Client(Methods):
SYSTEM_VERSION = f"{platform.system()} {platform.release()}"
LANG_CODE = "en"
LANG_PACK = ""
SYSTEM_LANG_CODE = "en-US"
PARENT_DIR = Path(sys.argv[0]).parent
@ -252,7 +254,9 @@ class Client(Methods):
app_version: str = APP_VERSION,
device_model: str = DEVICE_MODEL,
system_version: str = SYSTEM_VERSION,
system_lang_code: str = SYSTEM_LANG_CODE,
lang_code: str = LANG_CODE,
lang_pack: str = LANG_PACK,
ipv6: Optional[bool] = False,
alt_port: Optional[bool] = False,
proxy: Optional[dict] = None,
@ -288,7 +292,9 @@ class Client(Methods):
self.app_version = app_version
self.device_model = device_model
self.system_version = system_version
self.system_lang_code = system_lang_code.lower()
self.lang_code = lang_code.lower()
self.lang_pack = lang_pack.lower()
self.ipv6 = ipv6
self.alt_port = alt_port
self.proxy = proxy
@ -445,7 +451,7 @@ class Client(Methods):
return await self.sign_in_bot(value)
else:
self.phone_number = value
if not self.use_qrcode:
sent_code = await self.send_code(self.phone_number)
except BadRequest as e:
print(e.MESSAGE)
@ -453,7 +459,7 @@ class Client(Methods):
self.bot_token = None
else:
break
if not self.use_qrcode:
sent_code_descriptions = {
enums.SentCodeType.APP: "Telegram app",
enums.SentCodeType.SMS: "SMS",

View file

@ -84,3 +84,6 @@ class MessageMediaType(AutoName):
PAID_MEDIA = auto()
"Paid media"
TODO = auto()
"To-Do list media"

View file

@ -135,3 +135,9 @@ class MessageServiceType(AutoName):
PAID_MESSAGE_PRICE_CHANGED = auto()
"Paid message price changed"
TODO_TASKS_ADDED = auto()
"To-Do tasks added"
TODO_TASKS_COMPLETION = auto()
"To-Do tasks completion/incompletion"

View file

@ -796,7 +796,7 @@ from_scheduled = create(from_scheduled_filter)
# region linked_channel_filter
async def linked_channel_filter(_, __, m: Message):
return bool(m.forward_from_chat and not m.from_user)
return bool((m.forward_origin and m.forward_origin.chat) and not m.from_user)
linked_channel = create(linked_channel_filter)

View file

@ -67,6 +67,7 @@ from .set_chat_title import SetChatTitle
from .set_chat_username import SetChatUsername
from .set_send_as_chat import SetSendAsChat
from .set_slow_mode import SetSlowMode
from .transfer_chat_ownership import TransferChatOwnership
from .unarchive_chats import UnarchiveChats
from .unban_chat_member import UnbanChatMember
from .unpin_all_chat_messages import UnpinAllChatMessages
@ -130,6 +131,7 @@ class Chats(
GetSendAsChats,
SetSendAsChat,
SetChatProtectedContent,
TransferChatOwnership,
UpdateColor,
UpdateFolder
):

View file

@ -81,7 +81,7 @@ class GetFolders:
users.update({i.id: i for i in r.users})
chats.update({i.id: i for i in r.chats})
folders = types.List(types.Folder._parse(self, folder, users, chats) for folder in raw_folders)
folders = types.List([types.Folder._parse(self, folder, users, chats) for folder in raw_folders])
if not folders:
return None

View file

@ -0,0 +1,83 @@
# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2022-present Mayuri-Chan <https://github.com/Mayuri-Chan>
#
# This file is part of Pyrofork.
#
# Pyrofork 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.
#
# Pyrofork 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 Pyrofork. If not, see <http://www.gnu.org/licenses/>.
from typing import Union
import pyrogram
from pyrogram import raw, utils
class TransferChatOwnership:
async def transfer_chat_ownership(
self: "pyrogram.Client",
chat_id: Union[int, str],
user_id: Union[int, str],
password: str,
) -> bool:
"""Transfer the owner of a chat or channel to another user.
.. note:
Requires owner privileges.
.. include:: /_includes/usable-by/users.rst
Parameters:
chat_id (``int`` | ``str``):
Unique identifier (int) or username (str) of the target chat.
Unique identifier for the target chat in form of a *t.me/joinchat/* link, identifier (int) or username
of the target channel/supergroup (in the format @username).
user_id (``int`` | ``str``):
Unique identifier (int) or username (str) of the new owner.
For a contact that exists in your Telegram address book you can use his phone number (str).
password (``str``):
The 2-step verification password of the current user.
Returns:
``bool``: True on success.
Raises:
ValueError: In case of invalid parameters.
RPCError: In case of a Telegram RPC error.
Example:
.. code-block:: python
await app.transfer_chat_ownership(chat_id, user_id, "password")
"""
peer_channel = await self.resolve_peer(chat_id)
peer_user = await self.resolve_peer(user_id)
if not isinstance(peer_channel, raw.types.InputPeerChannel):
raise ValueError("The chat_id must belong to a channel/supergroup.")
if not isinstance(peer_user, raw.types.InputPeerUser):
raise ValueError("The user_id must belong to a user.")
r = await self.invoke(
raw.functions.channels.EditCreator(
channel=peer_channel,
user_id=peer_user,
password=utils.compute_password_check(
await self.invoke(raw.functions.account.GetPassword()), password
),
)
)
return bool(r)

View file

@ -20,8 +20,7 @@
from typing import List, Union
import pyrogram
from pyrogram import raw
from pyrogram import enums
from pyrogram import enums, raw, types, utils
class UpdateFolder:
@ -29,6 +28,7 @@ class UpdateFolder:
self: "pyrogram.Client",
folder_id: int,
title: str,
title_entities: List["types.MessageEntity"] = None,
included_chats: Union[Union[int, str], List[Union[int, str]]] = None,
excluded_chats: Union[Union[int, str], List[Union[int, str]]] = None,
pinned_chats: Union[Union[int, str], List[Union[int, str]]] = None,
@ -41,7 +41,8 @@ class UpdateFolder:
exclude_read: bool = None,
exclude_archived: bool = None,
color: "enums.FolderColor" = None,
emoji: str = None
emoji: str = None,
parse_mode: "pyrogram.enums.ParseMode" = pyrogram.enums.ParseMode.DEFAULT
) -> bool:
"""Create or update a user's folder.
@ -54,6 +55,9 @@ class UpdateFolder:
title (``str``):
Folder title.
title_entities (List of :obj:`~pyrogram.types.MessageEntity`, *optional*):
Entities for the folder title.
included_chats (``int`` | ``str`` | List of ``int`` or ``str``, *optional*):
Users or chats that should added in the folder
You can pass an ID (int), username (str) or phone number (str).
@ -98,6 +102,9 @@ class UpdateFolder:
Color type.
Pass :obj:`~pyrogram.enums.FolderColor` to set folder color.
parse_mode (:obj:`~pyrogram.enums.ParseMode`, *optional*):
The parse mode to use for the title.
Returns:
``bool``: True, on success.
@ -107,6 +114,8 @@ class UpdateFolder:
# Create or update folder
app.update_folder(folder_id, title="New folder", included_chats="me")
"""
title_text, title_entities = (await utils.parse_text_entities(self, title, parse_mode, title_entities)).values()
if not isinstance(included_chats, list):
included_chats = [included_chats] if included_chats else []
if not isinstance(excluded_chats, list):
@ -119,7 +128,10 @@ class UpdateFolder:
id=folder_id,
filter=raw.types.DialogFilter(
id=folder_id,
title=title,
title=raw.types.TextWithEntities(
text=title_text,
entities=title_entities or []
),
pinned_peers=[
await self.resolve_peer(user_id)
for user_id in pinned_chats
@ -146,4 +158,4 @@ class UpdateFolder:
)
)
return r
return bool(r)

View file

@ -17,6 +17,7 @@
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrofork. If not, see <http://www.gnu.org/licenses/>.
from .add_task_to_todo import AddTaskToTodo
from .copy_media_group import CopyMediaGroup
from .copy_message import CopyMessage
from .delete_chat_history import DeleteChatHistory
@ -52,6 +53,7 @@ from .search_global_hashtag_messages import SearchGlobalHashtagMessages
from .search_global_hashtag_messages_count import SearchGlobalHashtagMessagesCount
from .search_messages import SearchMessages
from .search_messages_count import SearchMessagesCount
from .set_todo_tasks_completion import SetTodoTasksCompletion
from .send_animation import SendAnimation
from .send_audio import SendAudio
from .send_cached_media import SendCachedMedia
@ -66,6 +68,7 @@ from .send_photo import SendPhoto
from .send_poll import SendPoll
from .send_reaction import SendReaction
from .send_sticker import SendSticker
from .send_todo import SendTodo
from .send_venue import SendVenue
from .send_video import SendVideo
from .send_video_note import SendVideoNote
@ -79,6 +82,7 @@ from .transcribe_audio import TranscribeAudio
from .translate_text import TranslateText
class Messages(
AddTaskToTodo,
DeleteChatHistory,
DeleteMessages,
DeleteScheduledMessages,
@ -93,6 +97,7 @@ class Messages(
GetMessages,
GetMessageReadParticipants,
GetScheduledMessages,
SetTodoTasksCompletion,
SendAudio,
SendChatAction,
SendContact,
@ -103,6 +108,7 @@ class Messages(
SendMessage,
SendPhoto,
SendSticker,
SendTodo,
SendVenue,
SendVideo,
SendVideoNote,

View file

@ -0,0 +1,82 @@
# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2022-present Mayuri-Chan <https://github.com/Mayuri-Chan>
#
# This file is part of Pyrofork.
#
# Pyrofork 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.
#
# Pyrofork 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 Pyrofork. If not, see <http://www.gnu.org/licenses/>.
import pyrogram
from pyrogram import raw, types, utils
from typing import Union, List
class AddTaskToTodo:
async def add_task_to_todo(
self: "pyrogram.Client",
chat_id: Union[int, str],
message_id: Union[int, str],
tasks: List["types.InputTodoTask"],
parse_mode: str = None
) -> "types.Message":
"""Add tasks to a todo list.
Parameters:
chat_id (``int`` | ``str``):
Unique identifier for the target chat or username of the target channel.
message_id (``int`` | ``str``):
Unique identifier for the target message or username of the target channel.
tasks (List of :obj:`~pyrogram.types.InputTodoTask`):
List of tasks to be added to the todo list.
parse_mode (``str``, *optional*):
The parse mode to use for formatting the text.
entities (List of :obj:`~pyrogram.types.MessageEntity`, *optional*):
Entities in the title of the todo list.
"""
tasks_list = []
get_message = await self.get_messages(chat_id, message_id)
if not isinstance(get_message, types.Message):
raise ValueError("The message must be a valid Message object.")
todo_list = get_message.todo
last_task_id = max((task.id for task in todo_list.tasks), default=0)
for i, task in enumerate(tasks):
task_title, task_entities = (await utils.parse_text_entities(self, task.title, parse_mode, task.entities)).values()
tasks_list.append(
raw.types.TodoItem(
id=last_task_id + i + 1,
title=raw.types.TextWithEntities(
text=task_title,
entities=task_entities or []
)
)
)
r = await self.invoke(
raw.functions.messages.AppendTodoList(
peer=await self.resolve_peer(chat_id),
msg_id=message_id,
list=tasks_list
)
)
for update in r.updates:
if isinstance(update, (raw.types.UpdateNewMessage,
raw.types.UpdateNewChannelMessage,
raw.types.UpdateNewScheduledMessage,
raw.types.UpdateBotNewBusinessMessage)):
return types.Message._parse(self, update.message, update, r.users, r.chats)

View file

@ -0,0 +1,99 @@
# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2022-present Mayuri-Chan <https://github.com/Mayuri-Chan>
#
# This file is part of Pyrofork.
#
# Pyrofork 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.
#
# Pyrofork 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 Pyrofork. If not, see <http://www.gnu.org/licenses/>.
import pyrogram
from pyrogram import raw, types, utils
from typing import Union, List
class SendTodo:
async def send_todo(
self: "pyrogram.Client",
chat_id: Union[int, str],
title: str,
tasks: List["types.InputTodoTask"],
entities: List["types.MessageEntity"] = None,
can_append: bool = False,
can_complete: bool = False,
parse_mode: Union[str, None] = None
):
"""Send a todo list to a chat.
Parameters:
chat_id (``int`` | ``str``):
Unique identifier for the target chat or username of the target channel.
title (``str``):
Title of the todo list.
tasks (List of :obj:`~pyrogram.types.TodoTask`):
List of tasks in the todo list.
entities (List of :obj:`~pyrogram.types.MessageEntity`, *optional*):
Entities in the title of the todo list.
can_append (``bool``, *optional*):
True, if other users can append tasks to this todo list.
can_complete (``bool``, *optional*):
True, if other users can complete tasks in this todo list.
"""
title, entities = (await utils.parse_text_entities(self, title, parse_mode, entities)).values()
tasks_list = []
for i, task in enumerate(tasks):
task_title, task_entities = (await utils.parse_text_entities(self, task.title, parse_mode, task.entities)).values()
tasks_list.append(
raw.types.TodoItem(
id=i + 1,
title=raw.types.TextWithEntities(
text=task_title,
entities=task_entities or []
)
)
)
r = await self.invoke(
raw.functions.messages.SendMedia(
peer=await self.resolve_peer(chat_id),
message="",
random_id=self.rnd_id(),
media=raw.types.InputMediaTodo(
todo=raw.types.TodoList(
title=raw.types.TextWithEntities(
text=title,
entities=entities or []
),
list=tasks_list,
others_can_append=can_append,
others_can_complete=can_complete
)
)
)
)
for i in r.updates:
if isinstance(i, (raw.types.UpdateNewMessage,
raw.types.UpdateNewChannelMessage,
raw.types.UpdateNewScheduledMessage,
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},
is_scheduled=isinstance(i, raw.types.UpdateNewScheduledMessage)
)

View file

@ -0,0 +1,76 @@
# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2022-present Mayuri-Chan <https://github.com/Mayuri-Chan>
#
# This file is part of Pyrofork.
#
# Pyrofork 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.
#
# Pyrofork 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 Pyrofork. If not, see <http://www.gnu.org/licenses/>.
from typing import List, Union
from pyrogram import raw, types
class SetTodoTasksCompletion:
async def set_todo_tasks_completion(
self,
chat_id: int | str,
message_id: int,
completed_ids: Union[int, List[int]] = None,
incompleted_ids: Union[int, List[int]] = None
) -> "types.Message":
"""Set the completion status of one or more todo tasks.
Parameters:
chat_id (``int`` | ``str``):
Unique identifier (int) or username (str) of the target chat.
message_id (``int``):
Unique identifier of the message containing the todo list.
completed_ids (``int`` | List of ``int``, *optional*):
Unique identifier of the todo tasks to be marked as completed.
If a list is provided, all tasks in the list will be marked as completed.
incompleted_ids (``int`` | List of ``int``, *optional*):
Unique identifier of the todo tasks to be marked as incomplete.
If a list is provided, all tasks in the list will be marked as incomplete.
"""
is_complete_iterable = None
is_incomplete_iterable = None
if completed_ids:
is_complete_iterable = not isinstance(completed_ids, int)
if incompleted_ids:
is_incomplete_iterable = not isinstance(incompleted_ids, int)
if not is_complete_iterable and not is_incomplete_iterable:
raise ValueError("At least one of completed_ids or incompleted_ids must be provided.")
r = await self.invoke(
raw.functions.messages.ToggleTodoCompleted(
peer=await self.resolve_peer(chat_id),
msg_id=message_id,
completed=(completed_ids if is_complete_iterable else [completed_ids]) if completed_ids else [],
incompleted=(incompleted_ids if is_incomplete_iterable else [incompleted_ids]) if incompleted_ids else []
)
)
for i in r.updates:
if isinstance(i, (raw.types.UpdateNewMessage,
raw.types.UpdateNewChannelMessage,
raw.types.UpdateNewScheduledMessage,
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},
is_scheduled=isinstance(i, raw.types.UpdateNewScheduledMessage)
)

View file

@ -131,9 +131,9 @@ class Session:
app_version=self.client.app_version,
device_model=self.client.device_model,
system_version=self.client.system_version,
system_lang_code=self.client.lang_code,
system_lang_code=self.client.system_lang_code,
lang_code=self.client.lang_code,
lang_pack="",
lang_pack=self.client.lang_pack,
query=raw.functions.help.GetConfig(),
)
),

View file

@ -26,6 +26,7 @@ from .input_location_message_content import InputLocationMessageContent
from .input_venue_message_content import InputVenueMessageContent
from .input_contact_message_content import InputContactMessageContent
from .input_invoice_message_content import InputInvoiceMessageContent
from .input_todo_task import InputTodoTask
__all__ = [
"InputMessageContent",
@ -36,5 +37,6 @@ __all__ = [
"InputLocationMessageContent",
"InputVenueMessageContent",
"InputContactMessageContent",
"InputInvoiceMessageContent"
"InputInvoiceMessageContent",
"InputTodoTask"
]

View file

@ -0,0 +1,37 @@
# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2022-present Mayuri-Chan <https://github.com/Mayuri-Chan>
#
# This file is part of Pyrofork.
#
# Pyrofork 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.
#
# Pyrofork 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 Pyrofork. If not, see <http://www.gnu.org/licenses/>.
from ..object import Object
class InputTodoTask(Object):
"""Contains information about a todo task.
Parameters:
title (``str``):
Title of the task.
entities (List of :obj:`~pyrogram.types.MessageEntity`):
Entities in the title of the task.
"""
def __init__(self, *, title: str, entities: list = None):
super().__init__()
self.title = title
self.entities = entities

View file

@ -55,6 +55,11 @@ from .stickerset import StickerSet
from .stories_privacy_rules import StoriesPrivacyRules
from .stripped_thumbnail import StrippedThumbnail
from .thumbnail import Thumbnail
from .todo_list import TodoList
from .todo_task import TodoTask
from .todo_tasks_added import TodoTasksAdded
from .todo_tasks_completed import TodoTasksCompleted
from .todo_tasks_incompleted import TodoTasksIncompleted
from .venue import Venue
from .video import Video
from .video_note import VideoNote
@ -142,5 +147,10 @@ __all__ = [
"WallpaperSettings",
"TranscribedAudio",
"TranslatedText",
"TextQuote"
"TextQuote",
"TodoList",
"TodoTask",
"TodoTasksAdded",
"TodoTasksCompleted",
"TodoTasksIncompleted"
]

View file

@ -194,6 +194,9 @@ class Message(Object, Update):
paid_media (:obj:`~pyrogram.types.PaidMedia`, *optional*):
Message is a paid media, information about the paid media.
todo (:obj:`~pyrogram.types.Todo`, *optional*):
Message is a todo list, information about the todo list.
sticker (:obj:`~pyrogram.types.Sticker`, *optional*):
Message is a sticker, information about the sticker.
@ -404,6 +407,21 @@ class Message(Object, Update):
gifted_premium (:obj:`~pyrogram.types.GiftedPremium`, *optional*):
Info about a gifted Telegram Premium subscription
screenshot_taken (:obj:`~pyrogram.types.ScreenshotTaken`, *optional*):
Service message: screenshot taken.
paid_message_price_changed (:obj:`~pyrogram.types.PaidMessagePriceChanged`, *optional*):
Service message: paid message price changed.
todo_tasks_added (:obj:`~pyrogram.types.TodoTasksAdded`, *optional*):
Service message: todo tasks added.
todo_tasks_completed (:obj:`~pyrogram.types.TodoTasksCompleted`, *optional*):
Service message: todo tasks completed.
todo_tasks_incompleted (:obj:`~pyrogram.types.TodoTasksIncompleted`, *optional*):
Service message: todo tasks incompleted.
link (``str``, *property*):
Generate a link to this message, only for groups and channels.
@ -468,6 +486,7 @@ class Message(Object, Update):
document: "types.Document" = None,
photo: "types.Photo" = None,
paid_media: "types.PaidMedia" = None,
todo: "types.Todo" = None,
sticker: "types.Sticker" = None,
animation: "types.Animation" = None,
game: "types.Game" = None,
@ -481,6 +500,9 @@ class Message(Object, Update):
gift: "types.Gift" = None,
screenshot_taken: "types.ScreenshotTaken" = None,
paid_message_price_changed: "types.PaidMessagePriceChanged" = None,
todo_tasks_added: "types.TodoTasksAdded" = None,
todo_tasks_completed: "types.TodoTasksCompleted" = None,
todo_tasks_incompleted: "types.TodoTasksIncompleted" = None,
invoice: "types.Invoice" = None,
story: Union["types.MessageStory", "types.Story"] = None,
alternative_videos: List["types.AlternativeVideo"] = None,
@ -584,6 +606,7 @@ class Message(Object, Update):
self.document = document
self.photo = photo
self.paid_media = paid_media
self.todo = todo
self.sticker = sticker
self.animation = animation
self.game = game
@ -598,6 +621,9 @@ class Message(Object, Update):
self.gift = gift
self.screenshot_taken = screenshot_taken
self.paid_message_price_changed = paid_message_price_changed
self.todo_tasks_added = todo_tasks_added
self.todo_tasks_completed = todo_tasks_completed
self.todo_tasks_incompleted = todo_tasks_incompleted
self.invoice = invoice
self.story = story
self.video = video
@ -763,6 +789,9 @@ class Message(Object, Update):
gift = None
screenshot_taken = None
paid_message_price_changed = None
todo_tasks_added = None
todo_tasks_completed = None
todo_tasks_incompleted = None
service_type = None
chat_join_type = None
@ -888,6 +917,7 @@ class Message(Object, Update):
paid_message_price_changed = types.PaidMessagePriceChanged._parse(action)
service_type = enums.MessageServiceType.PAID_MESSAGE_PRICE_CHANGED
parsed_message = Message(
id=message.id,
message_thread_id=message_thread_id,
@ -967,6 +997,34 @@ class Message(Object, Update):
parsed_message.service = enums.MessageServiceType.GAME_HIGH_SCORE
except MessageIdsEmpty:
pass
if isinstance(action, raw.types.MessageActionTodoCompletions):
if action.completed:
parsed_message.todo_tasks_completed = types.TodoTasksCompleted._parse(action)
if action.incompleted:
parsed_message.todo_tasks_incompleted = types.TodoTasksIncompleted._parse(action)
parsed_message.service_type = enums.MessageServiceType.TODO_TASKS_COMPLETION
try:
parsed_message.reply_to_message = await client.get_messages(
parsed_message.chat.id,
reply_to_message_ids=message.id,
replies=0
)
except MessageIdsEmpty:
pass
parsed_message.reply_to_message_id = message.reply_to.reply_to_msg_id
if isinstance(action, raw.types.MessageActionTodoAppendTasks):
parsed_message.todo_tasks_added = types.TodoTasksAdded._parse(client, action)
parsed_message.service = enums.MessageServiceType.TODO_TASKS_ADDED
try:
parsed_message.reply_to_message = await client.get_messages(
parsed_message.chat.id,
reply_to_message_ids=message.id,
replies=0
)
except MessageIdsEmpty:
pass
parsed_message.reply_to_message_id = message.reply_to.reply_to_msg_id
client.message_cache[(parsed_message.chat.id, parsed_message.id)] = parsed_message
@ -1004,6 +1062,7 @@ class Message(Object, Update):
photo = None
paid_media = None
todo = None
location = None
contact = None
venue = None
@ -1130,6 +1189,9 @@ class Message(Object, Update):
elif isinstance(media, raw.types.MessageMediaPaidMedia):
paid_media = types.PaidMedia._parse(client, media)
media_type = enums.MessageMediaType.PAID_MEDIA
elif isinstance(media, raw.types.MessageMediaToDo):
todo = types.TodoList._parse(client, media, users)
media_type = enums.MessageMediaType.TODO
else:
media = None
@ -1199,6 +1261,7 @@ class Message(Object, Update):
invert_media=message.invert_media,
photo=photo,
paid_media=paid_media,
todo=todo,
location=location,
contact=contact,
venue=venue,

View file

@ -0,0 +1,83 @@
# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2022-present Mayuri-Chan <https://github.com/Mayuri-Chan>
#
# This file is part of Pyrofork.
#
# Pyrofork 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.
#
# Pyrofork 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 Pyrofork. If not, see <http://www.gnu.org/licenses/>.
from typing import List, Dict
import pyrogram
from pyrogram import raw, types
from ..object import Object
class TodoList(Object):
"""A list of tasks.
Parameters:
title (``str``):
Title of the todo list.
entities (List of :obj:`~pyrogram.types.MessageEntity`):
Entities in the title of the todo list.
tasks (List of :obj:`~pyrogram.types.TodoTask`):
List of tasks in the todo list.
can_append (``bool``, optional):
True, if other users can append tasks to this todo list.
can_complete (``bool``, optional):
True, if other users can complete tasks in this todo list.
"""
def __init__(
self,
title: str,
entities: List["types.MessageEntity"],
tasks: List["types.TodoTask"] = None,
can_append: bool = False,
can_complete: bool = False
):
super().__init__()
self.title = title
self.entities = entities
self.tasks = tasks
self.can_append = can_append
self.can_complete = can_complete
@staticmethod
def _parse(
client: "pyrogram.Client",
todo: "raw.types.TodoList",
users: Dict
) -> "TodoList":
todo_list = todo.todo
completions = todo.completions
entities = [types.MessageEntity._parse(client, entity, None) for entity in todo_list.title.entities]
entities = types.List(filter(lambda x: x is not None, entities))
tasks = [
types.TodoTask._parse(client, task, users, completions)
for task in todo_list.list
] if todo_list.list else []
return TodoList(
title=todo_list.title.text,
entities=entities,
tasks=tasks,
can_append=todo_list.others_can_append,
can_complete=todo_list.others_can_complete
)

View file

@ -0,0 +1,85 @@
# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2022-present Mayuri-Chan <https://github.com/Mayuri-Chan>
#
# This file is part of Pyrofork.
#
# Pyrofork 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.
#
# Pyrofork 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 Pyrofork. If not, see <http://www.gnu.org/licenses/>.
from typing import List, Dict
import pyrogram
from pyrogram import raw, types, utils
from ..object import Object
class TodoTask(Object):
"""A task in a todo list.
Parameters:
title (``str``):
Title of the task.
entities (List of :obj:`~pyrogram.types.MessageEntity`):
Entities in the title of the task.
is_completed (``bool``):
True, if the task is completed.
completed_by (:obj:`~pyrogram.types.User`, *optional*):
User who completed the task.
complete_date (:obj:`~datetime.datetime`, *optional*):
Date when the task was completed.
"""
def __init__(
self,
id: int,
title: str,
entities: List["types.MessageEntity"],
is_completed: bool,
completed_by: "types.User" = None,
complete_date: "pyrogram.types.datetime" = None
):
super().__init__()
self.id = id
self.title = title
self.entities = entities
self.is_completed = is_completed
self.completed_by = completed_by
self.complete_date = complete_date
@staticmethod
def _parse(
client: "pyrogram.Client",
todo_task: "raw.types.TodoTask",
users: Dict,
completions: List["raw.types.TodoTaskCompletion"] = None
) -> "TodoTask":
entities = [types.MessageEntity._parse(client, entity, None) for entity in todo_task.title.entities]
entities = types.List(filter(lambda x: x is not None, entities))
complete = {i.id: i for i in completions} if completions else {}
todo_completion = complete.get(todo_task.id)
completed_by = types.User._parse(client, users.get(todo_completion.completed_by, None)) if todo_completion else None
complete_date = utils.timestamp_to_datetime(todo_completion.date) if todo_completion else None
return TodoTask(
id=todo_task.id,
title=todo_task.title.text,
entities=entities,
is_completed=True if todo_completion else False,
completed_by=completed_by,
complete_date=complete_date
)

View file

@ -0,0 +1,45 @@
# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2022-present Mayuri-Chan <https://github.com/Mayuri-Chan>
#
# This file is part of Pyrofork.
#
# Pyrofork 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.
#
# Pyrofork 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 Pyrofork. If not, see <http://www.gnu.org/licenses/>.
import pyrogram
from pyrogram import raw, types
from ..object import Object
class TodoTasksAdded(Object):
"""A todo task added to a todo list.
Parameters:
task (:obj:`~pyrogram.types.TodoTask`):
The added todo task.
"""
def __init__(self, tasks: "types.TodoTask"):
super().__init__()
self.tasks = tasks
@staticmethod
def _parse(
client: "pyrogram.Client",
todo_task_added: "raw.types.MessageActionTodoAppendTasks"
) -> "TodoTasksAdded":
return TodoTasksAdded(
tasks=[types.TodoTask._parse(client, task, {}, {}) for task in todo_task_added.list]
)

View file

@ -0,0 +1,44 @@
# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2022-present Mayuri-Chan <https://github.com/Mayuri-Chan>
#
# This file is part of Pyrofork.
#
# Pyrofork 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.
#
# Pyrofork 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 Pyrofork. If not, see <http://www.gnu.org/licenses/>.
from typing import List
from pyrogram import raw
from ..object import Object
class TodoTasksCompleted(Object):
"""One or more todo task/s has been flag as complete.
Parameters:
ids (List of ``int``):
List of Unique identifier of the todo tasks.
"""
def __init__(self, ids: List[int]):
super().__init__()
self.ids = ids
@staticmethod
def _parse(todo_completion: "raw.types.TodoCompletion") -> "TodoTasksCompleted":
ids = [id for id in todo_completion.completed]
return TodoTasksCompleted(
ids=ids,
)

View file

@ -0,0 +1,44 @@
# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2022-present Mayuri-Chan <https://github.com/Mayuri-Chan>
#
# This file is part of Pyrofork.
#
# Pyrofork 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.
#
# Pyrofork 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 Pyrofork. If not, see <http://www.gnu.org/licenses/>.
from typing import List
from pyrogram import raw
from ..object import Object
class TodoTasksIncompleted(Object):
"""One or more todo task/s has been flag as incomplete.
Parameters:
ids (List of ``int``):
List of Unique identifier of the todo tasks.
"""
def __init__(self, ids: List[int]):
super().__init__()
self.ids = ids
@staticmethod
def _parse(todo_completion: "raw.types.TodoCompletion") -> "TodoTasksIncompleted":
ids = [id for id in todo_completion.incompleted]
return TodoTasksIncompleted(
ids=ids,
)

View file

@ -104,6 +104,10 @@ class Gift(Object):
The number of gifts available for purchase.
Returned only if is_limited is True.
resale_amount (``int``, *optional*):
The number of gifts available for resale.
Returned only if is_limited is True.
total_amount (``int``, *optional*):
Total amount of gifts.
Returned only if is_limited is True.
@ -177,6 +181,7 @@ class Gift(Object):
collectible_id: Optional[int] = None,
attributes: Optional[List["types.GiftAttribute"]] = None,
available_amount: Optional[int] = None,
resale_amount: Optional[int] = None,
total_amount: Optional[int] = None,
can_upgrade: Optional[bool] = None,
can_export_at: Optional[datetime] = None,
@ -216,6 +221,7 @@ class Gift(Object):
self.collectible_id = collectible_id
self.attributes = attributes
self.available_amount = available_amount
self.resale_amount = resale_amount
self.total_amount = total_amount
self.can_upgrade = can_upgrade
self.can_export_at = can_export_at
@ -254,6 +260,7 @@ class Gift(Object):
convert_price=star_gift.convert_stars,
upgrade_price=getattr(star_gift, "upgrade_stars", None),
available_amount=getattr(star_gift, "availability_remains", None),
resale_amount=getattr(star_gift, "availability_resale", None),
total_amount=getattr(star_gift, "availability_total", None),
is_limited=getattr(star_gift, "limited", None),
is_sold_out=getattr(star_gift, "sold_out", None),
@ -281,6 +288,7 @@ class Gift(Object):
[await types.GiftAttribute._parse(client, attr, users) for attr in star_gift.attributes]
) or None,
available_amount=getattr(star_gift, "availability_issued", None),
resale_amount=getattr(star_gift, "availability_resale", None),
total_amount=getattr(star_gift, "availability_total", None),
owner=(
types.Chat._parse_chat(client, users.get(owner_id) or

View file

@ -476,9 +476,9 @@ class Chat(Object):
users: Dict[int, "raw.types.User"],
chats: Dict[int, "raw.types.Chat"]
) -> "Chat":
if isinstance(peer, raw.types.PeerUser):
if isinstance(peer, raw.types.PeerUser) or isinstance(peer, raw.types.InputPeerUser):
return Chat._parse_user_chat(client, users[peer.user_id])
elif isinstance(peer, raw.types.PeerChat):
elif isinstance(peer, raw.types.PeerChat) or isinstance(peer, raw.types.InputPeerChat):
return Chat._parse_chat_chat(client, chats[peer.chat_id])
else:
return Chat._parse_channel_chat(client, chats[peer.channel_id])

View file

@ -37,6 +37,9 @@ class Folder(Object):
title (``str``):
The folder title.
title_entities (List of :obj:`~pyrogram.types.MessageEntity`, *optional*):
A list of entities in the folder title.
included_chats (List of :obj:`~pyrogram.types.Chat`, *optional*):
A list of included chats in folder.
@ -83,6 +86,7 @@ class Folder(Object):
client: "pyrogram.Client" = None,
id: int,
title: str,
title_entities: List["types.MessageEntity"] = None,
included_chats: List["types.Chat"] = None,
excluded_chats: List["types.Chat"] = None,
pinned_chats: List["types.Chat"] = None,
@ -102,6 +106,7 @@ class Folder(Object):
self.id = id
self.title = title
self.title_entities = title_entities
self.included_chats = included_chats
self.excluded_chats = excluded_chats
self.pinned_chats = pinned_chats
@ -122,6 +127,9 @@ class Folder(Object):
included_chats = []
excluded_chats = []
pinned_chats = []
title = folder.title
title_text = title.text
title_entities = [types.MessageEntity._parse(client, entity) for entity in title.entities] if title.entities else None
for peer in folder.include_peers:
try:
@ -144,7 +152,8 @@ class Folder(Object):
return Folder(
id=folder.id,
title=folder.title,
title=title_text,
title_entities=title_entities,
included_chats=types.List(included_chats) or None,
excluded_chats=types.List(excluded_chats) or None,
pinned_chats=types.List(pinned_chats) or None,