Skip to content

Commit

Permalink
Merge branch 'Mayuri-Chan:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
eyMarv authored Jan 22, 2024
2 parents edb1fd4 + 9299f02 commit 7fb3813
Show file tree
Hide file tree
Showing 31 changed files with 791 additions and 59 deletions.
31 changes: 22 additions & 9 deletions compiler/api/source/main_api.tl
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,17 @@ storage.fileMp4#b3cea0e4 = storage.FileType;
storage.fileWebp#1081464c = storage.FileType;

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

userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;
userProfilePhoto#82d1f706 flags:# has_video:flags.0?true personal:flags.2?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = UserProfilePhoto;

userStatusEmpty#9d05049 = UserStatus;
userStatusOnline#edb93949 expires:int = UserStatus;
userStatusOffline#8c703f was_online:int = UserStatus;
userStatusRecently#e26f42f1 = UserStatus;
userStatusLastWeek#7bf09fc = UserStatus;
userStatusLastMonth#77ebc742 = UserStatus;
userStatusRecently#7b197dc8 flags:# by_me:flags.0?true = UserStatus;
userStatusLastWeek#541a1d1a flags:# by_me:flags.0?true = UserStatus;
userStatusLastMonth#65899777 flags:# by_me:flags.0?true = UserStatus;

chatEmpty#29562865 id:long = Chat;
chat#41cbf256 flags:# creator:flags.0?true left:flags.2?true deactivated:flags.5?true call_active:flags.23?true call_not_empty:flags.24?true noforwards:flags.25?true id:long title:string photo:ChatPhoto participants_count:int date:int version:int migrated_to:flags.6?InputChannel admin_rights:flags.14?ChatAdminRights default_banned_rights:flags.18?ChatBannedRights = Chat;
Expand Down Expand Up @@ -235,7 +235,7 @@ inputReportReasonFake#f5ddd6e7 = ReportReason;
inputReportReasonIllegalDrugs#a8eb2be = ReportReason;
inputReportReasonPersonalDetails#9ec7863d = ReportReason;

userFull#b9b12c6c flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true voice_messages_forbidden:flags.20?true translations_disabled:flags.23?true stories_pinned_available:flags.26?true blocked_my_stories_from:flags.27?true wallpaper_overridden:flags.28?true id:long about:flags.1?string settings:PeerSettings personal_photo:flags.21?Photo profile_photo:flags.2?Photo fallback_photo:flags.22?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int theme_emoticon:flags.15?string private_forward_name:flags.16?string bot_group_admin_rights:flags.17?ChatAdminRights bot_broadcast_admin_rights:flags.18?ChatAdminRights premium_gifts:flags.19?Vector<PremiumGiftOption> wallpaper:flags.24?WallPaper stories:flags.25?PeerStories = UserFull;
userFull#b9b12c6c flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true voice_messages_forbidden:flags.20?true translations_disabled:flags.23?true stories_pinned_available:flags.26?true blocked_my_stories_from:flags.27?true wallpaper_overridden:flags.28?true contact_require_premium:flags.29?true read_dates_private:flags.30?true id:long about:flags.1?string settings:PeerSettings personal_photo:flags.21?Photo profile_photo:flags.2?Photo fallback_photo:flags.22?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int theme_emoticon:flags.15?string private_forward_name:flags.16?string bot_group_admin_rights:flags.17?ChatAdminRights bot_broadcast_admin_rights:flags.18?ChatAdminRights premium_gifts:flags.19?Vector<PremiumGiftOption> wallpaper:flags.24?WallPaper stories:flags.25?PeerStories = UserFull;

contact#145ade0b user_id:long mutual:Bool = Contact;

Expand Down Expand Up @@ -409,6 +409,7 @@ updateBotMessageReaction#ac21d3ce peer:Peer msg_id:int date:int actor:Peer old_r
updateBotMessageReactions#9cb7759 peer:Peer msg_id:int date:int reactions:Vector<ReactionCount> qts:int = Update;
updateSavedDialogPinned#aeaf9e74 flags:# pinned:flags.0?true peer:DialogPeer = Update;
updatePinnedSavedDialogs#686c85a6 flags:# order:flags.0?Vector<DialogPeer> = Update;
updateSavedReactionTags#39c67432 = Update;

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

