Merge branch 'v2'

v2 is still not complete. A lot of cleanup still needs to be done.
In particular, entities still need some care. However, most of it
is there, and keeping up with two branches is annoying.
This also lets me close a lot of issues to reduce noise
and focus on the important ones.

Closes #354 (input entities have been reworked).
Closes #902 (sessions were overhauled).
Closes #1125, #3253, #1589, #1634, #3150, #3668 (updates are reworked, gaps are properly handled now).
Closes #1169 (2.0 is now merged).
Closes #1311 (proper usage should not trigger this issue on the reworked connection code).
Closes #1327 (there have been some stringify changes).
Closes #1330 (gaps are now detected).
Closes #1366 (sessions are now async).
Closes #1476, #1484 (asyncio open connection is no longer used).
Closes #1529 (commonmark is now used).
Closes #1721 (update gaps are now properly handled).
Closes #1724 (a gap that fixes this will eventually trigger).
Closes #3006 (force_sms is gone).
Closes #3041 (a clean implementation to get difference now exists).
Closes #3049 (commonmark is now used).
Closes #3111 (to_dict has changed).
Closes #3117 (SMS is no longer an option).
Closes #3171 (connectivity bug is unlikely to be a bug in the library).
Closes #3206 (Telethon cannot really fix broken SSL).
Closes #3214, #3257, #3661 (not enough information).
Closes #3215 (this had already been fixed).
Closes #3230, #3674 (entities were reworked).
Closes #3234, #3238, #3245, #3258, #3264 (the layer has been updated).
Closes #3242 (bot-API file IDs have been removed).
Closes #3244 (the error is now documented).
Closes #3249 (errors have been reworked).
This commit is contained in:
Lonami Exo
2022-01-24 13:24:35 +01:00
172 changed files with 13073 additions and 14097 deletions

View File