Expand Down Expand Up @@ -1267,7 +1268,7 @@ statsGroupTopInviter#535f779d user_id:long invitations:int = StatsGroupTopInvite

stats.megagroupStats#ef7ff916 period:StatsDateRangeDays members:StatsAbsValueAndPrev messages:StatsAbsValueAndPrev viewers:StatsAbsValueAndPrev posters:StatsAbsValueAndPrev growth_graph:StatsGraph members_graph:StatsGraph new_members_by_source_graph:StatsGraph languages_graph:StatsGraph messages_graph:StatsGraph actions_graph:StatsGraph top_hours_graph:StatsGraph weekdays_graph:StatsGraph top_posters:Vector<StatsGroupTopPoster> top_admins:Vector<StatsGroupTopAdmin> top_inviters:Vector<StatsGroupTopInviter> users:Vector<User> = stats.MegagroupStats;

globalPrivacySettings#734c4ccb flags:# archive_and_mute_new_noncontact_peers:flags.0?true keep_archived_unmuted:flags.1?true keep_archived_folders:flags.2?true = GlobalPrivacySettings;
globalPrivacySettings#734c4ccb flags:# archive_and_mute_new_noncontact_peers:flags.0?true keep_archived_unmuted:flags.1?true keep_archived_folders:flags.2?true hide_read_marks:flags.3?true new_noncontact_peers_require_premium:flags.4?true = GlobalPrivacySettings;

help.countryCode#4203c5ef flags:# country_code:string prefixes:flags.0?Vector<string> patterns:flags.1?Vector<string> = help.CountryCode;

Expand Down Expand Up @@ -1375,7 +1376,7 @@ auth.loggedOut#c3a2835f flags:# future_auth_token:flags.0?bytes = auth.LoggedOut

reactionCount#a3d1cb80 flags:# chosen_order:flags.0?int reaction:Reaction count:int = ReactionCount;

messageReactions#4f2b9479 flags:# min:flags.0?true can_see_list:flags.2?true results:Vector<ReactionCount> recent_reactions:flags.1?Vector<MessagePeerReaction> = MessageReactions;
messageReactions#4f2b9479 flags:# min:flags.0?true can_see_list:flags.2?true reactions_as_tags:flags.3?true results:Vector<ReactionCount> recent_reactions:flags.1?Vector<MessagePeerReaction> = MessageReactions;

messages.messageReactionsList#31bd492d flags:# count:int reactions:Vector<MessagePeerReaction> chats:Vector<Chat> users:Vector<User> next_offset:flags.0?string = messages.MessageReactionsList;

Expand Down Expand Up @@ -1652,6 +1653,13 @@ messages.savedDialogs#f83ae221 dialogs:Vector<SavedDialog> messages:Vector<Messa
messages.savedDialogsSlice#44ba9dd9 count:int dialogs:Vector<SavedDialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.SavedDialogs;
messages.savedDialogsNotModified#c01f6fe8 count:int = messages.SavedDialogs;

savedReactionTag#cb6ff828 flags:# reaction:Reaction title:flags.0?string count:int = SavedReactionTag;

messages.savedReactionTagsNotModified#889b59ef = messages.SavedReactionTags;
messages.savedReactionTags#3259950a tags:Vector<SavedReactionTag> hash:long = messages.SavedReactionTags;

outboxReadDate#3bb842ac date:int = OutboxReadDate;

---functions---

invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;
Expand Down Expand Up @@ -1781,6 +1789,7 @@ account.getChannelRestrictedStatusEmojis#35a9e0d5 hash:long = EmojiList;
users.getUsers#d91a548 id:Vector<InputUser> = Vector<User>;
users.getFullUser#b60f5918 id:InputUser = users.UserFull;
users.setSecureValueErrors#90c894b5 id:InputUser errors:Vector<SecureValueError> = Bool;
users.getIsPremiumRequiredToContact#a622aa10 id:Vector<InputUser> = Vector<Bool>;