@@ -123,13 +123,13 @@ userStatusLastWeek#7bf09fc = UserStatus;
userStatusLastMonth#77ebc742 = UserStatus;
chatEmpty#29562865 id:long = Chat;
chat#41cbf256 flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?true deactivated:flags.5?true call_active:flags.23?true call_not_empty:flags.24?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;
chat#41cbf256 flags:# creator:flags.0?true kicked:flags.1?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;
chatForbidden#6592a1a7 id:long title:string = Chat;
channel#8261ac61 flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true call_active:flags.23?true call_not_empty:flags.24?true fake:flags.25?true gigagroup:flags.26?true id:long access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int restriction_reason:flags.9?Vector<RestrictionReason> admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int = Chat;
channel#8261ac61 flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true call_active:flags.23?true call_not_empty:flags.24?true fake:flags.25?true gigagroup:flags.26?true noforwards:flags.27?true id:long access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int restriction_reason:flags.9?Vector<RestrictionReason> admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int = Chat;
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#4dbdc099 flags:# can_set_username:flags.7?true has_scheduled:flags.8?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 = ChatFull;
channelFull#e9b27a17 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 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 = ChatFull;
chatFull#d18ee226 flags:# can_set_username:flags.7?true has_scheduled:flags.8?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?Vector<string> = ChatFull;
channelFull#e13c3d20 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 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?Vector<string> = ChatFull;
chatParticipant#c02d4007 user_id:long inviter_id:long date:int = ChatParticipant;
chatParticipantCreator#e46bcee4 user_id:long = ChatParticipant;
@@ -142,7 +142,7 @@ 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#85d6cbe2 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 id:int from_id:flags.8?Peer peer_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?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 restriction_reason:flags.22?Vector<RestrictionReason> ttl_period:flags.25?int = Message;
message#38116ee0 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 id:int from_id:flags.8?Peer peer_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?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 = Message;
messageService#2b085862 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?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 ttl_period:flags.25?int = Message;
messageMediaEmpty#3ded6320 = MessageMedia;
@@ -188,6 +188,7 @@ messageActionInviteToGroupCall#502f92f7 call:InputGroupCall users:Vector<long> =
messageActionSetMessagesTTL#aa1afbfd period:int = MessageAction;
messageActionGroupCallScheduled#b3a07661 call:InputGroupCall schedule_date:int = MessageAction;
messageActionSetChatTheme#aa786345 emoticon:string = MessageAction;
messageActionChatJoinedByRequest#ebbca3cb = MessageAction;
dialog#2c171f72 flags:# pinned:flags.2?true unread_mark:flags.3?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?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;
@@ -207,7 +208,7 @@ geoPoint#b2a2f663 flags:# long:double lat:double access_hash:long accuracy_radiu
auth.sentCode#5e002502 flags:# type:auth.SentCodeType phone_code_hash:string next_type:flags.1?auth.CodeType timeout:flags.2?int = auth.SentCode;
auth.authorization#cd050916 flags:# tmp_sessions:flags.0?int user:User = auth.Authorization;
auth.authorization#33fb7bb8 flags:# setup_password_required:flags.1?true otherwise_relogin_days:flags.1?int tmp_sessions:flags.0?int user:User = auth.Authorization;
auth.authorizationSignUpRequired#44747e9a flags:# terms_of_service:flags.0?help.TermsOfService = auth.Authorization;
auth.exportedAuthorization#b434e2b8 id:long bytes:bytes = auth.ExportedAuthorization;
@@ -221,7 +222,7 @@ inputPeerNotifySettings#9c3d198e flags:# show_previews:flags.0?Bool silent:flags
peerNotifySettings#af509d20 flags:# show_previews:flags.0?Bool silent:flags.1?Bool mute_until:flags.2?int sound:flags.3?string = PeerNotifySettings;
peerSettings#733f2961 flags:# report_spam:flags.0?true add_contact:flags.1?true block_contact:flags.2?true share_contact:flags.3?true need_contacts_exception:flags.4?true report_geo:flags.5?true autoarchived:flags.7?true invite_members:flags.8?true geo_distance:flags.6?int = PeerSettings;
peerSettings#a518110d flags:# report_spam:flags.0?true add_contact:flags.1?true block_contact:flags.2?true share_contact:flags.3?true need_contacts_exception:flags.4?true report_geo:flags.5?true autoarchived:flags.7?true invite_members:flags.8?true request_chat_broadcast:flags.10?true geo_distance:flags.6?int request_chat_title:flags.9?string request_chat_date:flags.9?int = PeerSettings;
wallPaper#a437c3ed id:long flags:# creator:flags.0?true default:flags.1?true pattern:flags.3?true dark:flags.4?true access_hash:long slug:string document:Document settings:flags.2?WallPaperSettings = WallPaper;
wallPaperNoFile#e0804116 id:long flags:# default:flags.1?true dark:flags.4?true settings:flags.2?WallPaperSettings = WallPaper;
@@ -235,7 +236,7 @@ inputReportReasonCopyright#9b89f93a = ReportReason;
inputReportReasonGeoIrrelevant#dbd4feed = ReportReason;
inputReportReasonFake#f5ddd6e7 = ReportReason;
userFull#d697ff05 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 user:User about:flags.1?string settings:PeerSettings profile_photo:flags.2?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 = UserFull;
userFull#cf366521 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 id:long about:flags.1?string settings:PeerSettings profile_photo:flags.2?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 = UserFull;
contact#145ade0b user_id:long mutual:Bool = Contact;
@@ -378,6 +379,9 @@ updateChannelParticipant#985d3abb flags:# channel_id:long date:int actor_id:long
updateBotStopped#c4870a49 user_id:long date:int stopped:Bool qts:int = Update;
updateGroupCallConnection#b783982 flags:# presentation:flags.0?true params:DataJSON = Update;
updateBotCommands#4d712f2e peer:Peer bot_id:long commands:Vector<BotCommand> = Update;
updatePendingJoinRequests#7063c3db peer:Peer requests_pending:int recent_requesters:Vector<long> = Update;
updateBotChatInviteRequester#11dfa986 peer:Peer date:int user_id:long about:string invite:ExportedChatInvite qts:int = Update;
updateMessageReactions#154798c3 peer:Peer msg_id:int reactions:MessageReactions = Update;
updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;
@@ -535,9 +539,9 @@ webPagePending#c586da1c id:long date:int = WebPage;
webPage#e89c45b2 flags:# id:long url:string display_url:string hash:int type:flags.0?string site_name:flags.1?string title:flags.2?string description:flags.3?string photo:flags.4?Photo embed_url:flags.5?string embed_type:flags.5?string embed_width:flags.6?int embed_height:flags.6?int duration:flags.7?int author:flags.8?string document:flags.9?Document cached_page:flags.10?Page attributes:flags.12?Vector<WebPageAttribute> = WebPage;
webPageNotModified#7311ca11 flags:# cached_page_views:flags.0?int = WebPage;
authorization#ad01d61d flags:# current:flags.0?true official_app:flags.1?true password_pending:flags.2?true hash:long device_model:string platform:string system_version:string api_id:int app_name:string app_version:string date_created:int date_active:int ip:string country:string region:string = Authorization;
authorization#ad01d61d flags:# current:flags.0?true official_app:flags.1?true password_pending:flags.2?true encrypted_requests_disabled:flags.3?true call_requests_disabled:flags.4?true hash:long device_model:string platform:string system_version:string api_id:int app_name:string app_version:string date_created:int date_active:int ip:string country:string region:string = Authorization;
account.authorizations#1250abde authorizations:Vector<Authorization> = account.Authorizations;
account.authorizations#4bff8ea0 authorization_ttl_days:int authorizations:Vector<Authorization> = account.Authorizations;
account.password#185b184f flags:# has_recovery:flags.0?true has_secure_values:flags.1?true has_password:flags.2?true current_algo:flags.2?PasswordKdfAlgo srp_B:flags.2?bytes srp_id:flags.2?long hint:flags.3?string email_unconfirmed_pattern:flags.4?string new_algo:PasswordKdfAlgo new_secure_algo:SecurePasswordKdfAlgo secure_random:bytes pending_reset_date:flags.5?int = account.Password;
@@ -549,10 +553,10 @@ auth.passwordRecovery#137948a5 email_pattern:string = auth.PasswordRecovery;
receivedNotifyMessage#a384b779 id:int flags:int = ReceivedNotifyMessage;
chatInviteExported#b18105e8 flags:# revoked:flags.0?true permanent:flags.5?true link:string admin_id:long date:int start_date:flags.4?int expire_date:flags.1?int usage_limit:flags.2?int usage:flags.3?int = ExportedChatInvite;
chatInviteExported#ab4a819 flags:# revoked:flags.0?true permanent:flags.5?true request_needed:flags.6?true link:string admin_id:long date:int start_date:flags.4?int expire_date:flags.1?int usage_limit:flags.2?int usage:flags.3?int requested:flags.7?int title:flags.8?string = ExportedChatInvite;
chatInviteAlready#5a686d7c chat:Chat = ChatInvite;
chatInvite#dfc2f58e flags:# channel:flags.0?true broadcast:flags.1?true public:flags.2?true megagroup:flags.3?true title:string photo:Photo participants_count:int participants:flags.4?Vector<User> = ChatInvite;
chatInvite#300c44c1 flags:# channel:flags.0?true broadcast:flags.1?true public:flags.2?true megagroup:flags.3?true request_needed:flags.6?true title:string about:flags.5?string photo:Photo participants_count:int participants:flags.4?Vector<User> = ChatInvite;
chatInvitePeek#61695cb0 chat:Chat expires:int = ChatInvite;
inputStickerSetEmpty#ffb62b95 = InputStickerSet;
@@ -565,6 +569,7 @@ inputStickerSetAnimatedEmojiAnimations#cde3739 = InputStickerSet;
stickerSet#d7df217a flags:# archived:flags.1?true official:flags.2?true masks:flags.3?true animated:flags.5?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 count:int hash:int = StickerSet;
messages.stickerSet#b60a24a6 set:StickerSet packs:Vector<StickerPack> documents:Vector<Document> = messages.StickerSet;
messages.stickerSetNotModified#d3f924eb = messages.StickerSet;
botCommand#c27ac8c7 command:string description:string = BotCommand;
@@ -581,6 +586,8 @@ keyboardButtonBuy#afd93fbb text:string = KeyboardButton;
keyboardButtonUrlAuth#10b78d29 flags:# text:string fwd_text:flags.0?string url:string button_id:int = KeyboardButton;
inputKeyboardButtonUrlAuth#d02e7fd4 flags:# request_write_access:flags.0?true text:string fwd_text:flags.1?string url:string bot:InputUser = KeyboardButton;
keyboardButtonRequestPoll#bbc7515d flags:# quiz:flags.0?Bool text:string = KeyboardButton;
inputKeyboardButtonUserProfile#e988037b text:string user_id:InputUser = KeyboardButton;
keyboardButtonUserProfile#308660c1 text:string user_id:long = KeyboardButton;
keyboardButtonRow#77608b83 buttons:Vector<KeyboardButton> = KeyboardButtonRow;
@@ -608,6 +615,7 @@ messageEntityUnderline#9c4e7e8b offset:int length:int = MessageEntity;
messageEntityStrike#bf0693d4 offset:int length:int = MessageEntity;
messageEntityBlockquote#20df5d0 offset:int length:int = MessageEntity;
messageEntityBankCard#761e6af4 offset:int length:int = MessageEntity;
messageEntitySpoiler#32ca960f offset:int length:int = MessageEntity;
inputChannelEmpty#ee8c1e86 = InputChannel;
inputChannel#f35aec28 channel_id:long access_hash:long = InputChannel;
@@ -625,7 +633,7 @@ channelMessagesFilterEmpty#94d42ee7 = ChannelMessagesFilter;
channelMessagesFilter#cd77d957 flags:# exclude_new_messages:flags.1?true ranges:Vector<MessageRange> = ChannelMessagesFilter;
channelParticipant#c00c07c0 user_id:long date:int = ChannelParticipant;
channelParticipantSelf#28a8bc67 user_id:long inviter_id:long date:int = ChannelParticipant;
channelParticipantSelf#35a8bfa7 flags:# via_request:flags.0?true user_id:long inviter_id:long date:int = ChannelParticipant;
channelParticipantCreator#2fe601d3 flags:# user_id:long admin_rights:ChatAdminRights rank:flags.0?string = ChannelParticipant;
channelParticipantAdmin#34c3bb53 flags:# can_edit:flags.0?true self:flags.1?true user_id:long inviter_id:flags.1?long promoted_by:long date:int admin_rights:ChatAdminRights rank:flags.2?string = ChannelParticipant;
channelParticipantBanned#6df8014e flags:# left:flags.0?true peer:Peer kicked_by:long date:int banned_rights:ChatBannedRights = ChannelParticipant;
@@ -682,11 +690,13 @@ messageFwdHeader#5f777dce flags:# imported:flags.7?true from_id:flags.0?Peer fro
auth.codeTypeSms#72a3158c = auth.CodeType;
auth.codeTypeCall#741cd3e3 = auth.CodeType;
auth.codeTypeFlashCall#226ccefb = auth.CodeType;
auth.codeTypeMissedCall#d61ad6ee = auth.CodeType;
auth.sentCodeTypeApp#3dbb5986 length:int = auth.SentCodeType;
auth.sentCodeTypeSms#c000bba2 length:int = auth.SentCodeType;
auth.sentCodeTypeCall#5353e5a7 length:int = auth.SentCodeType;
auth.sentCodeTypeFlashCall#ab03c6d9 pattern:string = auth.SentCodeType;
auth.sentCodeTypeMissedCall#82006484 prefix:string length:int = auth.SentCodeType;
messages.botCallbackAnswer#36585ea4 flags:# alert:flags.1?true has_url:flags.3?true native_ui:flags.4?true message:flags.0?string url:flags.2?string cache_time:int = messages.BotCallbackAnswer;
@@ -908,12 +918,16 @@ channelAdminLogEventActionExportedInviteRevoke#410a134e invite:ExportedChatInvit
channelAdminLogEventActionExportedInviteEdit#e90ebb59 prev_invite:ExportedChatInvite new_invite:ExportedChatInvite = ChannelAdminLogEventAction;
channelAdminLogEventActionParticipantVolume#3e7f6847 participant:GroupCallParticipant = ChannelAdminLogEventAction;
channelAdminLogEventActionChangeHistoryTTL#6e941a38 prev_value:int new_value:int = ChannelAdminLogEventAction;
channelAdminLogEventActionParticipantJoinByRequest#afb6144a invite:ExportedChatInvite approved_by:long = ChannelAdminLogEventAction;
channelAdminLogEventActionToggleNoForwards#cb2ac766 new_value:Bool = ChannelAdminLogEventAction;
channelAdminLogEventActionSendMessage#278f2868 message:Message = ChannelAdminLogEventAction;
channelAdminLogEventActionChangeAvailableReactions#9cf7f76a prev_value:Vector<string> new_value:Vector<string> = ChannelAdminLogEventAction;
channelAdminLogEvent#1fad68cd id:long date:int user_id:long action:ChannelAdminLogEventAction = ChannelAdminLogEvent;
channels.adminLogResults#ed8af74d events:Vector<ChannelAdminLogEvent> chats:Vector<Chat> users:Vector<User> = channels.AdminLogResults;
channelAdminLogEventsFilter#ea107ae4 flags:# join:flags.0?true leave:flags.1?true invite:flags.2?true ban:flags.3?true unban:flags.4?true kick:flags.5?true unkick:flags.6?true promote:flags.7?true demote:flags.8?true info:flags.9?true settings:flags.10?true pinned:flags.11?true edit:flags.12?true delete:flags.13?true group_call:flags.14?true invites:flags.15?true = ChannelAdminLogEventsFilter;
channelAdminLogEventsFilter#ea107ae4 flags:# join:flags.0?true leave:flags.1?true invite:flags.2?true ban:flags.3?true unban:flags.4?true kick:flags.5?true unkick:flags.6?true promote:flags.7?true demote:flags.8?true info:flags.9?true settings:flags.10?true pinned:flags.11?true edit:flags.12?true delete:flags.13?true group_call:flags.14?true invites:flags.15?true send:flags.16?true = ChannelAdminLogEventsFilter;
popularContact#5ce14175 client_id:long importers:int = PopularContact;
@@ -1082,7 +1096,7 @@ inputWallPaperNoFile#967a462e id:long = InputWallPaper;
account.wallPapersNotModified#1c199183 = account.WallPapers;
account.wallPapers#cdc3858c hash:long wallpapers:Vector<WallPaper> = account.WallPapers;
codeSettings#debebe83 flags:# allow_flashcall:flags.0?true current_number:flags.1?true allow_app_hash:flags.4?true = CodeSettings;
codeSettings#8a6469c2 flags:# allow_flashcall:flags.0?true current_number:flags.1?true allow_app_hash:flags.4?true allow_missed_call:flags.5?true logout_tokens:flags.6?Vector<bytes> = CodeSettings;
wallPaperSettings#1dc1bca4 flags:# blur:flags.1?true motion:flags.2?true background_color:flags.0?int second_background_color:flags.4?int third_background_color:flags.5?int fourth_background_color:flags.6?int intensity:flags.3?int rotation:flags.4?int = WallPaperSettings;
@@ -1122,7 +1136,7 @@ restrictionReason#d072acb4 platform:string reason:string text:string = Restricti
inputTheme#3c5693e9 id:long access_hash:long = InputTheme;
inputThemeSlug#f5890df1 slug:string = InputTheme;
theme#e802b8dc flags:# creator:flags.0?true default:flags.1?true for_chat:flags.5?true id:long access_hash:long slug:string title:string document:flags.2?Document settings:flags.3?ThemeSettings installs_count:flags.4?int = Theme;
theme#a00e67d6 flags:# creator:flags.0?true default:flags.1?true for_chat:flags.5?true id:long access_hash:long slug:string title:string document:flags.2?Document settings:flags.3?Vector<ThemeSettings> emoticon:flags.6?string installs_count:flags.4?int = Theme;
account.themesNotModified#f41eb622 = account.Themes;
account.themes#9a3d8c6d hash:long themes:Vector<Theme> = account.Themes;
@@ -1234,7 +1248,7 @@ messages.historyImportParsed#5e0fb7b9 flags:# pm:flags.0?true group:flags.1?true
messages.affectedFoundMessages#ef8d3e6c pts:int pts_count:int offset:int messages:Vector<int> = messages.AffectedFoundMessages;
chatInviteImporter#b5cd5f4 user_id:long date:int = ChatInviteImporter;
chatInviteImporter#8c5adfd9 flags:# requested:flags.0?true user_id:long date:int about:flags.2?string approved_by:flags.1?long = ChatInviteImporter;
messages.exportedChatInvites#bdc62dcc count:int invites:Vector<ExportedChatInvite> users:Vector<User> = messages.ExportedChatInvites;
@@ -1271,15 +1285,39 @@ account.resetPasswordFailedWait#e3779861 retry_date:int = account.ResetPasswordR
account.resetPasswordRequestedWait#e9effc7d until_date:int = account.ResetPasswordResult;
account.resetPasswordOk#e926d63e = account.ResetPasswordResult;
chatTheme#ed0b5c33 emoticon:string theme:Theme dark_theme:Theme = ChatTheme;
account.chatThemesNotModified#e011e1c4 = account.ChatThemes;
account.chatThemes#fe4cbebd hash:int themes:Vector<ChatTheme> = account.ChatThemes;
sponsoredMessage#2a3c381f flags:# random_id:bytes from_id:Peer start_param:flags.0?string message:string entities:flags.1?Vector<MessageEntity> = SponsoredMessage;
sponsoredMessage#3a836df8 flags:# random_id:bytes from_id:flags.3?Peer chat_invite:flags.4?ChatInvite chat_invite_hash:flags.4?string channel_post:flags.2?int start_param:flags.0?string message:string entities:flags.1?Vector<MessageEntity> = SponsoredMessage;
messages.sponsoredMessages#65a4c7d5 messages:Vector<SponsoredMessage> chats:Vector<Chat> users:Vector<User> = messages.SponsoredMessages;
searchResultsCalendarPeriod#c9b0539f date:int min_msg_id:int max_msg_id:int count:int = SearchResultsCalendarPeriod;
messages.searchResultsCalendar#147ee23c flags:# inexact:flags.0?true count:int min_date:int min_msg_id:int offset_id_offset:flags.1?int periods:Vector<SearchResultsCalendarPeriod> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.SearchResultsCalendar;
searchResultPosition#7f648b67 msg_id:int date:int offset:int = SearchResultsPosition;
messages.searchResultsPositions#53b22baf count:int positions:Vector<SearchResultsPosition> = messages.SearchResultsPositions;
channels.sendAsPeers#8356cda9 peers:Vector<Peer> chats:Vector<Chat> users:Vector<User> = channels.SendAsPeers;
users.userFull#3b6d152e full_user:UserFull chats:Vector<Chat> users:Vector<User> = users.UserFull;
messages.peerSettings#6880b94d settings:PeerSettings chats:Vector<Chat> users:Vector<User> = messages.PeerSettings;
auth.loggedOut#c3a2835f flags:# future_auth_token:flags.0?bytes = auth.LoggedOut;
reactionCount#6fb250d1 flags:# chosen:flags.0?true reaction:string count:int = ReactionCount;
messageReactions#87b6e36 flags:# min:flags.0?true can_see_list:flags.2?true results:Vector<ReactionCount> recent_reactons:flags.1?Vector<MessageUserReaction> = MessageReactions;
messageUserReaction#932844fa user_id:long reaction:string = MessageUserReaction;
messages.messageReactionsList#a366923c flags:# count:int reactions:Vector<MessageUserReaction> users:Vector<User> next_offset:flags.0?string = messages.MessageReactionsList;
availableReaction#c077ec01 flags:# inactive:flags.0?true reaction:string title:string static_icon:Document appear_animation:Document select_animation:Document activate_animation:Document effect_animation:Document around_animation:flags.1?Document center_icon:flags.1?Document = AvailableReaction;
messages.availableReactionsNotModified#9f071957 = messages.AvailableReactions;
messages.availableReactions#768e3aad hash:int reactions:Vector<AvailableReaction> = messages.AvailableReactions;
---functions---
invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;
@@ -1293,7 +1331,7 @@ invokeWithTakeout#aca9fd2e {X:Type} takeout_id:long query:!X = X;
auth.sendCode#a677244f phone_number:string api_id:int api_hash:string settings:CodeSettings = auth.SentCode;
auth.signUp#80eee427 phone_number:string phone_code_hash:string first_name:string last_name:string = auth.Authorization;
auth.signIn#bcd51581 phone_number:string phone_code_hash:string phone_code:string = auth.Authorization;
auth.logOut#5717da40 = Bool;
auth.logOut#3e72ba19 = auth.LoggedOut;
auth.resetAuthorizations#9fab0d1a = Bool;
auth.exportAuthorization#e5bfffcd dc_id:int = auth.ExportedAuthorization;
auth.importAuthorization#a57a7dad id:long bytes:bytes = auth.Authorization;
@@ -1366,10 +1404,10 @@ account.resetWallPapers#bb3b9804 = Bool;
account.getAutoDownloadSettings#56da0b3f = account.AutoDownloadSettings;
account.saveAutoDownloadSettings#76f36233 flags:# low:flags.0?true high:flags.1?true settings:AutoDownloadSettings = Bool;
account.uploadTheme#1c3db333 flags:# file:InputFile thumb:flags.0?InputFile file_name:string mime_type:string = Document;
account.createTheme#8432c21f flags:# slug:string title:string document:flags.2?InputDocument settings:flags.3?InputThemeSettings = Theme;
account.updateTheme#5cb367d5 flags:# format:string theme:InputTheme slug:flags.0?string title:flags.1?string document:flags.2?InputDocument settings:flags.3?InputThemeSettings = Theme;
account.createTheme#652e4400 flags:# slug:string title:string document:flags.2?InputDocument settings:flags.3?Vector<InputThemeSettings> = Theme;
account.updateTheme#2bf40ccc flags:# format:string theme:InputTheme slug:flags.0?string title:flags.1?string document:flags.2?InputDocument settings:flags.3?Vector<InputThemeSettings> = Theme;
account.saveTheme#f257106c theme:InputTheme unsave:Bool = Bool;
account.installTheme#7ae43737 flags:# dark:flags.0?true format:flags.1?string theme:flags.1?InputTheme = Bool;
account.installTheme#c727bb3b flags:# dark:flags.0?true theme:flags.1?InputTheme format:flags.2?string base_theme:flags.3?BaseTheme = Bool;
account.getTheme#8d9d742b format:string theme:InputTheme document_id:long = Theme;
account.getThemes#7206e458 format:string hash:long = account.Themes;
account.setContentSettings#b574b16b flags:# sensitive_enabled:flags.0?true = Bool;
@@ -1380,10 +1418,12 @@ account.setGlobalPrivacySettings#1edaaac2 settings:GlobalPrivacySettings = Globa
account.reportProfilePhoto#fa8cc6f5 peer:InputPeer photo_id:InputPhoto reason:ReportReason message:string = Bool;
account.resetPassword#9308ce1b = account.ResetPasswordResult;
account.declinePasswordReset#4c9409f6 = Bool;
account.getChatThemes#d6d71d7b hash:int = account.ChatThemes;
account.getChatThemes#d638de89 hash:long = account.Themes;
account.setAuthorizationTTL#bf899aa0 authorization_ttl_days:int = Bool;
account.changeAuthorizationSettings#40f48462 flags:# hash:long encrypted_requests_disabled:flags.0?Bool call_requests_disabled:flags.1?Bool = Bool;
users.getUsers#d91a548 id:Vector<InputUser> = Vector<User>;
users.getFullUser#ca30a5b1 id:InputUser = UserFull;
users.getFullUser#b60f5918 id:InputUser = users.UserFull;
users.setSecureValueErrors#90c894b5 id:InputUser errors:Vector<SecureValueError> = Bool;
contacts.getContactIDs#7adc669d hash:long = Vector<int>;
@@ -1412,15 +1452,15 @@ messages.getDialogs#a0f4cb4f flags:# exclude_pinned:flags.0?true folder_id:flags
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#a0fda762 flags:# peer:InputPeer q:string from_id:flags.0?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.readHistory#e306d3a peer:InputPeer max_id:int = messages.AffectedMessages;
messages.deleteHistory#1c015b09 flags:# just_clear:flags.0?true revoke:flags.1?true peer:InputPeer max_id:int = messages.AffectedHistory;
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;
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#520c3870 flags:# no_webpage:flags.1?true silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int = Updates;
messages.sendMedia#3491eba9 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int = Updates;
messages.forwardMessages#d9fee60e 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 from_peer:InputPeer id:Vector<int> random_id:Vector<long> to_peer:InputPeer schedule_date:flags.10?int = Updates;
messages.sendMessage#d9d75a4 flags:# no_webpage:flags.1?true silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true peer:InputPeer reply_to_msg_id:flags.0?int 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 = Updates;
messages.sendMedia#e25ff8e0 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true peer:InputPeer reply_to_msg_id:flags.0?int 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 = Updates;
messages.forwardMessages#cc30290b 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 from_peer:InputPeer id:Vector<int> random_id:Vector<long> to_peer:InputPeer schedule_date:flags.10?int send_as:flags.13?InputPeer = Updates;
messages.reportSpam#cf1592db peer:InputPeer = Bool;
messages.getPeerSettings#3672e09c peer:InputPeer = PeerSettings;
messages.getPeerSettings#efd9a6a2 peer:InputPeer = messages.PeerSettings;
messages.report#8953ab4e peer:InputPeer id:Vector<int> reason:ReportReason message:string = Bool;
messages.getChats#49e9528f id:Vector<long> = messages.Chats;
messages.getFullChat#aeb00b34 chat_id:long = messages.ChatFull;
@@ -1444,10 +1484,10 @@ messages.readMessageContents#36a73f77 id:Vector<int> = messages.AffectedMessages
messages.getStickers#d5a5d3a1 emoticon:string hash:long = messages.Stickers;
messages.getAllStickers#b8a0a1a8 hash:long = messages.AllStickers;
messages.getWebPagePreview#8b68b0cc flags:# message:string entities:flags.3?Vector<MessageEntity> = MessageMedia;
messages.exportChatInvite#14b9bcd7 flags:# legacy_revoke_permanent:flags.2?true peer:InputPeer expire_date:flags.0?int usage_limit:flags.1?int = ExportedChatInvite;
messages.exportChatInvite#a02ce5d5 flags:# legacy_revoke_permanent:flags.2?true request_needed:flags.3?true peer:InputPeer expire_date:flags.0?int usage_limit:flags.1?int title:flags.4?string = ExportedChatInvite;
messages.checkChatInvite#3eadb1bb hash:string = ChatInvite;
messages.importChatInvite#6c50051c hash:string = Updates;
messages.getStickerSet#2619a90e stickerset:InputStickerSet = messages.StickerSet;
messages.getStickerSet#c8a0ec74 stickerset:InputStickerSet hash:int = messages.StickerSet;
messages.installStickerSet#c78fe460 stickerset:InputStickerSet archived:Bool = messages.StickerSetInstallResult;
messages.uninstallStickerSet#f96e55de stickerset:InputStickerSet = Bool;
messages.startBot#e6df7378 bot:InputUser peer:InputPeer random_id:long start_param:string = Updates;
@@ -1461,7 +1501,7 @@ messages.getSavedGifs#5cf09635 hash:long = messages.SavedGifs;
messages.saveGif#327a30cb id:InputDocument unsave:Bool = Bool;
messages.getInlineBotResults#514e999d flags:# bot:InputUser peer:InputPeer geo_point:flags.0?InputGeoPoint query:string offset:string = messages.BotResults;
messages.setInlineBotResults#eb5ea206 flags:# gallery:flags.0?true private:flags.1?true query_id:long results:Vector<InputBotInlineResult> cache_time:int next_offset:flags.2?string switch_pm:flags.3?InlineBotSwitchPM = Bool;
messages.sendInlineBotResult#220815b0 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true hide_via:flags.11?true peer:InputPeer reply_to_msg_id:flags.0?int random_id:long query_id:long id:string schedule_date:flags.10?int = Updates;
messages.sendInlineBotResult#7aa11297 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true hide_via:flags.11?true peer:InputPeer reply_to_msg_id:flags.0?int random_id:long query_id:long id:string schedule_date:flags.10?int send_as:flags.13?InputPeer = Updates;
messages.getMessageEditData#fda68d36 peer:InputPeer id:int = messages.MessageEditData;
messages.editMessage#48f71778 flags:# no_webpage:flags.1?true peer:InputPeer id:int message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.15?int = Updates;
messages.editInlineBotMessage#83557dba flags:# no_webpage:flags.1?true id:InputBotInlineMessageID message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> = Bool;
@@ -1497,7 +1537,7 @@ messages.faveSticker#b9ffc55b id:InputDocument unfave:Bool = Bool;
messages.getUnreadMentions#46578472 peer:InputPeer offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages;
messages.readMentions#f0189d3 peer:InputPeer = messages.AffectedHistory;
messages.getRecentLocations#702a40e0 peer:InputPeer limit:int hash:long = messages.Messages;
messages.sendMultiMedia#cc0110cb flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int multi_media:Vector<InputSingleMedia> schedule_date:flags.10?int = Updates;
messages.sendMultiMedia#f803138f flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true peer:InputPeer reply_to_msg_id:flags.0?int multi_media:Vector<InputSingleMedia> schedule_date:flags.10?int send_as:flags.13?InputPeer = Updates;
messages.uploadEncryptedFile#5057c497 peer:InputEncryptedChat file:InputEncryptedFile = EncryptedFile;
messages.searchStickerSets#35705b8a flags:# exclude_featured:flags.0?true q:string hash:long = messages.FoundStickerSets;
messages.getSplitRanges#1cff7e08 = Vector<MessageRange>;
@@ -1508,7 +1548,6 @@ messages.updatePinnedMessage#d2aaf7ec flags:# silent:flags.0?true unpin:flags.1?
messages.sendVote#10ea6184 peer:InputPeer msg_id:int options:Vector<bytes> = Updates;
messages.getPollResults#73bb643b peer:InputPeer msg_id:int = Updates;
messages.getOnlines#6e2be050 peer:InputPeer = ChatOnlines;
messages.getStatsURL#812c2ae6 flags:# dark:flags.0?true peer:InputPeer params:string = StatsURL;
messages.editChatAbout#def60797 peer:InputPeer about:string = Bool;
messages.editChatDefaultBannedRights#a5866b41 peer:InputPeer banned_rights:ChatBannedRights = Updates;
messages.getEmojiKeywords#35a0e062 lang_code:string = EmojiKeywordsDifference;
@@ -1542,15 +1581,27 @@ messages.uploadImportedMedia#2a862092 peer:InputPeer import_id:long file_name:st
messages.startHistoryImport#b43df344 peer:InputPeer import_id:long = Bool;
messages.getExportedChatInvites#a2b5a3f6 flags:# revoked:flags.3?true peer:InputPeer admin_id:InputUser offset_date:flags.2?int offset_link:flags.2?string limit:int = messages.ExportedChatInvites;
messages.getExportedChatInvite#73746f5c peer:InputPeer link:string = messages.ExportedChatInvite;
messages.editExportedChatInvite#2e4ffbe flags:# revoked:flags.2?true peer:InputPeer link:string expire_date:flags.0?int usage_limit:flags.1?int = messages.ExportedChatInvite;
messages.editExportedChatInvite#bdca2f75 flags:# revoked:flags.2?true peer:InputPeer link:string expire_date:flags.0?int usage_limit:flags.1?int request_needed:flags.3?Bool title:flags.4?string = messages.ExportedChatInvite;
messages.deleteRevokedExportedChatInvites#56987bd5 peer:InputPeer admin_id:InputUser = Bool;
messages.deleteExportedChatInvite#d464a42b peer:InputPeer link:string = Bool;
messages.getAdminsWithInvites#3920e6ef peer:InputPeer = messages.ChatAdminsWithInvites;
messages.getChatInviteImporters#26fb7289 peer:InputPeer link:string offset_date:int offset_user:InputUser limit:int = messages.ChatInviteImporters;
messages.getChatInviteImporters#df04dd4e flags:# requested:flags.0?true peer:InputPeer link:flags.1?string q:flags.2?string offset_date:int offset_user:InputUser limit:int = messages.ChatInviteImporters;
messages.setHistoryTTL#b80e5fe4 peer:InputPeer period:int = Updates;
messages.checkHistoryImportPeer#5dc60f03 peer:InputPeer = messages.CheckedHistoryImportPeer;
messages.setChatTheme#e63be13f peer:InputPeer emoticon:string = Updates;
messages.getMessageReadParticipants#2c6f97b7 peer:InputPeer msg_id:int = Vector<long>;
messages.getSearchResultsCalendar#49f0bde9 peer:InputPeer filter:MessagesFilter offset_id:int offset_date:int = messages.SearchResultsCalendar;
messages.getSearchResultsPositions#6e9583a3 peer:InputPeer filter:MessagesFilter offset_id:int limit:int = messages.SearchResultsPositions;
messages.hideChatJoinRequest#7fe7e815 flags:# approved:flags.0?true peer:InputPeer user_id:InputUser = Updates;
messages.hideAllChatJoinRequests#e085f4ea flags:# approved:flags.0?true peer:InputPeer link:flags.1?string = Updates;
messages.toggleNoForwards#b11eafa2 peer:InputPeer enabled:Bool = Updates;
messages.saveDefaultSendAs#ccfddf96 peer:InputPeer send_as:InputPeer = Bool;
messages.sendReaction#25690ce4 flags:# peer:InputPeer msg_id:int reaction:flags.0?string = Updates;
messages.getMessagesReactions#8bba90e6 peer:InputPeer id:Vector<int> = Updates;
messages.getMessageReactionsList#e0ee6b77 flags:# peer:InputPeer id:int reaction:flags.0?string offset:flags.1?string limit:int = messages.MessageReactionsList;
messages.setChatAvailableReactions#14050ea6 peer:InputPeer available_reactions:Vector<string> = Updates;
messages.getAvailableReactions#18dea0ac hash:int = messages.AvailableReactions;
messages.setDefaultReaction#d960c4d4 reaction:string = Bool;
updates.getState#edd4882a = updates.State;
updates.getDifference#25939651 flags:# pts:int pts_total_limit:flags.0?int date:int qts:int = updates.Difference;
@@ -1595,8 +1646,7 @@ help.getCountriesList#735787a8 lang_code:string hash:int = help.CountriesList;
channels.readHistory#cc104937 channel:InputChannel max_id:int = Bool;
channels.deleteMessages#84c1fd4e channel:InputChannel id:Vector<int> = messages.AffectedMessages;
channels.deleteUserHistory#d10dd71b channel:InputChannel user_id:InputUser = messages.AffectedHistory;
channels.reportSpam#fe087810 channel:InputChannel user_id:InputUser id:Vector<int> = Bool;
channels.reportSpam#f44a8315 channel:InputChannel participant:InputPeer id:Vector<int> = Bool;
channels.getMessages#ad8c9a23 channel:InputChannel id:Vector<InputMessage> = messages.Messages;
channels.getParticipants#77ced9d0 channel:InputChannel filter:ChannelParticipantsFilter offset:int limit:int hash:long = channels.ChannelParticipants;
channels.getParticipant#a0ab6cc6 channel:InputChannel participant:InputPeer = channels.ChannelParticipant;
@@ -1631,6 +1681,8 @@ channels.getInactiveChannels#11e831ee = messages.InactiveChats;
channels.convertToGigagroup#b290c69 channel:InputChannel = Updates;
channels.viewSponsoredMessage#beaedb94 channel:InputChannel random_id:bytes = Bool;
channels.getSponsoredMessages#ec210fbf channel:InputChannel = messages.SponsoredMessages;
channels.getSendAs#dc770ee peer:InputPeer = channels.SendAsPeers;
channels.deleteParticipantHistory#367544db channel:InputChannel participant:InputPeer = messages.AffectedHistory;
bots.sendCustomRequest#aa2769ed custom_method:string params:DataJSON = DataJSON;
bots.answerWebhookJSONQuery#e6213f4d query_id:long data:DataJSON = Bool;
@@ -1698,4 +1750,4 @@ stats.getMegagroupStats#dcdf8607 flags:# dark:flags.0?true channel:InputChannel
stats.getMessagePublicForwards#5630281b channel:InputChannel msg_id:int offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages;
stats.getMessageStats#b6e0a3f5 flags:# dark:flags.0?true channel:InputChannel msg_id:int = stats.MessageStats;
// LAYER 133
// LAYER 137