contacts.getContactIDs#7adc669d hash:long = Vector<int>;
contacts.getStatuses#c4a353ee = Vector<ContactStatus>;
Expand Down Expand Up @@ -1811,7 +1820,7 @@ contacts.setBlocked#94c65c76 flags:# my_stories_from:flags.0?true id:Vector<Inpu
messages.getMessages#63c66506 id:Vector<InputMessage> = messages.Messages;
messages.getDialogs#a0f4cb4f flags:# exclude_pinned:flags.0?true folder_id:flags.1?int offset_date:int offset_id:int offset_peer:InputPeer limit:int hash:long = messages.Dialogs;
messages.getHistory#4423e6c5 peer:InputPeer offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;
messages.search#a7b4e929 flags:# peer:InputPeer q:string from_id:flags.0?InputPeer saved_peer_id:flags.2?InputPeer top_msg_id:flags.1?int filter:MessagesFilter min_date:int max_date:int offset_id:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;
messages.search#29ee847a flags:# peer:InputPeer q:string from_id:flags.0?InputPeer saved_peer_id:flags.2?InputPeer saved_reaction:flags.3?Vector<Reaction> top_msg_id:flags.1?int filter:MessagesFilter min_date:int max_date:int offset_id:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;
messages.readHistory#e306d3a peer:InputPeer max_id:int = messages.AffectedMessages;
messages.deleteHistory#b08f922a flags:# just_clear:flags.0?true revoke:flags.1?true peer:InputPeer max_id:int min_date:flags.2?int max_date:flags.3?int = messages.AffectedHistory;
messages.deleteMessages#e58e95d2 flags:# revoke:flags.0?true id:Vector<int> = messages.AffectedMessages;
Expand Down Expand Up @@ -2002,6 +2011,10 @@ messages.deleteSavedHistory#6e98102b flags:# peer:InputPeer max_id:int min_date:
messages.getPinnedSavedDialogs#d63d94e0 = messages.SavedDialogs;
messages.toggleSavedDialogPin#ac81bbde flags:# pinned:flags.0?true peer:InputDialogPeer = Bool;
messages.reorderPinnedSavedDialogs#8b716587 flags:# force:flags.0?true order:Vector<InputDialogPeer> = Bool;
messages.getSavedReactionTags#761ddacf hash:long = messages.SavedReactionTags;
messages.updateSavedReactionTag#60297dec flags:# reaction:Reaction title:flags.0?string = Bool;
messages.getDefaultTagReactions#bdf93428 hash:long = messages.Reactions;
messages.getOutboxReadDate#8c4bfe5d peer:InputPeer msg_id:int = OutboxReadDate;

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;
Expand Down Expand Up @@ -2244,4 +2257,4 @@ premium.applyBoost#6b7da746 flags:# slots:flags.0?Vector<int> peer:InputPeer = p
premium.getBoostsStatus#42f1f61 peer:InputPeer = premium.BoostsStatus;
premium.getUserBoosts#39854d1f peer:InputPeer user_id:InputUser = premium.BoostsList;

// LAYER 170
// LAYER 172
5 changes: 5 additions & 0 deletions compiler/docs/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,11 @@ def get_title_list(s: str) -> list:
ForumTopicReopened
GeneralTopicHidden
GeneralTopicUnhidden
Reaction
ReactionCount
ReactionType
MessageReactionUpdated
MessageReactionCountUpdated
""",
stories="""
Stories
Expand Down
1 change: 1 addition & 0 deletions compiler/errors/source/400_BAD_REQUEST.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ RESULTS_TOO_MUCH The result contains too many items
RESULT_ID_DUPLICATE The result contains items with duplicated identifiers
RESULT_ID_EMPTY Result ID empty
RESULT_ID_INVALID The given result cannot be used to send the selection to the bot
REACTIONS_TOO_MANY Currently, non-premium users, can set up to one reaction per message
RESULT_TYPE_INVALID The result type is invalid
REVOTE_NOT_ALLOWED You cannot change your vote
RSA_DECRYPT_FAILED Internal RSA decryption failed
Expand Down
1 change: 1 addition & 0 deletions compiler/errors/source/403_FORBIDDEN.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ MESSAGE_AUTHOR_REQUIRED You are not the author of this message
MESSAGE_DELETE_FORBIDDEN You don't have rights to delete messages in this chat, most likely because you are not the author of them
POLL_VOTE_REQUIRED Cast a vote in the poll before calling this method
PREMIUM_ACCOUNT_REQUIRED This action requires a premium account
PRIVACY_PREMIUM_REQUIRED The user has restricted from sending messages OR This action requires a premium account
RIGHT_FORBIDDEN You don't have enough rights for this action, or you tried to set one or more admin rights that can't be applied to this kind of chat (channel or supergroup)
SENSITIVE_CHANGE_FORBIDDEN Your sensitive content settings can't be changed at this time
TAKEOUT_REQUIRED The method must be invoked inside a takeout session
Expand Down
4 changes: 3 additions & 1 deletion compiler/errors/source/420_FLOOD.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ id message
2FA_CONFIRM_WAIT_X A wait of {value} seconds is required because this account is active and protected by a 2FA password
FLOOD_TEST_PHONE_WAIT_X A wait of {value} seconds is required in the test servers
FLOOD_WAIT_X A wait of {value} seconds is required
SLOWMODE_WAIT_X A wait of {value} seconds is required to send messages in this chat.
PREMIUM_SUB_ACTIVE_UNTIL_X A wait of {value} seconds is required
SLOWMODE_WAIT_X A wait of {value} seconds is required to send messages in this chat
STORY_SEND_FLOOD_X A wait of {value} seconds is required to continue posting stories
TAKEOUT_INIT_DELAY_X You have to confirm the data export request using one of your mobile devices or wait {value} seconds
4 changes: 4 additions & 0 deletions docs/source/api/decorators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ Index
- :meth:`~Client.on_message`
- :meth:`~Client.on_edited_message`
- :meth:`~Client.on_callback_query`
- :meth:`~Client.on_message_reaction_updated`
- :meth:`~Client.on_message_reaction_count_updated`
- :meth:`~Client.on_inline_query`
- :meth:`~Client.on_chosen_inline_result`
- :meth:`~Client.on_chat_member_updated`
Expand All @@ -58,6 +60,8 @@ Details
.. autodecorator:: pyrogram.Client.on_message()
.. autodecorator:: pyrogram.Client.on_edited_message()
.. autodecorator:: pyrogram.Client.on_callback_query()
.. autodecorator:: pyrogram.Client.on_message_reaction_updated()
.. autodecorator:: pyrogram.Client.on_message_reaction_count_updated()
.. autodecorator:: pyrogram.Client.on_inline_query()
.. autodecorator:: pyrogram.Client.on_chosen_inline_result()
.. autodecorator:: pyrogram.Client.on_chat_member_updated()
Expand Down
8 changes: 8 additions & 0 deletions docs/source/api/enums/ReactionType.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ReactionType
============

.. autoclass:: pyrogram.enums.ReactionType()
:members:

.. raw:: html
:file: ./cleanup.html
2 changes: 2 additions & 0 deletions docs/source/api/enums/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ to apply only a valid value among the expected ones.
SentCodeType
NextCodeType
UserStatus
ReactionType
StoriesPrivacyRules
StoryPrivacy

Expand All @@ -49,5 +50,6 @@ to apply only a valid value among the expected ones.
SentCodeType
NextCodeType
UserStatus
ReactionType
StoriesPrivacyRules
StoryPrivacy
4 changes: 4 additions & 0 deletions docs/source/api/handlers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ Index
- :class:`EditedMessageHandler`
- :class:`DeletedMessagesHandler`
- :class:`CallbackQueryHandler`
- :class:`MessageReactionUpdatedHandler`
- :class:`MessageReactionCountUpdatedHandler`
- :class:`InlineQueryHandler`
- :class:`ChosenInlineResultHandler`
- :class:`ChatMemberUpdatedHandler`
Expand All @@ -58,6 +60,8 @@ Details
.. autoclass:: EditedMessageHandler()
.. autoclass:: DeletedMessagesHandler()
.. autoclass:: CallbackQueryHandler()
.. autoclass:: MessageReactionUpdatedHandler()
.. autoclass:: MessageReactionCountUpdatedHandler()
.. autoclass:: InlineQueryHandler()
.. autoclass:: ChosenInlineResultHandler()
.. autoclass:: ChatMemberUpdatedHandler()
Expand Down
5 changes: 5 additions & 0 deletions pyrogram/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,9 @@ async def handle_download(self, packet):
if isinstance(e, asyncio.CancelledError):
raise e

if isinstance(e, pyrogram.errors.FloodWait):
raise e

return None
else:
if in_memory:
Expand Down Expand Up @@ -1070,6 +1073,8 @@ async def get_file(
await cdn_session.stop()
except pyrogram.StopTransmission:
raise
except pyrogram.errors.FloodWait:
raise
except Exception as e:
log.exception(e)
finally:
Expand Down
Loading

0 comments on commit 7fb3813

Please sign in to comment.