View File

@@ -1,5 +1,5 @@
name,codes,description
2FA_CONFIRM_WAIT_X,420,The account is 2FA protected so it will be deleted in a week. Otherwise it can be reset in {seconds}
2FA_CONFIRM_WAIT_0,420,The account is 2FA protected so it will be deleted in a week. Otherwise it can be reset in {seconds}
ABOUT_TOO_LONG,400,The provided bio is too long
ACCESS_TOKEN_EXPIRED,400,Bot token expired
ACCESS_TOKEN_INVALID,400,The provided token is not valid
@@ -67,6 +67,7 @@ CHAT_ABOUT_TOO_LONG,400,Chat about too long
CHAT_ADMIN_INVITE_REQUIRED,403,You do not have the rights to do this
CHAT_ADMIN_REQUIRED,400,"Chat admin privileges are required to do that in the specified chat (for example, to send a message in a channel which is not yours), or invalid permissions used for the channel or group"
CHAT_FORBIDDEN,403,You cannot write in this chat
CHAT_FORWARDS_RESTRICTED,,
CHAT_ID_EMPTY,400,The provided chat ID is empty
CHAT_ID_INVALID,400,"Invalid object ID for a chat. Make sure to pass the right types, for instance making sure that the request is designed for chats (not channels/megagroups) or otherwise look for a different one more suited\nAn example working with a megagroup and AddChatUserRequest, it will fail because megagroups are channels. Use InviteToChannelRequest instead"
CHAT_INVALID,400,The chat is invalid for this request
@@ -102,7 +103,7 @@ DH_G_A_INVALID,400,g_a invalid
DOCUMENT_INVALID,400,The document file was invalid and can't be used in inline mode
EMAIL_HASH_EXPIRED,400,The email hash expired and cannot be used to verify it
EMAIL_INVALID,400,The given email is invalid
EMAIL_UNCONFIRMED_X,400,"Email unconfirmed, the length of the code must be {code_length}"
EMAIL_UNCONFIRMED_0,400,"Email unconfirmed, the length of the code must be {code_length}"
EMOJI_INVALID,400,
EMOJI_NOT_MODIFIED,400,
EMOTICON_EMPTY,400,The emoticon field cannot be empty
@@ -117,6 +118,7 @@ ENCRYPTION_OCCUPY_FAILED,500,TDLib developer claimed it is not an error while ac
ENTITIES_TOO_LONG,400,It is no longer possible to send such long data inside entity tags (for example inline text URLs)
ENTITY_MENTION_USER_INVALID,400,You can't use this entity
ERROR_TEXT_EMPTY,400,The provided error message is empty
EXPIRE_DATE_INVALID,400,
EXPIRE_FORBIDDEN,400,
EXPORT_CARD_INVALID,400,Provided card is invalid
EXTERNAL_URL_INVALID,400,External URL invalid
@@ -125,22 +127,21 @@ FIELD_NAME_INVALID,400,The field with the name FIELD_NAME is invalid
FILEREF_UPGRADE_NEEDED,406,The file reference needs to be refreshed before being used again
FILE_CONTENT_TYPE_INVALID,400,
FILE_ID_INVALID,400,"The provided file id is invalid. Make sure all parameters are present, have the correct type and are not empty (ID, access hash, file reference, thumb size ...)"
FILE_MIGRATE_X,303,The file to be accessed is currently stored in DC {new_dc}
FILE_MIGRATE_0,303,The file to be accessed is currently stored in DC {new_dc}
FILE_PARTS_INVALID,400,The number of file parts is invalid
FILE_PART_0_MISSING,400,File part 0 missing
FILE_PART_EMPTY,400,The provided file part is empty
FILE_PART_INVALID,400,The file part number is invalid
FILE_PART_LENGTH_INVALID,400,The length of a file part is invalid
FILE_PART_SIZE_CHANGED,400,The file part size (chunk size) cannot change during upload
FILE_PART_SIZE_INVALID,400,The provided file part size is invalid
FILE_PART_X_MISSING,400,Part {which} of the file is missing from storage
FILE_PART_0_MISSING,400,Part {which} of the file is missing from storage
FILE_REFERENCE_EMPTY,400,The file reference must exist to access the media and it cannot be empty
FILE_REFERENCE_EXPIRED,400,The file reference has expired and is no longer valid or it belongs to self-destructing media and cannot be resent
FILE_REFERENCE_INVALID,400,The file reference is invalid or you can't do that operation on such message
FILE_TITLE_EMPTY,400,
FIRSTNAME_INVALID,400,The first name is invalid
FLOOD_TEST_PHONE_WAIT_X,420,A wait of {seconds} seconds is required in the test servers
FLOOD_WAIT_X,420,A wait of {seconds} seconds is required
FLOOD_TEST_PHONE_WAIT_0,420,A wait of {seconds} seconds is required in the test servers
FLOOD_WAIT_0,420,A wait of {seconds} seconds is required
FOLDER_ID_EMPTY,400,The folder you tried to delete was already empty
FOLDER_ID_INVALID,400,The folder you tried to use was not valid
FRESH_CHANGE_ADMINS_FORBIDDEN,400,Recently logged-in users cannot add or change admins
@@ -176,8 +177,8 @@ INPUT_LAYER_INVALID,400,The provided layer is invalid
INPUT_METHOD_INVALID,400,The invoked method does not exist anymore or has never existed
INPUT_REQUEST_TOO_LONG,400,The input request was too long. This may be a bug in the library as it can occur when serializing more bytes than it should (like appending the vector constructor code at the end of a message)
INPUT_USER_DEACTIVATED,400,The specified user was deleted
INTERDC_X_CALL_ERROR,500,An error occurred while communicating with DC {dc}
INTERDC_X_CALL_RICH_ERROR,500,A rich error occurred while communicating with DC {dc}
INTERDC_0_CALL_ERROR,500,An error occurred while communicating with DC {dc}
INTERDC_0_CALL_RICH_ERROR,500,A rich error occurred while communicating with DC {dc}
INVITE_FORBIDDEN_WITH_JOINAS,400,
INVITE_HASH_EMPTY,400,The invite hash is empty
INVITE_HASH_EXPIRED,400,The chat the user tried to join has expired and is not valid anymore
@@ -220,7 +221,7 @@ MT_SEND_QUEUE_TOO_LONG,500,
MULTI_MEDIA_TOO_LONG,400,Too many media files were included in the same album
NEED_CHAT_INVALID,500,The provided chat is invalid
NEED_MEMBER_INVALID,500,The provided member is invalid or does not exist (for example a thumb size)
NETWORK_MIGRATE_X,303,The source IP address is associated with DC {new_dc}
NETWORK_MIGRATE_0,303,The source IP address is associated with DC {new_dc}
NEW_SALT_INVALID,400,The new salt is invalid
NEW_SETTINGS_INVALID,400,The new settings are invalid
NEXT_OFFSET_INVALID,400,The value for next_offset is invalid. Check that it has normal characters and is not too long
@@ -233,6 +234,7 @@ PACK_SHORT_NAME_OCCUPIED,400,A stickerpack with this name already exists
PARTICIPANTS_TOO_FEW,400,Not enough participants
PARTICIPANT_CALL_FAILED,500,Failure while making call
PARTICIPANT_JOIN_MISSING,403,
PARTICIPANT_ID_INVALID,,
PARTICIPANT_VERSION_OUTDATED,400,The other participant does not use an up to date telegram client with support for calls
PASSWORD_EMPTY,400,The provided password is empty
PASSWORD_HASH_INVALID,400,The password (and thus its hash value) you entered is invalid
@@ -240,7 +242,7 @@ PASSWORD_MISSING,400,The account must have 2-factor authentication enabled (a pa
PASSWORD_RECOVERY_EXPIRED,400,
PASSWORD_RECOVERY_NA,400,
PASSWORD_REQUIRED,400,The account must have 2-factor authentication enabled (a password) before this method can be used
PASSWORD_TOO_FRESH_X,400,The password was added too recently and {seconds} seconds must pass before using the method
PASSWORD_TOO_FRESH_0,400,The password was added too recently and {seconds} seconds must pass before using the method
PAYMENT_PROVIDER_INVALID,400,The payment provider was not recognised or its token was invalid
PEER_FLOOD,400,Too many requests
PEER_ID_INVALID,400,"An invalid Peer was used. Make sure to pass the right peer type and that the value is valid (for instance, bots cannot start conversations)"
@@ -252,7 +254,7 @@ PHONE_CODE_EMPTY,400,The phone code is missing
PHONE_CODE_EXPIRED,400,The confirmation code has expired
PHONE_CODE_HASH_EMPTY,400,The phone code hash is missing
PHONE_CODE_INVALID,400,The phone code entered was invalid
PHONE_MIGRATE_X,303,The phone number a user is trying to use for authorization is associated with DC {new_dc}
PHONE_MIGRATE_0,303,The phone number a user is trying to use for authorization is associated with DC {new_dc}
PHONE_NUMBER_APP_SIGNUP_FORBIDDEN,400,You can't sign up using this app
PHONE_NUMBER_BANNED,400,The used phone number has been banned from Telegram and cannot be used anymore. Maybe check https://www.telegram.org/faq_spam
PHONE_NUMBER_FLOOD,400,You asked for the code too many times.
@@ -278,7 +280,7 @@ POLL_OPTION_INVALID,400,A poll option used invalid data (the data may be too lon
POLL_QUESTION_INVALID,400,The poll question was either empty or too long
POLL_UNSUPPORTED,400,This layer does not support polls in the issued method
POLL_VOTE_REQUIRED,403,
PREVIOUS_CHAT_IMPORT_ACTIVE_WAIT_XMIN,406,"Similar to a flood wait, must wait {minutes} minutes"
PREVIOUS_CHAT_IMPORT_ACTIVE_WAIT_0MIN,406,"Similar to a flood wait, must wait {minutes} minutes"
PRIVACY_KEY_INVALID,400,The privacy key is invalid
PRIVACY_TOO_LONG,400,Cannot add that many entities in a single request
PRIVACY_VALUE_INVALID,400,The privacy value is invalid
@@ -319,22 +321,24 @@ SCHEDULE_STATUS_PRIVATE,400,You cannot schedule a message until the person comes
SCHEDULE_TOO_MUCH,400,You cannot schedule more messages in this chat (last known limit of 100 per chat)
SEARCH_QUERY_EMPTY,400,The search query is empty
SECONDS_INVALID,400,"Slow mode only supports certain values (e.g. 0, 10s, 30s, 1m, 5m, 15m and 1h)"
SEND_AS_PEER_INVALID,,
SEND_CODE_UNAVAILABLE,406,
SEND_MESSAGE_MEDIA_INVALID,400,The message media was invalid or not specified
SEND_MESSAGE_TYPE_INVALID,400,The message type is invalid
SENSITIVE_CHANGE_FORBIDDEN,403,Your sensitive content settings cannot be changed at this time
SESSION_EXPIRED,401,The authorization has expired
SESSION_PASSWORD_NEEDED,401,Two-steps verification is enabled and a password is required
SESSION_REVOKED,401,"The authorization has been invalidated, because of the user terminating all sessions"
SESSION_TOO_FRESH_X,400,The session logged in too recently and {seconds} seconds must pass before calling the method
SESSION_TOO_FRESH_0,400,The session logged in too recently and {seconds} seconds must pass before calling the method
SHA256_HASH_INVALID,400,The provided SHA256 hash is invalid
SHORTNAME_OCCUPY_FAILED,400,An error occurred when trying to register the short-name used for the sticker pack. Try a different name
SHORT_NAME_INVALID,400,
SHORT_NAME_OCCUPIED,400,
SLOWMODE_WAIT_X,420,A wait of {seconds} seconds is required before sending another message in this chat
SLOWMODE_WAIT_0,420,A wait of {seconds} seconds is required before sending another message in this chat
SRP_ID_INVALID,400,
START_PARAM_EMPTY,400,The start parameter is empty
START_PARAM_INVALID,400,Start parameter invalid
STATS_MIGRATE_X,303,The channel statistics must be fetched from DC {dc}
STATS_MIGRATE_0,303,The channel statistics must be fetched from DC {dc}
STICKERSET_INVALID,400,The provided sticker set is invalid
STICKERSET_OWNER_ANONYMOUS,406,This sticker set can't be used as the group's official stickers because it was created by one of its anonymous admins
STICKERS_EMPTY,400,No sticker provided
@@ -351,7 +355,7 @@ STICKER_THUMB_PNG_NOPNG,400,Stickerset thumb must be a png file but the used fil
STICKER_THUMB_TGS_NOTGS,400,Stickerset thumb must be a tgs file but the used file was not tgs
STORAGE_CHECK_FAILED,500,Server storage check failed
STORE_INVALID_SCALAR_TYPE,500,
TAKEOUT_INIT_DELAY_X,420,A wait of {seconds} seconds is required before being able to initiate the takeout
TAKEOUT_INIT_DELAY_0,420,A wait of {seconds} seconds is required before being able to initiate the takeout
TAKEOUT_INVALID,400,The takeout session has been invalidated by another data export session
TAKEOUT_REQUIRED,400,You must initialize a takeout request first
TEMP_AUTH_KEY_EMPTY,400,No temporary auth key provided
@@ -370,6 +374,7 @@ TYPE_CONSTRUCTOR_INVALID,400,The type constructor is invalid
UNKNOWN_ERROR,400,
UNKNOWN_METHOD,500,The method you tried to call cannot be called on non-CDN DCs
UNTIL_DATE_INVALID,400,That date cannot be specified in this request (try using None)
UPDATE_APP_TO_LOGIN,406,
URL_INVALID,400,The URL used was invalid (e.g. when answering a callback with a URL that's not t.me/yourbot or your game's URL)
USER_VOLUME_INVALID,400,
USERNAME_INVALID,400,"Nobody is using this username, or the username is unacceptable. If the latter, it must match r""[a-zA-Z][\w\d]{3,30}[a-zA-Z\d]"""
@@ -395,7 +400,7 @@ USER_INVALID,400,The given user was invalid
USER_IS_BLOCKED,400 403,User is blocked
USER_IS_BOT,400,Bots can't send messages to other bots
USER_KICKED,400,This user was kicked from this supergroup/channel
USER_MIGRATE_X,303,The user whose identity is being used to execute queries is associated with DC {new_dc}
USER_MIGRATE_0,303,The user whose identity is being used to execute queries is associated with DC {new_dc}
USER_NOT_MUTUAL_CONTACT,400 403,The provided user is not a mutual contact
USER_NOT_PARTICIPANT,400,The target user is not a member of the specified megagroup or channel
USER_PRIVACY_RESTRICTED,403,The user's privacy settings do not allow you to do this
1 name codes description
2 2FA_CONFIRM_WAIT_X 2FA_CONFIRM_WAIT_0 420 The account is 2FA protected so it will be deleted in a week. Otherwise it can be reset in {seconds}
3 ABOUT_TOO_LONG 400 The provided bio is too long
4 ACCESS_TOKEN_EXPIRED 400 Bot token expired
5 ACCESS_TOKEN_INVALID 400 The provided token is not valid
67 CHAT_ADMIN_INVITE_REQUIRED 403 You do not have the rights to do this
68 CHAT_ADMIN_REQUIRED 400 Chat admin privileges are required to do that in the specified chat (for example, to send a message in a channel which is not yours), or invalid permissions used for the channel or group
69 CHAT_FORBIDDEN 403 You cannot write in this chat
70 CHAT_FORWARDS_RESTRICTED
71 CHAT_ID_EMPTY 400 The provided chat ID is empty
72 CHAT_ID_INVALID 400 Invalid object ID for a chat. Make sure to pass the right types, for instance making sure that the request is designed for chats (not channels/megagroups) or otherwise look for a different one more suited\nAn example working with a megagroup and AddChatUserRequest, it will fail because megagroups are channels. Use InviteToChannelRequest instead
73 CHAT_INVALID 400 The chat is invalid for this request
103 DOCUMENT_INVALID 400 The document file was invalid and can't be used in inline mode
104 EMAIL_HASH_EXPIRED 400 The email hash expired and cannot be used to verify it
105 EMAIL_INVALID 400 The given email is invalid
106 EMAIL_UNCONFIRMED_X EMAIL_UNCONFIRMED_0 400 Email unconfirmed, the length of the code must be {code_length}
107 EMOJI_INVALID 400
108 EMOJI_NOT_MODIFIED 400
109 EMOTICON_EMPTY 400 The emoticon field cannot be empty
118 ENTITIES_TOO_LONG 400 It is no longer possible to send such long data inside entity tags (for example inline text URLs)
119 ENTITY_MENTION_USER_INVALID 400 You can't use this entity
120 ERROR_TEXT_EMPTY 400 The provided error message is empty
121 EXPIRE_DATE_INVALID 400
122 EXPIRE_FORBIDDEN 400
123 EXPORT_CARD_INVALID 400 Provided card is invalid
124 EXTERNAL_URL_INVALID 400 External URL invalid
127 FILEREF_UPGRADE_NEEDED 406 The file reference needs to be refreshed before being used again
128 FILE_CONTENT_TYPE_INVALID 400
129 FILE_ID_INVALID 400 The provided file id is invalid. Make sure all parameters are present, have the correct type and are not empty (ID, access hash, file reference, thumb size ...)
130 FILE_MIGRATE_X FILE_MIGRATE_0 303 The file to be accessed is currently stored in DC {new_dc}
131 FILE_PARTS_INVALID 400 The number of file parts is invalid
FILE_PART_0_MISSING 400 File part 0 missing
132 FILE_PART_EMPTY 400 The provided file part is empty
133 FILE_PART_INVALID 400 The file part number is invalid
134 FILE_PART_LENGTH_INVALID 400 The length of a file part is invalid
135 FILE_PART_SIZE_CHANGED 400 The file part size (chunk size) cannot change during upload
136 FILE_PART_SIZE_INVALID 400 The provided file part size is invalid
137 FILE_PART_X_MISSING FILE_PART_0_MISSING 400 Part {which} of the file is missing from storage
138 FILE_REFERENCE_EMPTY 400 The file reference must exist to access the media and it cannot be empty
139 FILE_REFERENCE_EXPIRED 400 The file reference has expired and is no longer valid or it belongs to self-destructing media and cannot be resent
140 FILE_REFERENCE_INVALID 400 The file reference is invalid or you can't do that operation on such message
141 FILE_TITLE_EMPTY 400
142 FIRSTNAME_INVALID 400 The first name is invalid
143 FLOOD_TEST_PHONE_WAIT_X FLOOD_TEST_PHONE_WAIT_0 420 A wait of {seconds} seconds is required in the test servers
144 FLOOD_WAIT_X FLOOD_WAIT_0 420 A wait of {seconds} seconds is required
145 FOLDER_ID_EMPTY 400 The folder you tried to delete was already empty
146 FOLDER_ID_INVALID 400 The folder you tried to use was not valid
147 FRESH_CHANGE_ADMINS_FORBIDDEN 400 Recently logged-in users cannot add or change admins
177 INPUT_METHOD_INVALID 400 The invoked method does not exist anymore or has never existed
178 INPUT_REQUEST_TOO_LONG 400 The input request was too long. This may be a bug in the library as it can occur when serializing more bytes than it should (like appending the vector constructor code at the end of a message)
179 INPUT_USER_DEACTIVATED 400 The specified user was deleted
180 INTERDC_X_CALL_ERROR INTERDC_0_CALL_ERROR 500 An error occurred while communicating with DC {dc}
181 INTERDC_X_CALL_RICH_ERROR INTERDC_0_CALL_RICH_ERROR 500 A rich error occurred while communicating with DC {dc}
182 INVITE_FORBIDDEN_WITH_JOINAS 400
183 INVITE_HASH_EMPTY 400 The invite hash is empty
184 INVITE_HASH_EXPIRED 400 The chat the user tried to join has expired and is not valid anymore
221 MULTI_MEDIA_TOO_LONG 400 Too many media files were included in the same album
222 NEED_CHAT_INVALID 500 The provided chat is invalid
223 NEED_MEMBER_INVALID 500 The provided member is invalid or does not exist (for example a thumb size)
224 NETWORK_MIGRATE_X NETWORK_MIGRATE_0 303 The source IP address is associated with DC {new_dc}
225 NEW_SALT_INVALID 400 The new salt is invalid
226 NEW_SETTINGS_INVALID 400 The new settings are invalid
227 NEXT_OFFSET_INVALID 400 The value for next_offset is invalid. Check that it has normal characters and is not too long
234 PARTICIPANTS_TOO_FEW 400 Not enough participants
235 PARTICIPANT_CALL_FAILED 500 Failure while making call
236 PARTICIPANT_JOIN_MISSING 403
237 PARTICIPANT_ID_INVALID
238 PARTICIPANT_VERSION_OUTDATED 400 The other participant does not use an up to date telegram client with support for calls
239 PASSWORD_EMPTY 400 The provided password is empty
240 PASSWORD_HASH_INVALID 400 The password (and thus its hash value) you entered is invalid
242 PASSWORD_RECOVERY_EXPIRED 400
243 PASSWORD_RECOVERY_NA 400
244 PASSWORD_REQUIRED 400 The account must have 2-factor authentication enabled (a password) before this method can be used
245 PASSWORD_TOO_FRESH_X PASSWORD_TOO_FRESH_0 400 The password was added too recently and {seconds} seconds must pass before using the method
246 PAYMENT_PROVIDER_INVALID 400 The payment provider was not recognised or its token was invalid
247 PEER_FLOOD 400 Too many requests
248 PEER_ID_INVALID 400 An invalid Peer was used. Make sure to pass the right peer type and that the value is valid (for instance, bots cannot start conversations)
254 PHONE_CODE_EXPIRED 400 The confirmation code has expired
255 PHONE_CODE_HASH_EMPTY 400 The phone code hash is missing
256 PHONE_CODE_INVALID 400 The phone code entered was invalid
257 PHONE_MIGRATE_X PHONE_MIGRATE_0 303 The phone number a user is trying to use for authorization is associated with DC {new_dc}
258 PHONE_NUMBER_APP_SIGNUP_FORBIDDEN 400 You can't sign up using this app
259 PHONE_NUMBER_BANNED 400 The used phone number has been banned from Telegram and cannot be used anymore. Maybe check https://www.telegram.org/faq_spam
260 PHONE_NUMBER_FLOOD 400 You asked for the code too many times.
280 POLL_QUESTION_INVALID 400 The poll question was either empty or too long
281 POLL_UNSUPPORTED 400 This layer does not support polls in the issued method
282 POLL_VOTE_REQUIRED 403
283 PREVIOUS_CHAT_IMPORT_ACTIVE_WAIT_XMIN PREVIOUS_CHAT_IMPORT_ACTIVE_WAIT_0MIN 406 Similar to a flood wait, must wait {minutes} minutes
284 PRIVACY_KEY_INVALID 400 The privacy key is invalid
285 PRIVACY_TOO_LONG 400 Cannot add that many entities in a single request
286 PRIVACY_VALUE_INVALID 400 The privacy value is invalid
321 SCHEDULE_TOO_MUCH 400 You cannot schedule more messages in this chat (last known limit of 100 per chat)
322 SEARCH_QUERY_EMPTY 400 The search query is empty
323 SECONDS_INVALID 400 Slow mode only supports certain values (e.g. 0, 10s, 30s, 1m, 5m, 15m and 1h)
324 SEND_AS_PEER_INVALID
325 SEND_CODE_UNAVAILABLE 406
326 SEND_MESSAGE_MEDIA_INVALID 400 The message media was invalid or not specified
327 SEND_MESSAGE_TYPE_INVALID 400 The message type is invalid
328 SENSITIVE_CHANGE_FORBIDDEN 403 Your sensitive content settings cannot be changed at this time
329 SESSION_EXPIRED 401 The authorization has expired
330 SESSION_PASSWORD_NEEDED 401 Two-steps verification is enabled and a password is required
331 SESSION_REVOKED 401 The authorization has been invalidated, because of the user terminating all sessions
332 SESSION_TOO_FRESH_X SESSION_TOO_FRESH_0 400 The session logged in too recently and {seconds} seconds must pass before calling the method
333 SHA256_HASH_INVALID 400 The provided SHA256 hash is invalid
334 SHORTNAME_OCCUPY_FAILED 400 An error occurred when trying to register the short-name used for the sticker pack. Try a different name
335 SHORT_NAME_INVALID 400
336 SHORT_NAME_OCCUPIED 400
337 SLOWMODE_WAIT_X SLOWMODE_WAIT_0 420 A wait of {seconds} seconds is required before sending another message in this chat
338 SRP_ID_INVALID 400
339 START_PARAM_EMPTY 400 The start parameter is empty
340 START_PARAM_INVALID 400 Start parameter invalid
341 STATS_MIGRATE_X STATS_MIGRATE_0 303 The channel statistics must be fetched from DC {dc}
342 STICKERSET_INVALID 400 The provided sticker set is invalid
343 STICKERSET_OWNER_ANONYMOUS 406 This sticker set can't be used as the group's official stickers because it was created by one of its anonymous admins
344 STICKERS_EMPTY 400 No sticker provided
355 STICKER_THUMB_TGS_NOTGS 400 Stickerset thumb must be a tgs file but the used file was not tgs
356 STORAGE_CHECK_FAILED 500 Server storage check failed
357 STORE_INVALID_SCALAR_TYPE 500
358 TAKEOUT_INIT_DELAY_X TAKEOUT_INIT_DELAY_0 420 A wait of {seconds} seconds is required before being able to initiate the takeout
359 TAKEOUT_INVALID 400 The takeout session has been invalidated by another data export session
360 TAKEOUT_REQUIRED 400 You must initialize a takeout request first
361 TEMP_AUTH_KEY_EMPTY 400 No temporary auth key provided
374 UNKNOWN_ERROR 400
375 UNKNOWN_METHOD 500 The method you tried to call cannot be called on non-CDN DCs
376 UNTIL_DATE_INVALID 400 That date cannot be specified in this request (try using None)
377 UPDATE_APP_TO_LOGIN 406
378 URL_INVALID 400 The URL used was invalid (e.g. when answering a callback with a URL that's not t.me/yourbot or your game's URL)
379 USER_VOLUME_INVALID 400
380 USERNAME_INVALID 400 Nobody is using this username, or the username is unacceptable. If the latter, it must match r"[a-zA-Z][\w\d]{3,30}[a-zA-Z\d]"
400 USER_IS_BLOCKED 400 403 User is blocked
401 USER_IS_BOT 400 Bots can't send messages to other bots
402 USER_KICKED 400 This user was kicked from this supergroup/channel
403 USER_MIGRATE_X USER_MIGRATE_0 303 The user whose identity is being used to execute queries is associated with DC {new_dc}
404 USER_NOT_MUTUAL_CONTACT 400 403 The provided user is not a mutual contact
405 USER_NOT_PARTICIPANT 400 The target user is not a member of the specified megagroup or channel
406 USER_PRIVACY_RESTRICTED 403 The user's privacy settings do not allow you to do this

View File

@@ -7,7 +7,7 @@ account.confirmPasswordEmail,user,
account.confirmPhone,user,CODE_HASH_INVALID PHONE_CODE_EMPTY
account.createTheme,user,THEME_MIME_INVALID
account.declinePasswordReset,user,RESET_REQUEST_MISSING
account.deleteAccount,user,2FA_CONFIRM_WAIT_X
account.deleteAccount,user,2FA_CONFIRM_WAIT_0
account.deleteSecureValue,user,
account.finishTakeoutSession,user,
account.getAccountTTL,user,
@@ -57,7 +57,7 @@ account.setPrivacy,user,PRIVACY_KEY_INVALID PRIVACY_TOO_LONG
account.unregisterDevice,user,TOKEN_INVALID
account.updateDeviceLocked,user,
account.updateNotifySettings,user,PEER_ID_INVALID
account.updatePasswordSettings,user,EMAIL_UNCONFIRMED_X NEW_SALT_INVALID NEW_SETTINGS_INVALID PASSWORD_HASH_INVALID
account.updatePasswordSettings,user,EMAIL_UNCONFIRMED_0 NEW_SALT_INVALID NEW_SETTINGS_INVALID PASSWORD_HASH_INVALID
account.updateProfile,user,ABOUT_TOO_LONG FIRSTNAME_INVALID
account.updateStatus,user,SESSION_PASSWORD_NEEDED
account.updateTheme,user,THEME_INVALID
@@ -80,7 +80,7 @@ auth.importLoginToken,user,AUTH_TOKEN_ALREADY_ACCEPTED AUTH_TOKEN_EXPIRED AUTH_T
auth.logOut,both,
auth.recoverPassword,user,CODE_EMPTY NEW_SETTINGS_INVALID
auth.requestPasswordRecovery,user,PASSWORD_EMPTY PASSWORD_RECOVERY_NA
auth.resendCode,user,PHONE_NUMBER_INVALID
auth.resendCode,user,PHONE_NUMBER_INVALID SEND_CODE_UNAVAILABLE
auth.resetAuthorizations,user,TIMEOUT
auth.sendCode,user,API_ID_INVALID API_ID_PUBLISHED_FLOOD AUTH_RESTART INPUT_REQUEST_TOO_LONG PHONE_NUMBER_APP_SIGNUP_FORBIDDEN PHONE_NUMBER_BANNED PHONE_NUMBER_FLOOD PHONE_NUMBER_INVALID PHONE_PASSWORD_FLOOD PHONE_PASSWORD_PROTECTED
auth.signIn,user,PHONE_CODE_EMPTY PHONE_CODE_EXPIRED PHONE_CODE_INVALID PHONE_NUMBER_INVALID PHONE_NUMBER_UNOCCUPIED SESSION_PASSWORD_NEEDED
@@ -97,7 +97,7 @@ channels.deleteMessages,both,CHANNEL_INVALID CHANNEL_PRIVATE MESSAGE_DELETE_FORB
channels.deleteUserHistory,user,CHANNEL_INVALID CHAT_ADMIN_REQUIRED
channels.editAdmin,both,ADMINS_TOO_MUCH ADMIN_RANK_EMOJI_NOT_ALLOWED ADMIN_RANK_INVALID BOT_CHANNELS_NA CHANNEL_INVALID CHAT_ADMIN_INVITE_REQUIRED CHAT_ADMIN_REQUIRED FRESH_CHANGE_ADMINS_FORBIDDEN RIGHT_FORBIDDEN USER_CREATOR USER_ID_INVALID USER_NOT_MUTUAL_CONTACT USER_PRIVACY_RESTRICTED
channels.editBanned,both,CHANNEL_INVALID CHANNEL_PRIVATE CHAT_ADMIN_REQUIRED USER_ADMIN_INVALID USER_ID_INVALID
channels.editCreator,user,PASSWORD_MISSING PASSWORD_TOO_FRESH_X SESSION_TOO_FRESH_X SRP_ID_INVALID
channels.editCreator,user,PASSWORD_MISSING PASSWORD_TOO_FRESH_0 SESSION_TOO_FRESH_0 SRP_ID_INVALID
channels.editLocation,user,
channels.editPhoto,both,CHANNEL_INVALID CHAT_ADMIN_REQUIRED FILE_REFERENCE_INVALID PHOTO_INVALID
channels.editTitle,both,CHANNEL_INVALID CHAT_ADMIN_REQUIRED CHAT_NOT_MODIFIED
@@ -197,7 +197,7 @@ messages.editChatPhoto,both,CHAT_ID_INVALID INPUT_CONSTRUCTOR_INVALID INPUT_FETC
messages.editChatTitle,both,CHAT_ID_INVALID NEED_CHAT_INVALID
messages.editInlineBotMessage,both,MESSAGE_ID_INVALID MESSAGE_NOT_MODIFIED
messages.editMessage,both,CHANNEL_INVALID CHANNEL_PRIVATE CHAT_WRITE_FORBIDDEN INLINE_BOT_REQUIRED INPUT_USER_DEACTIVATED MEDIA_GROUPED_INVALID MEDIA_NEW_INVALID MEDIA_PREV_INVALID MESSAGE_AUTHOR_REQUIRED MESSAGE_EDIT_TIME_EXPIRED MESSAGE_EMPTY MESSAGE_ID_INVALID MESSAGE_NOT_MODIFIED PEER_ID_INVALID
messages.exportChatInvite,both,CHAT_ID_INVALID
messages.exportChatInvite,both,CHAT_ID_INVALID EXPIRE_DATE_INVALID
messages.faveSticker,user,STICKER_ID_INVALID
messages.forwardMessages,both,BROADCAST_PUBLIC_VOTERS_FORBIDDEN CHANNEL_INVALID CHANNEL_PRIVATE CHAT_ADMIN_REQUIRED CHAT_ID_INVALID CHAT_SEND_GIFS_FORBIDDEN CHAT_SEND_MEDIA_FORBIDDEN CHAT_SEND_STICKERS_FORBIDDEN CHAT_WRITE_FORBIDDEN GROUPED_MEDIA_INVALID INPUT_USER_DEACTIVATED MEDIA_EMPTY MESSAGE_IDS_EMPTY MESSAGE_ID_INVALID PEER_ID_INVALID PTS_CHANGE_EMPTY QUIZ_ANSWER_MISSING RANDOM_ID_DUPLICATE RANDOM_ID_INVALID SCHEDULE_DATE_TOO_LATE SCHEDULE_TOO_MUCH TIMEOUT USER_BANNED_IN_CHANNEL USER_IS_BLOCKED USER_IS_BOT YOU_BLOCKED_USER
messages.getAllChats,user,
@@ -251,7 +251,7 @@ messages.getWebPage,user,WC_CONVERT_URL_INVALID
messages.getWebPagePreview,user,
messages.hidePeerSettingsBar,user,
messages.importChatInvite,user,CHANNELS_TOO_MUCH INVITE_HASH_EMPTY INVITE_HASH_EXPIRED INVITE_HASH_INVALID SESSION_PASSWORD_NEEDED USERS_TOO_MUCH USER_ALREADY_PARTICIPANT
messages.initHistoryImport,user,IMPORT_FILE_INVALID IMPORT_FORMAT_UNRECOGNIZED PREVIOUS_CHAT_IMPORT_ACTIVE_WAIT_XMIN TIMEOUT
messages.initHistoryImport,user,IMPORT_FILE_INVALID IMPORT_FORMAT_UNRECOGNIZED PREVIOUS_CHAT_IMPORT_ACTIVE_WAIT_0MIN TIMEOUT
messages.installStickerSet,user,STICKERSET_INVALID
messages.markDialogUnread,user,
messages.migrateChat,user,CHAT_ADMIN_REQUIRED CHAT_ID_INVALID PEER_ID_INVALID
@@ -337,8 +337,8 @@ reqPq,both,
reqPqMulti,both,
rpcDropAnswer,both,
setClientDHParams,both,
stats.getBroadcastStats,user,BROADCAST_REQUIRED CHAT_ADMIN_REQUIRED CHP_CALL_FAIL STATS_MIGRATE_X
stats.getMegagroupStats,user,CHAT_ADMIN_REQUIRED MEGAGROUP_REQUIRED STATS_MIGRATE_X
stats.getBroadcastStats,user,BROADCAST_REQUIRED CHAT_ADMIN_REQUIRED CHP_CALL_FAIL STATS_MIGRATE_0
stats.getMegagroupStats,user,CHAT_ADMIN_REQUIRED MEGAGROUP_REQUIRED STATS_MIGRATE_0
stats.loadAsyncGraph,user,GRAPH_INVALID_RELOAD GRAPH_OUTDATED_RELOAD
stickers.addStickerToSet,bot,BOT_MISSING STICKERSET_INVALID STICKER_PNG_NOPNG STICKER_TGS_NOTGS
stickers.changeStickerPosition,bot,BOT_MISSING STICKER_INVALID
1 method usability errors
7 account.confirmPhone user CODE_HASH_INVALID PHONE_CODE_EMPTY
8 account.createTheme user THEME_MIME_INVALID
9 account.declinePasswordReset user RESET_REQUEST_MISSING
10 account.deleteAccount user 2FA_CONFIRM_WAIT_X 2FA_CONFIRM_WAIT_0
11 account.deleteSecureValue user
12 account.finishTakeoutSession user
13 account.getAccountTTL user
57 account.unregisterDevice user TOKEN_INVALID
58 account.updateDeviceLocked user
59 account.updateNotifySettings user PEER_ID_INVALID
60 account.updatePasswordSettings user EMAIL_UNCONFIRMED_X NEW_SALT_INVALID NEW_SETTINGS_INVALID PASSWORD_HASH_INVALID EMAIL_UNCONFIRMED_0 NEW_SALT_INVALID NEW_SETTINGS_INVALID PASSWORD_HASH_INVALID
61 account.updateProfile user ABOUT_TOO_LONG FIRSTNAME_INVALID
62 account.updateStatus user SESSION_PASSWORD_NEEDED
63 account.updateTheme user THEME_INVALID
80 auth.logOut both
81 auth.recoverPassword user CODE_EMPTY NEW_SETTINGS_INVALID
82 auth.requestPasswordRecovery user PASSWORD_EMPTY PASSWORD_RECOVERY_NA
83 auth.resendCode user PHONE_NUMBER_INVALID PHONE_NUMBER_INVALID SEND_CODE_UNAVAILABLE
84 auth.resetAuthorizations user TIMEOUT
85 auth.sendCode user API_ID_INVALID API_ID_PUBLISHED_FLOOD AUTH_RESTART INPUT_REQUEST_TOO_LONG PHONE_NUMBER_APP_SIGNUP_FORBIDDEN PHONE_NUMBER_BANNED PHONE_NUMBER_FLOOD PHONE_NUMBER_INVALID PHONE_PASSWORD_FLOOD PHONE_PASSWORD_PROTECTED
86 auth.signIn user PHONE_CODE_EMPTY PHONE_CODE_EXPIRED PHONE_CODE_INVALID PHONE_NUMBER_INVALID PHONE_NUMBER_UNOCCUPIED SESSION_PASSWORD_NEEDED
97 channels.deleteUserHistory user CHANNEL_INVALID CHAT_ADMIN_REQUIRED
98 channels.editAdmin both ADMINS_TOO_MUCH ADMIN_RANK_EMOJI_NOT_ALLOWED ADMIN_RANK_INVALID BOT_CHANNELS_NA CHANNEL_INVALID CHAT_ADMIN_INVITE_REQUIRED CHAT_ADMIN_REQUIRED FRESH_CHANGE_ADMINS_FORBIDDEN RIGHT_FORBIDDEN USER_CREATOR USER_ID_INVALID USER_NOT_MUTUAL_CONTACT USER_PRIVACY_RESTRICTED
99 channels.editBanned both CHANNEL_INVALID CHANNEL_PRIVATE CHAT_ADMIN_REQUIRED USER_ADMIN_INVALID USER_ID_INVALID
100 channels.editCreator user PASSWORD_MISSING PASSWORD_TOO_FRESH_X SESSION_TOO_FRESH_X SRP_ID_INVALID PASSWORD_MISSING PASSWORD_TOO_FRESH_0 SESSION_TOO_FRESH_0 SRP_ID_INVALID
101 channels.editLocation user
102 channels.editPhoto both CHANNEL_INVALID CHAT_ADMIN_REQUIRED FILE_REFERENCE_INVALID PHOTO_INVALID
103 channels.editTitle both CHANNEL_INVALID CHAT_ADMIN_REQUIRED CHAT_NOT_MODIFIED
197 messages.editChatTitle both CHAT_ID_INVALID NEED_CHAT_INVALID
198 messages.editInlineBotMessage both MESSAGE_ID_INVALID MESSAGE_NOT_MODIFIED
199 messages.editMessage both CHANNEL_INVALID CHANNEL_PRIVATE CHAT_WRITE_FORBIDDEN INLINE_BOT_REQUIRED INPUT_USER_DEACTIVATED MEDIA_GROUPED_INVALID MEDIA_NEW_INVALID MEDIA_PREV_INVALID MESSAGE_AUTHOR_REQUIRED MESSAGE_EDIT_TIME_EXPIRED MESSAGE_EMPTY MESSAGE_ID_INVALID MESSAGE_NOT_MODIFIED PEER_ID_INVALID
200 messages.exportChatInvite both CHAT_ID_INVALID CHAT_ID_INVALID EXPIRE_DATE_INVALID
201 messages.faveSticker user STICKER_ID_INVALID
202 messages.forwardMessages both BROADCAST_PUBLIC_VOTERS_FORBIDDEN CHANNEL_INVALID CHANNEL_PRIVATE CHAT_ADMIN_REQUIRED CHAT_ID_INVALID CHAT_SEND_GIFS_FORBIDDEN CHAT_SEND_MEDIA_FORBIDDEN CHAT_SEND_STICKERS_FORBIDDEN CHAT_WRITE_FORBIDDEN GROUPED_MEDIA_INVALID INPUT_USER_DEACTIVATED MEDIA_EMPTY MESSAGE_IDS_EMPTY MESSAGE_ID_INVALID PEER_ID_INVALID PTS_CHANGE_EMPTY QUIZ_ANSWER_MISSING RANDOM_ID_DUPLICATE RANDOM_ID_INVALID SCHEDULE_DATE_TOO_LATE SCHEDULE_TOO_MUCH TIMEOUT USER_BANNED_IN_CHANNEL USER_IS_BLOCKED USER_IS_BOT YOU_BLOCKED_USER
203 messages.getAllChats user
251 messages.getWebPagePreview user
252 messages.hidePeerSettingsBar user
253 messages.importChatInvite user CHANNELS_TOO_MUCH INVITE_HASH_EMPTY INVITE_HASH_EXPIRED INVITE_HASH_INVALID SESSION_PASSWORD_NEEDED USERS_TOO_MUCH USER_ALREADY_PARTICIPANT
254 messages.initHistoryImport user IMPORT_FILE_INVALID IMPORT_FORMAT_UNRECOGNIZED PREVIOUS_CHAT_IMPORT_ACTIVE_WAIT_XMIN TIMEOUT IMPORT_FILE_INVALID IMPORT_FORMAT_UNRECOGNIZED PREVIOUS_CHAT_IMPORT_ACTIVE_WAIT_0MIN TIMEOUT
255 messages.installStickerSet user STICKERSET_INVALID
256 messages.markDialogUnread user
257 messages.migrateChat user CHAT_ADMIN_REQUIRED CHAT_ID_INVALID PEER_ID_INVALID
337 reqPqMulti both
338 rpcDropAnswer both
339 setClientDHParams both
340 stats.getBroadcastStats user BROADCAST_REQUIRED CHAT_ADMIN_REQUIRED CHP_CALL_FAIL STATS_MIGRATE_X BROADCAST_REQUIRED CHAT_ADMIN_REQUIRED CHP_CALL_FAIL STATS_MIGRATE_0
341 stats.getMegagroupStats user CHAT_ADMIN_REQUIRED MEGAGROUP_REQUIRED STATS_MIGRATE_X CHAT_ADMIN_REQUIRED MEGAGROUP_REQUIRED STATS_MIGRATE_0
342 stats.loadAsyncGraph user GRAPH_INVALID_RELOAD GRAPH_OUTDATED_RELOAD
343 stickers.addStickerToSet bot BOT_MISSING STICKERSET_INVALID STICKER_PNG_NOPNG STICKER_TGS_NOTGS
344 stickers.changeStickerPosition bot BOT_MISSING STICKER_INVALID

View File

@@ -370,7 +370,7 @@ def _write_html_pages(tlobjects, methods, layer, input_res):
))
docs.begin_table(column_count=2)
for error in errors:
docs.add_row('<code>{}</code>'.format(error.name))
docs.add_row('<code>{}</code>'.format(error.canonical_name))
docs.add_row('{}.'.format(error.description))
docs.end_table()
docs.write_text('You can import these from '
@@ -396,7 +396,7 @@ def _write_html_pages(tlobjects, methods, layer, input_res):
docs.write('<details>')
docs.write('''<pre>\
<strong>from</strong> telethon.sync <strong>import</strong> TelegramClient
<strong>from</strong> telethon <strong>import</strong> TelegramClient
<strong>from</strong> telethon <strong>import</strong> functions, types
<strong>with</strong> TelegramClient(name, api_id, api_hash) <strong>as</strong> client:

View File

@@ -1,60 +1,12 @@
def generate_errors(errors, f):
# Exact/regex match to create {CODE: ErrorClassName}
exact_match = []
regex_match = []
# Find out what subclasses to import and which to create
import_base, create_base = set(), {}
f.write('_captures = {\n')
for error in errors:
if error.subclass_exists:
import_base.add(error.subclass)
else:
create_base[error.subclass] = error.int_code
if error.capture_name:
f.write(f" {error.canonical_name!r}: {error.capture_name!r},\n")
f.write('}\n')
if error.has_captures:
regex_match.append(error)
else:
exact_match.append(error)
# Imports and new subclass creation
f.write('from .rpcbaseerrors import RPCError, {}\n'
.format(", ".join(sorted(import_base))))
for cls, int_code in sorted(create_base.items(), key=lambda t: t[1]):
f.write('\n\nclass {}(RPCError):\n code = {}\n'
.format(cls, int_code))
# Error classes generation
f.write('\n\n_descriptions = {\n')
for error in errors:
f.write('\n\nclass {}({}):\n '.format(error.name, error.subclass))
if error.has_captures:
f.write('def __init__(self, request, capture=0):\n '
' self.request = request\n ')
f.write(' self.{} = int(capture)\n '
.format(error.capture_name))
else:
f.write('def __init__(self, request):\n '
' self.request = request\n ')
f.write('super(Exception, self).__init__('
'{}'.format(repr(error.description)))
if error.has_captures:
f.write('.format({0}=self.{0})'.format(error.capture_name))
f.write(' + self._fmt_request(self.request))\n\n')
f.write(' def __reduce__(self):\n ')
if error.has_captures:
f.write('return type(self), (self.request, self.{})\n'.format(error.capture_name))
else:
f.write('return type(self), (self.request,)\n')
# Create the actual {CODE: ErrorClassName} dict once classes are defined
f.write('\n\nrpc_errors_dict = {\n')
for error in exact_match:
f.write(' {}: {},\n'.format(repr(error.pattern), error.name))
f.write('}\n\nrpc_errors_re = (\n')
for error in regex_match:
f.write(' ({}, {}),\n'.format(repr(error.pattern), error.name))
f.write(')\n')
if error.description:
f.write(f" {error.canonical_name!r}: {error.description!r},\n")
f.write('}\n')

View File

@@ -32,7 +32,7 @@ AUTO_CASTS = {
}
NAMED_AUTO_CASTS = {
('chat_id', 'int'): 'await client.get_peer_id({}, add_mark=False)'
('chat_id', 'int'): 'await client.get_peer_id({})'
}
# Secret chats have a chat_id which may be negative.
@@ -52,7 +52,7 @@ BASE_TYPES = ('string', 'bytes', 'int', 'long', 'int128',
def _write_modules(
out_dir, depth, kind, namespace_tlobjects, type_constructors):
out_dir, in_mod, kind, namespace_tlobjects, type_constructors, layer, all_tlobjects):
# namespace_tlobjects: {'namespace', [TLObject]}
out_dir.mkdir(parents=True, exist_ok=True)
for ns, tlobjects in namespace_tlobjects.items():
@@ -60,10 +60,11 @@ def _write_modules(
with file.open('w') as f, SourceBuilder(f) as builder:
builder.writeln(AUTO_GEN_NOTICE)
builder.writeln('from {}.tl.tlobject import TLObject', '.' * depth)
if kind != 'TLObject':
builder.writeln(
'from {}.tl.tlobject import {}', '.' * depth, kind)
if kind == 'TLObject':
builder.writeln('from .._misc.tlobject import TLObject, TLRequest')
builder.writeln('from . import fn')
else:
builder.writeln('from ..._misc.tlobject import TLObject, TLRequest')
builder.writeln('from typing import Optional, List, '
'Union, TYPE_CHECKING')
@@ -124,7 +125,11 @@ def _write_modules(
if not name or name in primitives:
continue
import_space = '{}.tl.types'.format('.' * depth)
if kind == 'TLObject':
import_space = '.'
else:
import_space = '..'
if '.' in name:
namespace = name.split('.')[0]
name = name.split('.')[1]
@@ -158,6 +163,9 @@ def _write_modules(
for line in type_defs:
builder.writeln(line)
if not ns and kind == 'TLObject':
_write_all_tlobjects(all_tlobjects, layer, builder)
def _write_source_code(tlobject, kind, builder, type_constructors):
"""
@@ -170,7 +178,6 @@ def _write_source_code(tlobject, kind, builder, type_constructors):
"""
_write_class_init(tlobject, kind, type_constructors, builder)
_write_resolve(tlobject, builder)
_write_to_dict(tlobject, builder)
_write_to_bytes(tlobject, builder)
_write_from_reader(tlobject, builder)
_write_read_result(tlobject, builder)
@@ -181,6 +188,15 @@ def _write_class_init(tlobject, kind, type_constructors, builder):
builder.writeln()
builder.writeln('class {}({}):', tlobject.class_name, kind)
# Define slots to help reduce the size of the objects a little bit.
# It's also good for knowing what fields an object has.
builder.write('__slots__ = (')
sep = ''
for arg in tlobject.real_args:
builder.write('{}{!r},', sep, arg.name)
sep = ' '
builder.writeln(')')
# Class-level variable to store its Telegram's constructor ID
builder.writeln('CONSTRUCTOR_ID = {:#x}', tlobject.id)
builder.writeln('SUBCLASS_OF_ID = {:#x}',
@@ -284,42 +300,6 @@ def _write_resolve(tlobject, builder):
builder.end_block()
def _write_to_dict(tlobject, builder):
builder.writeln('def to_dict(self):')
builder.writeln('return {')
builder.current_indent += 1
builder.write("'_': '{}'", tlobject.class_name)
for arg in tlobject.real_args:
builder.writeln(',')
builder.write("'{}': ", arg.name)
if arg.type in BASE_TYPES:
if arg.is_vector:
builder.write('[] if self.{0} is None else self.{0}[:]',
arg.name)
else:
builder.write('self.{}', arg.name)
else:
if arg.is_vector:
builder.write(
'[] if self.{0} is None else [x.to_dict() '
'if isinstance(x, TLObject) else x for x in self.{0}]',
arg.name
)
else:
builder.write(
'self.{0}.to_dict() '
'if isinstance(self.{0}, TLObject) else self.{0}',
arg.name
)
builder.writeln()
builder.current_indent -= 1
builder.writeln("}")
builder.end_block()
def _write_to_bytes(tlobject, builder):
builder.writeln('def _bytes(self):')
@@ -653,12 +633,6 @@ def _write_arg_read_code(builder, arg, tlobject, name):
def _write_all_tlobjects(tlobjects, layer, builder):
builder.writeln(AUTO_GEN_NOTICE)
builder.writeln()
builder.writeln('from . import types, functions')
builder.writeln()
# Create a constant variable to indicate which layer this is
builder.writeln('LAYER = {}', layer)
builder.writeln()
@@ -670,18 +644,19 @@ def _write_all_tlobjects(tlobjects, layer, builder):
# Fill the dictionary (0x1a2b3c4f: tl.full.type.path.Class)
for tlobject in tlobjects:
builder.write('{:#010x}: ', tlobject.id)
builder.write('functions' if tlobject.is_function else 'types')
if tlobject.is_function:
builder.write('fn.')
if tlobject.namespace:
builder.write('.{}', tlobject.namespace)
builder.write('{}.', tlobject.namespace)
builder.writeln('.{},', tlobject.class_name)
builder.writeln('{},', tlobject.class_name)
builder.current_indent -= 1
builder.writeln('}')
def generate_tlobjects(tlobjects, layer, import_depth, output_dir):
def generate_tlobjects(tlobjects, layer, input_mod, output_dir):
# Group everything by {namespace: [tlobjects]} to generate __init__.py
namespace_functions = defaultdict(list)
namespace_types = defaultdict(list)
@@ -695,15 +670,10 @@ def generate_tlobjects(tlobjects, layer, import_depth, output_dir):
namespace_types[tlobject.namespace].append(tlobject)
type_constructors[tlobject.result].append(tlobject)
_write_modules(output_dir / 'functions', import_depth, 'TLRequest',
namespace_functions, type_constructors)
_write_modules(output_dir / 'types', import_depth, 'TLObject',
namespace_types, type_constructors)
filename = output_dir / 'alltlobjects.py'
with filename.open('w') as file:
with SourceBuilder(file) as builder:
_write_all_tlobjects(tlobjects, layer, builder)
_write_modules(output_dir, input_mod, 'TLObject',
namespace_types, type_constructors, layer, tlobjects)
_write_modules(output_dir / 'fn', input_mod + '.fn', 'TLRequest',
namespace_functions, type_constructors, layer, tlobjects)
def clean_tlobjects(output_dir):
@@ -711,7 +681,3 @@ def clean_tlobjects(output_dir):
d = output_dir / d
if d.is_dir():
shutil.rmtree(str(d))
tl = output_dir / 'alltlobjects.py'
if tl.is_file():
tl.unlink()

View File

@@ -17,25 +17,16 @@ KNOWN_BASE_CLASSES = {
}
def _get_class_name(error_code):
def _get_canonical_name(error_code):
"""
Gets the corresponding class name for the given error code,
this either being an integer (thus base error name) or str.
Gets the corresponding canonical name for the given error code.
"""
if isinstance(error_code, int):
return KNOWN_BASE_CLASSES.get(
abs(error_code), 'RPCError' + str(error_code).replace('-', 'Neg')
)
# This code should match that of the library itself.
name = re.sub(r'[-_\d]', '', error_code).lower()
while name.endswith('error'):
name = name[:-len('error')]
if error_code.startswith('2'):
error_code = re.sub(r'2', 'TWO_', error_code, count=1)
if re.match(r'\d+', error_code):
raise RuntimeError('error code starting with a digit cannot have valid Python name: {}'.format(error_code))
return snake_to_camel_case(
error_code.replace('FIRSTNAME', 'FIRST_NAME')\
.replace('SLOWMODE', 'SLOW_MODE').lower(), suffix='Error')
return name
class Error:
@@ -45,18 +36,13 @@ class Error:
# Telegram isn't exactly consistent with returned errors anyway.
self.int_code = codes[0]
self.str_code = name
self.subclass = _get_class_name(codes[0])
self.subclass_exists = abs(codes[0]) in KNOWN_BASE_CLASSES
self.canonical_name = _get_canonical_name(name)
self.description = description
self.has_captures = '_X' in name
if self.has_captures:
self.name = _get_class_name(name.replace('_X', '_'))
self.pattern = name.replace('_X', r'_(\d+)')
has_captures = '0' in name
if has_captures:
self.capture_name = re.search(r'{(\w+)}', description).group(1)
else:
self.name = _get_class_name(name)
self.pattern = name
self.capture_name = None

View File

@@ -52,8 +52,7 @@ class TLObject:
assert self.id == self.infer_id(),\
'Invalid inferred ID for ' + repr(self)
self.class_name = snake_to_camel_case(
self.name, suffix='Request' if self.is_function else '')
self.class_name = snake_to_camel_case(self.name)
self.real_args = list(a for a in self.sorted_args() if not
(a.flag_indicator or a.generic_definition))