diff --git a/_schema/telegram.tl b/_schema/telegram.tl index cea596045c..56fb3bfe72 100644 --- a/_schema/telegram.tl +++ b/_schema/telegram.tl @@ -1,8 +1,8 @@ // Code generated by ./cmd/dltl, DO NOT EDIT. // // Source: https://raw.githubusercontent.com/tdlib/td/master/td/generate/scheme/telegram_api.tl -// Layer: 132 -// SHA256: 9eb958c089c1718e9417c4b0884736942a88e31f822d4c468e5664894bb17b48 +// Layer: 133 +// SHA256: 5f10a084a6a53d532e13ceaaaacf6a91ecc049292c68edfc723da3fd6cbbdd22 int#a8509bda ? = Int; @@ -48,23 +48,23 @@ inputPeerEmpty#7f3b18ea = InputPeer; inputPeerSelf#7da07ec9 = InputPeer; -inputPeerChat#179be863 chat_id:int = InputPeer; +inputPeerChat#35a95cb9 chat_id:long = InputPeer; -inputPeerUser#7b8e7de6 user_id:int access_hash:long = InputPeer; +inputPeerUser#dde8a54c user_id:long access_hash:long = InputPeer; -inputPeerChannel#20adaef8 channel_id:int access_hash:long = InputPeer; +inputPeerChannel#27bcbbfc channel_id:long access_hash:long = InputPeer; -inputPeerUserFromMessage#17bae2e6 peer:InputPeer msg_id:int user_id:int = InputPeer; +inputPeerUserFromMessage#a87b0a1c peer:InputPeer msg_id:int user_id:long = InputPeer; -inputPeerChannelFromMessage#9c95f7bb peer:InputPeer msg_id:int channel_id:int = InputPeer; +inputPeerChannelFromMessage#bd2a0840 peer:InputPeer msg_id:int channel_id:long = InputPeer; inputUserEmpty#b98886cf = InputUser; inputUserSelf#f7c1b13f = InputUser; -inputUser#d8292816 user_id:int access_hash:long = InputUser; +inputUser#f21158c6 user_id:long access_hash:long = InputUser; -inputUserFromMessage#2d117597 peer:InputPeer msg_id:int user_id:int = InputUser; +inputUserFromMessage#1da448e2 peer:InputPeer msg_id:int user_id:long = InputUser; inputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_name:string = InputContact; @@ -136,11 +136,11 @@ inputStickerSetThumb#9d84f3db stickerset:InputStickerSet thumb_version:int = Inp inputGroupCallStream#598a92a flags:# call:InputGroupCall time_ms:long scale:int video_channel:flags.0?int video_quality:flags.0?int = InputFileLocation; -peerUser#9db1bc6d user_id:int = Peer; +peerUser#59511722 user_id:long = Peer; -peerChat#bad0e5bb chat_id:int = Peer; +peerChat#36c6019a chat_id:long = Peer; -peerChannel#bddde532 channel_id:int = Peer; +peerChannel#a2a5371e channel_id:long = Peer; storage.fileUnknown#aa963b05 = storage.FileType; @@ -162,9 +162,9 @@ storage.fileMp4#b3cea0e4 = storage.FileType; storage.fileWebp#1081464c = storage.FileType; -userEmpty#200250ba id:int = User; +userEmpty#d3bc4b7a id:long = User; -user#938458c1 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 id:int 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 bot_inline_placeholder:flags.19?string lang_code:flags.22?string = User; +user#3ff6ecb0 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 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 bot_inline_placeholder:flags.19?string lang_code:flags.22?string = User; userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto; @@ -182,29 +182,29 @@ userStatusLastWeek#7bf09fc = UserStatus; userStatusLastMonth#77ebc742 = UserStatus; -chatEmpty#9ba2d800 id:int = Chat; +chatEmpty#29562865 id:long = Chat; -chat#3bda1bde 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:int 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 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#7328bdb id:int title:string = Chat; +chatForbidden#6592a1a7 id:long title:string = Chat; -channel#d31a961e 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:int access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int version:int restriction_reason:flags.9?Vector 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 id:long access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int restriction_reason:flags.9?Vector admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int = Chat; -channelForbidden#289da732 flags:# broadcast:flags.5?true megagroup:flags.8?true id:int access_hash:long title:string until_date:flags.16?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#49a0a5d9 flags:# can_set_username:flags.7?true has_scheduled:flags.8?true id:int about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:flags.13?ExportedChatInvite bot_info:flags.3?Vector 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; +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 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#2f532f3c 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:int 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 migrated_from_chat_id:flags.4?int 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?int 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 groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?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 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 groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string = ChatFull; -chatParticipant#c8d7493e user_id:int inviter_id:int date:int = ChatParticipant; +chatParticipant#c02d4007 user_id:long inviter_id:long date:int = ChatParticipant; -chatParticipantCreator#da13538a user_id:int = ChatParticipant; +chatParticipantCreator#e46bcee4 user_id:long = ChatParticipant; -chatParticipantAdmin#e2d6e436 user_id:int inviter_id:int date:int = ChatParticipant; +chatParticipantAdmin#a0933f5b user_id:long inviter_id:long date:int = ChatParticipant; -chatParticipantsForbidden#fc900c2b flags:# chat_id:int self_participant:flags.0?ChatParticipant = ChatParticipants; +chatParticipantsForbidden#8763d3e1 flags:# chat_id:long self_participant:flags.0?ChatParticipant = ChatParticipants; -chatParticipants#3f460fed chat_id:int participants:Vector version:int = ChatParticipants; +chatParticipants#3cbc93f8 chat_id:long participants:Vector version:int = ChatParticipants; chatPhotoEmpty#37c1011c = ChatPhoto; @@ -212,7 +212,7 @@ chatPhoto#1c6e1c11 flags:# has_video:flags.0?true photo_id:long stripped_thumb:f messageEmpty#90a6ca84 flags:# id:int peer_id:flags.0?Peer = Message; -message#bce383d2 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?int reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector 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 ttl_period:flags.25?int = 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 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 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; @@ -222,7 +222,7 @@ messageMediaPhoto#695150d7 flags:# photo:flags.0?Photo ttl_seconds:flags.2?int = messageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia; -messageMediaContact#cbf24940 phone_number:string first_name:string last_name:string vcard:string user_id:int = MessageMedia; +messageMediaContact#70322949 phone_number:string first_name:string last_name:string vcard:string user_id:long = MessageMedia; messageMediaUnsupported#9f84f49e = MessageMedia; @@ -244,7 +244,7 @@ messageMediaDice#3f7ee58b value:int emoticon:string = MessageMedia; messageActionEmpty#b6aef7b0 = MessageAction; -messageActionChatCreate#a6638b9a title:string users:Vector = MessageAction; +messageActionChatCreate#bd47cbad title:string users:Vector = MessageAction; messageActionChatEditTitle#b5a1ce5a title:string = MessageAction; @@ -252,17 +252,17 @@ messageActionChatEditPhoto#7fcb13a8 photo:Photo = MessageAction; messageActionChatDeletePhoto#95e3fbef = MessageAction; -messageActionChatAddUser#488a7337 users:Vector = MessageAction; +messageActionChatAddUser#15cefd00 users:Vector = MessageAction; -messageActionChatDeleteUser#b2ae9b0c user_id:int = MessageAction; +messageActionChatDeleteUser#a43f30cc user_id:long = MessageAction; -messageActionChatJoinedByLink#f89cf5e8 inviter_id:int = MessageAction; +messageActionChatJoinedByLink#31224c3 inviter_id:long = MessageAction; messageActionChannelCreate#95d2ac92 title:string = MessageAction; -messageActionChatMigrateTo#51bdb021 channel_id:int = MessageAction; +messageActionChatMigrateTo#e1037f92 channel_id:long = MessageAction; -messageActionChannelMigrateFrom#b055eaee title:string chat_id:int = MessageAction; +messageActionChannelMigrateFrom#ea3948e9 title:string chat_id:long = MessageAction; messageActionPinMessage#94bd38ed = MessageAction; @@ -292,7 +292,7 @@ messageActionGeoProximityReached#98e0d697 from_id:Peer to_id:Peer distance:int = messageActionGroupCall#7a0d7f42 flags:# call:InputGroupCall duration:flags.0?int = MessageAction; -messageActionInviteToGroupCall#76b9f11a call:InputGroupCall users:Vector = MessageAction; +messageActionInviteToGroupCall#502f92f7 call:InputGroupCall users:Vector = MessageAction; messageActionSetMessagesTTL#aa1afbfd period:int = MessageAction; @@ -330,7 +330,7 @@ auth.authorization#cd050916 flags:# tmp_sessions:flags.0?int user:User = auth.Au auth.authorizationSignUpRequired#44747e9a flags:# terms_of_service:flags.0?help.TermsOfService = auth.Authorization; -auth.exportedAuthorization#df969c2d id:int bytes:bytes = auth.ExportedAuthorization; +auth.exportedAuthorization#b434e2b8 id:long bytes:bytes = auth.ExportedAuthorization; inputNotifyPeer#b8bc5b0c peer:InputPeer = InputNotifyPeer; @@ -368,11 +368,11 @@ 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; -contact#f911c994 user_id:int mutual:Bool = Contact; +contact#145ade0b user_id:long mutual:Bool = Contact; -importedContact#d0028438 user_id:int client_id:long = ImportedContact; +importedContact#c13e3c50 user_id:long client_id:long = ImportedContact; -contactStatus#d3680c61 user_id:int status:UserStatus = ContactStatus; +contactStatus#16d9703b user_id:long status:UserStatus = ContactStatus; contacts.contactsNotModified#b74ba9d2 = contacts.Contacts; @@ -446,17 +446,17 @@ updateMessageID#4e90bfd6 id:int random_id:long = Update; updateDeleteMessages#a20db0e5 messages:Vector pts:int pts_count:int = Update; -updateUserTyping#5c486927 user_id:int action:SendMessageAction = Update; +updateUserTyping#c01e857f user_id:long action:SendMessageAction = Update; -updateChatUserTyping#86cadb6c chat_id:int from_id:Peer action:SendMessageAction = Update; +updateChatUserTyping#83487af0 chat_id:long from_id:Peer action:SendMessageAction = Update; updateChatParticipants#7761198 participants:ChatParticipants = Update; -updateUserStatus#1bfbd823 user_id:int status:UserStatus = Update; +updateUserStatus#e5bdf8de user_id:long status:UserStatus = Update; -updateUserName#a7332b73 user_id:int first_name:string last_name:string username:string = Update; +updateUserName#c3f202e0 user_id:long first_name:string last_name:string username:string = Update; -updateUserPhoto#95313b0c user_id:int date:int photo:UserProfilePhoto previous:Bool = Update; +updateUserPhoto#f227868c user_id:long date:int photo:UserProfilePhoto previous:Bool = Update; updateNewEncryptedMessage#12bcbd9a message:EncryptedMessage qts:int = Update; @@ -466,9 +466,9 @@ updateEncryption#b4a2e88d chat:EncryptedChat date:int = Update; updateEncryptedMessagesRead#38fe25b7 chat_id:int max_date:int date:int = Update; -updateChatParticipantAdd#ea4b0e5c chat_id:int user_id:int inviter_id:int date:int version:int = Update; +updateChatParticipantAdd#3dda5451 chat_id:long user_id:long inviter_id:long date:int version:int = Update; -updateChatParticipantDelete#6e5f8c22 chat_id:int user_id:int version:int = Update; +updateChatParticipantDelete#e32f3d77 chat_id:long user_id:long version:int = Update; updateDcOptions#8e5e9873 dc_options:Vector = Update; @@ -478,7 +478,7 @@ updateServiceNotification#ebe46819 flags:# popup:flags.0?true inbox_date:flags.1 updatePrivacy#ee3b272a key:PrivacyKey rules:Vector = Update; -updateUserPhone#12b9417b user_id:int phone:string = Update; +updateUserPhone#5492a13 user_id:long phone:string = Update; updateReadHistoryInbox#9c974fdf flags:# folder_id:flags.0?int peer:Peer max_id:int still_unread_count:int pts:int pts_count:int = Update; @@ -488,19 +488,19 @@ updateWebPage#7f891213 webpage:WebPage pts:int pts_count:int = Update; updateReadMessagesContents#68c13933 messages:Vector pts:int pts_count:int = Update; -updateChannelTooLong#eb0467fb flags:# channel_id:int pts:flags.0?int = Update; +updateChannelTooLong#108d941f flags:# channel_id:long pts:flags.0?int = Update; -updateChannel#b6d45656 channel_id:int = Update; +updateChannel#635b4c09 channel_id:long = Update; updateNewChannelMessage#62ba04d9 message:Message pts:int pts_count:int = Update; -updateReadChannelInbox#330b5424 flags:# folder_id:flags.0?int channel_id:int max_id:int still_unread_count:int pts:int = Update; +updateReadChannelInbox#922e6e10 flags:# folder_id:flags.0?int channel_id:long max_id:int still_unread_count:int pts:int = Update; -updateDeleteChannelMessages#c37521c9 channel_id:int messages:Vector pts:int pts_count:int = Update; +updateDeleteChannelMessages#c32d5b12 channel_id:long messages:Vector pts:int pts_count:int = Update; -updateChannelMessageViews#98a12b4b channel_id:int id:int views:int = Update; +updateChannelMessageViews#f226ac08 channel_id:long id:int views:int = Update; -updateChatParticipantAdmin#b6901959 chat_id:int user_id:int is_admin:Bool version:int = Update; +updateChatParticipantAdmin#d7ca61a2 chat_id:long user_id:long is_admin:Bool version:int = Update; updateNewStickerSet#688a30aa stickerset:messages.StickerSet = Update; @@ -510,19 +510,19 @@ updateStickerSets#43ae3dec = Update; updateSavedGifs#9375341e = Update; -updateBotInlineQuery#3f2038db flags:# query_id:long user_id:int query:string geo:flags.0?GeoPoint peer_type:flags.1?InlineQueryPeerType offset:string = Update; +updateBotInlineQuery#496f379c flags:# query_id:long user_id:long query:string geo:flags.0?GeoPoint peer_type:flags.1?InlineQueryPeerType offset:string = Update; -updateBotInlineSend#e48f964 flags:# user_id:int query:string geo:flags.0?GeoPoint id:string msg_id:flags.1?InputBotInlineMessageID = Update; +updateBotInlineSend#12f12a07 flags:# user_id:long query:string geo:flags.0?GeoPoint id:string msg_id:flags.1?InputBotInlineMessageID = Update; updateEditChannelMessage#1b3f4df7 message:Message pts:int pts_count:int = Update; -updateBotCallbackQuery#e73547e1 flags:# query_id:long user_id:int peer:Peer msg_id:int chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update; +updateBotCallbackQuery#b9cfc48d flags:# query_id:long user_id:long peer:Peer msg_id:int chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update; updateEditMessage#e40370a3 message:Message pts:int pts_count:int = Update; -updateInlineBotCallbackQuery#f9d27a5a flags:# query_id:long user_id:int msg_id:InputBotInlineMessageID chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update; +updateInlineBotCallbackQuery#691e9052 flags:# query_id:long user_id:long msg_id:InputBotInlineMessageID chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update; -updateReadChannelOutbox#25d6c9c7 channel_id:int max_id:int = Update; +updateReadChannelOutbox#b75f99a9 channel_id:long max_id:int = Update; updateDraftMessage#ee2bb969 peer:Peer draft:DraftMessage = Update; @@ -534,7 +534,7 @@ updateConfig#a229dd06 = Update; updatePtsChanged#3354678f = Update; -updateChannelWebPage#40771900 channel_id:int webpage:WebPage pts:int pts_count:int = Update; +updateChannelWebPage#2f2ba99f channel_id:long webpage:WebPage pts:int pts_count:int = Update; updateDialogPinned#6e6fe51c flags:# pinned:flags.0?true folder_id:flags.1?int peer:DialogPeer = Update; @@ -544,9 +544,9 @@ updateBotWebhookJSON#8317c0c3 data:DataJSON = Update; updateBotWebhookJSONQuery#9b9240a6 query_id:long data:DataJSON timeout:int = Update; -updateBotShippingQuery#e0cdc940 query_id:long user_id:int payload:bytes shipping_address:PostAddress = Update; +updateBotShippingQuery#b5aefd7d query_id:long user_id:long payload:bytes shipping_address:PostAddress = Update; -updateBotPrecheckoutQuery#5d2f3aa9 flags:# query_id:long user_id:int payload:bytes info:flags.0?PaymentRequestedInfo shipping_option_id:flags.1?string currency:string total_amount:long = Update; +updateBotPrecheckoutQuery#8caa9a96 flags:# query_id:long user_id:long payload:bytes info:flags.0?PaymentRequestedInfo shipping_option_id:flags.1?string currency:string total_amount:long = Update; updatePhoneCall#ab0f6b1e phone_call:PhoneCall = Update; @@ -556,11 +556,11 @@ updateLangPack#56022f4d difference:LangPackDifference = Update; updateFavedStickers#e511996d = Update; -updateChannelReadMessagesContents#89893b45 channel_id:int messages:Vector = Update; +updateChannelReadMessagesContents#44bdd535 channel_id:long messages:Vector = Update; updateContactsReset#7084a7be = Update; -updateChannelAvailableMessages#70db6837 channel_id:int available_min_id:int = Update; +updateChannelAvailableMessages#b23fc698 channel_id:long available_min_id:int = Update; updateDialogUnreadMark#e16459c3 flags:# unread:flags.0?true peer:DialogPeer = Update; @@ -584,7 +584,7 @@ updateGeoLiveViewed#871fb939 peer:Peer msg_id:int = Update; updateLoginToken#564fe691 = Update; -updateMessagePollVote#37f69f0b poll_id:long user_id:int options:Vector qts:int = Update; +updateMessagePollVote#106395c9 poll_id:long user_id:long options:Vector qts:int = Update; updateDialogFilter#26ffde7d flags:# id:int filter:flags.0?DialogFilter = Update; @@ -594,37 +594,37 @@ updateDialogFilters#3504914f = Update; updatePhoneCallSignalingData#2661bf09 phone_call_id:long data:bytes = Update; -updateChannelMessageForwards#6e8a84df channel_id:int id:int forwards:int = Update; +updateChannelMessageForwards#d29a27f4 channel_id:long id:int forwards:int = Update; -updateReadChannelDiscussionInbox#1cc7de54 flags:# channel_id:int top_msg_id:int read_max_id:int broadcast_id:flags.0?int broadcast_post:flags.0?int = Update; +updateReadChannelDiscussionInbox#d6b19546 flags:# channel_id:long top_msg_id:int read_max_id:int broadcast_id:flags.0?long broadcast_post:flags.0?int = Update; -updateReadChannelDiscussionOutbox#4638a26c channel_id:int top_msg_id:int read_max_id:int = Update; +updateReadChannelDiscussionOutbox#695c9e7c channel_id:long top_msg_id:int read_max_id:int = Update; updatePeerBlocked#246a4b22 peer_id:Peer blocked:Bool = Update; -updateChannelUserTyping#6b171718 flags:# channel_id:int top_msg_id:flags.0?int from_id:Peer action:SendMessageAction = Update; +updateChannelUserTyping#8c88c923 flags:# channel_id:long top_msg_id:flags.0?int from_id:Peer action:SendMessageAction = Update; updatePinnedMessages#ed85eab5 flags:# pinned:flags.0?true peer:Peer messages:Vector pts:int pts_count:int = Update; -updatePinnedChannelMessages#8588878b flags:# pinned:flags.0?true channel_id:int messages:Vector pts:int pts_count:int = Update; +updatePinnedChannelMessages#5bb98608 flags:# pinned:flags.0?true channel_id:long messages:Vector pts:int pts_count:int = Update; -updateChat#1330a196 chat_id:int = Update; +updateChat#f89a6a4e chat_id:long = Update; updateGroupCallParticipants#f2ebdb4e call:InputGroupCall participants:Vector version:int = Update; -updateGroupCall#a45eb99b chat_id:int call:GroupCall = Update; +updateGroupCall#14b24500 chat_id:long call:GroupCall = Update; updatePeerHistoryTTL#bb9bb9a5 flags:# peer:Peer ttl_period:flags.0?int = Update; -updateChatParticipant#f3b3781f flags:# chat_id:int date:int actor_id:int user_id:int prev_participant:flags.0?ChatParticipant new_participant:flags.1?ChatParticipant invite:flags.2?ExportedChatInvite qts:int = Update; +updateChatParticipant#d087663a flags:# chat_id:long date:int actor_id:long user_id:long prev_participant:flags.0?ChatParticipant new_participant:flags.1?ChatParticipant invite:flags.2?ExportedChatInvite qts:int = Update; -updateChannelParticipant#7fecb1ec flags:# channel_id:int date:int actor_id:int user_id:int prev_participant:flags.0?ChannelParticipant new_participant:flags.1?ChannelParticipant invite:flags.2?ExportedChatInvite qts:int = Update; +updateChannelParticipant#985d3abb flags:# channel_id:long date:int actor_id:long user_id:long prev_participant:flags.0?ChannelParticipant new_participant:flags.1?ChannelParticipant invite:flags.2?ExportedChatInvite qts:int = Update; -updateBotStopped#7f9488a user_id:int date:int stopped:Bool qts:int = Update; +updateBotStopped#c4870a49 user_id:long date:int stopped:Bool qts:int = Update; updateGroupCallConnection#b783982 flags:# presentation:flags.0?true params:DataJSON = Update; -updateBotCommands#cf7e0873 peer:Peer bot_id:int commands:Vector = Update; +updateBotCommands#4d712f2e peer:Peer bot_id:long commands:Vector = Update; updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State; @@ -638,9 +638,9 @@ updates.differenceTooLong#4afe8f6d pts:int = updates.Difference; updatesTooLong#e317af7e = Updates; -updateShortMessage#faeff833 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int user_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector ttl_period:flags.25?int = Updates; +updateShortMessage#313bc7f8 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int user_id:long message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector ttl_period:flags.25?int = Updates; -updateShortChatMessage#1157b858 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int from_id:int chat_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector ttl_period:flags.25?int = Updates; +updateShortChatMessage#4d6deea5 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int from_id:long chat_id:long message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector ttl_period:flags.25?int = Updates; updateShort#78d4dec1 update:Update date:int = Updates; @@ -674,11 +674,11 @@ help.inviteText#18cb9f78 message:string = help.InviteText; encryptedChatEmpty#ab7ec0a0 id:int = EncryptedChat; -encryptedChatWaiting#3bf703dc id:int access_hash:long date:int admin_id:int participant_id:int = EncryptedChat; +encryptedChatWaiting#66b25953 id:int access_hash:long date:int admin_id:long participant_id:long = EncryptedChat; -encryptedChatRequested#62718a82 flags:# folder_id:flags.0?int id:int access_hash:long date:int admin_id:int participant_id:int g_a:bytes = EncryptedChat; +encryptedChatRequested#48f1d94c flags:# folder_id:flags.0?int id:int access_hash:long date:int admin_id:long participant_id:long g_a:bytes = EncryptedChat; -encryptedChat#fa56ce36 id:int access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long = EncryptedChat; +encryptedChat#61f0d4c7 id:int access_hash:long date:int admin_id:long participant_id:long g_a_or_b:bytes key_fingerprint:long = EncryptedChat; encryptedChatDiscarded#1e1c7c45 flags:# history_deleted:flags.0?true id:int = EncryptedChat; @@ -758,6 +758,10 @@ sendMessageHistoryImportAction#dbda9246 progress:int = SendMessageAction; sendMessageChooseStickerAction#b05ac6b1 = SendMessageAction; +sendMessageEmojiInteraction#25972bcb emoticon:string msg_id:int interaction:DataJSON = SendMessageAction; + +sendMessageEmojiInteractionSeen#b665902e emoticon:string = SendMessageAction; + contacts.found#b3134d9d my_results:Vector results:Vector chats:Vector users:Vector = contacts.Found; inputPrivacyKeyStatusTimestamp#4f96cb18 = InputPrivacyKey; @@ -804,25 +808,25 @@ inputPrivacyValueDisallowAll#d66b66c9 = InputPrivacyRule; inputPrivacyValueDisallowUsers#90110467 users:Vector = InputPrivacyRule; -inputPrivacyValueAllowChatParticipants#4c81c1ba chats:Vector = InputPrivacyRule; +inputPrivacyValueAllowChatParticipants#840649cf chats:Vector = InputPrivacyRule; -inputPrivacyValueDisallowChatParticipants#d82363af chats:Vector = InputPrivacyRule; +inputPrivacyValueDisallowChatParticipants#e94f0f86 chats:Vector = InputPrivacyRule; privacyValueAllowContacts#fffe1bac = PrivacyRule; privacyValueAllowAll#65427b82 = PrivacyRule; -privacyValueAllowUsers#4d5bbe0c users:Vector = PrivacyRule; +privacyValueAllowUsers#b8905fb2 users:Vector = PrivacyRule; privacyValueDisallowContacts#f888fa1a = PrivacyRule; privacyValueDisallowAll#8b73e763 = PrivacyRule; -privacyValueDisallowUsers#c7f49b7 users:Vector = PrivacyRule; +privacyValueDisallowUsers#e4621141 users:Vector = PrivacyRule; -privacyValueAllowChatParticipants#18be796b chats:Vector = PrivacyRule; +privacyValueAllowChatParticipants#6b134e8e chats:Vector = PrivacyRule; -privacyValueDisallowChatParticipants#acae0690 chats:Vector = PrivacyRule; +privacyValueDisallowChatParticipants#41c87565 chats:Vector = PrivacyRule; account.privacyRules#50a04e45 rules:Vector chats:Vector users:Vector = account.PrivacyRules; @@ -844,13 +848,13 @@ documentAttributeHasStickers#9801d2f7 = DocumentAttribute; messages.stickersNotModified#f1749a22 = messages.Stickers; -messages.stickers#e4599bbd hash:int stickers:Vector = messages.Stickers; +messages.stickers#30a6ec7e hash:long stickers:Vector = messages.Stickers; stickerPack#12b299d4 emoticon:string documents:Vector = StickerPack; messages.allStickersNotModified#e86602c3 = messages.AllStickers; -messages.allStickers#edfd405f hash:int sets:Vector = messages.AllStickers; +messages.allStickers#cdbbcebb hash:long sets:Vector = messages.AllStickers; messages.affectedMessages#84d19185 pts:int pts_count:int = messages.AffectedMessages; @@ -876,7 +880,7 @@ auth.passwordRecovery#137948a5 email_pattern:string = auth.PasswordRecovery; receivedNotifyMessage#a384b779 id:int flags:int = ReceivedNotifyMessage; -chatInviteExported#6e24fc9d flags:# revoked:flags.0?true permanent:flags.5?true link:string admin_id:int date:int start_date:flags.4?int expire_date:flags.1?int usage_limit:flags.2?int usage:flags.3?int = ExportedChatInvite; +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; chatInviteAlready#5a686d7c chat:Chat = ChatInvite; @@ -894,13 +898,15 @@ inputStickerSetAnimatedEmoji#28703c8 = InputStickerSet; inputStickerSetDice#e67f520e emoticon:string = InputStickerSet; +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 thumb_dc_id:flags.4?int thumb_version:flags.4?int count:int hash:int = StickerSet; messages.stickerSet#b60a24a6 set:StickerSet packs:Vector documents:Vector = messages.StickerSet; botCommand#c27ac8c7 command:string description:string = BotCommand; -botInfo#98e81d3a user_id:int description:string commands:Vector = BotInfo; +botInfo#1b74b335 user_id:long description:string commands:Vector = BotInfo; keyboardButton#a2fa4880 text:string = KeyboardButton; @@ -956,7 +962,7 @@ messageEntityPre#73924be0 offset:int length:int language:string = MessageEntity; messageEntityTextUrl#76a6d327 offset:int length:int url:string = MessageEntity; -messageEntityMentionName#352dca58 offset:int length:int user_id:int = MessageEntity; +messageEntityMentionName#dc7b1140 offset:int length:int user_id:long = MessageEntity; inputMessageEntityMentionName#208e68c9 offset:int length:int user_id:InputUser = MessageEntity; @@ -974,9 +980,9 @@ messageEntityBankCard#761e6af4 offset:int length:int = MessageEntity; inputChannelEmpty#ee8c1e86 = InputChannel; -inputChannel#afeb712e channel_id:int access_hash:long = InputChannel; +inputChannel#f35aec28 channel_id:long access_hash:long = InputChannel; -inputChannelFromMessage#2a286531 peer:InputPeer msg_id:int channel_id:int = InputChannel; +inputChannelFromMessage#5b934f9d peer:InputPeer msg_id:int channel_id:long = InputChannel; contacts.resolvedPeer#7f077ad9 peer:Peer chats:Vector users:Vector = contacts.ResolvedPeer; @@ -992,15 +998,15 @@ channelMessagesFilterEmpty#94d42ee7 = ChannelMessagesFilter; channelMessagesFilter#cd77d957 flags:# exclude_new_messages:flags.1?true ranges:Vector = ChannelMessagesFilter; -channelParticipant#15ebac1d user_id:int date:int = ChannelParticipant; +channelParticipant#c00c07c0 user_id:long date:int = ChannelParticipant; -channelParticipantSelf#a3289a6d user_id:int inviter_id:int date:int = ChannelParticipant; +channelParticipantSelf#28a8bc67 user_id:long inviter_id:long date:int = ChannelParticipant; -channelParticipantCreator#447dca4b flags:# user_id:int admin_rights:ChatAdminRights rank:flags.0?string = ChannelParticipant; +channelParticipantCreator#2fe601d3 flags:# user_id:long admin_rights:ChatAdminRights rank:flags.0?string = ChannelParticipant; -channelParticipantAdmin#ccbebbaf flags:# can_edit:flags.0?true self:flags.1?true user_id:int inviter_id:flags.1?int promoted_by:int date:int admin_rights:ChatAdminRights rank:flags.2?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#50a1dfd6 flags:# left:flags.0?true peer:Peer kicked_by:int date:int banned_rights:ChatBannedRights = ChannelParticipant; +channelParticipantBanned#6df8014e flags:# left:flags.0?true peer:Peer kicked_by:long date:int banned_rights:ChatBannedRights = ChannelParticipant; channelParticipantLeft#1b03f006 peer:Peer = ChannelParticipant; @@ -1030,7 +1036,7 @@ help.termsOfService#780a0310 flags:# popup:flags.0?true id:DataJSON text:string messages.savedGifsNotModified#e8025ca2 = messages.SavedGifs; -messages.savedGifs#2e0709a5 hash:int gifs:Vector = messages.SavedGifs; +messages.savedGifs#84a02a0d hash:long gifs:Vector = messages.SavedGifs; inputBotInlineMessageMediaAuto#3380c786 flags:# message:string entities:flags.1?Vector reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage; @@ -1096,6 +1102,8 @@ messages.messageEditData#26b5dde6 flags:# caption:flags.0?true = messages.Messag inputBotInlineMessageID#890c3d89 dc_id:int id:long access_hash:long = InputBotInlineMessageID; +inputBotInlineMessageID64#b6d915d7 dc_id:int owner_id:long id:int access_hash:long = InputBotInlineMessageID; + inlineBotSwitchPM#3c20629f text:string start_param:string = InlineBotSwitchPM; messages.peerDialogs#3371c354 dialogs:Vector messages:Vector chats:Vector users:Vector state:updates.State = messages.PeerDialogs; @@ -1132,11 +1140,11 @@ draftMessage#fd8e711f flags:# no_webpage:flags.1?true reply_to_msg_id:flags.0?in messages.featuredStickersNotModified#c6dc0c66 count:int = messages.FeaturedStickers; -messages.featuredStickers#b6abc341 hash:int count:int sets:Vector unread:Vector = messages.FeaturedStickers; +messages.featuredStickers#84c02310 hash:long count:int sets:Vector unread:Vector = messages.FeaturedStickers; messages.recentStickersNotModified#b17f890 = messages.RecentStickers; -messages.recentStickers#22f3afb3 hash:int packs:Vector stickers:Vector dates:Vector = messages.RecentStickers; +messages.recentStickers#88d37c56 hash:long packs:Vector stickers:Vector dates:Vector = messages.RecentStickers; messages.archivedStickers#4fcba9c8 count:int sets:Vector = messages.ArchivedStickers; @@ -1160,7 +1168,7 @@ inputGameID#32c3e77 id:long access_hash:long = InputGame; inputGameShortName#c331e80a bot_id:InputUser short_name:string = InputGame; -highScore#58fffcd0 pos:int user_id:int score:int = HighScore; +highScore#73a379eb pos:int user_id:long score:int = HighScore; messages.highScores#9a3bfd99 scores:Vector users:Vector = messages.HighScores; @@ -1288,7 +1296,7 @@ inputWebFileGeoPointLocation#9f2221c9 geo_point:InputGeoPoint access_hash:long w upload.webFile#21e753bc size:int mime_type:string file_type:storage.FileType mtime:int bytes:bytes = upload.WebFile; -payments.paymentForm#8d0b2415 flags:# can_save_credentials:flags.2?true password_missing:flags.3?true form_id:long bot_id:int invoice:Invoice provider_id:int url:string native_provider:flags.4?string native_params:flags.4?DataJSON saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?PaymentSavedCredentials users:Vector = payments.PaymentForm; +payments.paymentForm#1694761b flags:# can_save_credentials:flags.2?true password_missing:flags.3?true form_id:long bot_id:long invoice:Invoice provider_id:long url:string native_provider:flags.4?string native_params:flags.4?DataJSON saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?PaymentSavedCredentials users:Vector = payments.PaymentForm; payments.validatedRequestedInfo#d1451883 flags:# id:flags.0?string shipping_options:flags.1?Vector = payments.ValidatedRequestedInfo; @@ -1296,7 +1304,7 @@ payments.paymentResult#4e5f810d updates:Updates = payments.PaymentResult; payments.paymentVerificationNeeded#d8411139 url:string = payments.PaymentResult; -payments.paymentReceipt#10b555d0 flags:# date:int bot_id:int provider_id:int title:string description:string photo:flags.2?WebDocument invoice:Invoice info:flags.0?PaymentRequestedInfo shipping:flags.1?ShippingOption tip_amount:flags.3?long currency:string total_amount:long credentials_title:string users:Vector = payments.PaymentReceipt; +payments.paymentReceipt#70c4fe03 flags:# date:int bot_id:long provider_id:long title:string description:string photo:flags.2?WebDocument invoice:Invoice info:flags.0?PaymentRequestedInfo shipping:flags.1?ShippingOption tip_amount:flags.3?long currency:string total_amount:long credentials_title:string users:Vector = payments.PaymentReceipt; payments.savedInfo#fb8fe43c flags:# has_saved_credentials:flags.1?true saved_info:flags.0?PaymentRequestedInfo = payments.SavedInfo; @@ -1318,13 +1326,13 @@ inputPhoneCall#1e36fded id:long access_hash:long = InputPhoneCall; phoneCallEmpty#5366c915 id:long = PhoneCall; -phoneCallWaiting#1b8f4ad1 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:int participant_id:int protocol:PhoneCallProtocol receive_date:flags.0?int = PhoneCall; +phoneCallWaiting#c5226f17 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long protocol:PhoneCallProtocol receive_date:flags.0?int = PhoneCall; -phoneCallRequested#87eabb53 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:int participant_id:int g_a_hash:bytes protocol:PhoneCallProtocol = PhoneCall; +phoneCallRequested#14b0ed0c flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_a_hash:bytes protocol:PhoneCallProtocol = PhoneCall; -phoneCallAccepted#997c454a flags:# video:flags.6?true id:long access_hash:long date:int admin_id:int participant_id:int g_b:bytes protocol:PhoneCallProtocol = PhoneCall; +phoneCallAccepted#3660c311 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_b:bytes protocol:PhoneCallProtocol = PhoneCall; -phoneCall#8742ae7f flags:# p2p_allowed:flags.5?true video:flags.6?true id:long access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long protocol:PhoneCallProtocol connections:Vector start_date:int = PhoneCall; +phoneCall#967f7c67 flags:# p2p_allowed:flags.5?true video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_a_or_b:bytes key_fingerprint:long protocol:PhoneCallProtocol connections:Vector start_date:int = PhoneCall; phoneCallDiscarded#50ca4de1 flags:# need_rating:flags.2?true need_debug:flags.3?true video:flags.6?true id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = PhoneCall; @@ -1390,7 +1398,7 @@ channelAdminLogEventActionDefaultBannedRights#2df5fc0a prev_banned_rights:ChatBa channelAdminLogEventActionStopPoll#8f079643 message:Message = ChannelAdminLogEventAction; -channelAdminLogEventActionChangeLinkedChat#a26f881b prev_value:int new_value:int = ChannelAdminLogEventAction; +channelAdminLogEventActionChangeLinkedChat#50c7ac8 prev_value:long new_value:long = ChannelAdminLogEventAction; channelAdminLogEventActionChangeLocation#e6b76ae prev_value:ChannelLocation new_value:ChannelLocation = ChannelAdminLogEventAction; @@ -1418,9 +1426,7 @@ channelAdminLogEventActionParticipantVolume#3e7f6847 participant:GroupCallPartic channelAdminLogEventActionChangeHistoryTTL#6e941a38 prev_value:int new_value:int = ChannelAdminLogEventAction; -channelAdminLogEventActionChangeTheme#fe69018d prev_value:string new_value:string = ChannelAdminLogEventAction; - -channelAdminLogEvent#3b5a3e40 id:long date:int user_id:int action:ChannelAdminLogEventAction = ChannelAdminLogEvent; +channelAdminLogEvent#1fad68cd id:long date:int user_id:long action:ChannelAdminLogEventAction = ChannelAdminLogEvent; channels.adminLogResults#ed8af74d events:Vector chats:Vector users:Vector = channels.AdminLogResults; @@ -1430,13 +1436,13 @@ popularContact#5ce14175 client_id:long importers:int = PopularContact; messages.favedStickersNotModified#9e8fa6d3 = messages.FavedStickers; -messages.favedStickers#f37f2f16 hash:int packs:Vector stickers:Vector = messages.FavedStickers; +messages.favedStickers#2cb51097 hash:long packs:Vector stickers:Vector = messages.FavedStickers; recentMeUrlUnknown#46e1d13d url:string = RecentMeUrl; -recentMeUrlUser#8dbc3336 url:string user_id:int = RecentMeUrl; +recentMeUrlUser#b92c09e2 url:string user_id:long = RecentMeUrl; -recentMeUrlChat#a01b22f9 url:string chat_id:int = RecentMeUrl; +recentMeUrlChat#b2da71d2 url:string chat_id:long = RecentMeUrl; recentMeUrlChatInvite#eb49081d url:string chat_invite:ChatInvite = RecentMeUrl; @@ -1446,7 +1452,7 @@ help.recentMeUrls#e0310d7 urls:Vector chats:Vector users:Vect inputSingleMedia#1cc6e91f flags:# media:InputMedia random_id:long message:string entities:flags.0?Vector = InputSingleMedia; -webAuthorization#cac943f2 hash:long bot_id:int domain:string browser:string platform:string date_created:int date_active:int ip:string region:string = WebAuthorization; +webAuthorization#a6f8f452 hash:long bot_id:long domain:string browser:string platform:string date_created:int date_active:int ip:string region:string = WebAuthorization; account.webAuthorizations#ed56c9fc authorizations:Vector users:Vector = account.WebAuthorizations; @@ -1468,7 +1474,7 @@ dialogPeerFolder#514519e2 folder_id:int = DialogPeer; messages.foundStickerSetsNotModified#d54b65d = messages.FoundStickerSets; -messages.foundStickerSets#5108d648 hash:int sets:Vector = messages.FoundStickerSets; +messages.foundStickerSets#8af09dd2 hash:long sets:Vector = messages.FoundStickerSets; fileHash#6242c773 offset:int limit:int hash:bytes = FileHash; @@ -1626,7 +1632,7 @@ poll#86e18161 id:long flags:# closed:flags.0?true public_voters:flags.1?true mul pollAnswerVoters#3b6ddad2 flags:# chosen:flags.0?true correct:flags.1?true option:bytes voters:int = PollAnswerVoters; -pollResults#badcc1a3 flags:# min:flags.0?true results:flags.1?Vector total_voters:flags.2?int recent_voters:flags.3?Vector solution:flags.4?string solution_entities:flags.4?Vector = PollResults; +pollResults#dcb82ea3 flags:# min:flags.0?true results:flags.1?Vector total_voters:flags.2?int recent_voters:flags.3?Vector solution:flags.4?string solution_entities:flags.4?Vector = PollResults; chatOnlines#f041e250 onlines:int = ChatOnlines; @@ -1644,7 +1650,7 @@ inputWallPaperNoFile#967a462e id:long = InputWallPaper; account.wallPapersNotModified#1c199183 = account.WallPapers; -account.wallPapers#702b65a9 hash:int wallpapers:Vector = account.WallPapers; +account.wallPapers#cdc3858c hash:long wallpapers:Vector = account.WallPapers; codeSettings#debebe83 flags:# allow_flashcall:flags.0?true current_number:flags.1?true allow_app_hash:flags.4?true = CodeSettings; @@ -1696,7 +1702,7 @@ theme#e802b8dc flags:# creator:flags.0?true default:flags.1?true for_chat:flags. account.themesNotModified#f41eb622 = account.Themes; -account.themes#7f676421 hash:int themes:Vector = account.Themes; +account.themes#9a3d8c6d hash:long themes:Vector = account.Themes; auth.loginToken#629f1980 expires:int token:bytes = auth.LoginToken; @@ -1718,17 +1724,17 @@ baseThemeTinted#6d5f77ee = BaseTheme; baseThemeArctic#5b11125a = BaseTheme; -inputThemeSettings#ff38f912 flags:# message_colors_animated:flags.2?true base_theme:BaseTheme accent_color:int message_colors:flags.0?Vector wallpaper:flags.1?InputWallPaper wallpaper_settings:flags.1?WallPaperSettings = InputThemeSettings; +inputThemeSettings#8fde504f flags:# message_colors_animated:flags.2?true base_theme:BaseTheme accent_color:int outbox_accent_color:flags.3?int message_colors:flags.0?Vector wallpaper:flags.1?InputWallPaper wallpaper_settings:flags.1?WallPaperSettings = InputThemeSettings; -themeSettings#8db4e76c flags:# message_colors_animated:flags.2?true base_theme:BaseTheme accent_color:int message_colors:flags.0?Vector wallpaper:flags.1?WallPaper = ThemeSettings; +themeSettings#fa58b6d4 flags:# message_colors_animated:flags.2?true base_theme:BaseTheme accent_color:int outbox_accent_color:flags.3?int message_colors:flags.0?Vector wallpaper:flags.1?WallPaper = ThemeSettings; webPageAttributeTheme#54b56617 flags:# documents:flags.0?Vector settings:flags.1?ThemeSettings = WebPageAttribute; -messageUserVote#a28e5559 user_id:int option:bytes date:int = MessageUserVote; +messageUserVote#34d247b4 user_id:long option:bytes date:int = MessageUserVote; -messageUserVoteInputOption#36377430 user_id:int date:int = MessageUserVote; +messageUserVoteInputOption#3ca5b0ec user_id:long date:int = MessageUserVote; -messageUserVoteMultiple#e8fe0de user_id:int options:Vector date:int = MessageUserVote; +messageUserVoteMultiple#8a65e557 user_id:long options:Vector date:int = MessageUserVote; messages.votesList#823f649 flags:# count:int votes:Vector users:Vector next_offset:flags.0?string = messages.VotesList; @@ -1762,11 +1768,11 @@ help.promoData#8c39793f flags:# proxy:flags.0?true expires:int peer:Peer chats:V videoSize#de33b094 flags:# type:string w:int h:int size:int video_start_ts:flags.0?double = VideoSize; -statsGroupTopPoster#18f3d0f7 user_id:int messages:int avg_chars:int = StatsGroupTopPoster; +statsGroupTopPoster#9d04af9b user_id:long messages:int avg_chars:int = StatsGroupTopPoster; -statsGroupTopAdmin#6014f412 user_id:int deleted:int kicked:int banned:int = StatsGroupTopAdmin; +statsGroupTopAdmin#d7584c87 user_id:long deleted:int kicked:int banned:int = StatsGroupTopAdmin; -statsGroupTopInviter#31962a4c user_id:int invitations:int = StatsGroupTopInviter; +statsGroupTopInviter#535f779d user_id:long invitations:int = StatsGroupTopInviter; 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 top_admins:Vector top_inviters:Vector users:Vector = stats.MegagroupStats; @@ -1788,7 +1794,7 @@ messages.discussionMessage#a6341782 flags:# messages:Vector max_id:flag messageReplyHeader#a6d57763 flags:# reply_to_msg_id:int reply_to_peer_id:flags.0?Peer reply_to_top_id:flags.1?int = MessageReplyHeader; -messageReplies#4128faac flags:# comments:flags.0?true replies:int replies_pts:int recent_repliers:flags.1?Vector channel_id:flags.0?int max_id:flags.2?int read_max_id:flags.3?int = MessageReplies; +messageReplies#83d60fc2 flags:# comments:flags.0?true replies:int replies_pts:int recent_repliers:flags.1?Vector channel_id:flags.0?long max_id:flags.2?int read_max_id:flags.3?int = MessageReplies; peerBlocked#e8fd8014 peer_id:Peer date:int = PeerBlocked; @@ -1822,7 +1828,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 = messages.AffectedFoundMessages; -chatInviteImporter#1e3e6680 user_id:int date:int = ChatInviteImporter; +chatInviteImporter#b5cd5f4 user_id:long date:int = ChatInviteImporter; messages.exportedChatInvites#bdc62dcc count:int invites:Vector users:Vector = messages.ExportedChatInvites; @@ -1832,7 +1838,7 @@ messages.exportedChatInviteReplaced#222600ef invite:ExportedChatInvite new_invit messages.chatInviteImporters#81b6b00a count:int importers:Vector users:Vector = messages.ChatInviteImporters; -chatAdminWithInvites#dfd2330f admin_id:int invites_count:int revoked_invites_count:int = ChatAdminWithInvites; +chatAdminWithInvites#f2ecef23 admin_id:long invites_count:int revoked_invites_count:int = ChatAdminWithInvites; messages.chatAdminsWithInvites#b69b72d7 admins:Vector users:Vector = messages.ChatAdminsWithInvites; @@ -1907,7 +1913,7 @@ auth.resetAuthorizations#9fab0d1a = Bool; auth.exportAuthorization#e5bfffcd dc_id:int = auth.ExportedAuthorization; -auth.importAuthorization#e3ef9613 id:int bytes:bytes = auth.Authorization; +auth.importAuthorization#a57a7dad id:long bytes:bytes = auth.Authorization; auth.bindTempAuthKey#cdd42a05 perm_auth_key_id:long nonce:long expires_at:int encrypted_message:bytes = Bool; @@ -1925,7 +1931,7 @@ auth.cancelCode#1f040578 phone_number:string phone_code_hash:string = Bool; auth.dropTempAuthKeys#8e48a188 except_auth_keys:Vector = Bool; -auth.exportLoginToken#b1b41517 api_id:int api_hash:string except_ids:Vector = auth.LoginToken; +auth.exportLoginToken#b7e085fe api_id:int api_hash:string except_ids:Vector = auth.LoginToken; auth.importLoginToken#95ac5ce4 token:bytes = auth.LoginToken; @@ -1933,9 +1939,9 @@ auth.acceptLoginToken#e894ad4d token:bytes = Authorization; auth.checkRecoveryPassword#d36bf79 code:string = Bool; -account.registerDevice#68976c6f flags:# no_muted:flags.0?true token_type:int token:string app_sandbox:Bool secret:bytes other_uids:Vector = Bool; +account.registerDevice#ec86017a flags:# no_muted:flags.0?true token_type:int token:string app_sandbox:Bool secret:bytes other_uids:Vector = Bool; -account.unregisterDevice#3076c4bf token_type:int token:string other_uids:Vector = Bool; +account.unregisterDevice#6a0d3206 token_type:int token:string other_uids:Vector = Bool; account.updateNotifySettings#84be5b93 peer:InputNotifyPeer settings:InputPeerNotifySettings = Bool; @@ -1947,7 +1953,7 @@ account.updateProfile#78515775 flags:# first_name:flags.0?string last_name:flags account.updateStatus#6628562c offline:Bool = Bool; -account.getWallPapers#aabb1763 hash:int = account.WallPapers; +account.getWallPapers#7967d36 hash:long = account.WallPapers; account.reportPeer#c5ba3d86 peer:InputPeer reason:ReportReason message:string = Bool; @@ -2001,9 +2007,9 @@ account.saveSecureValue#899fe31d value:InputSecureValue secure_secret_id:long = account.deleteSecureValue#b880bc4b types:Vector = Bool; -account.getAuthorizationForm#b86ba8e1 bot_id:int scope:string public_key:string = account.AuthorizationForm; +account.getAuthorizationForm#a929597a bot_id:long scope:string public_key:string = account.AuthorizationForm; -account.acceptAuthorization#e7027c94 bot_id:int scope:string public_key:string value_hashes:Vector credentials:SecureCredentialsEncrypted = Bool; +account.acceptAuthorization#f3ed4c73 bot_id:long scope:string public_key:string value_hashes:Vector credentials:SecureCredentialsEncrypted = Bool; account.sendVerifyPhoneCode#a5a356f9 phone_number:string settings:CodeSettings = auth.SentCode; @@ -2055,7 +2061,7 @@ account.installTheme#7ae43737 flags:# dark:flags.0?true format:flags.1?string th account.getTheme#8d9d742b format:string theme:InputTheme document_id:long = Theme; -account.getThemes#285946f8 format:string hash:int = account.Themes; +account.getThemes#7206e458 format:string hash:long = account.Themes; account.setContentSettings#b574b16b flags:# sensitive_enabled:flags.0?true = Bool; @@ -2081,11 +2087,11 @@ users.getFullUser#ca30a5b1 id:InputUser = UserFull; users.setSecureValueErrors#90c894b5 id:InputUser errors:Vector = Bool; -contacts.getContactIDs#2caa4a42 hash:int = Vector; +contacts.getContactIDs#7adc669d hash:long = Vector; contacts.getStatuses#c4a353ee = Vector; -contacts.getContacts#c023849f hash:int = contacts.Contacts; +contacts.getContacts#5dd69e12 hash:long = contacts.Contacts; contacts.importContacts#2c800be5 contacts:Vector = contacts.ImportedContacts; @@ -2103,7 +2109,7 @@ contacts.search#11f812d8 q:string limit:int = contacts.Found; contacts.resolveUsername#f93ccba3 username:string = contacts.ResolvedPeer; -contacts.getTopPeers#d4982db5 flags:# correspondents:flags.0?true bots_pm:flags.1?true bots_inline:flags.2?true phone_calls:flags.3?true forward_users:flags.4?true forward_chats:flags.5?true groups:flags.10?true channels:flags.15?true offset:int limit:int hash:int = contacts.TopPeers; +contacts.getTopPeers#973478b6 flags:# correspondents:flags.0?true bots_pm:flags.1?true bots_inline:flags.2?true phone_calls:flags.3?true forward_users:flags.4?true forward_chats:flags.5?true groups:flags.10?true channels:flags.15?true offset:int limit:int hash:long = contacts.TopPeers; contacts.resetTopPeerRating#1ae373ac category:TopPeerCategory peer:InputPeer = Bool; @@ -2123,11 +2129,11 @@ contacts.blockFromReplies#29a8962c flags:# delete_message:flags.0?true delete_hi messages.getMessages#63c66506 id:Vector = messages.Messages; -messages.getDialogs#a0ee3b73 flags:# exclude_pinned:flags.0?true folder_id:flags.1?int offset_date:int offset_id:int offset_peer:InputPeer limit:int hash:int = messages.Dialogs; +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#dcbb8260 peer:InputPeer offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:int = messages.Messages; +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#c352eec 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:int = 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; @@ -2151,17 +2157,17 @@ messages.getPeerSettings#3672e09c peer:InputPeer = PeerSettings; messages.report#8953ab4e peer:InputPeer id:Vector reason:ReportReason message:string = Bool; -messages.getChats#3c6aa187 id:Vector = messages.Chats; +messages.getChats#49e9528f id:Vector = messages.Chats; -messages.getFullChat#3b831c66 chat_id:int = messages.ChatFull; +messages.getFullChat#aeb00b34 chat_id:long = messages.ChatFull; -messages.editChatTitle#dc452855 chat_id:int title:string = Updates; +messages.editChatTitle#73783ffd chat_id:long title:string = Updates; -messages.editChatPhoto#ca4c79d8 chat_id:int photo:InputChatPhoto = Updates; +messages.editChatPhoto#35ddd674 chat_id:long photo:InputChatPhoto = Updates; -messages.addChatUser#f9a0aa09 chat_id:int user_id:InputUser fwd_limit:int = Updates; +messages.addChatUser#f24753e3 chat_id:long user_id:InputUser fwd_limit:int = Updates; -messages.deleteChatUser#c534459a flags:# revoke_history:flags.0?true chat_id:int user_id:InputUser = Updates; +messages.deleteChatUser#a2185cab flags:# revoke_history:flags.0?true chat_id:long user_id:InputUser = Updates; messages.createChat#9cb126e users:Vector title:string = Updates; @@ -2189,9 +2195,9 @@ messages.reportEncryptedSpam#4b0c8c0f peer:InputEncryptedChat = Bool; messages.readMessageContents#36a73f77 id:Vector = messages.AffectedMessages; -messages.getStickers#43d4f2c emoticon:string hash:int = messages.Stickers; +messages.getStickers#d5a5d3a1 emoticon:string hash:long = messages.Stickers; -messages.getAllStickers#1c9618b1 hash:int = messages.AllStickers; +messages.getAllStickers#b8a0a1a8 hash:long = messages.AllStickers; messages.getWebPagePreview#8b68b0cc flags:# message:string entities:flags.3?Vector = MessageMedia; @@ -2211,9 +2217,9 @@ messages.startBot#e6df7378 bot:InputUser peer:InputPeer random_id:long start_par messages.getMessagesViews#5784d3e1 peer:InputPeer id:Vector increment:Bool = messages.MessageViews; -messages.editChatAdmin#a9e69f2e chat_id:int user_id:InputUser is_admin:Bool = Bool; +messages.editChatAdmin#a85bd1c2 chat_id:long user_id:InputUser is_admin:Bool = Bool; -messages.migrateChat#15a3b8e3 chat_id:int = Updates; +messages.migrateChat#a2875319 chat_id:long = Updates; messages.searchGlobal#4bc6589a flags:# folder_id:flags.0?int q:string filter:MessagesFilter min_date:int max_date:int offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages; @@ -2221,7 +2227,7 @@ messages.reorderStickerSets#78337739 flags:# masks:flags.0?true order:Vector = Bool; -messages.getRecentStickers#5ea192c9 flags:# attached:flags.0?true hash:int = messages.RecentStickers; +messages.getRecentStickers#9da9403b flags:# attached:flags.0?true hash:long = messages.RecentStickers; messages.saveRecentSticker#392718f8 flags:# attached:flags.0?true id:InputDocument unsave:Bool = Bool; @@ -2259,7 +2265,7 @@ messages.clearRecentStickers#8999602d flags:# attached:flags.0?true = Bool; messages.getArchivedStickers#57f17692 flags:# masks:flags.0?true offset_id:long limit:int = messages.ArchivedStickers; -messages.getMaskStickers#65b8c79f hash:int = messages.AllStickers; +messages.getMaskStickers#640f82b8 hash:long = messages.AllStickers; messages.getAttachedStickers#cc5b67cc media:InputStickeredMedia = Vector; @@ -2271,9 +2277,9 @@ messages.getGameHighScores#e822649d peer:InputPeer id:int user_id:InputUser = me messages.getInlineGameHighScores#f635e1b id:InputBotInlineMessageID user_id:InputUser = messages.HighScores; -messages.getCommonChats#d0a48c4 user_id:InputUser max_id:int limit:int = messages.Chats; +messages.getCommonChats#e40ca104 user_id:InputUser max_id:long limit:int = messages.Chats; -messages.getAllChats#eba80ff0 except_ids:Vector = messages.Chats; +messages.getAllChats#875f74be except_ids:Vector = messages.Chats; messages.getWebPage#32ca8f91 url:string hash:int = WebPage; @@ -2291,7 +2297,7 @@ messages.uploadMedia#519bc2b1 peer:InputPeer media:InputMedia = MessageMedia; messages.sendScreenshotNotification#c97df020 peer:InputPeer reply_to_msg_id:int random_id:long = Updates; -messages.getFavedStickers#21ce0b0e hash:int = messages.FavedStickers; +messages.getFavedStickers#4f1aaa9 hash:long = messages.FavedStickers; messages.faveSticker#b9ffc55b id:InputDocument unfave:Bool = Bool; @@ -2299,13 +2305,13 @@ messages.getUnreadMentions#46578472 peer:InputPeer offset_id:int add_offset:int messages.readMentions#f0189d3 peer:InputPeer = messages.AffectedHistory; -messages.getRecentLocations#bbc45b09 peer:InputPeer limit:int hash:int = messages.Messages; +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 schedule_date:flags.10?int = Updates; messages.uploadEncryptedFile#5057c497 peer:InputEncryptedChat file:InputEncryptedFile = EncryptedFile; -messages.searchStickerSets#c2b7d08b flags:# exclude_featured:flags.0?true q:string hash:int = messages.FoundStickerSets; +messages.searchStickerSets#35705b8a flags:# exclude_featured:flags.0?true q:string hash:long = messages.FoundStickerSets; messages.getSplitRanges#1cff7e08 = Vector; @@ -2345,7 +2351,7 @@ messages.acceptUrlAuth#b12c7125 flags:# write_allowed:flags.0?true peer:flags.1? messages.hidePeerSettingsBar#4facb138 peer:InputPeer = Bool; -messages.getScheduledHistory#e2c2685b peer:InputPeer hash:int = messages.Messages; +messages.getScheduledHistory#f516760b peer:InputPeer hash:long = messages.Messages; messages.getScheduledMessages#bdbb0464 peer:InputPeer id:Vector = messages.Messages; @@ -2365,9 +2371,9 @@ messages.updateDialogFilter#1ad4a04a flags:# id:int filter:flags.0?DialogFilter messages.updateDialogFiltersOrder#c563c1e4 order:Vector = Bool; -messages.getOldFeaturedStickers#5fe7025b offset:int limit:int hash:int = messages.FeaturedStickers; +messages.getOldFeaturedStickers#7ed094a1 offset:int limit:int hash:long = messages.FeaturedStickers; -messages.getReplies#24b581ba peer:InputPeer msg_id:int offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:int = messages.Messages; +messages.getReplies#22ddd30c peer:InputPeer msg_id:int offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages; messages.getDiscussionMessage#446972fd peer:InputPeer msg_id:int = messages.DiscussionMessage; @@ -2375,7 +2381,7 @@ messages.readDiscussion#f731a9f4 peer:InputPeer msg_id:int read_max_id:int = Boo messages.unpinAllMessages#f025bc8b peer:InputPeer = messages.AffectedHistory; -messages.deleteChat#83247d11 chat_id:int = Bool; +messages.deleteChat#5bd0ee50 chat_id:long = Bool; messages.deletePhoneCallHistory#f9cbe409 flags:# revoke:flags.0?true = messages.AffectedFoundMessages; @@ -2407,6 +2413,8 @@ messages.checkHistoryImportPeer#5dc60f03 peer:InputPeer = messages.CheckedHistor messages.setChatTheme#e63be13f peer:InputPeer emoticon:string = Updates; +messages.getMessageReadParticipants#2c6f97b7 peer:InputPeer msg_id:int = Vector; + updates.getState#edd4882a = updates.State; updates.getDifference#25939651 flags:# pts:int pts_total_limit:flags.0?int date:int qts:int = updates.Difference; @@ -2491,7 +2499,7 @@ channels.reportSpam#fe087810 channel:InputChannel user_id:InputUser id:Vector = messages.Messages; -channels.getParticipants#123e05e9 channel:InputChannel filter:ChannelParticipantsFilter offset:int limit:int hash:int = channels.ChannelParticipants; +channels.getParticipants#77ced9d0 channel:InputChannel filter:ChannelParticipantsFilter offset:int limit:int hash:long = channels.ChannelParticipants; channels.getParticipant#a0ab6cc6 channel:InputChannel participant:InputPeer = channels.ChannelParticipant; @@ -2675,4 +2683,4 @@ stats.getMessagePublicForwards#5630281b channel:InputChannel msg_id:int offset_r stats.getMessageStats#b6e0a3f5 flags:# dark:flags.0?true channel:InputChannel msg_id:int = stats.MessageStats; -// LAYER 132 +// LAYER 133 diff --git a/internal/gen/_template/handlers.tmpl b/internal/gen/_template/handlers.tmpl index 97af8bfffa..ee184b4bb2 100644 --- a/internal/gen/_template/handlers.tmpl +++ b/internal/gen/_template/handlers.tmpl @@ -16,16 +16,16 @@ func NewUpdateDispatcher() UpdateDispatcher { type Entities struct { Short bool - Users map[int]*User - Chats map[int]*Chat - Channels map[int]*Channel + Users map[int64]*User + Chats map[int64]*Chat + Channels map[int64]*Channel } func (u *Entities) short() { u.Short = true - u.Users = make(map[int]*User, 0) - u.Chats = make(map[int]*Chat, 0) - u.Channels = make(map[int]*Channel, 0) + u.Users = make(map[int64]*User, 0) + u.Chats = make(map[int64]*Chat, 0) + u.Channels = make(map[int64]*Channel, 0) } // Handle implements UpdateDispatcher. diff --git a/internal/gen/combinators.go b/internal/gen/combinators.go index a056951a08..efcdf58192 100644 --- a/internal/gen/combinators.go +++ b/internal/gen/combinators.go @@ -28,12 +28,14 @@ func collectOnlyFields(fields []fieldDef, matchers ...simpleField) []fieldDef { func mapCollectableFields(fields []fieldDef) (r []fieldDef) { return collectOnlyFields(fields, simpleField{Name: "ID", Type: "int"}, + simpleField{Name: "ID", Type: "int64"}, ) } func sortableFields(fields []fieldDef) (r []fieldDef) { return collectOnlyFields(fields, simpleField{Name: "ID", Type: "int"}, + simpleField{Name: "ID", Type: "int64"}, simpleField{Name: "Date", Type: "int"}, ) } diff --git a/telegram/internal/e2etest/echo_bot.go b/telegram/internal/e2etest/echo_bot.go index 8af43b14f0..2835551694 100644 --- a/telegram/internal/e2etest/echo_bot.go +++ b/telegram/internal/e2etest/echo_bot.go @@ -33,13 +33,13 @@ func NewEchoBot(suite *Suite, auth chan<- *tg.User) EchoBot { } type users struct { - users map[int]*tg.User + users map[int64]*tg.User lock sync.RWMutex } func newUsers() *users { return &users{ - users: map[int]*tg.User{}, + users: map[int64]*tg.User{}, } } @@ -57,7 +57,7 @@ func (m *users) add(list ...tg.UserClass) { tg.UserClassArray(list).FillNotEmptyMap(m.users) } -func (m *users) get(id int) (r *tg.User) { +func (m *users) get(id int64) (r *tg.User) { m.lock.RLock() r = m.users[id] m.lock.RUnlock() @@ -78,7 +78,7 @@ func (b EchoBot) login(ctx context.Context, client *telegram.Client) (*tg.User, return nil, err } - expectedUsername := "echobot" + strconv.Itoa(me.ID) + expectedUsername := "echobot" + strconv.FormatInt(me.ID, 10) raw := tg.NewClient(waitInvoker{prev: client}) _, err := raw.AccountUpdateUsername(ctx, expectedUsername) if err != nil { @@ -149,7 +149,7 @@ func (b EchoBot) handler(client *telegram.Client) tg.NewMessageHandler { b.logger.Info("Got message", zap.String("text", m.Message), - zap.Int("user_id", user.ID), + zap.Int64("user_id", user.ID), zap.String("user_first_name", user.FirstName), zap.String("username", user.Username), ) @@ -181,7 +181,7 @@ func (b EchoBot) Run(ctx context.Context) error { b.logger.Info("Logged in", zap.String("user", me.Username), - zap.Int("id", me.ID), + zap.Int64("id", me.ID), ) select { diff --git a/telegram/internal/upconv/upconv.go b/telegram/internal/upconv/upconv.go index 205c2ceedc..48ffbeaf24 100644 --- a/telegram/internal/upconv/upconv.go +++ b/telegram/internal/upconv/upconv.go @@ -10,7 +10,7 @@ func convertOptional(msg *tg.Message, i tg.UpdatesClass) { msg.SetFwdFrom(v) } } - if u, ok := i.(interface{ GetViaBotID() (int, bool) }); ok { + if u, ok := i.(interface{ GetViaBotID() (int64, bool) }); ok { if v, ok := u.GetViaBotID(); ok { msg.SetViaBotID(v) } diff --git a/telegram/message/entity/html.go b/telegram/message/entity/html.go index b0d5fbd005..2fdfadb154 100644 --- a/telegram/message/entity/html.go +++ b/telegram/message/entity/html.go @@ -23,7 +23,7 @@ type htmlParser struct { builder *Builder stack []stackElem attr map[string]string - userResolver func(id int) (tg.InputUserClass, error) + userResolver func(id int64) (tg.InputUserClass, error) } func (p *htmlParser) fillAttrs() { @@ -75,7 +75,7 @@ func (p *htmlParser) startTag() error { } if u.Scheme == "tg" && u.Host == "user" { - id, err := strconv.Atoi(u.Query().Get("id")) + id, err := strconv.ParseInt(u.Query().Get("id"), 10, 64) if err != nil { return xerrors.Errorf("invalid user ID %q: %w", id, err) } @@ -159,9 +159,9 @@ func (p *htmlParser) parse() error { // Notice that it's okay for bots, but not for users. // // See https://core.telegram.org/bots/api#html-style. -func HTML(r io.Reader, b *Builder, userResolver func(id int) (tg.InputUserClass, error)) error { +func HTML(r io.Reader, b *Builder, userResolver func(id int64) (tg.InputUserClass, error)) error { if userResolver == nil { - userResolver = func(id int) (tg.InputUserClass, error) { + userResolver = func(id int64) (tg.InputUserClass, error) { return &tg.InputUser{ UserID: id, }, nil diff --git a/telegram/message/html/html.go b/telegram/message/html/html.go index 5ad023ff99..aba9e2795d 100644 --- a/telegram/message/html/html.go +++ b/telegram/message/html/html.go @@ -14,19 +14,19 @@ import ( // Bytes reads HTML from given byte slice and returns styling option // to build styled text block. -func Bytes(resolver func(id int) (tg.InputUserClass, error), b []byte) styling.StyledTextOption { +func Bytes(resolver func(id int64) (tg.InputUserClass, error), b []byte) styling.StyledTextOption { return Reader(resolver, bytes.NewReader(b)) } // String reads HTML from given string and returns styling option // to build styled text block. -func String(resolver func(id int) (tg.InputUserClass, error), s string) styling.StyledTextOption { +func String(resolver func(id int64) (tg.InputUserClass, error), s string) styling.StyledTextOption { return Reader(resolver, strings.NewReader(s)) } // Format formats string using fmt, parses HTML from formatted string and returns styling option // to build styled text block. -func Format(resolver func(id int) (tg.InputUserClass, error), format string, args ...interface{}) styling.StyledTextOption { +func Format(resolver func(id int64) (tg.InputUserClass, error), format string, args ...interface{}) styling.StyledTextOption { return styling.Custom(func(eb *entity.Builder) error { var buf bytes.Buffer _, err := fmt.Fprintf(&buf, format, args...) @@ -39,7 +39,7 @@ func Format(resolver func(id int) (tg.InputUserClass, error), format string, arg // Reader reads HTML from given reader and returns styling option // to build styled text block. -func Reader(resolver func(id int) (tg.InputUserClass, error), r io.Reader) styling.StyledTextOption { +func Reader(resolver func(id int64) (tg.InputUserClass, error), r io.Reader) styling.StyledTextOption { return styling.Custom(func(eb *entity.Builder) error { return entity.HTML(r, eb, resolver) }) diff --git a/telegram/message/peer/dialog_key.go b/telegram/message/peer/dialog_key.go index b371190b2f..0cc32518e6 100644 --- a/telegram/message/peer/dialog_key.go +++ b/telegram/message/peer/dialog_key.go @@ -21,7 +21,7 @@ const ( // DialogKey is a generic peer key. type DialogKey struct { Kind Kind - ID int + ID int64 AccessHash int64 } diff --git a/telegram/message/peer/extract.go b/telegram/message/peer/extract.go index db66682596..5aa3f80736 100644 --- a/telegram/message/peer/extract.go +++ b/telegram/message/peer/extract.go @@ -8,16 +8,16 @@ import ( // Entities is simple peer entities storage. type Entities struct { - users map[int]*tg.User - chats map[int]*tg.Chat - channels map[int]*tg.Channel + users map[int64]*tg.User + chats map[int64]*tg.Chat + channels map[int64]*tg.Channel } // NewEntities creates new Entities struct. func NewEntities( - users map[int]*tg.User, - chats map[int]*tg.Chat, - channels map[int]*tg.Channel, + users map[int64]*tg.User, + chats map[int64]*tg.Chat, + channels map[int64]*tg.Channel, ) Entities { return Entities{users: users, chats: chats, channels: channels} } @@ -49,19 +49,19 @@ func EntitiesFromUpdate(uctx tg.Entities) Entities { // Users returns map of users. // Notice that returned map is not a copy. -func (ent Entities) Users() map[int]*tg.User { +func (ent Entities) Users() map[int64]*tg.User { return ent.users } // Chats returns map of chats. // Notice that returned map is not a copy. -func (ent Entities) Chats() map[int]*tg.Chat { +func (ent Entities) Chats() map[int64]*tg.Chat { return ent.chats } // Channels returns map of channels. // Notice that returned map is not a copy. -func (ent Entities) Channels() map[int]*tg.Channel { +func (ent Entities) Channels() map[int64]*tg.Channel { return ent.channels } @@ -83,9 +83,9 @@ func (ent Entities) FillFromUpdate(uctx tg.Entities) { // Fill adds and updates all entities from given maps. func (ent Entities) Fill( - users map[int]*tg.User, - chats map[int]*tg.Chat, - channels map[int]*tg.Channel, + users map[int64]*tg.User, + chats map[int64]*tg.Chat, + channels map[int64]*tg.Channel, ) { for k, v := range users { ent.users[k] = v @@ -141,19 +141,19 @@ func (ent Entities) ExtractPeer(peerID tg.PeerClass) (tg.InputPeerClass, error) } // User finds user by given ID. -func (ent Entities) User(id int) (*tg.User, bool) { +func (ent Entities) User(id int64) (*tg.User, bool) { v, ok := ent.users[id] return v, ok } // Chat finds chat by given ID. -func (ent Entities) Chat(id int) (*tg.Chat, bool) { +func (ent Entities) Chat(id int64) (*tg.Chat, bool) { v, ok := ent.chats[id] return v, ok } // Channel finds channel by given ID. -func (ent Entities) Channel(id int) (*tg.Channel, bool) { +func (ent Entities) Channel(id int64) (*tg.Channel, bool) { v, ok := ent.channels[id] return v, ok } diff --git a/telegram/message/peer/extract_test.go b/telegram/message/peer/extract_test.go index a5c7be979b..1151271d87 100644 --- a/telegram/message/peer/extract_test.go +++ b/telegram/message/peer/extract_test.go @@ -37,13 +37,13 @@ func (m mockResult) MapChats() (r tg.ChatClassArray) { } func TestEntities(t *testing.T) { - users := map[int]*tg.User{ + users := map[int64]*tg.User{ 10: {ID: 10, AccessHash: 10}, } - chats := map[int]*tg.Chat{ + chats := map[int64]*tg.Chat{ 10: {ID: 10}, } - channels := map[int]*tg.Channel{ + channels := map[int64]*tg.Channel{ 10: {ID: 10, AccessHash: 10}, } ent := NewEntities(users, chats, channels) @@ -66,9 +66,9 @@ func TestEntities(t *testing.T) { }}, {"FillFromResult", func() Entities { e := NewEntities( - map[int]*tg.User{}, - map[int]*tg.Chat{}, - map[int]*tg.Channel{}, + map[int64]*tg.User{}, + map[int64]*tg.Chat{}, + map[int64]*tg.Channel{}, ) e.FillFromResult(result) return e @@ -78,9 +78,9 @@ func TestEntities(t *testing.T) { }}, {"FillFromUpdate", func() Entities { e := NewEntities( - map[int]*tg.User{}, - map[int]*tg.Chat{}, - map[int]*tg.Channel{}, + map[int64]*tg.User{}, + map[int64]*tg.Chat{}, + map[int64]*tg.Channel{}, ) e.FillFromUpdate(ctx) return e diff --git a/telegram/message/peer/lru_test.go b/telegram/message/peer/lru_test.go index cd1015025d..a8d5453c38 100644 --- a/telegram/message/peer/lru_test.go +++ b/telegram/message/peer/lru_test.go @@ -24,7 +24,7 @@ func TestLRU(t *testing.T) { // State: [4 3 2 1] for i := range [5]struct{}{} { lru.put(strconv.Itoa(i), &tg.InputPeerChat{ - ChatID: i, + ChatID: int64(i), }) } diff --git a/telegram/message/peer/resolver_test.go b/telegram/message/peer/resolver_test.go index c4b7f09756..d1364d71ae 100644 --- a/telegram/message/peer/resolver_test.go +++ b/telegram/message/peer/resolver_test.go @@ -36,7 +36,7 @@ func Test_plainResolver_Resolve(t *testing.T) { r, err := resolver.ResolveDomain(ctx, domain) require.IsType(t, &tg.InputPeerUser{}, r) - require.Equal(t, 10, r.(*tg.InputPeerUser).UserID) + require.Equal(t, int64(10), r.(*tg.InputPeerUser).UserID) require.NoError(t, err) _, err = resolver.ResolveDomain(ctx, domain) @@ -71,7 +71,7 @@ func Test_plainResolver_ResolvePhone(t *testing.T) { r, err := resolver.ResolvePhone(ctx, phone) require.NoError(t, err) require.IsType(t, &tg.InputPeerUser{}, r) - require.Equal(t, 10, r.(*tg.InputPeerUser).UserID) + require.Equal(t, int64(10), r.(*tg.InputPeerUser).UserID) _, err = resolver.ResolvePhone(ctx, phone) require.Error(t, err) diff --git a/telegram/message/peer_test.go b/telegram/message/peer_test.go index e896244ab0..9585734146 100644 --- a/telegram/message/peer_test.go +++ b/telegram/message/peer_test.go @@ -41,7 +41,7 @@ func resolver(t *testing.T, expectedDomain string, expected tg.InputPeerClass) p type answerable struct { ID int - UserID int + UserID int64 } func (a answerable) GetPeer() tg.PeerClass { @@ -73,7 +73,7 @@ func TestResolve(t *testing.T) { check(s.ResolveDomain("@durov"), expected) check(s.ResolveDeeplink("https://t.me/durov"), expected) - uctx := tg.Entities{Users: map[int]*tg.User{ + uctx := tg.Entities{Users: map[int64]*tg.User{ expected.UserID: {ID: expected.UserID, AccessHash: expected.AccessHash, Username: "durov"}, }} ans := answerable{ID: 10, UserID: expected.UserID} diff --git a/telegram/message/scheduled.go b/telegram/message/scheduled.go index ee01335e63..d1555a7042 100644 --- a/telegram/message/scheduled.go +++ b/telegram/message/scheduled.go @@ -74,7 +74,7 @@ func (m *ScheduledManager) Get(ctx context.Context, id int, ids ...int) (tg.Modi } // HistoryWithHash gets scheduled messages history. -func (m *ScheduledManager) HistoryWithHash(ctx context.Context, hash int) (tg.ModifiedMessagesMessages, error) { +func (m *ScheduledManager) HistoryWithHash(ctx context.Context, hash int64) (tg.ModifiedMessagesMessages, error) { p, err := m.peer(ctx) if err != nil { return nil, xerrors.Errorf("peer: %w", err) diff --git a/telegram/query/cached/compute_hash.go b/telegram/query/cached/compute_hash.go index 4ba51883a0..f9b3a1ccd6 100644 --- a/telegram/query/cached/compute_hash.go +++ b/telegram/query/cached/compute_hash.go @@ -7,7 +7,7 @@ import ( "github.com/gotd/td/tg" ) -func (s *ContactsGetContacts) computeHash(v *tg.ContactsContacts) int { +func (s *ContactsGetContacts) computeHash(v *tg.ContactsContacts) int64 { cts := v.Contacts sort.SliceStable(cts, func(i, j int) bool { @@ -18,5 +18,5 @@ func (s *ContactsGetContacts) computeHash(v *tg.ContactsContacts) int { h.Update(uint32(contact.UserID)) } - return int(h.Sum()) + return h.Sum() } diff --git a/telegram/query/cached/queries.gen.go b/telegram/query/cached/queries.gen.go index 761325c4d5..b5c4d18f0c 100644 --- a/telegram/query/cached/queries.gen.go +++ b/telegram/query/cached/queries.gen.go @@ -14,93 +14,9 @@ import ( // No-op definition for keeping imports. var _ = context.Background() -type innerAccountGetChatThemes struct { - // Last received hash. - hash int - // Last received result. - value *tg.AccountChatThemes -} - -type AccountGetChatThemes struct { - // Result state. - last atomic.Value - - // Reference to RPC client to make requests. - raw *tg.Client -} - -// NewAccountGetChatThemes creates new AccountGetChatThemes. -func NewAccountGetChatThemes(raw *tg.Client) *AccountGetChatThemes { - q := &AccountGetChatThemes{ - raw: raw, - } - - return q -} - -func (s *AccountGetChatThemes) store(v innerAccountGetChatThemes) { - s.last.Store(v) -} - -func (s *AccountGetChatThemes) load() (innerAccountGetChatThemes, bool) { - v, ok := s.last.Load().(innerAccountGetChatThemes) - return v, ok -} - -// Value returns last received result. -// NB: May be nil. Returned AccountChatThemes must not be mutated. -func (s *AccountGetChatThemes) Value() *tg.AccountChatThemes { - inner, _ := s.load() - return inner.value -} - -// Hash returns last received hash. -func (s *AccountGetChatThemes) Hash() int { - inner, _ := s.load() - return inner.hash -} - -// Get updates data if needed and returns it. -func (s *AccountGetChatThemes) Get(ctx context.Context) (*tg.AccountChatThemes, error) { - if _, err := s.Fetch(ctx); err != nil { - return nil, err - } - - return s.Value(), nil -} - -// Fetch updates data if needed and returns true if data was modified. -func (s *AccountGetChatThemes) Fetch(ctx context.Context) (bool, error) { - lastHash := s.Hash() - - req := lastHash - result, err := s.raw.AccountGetChatThemes(ctx, req) - if err != nil { - return false, xerrors.Errorf("execute AccountGetChatThemes: %w", err) - } - - switch variant := result.(type) { - case *tg.AccountChatThemes: - hash := variant.Hash - - s.store(innerAccountGetChatThemes{ - hash: hash, - value: variant, - }) - return true, nil - case *tg.AccountChatThemesNotModified: - if lastHash == 0 { - return false, xerrors.Errorf("got unexpected %T result", result) - } - return false, nil - default: - return false, xerrors.Errorf("unexpected type %T", result) - } -} - type innerAccountGetThemes struct { // Last received hash. - hash int + hash int64 // Last received result. value *tg.AccountThemes } @@ -142,7 +58,7 @@ func (s *AccountGetThemes) Value() *tg.AccountThemes { } // Hash returns last received hash. -func (s *AccountGetThemes) Hash() int { +func (s *AccountGetThemes) Hash() int64 { inner, _ := s.load() return inner.hash } @@ -188,7 +104,7 @@ func (s *AccountGetThemes) Fetch(ctx context.Context) (bool, error) { type innerAccountGetWallPapers struct { // Last received hash. - hash int + hash int64 // Last received result. value *tg.AccountWallPapers } @@ -227,7 +143,7 @@ func (s *AccountGetWallPapers) Value() *tg.AccountWallPapers { } // Hash returns last received hash. -func (s *AccountGetWallPapers) Hash() int { +func (s *AccountGetWallPapers) Hash() int64 { inner, _ := s.load() return inner.hash } @@ -272,7 +188,7 @@ func (s *AccountGetWallPapers) Fetch(ctx context.Context) (bool, error) { type innerContactsGetContacts struct { // Last received hash. - hash int + hash int64 // Last received result. value *tg.ContactsContacts } @@ -311,7 +227,7 @@ func (s *ContactsGetContacts) Value() *tg.ContactsContacts { } // Hash returns last received hash. -func (s *ContactsGetContacts) Hash() int { +func (s *ContactsGetContacts) Hash() int64 { inner, _ := s.load() return inner.hash } @@ -354,181 +270,9 @@ func (s *ContactsGetContacts) Fetch(ctx context.Context) (bool, error) { } } -type innerHelpGetCountriesList struct { - // Last received hash. - hash int - // Last received result. - value *tg.HelpCountriesList -} - -type HelpGetCountriesList struct { - // Query to send. - req *tg.HelpGetCountriesListRequest - // Result state. - last atomic.Value - - // Reference to RPC client to make requests. - raw *tg.Client -} - -// NewHelpGetCountriesList creates new HelpGetCountriesList. -func NewHelpGetCountriesList(raw *tg.Client, initial *tg.HelpGetCountriesListRequest) *HelpGetCountriesList { - q := &HelpGetCountriesList{ - req: initial, - raw: raw, - } - - return q -} - -func (s *HelpGetCountriesList) store(v innerHelpGetCountriesList) { - s.last.Store(v) -} - -func (s *HelpGetCountriesList) load() (innerHelpGetCountriesList, bool) { - v, ok := s.last.Load().(innerHelpGetCountriesList) - return v, ok -} - -// Value returns last received result. -// NB: May be nil. Returned HelpCountriesList must not be mutated. -func (s *HelpGetCountriesList) Value() *tg.HelpCountriesList { - inner, _ := s.load() - return inner.value -} - -// Hash returns last received hash. -func (s *HelpGetCountriesList) Hash() int { - inner, _ := s.load() - return inner.hash -} - -// Get updates data if needed and returns it. -func (s *HelpGetCountriesList) Get(ctx context.Context) (*tg.HelpCountriesList, error) { - if _, err := s.Fetch(ctx); err != nil { - return nil, err - } - - return s.Value(), nil -} - -// Fetch updates data if needed and returns true if data was modified. -func (s *HelpGetCountriesList) Fetch(ctx context.Context) (bool, error) { - lastHash := s.Hash() - - req := s.req - req.Hash = lastHash - result, err := s.raw.HelpGetCountriesList(ctx, req) - if err != nil { - return false, xerrors.Errorf("execute HelpGetCountriesList: %w", err) - } - - switch variant := result.(type) { - case *tg.HelpCountriesList: - hash := variant.Hash - - s.store(innerHelpGetCountriesList{ - hash: hash, - value: variant, - }) - return true, nil - case *tg.HelpCountriesListNotModified: - if lastHash == 0 { - return false, xerrors.Errorf("got unexpected %T result", result) - } - return false, nil - default: - return false, xerrors.Errorf("unexpected type %T", result) - } -} - -type innerHelpGetPassportConfig struct { - // Last received hash. - hash int - // Last received result. - value *tg.HelpPassportConfig -} - -type HelpGetPassportConfig struct { - // Result state. - last atomic.Value - - // Reference to RPC client to make requests. - raw *tg.Client -} - -// NewHelpGetPassportConfig creates new HelpGetPassportConfig. -func NewHelpGetPassportConfig(raw *tg.Client) *HelpGetPassportConfig { - q := &HelpGetPassportConfig{ - raw: raw, - } - - return q -} - -func (s *HelpGetPassportConfig) store(v innerHelpGetPassportConfig) { - s.last.Store(v) -} - -func (s *HelpGetPassportConfig) load() (innerHelpGetPassportConfig, bool) { - v, ok := s.last.Load().(innerHelpGetPassportConfig) - return v, ok -} - -// Value returns last received result. -// NB: May be nil. Returned HelpPassportConfig must not be mutated. -func (s *HelpGetPassportConfig) Value() *tg.HelpPassportConfig { - inner, _ := s.load() - return inner.value -} - -// Hash returns last received hash. -func (s *HelpGetPassportConfig) Hash() int { - inner, _ := s.load() - return inner.hash -} - -// Get updates data if needed and returns it. -func (s *HelpGetPassportConfig) Get(ctx context.Context) (*tg.HelpPassportConfig, error) { - if _, err := s.Fetch(ctx); err != nil { - return nil, err - } - - return s.Value(), nil -} - -// Fetch updates data if needed and returns true if data was modified. -func (s *HelpGetPassportConfig) Fetch(ctx context.Context) (bool, error) { - lastHash := s.Hash() - - req := lastHash - result, err := s.raw.HelpGetPassportConfig(ctx, req) - if err != nil { - return false, xerrors.Errorf("execute HelpGetPassportConfig: %w", err) - } - - switch variant := result.(type) { - case *tg.HelpPassportConfig: - hash := variant.Hash - - s.store(innerHelpGetPassportConfig{ - hash: hash, - value: variant, - }) - return true, nil - case *tg.HelpPassportConfigNotModified: - if lastHash == 0 { - return false, xerrors.Errorf("got unexpected %T result", result) - } - return false, nil - default: - return false, xerrors.Errorf("unexpected type %T", result) - } -} - type innerMessagesGetAllStickers struct { // Last received hash. - hash int + hash int64 // Last received result. value *tg.MessagesAllStickers } @@ -567,7 +311,7 @@ func (s *MessagesGetAllStickers) Value() *tg.MessagesAllStickers { } // Hash returns last received hash. -func (s *MessagesGetAllStickers) Hash() int { +func (s *MessagesGetAllStickers) Hash() int64 { inner, _ := s.load() return inner.hash } @@ -612,7 +356,7 @@ func (s *MessagesGetAllStickers) Fetch(ctx context.Context) (bool, error) { type innerMessagesGetFavedStickers struct { // Last received hash. - hash int + hash int64 // Last received result. value *tg.MessagesFavedStickers } @@ -651,7 +395,7 @@ func (s *MessagesGetFavedStickers) Value() *tg.MessagesFavedStickers { } // Hash returns last received hash. -func (s *MessagesGetFavedStickers) Hash() int { +func (s *MessagesGetFavedStickers) Hash() int64 { inner, _ := s.load() return inner.hash } @@ -696,7 +440,7 @@ func (s *MessagesGetFavedStickers) Fetch(ctx context.Context) (bool, error) { type innerMessagesGetFeaturedStickers struct { // Last received hash. - hash int + hash int64 // Last received result. value *tg.MessagesFeaturedStickers } @@ -735,7 +479,7 @@ func (s *MessagesGetFeaturedStickers) Value() *tg.MessagesFeaturedStickers { } // Hash returns last received hash. -func (s *MessagesGetFeaturedStickers) Hash() int { +func (s *MessagesGetFeaturedStickers) Hash() int64 { inner, _ := s.load() return inner.hash } @@ -780,7 +524,7 @@ func (s *MessagesGetFeaturedStickers) Fetch(ctx context.Context) (bool, error) { type innerMessagesGetMaskStickers struct { // Last received hash. - hash int + hash int64 // Last received result. value *tg.MessagesAllStickers } @@ -819,7 +563,7 @@ func (s *MessagesGetMaskStickers) Value() *tg.MessagesAllStickers { } // Hash returns last received hash. -func (s *MessagesGetMaskStickers) Hash() int { +func (s *MessagesGetMaskStickers) Hash() int64 { inner, _ := s.load() return inner.hash } @@ -864,7 +608,7 @@ func (s *MessagesGetMaskStickers) Fetch(ctx context.Context) (bool, error) { type innerMessagesGetRecentStickers struct { // Last received hash. - hash int + hash int64 // Last received result. value *tg.MessagesRecentStickers } @@ -906,7 +650,7 @@ func (s *MessagesGetRecentStickers) Value() *tg.MessagesRecentStickers { } // Hash returns last received hash. -func (s *MessagesGetRecentStickers) Hash() int { +func (s *MessagesGetRecentStickers) Hash() int64 { inner, _ := s.load() return inner.hash } @@ -952,7 +696,7 @@ func (s *MessagesGetRecentStickers) Fetch(ctx context.Context) (bool, error) { type innerMessagesGetSavedGifs struct { // Last received hash. - hash int + hash int64 // Last received result. value *tg.MessagesSavedGifs } @@ -991,7 +735,7 @@ func (s *MessagesGetSavedGifs) Value() *tg.MessagesSavedGifs { } // Hash returns last received hash. -func (s *MessagesGetSavedGifs) Hash() int { +func (s *MessagesGetSavedGifs) Hash() int64 { inner, _ := s.load() return inner.hash } @@ -1036,7 +780,7 @@ func (s *MessagesGetSavedGifs) Fetch(ctx context.Context) (bool, error) { type innerMessagesGetStickers struct { // Last received hash. - hash int + hash int64 // Last received result. value *tg.MessagesStickers } @@ -1078,7 +822,7 @@ func (s *MessagesGetStickers) Value() *tg.MessagesStickers { } // Hash returns last received hash. -func (s *MessagesGetStickers) Hash() int { +func (s *MessagesGetStickers) Hash() int64 { inner, _ := s.load() return inner.hash } @@ -1124,7 +868,7 @@ func (s *MessagesGetStickers) Fetch(ctx context.Context) (bool, error) { type innerMessagesSearchStickerSets struct { // Last received hash. - hash int + hash int64 // Last received result. value *tg.MessagesFoundStickerSets } @@ -1166,7 +910,7 @@ func (s *MessagesSearchStickerSets) Value() *tg.MessagesFoundStickerSets { } // Hash returns last received hash. -func (s *MessagesSearchStickerSets) Hash() int { +func (s *MessagesSearchStickerSets) Hash() int64 { inner, _ := s.load() return inner.hash } diff --git a/telegram/query/channels/participants/iter.go b/telegram/query/channels/participants/iter.go index be47f07ab1..bf2fb11745 100644 --- a/telegram/query/channels/participants/iter.go +++ b/telegram/query/channels/participants/iter.go @@ -64,7 +64,7 @@ func (m *Iterator) apply(r tg.ChannelsChannelParticipantsClass) error { switch prts := r.(type) { case *tg.ChannelsChannelParticipants: // channels.channelParticipants#f56ee2a8 participants = prts.Participants - entities = peer.NewEntities(prts.MapUsers().UserToMap(), map[int]*tg.Chat{}, map[int]*tg.Channel{}) + entities = peer.NewEntities(prts.MapUsers().UserToMap(), map[int64]*tg.Chat{}, map[int64]*tg.Channel{}) m.count = prts.Count m.lastBatch = len(participants) < m.limit diff --git a/telegram/query/channels/participants/iter_test.go b/telegram/query/channels/participants/iter_test.go index 583b7ca222..ea0bb54c28 100644 --- a/telegram/query/channels/participants/iter_test.go +++ b/telegram/query/channels/participants/iter_test.go @@ -15,7 +15,7 @@ func generateParticipants(count int) []tg.ChannelParticipantClass { for i := 0; i < count; i++ { r = append(r, &tg.ChannelParticipant{ - UserID: i, + UserID: int64(i), Date: i, }) } diff --git a/telegram/query/channels/participants/specialize.go b/telegram/query/channels/participants/specialize.go index ec336087f6..078eb9559c 100644 --- a/telegram/query/channels/participants/specialize.go +++ b/telegram/query/channels/participants/specialize.go @@ -17,7 +17,7 @@ func (e Elem) UserPhotos(raw *tg.Client) (*photos.GetUserPhotosQueryBuilder, boo // User tries to get participant user object. func (e Elem) User() (*tg.User, bool) { switch part := e.Participant.(type) { - case interface{ GetUserID() int }: + case interface{ GetUserID() int64 }: return e.Entities.User(part.GetUserID()) case interface{ GetPeer() tg.PeerClass }: user, ok := part.GetPeer().(*tg.PeerUser) diff --git a/telegram/query/channels/participants/specialize_test.go b/telegram/query/channels/participants/specialize_test.go index 0b2c2164e4..ea82d6982a 100644 --- a/telegram/query/channels/participants/specialize_test.go +++ b/telegram/query/channels/participants/specialize_test.go @@ -11,9 +11,9 @@ import ( func TestElem(t *testing.T) { entities := peer.NewEntities( - map[int]*tg.User{10: {}}, - map[int]*tg.Chat{}, - map[int]*tg.Channel{}, + map[int64]*tg.User{10: {}}, + map[int64]*tg.Chat{}, + map[int64]*tg.Channel{}, ) type results struct { diff --git a/telegram/query/contacts/blocked/iter_test.go b/telegram/query/contacts/blocked/iter_test.go index ca959dbbc1..904e1ef093 100644 --- a/telegram/query/contacts/blocked/iter_test.go +++ b/telegram/query/contacts/blocked/iter_test.go @@ -16,7 +16,7 @@ func generateBlocked(count int) []tg.PeerBlocked { for i := 0; i < count; i++ { r = append(r, tg.PeerBlocked{ PeerID: &tg.PeerUser{ - UserID: i + 1, + UserID: int64(i + 1), }, Date: i, }) diff --git a/telegram/query/dialogs/iter_test.go b/telegram/query/dialogs/iter_test.go index fbc2b64352..0d7e6d475d 100644 --- a/telegram/query/dialogs/iter_test.go +++ b/telegram/query/dialogs/iter_test.go @@ -15,7 +15,7 @@ func generateDialogs(count int) []tg.DialogClass { for i := 0; i < count; i++ { r = append(r, &tg.Dialog{ - Peer: &tg.PeerChannel{ChannelID: i}, + Peer: &tg.PeerChannel{ChannelID: int64(i)}, }) } diff --git a/telegram/query/hasher/hash.go b/telegram/query/hasher/hash.go index 2523bc4cd7..997684ea7d 100644 --- a/telegram/query/hasher/hash.go +++ b/telegram/query/hasher/hash.go @@ -25,7 +25,6 @@ func (h *Hasher) Update64(value uint64) { } // Sum returns final sum. -func (h *Hasher) Sum() int32 { - r := int32(h.state & 0x7FFFFFFF) - return r +func (h *Hasher) Sum() int64 { + return int64(h.state & 0x7FFFFFFF) } diff --git a/telegram/query/hasher/hash_test.go b/telegram/query/hasher/hash_test.go index fe5ce661bb..0b23cc5ee7 100644 --- a/telegram/query/hasher/hash_test.go +++ b/telegram/query/hasher/hash_test.go @@ -14,5 +14,5 @@ func TestHasher(t *testing.T) { hasher.Update(uint32(data[i])) } - require.Equal(t, int32(611477280), hasher.Sum()) + require.Equal(t, int64(611477280), hasher.Sum()) } diff --git a/telegram/query/internal/cachedgen/_template/gen.tmpl b/telegram/query/internal/cachedgen/_template/gen.tmpl index 29cfea5711..3c889d2c39 100644 --- a/telegram/query/internal/cachedgen/_template/gen.tmpl +++ b/telegram/query/internal/cachedgen/_template/gen.tmpl @@ -19,7 +19,7 @@ var _ = context.Background() type inner{{ $query.Name }} struct { // Last received hash. - hash int + hash int64 // Last received result. value *tg.{{ $query.ResultName }} } @@ -63,7 +63,7 @@ func (s *{{ $query.Name }}) Value() *tg.{{ $query.ResultName }} { } // Hash returns last received hash. -func (s *{{ $query.Name }}) Hash() int { +func (s *{{ $query.Name }}) Hash() int64 { inner, _ := s.load() return inner.hash } diff --git a/telegram/query/internal/cachedgen/collect.go b/telegram/query/internal/cachedgen/collect.go index 70a199f785..9c81dacbbd 100644 --- a/telegram/query/internal/cachedgen/collect.go +++ b/telegram/query/internal/cachedgen/collect.go @@ -16,7 +16,7 @@ func isHashField(field *types.Var) bool { return false } - return basic.Kind() == types.Int && field.Name() == "Hash" + return basic.Kind() == types.Int64 && field.Name() == "Hash" } func hasHashField(st *types.Struct) bool { @@ -67,7 +67,7 @@ func isCachedQuery(args *types.Tuple) (request, bool) { params: sortParams(r), }, hasHashField(st) case *types.Basic: - if req.Kind() != types.Int || arg.Name() != "hash" { + if req.Kind() != types.Int64 || arg.Name() != "hash" { return request{}, false } return request{}, true diff --git a/telegram/query/photos/iter.go b/telegram/query/photos/iter.go index f6eb907808..317a40f046 100644 --- a/telegram/query/photos/iter.go +++ b/telegram/query/photos/iter.go @@ -64,13 +64,13 @@ func (m *Iterator) apply(r tg.PhotosPhotosClass) error { switch phts := r.(type) { case *tg.PhotosPhotos: // photos.photos#8dca6aa5 photos = phts.Photos - entities = peer.NewEntities(phts.MapUsers().UserToMap(), map[int]*tg.Chat{}, map[int]*tg.Channel{}) + entities = peer.NewEntities(phts.MapUsers().UserToMap(), map[int64]*tg.Chat{}, map[int64]*tg.Channel{}) m.count = len(phts.Photos) m.lastBatch = true case *tg.PhotosPhotosSlice: // photos.photosSlice#15051f54 photos = phts.Photos - entities = peer.NewEntities(phts.MapUsers().UserToMap(), map[int]*tg.Chat{}, map[int]*tg.Channel{}) + entities = peer.NewEntities(phts.MapUsers().UserToMap(), map[int64]*tg.Chat{}, map[int64]*tg.Channel{}) m.count = phts.Count m.lastBatch = len(phts.Photos) < m.limit diff --git a/telegram/updates/access_hash_feeder.go b/telegram/updates/access_hash_feeder.go index f88441acee..63b2e3a307 100644 --- a/telegram/updates/access_hash_feeder.go +++ b/telegram/updates/access_hash_feeder.go @@ -19,7 +19,7 @@ func (s *state) saveChannelHashes(chats []tg.ChatClass) { continue } s.log.Debug("New channel access hash", - zap.Int("channel_id", c.ID), + zap.Int64("channel_id", c.ID), zap.String("title", c.Title), ) if err := s.hasher.SetChannelAccessHash(s.selfID, c.ID, hash); err != nil { @@ -31,7 +31,7 @@ func (s *state) saveChannelHashes(chats []tg.ChatClass) { continue } s.log.Debug("New channel access hash", - zap.Int("channel_id", c.ID), + zap.Int64("channel_id", c.ID), zap.String("title", c.Title), ) if err := s.hasher.SetChannelAccessHash(s.selfID, c.ID, c.AccessHash); err != nil { @@ -41,7 +41,7 @@ func (s *state) saveChannelHashes(chats []tg.ChatClass) { } } -func (s *state) restoreAccessHash(channelID, date int) (accessHash int64, ok bool) { +func (s *state) restoreAccessHash(channelID int64, date int) (accessHash int64, ok bool) { diff, err := s.client.UpdatesGetDifference(s.ctx, &tg.UpdatesGetDifferenceRequest{ Pts: s.pts.State(), Qts: s.qts.State(), diff --git a/telegram/updates/classifier.go b/telegram/updates/classifier.go index 453a0f8d23..ff9d5f1e52 100644 --- a/telegram/updates/classifier.go +++ b/telegram/updates/classifier.go @@ -44,7 +44,7 @@ func isCommonQtsUpdate(u tg.UpdateClass) (qts int, ok bool) { return } -func isChannelPtsUpdate(u tg.UpdateClass) (channelID, pts, ptsCount int, ok bool, err error) { +func isChannelPtsUpdate(u tg.UpdateClass) (channelID int64, pts, ptsCount int, ok bool, err error) { switch u := u.(type) { case *tg.UpdateNewChannelMessage: channelID, err = extractChannelID(u.Message) @@ -68,7 +68,7 @@ func isChannelPtsUpdate(u tg.UpdateClass) (channelID, pts, ptsCount int, ok bool return } -func extractChannelID(msg tg.MessageClass) (int, error) { +func extractChannelID(msg tg.MessageClass) (int64, error) { switch msg := msg.(type) { case *tg.Message: if c, ok := msg.PeerID.(*tg.PeerChannel); ok { diff --git a/telegram/updates/config.go b/telegram/updates/config.go index 3206cd64c1..6629e64fd5 100644 --- a/telegram/updates/config.go +++ b/telegram/updates/config.go @@ -23,7 +23,7 @@ type Config struct { Handler telegram.UpdateHandler // Callback called if manager cannot // recover channel gap (optional). - OnChannelTooLong func(channelID int) + OnChannelTooLong func(channelID int64) // State storage. // In-mem used if not provided. Storage StateStorage @@ -48,8 +48,8 @@ func (cfg *Config) setDefaults() { cfg.Logger = zap.NewNop() } if cfg.OnChannelTooLong == nil { - cfg.OnChannelTooLong = func(channelID int) { - cfg.Logger.Error("Difference too long", zap.Int("channel_id", channelID)) + cfg.OnChannelTooLong = func(channelID int64) { + cfg.Logger.Error("Difference too long", zap.Int64("channel_id", channelID)) } } } diff --git a/telegram/updates/conv_shorts.go b/telegram/updates/conv_shorts.go index a0ab5ce46b..2274669913 100644 --- a/telegram/updates/conv_shorts.go +++ b/telegram/updates/conv_shorts.go @@ -10,7 +10,7 @@ func convertOptional(msg *tg.Message, i tg.UpdatesClass) { msg.SetFwdFrom(v) } } - if u, ok := i.(interface{ GetViaBotID() (int, bool) }); ok { + if u, ok := i.(interface{ GetViaBotID() (int64, bool) }); ok { if v, ok := u.GetViaBotID(); ok { msg.SetViaBotID(v) } diff --git a/telegram/updates/internal/e2e/entities.go b/telegram/updates/internal/e2e/entities.go index 2078478437..36323d49e7 100644 --- a/telegram/updates/internal/e2e/entities.go +++ b/telegram/updates/internal/e2e/entities.go @@ -4,19 +4,19 @@ import "github.com/gotd/td/tg" // Entities contains update entities. type Entities struct { - Users map[int]*tg.User - Chats map[int]*tg.Chat - Channels map[int]*tg.Channel - ChannelsForbidden map[int]*tg.ChannelForbidden + Users map[int64]*tg.User + Chats map[int64]*tg.Chat + Channels map[int64]*tg.Channel + ChannelsForbidden map[int64]*tg.ChannelForbidden } // NewEntities creates new Entities. func NewEntities() *Entities { return &Entities{ - Users: map[int]*tg.User{}, - Chats: map[int]*tg.Chat{}, - Channels: map[int]*tg.Channel{}, - ChannelsForbidden: map[int]*tg.ChannelForbidden{}, + Users: map[int64]*tg.User{}, + Chats: map[int64]*tg.Chat{}, + Channels: map[int64]*tg.Channel{}, + ChannelsForbidden: map[int64]*tg.ChannelForbidden{}, } } diff --git a/telegram/updates/internal/e2e/handler.go b/telegram/updates/internal/e2e/handler.go index cbfb18431f..6ed179b058 100644 --- a/telegram/updates/internal/e2e/handler.go +++ b/telegram/updates/internal/e2e/handler.go @@ -17,7 +17,7 @@ type handler struct { func newHandler() *handler { return &handler{ messages: &messageDatabase{ - channels: make(map[int][]tg.MessageClass), + channels: make(map[int64][]tg.MessageClass), }, ents: NewEntities(), } diff --git a/telegram/updates/internal/e2e/manager_test.go b/telegram/updates/internal/e2e/manager_test.go index de8182f07f..4b784b11c0 100644 --- a/telegram/updates/internal/e2e/manager_test.go +++ b/telegram/updates/internal/e2e/manager_test.go @@ -26,7 +26,7 @@ func TestE2E(t *testing.T) { ) var channels []*tg.PeerChannel - require.NoError(t, storage.ForEachChannels(123, func(channelID, pts int) error { + require.NoError(t, storage.ForEachChannels(123, func(channelID int64, pts int) error { channels = append(channels, &tg.PeerChannel{ ChannelID: channelID, }) @@ -93,7 +93,7 @@ func testManager(t *testing.T, f func(s *server, storage updates.StateStorage) c for i := 0; i < 30; i++ { c := s.peers.createChannel(fmt.Sprintf("channel-%d", i)) require.NoError(t, storage.SetChannelPts(123, c.ChannelID, 0)) - require.NoError(t, hasher.SetChannelAccessHash(123, c.ChannelID, int64(c.ChannelID*2))) + require.NoError(t, hasher.SetChannelAccessHash(123, c.ChannelID, c.ChannelID*2)) } e := updates.New(updates.Config{ @@ -139,7 +139,7 @@ func testManager(t *testing.T, f func(s *server, storage updates.StateStorage) c } ups := []tg.UpdateClass{&tg.UpdatePtsChanged{}} - if err := storage.ForEachChannels(123, func(channelID, pts int) error { + if err := storage.ForEachChannels(123, func(channelID int64, pts int) error { ups = append(ups, &tg.UpdateChannelTooLong{ChannelID: channelID}) return nil }); err != nil { diff --git a/telegram/updates/internal/e2e/peer_db.go b/telegram/updates/internal/e2e/peer_db.go index 0ad1e7c134..cdbe76c965 100644 --- a/telegram/updates/internal/e2e/peer_db.go +++ b/telegram/updates/internal/e2e/peer_db.go @@ -5,15 +5,15 @@ import "github.com/gotd/td/tg" type messageDatabase struct { common []tg.MessageClass secret []tg.EncryptedMessageClass - channels map[int][]tg.MessageClass + channels map[int64][]tg.MessageClass } type peerDatabase struct { - users map[int]*tg.User - chats map[int]*tg.Chat - channels map[int]*tg.Channel + users map[int64]*tg.User + chats map[int64]*tg.Chat + channels map[int64]*tg.Channel - id int + id int64 } func (p *peerDatabase) createUser(username string) *tg.PeerUser { @@ -41,7 +41,7 @@ func (p *peerDatabase) createChannel(username string) *tg.PeerChannel { ID: p.id, Username: username, } - p.channels[p.id].SetAccessHash(int64(p.id * 2)) + p.channels[p.id].SetAccessHash(p.id * 2) defer func() { p.id++ }() return &tg.PeerChannel{ChannelID: p.id} diff --git a/telegram/updates/internal/e2e/server.go b/telegram/updates/internal/e2e/server.go index 7d5acf9ee7..fd7d0b66c7 100644 --- a/telegram/updates/internal/e2e/server.go +++ b/telegram/updates/internal/e2e/server.go @@ -24,12 +24,12 @@ func newServer() *server { return &server{ date: 1, peers: &peerDatabase{ - users: make(map[int]*tg.User), - chats: make(map[int]*tg.Chat), - channels: make(map[int]*tg.Channel), + users: make(map[int64]*tg.User), + chats: make(map[int64]*tg.Chat), + channels: make(map[int64]*tg.Channel), }, messages: &messageDatabase{ - channels: make(map[int][]tg.MessageClass), + channels: make(map[int64][]tg.MessageClass), }, } } diff --git a/telegram/updates/internal/e2e/storage_mem.go b/telegram/updates/internal/e2e/storage_mem.go index 6402f757ee..265039f491 100644 --- a/telegram/updates/internal/e2e/storage_mem.go +++ b/telegram/updates/internal/e2e/storage_mem.go @@ -11,19 +11,19 @@ import ( var _ updates.StateStorage = (*memStorage)(nil) type memStorage struct { - states map[int]updates.State - channels map[int]map[int]int + states map[int64]updates.State + channels map[int64]map[int64]int mux sync.Mutex } func newMemStorage() *memStorage { return &memStorage{ - states: map[int]updates.State{}, - channels: map[int]map[int]int{}, + states: map[int64]updates.State{}, + channels: map[int64]map[int64]int{}, } } -func (s *memStorage) GetState(userID int) (state updates.State, found bool, err error) { +func (s *memStorage) GetState(userID int64) (state updates.State, found bool, err error) { s.mux.Lock() defer s.mux.Unlock() @@ -31,16 +31,16 @@ func (s *memStorage) GetState(userID int) (state updates.State, found bool, err return } -func (s *memStorage) SetState(userID int, state updates.State) error { +func (s *memStorage) SetState(userID int64, state updates.State) error { s.mux.Lock() defer s.mux.Unlock() s.states[userID] = state - s.channels[userID] = map[int]int{} + s.channels[userID] = map[int64]int{} return nil } -func (s *memStorage) SetPts(userID, pts int) error { +func (s *memStorage) SetPts(userID int64, pts int) error { s.mux.Lock() defer s.mux.Unlock() @@ -54,7 +54,7 @@ func (s *memStorage) SetPts(userID, pts int) error { return nil } -func (s *memStorage) SetQts(userID, qts int) error { +func (s *memStorage) SetQts(userID int64, qts int) error { s.mux.Lock() defer s.mux.Unlock() @@ -68,7 +68,7 @@ func (s *memStorage) SetQts(userID, qts int) error { return nil } -func (s *memStorage) SetDate(userID, date int) error { +func (s *memStorage) SetDate(userID int64, date int) error { s.mux.Lock() defer s.mux.Unlock() @@ -82,7 +82,7 @@ func (s *memStorage) SetDate(userID, date int) error { return nil } -func (s *memStorage) SetSeq(userID, seq int) error { +func (s *memStorage) SetSeq(userID int64, seq int) error { s.mux.Lock() defer s.mux.Unlock() @@ -96,7 +96,7 @@ func (s *memStorage) SetSeq(userID, seq int) error { return nil } -func (s *memStorage) SetDateSeq(userID, date, seq int) error { +func (s *memStorage) SetDateSeq(userID int64, date, seq int) error { s.mux.Lock() defer s.mux.Unlock() @@ -111,7 +111,7 @@ func (s *memStorage) SetDateSeq(userID, date, seq int) error { return nil } -func (s *memStorage) SetChannelPts(userID, channelID, pts int) error { +func (s *memStorage) SetChannelPts(userID, channelID int64, pts int) error { s.mux.Lock() defer s.mux.Unlock() @@ -124,7 +124,7 @@ func (s *memStorage) SetChannelPts(userID, channelID, pts int) error { return nil } -func (s *memStorage) GetChannelPts(userID, channelID int) (pts int, found bool, err error) { +func (s *memStorage) GetChannelPts(userID, channelID int64) (pts int, found bool, err error) { s.mux.Lock() defer s.mux.Unlock() @@ -137,7 +137,7 @@ func (s *memStorage) GetChannelPts(userID, channelID int) (pts int, found bool, return } -func (s *memStorage) ForEachChannels(userID int, f func(channelID, pts int) error) error { +func (s *memStorage) ForEachChannels(userID int64, f func(channelID int64, pts int) error) error { s.mux.Lock() defer s.mux.Unlock() @@ -158,17 +158,17 @@ func (s *memStorage) ForEachChannels(userID int, f func(channelID, pts int) erro var _ updates.ChannelAccessHasher = (*memAccessHasher)(nil) type memAccessHasher struct { - hashes map[int]map[int]int64 + hashes map[int64]map[int64]int64 mux sync.Mutex } func newMemAccessHasher() *memAccessHasher { return &memAccessHasher{ - hashes: map[int]map[int]int64{}, + hashes: map[int64]map[int64]int64{}, } } -func (m *memAccessHasher) GetChannelAccessHash(userID, channelID int) (hash int64, found bool, err error) { +func (m *memAccessHasher) GetChannelAccessHash(userID, channelID int64) (hash int64, found bool, err error) { m.mux.Lock() defer m.mux.Unlock() @@ -181,13 +181,13 @@ func (m *memAccessHasher) GetChannelAccessHash(userID, channelID int) (hash int6 return } -func (m *memAccessHasher) SetChannelAccessHash(userID, channelID int, hash int64) error { +func (m *memAccessHasher) SetChannelAccessHash(userID, channelID, hash int64) error { m.mux.Lock() defer m.mux.Unlock() userHashes, ok := m.hashes[userID] if !ok { - userHashes = map[int]int64{} + userHashes = map[int64]int64{} m.hashes[userID] = userHashes } diff --git a/telegram/updates/manager.go b/telegram/updates/manager.go index 90c8c2347d..3f7bb20ec9 100644 --- a/telegram/updates/manager.go +++ b/telegram/updates/manager.go @@ -57,7 +57,7 @@ func (m *Manager) Handle(ctx context.Context, u tg.UpdatesClass) error { // // If forget is true, local state (if exist) will be overwritten // with remote state. -func (m *Manager) Auth(ctx context.Context, client RawClient, userID int, isBot, forget bool) error { +func (m *Manager) Auth(ctx context.Context, client RawClient, userID int64, isBot, forget bool) error { m.mux.Lock() defer m.mux.Unlock() @@ -70,11 +70,11 @@ func (m *Manager) Auth(ctx context.Context, client RawClient, userID int, isBot, return xerrors.Errorf("load state: %w", err) } - channels := make(map[int]struct { + channels := make(map[int64]struct { Pts int AccessHash int64 }) - if err := m.cfg.Storage.ForEachChannels(userID, func(channelID, pts int) error { + if err := m.cfg.Storage.ForEachChannels(userID, func(channelID int64, pts int) error { hash, found, err := m.cfg.AccessHasher.GetChannelAccessHash(userID, channelID) if err != nil { return err @@ -114,7 +114,7 @@ func (m *Manager) Auth(ctx context.Context, client RawClient, userID int, isBot, return nil } -func (m *Manager) loadState(client RawClient, userID int, forget bool) (State, error) { +func (m *Manager) loadState(client RawClient, userID int64, forget bool) (State, error) { onNotFound: var state State if forget { diff --git a/telegram/updates/state.go b/telegram/updates/state.go index 2f0667f61e..fd562fac96 100644 --- a/telegram/updates/state.go +++ b/telegram/updates/state.go @@ -39,16 +39,16 @@ type state struct { idleTimeout *time.Timer // Channel states. - channels map[int]*channelState + channels map[int64]*channelState // Immutable fields. client RawClient log *zap.Logger handler telegram.UpdateHandler - onTooLong func(channelID int) + onTooLong func(channelID int64) storage StateStorage hasher ChannelAccessHasher - selfID int + selfID int64 diffLim int ctx context.Context @@ -58,17 +58,17 @@ type state struct { type stateConfig struct { State State - Channels map[int]struct { + Channels map[int64]struct { Pts int AccessHash int64 } RawClient RawClient Logger *zap.Logger Handler telegram.UpdateHandler - OnChannelTooLong func(channelID int) + OnChannelTooLong func(channelID int64) Storage StateStorage Hasher ChannelAccessHasher - SelfID int + SelfID int64 DiffLimit int } @@ -81,7 +81,7 @@ func newState(ctx context.Context, cfg stateConfig) *state { date: cfg.State.Date, idleTimeout: time.NewTimer(idleTimeout), - channels: make(map[int]*channelState), + channels: make(map[int64]*channelState), client: cfg.RawClient, log: cfg.Logger, @@ -259,7 +259,7 @@ func (s *state) handleQts(qts int, u tg.UpdateClass, ents entities) error { }) } -func (s *state) handleChannel(channelID, date, pts, ptsCount int, cu channelUpdate) { +func (s *state) handleChannel(channelID int64, date, pts, ptsCount int, cu channelUpdate) { if err := validatePts(pts, ptsCount); err != nil { s.log.Error("Pts validation failed", zap.Error(err), zap.Any("update", cu.update)) return @@ -284,7 +284,7 @@ func (s *state) handleChannel(channelID, date, pts, ptsCount int, cu channelUpda accessHash, found = s.restoreAccessHash(channelID, date) if !found { s.log.Debug("Failed to recover missing access hash, update ignored", - zap.Int("channel_id", channelID), + zap.Int64("channel_id", channelID), zap.Any("update", cu.update), ) return @@ -312,7 +312,7 @@ func (s *state) handleChannel(channelID, date, pts, ptsCount int, cu channelUpda state.PushUpdate(cu) } -func (s *state) newChannelState(channelID int, accessHash int64, initialPts int) *channelState { +func (s *state) newChannelState(channelID, accessHash int64, initialPts int) *channelState { return newChannelState(channelStateConfig{ Outchan: s.internalQueue, InitialPts: initialPts, @@ -324,7 +324,7 @@ func (s *state) newChannelState(channelID int, accessHash int64, initialPts int) RawClient: s.client, Handler: s.handler, OnChannelTooLong: s.onTooLong, - Logger: s.log.Named("channel").With(zap.Int("channel_id", channelID)), + Logger: s.log.Named("channel").With(zap.Int64("channel_id", channelID)), }) } diff --git a/telegram/updates/state_apply.go b/telegram/updates/state_apply.go index c5046838b8..b6d3524bfe 100644 --- a/telegram/updates/state_apply.go +++ b/telegram/updates/state_apply.go @@ -49,7 +49,7 @@ func (s *state) applyCombined(ctx context.Context, comb *tg.UpdatesCombined) (pt case *tg.UpdateChannelTooLong: channelState, ok := s.channels[u.ChannelID] if !ok { - s.log.Debug("ChannelTooLong for channel that is not in the state, update ignored", zap.Int("channel_id", u.ChannelID)) + s.log.Debug("ChannelTooLong for channel that is not in the state, update ignored", zap.Int64("channel_id", u.ChannelID)) continue } diff --git a/telegram/updates/state_channel.go b/telegram/updates/state_channel.go index 128122d0ba..d996fbfd63 100644 --- a/telegram/updates/state_channel.go +++ b/telegram/updates/state_channel.go @@ -29,15 +29,15 @@ type channelState struct { diffTimeout time.Time // Immutable fields. - channelID int + channelID int64 accessHash int64 - selfID int + selfID int64 diffLim int client RawClient storage StateStorage log *zap.Logger handler telegram.UpdateHandler - onTooLong func(channelID int) + onTooLong func(channelID int64) ctx context.Context cancel context.CancelFunc @@ -47,14 +47,14 @@ type channelState struct { type channelStateConfig struct { Outchan chan tg.UpdatesClass InitialPts int - ChannelID int + ChannelID int64 AccessHash int64 - SelfID int + SelfID int64 DiffLimit int RawClient RawClient Storage StateStorage Handler telegram.UpdateHandler - OnChannelTooLong func(channelID int) + OnChannelTooLong func(channelID int64) Logger *zap.Logger } diff --git a/telegram/updates/storage.go b/telegram/updates/storage.go index 2af9ffa9b4..e53f09b784 100644 --- a/telegram/updates/storage.go +++ b/telegram/updates/storage.go @@ -24,20 +24,20 @@ func (s State) fromRemote(remote *tg.UpdatesState) State { // SetPts, SetQts, SetDate, SetSeq, SetDateSeq // should return error if user state does not exist. type StateStorage interface { - GetState(userID int) (state State, found bool, err error) - SetState(userID int, state State) error - SetPts(userID, pts int) error - SetQts(userID, qts int) error - SetDate(userID, date int) error - SetSeq(userID, seq int) error - SetDateSeq(userID, date, seq int) error - GetChannelPts(userID, channelID int) (pts int, found bool, err error) - SetChannelPts(userID, channelID, pts int) error - ForEachChannels(userID int, f func(channelID, pts int) error) error + GetState(userID int64) (state State, found bool, err error) + SetState(userID int64, state State) error + SetPts(userID int64, pts int) error + SetQts(userID int64, qts int) error + SetDate(userID int64, date int) error + SetSeq(userID int64, seq int) error + SetDateSeq(userID int64, date, seq int) error + GetChannelPts(userID, channelID int64) (pts int, found bool, err error) + SetChannelPts(userID, channelID int64, pts int) error + ForEachChannels(userID int64, f func(channelID int64, pts int) error) error } // ChannelAccessHasher stores users channel access hashes. type ChannelAccessHasher interface { - SetChannelAccessHash(userID, channelID int, accessHash int64) error - GetChannelAccessHash(userID, channelID int) (accessHash int64, found bool, err error) + SetChannelAccessHash(userID, channelID, accessHash int64) error + GetChannelAccessHash(userID, channelID int64) (accessHash int64, found bool, err error) } diff --git a/telegram/updates/storage_mem.go b/telegram/updates/storage_mem.go index 2387574cd9..30e71a61d5 100644 --- a/telegram/updates/storage_mem.go +++ b/telegram/updates/storage_mem.go @@ -9,19 +9,19 @@ import ( var _ StateStorage = (*memStorage)(nil) type memStorage struct { - states map[int]State - channels map[int]map[int]int + states map[int64]State + channels map[int64]map[int64]int mux sync.Mutex } func newMemStorage() *memStorage { return &memStorage{ - states: map[int]State{}, - channels: map[int]map[int]int{}, + states: map[int64]State{}, + channels: map[int64]map[int64]int{}, } } -func (s *memStorage) GetState(userID int) (state State, found bool, err error) { +func (s *memStorage) GetState(userID int64) (state State, found bool, err error) { s.mux.Lock() defer s.mux.Unlock() @@ -29,16 +29,16 @@ func (s *memStorage) GetState(userID int) (state State, found bool, err error) { return } -func (s *memStorage) SetState(userID int, state State) error { +func (s *memStorage) SetState(userID int64, state State) error { s.mux.Lock() defer s.mux.Unlock() s.states[userID] = state - s.channels[userID] = map[int]int{} + s.channels[userID] = map[int64]int{} return nil } -func (s *memStorage) SetPts(userID, pts int) error { +func (s *memStorage) SetPts(userID int64, pts int) error { s.mux.Lock() defer s.mux.Unlock() @@ -52,7 +52,7 @@ func (s *memStorage) SetPts(userID, pts int) error { return nil } -func (s *memStorage) SetQts(userID, qts int) error { +func (s *memStorage) SetQts(userID int64, qts int) error { s.mux.Lock() defer s.mux.Unlock() @@ -66,7 +66,7 @@ func (s *memStorage) SetQts(userID, qts int) error { return nil } -func (s *memStorage) SetDate(userID, date int) error { +func (s *memStorage) SetDate(userID int64, date int) error { s.mux.Lock() defer s.mux.Unlock() @@ -80,7 +80,7 @@ func (s *memStorage) SetDate(userID, date int) error { return nil } -func (s *memStorage) SetSeq(userID, seq int) error { +func (s *memStorage) SetSeq(userID int64, seq int) error { s.mux.Lock() defer s.mux.Unlock() @@ -94,7 +94,7 @@ func (s *memStorage) SetSeq(userID, seq int) error { return nil } -func (s *memStorage) SetDateSeq(userID, date, seq int) error { +func (s *memStorage) SetDateSeq(userID int64, date, seq int) error { s.mux.Lock() defer s.mux.Unlock() @@ -109,7 +109,7 @@ func (s *memStorage) SetDateSeq(userID, date, seq int) error { return nil } -func (s *memStorage) SetChannelPts(userID, channelID, pts int) error { +func (s *memStorage) SetChannelPts(userID, channelID int64, pts int) error { s.mux.Lock() defer s.mux.Unlock() @@ -122,7 +122,7 @@ func (s *memStorage) SetChannelPts(userID, channelID, pts int) error { return nil } -func (s *memStorage) GetChannelPts(userID, channelID int) (pts int, found bool, err error) { +func (s *memStorage) GetChannelPts(userID, channelID int64) (pts int, found bool, err error) { s.mux.Lock() defer s.mux.Unlock() @@ -135,7 +135,7 @@ func (s *memStorage) GetChannelPts(userID, channelID int) (pts int, found bool, return } -func (s *memStorage) ForEachChannels(userID int, f func(channelID, pts int) error) error { +func (s *memStorage) ForEachChannels(userID int64, f func(channelID int64, pts int) error) error { s.mux.Lock() defer s.mux.Unlock() @@ -156,17 +156,17 @@ func (s *memStorage) ForEachChannels(userID int, f func(channelID, pts int) erro var _ ChannelAccessHasher = (*memAccessHasher)(nil) type memAccessHasher struct { - hashes map[int]map[int]int64 + hashes map[int64]map[int64]int64 mux sync.Mutex } func newMemAccessHasher() *memAccessHasher { return &memAccessHasher{ - hashes: map[int]map[int]int64{}, + hashes: map[int64]map[int64]int64{}, } } -func (m *memAccessHasher) GetChannelAccessHash(userID, channelID int) (hash int64, found bool, err error) { +func (m *memAccessHasher) GetChannelAccessHash(userID, channelID int64) (hash int64, found bool, err error) { m.mux.Lock() defer m.mux.Unlock() @@ -179,13 +179,13 @@ func (m *memAccessHasher) GetChannelAccessHash(userID, channelID int) (hash int6 return } -func (m *memAccessHasher) SetChannelAccessHash(userID, channelID int, hash int64) error { +func (m *memAccessHasher) SetChannelAccessHash(userID, channelID, hash int64) error { m.mux.Lock() defer m.mux.Unlock() userHashes, ok := m.hashes[userID] if !ok { - userHashes = map[int]int64{} + userHashes = map[int64]int64{} m.hashes[userID] = userHashes } diff --git a/tg/tl_account_accept_authorization_gen.go b/tg/tl_account_accept_authorization_gen.go index 0d5f276cfa..1c61ec7ae1 100644 --- a/tg/tl_account_accept_authorization_gen.go +++ b/tg/tl_account_accept_authorization_gen.go @@ -29,14 +29,14 @@ var ( _ = tgerr.Error{} ) -// AccountAcceptAuthorizationRequest represents TL type `account.acceptAuthorization#e7027c94`. +// AccountAcceptAuthorizationRequest represents TL type `account.acceptAuthorization#f3ed4c73`. // Sends a Telegram Passport authorization form, effectively sharing data with the // service // // See https://core.telegram.org/method/account.acceptAuthorization for reference. type AccountAcceptAuthorizationRequest struct { // Bot ID - BotID int + BotID int64 // Telegram Passport element types requested by the service Scope string // Service's public key @@ -48,7 +48,7 @@ type AccountAcceptAuthorizationRequest struct { } // AccountAcceptAuthorizationRequestTypeID is TL type id of AccountAcceptAuthorizationRequest. -const AccountAcceptAuthorizationRequestTypeID = 0xe7027c94 +const AccountAcceptAuthorizationRequestTypeID = 0xf3ed4c73 // Ensuring interfaces in compile-time for AccountAcceptAuthorizationRequest. var ( @@ -92,7 +92,7 @@ func (a *AccountAcceptAuthorizationRequest) String() string { // FillFrom fills AccountAcceptAuthorizationRequest from given interface. func (a *AccountAcceptAuthorizationRequest) FillFrom(from interface { - GetBotID() (value int) + GetBotID() (value int64) GetScope() (value string) GetPublicKey() (value string) GetValueHashes() (value []SecureValueHash) @@ -155,7 +155,7 @@ func (a *AccountAcceptAuthorizationRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (a *AccountAcceptAuthorizationRequest) Encode(b *bin.Buffer) error { if a == nil { - return fmt.Errorf("can't encode account.acceptAuthorization#e7027c94 as nil") + return fmt.Errorf("can't encode account.acceptAuthorization#f3ed4c73 as nil") } b.PutID(AccountAcceptAuthorizationRequestTypeID) return a.EncodeBare(b) @@ -164,19 +164,19 @@ func (a *AccountAcceptAuthorizationRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (a *AccountAcceptAuthorizationRequest) EncodeBare(b *bin.Buffer) error { if a == nil { - return fmt.Errorf("can't encode account.acceptAuthorization#e7027c94 as nil") + return fmt.Errorf("can't encode account.acceptAuthorization#f3ed4c73 as nil") } - b.PutInt(a.BotID) + b.PutLong(a.BotID) b.PutString(a.Scope) b.PutString(a.PublicKey) b.PutVectorHeader(len(a.ValueHashes)) for idx, v := range a.ValueHashes { if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode account.acceptAuthorization#e7027c94: field value_hashes element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode account.acceptAuthorization#f3ed4c73: field value_hashes element with index %d: %w", idx, err) } } if err := a.Credentials.Encode(b); err != nil { - return fmt.Errorf("unable to encode account.acceptAuthorization#e7027c94: field credentials: %w", err) + return fmt.Errorf("unable to encode account.acceptAuthorization#f3ed4c73: field credentials: %w", err) } return nil } @@ -184,10 +184,10 @@ func (a *AccountAcceptAuthorizationRequest) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (a *AccountAcceptAuthorizationRequest) Decode(b *bin.Buffer) error { if a == nil { - return fmt.Errorf("can't decode account.acceptAuthorization#e7027c94 to nil") + return fmt.Errorf("can't decode account.acceptAuthorization#f3ed4c73 to nil") } if err := b.ConsumeID(AccountAcceptAuthorizationRequestTypeID); err != nil { - return fmt.Errorf("unable to decode account.acceptAuthorization#e7027c94: %w", err) + return fmt.Errorf("unable to decode account.acceptAuthorization#f3ed4c73: %w", err) } return a.DecodeBare(b) } @@ -195,33 +195,33 @@ func (a *AccountAcceptAuthorizationRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (a *AccountAcceptAuthorizationRequest) DecodeBare(b *bin.Buffer) error { if a == nil { - return fmt.Errorf("can't decode account.acceptAuthorization#e7027c94 to nil") + return fmt.Errorf("can't decode account.acceptAuthorization#f3ed4c73 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode account.acceptAuthorization#e7027c94: field bot_id: %w", err) + return fmt.Errorf("unable to decode account.acceptAuthorization#f3ed4c73: field bot_id: %w", err) } a.BotID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode account.acceptAuthorization#e7027c94: field scope: %w", err) + return fmt.Errorf("unable to decode account.acceptAuthorization#f3ed4c73: field scope: %w", err) } a.Scope = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode account.acceptAuthorization#e7027c94: field public_key: %w", err) + return fmt.Errorf("unable to decode account.acceptAuthorization#f3ed4c73: field public_key: %w", err) } a.PublicKey = value } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode account.acceptAuthorization#e7027c94: field value_hashes: %w", err) + return fmt.Errorf("unable to decode account.acceptAuthorization#f3ed4c73: field value_hashes: %w", err) } if headerLen > 0 { @@ -230,21 +230,21 @@ func (a *AccountAcceptAuthorizationRequest) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { var value SecureValueHash if err := value.Decode(b); err != nil { - return fmt.Errorf("unable to decode account.acceptAuthorization#e7027c94: field value_hashes: %w", err) + return fmt.Errorf("unable to decode account.acceptAuthorization#f3ed4c73: field value_hashes: %w", err) } a.ValueHashes = append(a.ValueHashes, value) } } { if err := a.Credentials.Decode(b); err != nil { - return fmt.Errorf("unable to decode account.acceptAuthorization#e7027c94: field credentials: %w", err) + return fmt.Errorf("unable to decode account.acceptAuthorization#f3ed4c73: field credentials: %w", err) } } return nil } // GetBotID returns value of BotID field. -func (a *AccountAcceptAuthorizationRequest) GetBotID() (value int) { +func (a *AccountAcceptAuthorizationRequest) GetBotID() (value int64) { return a.BotID } @@ -268,7 +268,7 @@ func (a *AccountAcceptAuthorizationRequest) GetCredentials() (value SecureCreden return a.Credentials } -// AccountAcceptAuthorization invokes method account.acceptAuthorization#e7027c94 returning error if any. +// AccountAcceptAuthorization invokes method account.acceptAuthorization#f3ed4c73 returning error if any. // Sends a Telegram Passport authorization form, effectively sharing data with the // service // diff --git a/tg/tl_account_get_authorization_form_gen.go b/tg/tl_account_get_authorization_form_gen.go index ece93063da..fde517828a 100644 --- a/tg/tl_account_get_authorization_form_gen.go +++ b/tg/tl_account_get_authorization_form_gen.go @@ -29,13 +29,13 @@ var ( _ = tgerr.Error{} ) -// AccountGetAuthorizationFormRequest represents TL type `account.getAuthorizationForm#b86ba8e1`. +// AccountGetAuthorizationFormRequest represents TL type `account.getAuthorizationForm#a929597a`. // Returns a Telegram Passport authorization form for sharing data with a service // // See https://core.telegram.org/method/account.getAuthorizationForm for reference. type AccountGetAuthorizationFormRequest struct { // User identifier of the service's bot - BotID int + BotID int64 // Telegram Passport element types requested by the service Scope string // Service's public key @@ -43,7 +43,7 @@ type AccountGetAuthorizationFormRequest struct { } // AccountGetAuthorizationFormRequestTypeID is TL type id of AccountGetAuthorizationFormRequest. -const AccountGetAuthorizationFormRequestTypeID = 0xb86ba8e1 +const AccountGetAuthorizationFormRequestTypeID = 0xa929597a // Ensuring interfaces in compile-time for AccountGetAuthorizationFormRequest. var ( @@ -81,7 +81,7 @@ func (g *AccountGetAuthorizationFormRequest) String() string { // FillFrom fills AccountGetAuthorizationFormRequest from given interface. func (g *AccountGetAuthorizationFormRequest) FillFrom(from interface { - GetBotID() (value int) + GetBotID() (value int64) GetScope() (value string) GetPublicKey() (value string) }) { @@ -132,7 +132,7 @@ func (g *AccountGetAuthorizationFormRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (g *AccountGetAuthorizationFormRequest) Encode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode account.getAuthorizationForm#b86ba8e1 as nil") + return fmt.Errorf("can't encode account.getAuthorizationForm#a929597a as nil") } b.PutID(AccountGetAuthorizationFormRequestTypeID) return g.EncodeBare(b) @@ -141,9 +141,9 @@ func (g *AccountGetAuthorizationFormRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (g *AccountGetAuthorizationFormRequest) EncodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode account.getAuthorizationForm#b86ba8e1 as nil") + return fmt.Errorf("can't encode account.getAuthorizationForm#a929597a as nil") } - b.PutInt(g.BotID) + b.PutLong(g.BotID) b.PutString(g.Scope) b.PutString(g.PublicKey) return nil @@ -152,10 +152,10 @@ func (g *AccountGetAuthorizationFormRequest) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (g *AccountGetAuthorizationFormRequest) Decode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode account.getAuthorizationForm#b86ba8e1 to nil") + return fmt.Errorf("can't decode account.getAuthorizationForm#a929597a to nil") } if err := b.ConsumeID(AccountGetAuthorizationFormRequestTypeID); err != nil { - return fmt.Errorf("unable to decode account.getAuthorizationForm#b86ba8e1: %w", err) + return fmt.Errorf("unable to decode account.getAuthorizationForm#a929597a: %w", err) } return g.DecodeBare(b) } @@ -163,26 +163,26 @@ func (g *AccountGetAuthorizationFormRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (g *AccountGetAuthorizationFormRequest) DecodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode account.getAuthorizationForm#b86ba8e1 to nil") + return fmt.Errorf("can't decode account.getAuthorizationForm#a929597a to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode account.getAuthorizationForm#b86ba8e1: field bot_id: %w", err) + return fmt.Errorf("unable to decode account.getAuthorizationForm#a929597a: field bot_id: %w", err) } g.BotID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode account.getAuthorizationForm#b86ba8e1: field scope: %w", err) + return fmt.Errorf("unable to decode account.getAuthorizationForm#a929597a: field scope: %w", err) } g.Scope = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode account.getAuthorizationForm#b86ba8e1: field public_key: %w", err) + return fmt.Errorf("unable to decode account.getAuthorizationForm#a929597a: field public_key: %w", err) } g.PublicKey = value } @@ -190,7 +190,7 @@ func (g *AccountGetAuthorizationFormRequest) DecodeBare(b *bin.Buffer) error { } // GetBotID returns value of BotID field. -func (g *AccountGetAuthorizationFormRequest) GetBotID() (value int) { +func (g *AccountGetAuthorizationFormRequest) GetBotID() (value int64) { return g.BotID } @@ -204,7 +204,7 @@ func (g *AccountGetAuthorizationFormRequest) GetPublicKey() (value string) { return g.PublicKey } -// AccountGetAuthorizationForm invokes method account.getAuthorizationForm#b86ba8e1 returning error if any. +// AccountGetAuthorizationForm invokes method account.getAuthorizationForm#a929597a returning error if any. // Returns a Telegram Passport authorization form for sharing data with a service // // See https://core.telegram.org/method/account.getAuthorizationForm for reference. diff --git a/tg/tl_account_get_themes_gen.go b/tg/tl_account_get_themes_gen.go index 62f80f3d4c..220faff79e 100644 --- a/tg/tl_account_get_themes_gen.go +++ b/tg/tl_account_get_themes_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// AccountGetThemesRequest represents TL type `account.getThemes#285946f8`. +// AccountGetThemesRequest represents TL type `account.getThemes#7206e458`. // Get installed themes // // See https://core.telegram.org/method/account.getThemes for reference. @@ -40,11 +40,11 @@ type AccountGetThemesRequest struct { // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation - Hash int + Hash int64 } // AccountGetThemesRequestTypeID is TL type id of AccountGetThemesRequest. -const AccountGetThemesRequestTypeID = 0x285946f8 +const AccountGetThemesRequestTypeID = 0x7206e458 // Ensuring interfaces in compile-time for AccountGetThemesRequest. var ( @@ -80,7 +80,7 @@ func (g *AccountGetThemesRequest) String() string { // FillFrom fills AccountGetThemesRequest from given interface. func (g *AccountGetThemesRequest) FillFrom(from interface { GetFormat() (value string) - GetHash() (value int) + GetHash() (value int64) }) { g.Format = from.GetFormat() g.Hash = from.GetHash() @@ -124,7 +124,7 @@ func (g *AccountGetThemesRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (g *AccountGetThemesRequest) Encode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode account.getThemes#285946f8 as nil") + return fmt.Errorf("can't encode account.getThemes#7206e458 as nil") } b.PutID(AccountGetThemesRequestTypeID) return g.EncodeBare(b) @@ -133,20 +133,20 @@ func (g *AccountGetThemesRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (g *AccountGetThemesRequest) EncodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode account.getThemes#285946f8 as nil") + return fmt.Errorf("can't encode account.getThemes#7206e458 as nil") } b.PutString(g.Format) - b.PutInt(g.Hash) + b.PutLong(g.Hash) return nil } // Decode implements bin.Decoder. func (g *AccountGetThemesRequest) Decode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode account.getThemes#285946f8 to nil") + return fmt.Errorf("can't decode account.getThemes#7206e458 to nil") } if err := b.ConsumeID(AccountGetThemesRequestTypeID); err != nil { - return fmt.Errorf("unable to decode account.getThemes#285946f8: %w", err) + return fmt.Errorf("unable to decode account.getThemes#7206e458: %w", err) } return g.DecodeBare(b) } @@ -154,19 +154,19 @@ func (g *AccountGetThemesRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (g *AccountGetThemesRequest) DecodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode account.getThemes#285946f8 to nil") + return fmt.Errorf("can't decode account.getThemes#7206e458 to nil") } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode account.getThemes#285946f8: field format: %w", err) + return fmt.Errorf("unable to decode account.getThemes#7206e458: field format: %w", err) } g.Format = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode account.getThemes#285946f8: field hash: %w", err) + return fmt.Errorf("unable to decode account.getThemes#7206e458: field hash: %w", err) } g.Hash = value } @@ -179,11 +179,11 @@ func (g *AccountGetThemesRequest) GetFormat() (value string) { } // GetHash returns value of Hash field. -func (g *AccountGetThemesRequest) GetHash() (value int) { +func (g *AccountGetThemesRequest) GetHash() (value int64) { return g.Hash } -// AccountGetThemes invokes method account.getThemes#285946f8 returning error if any. +// AccountGetThemes invokes method account.getThemes#7206e458 returning error if any. // Get installed themes // // See https://core.telegram.org/method/account.getThemes for reference. diff --git a/tg/tl_account_get_wall_papers_gen.go b/tg/tl_account_get_wall_papers_gen.go index 5fb764382f..46290d174f 100644 --- a/tg/tl_account_get_wall_papers_gen.go +++ b/tg/tl_account_get_wall_papers_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// AccountGetWallPapersRequest represents TL type `account.getWallPapers#aabb1763`. +// AccountGetWallPapersRequest represents TL type `account.getWallPapers#7967d36`. // Returns a list of available wallpapers. // // See https://core.telegram.org/method/account.getWallPapers for reference. @@ -38,11 +38,11 @@ type AccountGetWallPapersRequest struct { // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation - Hash int + Hash int64 } // AccountGetWallPapersRequestTypeID is TL type id of AccountGetWallPapersRequest. -const AccountGetWallPapersRequestTypeID = 0xaabb1763 +const AccountGetWallPapersRequestTypeID = 0x7967d36 // Ensuring interfaces in compile-time for AccountGetWallPapersRequest. var ( @@ -74,7 +74,7 @@ func (g *AccountGetWallPapersRequest) String() string { // FillFrom fills AccountGetWallPapersRequest from given interface. func (g *AccountGetWallPapersRequest) FillFrom(from interface { - GetHash() (value int) + GetHash() (value int64) }) { g.Hash = from.GetHash() } @@ -113,7 +113,7 @@ func (g *AccountGetWallPapersRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (g *AccountGetWallPapersRequest) Encode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode account.getWallPapers#aabb1763 as nil") + return fmt.Errorf("can't encode account.getWallPapers#7967d36 as nil") } b.PutID(AccountGetWallPapersRequestTypeID) return g.EncodeBare(b) @@ -122,19 +122,19 @@ func (g *AccountGetWallPapersRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (g *AccountGetWallPapersRequest) EncodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode account.getWallPapers#aabb1763 as nil") + return fmt.Errorf("can't encode account.getWallPapers#7967d36 as nil") } - b.PutInt(g.Hash) + b.PutLong(g.Hash) return nil } // Decode implements bin.Decoder. func (g *AccountGetWallPapersRequest) Decode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode account.getWallPapers#aabb1763 to nil") + return fmt.Errorf("can't decode account.getWallPapers#7967d36 to nil") } if err := b.ConsumeID(AccountGetWallPapersRequestTypeID); err != nil { - return fmt.Errorf("unable to decode account.getWallPapers#aabb1763: %w", err) + return fmt.Errorf("unable to decode account.getWallPapers#7967d36: %w", err) } return g.DecodeBare(b) } @@ -142,12 +142,12 @@ func (g *AccountGetWallPapersRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (g *AccountGetWallPapersRequest) DecodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode account.getWallPapers#aabb1763 to nil") + return fmt.Errorf("can't decode account.getWallPapers#7967d36 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode account.getWallPapers#aabb1763: field hash: %w", err) + return fmt.Errorf("unable to decode account.getWallPapers#7967d36: field hash: %w", err) } g.Hash = value } @@ -155,15 +155,15 @@ func (g *AccountGetWallPapersRequest) DecodeBare(b *bin.Buffer) error { } // GetHash returns value of Hash field. -func (g *AccountGetWallPapersRequest) GetHash() (value int) { +func (g *AccountGetWallPapersRequest) GetHash() (value int64) { return g.Hash } -// AccountGetWallPapers invokes method account.getWallPapers#aabb1763 returning error if any. +// AccountGetWallPapers invokes method account.getWallPapers#7967d36 returning error if any. // Returns a list of available wallpapers. // // See https://core.telegram.org/method/account.getWallPapers for reference. -func (c *Client) AccountGetWallPapers(ctx context.Context, hash int) (AccountWallPapersClass, error) { +func (c *Client) AccountGetWallPapers(ctx context.Context, hash int64) (AccountWallPapersClass, error) { var result AccountWallPapersBox request := &AccountGetWallPapersRequest{ diff --git a/tg/tl_account_register_device_gen.go b/tg/tl_account_register_device_gen.go index 431fc15d65..a3dd4d023b 100644 --- a/tg/tl_account_register_device_gen.go +++ b/tg/tl_account_register_device_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// AccountRegisterDeviceRequest represents TL type `account.registerDevice#68976c6f`. +// AccountRegisterDeviceRequest represents TL type `account.registerDevice#ec86017a`. // Register device to receive PUSH notifications¹ // // Links: @@ -66,11 +66,11 @@ type AccountRegisterDeviceRequest struct { // For FCM and APNS VoIP, optional encryption key used to encrypt push notifications Secret []byte // List of user identifiers of other users currently using the client - OtherUIDs []int + OtherUIDs []int64 } // AccountRegisterDeviceRequestTypeID is TL type id of AccountRegisterDeviceRequest. -const AccountRegisterDeviceRequestTypeID = 0x68976c6f +const AccountRegisterDeviceRequestTypeID = 0xec86017a // Ensuring interfaces in compile-time for AccountRegisterDeviceRequest. var ( @@ -125,7 +125,7 @@ func (r *AccountRegisterDeviceRequest) FillFrom(from interface { GetToken() (value string) GetAppSandbox() (value bool) GetSecret() (value []byte) - GetOtherUIDs() (value []int) + GetOtherUIDs() (value []int64) }) { r.NoMuted = from.GetNoMuted() r.TokenType = from.GetTokenType() @@ -190,7 +190,7 @@ func (r *AccountRegisterDeviceRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (r *AccountRegisterDeviceRequest) Encode(b *bin.Buffer) error { if r == nil { - return fmt.Errorf("can't encode account.registerDevice#68976c6f as nil") + return fmt.Errorf("can't encode account.registerDevice#ec86017a as nil") } b.PutID(AccountRegisterDeviceRequestTypeID) return r.EncodeBare(b) @@ -199,13 +199,13 @@ func (r *AccountRegisterDeviceRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (r *AccountRegisterDeviceRequest) EncodeBare(b *bin.Buffer) error { if r == nil { - return fmt.Errorf("can't encode account.registerDevice#68976c6f as nil") + return fmt.Errorf("can't encode account.registerDevice#ec86017a as nil") } if !(r.NoMuted == false) { r.Flags.Set(0) } if err := r.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode account.registerDevice#68976c6f: field flags: %w", err) + return fmt.Errorf("unable to encode account.registerDevice#ec86017a: field flags: %w", err) } b.PutInt(r.TokenType) b.PutString(r.Token) @@ -213,7 +213,7 @@ func (r *AccountRegisterDeviceRequest) EncodeBare(b *bin.Buffer) error { b.PutBytes(r.Secret) b.PutVectorHeader(len(r.OtherUIDs)) for _, v := range r.OtherUIDs { - b.PutInt(v) + b.PutLong(v) } return nil } @@ -221,10 +221,10 @@ func (r *AccountRegisterDeviceRequest) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (r *AccountRegisterDeviceRequest) Decode(b *bin.Buffer) error { if r == nil { - return fmt.Errorf("can't decode account.registerDevice#68976c6f to nil") + return fmt.Errorf("can't decode account.registerDevice#ec86017a to nil") } if err := b.ConsumeID(AccountRegisterDeviceRequestTypeID); err != nil { - return fmt.Errorf("unable to decode account.registerDevice#68976c6f: %w", err) + return fmt.Errorf("unable to decode account.registerDevice#ec86017a: %w", err) } return r.DecodeBare(b) } @@ -232,55 +232,55 @@ func (r *AccountRegisterDeviceRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (r *AccountRegisterDeviceRequest) DecodeBare(b *bin.Buffer) error { if r == nil { - return fmt.Errorf("can't decode account.registerDevice#68976c6f to nil") + return fmt.Errorf("can't decode account.registerDevice#ec86017a to nil") } { if err := r.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode account.registerDevice#68976c6f: field flags: %w", err) + return fmt.Errorf("unable to decode account.registerDevice#ec86017a: field flags: %w", err) } } r.NoMuted = r.Flags.Has(0) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode account.registerDevice#68976c6f: field token_type: %w", err) + return fmt.Errorf("unable to decode account.registerDevice#ec86017a: field token_type: %w", err) } r.TokenType = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode account.registerDevice#68976c6f: field token: %w", err) + return fmt.Errorf("unable to decode account.registerDevice#ec86017a: field token: %w", err) } r.Token = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode account.registerDevice#68976c6f: field app_sandbox: %w", err) + return fmt.Errorf("unable to decode account.registerDevice#ec86017a: field app_sandbox: %w", err) } r.AppSandbox = value } { value, err := b.Bytes() if err != nil { - return fmt.Errorf("unable to decode account.registerDevice#68976c6f: field secret: %w", err) + return fmt.Errorf("unable to decode account.registerDevice#ec86017a: field secret: %w", err) } r.Secret = value } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode account.registerDevice#68976c6f: field other_uids: %w", err) + return fmt.Errorf("unable to decode account.registerDevice#ec86017a: field other_uids: %w", err) } if headerLen > 0 { - r.OtherUIDs = make([]int, 0, headerLen%bin.PreallocateLimit) + r.OtherUIDs = make([]int64, 0, headerLen%bin.PreallocateLimit) } for idx := 0; idx < headerLen; idx++ { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode account.registerDevice#68976c6f: field other_uids: %w", err) + return fmt.Errorf("unable to decode account.registerDevice#ec86017a: field other_uids: %w", err) } r.OtherUIDs = append(r.OtherUIDs, value) } @@ -325,11 +325,11 @@ func (r *AccountRegisterDeviceRequest) GetSecret() (value []byte) { } // GetOtherUIDs returns value of OtherUIDs field. -func (r *AccountRegisterDeviceRequest) GetOtherUIDs() (value []int) { +func (r *AccountRegisterDeviceRequest) GetOtherUIDs() (value []int64) { return r.OtherUIDs } -// AccountRegisterDevice invokes method account.registerDevice#68976c6f returning error if any. +// AccountRegisterDevice invokes method account.registerDevice#ec86017a returning error if any. // Register device to receive PUSH notifications¹ // // Links: diff --git a/tg/tl_account_themes_gen.go b/tg/tl_account_themes_gen.go index f78e0ecdef..2fc857e3a0 100644 --- a/tg/tl_account_themes_gen.go +++ b/tg/tl_account_themes_gen.go @@ -131,7 +131,7 @@ func (t *AccountThemesNotModified) DecodeBare(b *bin.Buffer) error { return nil } -// AccountThemes represents TL type `account.themes#7f676421`. +// AccountThemes represents TL type `account.themes#9a3d8c6d`. // Installed themes // // See https://core.telegram.org/constructor/account.themes for reference. @@ -140,13 +140,13 @@ type AccountThemes struct { // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation - Hash int + Hash int64 // Themes Themes []Theme } // AccountThemesTypeID is TL type id of AccountThemes. -const AccountThemesTypeID = 0x7f676421 +const AccountThemesTypeID = 0x9a3d8c6d // construct implements constructor of AccountThemesClass. func (t AccountThemes) construct() AccountThemesClass { return &t } @@ -186,7 +186,7 @@ func (t *AccountThemes) String() string { // FillFrom fills AccountThemes from given interface. func (t *AccountThemes) FillFrom(from interface { - GetHash() (value int) + GetHash() (value int64) GetThemes() (value []Theme) }) { t.Hash = from.GetHash() @@ -231,7 +231,7 @@ func (t *AccountThemes) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (t *AccountThemes) Encode(b *bin.Buffer) error { if t == nil { - return fmt.Errorf("can't encode account.themes#7f676421 as nil") + return fmt.Errorf("can't encode account.themes#9a3d8c6d as nil") } b.PutID(AccountThemesTypeID) return t.EncodeBare(b) @@ -240,13 +240,13 @@ func (t *AccountThemes) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (t *AccountThemes) EncodeBare(b *bin.Buffer) error { if t == nil { - return fmt.Errorf("can't encode account.themes#7f676421 as nil") + return fmt.Errorf("can't encode account.themes#9a3d8c6d as nil") } - b.PutInt(t.Hash) + b.PutLong(t.Hash) b.PutVectorHeader(len(t.Themes)) for idx, v := range t.Themes { if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode account.themes#7f676421: field themes element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode account.themes#9a3d8c6d: field themes element with index %d: %w", idx, err) } } return nil @@ -255,10 +255,10 @@ func (t *AccountThemes) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (t *AccountThemes) Decode(b *bin.Buffer) error { if t == nil { - return fmt.Errorf("can't decode account.themes#7f676421 to nil") + return fmt.Errorf("can't decode account.themes#9a3d8c6d to nil") } if err := b.ConsumeID(AccountThemesTypeID); err != nil { - return fmt.Errorf("unable to decode account.themes#7f676421: %w", err) + return fmt.Errorf("unable to decode account.themes#9a3d8c6d: %w", err) } return t.DecodeBare(b) } @@ -266,19 +266,19 @@ func (t *AccountThemes) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (t *AccountThemes) DecodeBare(b *bin.Buffer) error { if t == nil { - return fmt.Errorf("can't decode account.themes#7f676421 to nil") + return fmt.Errorf("can't decode account.themes#9a3d8c6d to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode account.themes#7f676421: field hash: %w", err) + return fmt.Errorf("unable to decode account.themes#9a3d8c6d: field hash: %w", err) } t.Hash = value } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode account.themes#7f676421: field themes: %w", err) + return fmt.Errorf("unable to decode account.themes#9a3d8c6d: field themes: %w", err) } if headerLen > 0 { @@ -287,7 +287,7 @@ func (t *AccountThemes) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { var value Theme if err := value.Decode(b); err != nil { - return fmt.Errorf("unable to decode account.themes#7f676421: field themes: %w", err) + return fmt.Errorf("unable to decode account.themes#9a3d8c6d: field themes: %w", err) } t.Themes = append(t.Themes, value) } @@ -296,7 +296,7 @@ func (t *AccountThemes) DecodeBare(b *bin.Buffer) error { } // GetHash returns value of Hash field. -func (t *AccountThemes) GetHash() (value int) { +func (t *AccountThemes) GetHash() (value int64) { return t.Hash } @@ -316,7 +316,7 @@ func (t *AccountThemes) GetThemes() (value []Theme) { // } // switch v := g.(type) { // case *tg.AccountThemesNotModified: // account.themesNotModified#f41eb622 -// case *tg.AccountThemes: // account.themes#7f676421 +// case *tg.AccountThemes: // account.themes#9a3d8c6d // default: panic(v) // } type AccountThemesClass interface { @@ -366,7 +366,7 @@ func DecodeAccountThemes(buf *bin.Buffer) (AccountThemesClass, error) { } return &v, nil case AccountThemesTypeID: - // Decoding account.themes#7f676421. + // Decoding account.themes#9a3d8c6d. v := AccountThemes{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode AccountThemesClass: %w", err) diff --git a/tg/tl_account_unregister_device_gen.go b/tg/tl_account_unregister_device_gen.go index 5959f4d1db..bc7c2dced3 100644 --- a/tg/tl_account_unregister_device_gen.go +++ b/tg/tl_account_unregister_device_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// AccountUnregisterDeviceRequest represents TL type `account.unregisterDevice#3076c4bf`. +// AccountUnregisterDeviceRequest represents TL type `account.unregisterDevice#6a0d3206`. // Deletes a device by its token, stops sending PUSH-notifications to it. // // See https://core.telegram.org/method/account.unregisterDevice for reference. @@ -48,11 +48,11 @@ type AccountUnregisterDeviceRequest struct { // Device token Token string // List of user identifiers of other users currently using the client - OtherUIDs []int + OtherUIDs []int64 } // AccountUnregisterDeviceRequestTypeID is TL type id of AccountUnregisterDeviceRequest. -const AccountUnregisterDeviceRequestTypeID = 0x3076c4bf +const AccountUnregisterDeviceRequestTypeID = 0x6a0d3206 // Ensuring interfaces in compile-time for AccountUnregisterDeviceRequest. var ( @@ -92,7 +92,7 @@ func (u *AccountUnregisterDeviceRequest) String() string { func (u *AccountUnregisterDeviceRequest) FillFrom(from interface { GetTokenType() (value int) GetToken() (value string) - GetOtherUIDs() (value []int) + GetOtherUIDs() (value []int64) }) { u.TokenType = from.GetTokenType() u.Token = from.GetToken() @@ -141,7 +141,7 @@ func (u *AccountUnregisterDeviceRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *AccountUnregisterDeviceRequest) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode account.unregisterDevice#3076c4bf as nil") + return fmt.Errorf("can't encode account.unregisterDevice#6a0d3206 as nil") } b.PutID(AccountUnregisterDeviceRequestTypeID) return u.EncodeBare(b) @@ -150,13 +150,13 @@ func (u *AccountUnregisterDeviceRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *AccountUnregisterDeviceRequest) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode account.unregisterDevice#3076c4bf as nil") + return fmt.Errorf("can't encode account.unregisterDevice#6a0d3206 as nil") } b.PutInt(u.TokenType) b.PutString(u.Token) b.PutVectorHeader(len(u.OtherUIDs)) for _, v := range u.OtherUIDs { - b.PutInt(v) + b.PutLong(v) } return nil } @@ -164,10 +164,10 @@ func (u *AccountUnregisterDeviceRequest) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *AccountUnregisterDeviceRequest) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode account.unregisterDevice#3076c4bf to nil") + return fmt.Errorf("can't decode account.unregisterDevice#6a0d3206 to nil") } if err := b.ConsumeID(AccountUnregisterDeviceRequestTypeID); err != nil { - return fmt.Errorf("unable to decode account.unregisterDevice#3076c4bf: %w", err) + return fmt.Errorf("unable to decode account.unregisterDevice#6a0d3206: %w", err) } return u.DecodeBare(b) } @@ -175,35 +175,35 @@ func (u *AccountUnregisterDeviceRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *AccountUnregisterDeviceRequest) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode account.unregisterDevice#3076c4bf to nil") + return fmt.Errorf("can't decode account.unregisterDevice#6a0d3206 to nil") } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode account.unregisterDevice#3076c4bf: field token_type: %w", err) + return fmt.Errorf("unable to decode account.unregisterDevice#6a0d3206: field token_type: %w", err) } u.TokenType = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode account.unregisterDevice#3076c4bf: field token: %w", err) + return fmt.Errorf("unable to decode account.unregisterDevice#6a0d3206: field token: %w", err) } u.Token = value } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode account.unregisterDevice#3076c4bf: field other_uids: %w", err) + return fmt.Errorf("unable to decode account.unregisterDevice#6a0d3206: field other_uids: %w", err) } if headerLen > 0 { - u.OtherUIDs = make([]int, 0, headerLen%bin.PreallocateLimit) + u.OtherUIDs = make([]int64, 0, headerLen%bin.PreallocateLimit) } for idx := 0; idx < headerLen; idx++ { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode account.unregisterDevice#3076c4bf: field other_uids: %w", err) + return fmt.Errorf("unable to decode account.unregisterDevice#6a0d3206: field other_uids: %w", err) } u.OtherUIDs = append(u.OtherUIDs, value) } @@ -222,11 +222,11 @@ func (u *AccountUnregisterDeviceRequest) GetToken() (value string) { } // GetOtherUIDs returns value of OtherUIDs field. -func (u *AccountUnregisterDeviceRequest) GetOtherUIDs() (value []int) { +func (u *AccountUnregisterDeviceRequest) GetOtherUIDs() (value []int64) { return u.OtherUIDs } -// AccountUnregisterDevice invokes method account.unregisterDevice#3076c4bf returning error if any. +// AccountUnregisterDevice invokes method account.unregisterDevice#6a0d3206 returning error if any. // Deletes a device by its token, stops sending PUSH-notifications to it. // // Possible errors: diff --git a/tg/tl_account_wall_papers_gen.go b/tg/tl_account_wall_papers_gen.go index 8b290162d9..4630e65b50 100644 --- a/tg/tl_account_wall_papers_gen.go +++ b/tg/tl_account_wall_papers_gen.go @@ -131,7 +131,7 @@ func (w *AccountWallPapersNotModified) DecodeBare(b *bin.Buffer) error { return nil } -// AccountWallPapers represents TL type `account.wallPapers#702b65a9`. +// AccountWallPapers represents TL type `account.wallPapers#cdc3858c`. // Installed wallpapers // // See https://core.telegram.org/constructor/account.wallPapers for reference. @@ -140,13 +140,13 @@ type AccountWallPapers struct { // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation - Hash int + Hash int64 // Wallpapers Wallpapers []WallPaperClass } // AccountWallPapersTypeID is TL type id of AccountWallPapers. -const AccountWallPapersTypeID = 0x702b65a9 +const AccountWallPapersTypeID = 0xcdc3858c // construct implements constructor of AccountWallPapersClass. func (w AccountWallPapers) construct() AccountWallPapersClass { return &w } @@ -186,7 +186,7 @@ func (w *AccountWallPapers) String() string { // FillFrom fills AccountWallPapers from given interface. func (w *AccountWallPapers) FillFrom(from interface { - GetHash() (value int) + GetHash() (value int64) GetWallpapers() (value []WallPaperClass) }) { w.Hash = from.GetHash() @@ -231,7 +231,7 @@ func (w *AccountWallPapers) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (w *AccountWallPapers) Encode(b *bin.Buffer) error { if w == nil { - return fmt.Errorf("can't encode account.wallPapers#702b65a9 as nil") + return fmt.Errorf("can't encode account.wallPapers#cdc3858c as nil") } b.PutID(AccountWallPapersTypeID) return w.EncodeBare(b) @@ -240,16 +240,16 @@ func (w *AccountWallPapers) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (w *AccountWallPapers) EncodeBare(b *bin.Buffer) error { if w == nil { - return fmt.Errorf("can't encode account.wallPapers#702b65a9 as nil") + return fmt.Errorf("can't encode account.wallPapers#cdc3858c as nil") } - b.PutInt(w.Hash) + b.PutLong(w.Hash) b.PutVectorHeader(len(w.Wallpapers)) for idx, v := range w.Wallpapers { if v == nil { - return fmt.Errorf("unable to encode account.wallPapers#702b65a9: field wallpapers element with index %d is nil", idx) + return fmt.Errorf("unable to encode account.wallPapers#cdc3858c: field wallpapers element with index %d is nil", idx) } if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode account.wallPapers#702b65a9: field wallpapers element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode account.wallPapers#cdc3858c: field wallpapers element with index %d: %w", idx, err) } } return nil @@ -258,10 +258,10 @@ func (w *AccountWallPapers) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (w *AccountWallPapers) Decode(b *bin.Buffer) error { if w == nil { - return fmt.Errorf("can't decode account.wallPapers#702b65a9 to nil") + return fmt.Errorf("can't decode account.wallPapers#cdc3858c to nil") } if err := b.ConsumeID(AccountWallPapersTypeID); err != nil { - return fmt.Errorf("unable to decode account.wallPapers#702b65a9: %w", err) + return fmt.Errorf("unable to decode account.wallPapers#cdc3858c: %w", err) } return w.DecodeBare(b) } @@ -269,19 +269,19 @@ func (w *AccountWallPapers) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (w *AccountWallPapers) DecodeBare(b *bin.Buffer) error { if w == nil { - return fmt.Errorf("can't decode account.wallPapers#702b65a9 to nil") + return fmt.Errorf("can't decode account.wallPapers#cdc3858c to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode account.wallPapers#702b65a9: field hash: %w", err) + return fmt.Errorf("unable to decode account.wallPapers#cdc3858c: field hash: %w", err) } w.Hash = value } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode account.wallPapers#702b65a9: field wallpapers: %w", err) + return fmt.Errorf("unable to decode account.wallPapers#cdc3858c: field wallpapers: %w", err) } if headerLen > 0 { @@ -290,7 +290,7 @@ func (w *AccountWallPapers) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := DecodeWallPaper(b) if err != nil { - return fmt.Errorf("unable to decode account.wallPapers#702b65a9: field wallpapers: %w", err) + return fmt.Errorf("unable to decode account.wallPapers#cdc3858c: field wallpapers: %w", err) } w.Wallpapers = append(w.Wallpapers, value) } @@ -299,7 +299,7 @@ func (w *AccountWallPapers) DecodeBare(b *bin.Buffer) error { } // GetHash returns value of Hash field. -func (w *AccountWallPapers) GetHash() (value int) { +func (w *AccountWallPapers) GetHash() (value int64) { return w.Hash } @@ -324,7 +324,7 @@ func (w *AccountWallPapers) MapWallpapers() (value WallPaperClassArray) { // } // switch v := g.(type) { // case *tg.AccountWallPapersNotModified: // account.wallPapersNotModified#1c199183 -// case *tg.AccountWallPapers: // account.wallPapers#702b65a9 +// case *tg.AccountWallPapers: // account.wallPapers#cdc3858c // default: panic(v) // } type AccountWallPapersClass interface { @@ -374,7 +374,7 @@ func DecodeAccountWallPapers(buf *bin.Buffer) (AccountWallPapersClass, error) { } return &v, nil case AccountWallPapersTypeID: - // Decoding account.wallPapers#702b65a9. + // Decoding account.wallPapers#cdc3858c. v := AccountWallPapers{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode AccountWallPapersClass: %w", err) diff --git a/tg/tl_auth_export_login_token_gen.go b/tg/tl_auth_export_login_token_gen.go index 755f8d9c13..4c4a6c201e 100644 --- a/tg/tl_auth_export_login_token_gen.go +++ b/tg/tl_auth_export_login_token_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// AuthExportLoginTokenRequest represents TL type `auth.exportLoginToken#b1b41517`. +// AuthExportLoginTokenRequest represents TL type `auth.exportLoginToken#b7e085fe`. // Generate a login token, for login via QR code¹. // The generated login token should be encoded using base64url, then shown as a // tg://login?token=base64encodedtoken URL in the QR code. @@ -52,11 +52,11 @@ type AuthExportLoginTokenRequest struct { // 1) https://core.telegram.org/myapp APIHash string // List of already logged-in user IDs, to prevent logging in twice with the same user - ExceptIDs []int + ExceptIDs []int64 } // AuthExportLoginTokenRequestTypeID is TL type id of AuthExportLoginTokenRequest. -const AuthExportLoginTokenRequestTypeID = 0xb1b41517 +const AuthExportLoginTokenRequestTypeID = 0xb7e085fe // Ensuring interfaces in compile-time for AuthExportLoginTokenRequest. var ( @@ -96,7 +96,7 @@ func (e *AuthExportLoginTokenRequest) String() string { func (e *AuthExportLoginTokenRequest) FillFrom(from interface { GetAPIID() (value int) GetAPIHash() (value string) - GetExceptIDs() (value []int) + GetExceptIDs() (value []int64) }) { e.APIID = from.GetAPIID() e.APIHash = from.GetAPIHash() @@ -145,7 +145,7 @@ func (e *AuthExportLoginTokenRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (e *AuthExportLoginTokenRequest) Encode(b *bin.Buffer) error { if e == nil { - return fmt.Errorf("can't encode auth.exportLoginToken#b1b41517 as nil") + return fmt.Errorf("can't encode auth.exportLoginToken#b7e085fe as nil") } b.PutID(AuthExportLoginTokenRequestTypeID) return e.EncodeBare(b) @@ -154,13 +154,13 @@ func (e *AuthExportLoginTokenRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (e *AuthExportLoginTokenRequest) EncodeBare(b *bin.Buffer) error { if e == nil { - return fmt.Errorf("can't encode auth.exportLoginToken#b1b41517 as nil") + return fmt.Errorf("can't encode auth.exportLoginToken#b7e085fe as nil") } b.PutInt(e.APIID) b.PutString(e.APIHash) b.PutVectorHeader(len(e.ExceptIDs)) for _, v := range e.ExceptIDs { - b.PutInt(v) + b.PutLong(v) } return nil } @@ -168,10 +168,10 @@ func (e *AuthExportLoginTokenRequest) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (e *AuthExportLoginTokenRequest) Decode(b *bin.Buffer) error { if e == nil { - return fmt.Errorf("can't decode auth.exportLoginToken#b1b41517 to nil") + return fmt.Errorf("can't decode auth.exportLoginToken#b7e085fe to nil") } if err := b.ConsumeID(AuthExportLoginTokenRequestTypeID); err != nil { - return fmt.Errorf("unable to decode auth.exportLoginToken#b1b41517: %w", err) + return fmt.Errorf("unable to decode auth.exportLoginToken#b7e085fe: %w", err) } return e.DecodeBare(b) } @@ -179,35 +179,35 @@ func (e *AuthExportLoginTokenRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (e *AuthExportLoginTokenRequest) DecodeBare(b *bin.Buffer) error { if e == nil { - return fmt.Errorf("can't decode auth.exportLoginToken#b1b41517 to nil") + return fmt.Errorf("can't decode auth.exportLoginToken#b7e085fe to nil") } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode auth.exportLoginToken#b1b41517: field api_id: %w", err) + return fmt.Errorf("unable to decode auth.exportLoginToken#b7e085fe: field api_id: %w", err) } e.APIID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode auth.exportLoginToken#b1b41517: field api_hash: %w", err) + return fmt.Errorf("unable to decode auth.exportLoginToken#b7e085fe: field api_hash: %w", err) } e.APIHash = value } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode auth.exportLoginToken#b1b41517: field except_ids: %w", err) + return fmt.Errorf("unable to decode auth.exportLoginToken#b7e085fe: field except_ids: %w", err) } if headerLen > 0 { - e.ExceptIDs = make([]int, 0, headerLen%bin.PreallocateLimit) + e.ExceptIDs = make([]int64, 0, headerLen%bin.PreallocateLimit) } for idx := 0; idx < headerLen; idx++ { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode auth.exportLoginToken#b1b41517: field except_ids: %w", err) + return fmt.Errorf("unable to decode auth.exportLoginToken#b7e085fe: field except_ids: %w", err) } e.ExceptIDs = append(e.ExceptIDs, value) } @@ -226,11 +226,11 @@ func (e *AuthExportLoginTokenRequest) GetAPIHash() (value string) { } // GetExceptIDs returns value of ExceptIDs field. -func (e *AuthExportLoginTokenRequest) GetExceptIDs() (value []int) { +func (e *AuthExportLoginTokenRequest) GetExceptIDs() (value []int64) { return e.ExceptIDs } -// AuthExportLoginToken invokes method auth.exportLoginToken#b1b41517 returning error if any. +// AuthExportLoginToken invokes method auth.exportLoginToken#b7e085fe returning error if any. // Generate a login token, for login via QR code¹. // The generated login token should be encoded using base64url, then shown as a // tg://login?token=base64encodedtoken URL in the QR code. diff --git a/tg/tl_auth_exported_authorization_gen.go b/tg/tl_auth_exported_authorization_gen.go index 7999e5c4a8..ddca39ed19 100644 --- a/tg/tl_auth_exported_authorization_gen.go +++ b/tg/tl_auth_exported_authorization_gen.go @@ -29,19 +29,19 @@ var ( _ = tgerr.Error{} ) -// AuthExportedAuthorization represents TL type `auth.exportedAuthorization#df969c2d`. +// AuthExportedAuthorization represents TL type `auth.exportedAuthorization#b434e2b8`. // Data for copying of authorization between data centres. // // See https://core.telegram.org/constructor/auth.exportedAuthorization for reference. type AuthExportedAuthorization struct { // current user identifier - ID int + ID int64 // authorizes key Bytes []byte } // AuthExportedAuthorizationTypeID is TL type id of AuthExportedAuthorization. -const AuthExportedAuthorizationTypeID = 0xdf969c2d +const AuthExportedAuthorizationTypeID = 0xb434e2b8 // Ensuring interfaces in compile-time for AuthExportedAuthorization. var ( @@ -76,7 +76,7 @@ func (e *AuthExportedAuthorization) String() string { // FillFrom fills AuthExportedAuthorization from given interface. func (e *AuthExportedAuthorization) FillFrom(from interface { - GetID() (value int) + GetID() (value int64) GetBytes() (value []byte) }) { e.ID = from.GetID() @@ -121,7 +121,7 @@ func (e *AuthExportedAuthorization) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (e *AuthExportedAuthorization) Encode(b *bin.Buffer) error { if e == nil { - return fmt.Errorf("can't encode auth.exportedAuthorization#df969c2d as nil") + return fmt.Errorf("can't encode auth.exportedAuthorization#b434e2b8 as nil") } b.PutID(AuthExportedAuthorizationTypeID) return e.EncodeBare(b) @@ -130,9 +130,9 @@ func (e *AuthExportedAuthorization) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (e *AuthExportedAuthorization) EncodeBare(b *bin.Buffer) error { if e == nil { - return fmt.Errorf("can't encode auth.exportedAuthorization#df969c2d as nil") + return fmt.Errorf("can't encode auth.exportedAuthorization#b434e2b8 as nil") } - b.PutInt(e.ID) + b.PutLong(e.ID) b.PutBytes(e.Bytes) return nil } @@ -140,10 +140,10 @@ func (e *AuthExportedAuthorization) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (e *AuthExportedAuthorization) Decode(b *bin.Buffer) error { if e == nil { - return fmt.Errorf("can't decode auth.exportedAuthorization#df969c2d to nil") + return fmt.Errorf("can't decode auth.exportedAuthorization#b434e2b8 to nil") } if err := b.ConsumeID(AuthExportedAuthorizationTypeID); err != nil { - return fmt.Errorf("unable to decode auth.exportedAuthorization#df969c2d: %w", err) + return fmt.Errorf("unable to decode auth.exportedAuthorization#b434e2b8: %w", err) } return e.DecodeBare(b) } @@ -151,19 +151,19 @@ func (e *AuthExportedAuthorization) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (e *AuthExportedAuthorization) DecodeBare(b *bin.Buffer) error { if e == nil { - return fmt.Errorf("can't decode auth.exportedAuthorization#df969c2d to nil") + return fmt.Errorf("can't decode auth.exportedAuthorization#b434e2b8 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode auth.exportedAuthorization#df969c2d: field id: %w", err) + return fmt.Errorf("unable to decode auth.exportedAuthorization#b434e2b8: field id: %w", err) } e.ID = value } { value, err := b.Bytes() if err != nil { - return fmt.Errorf("unable to decode auth.exportedAuthorization#df969c2d: field bytes: %w", err) + return fmt.Errorf("unable to decode auth.exportedAuthorization#b434e2b8: field bytes: %w", err) } e.Bytes = value } @@ -171,7 +171,7 @@ func (e *AuthExportedAuthorization) DecodeBare(b *bin.Buffer) error { } // GetID returns value of ID field. -func (e *AuthExportedAuthorization) GetID() (value int) { +func (e *AuthExportedAuthorization) GetID() (value int64) { return e.ID } diff --git a/tg/tl_auth_import_authorization_gen.go b/tg/tl_auth_import_authorization_gen.go index 51e739f5c5..430e34f59f 100644 --- a/tg/tl_auth_import_authorization_gen.go +++ b/tg/tl_auth_import_authorization_gen.go @@ -29,19 +29,19 @@ var ( _ = tgerr.Error{} ) -// AuthImportAuthorizationRequest represents TL type `auth.importAuthorization#e3ef9613`. +// AuthImportAuthorizationRequest represents TL type `auth.importAuthorization#a57a7dad`. // Logs in a user using a key transmitted from his native data-centre. // // See https://core.telegram.org/method/auth.importAuthorization for reference. type AuthImportAuthorizationRequest struct { // User ID - ID int + ID int64 // Authorization key Bytes []byte } // AuthImportAuthorizationRequestTypeID is TL type id of AuthImportAuthorizationRequest. -const AuthImportAuthorizationRequestTypeID = 0xe3ef9613 +const AuthImportAuthorizationRequestTypeID = 0xa57a7dad // Ensuring interfaces in compile-time for AuthImportAuthorizationRequest. var ( @@ -76,7 +76,7 @@ func (i *AuthImportAuthorizationRequest) String() string { // FillFrom fills AuthImportAuthorizationRequest from given interface. func (i *AuthImportAuthorizationRequest) FillFrom(from interface { - GetID() (value int) + GetID() (value int64) GetBytes() (value []byte) }) { i.ID = from.GetID() @@ -121,7 +121,7 @@ func (i *AuthImportAuthorizationRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (i *AuthImportAuthorizationRequest) Encode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode auth.importAuthorization#e3ef9613 as nil") + return fmt.Errorf("can't encode auth.importAuthorization#a57a7dad as nil") } b.PutID(AuthImportAuthorizationRequestTypeID) return i.EncodeBare(b) @@ -130,9 +130,9 @@ func (i *AuthImportAuthorizationRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (i *AuthImportAuthorizationRequest) EncodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode auth.importAuthorization#e3ef9613 as nil") + return fmt.Errorf("can't encode auth.importAuthorization#a57a7dad as nil") } - b.PutInt(i.ID) + b.PutLong(i.ID) b.PutBytes(i.Bytes) return nil } @@ -140,10 +140,10 @@ func (i *AuthImportAuthorizationRequest) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (i *AuthImportAuthorizationRequest) Decode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode auth.importAuthorization#e3ef9613 to nil") + return fmt.Errorf("can't decode auth.importAuthorization#a57a7dad to nil") } if err := b.ConsumeID(AuthImportAuthorizationRequestTypeID); err != nil { - return fmt.Errorf("unable to decode auth.importAuthorization#e3ef9613: %w", err) + return fmt.Errorf("unable to decode auth.importAuthorization#a57a7dad: %w", err) } return i.DecodeBare(b) } @@ -151,19 +151,19 @@ func (i *AuthImportAuthorizationRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (i *AuthImportAuthorizationRequest) DecodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode auth.importAuthorization#e3ef9613 to nil") + return fmt.Errorf("can't decode auth.importAuthorization#a57a7dad to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode auth.importAuthorization#e3ef9613: field id: %w", err) + return fmt.Errorf("unable to decode auth.importAuthorization#a57a7dad: field id: %w", err) } i.ID = value } { value, err := b.Bytes() if err != nil { - return fmt.Errorf("unable to decode auth.importAuthorization#e3ef9613: field bytes: %w", err) + return fmt.Errorf("unable to decode auth.importAuthorization#a57a7dad: field bytes: %w", err) } i.Bytes = value } @@ -171,7 +171,7 @@ func (i *AuthImportAuthorizationRequest) DecodeBare(b *bin.Buffer) error { } // GetID returns value of ID field. -func (i *AuthImportAuthorizationRequest) GetID() (value int) { +func (i *AuthImportAuthorizationRequest) GetID() (value int64) { return i.ID } @@ -180,7 +180,7 @@ func (i *AuthImportAuthorizationRequest) GetBytes() (value []byte) { return i.Bytes } -// AuthImportAuthorization invokes method auth.importAuthorization#e3ef9613 returning error if any. +// AuthImportAuthorization invokes method auth.importAuthorization#a57a7dad returning error if any. // Logs in a user using a key transmitted from his native data-centre. // // Possible errors: diff --git a/tg/tl_bot_info_gen.go b/tg/tl_bot_info_gen.go index 85aace42be..e9f4b428bc 100644 --- a/tg/tl_bot_info_gen.go +++ b/tg/tl_bot_info_gen.go @@ -29,13 +29,13 @@ var ( _ = tgerr.Error{} ) -// BotInfo represents TL type `botInfo#98e81d3a`. +// BotInfo represents TL type `botInfo#1b74b335`. // Info about bots (available bot commands, etc) // // See https://core.telegram.org/constructor/botInfo for reference. type BotInfo struct { // ID of the bot - UserID int + UserID int64 // Description of the bot Description string // Bot commands that can be used in the chat @@ -43,7 +43,7 @@ type BotInfo struct { } // BotInfoTypeID is TL type id of BotInfo. -const BotInfoTypeID = 0x98e81d3a +const BotInfoTypeID = 0x1b74b335 // Ensuring interfaces in compile-time for BotInfo. var ( @@ -81,7 +81,7 @@ func (b *BotInfo) String() string { // FillFrom fills BotInfo from given interface. func (b *BotInfo) FillFrom(from interface { - GetUserID() (value int) + GetUserID() (value int64) GetDescription() (value string) GetCommands() (value []BotCommand) }) { @@ -132,7 +132,7 @@ func (b *BotInfo) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (b *BotInfo) Encode(buf *bin.Buffer) error { if b == nil { - return fmt.Errorf("can't encode botInfo#98e81d3a as nil") + return fmt.Errorf("can't encode botInfo#1b74b335 as nil") } buf.PutID(BotInfoTypeID) return b.EncodeBare(buf) @@ -141,14 +141,14 @@ func (b *BotInfo) Encode(buf *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (b *BotInfo) EncodeBare(buf *bin.Buffer) error { if b == nil { - return fmt.Errorf("can't encode botInfo#98e81d3a as nil") + return fmt.Errorf("can't encode botInfo#1b74b335 as nil") } - buf.PutInt(b.UserID) + buf.PutLong(b.UserID) buf.PutString(b.Description) buf.PutVectorHeader(len(b.Commands)) for idx, v := range b.Commands { if err := v.Encode(buf); err != nil { - return fmt.Errorf("unable to encode botInfo#98e81d3a: field commands element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode botInfo#1b74b335: field commands element with index %d: %w", idx, err) } } return nil @@ -157,10 +157,10 @@ func (b *BotInfo) EncodeBare(buf *bin.Buffer) error { // Decode implements bin.Decoder. func (b *BotInfo) Decode(buf *bin.Buffer) error { if b == nil { - return fmt.Errorf("can't decode botInfo#98e81d3a to nil") + return fmt.Errorf("can't decode botInfo#1b74b335 to nil") } if err := buf.ConsumeID(BotInfoTypeID); err != nil { - return fmt.Errorf("unable to decode botInfo#98e81d3a: %w", err) + return fmt.Errorf("unable to decode botInfo#1b74b335: %w", err) } return b.DecodeBare(buf) } @@ -168,26 +168,26 @@ func (b *BotInfo) Decode(buf *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (b *BotInfo) DecodeBare(buf *bin.Buffer) error { if b == nil { - return fmt.Errorf("can't decode botInfo#98e81d3a to nil") + return fmt.Errorf("can't decode botInfo#1b74b335 to nil") } { - value, err := buf.Int() + value, err := buf.Long() if err != nil { - return fmt.Errorf("unable to decode botInfo#98e81d3a: field user_id: %w", err) + return fmt.Errorf("unable to decode botInfo#1b74b335: field user_id: %w", err) } b.UserID = value } { value, err := buf.String() if err != nil { - return fmt.Errorf("unable to decode botInfo#98e81d3a: field description: %w", err) + return fmt.Errorf("unable to decode botInfo#1b74b335: field description: %w", err) } b.Description = value } { headerLen, err := buf.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode botInfo#98e81d3a: field commands: %w", err) + return fmt.Errorf("unable to decode botInfo#1b74b335: field commands: %w", err) } if headerLen > 0 { @@ -196,7 +196,7 @@ func (b *BotInfo) DecodeBare(buf *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { var value BotCommand if err := value.Decode(buf); err != nil { - return fmt.Errorf("unable to decode botInfo#98e81d3a: field commands: %w", err) + return fmt.Errorf("unable to decode botInfo#1b74b335: field commands: %w", err) } b.Commands = append(b.Commands, value) } @@ -205,7 +205,7 @@ func (b *BotInfo) DecodeBare(buf *bin.Buffer) error { } // GetUserID returns value of UserID field. -func (b *BotInfo) GetUserID() (value int) { +func (b *BotInfo) GetUserID() (value int64) { return b.UserID } diff --git a/tg/tl_channel_admin_log_event_action_gen.go b/tg/tl_channel_admin_log_event_action_gen.go index 86f89077df..8dae1276a8 100644 --- a/tg/tl_channel_admin_log_event_action_gen.go +++ b/tg/tl_channel_admin_log_event_action_gen.go @@ -2674,19 +2674,19 @@ func (c *ChannelAdminLogEventActionStopPoll) GetMessage() (value MessageClass) { return c.Message } -// ChannelAdminLogEventActionChangeLinkedChat represents TL type `channelAdminLogEventActionChangeLinkedChat#a26f881b`. +// ChannelAdminLogEventActionChangeLinkedChat represents TL type `channelAdminLogEventActionChangeLinkedChat#50c7ac8`. // The linked chat was changed // // See https://core.telegram.org/constructor/channelAdminLogEventActionChangeLinkedChat for reference. type ChannelAdminLogEventActionChangeLinkedChat struct { // Previous linked chat - PrevValue int + PrevValue int64 // New linked chat - NewValue int + NewValue int64 } // ChannelAdminLogEventActionChangeLinkedChatTypeID is TL type id of ChannelAdminLogEventActionChangeLinkedChat. -const ChannelAdminLogEventActionChangeLinkedChatTypeID = 0xa26f881b +const ChannelAdminLogEventActionChangeLinkedChatTypeID = 0x50c7ac8 // construct implements constructor of ChannelAdminLogEventActionClass. func (c ChannelAdminLogEventActionChangeLinkedChat) construct() ChannelAdminLogEventActionClass { @@ -2728,8 +2728,8 @@ func (c *ChannelAdminLogEventActionChangeLinkedChat) String() string { // FillFrom fills ChannelAdminLogEventActionChangeLinkedChat from given interface. func (c *ChannelAdminLogEventActionChangeLinkedChat) FillFrom(from interface { - GetPrevValue() (value int) - GetNewValue() (value int) + GetPrevValue() (value int64) + GetNewValue() (value int64) }) { c.PrevValue = from.GetPrevValue() c.NewValue = from.GetNewValue() @@ -2773,7 +2773,7 @@ func (c *ChannelAdminLogEventActionChangeLinkedChat) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (c *ChannelAdminLogEventActionChangeLinkedChat) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode channelAdminLogEventActionChangeLinkedChat#a26f881b as nil") + return fmt.Errorf("can't encode channelAdminLogEventActionChangeLinkedChat#50c7ac8 as nil") } b.PutID(ChannelAdminLogEventActionChangeLinkedChatTypeID) return c.EncodeBare(b) @@ -2782,20 +2782,20 @@ func (c *ChannelAdminLogEventActionChangeLinkedChat) Encode(b *bin.Buffer) error // EncodeBare implements bin.BareEncoder. func (c *ChannelAdminLogEventActionChangeLinkedChat) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode channelAdminLogEventActionChangeLinkedChat#a26f881b as nil") + return fmt.Errorf("can't encode channelAdminLogEventActionChangeLinkedChat#50c7ac8 as nil") } - b.PutInt(c.PrevValue) - b.PutInt(c.NewValue) + b.PutLong(c.PrevValue) + b.PutLong(c.NewValue) return nil } // Decode implements bin.Decoder. func (c *ChannelAdminLogEventActionChangeLinkedChat) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode channelAdminLogEventActionChangeLinkedChat#a26f881b to nil") + return fmt.Errorf("can't decode channelAdminLogEventActionChangeLinkedChat#50c7ac8 to nil") } if err := b.ConsumeID(ChannelAdminLogEventActionChangeLinkedChatTypeID); err != nil { - return fmt.Errorf("unable to decode channelAdminLogEventActionChangeLinkedChat#a26f881b: %w", err) + return fmt.Errorf("unable to decode channelAdminLogEventActionChangeLinkedChat#50c7ac8: %w", err) } return c.DecodeBare(b) } @@ -2803,19 +2803,19 @@ func (c *ChannelAdminLogEventActionChangeLinkedChat) Decode(b *bin.Buffer) error // DecodeBare implements bin.BareDecoder. func (c *ChannelAdminLogEventActionChangeLinkedChat) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode channelAdminLogEventActionChangeLinkedChat#a26f881b to nil") + return fmt.Errorf("can't decode channelAdminLogEventActionChangeLinkedChat#50c7ac8 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode channelAdminLogEventActionChangeLinkedChat#a26f881b: field prev_value: %w", err) + return fmt.Errorf("unable to decode channelAdminLogEventActionChangeLinkedChat#50c7ac8: field prev_value: %w", err) } c.PrevValue = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode channelAdminLogEventActionChangeLinkedChat#a26f881b: field new_value: %w", err) + return fmt.Errorf("unable to decode channelAdminLogEventActionChangeLinkedChat#50c7ac8: field new_value: %w", err) } c.NewValue = value } @@ -2823,12 +2823,12 @@ func (c *ChannelAdminLogEventActionChangeLinkedChat) DecodeBare(b *bin.Buffer) e } // GetPrevValue returns value of PrevValue field. -func (c *ChannelAdminLogEventActionChangeLinkedChat) GetPrevValue() (value int) { +func (c *ChannelAdminLogEventActionChangeLinkedChat) GetPrevValue() (value int64) { return c.PrevValue } // GetNewValue returns value of NewValue field. -func (c *ChannelAdminLogEventActionChangeLinkedChat) GetNewValue() (value int) { +func (c *ChannelAdminLogEventActionChangeLinkedChat) GetNewValue() (value int64) { return c.NewValue } @@ -4672,161 +4672,6 @@ func (c *ChannelAdminLogEventActionChangeHistoryTTL) GetNewValue() (value int) { return c.NewValue } -// ChannelAdminLogEventActionChangeTheme represents TL type `channelAdminLogEventActionChangeTheme#fe69018d`. -// -// See https://core.telegram.org/constructor/channelAdminLogEventActionChangeTheme for reference. -type ChannelAdminLogEventActionChangeTheme struct { - // PrevValue field of ChannelAdminLogEventActionChangeTheme. - PrevValue string - // NewValue field of ChannelAdminLogEventActionChangeTheme. - NewValue string -} - -// ChannelAdminLogEventActionChangeThemeTypeID is TL type id of ChannelAdminLogEventActionChangeTheme. -const ChannelAdminLogEventActionChangeThemeTypeID = 0xfe69018d - -// construct implements constructor of ChannelAdminLogEventActionClass. -func (c ChannelAdminLogEventActionChangeTheme) construct() ChannelAdminLogEventActionClass { return &c } - -// Ensuring interfaces in compile-time for ChannelAdminLogEventActionChangeTheme. -var ( - _ bin.Encoder = &ChannelAdminLogEventActionChangeTheme{} - _ bin.Decoder = &ChannelAdminLogEventActionChangeTheme{} - _ bin.BareEncoder = &ChannelAdminLogEventActionChangeTheme{} - _ bin.BareDecoder = &ChannelAdminLogEventActionChangeTheme{} - - _ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionChangeTheme{} -) - -func (c *ChannelAdminLogEventActionChangeTheme) Zero() bool { - if c == nil { - return true - } - if !(c.PrevValue == "") { - return false - } - if !(c.NewValue == "") { - return false - } - - return true -} - -// String implements fmt.Stringer. -func (c *ChannelAdminLogEventActionChangeTheme) String() string { - if c == nil { - return "ChannelAdminLogEventActionChangeTheme(nil)" - } - type Alias ChannelAdminLogEventActionChangeTheme - return fmt.Sprintf("ChannelAdminLogEventActionChangeTheme%+v", Alias(*c)) -} - -// FillFrom fills ChannelAdminLogEventActionChangeTheme from given interface. -func (c *ChannelAdminLogEventActionChangeTheme) FillFrom(from interface { - GetPrevValue() (value string) - GetNewValue() (value string) -}) { - c.PrevValue = from.GetPrevValue() - c.NewValue = from.GetNewValue() -} - -// TypeID returns type id in TL schema. -// -// See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*ChannelAdminLogEventActionChangeTheme) TypeID() uint32 { - return ChannelAdminLogEventActionChangeThemeTypeID -} - -// TypeName returns name of type in TL schema. -func (*ChannelAdminLogEventActionChangeTheme) TypeName() string { - return "channelAdminLogEventActionChangeTheme" -} - -// TypeInfo returns info about TL type. -func (c *ChannelAdminLogEventActionChangeTheme) TypeInfo() tdp.Type { - typ := tdp.Type{ - Name: "channelAdminLogEventActionChangeTheme", - ID: ChannelAdminLogEventActionChangeThemeTypeID, - } - if c == nil { - typ.Null = true - return typ - } - typ.Fields = []tdp.Field{ - { - Name: "PrevValue", - SchemaName: "prev_value", - }, - { - Name: "NewValue", - SchemaName: "new_value", - }, - } - return typ -} - -// Encode implements bin.Encoder. -func (c *ChannelAdminLogEventActionChangeTheme) Encode(b *bin.Buffer) error { - if c == nil { - return fmt.Errorf("can't encode channelAdminLogEventActionChangeTheme#fe69018d as nil") - } - b.PutID(ChannelAdminLogEventActionChangeThemeTypeID) - return c.EncodeBare(b) -} - -// EncodeBare implements bin.BareEncoder. -func (c *ChannelAdminLogEventActionChangeTheme) EncodeBare(b *bin.Buffer) error { - if c == nil { - return fmt.Errorf("can't encode channelAdminLogEventActionChangeTheme#fe69018d as nil") - } - b.PutString(c.PrevValue) - b.PutString(c.NewValue) - return nil -} - -// Decode implements bin.Decoder. -func (c *ChannelAdminLogEventActionChangeTheme) Decode(b *bin.Buffer) error { - if c == nil { - return fmt.Errorf("can't decode channelAdminLogEventActionChangeTheme#fe69018d to nil") - } - if err := b.ConsumeID(ChannelAdminLogEventActionChangeThemeTypeID); err != nil { - return fmt.Errorf("unable to decode channelAdminLogEventActionChangeTheme#fe69018d: %w", err) - } - return c.DecodeBare(b) -} - -// DecodeBare implements bin.BareDecoder. -func (c *ChannelAdminLogEventActionChangeTheme) DecodeBare(b *bin.Buffer) error { - if c == nil { - return fmt.Errorf("can't decode channelAdminLogEventActionChangeTheme#fe69018d to nil") - } - { - value, err := b.String() - if err != nil { - return fmt.Errorf("unable to decode channelAdminLogEventActionChangeTheme#fe69018d: field prev_value: %w", err) - } - c.PrevValue = value - } - { - value, err := b.String() - if err != nil { - return fmt.Errorf("unable to decode channelAdminLogEventActionChangeTheme#fe69018d: field new_value: %w", err) - } - c.NewValue = value - } - return nil -} - -// GetPrevValue returns value of PrevValue field. -func (c *ChannelAdminLogEventActionChangeTheme) GetPrevValue() (value string) { - return c.PrevValue -} - -// GetNewValue returns value of NewValue field. -func (c *ChannelAdminLogEventActionChangeTheme) GetNewValue() (value string) { - return c.NewValue -} - // ChannelAdminLogEventActionClass represents ChannelAdminLogEventAction generic type. // // See https://core.telegram.org/type/ChannelAdminLogEventAction for reference. @@ -4855,7 +4700,7 @@ func (c *ChannelAdminLogEventActionChangeTheme) GetNewValue() (value string) { // case *tg.ChannelAdminLogEventActionTogglePreHistoryHidden: // channelAdminLogEventActionTogglePreHistoryHidden#5f5c95f1 // case *tg.ChannelAdminLogEventActionDefaultBannedRights: // channelAdminLogEventActionDefaultBannedRights#2df5fc0a // case *tg.ChannelAdminLogEventActionStopPoll: // channelAdminLogEventActionStopPoll#8f079643 -// case *tg.ChannelAdminLogEventActionChangeLinkedChat: // channelAdminLogEventActionChangeLinkedChat#a26f881b +// case *tg.ChannelAdminLogEventActionChangeLinkedChat: // channelAdminLogEventActionChangeLinkedChat#50c7ac8 // case *tg.ChannelAdminLogEventActionChangeLocation: // channelAdminLogEventActionChangeLocation#e6b76ae // case *tg.ChannelAdminLogEventActionToggleSlowMode: // channelAdminLogEventActionToggleSlowMode#53909779 // case *tg.ChannelAdminLogEventActionStartGroupCall: // channelAdminLogEventActionStartGroupCall#23209745 @@ -4869,7 +4714,6 @@ func (c *ChannelAdminLogEventActionChangeTheme) GetNewValue() (value string) { // case *tg.ChannelAdminLogEventActionExportedInviteEdit: // channelAdminLogEventActionExportedInviteEdit#e90ebb59 // case *tg.ChannelAdminLogEventActionParticipantVolume: // channelAdminLogEventActionParticipantVolume#3e7f6847 // case *tg.ChannelAdminLogEventActionChangeHistoryTTL: // channelAdminLogEventActionChangeHistoryTTL#6e941a38 -// case *tg.ChannelAdminLogEventActionChangeTheme: // channelAdminLogEventActionChangeTheme#fe69018d // default: panic(v) // } type ChannelAdminLogEventActionClass interface { @@ -5025,7 +4869,7 @@ func DecodeChannelAdminLogEventAction(buf *bin.Buffer) (ChannelAdminLogEventActi } return &v, nil case ChannelAdminLogEventActionChangeLinkedChatTypeID: - // Decoding channelAdminLogEventActionChangeLinkedChat#a26f881b. + // Decoding channelAdminLogEventActionChangeLinkedChat#50c7ac8. v := ChannelAdminLogEventActionChangeLinkedChat{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err) @@ -5122,13 +4966,6 @@ func DecodeChannelAdminLogEventAction(buf *bin.Buffer) (ChannelAdminLogEventActi return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err) } return &v, nil - case ChannelAdminLogEventActionChangeThemeTypeID: - // Decoding channelAdminLogEventActionChangeTheme#fe69018d. - v := ChannelAdminLogEventActionChangeTheme{} - if err := v.Decode(buf); err != nil { - return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err) - } - return &v, nil default: return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", bin.NewUnexpectedID(id)) } diff --git a/tg/tl_channel_admin_log_event_action_slices_gen.go b/tg/tl_channel_admin_log_event_action_slices_gen.go index d93adcb2f9..253c7af376 100644 --- a/tg/tl_channel_admin_log_event_action_slices_gen.go +++ b/tg/tl_channel_admin_log_event_action_slices_gen.go @@ -504,19 +504,6 @@ func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionChange return to } -// AsChannelAdminLogEventActionChangeTheme returns copy with only ChannelAdminLogEventActionChangeTheme constructors. -func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionChangeTheme() (to ChannelAdminLogEventActionChangeThemeArray) { - for _, elem := range s { - value, ok := elem.(*ChannelAdminLogEventActionChangeTheme) - if !ok { - continue - } - to = append(to, *value) - } - - return to -} - // ChannelAdminLogEventActionChangeTitleArray is adapter for slice of ChannelAdminLogEventActionChangeTitle. type ChannelAdminLogEventActionChangeTitleArray []ChannelAdminLogEventActionChangeTitle @@ -2976,85 +2963,3 @@ func (s *ChannelAdminLogEventActionChangeHistoryTTLArray) Pop() (v ChannelAdminL return v, true } - -// ChannelAdminLogEventActionChangeThemeArray is adapter for slice of ChannelAdminLogEventActionChangeTheme. -type ChannelAdminLogEventActionChangeThemeArray []ChannelAdminLogEventActionChangeTheme - -// Sort sorts slice of ChannelAdminLogEventActionChangeTheme. -func (s ChannelAdminLogEventActionChangeThemeArray) Sort(less func(a, b ChannelAdminLogEventActionChangeTheme) bool) ChannelAdminLogEventActionChangeThemeArray { - sort.Slice(s, func(i, j int) bool { - return less(s[i], s[j]) - }) - return s -} - -// SortStable sorts slice of ChannelAdminLogEventActionChangeTheme. -func (s ChannelAdminLogEventActionChangeThemeArray) SortStable(less func(a, b ChannelAdminLogEventActionChangeTheme) bool) ChannelAdminLogEventActionChangeThemeArray { - sort.SliceStable(s, func(i, j int) bool { - return less(s[i], s[j]) - }) - return s -} - -// Retain filters in-place slice of ChannelAdminLogEventActionChangeTheme. -func (s ChannelAdminLogEventActionChangeThemeArray) Retain(keep func(x ChannelAdminLogEventActionChangeTheme) bool) ChannelAdminLogEventActionChangeThemeArray { - n := 0 - for _, x := range s { - if keep(x) { - s[n] = x - n++ - } - } - s = s[:n] - - return s -} - -// First returns first element of slice (if exists). -func (s ChannelAdminLogEventActionChangeThemeArray) First() (v ChannelAdminLogEventActionChangeTheme, ok bool) { - if len(s) < 1 { - return - } - return s[0], true -} - -// Last returns last element of slice (if exists). -func (s ChannelAdminLogEventActionChangeThemeArray) Last() (v ChannelAdminLogEventActionChangeTheme, ok bool) { - if len(s) < 1 { - return - } - return s[len(s)-1], true -} - -// PopFirst returns first element of slice (if exists) and deletes it. -func (s *ChannelAdminLogEventActionChangeThemeArray) PopFirst() (v ChannelAdminLogEventActionChangeTheme, ok bool) { - if s == nil || len(*s) < 1 { - return - } - - a := *s - v = a[0] - - // Delete by index from SliceTricks. - copy(a[0:], a[1:]) - var zero ChannelAdminLogEventActionChangeTheme - a[len(a)-1] = zero - a = a[:len(a)-1] - *s = a - - return v, true -} - -// Pop returns last element of slice (if exists) and deletes it. -func (s *ChannelAdminLogEventActionChangeThemeArray) Pop() (v ChannelAdminLogEventActionChangeTheme, ok bool) { - if s == nil || len(*s) < 1 { - return - } - - a := *s - v = a[len(a)-1] - a = a[:len(a)-1] - *s = a - - return v, true -} diff --git a/tg/tl_channel_admin_log_event_gen.go b/tg/tl_channel_admin_log_event_gen.go index 8380bf52d9..020483114e 100644 --- a/tg/tl_channel_admin_log_event_gen.go +++ b/tg/tl_channel_admin_log_event_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// ChannelAdminLogEvent represents TL type `channelAdminLogEvent#3b5a3e40`. +// ChannelAdminLogEvent represents TL type `channelAdminLogEvent#1fad68cd`. // Admin log event // // See https://core.telegram.org/constructor/channelAdminLogEvent for reference. @@ -39,13 +39,13 @@ type ChannelAdminLogEvent struct { // Date Date int // User ID - UserID int + UserID int64 // Action Action ChannelAdminLogEventActionClass } // ChannelAdminLogEventTypeID is TL type id of ChannelAdminLogEvent. -const ChannelAdminLogEventTypeID = 0x3b5a3e40 +const ChannelAdminLogEventTypeID = 0x1fad68cd // Ensuring interfaces in compile-time for ChannelAdminLogEvent. var ( @@ -88,7 +88,7 @@ func (c *ChannelAdminLogEvent) String() string { func (c *ChannelAdminLogEvent) FillFrom(from interface { GetID() (value int64) GetDate() (value int) - GetUserID() (value int) + GetUserID() (value int64) GetAction() (value ChannelAdminLogEventActionClass) }) { c.ID = from.GetID() @@ -143,7 +143,7 @@ func (c *ChannelAdminLogEvent) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (c *ChannelAdminLogEvent) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode channelAdminLogEvent#3b5a3e40 as nil") + return fmt.Errorf("can't encode channelAdminLogEvent#1fad68cd as nil") } b.PutID(ChannelAdminLogEventTypeID) return c.EncodeBare(b) @@ -152,16 +152,16 @@ func (c *ChannelAdminLogEvent) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (c *ChannelAdminLogEvent) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode channelAdminLogEvent#3b5a3e40 as nil") + return fmt.Errorf("can't encode channelAdminLogEvent#1fad68cd as nil") } b.PutLong(c.ID) b.PutInt(c.Date) - b.PutInt(c.UserID) + b.PutLong(c.UserID) if c.Action == nil { - return fmt.Errorf("unable to encode channelAdminLogEvent#3b5a3e40: field action is nil") + return fmt.Errorf("unable to encode channelAdminLogEvent#1fad68cd: field action is nil") } if err := c.Action.Encode(b); err != nil { - return fmt.Errorf("unable to encode channelAdminLogEvent#3b5a3e40: field action: %w", err) + return fmt.Errorf("unable to encode channelAdminLogEvent#1fad68cd: field action: %w", err) } return nil } @@ -169,10 +169,10 @@ func (c *ChannelAdminLogEvent) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (c *ChannelAdminLogEvent) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode channelAdminLogEvent#3b5a3e40 to nil") + return fmt.Errorf("can't decode channelAdminLogEvent#1fad68cd to nil") } if err := b.ConsumeID(ChannelAdminLogEventTypeID); err != nil { - return fmt.Errorf("unable to decode channelAdminLogEvent#3b5a3e40: %w", err) + return fmt.Errorf("unable to decode channelAdminLogEvent#1fad68cd: %w", err) } return c.DecodeBare(b) } @@ -180,33 +180,33 @@ func (c *ChannelAdminLogEvent) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (c *ChannelAdminLogEvent) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode channelAdminLogEvent#3b5a3e40 to nil") + return fmt.Errorf("can't decode channelAdminLogEvent#1fad68cd to nil") } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode channelAdminLogEvent#3b5a3e40: field id: %w", err) + return fmt.Errorf("unable to decode channelAdminLogEvent#1fad68cd: field id: %w", err) } c.ID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelAdminLogEvent#3b5a3e40: field date: %w", err) + return fmt.Errorf("unable to decode channelAdminLogEvent#1fad68cd: field date: %w", err) } c.Date = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode channelAdminLogEvent#3b5a3e40: field user_id: %w", err) + return fmt.Errorf("unable to decode channelAdminLogEvent#1fad68cd: field user_id: %w", err) } c.UserID = value } { value, err := DecodeChannelAdminLogEventAction(b) if err != nil { - return fmt.Errorf("unable to decode channelAdminLogEvent#3b5a3e40: field action: %w", err) + return fmt.Errorf("unable to decode channelAdminLogEvent#1fad68cd: field action: %w", err) } c.Action = value } @@ -224,7 +224,7 @@ func (c *ChannelAdminLogEvent) GetDate() (value int) { } // GetUserID returns value of UserID field. -func (c *ChannelAdminLogEvent) GetUserID() (value int) { +func (c *ChannelAdminLogEvent) GetUserID() (value int64) { return c.UserID } diff --git a/tg/tl_channel_participant_gen.go b/tg/tl_channel_participant_gen.go index 3738c75007..910d4a3d74 100644 --- a/tg/tl_channel_participant_gen.go +++ b/tg/tl_channel_participant_gen.go @@ -29,19 +29,19 @@ var ( _ = tgerr.Error{} ) -// ChannelParticipant represents TL type `channelParticipant#15ebac1d`. +// ChannelParticipant represents TL type `channelParticipant#c00c07c0`. // Channel/supergroup participant // // See https://core.telegram.org/constructor/channelParticipant for reference. type ChannelParticipant struct { // Pariticipant user ID - UserID int + UserID int64 // Date joined Date int } // ChannelParticipantTypeID is TL type id of ChannelParticipant. -const ChannelParticipantTypeID = 0x15ebac1d +const ChannelParticipantTypeID = 0xc00c07c0 // construct implements constructor of ChannelParticipantClass. func (c ChannelParticipant) construct() ChannelParticipantClass { return &c } @@ -81,7 +81,7 @@ func (c *ChannelParticipant) String() string { // FillFrom fills ChannelParticipant from given interface. func (c *ChannelParticipant) FillFrom(from interface { - GetUserID() (value int) + GetUserID() (value int64) GetDate() (value int) }) { c.UserID = from.GetUserID() @@ -126,7 +126,7 @@ func (c *ChannelParticipant) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (c *ChannelParticipant) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode channelParticipant#15ebac1d as nil") + return fmt.Errorf("can't encode channelParticipant#c00c07c0 as nil") } b.PutID(ChannelParticipantTypeID) return c.EncodeBare(b) @@ -135,9 +135,9 @@ func (c *ChannelParticipant) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (c *ChannelParticipant) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode channelParticipant#15ebac1d as nil") + return fmt.Errorf("can't encode channelParticipant#c00c07c0 as nil") } - b.PutInt(c.UserID) + b.PutLong(c.UserID) b.PutInt(c.Date) return nil } @@ -145,10 +145,10 @@ func (c *ChannelParticipant) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (c *ChannelParticipant) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode channelParticipant#15ebac1d to nil") + return fmt.Errorf("can't decode channelParticipant#c00c07c0 to nil") } if err := b.ConsumeID(ChannelParticipantTypeID); err != nil { - return fmt.Errorf("unable to decode channelParticipant#15ebac1d: %w", err) + return fmt.Errorf("unable to decode channelParticipant#c00c07c0: %w", err) } return c.DecodeBare(b) } @@ -156,19 +156,19 @@ func (c *ChannelParticipant) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (c *ChannelParticipant) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode channelParticipant#15ebac1d to nil") + return fmt.Errorf("can't decode channelParticipant#c00c07c0 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode channelParticipant#15ebac1d: field user_id: %w", err) + return fmt.Errorf("unable to decode channelParticipant#c00c07c0: field user_id: %w", err) } c.UserID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelParticipant#15ebac1d: field date: %w", err) + return fmt.Errorf("unable to decode channelParticipant#c00c07c0: field date: %w", err) } c.Date = value } @@ -176,7 +176,7 @@ func (c *ChannelParticipant) DecodeBare(b *bin.Buffer) error { } // GetUserID returns value of UserID field. -func (c *ChannelParticipant) GetUserID() (value int) { +func (c *ChannelParticipant) GetUserID() (value int64) { return c.UserID } @@ -185,21 +185,21 @@ func (c *ChannelParticipant) GetDate() (value int) { return c.Date } -// ChannelParticipantSelf represents TL type `channelParticipantSelf#a3289a6d`. +// ChannelParticipantSelf represents TL type `channelParticipantSelf#28a8bc67`. // Myself // // See https://core.telegram.org/constructor/channelParticipantSelf for reference. type ChannelParticipantSelf struct { // User ID - UserID int + UserID int64 // User that invited me to the channel/supergroup - InviterID int + InviterID int64 // When did I join the channel/supergroup Date int } // ChannelParticipantSelfTypeID is TL type id of ChannelParticipantSelf. -const ChannelParticipantSelfTypeID = 0xa3289a6d +const ChannelParticipantSelfTypeID = 0x28a8bc67 // construct implements constructor of ChannelParticipantClass. func (c ChannelParticipantSelf) construct() ChannelParticipantClass { return &c } @@ -242,8 +242,8 @@ func (c *ChannelParticipantSelf) String() string { // FillFrom fills ChannelParticipantSelf from given interface. func (c *ChannelParticipantSelf) FillFrom(from interface { - GetUserID() (value int) - GetInviterID() (value int) + GetUserID() (value int64) + GetInviterID() (value int64) GetDate() (value int) }) { c.UserID = from.GetUserID() @@ -293,7 +293,7 @@ func (c *ChannelParticipantSelf) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (c *ChannelParticipantSelf) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode channelParticipantSelf#a3289a6d as nil") + return fmt.Errorf("can't encode channelParticipantSelf#28a8bc67 as nil") } b.PutID(ChannelParticipantSelfTypeID) return c.EncodeBare(b) @@ -302,10 +302,10 @@ func (c *ChannelParticipantSelf) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (c *ChannelParticipantSelf) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode channelParticipantSelf#a3289a6d as nil") + return fmt.Errorf("can't encode channelParticipantSelf#28a8bc67 as nil") } - b.PutInt(c.UserID) - b.PutInt(c.InviterID) + b.PutLong(c.UserID) + b.PutLong(c.InviterID) b.PutInt(c.Date) return nil } @@ -313,10 +313,10 @@ func (c *ChannelParticipantSelf) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (c *ChannelParticipantSelf) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode channelParticipantSelf#a3289a6d to nil") + return fmt.Errorf("can't decode channelParticipantSelf#28a8bc67 to nil") } if err := b.ConsumeID(ChannelParticipantSelfTypeID); err != nil { - return fmt.Errorf("unable to decode channelParticipantSelf#a3289a6d: %w", err) + return fmt.Errorf("unable to decode channelParticipantSelf#28a8bc67: %w", err) } return c.DecodeBare(b) } @@ -324,26 +324,26 @@ func (c *ChannelParticipantSelf) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (c *ChannelParticipantSelf) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode channelParticipantSelf#a3289a6d to nil") + return fmt.Errorf("can't decode channelParticipantSelf#28a8bc67 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode channelParticipantSelf#a3289a6d: field user_id: %w", err) + return fmt.Errorf("unable to decode channelParticipantSelf#28a8bc67: field user_id: %w", err) } c.UserID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode channelParticipantSelf#a3289a6d: field inviter_id: %w", err) + return fmt.Errorf("unable to decode channelParticipantSelf#28a8bc67: field inviter_id: %w", err) } c.InviterID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelParticipantSelf#a3289a6d: field date: %w", err) + return fmt.Errorf("unable to decode channelParticipantSelf#28a8bc67: field date: %w", err) } c.Date = value } @@ -351,12 +351,12 @@ func (c *ChannelParticipantSelf) DecodeBare(b *bin.Buffer) error { } // GetUserID returns value of UserID field. -func (c *ChannelParticipantSelf) GetUserID() (value int) { +func (c *ChannelParticipantSelf) GetUserID() (value int64) { return c.UserID } // GetInviterID returns value of InviterID field. -func (c *ChannelParticipantSelf) GetInviterID() (value int) { +func (c *ChannelParticipantSelf) GetInviterID() (value int64) { return c.InviterID } @@ -365,7 +365,7 @@ func (c *ChannelParticipantSelf) GetDate() (value int) { return c.Date } -// ChannelParticipantCreator represents TL type `channelParticipantCreator#447dca4b`. +// ChannelParticipantCreator represents TL type `channelParticipantCreator#2fe601d3`. // Channel/supergroup creator // // See https://core.telegram.org/constructor/channelParticipantCreator for reference. @@ -376,7 +376,7 @@ type ChannelParticipantCreator struct { // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields // User ID - UserID int + UserID int64 // Creator admin rights AdminRights ChatAdminRights // The role (rank) of the group creator in the group: just an arbitrary string, admin by @@ -387,7 +387,7 @@ type ChannelParticipantCreator struct { } // ChannelParticipantCreatorTypeID is TL type id of ChannelParticipantCreator. -const ChannelParticipantCreatorTypeID = 0x447dca4b +const ChannelParticipantCreatorTypeID = 0x2fe601d3 // construct implements constructor of ChannelParticipantClass. func (c ChannelParticipantCreator) construct() ChannelParticipantClass { return &c } @@ -433,7 +433,7 @@ func (c *ChannelParticipantCreator) String() string { // FillFrom fills ChannelParticipantCreator from given interface. func (c *ChannelParticipantCreator) FillFrom(from interface { - GetUserID() (value int) + GetUserID() (value int64) GetAdminRights() (value ChatAdminRights) GetRank() (value string, ok bool) }) { @@ -488,7 +488,7 @@ func (c *ChannelParticipantCreator) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (c *ChannelParticipantCreator) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode channelParticipantCreator#447dca4b as nil") + return fmt.Errorf("can't encode channelParticipantCreator#2fe601d3 as nil") } b.PutID(ChannelParticipantCreatorTypeID) return c.EncodeBare(b) @@ -497,17 +497,17 @@ func (c *ChannelParticipantCreator) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (c *ChannelParticipantCreator) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode channelParticipantCreator#447dca4b as nil") + return fmt.Errorf("can't encode channelParticipantCreator#2fe601d3 as nil") } if !(c.Rank == "") { c.Flags.Set(0) } if err := c.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode channelParticipantCreator#447dca4b: field flags: %w", err) + return fmt.Errorf("unable to encode channelParticipantCreator#2fe601d3: field flags: %w", err) } - b.PutInt(c.UserID) + b.PutLong(c.UserID) if err := c.AdminRights.Encode(b); err != nil { - return fmt.Errorf("unable to encode channelParticipantCreator#447dca4b: field admin_rights: %w", err) + return fmt.Errorf("unable to encode channelParticipantCreator#2fe601d3: field admin_rights: %w", err) } if c.Flags.Has(0) { b.PutString(c.Rank) @@ -518,10 +518,10 @@ func (c *ChannelParticipantCreator) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (c *ChannelParticipantCreator) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode channelParticipantCreator#447dca4b to nil") + return fmt.Errorf("can't decode channelParticipantCreator#2fe601d3 to nil") } if err := b.ConsumeID(ChannelParticipantCreatorTypeID); err != nil { - return fmt.Errorf("unable to decode channelParticipantCreator#447dca4b: %w", err) + return fmt.Errorf("unable to decode channelParticipantCreator#2fe601d3: %w", err) } return c.DecodeBare(b) } @@ -529,29 +529,29 @@ func (c *ChannelParticipantCreator) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (c *ChannelParticipantCreator) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode channelParticipantCreator#447dca4b to nil") + return fmt.Errorf("can't decode channelParticipantCreator#2fe601d3 to nil") } { if err := c.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode channelParticipantCreator#447dca4b: field flags: %w", err) + return fmt.Errorf("unable to decode channelParticipantCreator#2fe601d3: field flags: %w", err) } } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode channelParticipantCreator#447dca4b: field user_id: %w", err) + return fmt.Errorf("unable to decode channelParticipantCreator#2fe601d3: field user_id: %w", err) } c.UserID = value } { if err := c.AdminRights.Decode(b); err != nil { - return fmt.Errorf("unable to decode channelParticipantCreator#447dca4b: field admin_rights: %w", err) + return fmt.Errorf("unable to decode channelParticipantCreator#2fe601d3: field admin_rights: %w", err) } } if c.Flags.Has(0) { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode channelParticipantCreator#447dca4b: field rank: %w", err) + return fmt.Errorf("unable to decode channelParticipantCreator#2fe601d3: field rank: %w", err) } c.Rank = value } @@ -559,7 +559,7 @@ func (c *ChannelParticipantCreator) DecodeBare(b *bin.Buffer) error { } // GetUserID returns value of UserID field. -func (c *ChannelParticipantCreator) GetUserID() (value int) { +func (c *ChannelParticipantCreator) GetUserID() (value int64) { return c.UserID } @@ -583,7 +583,7 @@ func (c *ChannelParticipantCreator) GetRank() (value string, ok bool) { return c.Rank, true } -// ChannelParticipantAdmin represents TL type `channelParticipantAdmin#ccbebbaf`. +// ChannelParticipantAdmin represents TL type `channelParticipantAdmin#34c3bb53`. // Admin // // See https://core.telegram.org/constructor/channelParticipantAdmin for reference. @@ -598,13 +598,13 @@ type ChannelParticipantAdmin struct { // Is this the current user Self bool // Admin user ID - UserID int + UserID int64 // User that invited the admin to the channel/group // // Use SetInviterID and GetInviterID helpers. - InviterID int + InviterID int64 // User that promoted the user to admin - PromotedBy int + PromotedBy int64 // When did the user join Date int // Admin rights¹ @@ -619,7 +619,7 @@ type ChannelParticipantAdmin struct { } // ChannelParticipantAdminTypeID is TL type id of ChannelParticipantAdmin. -const ChannelParticipantAdminTypeID = 0xccbebbaf +const ChannelParticipantAdminTypeID = 0x34c3bb53 // construct implements constructor of ChannelParticipantClass. func (c ChannelParticipantAdmin) construct() ChannelParticipantClass { return &c } @@ -682,9 +682,9 @@ func (c *ChannelParticipantAdmin) String() string { func (c *ChannelParticipantAdmin) FillFrom(from interface { GetCanEdit() (value bool) GetSelf() (value bool) - GetUserID() (value int) - GetInviterID() (value int, ok bool) - GetPromotedBy() (value int) + GetUserID() (value int64) + GetInviterID() (value int64, ok bool) + GetPromotedBy() (value int64) GetDate() (value int) GetAdminRights() (value ChatAdminRights) GetRank() (value string, ok bool) @@ -771,7 +771,7 @@ func (c *ChannelParticipantAdmin) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (c *ChannelParticipantAdmin) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode channelParticipantAdmin#ccbebbaf as nil") + return fmt.Errorf("can't encode channelParticipantAdmin#34c3bb53 as nil") } b.PutID(ChannelParticipantAdminTypeID) return c.EncodeBare(b) @@ -780,7 +780,7 @@ func (c *ChannelParticipantAdmin) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (c *ChannelParticipantAdmin) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode channelParticipantAdmin#ccbebbaf as nil") + return fmt.Errorf("can't encode channelParticipantAdmin#34c3bb53 as nil") } if !(c.CanEdit == false) { c.Flags.Set(0) @@ -795,16 +795,16 @@ func (c *ChannelParticipantAdmin) EncodeBare(b *bin.Buffer) error { c.Flags.Set(2) } if err := c.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode channelParticipantAdmin#ccbebbaf: field flags: %w", err) + return fmt.Errorf("unable to encode channelParticipantAdmin#34c3bb53: field flags: %w", err) } - b.PutInt(c.UserID) + b.PutLong(c.UserID) if c.Flags.Has(1) { - b.PutInt(c.InviterID) + b.PutLong(c.InviterID) } - b.PutInt(c.PromotedBy) + b.PutLong(c.PromotedBy) b.PutInt(c.Date) if err := c.AdminRights.Encode(b); err != nil { - return fmt.Errorf("unable to encode channelParticipantAdmin#ccbebbaf: field admin_rights: %w", err) + return fmt.Errorf("unable to encode channelParticipantAdmin#34c3bb53: field admin_rights: %w", err) } if c.Flags.Has(2) { b.PutString(c.Rank) @@ -815,10 +815,10 @@ func (c *ChannelParticipantAdmin) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (c *ChannelParticipantAdmin) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode channelParticipantAdmin#ccbebbaf to nil") + return fmt.Errorf("can't decode channelParticipantAdmin#34c3bb53 to nil") } if err := b.ConsumeID(ChannelParticipantAdminTypeID); err != nil { - return fmt.Errorf("unable to decode channelParticipantAdmin#ccbebbaf: %w", err) + return fmt.Errorf("unable to decode channelParticipantAdmin#34c3bb53: %w", err) } return c.DecodeBare(b) } @@ -826,52 +826,52 @@ func (c *ChannelParticipantAdmin) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (c *ChannelParticipantAdmin) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode channelParticipantAdmin#ccbebbaf to nil") + return fmt.Errorf("can't decode channelParticipantAdmin#34c3bb53 to nil") } { if err := c.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode channelParticipantAdmin#ccbebbaf: field flags: %w", err) + return fmt.Errorf("unable to decode channelParticipantAdmin#34c3bb53: field flags: %w", err) } } c.CanEdit = c.Flags.Has(0) c.Self = c.Flags.Has(1) { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode channelParticipantAdmin#ccbebbaf: field user_id: %w", err) + return fmt.Errorf("unable to decode channelParticipantAdmin#34c3bb53: field user_id: %w", err) } c.UserID = value } if c.Flags.Has(1) { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode channelParticipantAdmin#ccbebbaf: field inviter_id: %w", err) + return fmt.Errorf("unable to decode channelParticipantAdmin#34c3bb53: field inviter_id: %w", err) } c.InviterID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode channelParticipantAdmin#ccbebbaf: field promoted_by: %w", err) + return fmt.Errorf("unable to decode channelParticipantAdmin#34c3bb53: field promoted_by: %w", err) } c.PromotedBy = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelParticipantAdmin#ccbebbaf: field date: %w", err) + return fmt.Errorf("unable to decode channelParticipantAdmin#34c3bb53: field date: %w", err) } c.Date = value } { if err := c.AdminRights.Decode(b); err != nil { - return fmt.Errorf("unable to decode channelParticipantAdmin#ccbebbaf: field admin_rights: %w", err) + return fmt.Errorf("unable to decode channelParticipantAdmin#34c3bb53: field admin_rights: %w", err) } } if c.Flags.Has(2) { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode channelParticipantAdmin#ccbebbaf: field rank: %w", err) + return fmt.Errorf("unable to decode channelParticipantAdmin#34c3bb53: field rank: %w", err) } c.Rank = value } @@ -911,19 +911,19 @@ func (c *ChannelParticipantAdmin) GetSelf() (value bool) { } // GetUserID returns value of UserID field. -func (c *ChannelParticipantAdmin) GetUserID() (value int) { +func (c *ChannelParticipantAdmin) GetUserID() (value int64) { return c.UserID } // SetInviterID sets value of InviterID conditional field. -func (c *ChannelParticipantAdmin) SetInviterID(value int) { +func (c *ChannelParticipantAdmin) SetInviterID(value int64) { c.Flags.Set(1) c.InviterID = value } // GetInviterID returns value of InviterID conditional field and // boolean which is true if field was set. -func (c *ChannelParticipantAdmin) GetInviterID() (value int, ok bool) { +func (c *ChannelParticipantAdmin) GetInviterID() (value int64, ok bool) { if !c.Flags.Has(1) { return value, false } @@ -931,7 +931,7 @@ func (c *ChannelParticipantAdmin) GetInviterID() (value int, ok bool) { } // GetPromotedBy returns value of PromotedBy field. -func (c *ChannelParticipantAdmin) GetPromotedBy() (value int) { +func (c *ChannelParticipantAdmin) GetPromotedBy() (value int64) { return c.PromotedBy } @@ -960,7 +960,7 @@ func (c *ChannelParticipantAdmin) GetRank() (value string, ok bool) { return c.Rank, true } -// ChannelParticipantBanned represents TL type `channelParticipantBanned#50a1dfd6`. +// ChannelParticipantBanned represents TL type `channelParticipantBanned#6df8014e`. // Banned/kicked user // // See https://core.telegram.org/constructor/channelParticipantBanned for reference. @@ -975,7 +975,7 @@ type ChannelParticipantBanned struct { // Peer field of ChannelParticipantBanned. Peer PeerClass // User was kicked by the specified admin - KickedBy int + KickedBy int64 // When did the user join the group Date int // Banned rights¹ @@ -986,7 +986,7 @@ type ChannelParticipantBanned struct { } // ChannelParticipantBannedTypeID is TL type id of ChannelParticipantBanned. -const ChannelParticipantBannedTypeID = 0x50a1dfd6 +const ChannelParticipantBannedTypeID = 0x6df8014e // construct implements constructor of ChannelParticipantClass. func (c ChannelParticipantBanned) construct() ChannelParticipantClass { return &c } @@ -1040,7 +1040,7 @@ func (c *ChannelParticipantBanned) String() string { func (c *ChannelParticipantBanned) FillFrom(from interface { GetLeft() (value bool) GetPeer() (value PeerClass) - GetKickedBy() (value int) + GetKickedBy() (value int64) GetDate() (value int) GetBannedRights() (value ChatBannedRights) }) { @@ -1102,7 +1102,7 @@ func (c *ChannelParticipantBanned) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (c *ChannelParticipantBanned) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode channelParticipantBanned#50a1dfd6 as nil") + return fmt.Errorf("can't encode channelParticipantBanned#6df8014e as nil") } b.PutID(ChannelParticipantBannedTypeID) return c.EncodeBare(b) @@ -1111,24 +1111,24 @@ func (c *ChannelParticipantBanned) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (c *ChannelParticipantBanned) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode channelParticipantBanned#50a1dfd6 as nil") + return fmt.Errorf("can't encode channelParticipantBanned#6df8014e as nil") } if !(c.Left == false) { c.Flags.Set(0) } if err := c.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode channelParticipantBanned#50a1dfd6: field flags: %w", err) + return fmt.Errorf("unable to encode channelParticipantBanned#6df8014e: field flags: %w", err) } if c.Peer == nil { - return fmt.Errorf("unable to encode channelParticipantBanned#50a1dfd6: field peer is nil") + return fmt.Errorf("unable to encode channelParticipantBanned#6df8014e: field peer is nil") } if err := c.Peer.Encode(b); err != nil { - return fmt.Errorf("unable to encode channelParticipantBanned#50a1dfd6: field peer: %w", err) + return fmt.Errorf("unable to encode channelParticipantBanned#6df8014e: field peer: %w", err) } - b.PutInt(c.KickedBy) + b.PutLong(c.KickedBy) b.PutInt(c.Date) if err := c.BannedRights.Encode(b); err != nil { - return fmt.Errorf("unable to encode channelParticipantBanned#50a1dfd6: field banned_rights: %w", err) + return fmt.Errorf("unable to encode channelParticipantBanned#6df8014e: field banned_rights: %w", err) } return nil } @@ -1136,10 +1136,10 @@ func (c *ChannelParticipantBanned) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (c *ChannelParticipantBanned) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode channelParticipantBanned#50a1dfd6 to nil") + return fmt.Errorf("can't decode channelParticipantBanned#6df8014e to nil") } if err := b.ConsumeID(ChannelParticipantBannedTypeID); err != nil { - return fmt.Errorf("unable to decode channelParticipantBanned#50a1dfd6: %w", err) + return fmt.Errorf("unable to decode channelParticipantBanned#6df8014e: %w", err) } return c.DecodeBare(b) } @@ -1147,38 +1147,38 @@ func (c *ChannelParticipantBanned) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (c *ChannelParticipantBanned) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode channelParticipantBanned#50a1dfd6 to nil") + return fmt.Errorf("can't decode channelParticipantBanned#6df8014e to nil") } { if err := c.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode channelParticipantBanned#50a1dfd6: field flags: %w", err) + return fmt.Errorf("unable to decode channelParticipantBanned#6df8014e: field flags: %w", err) } } c.Left = c.Flags.Has(0) { value, err := DecodePeer(b) if err != nil { - return fmt.Errorf("unable to decode channelParticipantBanned#50a1dfd6: field peer: %w", err) + return fmt.Errorf("unable to decode channelParticipantBanned#6df8014e: field peer: %w", err) } c.Peer = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode channelParticipantBanned#50a1dfd6: field kicked_by: %w", err) + return fmt.Errorf("unable to decode channelParticipantBanned#6df8014e: field kicked_by: %w", err) } c.KickedBy = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelParticipantBanned#50a1dfd6: field date: %w", err) + return fmt.Errorf("unable to decode channelParticipantBanned#6df8014e: field date: %w", err) } c.Date = value } { if err := c.BannedRights.Decode(b); err != nil { - return fmt.Errorf("unable to decode channelParticipantBanned#50a1dfd6: field banned_rights: %w", err) + return fmt.Errorf("unable to decode channelParticipantBanned#6df8014e: field banned_rights: %w", err) } } return nil @@ -1206,7 +1206,7 @@ func (c *ChannelParticipantBanned) GetPeer() (value PeerClass) { } // GetKickedBy returns value of KickedBy field. -func (c *ChannelParticipantBanned) GetKickedBy() (value int) { +func (c *ChannelParticipantBanned) GetKickedBy() (value int64) { return c.KickedBy } @@ -1367,11 +1367,11 @@ func (c *ChannelParticipantLeft) GetPeer() (value PeerClass) { // panic(err) // } // switch v := g.(type) { -// case *tg.ChannelParticipant: // channelParticipant#15ebac1d -// case *tg.ChannelParticipantSelf: // channelParticipantSelf#a3289a6d -// case *tg.ChannelParticipantCreator: // channelParticipantCreator#447dca4b -// case *tg.ChannelParticipantAdmin: // channelParticipantAdmin#ccbebbaf -// case *tg.ChannelParticipantBanned: // channelParticipantBanned#50a1dfd6 +// case *tg.ChannelParticipant: // channelParticipant#c00c07c0 +// case *tg.ChannelParticipantSelf: // channelParticipantSelf#28a8bc67 +// case *tg.ChannelParticipantCreator: // channelParticipantCreator#2fe601d3 +// case *tg.ChannelParticipantAdmin: // channelParticipantAdmin#34c3bb53 +// case *tg.ChannelParticipantBanned: // channelParticipantBanned#6df8014e // case *tg.ChannelParticipantLeft: // channelParticipantLeft#1b03f006 // default: panic(v) // } @@ -1402,35 +1402,35 @@ func DecodeChannelParticipant(buf *bin.Buffer) (ChannelParticipantClass, error) } switch id { case ChannelParticipantTypeID: - // Decoding channelParticipant#15ebac1d. + // Decoding channelParticipant#c00c07c0. v := ChannelParticipant{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode ChannelParticipantClass: %w", err) } return &v, nil case ChannelParticipantSelfTypeID: - // Decoding channelParticipantSelf#a3289a6d. + // Decoding channelParticipantSelf#28a8bc67. v := ChannelParticipantSelf{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode ChannelParticipantClass: %w", err) } return &v, nil case ChannelParticipantCreatorTypeID: - // Decoding channelParticipantCreator#447dca4b. + // Decoding channelParticipantCreator#2fe601d3. v := ChannelParticipantCreator{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode ChannelParticipantClass: %w", err) } return &v, nil case ChannelParticipantAdminTypeID: - // Decoding channelParticipantAdmin#ccbebbaf. + // Decoding channelParticipantAdmin#34c3bb53. v := ChannelParticipantAdmin{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode ChannelParticipantClass: %w", err) } return &v, nil case ChannelParticipantBannedTypeID: - // Decoding channelParticipantBanned#50a1dfd6. + // Decoding channelParticipantBanned#6df8014e. v := ChannelParticipantBanned{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode ChannelParticipantClass: %w", err) diff --git a/tg/tl_channels_get_participants_gen.go b/tg/tl_channels_get_participants_gen.go index 2b270398d0..fe0b71269c 100644 --- a/tg/tl_channels_get_participants_gen.go +++ b/tg/tl_channels_get_participants_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// ChannelsGetParticipantsRequest represents TL type `channels.getParticipants#123e05e9`. +// ChannelsGetParticipantsRequest represents TL type `channels.getParticipants#77ced9d0`. // Get the participants of a supergroup/channel¹ // // Links: @@ -55,11 +55,11 @@ type ChannelsGetParticipantsRequest struct { // // Links: // 1) https://core.telegram.org/api/offsets - Hash int + Hash int64 } // ChannelsGetParticipantsRequestTypeID is TL type id of ChannelsGetParticipantsRequest. -const ChannelsGetParticipantsRequestTypeID = 0x123e05e9 +const ChannelsGetParticipantsRequestTypeID = 0x77ced9d0 // Ensuring interfaces in compile-time for ChannelsGetParticipantsRequest. var ( @@ -107,7 +107,7 @@ func (g *ChannelsGetParticipantsRequest) FillFrom(from interface { GetFilter() (value ChannelParticipantsFilterClass) GetOffset() (value int) GetLimit() (value int) - GetHash() (value int) + GetHash() (value int64) }) { g.Channel = from.GetChannel() g.Filter = from.GetFilter() @@ -166,7 +166,7 @@ func (g *ChannelsGetParticipantsRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (g *ChannelsGetParticipantsRequest) Encode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode channels.getParticipants#123e05e9 as nil") + return fmt.Errorf("can't encode channels.getParticipants#77ced9d0 as nil") } b.PutID(ChannelsGetParticipantsRequestTypeID) return g.EncodeBare(b) @@ -175,33 +175,33 @@ func (g *ChannelsGetParticipantsRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (g *ChannelsGetParticipantsRequest) EncodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode channels.getParticipants#123e05e9 as nil") + return fmt.Errorf("can't encode channels.getParticipants#77ced9d0 as nil") } if g.Channel == nil { - return fmt.Errorf("unable to encode channels.getParticipants#123e05e9: field channel is nil") + return fmt.Errorf("unable to encode channels.getParticipants#77ced9d0: field channel is nil") } if err := g.Channel.Encode(b); err != nil { - return fmt.Errorf("unable to encode channels.getParticipants#123e05e9: field channel: %w", err) + return fmt.Errorf("unable to encode channels.getParticipants#77ced9d0: field channel: %w", err) } if g.Filter == nil { - return fmt.Errorf("unable to encode channels.getParticipants#123e05e9: field filter is nil") + return fmt.Errorf("unable to encode channels.getParticipants#77ced9d0: field filter is nil") } if err := g.Filter.Encode(b); err != nil { - return fmt.Errorf("unable to encode channels.getParticipants#123e05e9: field filter: %w", err) + return fmt.Errorf("unable to encode channels.getParticipants#77ced9d0: field filter: %w", err) } b.PutInt(g.Offset) b.PutInt(g.Limit) - b.PutInt(g.Hash) + b.PutLong(g.Hash) return nil } // Decode implements bin.Decoder. func (g *ChannelsGetParticipantsRequest) Decode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode channels.getParticipants#123e05e9 to nil") + return fmt.Errorf("can't decode channels.getParticipants#77ced9d0 to nil") } if err := b.ConsumeID(ChannelsGetParticipantsRequestTypeID); err != nil { - return fmt.Errorf("unable to decode channels.getParticipants#123e05e9: %w", err) + return fmt.Errorf("unable to decode channels.getParticipants#77ced9d0: %w", err) } return g.DecodeBare(b) } @@ -209,40 +209,40 @@ func (g *ChannelsGetParticipantsRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (g *ChannelsGetParticipantsRequest) DecodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode channels.getParticipants#123e05e9 to nil") + return fmt.Errorf("can't decode channels.getParticipants#77ced9d0 to nil") } { value, err := DecodeInputChannel(b) if err != nil { - return fmt.Errorf("unable to decode channels.getParticipants#123e05e9: field channel: %w", err) + return fmt.Errorf("unable to decode channels.getParticipants#77ced9d0: field channel: %w", err) } g.Channel = value } { value, err := DecodeChannelParticipantsFilter(b) if err != nil { - return fmt.Errorf("unable to decode channels.getParticipants#123e05e9: field filter: %w", err) + return fmt.Errorf("unable to decode channels.getParticipants#77ced9d0: field filter: %w", err) } g.Filter = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channels.getParticipants#123e05e9: field offset: %w", err) + return fmt.Errorf("unable to decode channels.getParticipants#77ced9d0: field offset: %w", err) } g.Offset = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channels.getParticipants#123e05e9: field limit: %w", err) + return fmt.Errorf("unable to decode channels.getParticipants#77ced9d0: field limit: %w", err) } g.Limit = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode channels.getParticipants#123e05e9: field hash: %w", err) + return fmt.Errorf("unable to decode channels.getParticipants#77ced9d0: field hash: %w", err) } g.Hash = value } @@ -270,7 +270,7 @@ func (g *ChannelsGetParticipantsRequest) GetLimit() (value int) { } // GetHash returns value of Hash field. -func (g *ChannelsGetParticipantsRequest) GetHash() (value int) { +func (g *ChannelsGetParticipantsRequest) GetHash() (value int64) { return g.Hash } @@ -279,7 +279,7 @@ func (g *ChannelsGetParticipantsRequest) GetChannelAsNotEmpty() (NotEmptyInputCh return g.Channel.AsNotEmpty() } -// ChannelsGetParticipants invokes method channels.getParticipants#123e05e9 returning error if any. +// ChannelsGetParticipants invokes method channels.getParticipants#77ced9d0 returning error if any. // Get the participants of a supergroup/channel¹ // // Links: diff --git a/tg/tl_chat_admin_with_invites_gen.go b/tg/tl_chat_admin_with_invites_gen.go index 8b5df5a9c6..4bbe17e66e 100644 --- a/tg/tl_chat_admin_with_invites_gen.go +++ b/tg/tl_chat_admin_with_invites_gen.go @@ -29,12 +29,12 @@ var ( _ = tgerr.Error{} ) -// ChatAdminWithInvites represents TL type `chatAdminWithInvites#dfd2330f`. +// ChatAdminWithInvites represents TL type `chatAdminWithInvites#f2ecef23`. // // See https://core.telegram.org/constructor/chatAdminWithInvites for reference. type ChatAdminWithInvites struct { // AdminID field of ChatAdminWithInvites. - AdminID int + AdminID int64 // InvitesCount field of ChatAdminWithInvites. InvitesCount int // RevokedInvitesCount field of ChatAdminWithInvites. @@ -42,7 +42,7 @@ type ChatAdminWithInvites struct { } // ChatAdminWithInvitesTypeID is TL type id of ChatAdminWithInvites. -const ChatAdminWithInvitesTypeID = 0xdfd2330f +const ChatAdminWithInvitesTypeID = 0xf2ecef23 // Ensuring interfaces in compile-time for ChatAdminWithInvites. var ( @@ -80,7 +80,7 @@ func (c *ChatAdminWithInvites) String() string { // FillFrom fills ChatAdminWithInvites from given interface. func (c *ChatAdminWithInvites) FillFrom(from interface { - GetAdminID() (value int) + GetAdminID() (value int64) GetInvitesCount() (value int) GetRevokedInvitesCount() (value int) }) { @@ -131,7 +131,7 @@ func (c *ChatAdminWithInvites) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (c *ChatAdminWithInvites) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chatAdminWithInvites#dfd2330f as nil") + return fmt.Errorf("can't encode chatAdminWithInvites#f2ecef23 as nil") } b.PutID(ChatAdminWithInvitesTypeID) return c.EncodeBare(b) @@ -140,9 +140,9 @@ func (c *ChatAdminWithInvites) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (c *ChatAdminWithInvites) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chatAdminWithInvites#dfd2330f as nil") + return fmt.Errorf("can't encode chatAdminWithInvites#f2ecef23 as nil") } - b.PutInt(c.AdminID) + b.PutLong(c.AdminID) b.PutInt(c.InvitesCount) b.PutInt(c.RevokedInvitesCount) return nil @@ -151,10 +151,10 @@ func (c *ChatAdminWithInvites) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (c *ChatAdminWithInvites) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode chatAdminWithInvites#dfd2330f to nil") + return fmt.Errorf("can't decode chatAdminWithInvites#f2ecef23 to nil") } if err := b.ConsumeID(ChatAdminWithInvitesTypeID); err != nil { - return fmt.Errorf("unable to decode chatAdminWithInvites#dfd2330f: %w", err) + return fmt.Errorf("unable to decode chatAdminWithInvites#f2ecef23: %w", err) } return c.DecodeBare(b) } @@ -162,26 +162,26 @@ func (c *ChatAdminWithInvites) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (c *ChatAdminWithInvites) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode chatAdminWithInvites#dfd2330f to nil") + return fmt.Errorf("can't decode chatAdminWithInvites#f2ecef23 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode chatAdminWithInvites#dfd2330f: field admin_id: %w", err) + return fmt.Errorf("unable to decode chatAdminWithInvites#f2ecef23: field admin_id: %w", err) } c.AdminID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode chatAdminWithInvites#dfd2330f: field invites_count: %w", err) + return fmt.Errorf("unable to decode chatAdminWithInvites#f2ecef23: field invites_count: %w", err) } c.InvitesCount = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode chatAdminWithInvites#dfd2330f: field revoked_invites_count: %w", err) + return fmt.Errorf("unable to decode chatAdminWithInvites#f2ecef23: field revoked_invites_count: %w", err) } c.RevokedInvitesCount = value } @@ -189,7 +189,7 @@ func (c *ChatAdminWithInvites) DecodeBare(b *bin.Buffer) error { } // GetAdminID returns value of AdminID field. -func (c *ChatAdminWithInvites) GetAdminID() (value int) { +func (c *ChatAdminWithInvites) GetAdminID() (value int64) { return c.AdminID } diff --git a/tg/tl_chat_full_gen.go b/tg/tl_chat_full_gen.go index 0e6e9e8300..8d246f7ad0 100644 --- a/tg/tl_chat_full_gen.go +++ b/tg/tl_chat_full_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// ChatFull represents TL type `chatFull#49a0a5d9`. +// ChatFull represents TL type `chatFull#4dbdc099`. // Detailed chat info // // See https://core.telegram.org/constructor/chatFull for reference. @@ -47,7 +47,7 @@ type ChatFull struct { // 1) https://core.telegram.org/api/scheduled-messages HasScheduled bool // ID of the chat - ID int + ID int64 // About string for this chat About string // Participant list @@ -99,7 +99,7 @@ type ChatFull struct { } // ChatFullTypeID is TL type id of ChatFull. -const ChatFullTypeID = 0x49a0a5d9 +const ChatFullTypeID = 0x4dbdc099 // construct implements constructor of ChatFullClass. func (c ChatFull) construct() ChatFullClass { return &c } @@ -183,7 +183,7 @@ func (c *ChatFull) String() string { func (c *ChatFull) FillFrom(from interface { GetCanSetUsername() (value bool) GetHasScheduled() (value bool) - GetID() (value int) + GetID() (value int64) GetAbout() (value string) GetParticipants() (value ChatParticipantsClass) GetChatPhoto() (value PhotoClass, ok bool) @@ -342,7 +342,7 @@ func (c *ChatFull) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (c *ChatFull) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chatFull#49a0a5d9 as nil") + return fmt.Errorf("can't encode chatFull#4dbdc099 as nil") } b.PutID(ChatFullTypeID) return c.EncodeBare(b) @@ -351,7 +351,7 @@ func (c *ChatFull) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (c *ChatFull) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chatFull#49a0a5d9 as nil") + return fmt.Errorf("can't encode chatFull#4dbdc099 as nil") } if !(c.CanSetUsername == false) { c.Flags.Set(7) @@ -387,37 +387,37 @@ func (c *ChatFull) EncodeBare(b *bin.Buffer) error { c.Flags.Set(16) } if err := c.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode chatFull#49a0a5d9: field flags: %w", err) + return fmt.Errorf("unable to encode chatFull#4dbdc099: field flags: %w", err) } - b.PutInt(c.ID) + b.PutLong(c.ID) b.PutString(c.About) if c.Participants == nil { - return fmt.Errorf("unable to encode chatFull#49a0a5d9: field participants is nil") + return fmt.Errorf("unable to encode chatFull#4dbdc099: field participants is nil") } if err := c.Participants.Encode(b); err != nil { - return fmt.Errorf("unable to encode chatFull#49a0a5d9: field participants: %w", err) + return fmt.Errorf("unable to encode chatFull#4dbdc099: field participants: %w", err) } if c.Flags.Has(2) { if c.ChatPhoto == nil { - return fmt.Errorf("unable to encode chatFull#49a0a5d9: field chat_photo is nil") + return fmt.Errorf("unable to encode chatFull#4dbdc099: field chat_photo is nil") } if err := c.ChatPhoto.Encode(b); err != nil { - return fmt.Errorf("unable to encode chatFull#49a0a5d9: field chat_photo: %w", err) + return fmt.Errorf("unable to encode chatFull#4dbdc099: field chat_photo: %w", err) } } if err := c.NotifySettings.Encode(b); err != nil { - return fmt.Errorf("unable to encode chatFull#49a0a5d9: field notify_settings: %w", err) + return fmt.Errorf("unable to encode chatFull#4dbdc099: field notify_settings: %w", err) } if c.Flags.Has(13) { if err := c.ExportedInvite.Encode(b); err != nil { - return fmt.Errorf("unable to encode chatFull#49a0a5d9: field exported_invite: %w", err) + return fmt.Errorf("unable to encode chatFull#4dbdc099: field exported_invite: %w", err) } } if c.Flags.Has(3) { b.PutVectorHeader(len(c.BotInfo)) for idx, v := range c.BotInfo { if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode chatFull#49a0a5d9: field bot_info element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode chatFull#4dbdc099: field bot_info element with index %d: %w", idx, err) } } } @@ -429,7 +429,7 @@ func (c *ChatFull) EncodeBare(b *bin.Buffer) error { } if c.Flags.Has(12) { if err := c.Call.Encode(b); err != nil { - return fmt.Errorf("unable to encode chatFull#49a0a5d9: field call: %w", err) + return fmt.Errorf("unable to encode chatFull#4dbdc099: field call: %w", err) } } if c.Flags.Has(14) { @@ -437,10 +437,10 @@ func (c *ChatFull) EncodeBare(b *bin.Buffer) error { } if c.Flags.Has(15) { if c.GroupcallDefaultJoinAs == nil { - return fmt.Errorf("unable to encode chatFull#49a0a5d9: field groupcall_default_join_as is nil") + return fmt.Errorf("unable to encode chatFull#4dbdc099: field groupcall_default_join_as is nil") } if err := c.GroupcallDefaultJoinAs.Encode(b); err != nil { - return fmt.Errorf("unable to encode chatFull#49a0a5d9: field groupcall_default_join_as: %w", err) + return fmt.Errorf("unable to encode chatFull#4dbdc099: field groupcall_default_join_as: %w", err) } } if c.Flags.Has(16) { @@ -452,10 +452,10 @@ func (c *ChatFull) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (c *ChatFull) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode chatFull#49a0a5d9 to nil") + return fmt.Errorf("can't decode chatFull#4dbdc099 to nil") } if err := b.ConsumeID(ChatFullTypeID); err != nil { - return fmt.Errorf("unable to decode chatFull#49a0a5d9: %w", err) + return fmt.Errorf("unable to decode chatFull#4dbdc099: %w", err) } return c.DecodeBare(b) } @@ -463,57 +463,57 @@ func (c *ChatFull) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (c *ChatFull) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode chatFull#49a0a5d9 to nil") + return fmt.Errorf("can't decode chatFull#4dbdc099 to nil") } { if err := c.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode chatFull#49a0a5d9: field flags: %w", err) + return fmt.Errorf("unable to decode chatFull#4dbdc099: field flags: %w", err) } } c.CanSetUsername = c.Flags.Has(7) c.HasScheduled = c.Flags.Has(8) { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode chatFull#49a0a5d9: field id: %w", err) + return fmt.Errorf("unable to decode chatFull#4dbdc099: field id: %w", err) } c.ID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode chatFull#49a0a5d9: field about: %w", err) + return fmt.Errorf("unable to decode chatFull#4dbdc099: field about: %w", err) } c.About = value } { value, err := DecodeChatParticipants(b) if err != nil { - return fmt.Errorf("unable to decode chatFull#49a0a5d9: field participants: %w", err) + return fmt.Errorf("unable to decode chatFull#4dbdc099: field participants: %w", err) } c.Participants = value } if c.Flags.Has(2) { value, err := DecodePhoto(b) if err != nil { - return fmt.Errorf("unable to decode chatFull#49a0a5d9: field chat_photo: %w", err) + return fmt.Errorf("unable to decode chatFull#4dbdc099: field chat_photo: %w", err) } c.ChatPhoto = value } { if err := c.NotifySettings.Decode(b); err != nil { - return fmt.Errorf("unable to decode chatFull#49a0a5d9: field notify_settings: %w", err) + return fmt.Errorf("unable to decode chatFull#4dbdc099: field notify_settings: %w", err) } } if c.Flags.Has(13) { if err := c.ExportedInvite.Decode(b); err != nil { - return fmt.Errorf("unable to decode chatFull#49a0a5d9: field exported_invite: %w", err) + return fmt.Errorf("unable to decode chatFull#4dbdc099: field exported_invite: %w", err) } } if c.Flags.Has(3) { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode chatFull#49a0a5d9: field bot_info: %w", err) + return fmt.Errorf("unable to decode chatFull#4dbdc099: field bot_info: %w", err) } if headerLen > 0 { @@ -522,7 +522,7 @@ func (c *ChatFull) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { var value BotInfo if err := value.Decode(b); err != nil { - return fmt.Errorf("unable to decode chatFull#49a0a5d9: field bot_info: %w", err) + return fmt.Errorf("unable to decode chatFull#4dbdc099: field bot_info: %w", err) } c.BotInfo = append(c.BotInfo, value) } @@ -530,40 +530,40 @@ func (c *ChatFull) DecodeBare(b *bin.Buffer) error { if c.Flags.Has(6) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode chatFull#49a0a5d9: field pinned_msg_id: %w", err) + return fmt.Errorf("unable to decode chatFull#4dbdc099: field pinned_msg_id: %w", err) } c.PinnedMsgID = value } if c.Flags.Has(11) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode chatFull#49a0a5d9: field folder_id: %w", err) + return fmt.Errorf("unable to decode chatFull#4dbdc099: field folder_id: %w", err) } c.FolderID = value } if c.Flags.Has(12) { if err := c.Call.Decode(b); err != nil { - return fmt.Errorf("unable to decode chatFull#49a0a5d9: field call: %w", err) + return fmt.Errorf("unable to decode chatFull#4dbdc099: field call: %w", err) } } if c.Flags.Has(14) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode chatFull#49a0a5d9: field ttl_period: %w", err) + return fmt.Errorf("unable to decode chatFull#4dbdc099: field ttl_period: %w", err) } c.TTLPeriod = value } if c.Flags.Has(15) { value, err := DecodePeer(b) if err != nil { - return fmt.Errorf("unable to decode chatFull#49a0a5d9: field groupcall_default_join_as: %w", err) + return fmt.Errorf("unable to decode chatFull#4dbdc099: field groupcall_default_join_as: %w", err) } c.GroupcallDefaultJoinAs = value } if c.Flags.Has(16) { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode chatFull#49a0a5d9: field theme_emoticon: %w", err) + return fmt.Errorf("unable to decode chatFull#4dbdc099: field theme_emoticon: %w", err) } c.ThemeEmoticon = value } @@ -603,7 +603,7 @@ func (c *ChatFull) GetHasScheduled() (value bool) { } // GetID returns value of ID field. -func (c *ChatFull) GetID() (value int) { +func (c *ChatFull) GetID() (value int64) { return c.ID } @@ -757,7 +757,7 @@ func (c *ChatFull) GetThemeEmoticon() (value string, ok bool) { return c.ThemeEmoticon, true } -// ChannelFull represents TL type `channelFull#2f532f3c`. +// ChannelFull represents TL type `channelFull#e9b27a17`. // Full info about a channel/supergroup¹ // // Links: @@ -797,7 +797,7 @@ type ChannelFull struct { // 1) https://core.telegram.org/api/discussion Blocked bool // ID of the channel - ID int + ID int64 // Info about the channel About string // Number of participants of the channel @@ -848,7 +848,7 @@ type ChannelFull struct { // 1) https://core.telegram.org/api/channel // // Use SetMigratedFromChatID and GetMigratedFromChatID helpers. - MigratedFromChatID int + MigratedFromChatID int64 // The message ID in the original chat at which this group was migrated¹ // // Links: @@ -884,7 +884,7 @@ type ChannelFull struct { // 1) https://core.telegram.org/api/discussion // // Use SetLinkedChatID and GetLinkedChatID helpers. - LinkedChatID int + LinkedChatID int64 // Location of the geogroup // // Use SetLocation and GetLocation helpers. @@ -931,7 +931,7 @@ type ChannelFull struct { } // ChannelFullTypeID is TL type id of ChannelFull. -const ChannelFullTypeID = 0x2f532f3c +const ChannelFullTypeID = 0xe9b27a17 // construct implements constructor of ChatFullClass. func (c ChannelFull) construct() ChatFullClass { return &c } @@ -1093,7 +1093,7 @@ func (c *ChannelFull) FillFrom(from interface { GetHasScheduled() (value bool) GetCanViewStats() (value bool) GetBlocked() (value bool) - GetID() (value int) + GetID() (value int64) GetAbout() (value string) GetParticipantsCount() (value int, ok bool) GetAdminsCount() (value int, ok bool) @@ -1107,13 +1107,13 @@ func (c *ChannelFull) FillFrom(from interface { GetNotifySettings() (value PeerNotifySettings) GetExportedInvite() (value ChatInviteExported, ok bool) GetBotInfo() (value []BotInfo) - GetMigratedFromChatID() (value int, ok bool) + GetMigratedFromChatID() (value int64, ok bool) GetMigratedFromMaxID() (value int, ok bool) GetPinnedMsgID() (value int, ok bool) GetStickerset() (value StickerSet, ok bool) GetAvailableMinID() (value int, ok bool) GetFolderID() (value int, ok bool) - GetLinkedChatID() (value int, ok bool) + GetLinkedChatID() (value int64, ok bool) GetLocation() (value ChannelLocationClass, ok bool) GetSlowmodeSeconds() (value int, ok bool) GetSlowmodeNextSendDate() (value int, ok bool) @@ -1448,7 +1448,7 @@ func (c *ChannelFull) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (c *ChannelFull) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode channelFull#2f532f3c as nil") + return fmt.Errorf("can't encode channelFull#e9b27a17 as nil") } b.PutID(ChannelFullTypeID) return c.EncodeBare(b) @@ -1457,7 +1457,7 @@ func (c *ChannelFull) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (c *ChannelFull) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode channelFull#2f532f3c as nil") + return fmt.Errorf("can't encode channelFull#e9b27a17 as nil") } if !(c.CanViewParticipants == false) { c.Flags.Set(3) @@ -1550,9 +1550,9 @@ func (c *ChannelFull) EncodeBare(b *bin.Buffer) error { c.Flags.Set(27) } if err := c.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode channelFull#2f532f3c: field flags: %w", err) + return fmt.Errorf("unable to encode channelFull#e9b27a17: field flags: %w", err) } - b.PutInt(c.ID) + b.PutLong(c.ID) b.PutString(c.About) if c.Flags.Has(0) { b.PutInt(c.ParticipantsCount) @@ -1573,27 +1573,27 @@ func (c *ChannelFull) EncodeBare(b *bin.Buffer) error { b.PutInt(c.ReadOutboxMaxID) b.PutInt(c.UnreadCount) if c.ChatPhoto == nil { - return fmt.Errorf("unable to encode channelFull#2f532f3c: field chat_photo is nil") + return fmt.Errorf("unable to encode channelFull#e9b27a17: field chat_photo is nil") } if err := c.ChatPhoto.Encode(b); err != nil { - return fmt.Errorf("unable to encode channelFull#2f532f3c: field chat_photo: %w", err) + return fmt.Errorf("unable to encode channelFull#e9b27a17: field chat_photo: %w", err) } if err := c.NotifySettings.Encode(b); err != nil { - return fmt.Errorf("unable to encode channelFull#2f532f3c: field notify_settings: %w", err) + return fmt.Errorf("unable to encode channelFull#e9b27a17: field notify_settings: %w", err) } if c.Flags.Has(23) { if err := c.ExportedInvite.Encode(b); err != nil { - return fmt.Errorf("unable to encode channelFull#2f532f3c: field exported_invite: %w", err) + return fmt.Errorf("unable to encode channelFull#e9b27a17: field exported_invite: %w", err) } } b.PutVectorHeader(len(c.BotInfo)) for idx, v := range c.BotInfo { if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode channelFull#2f532f3c: field bot_info element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode channelFull#e9b27a17: field bot_info element with index %d: %w", idx, err) } } if c.Flags.Has(4) { - b.PutInt(c.MigratedFromChatID) + b.PutLong(c.MigratedFromChatID) } if c.Flags.Has(4) { b.PutInt(c.MigratedFromMaxID) @@ -1603,7 +1603,7 @@ func (c *ChannelFull) EncodeBare(b *bin.Buffer) error { } if c.Flags.Has(8) { if err := c.Stickerset.Encode(b); err != nil { - return fmt.Errorf("unable to encode channelFull#2f532f3c: field stickerset: %w", err) + return fmt.Errorf("unable to encode channelFull#e9b27a17: field stickerset: %w", err) } } if c.Flags.Has(9) { @@ -1613,14 +1613,14 @@ func (c *ChannelFull) EncodeBare(b *bin.Buffer) error { b.PutInt(c.FolderID) } if c.Flags.Has(14) { - b.PutInt(c.LinkedChatID) + b.PutLong(c.LinkedChatID) } if c.Flags.Has(15) { if c.Location == nil { - return fmt.Errorf("unable to encode channelFull#2f532f3c: field location is nil") + return fmt.Errorf("unable to encode channelFull#e9b27a17: field location is nil") } if err := c.Location.Encode(b); err != nil { - return fmt.Errorf("unable to encode channelFull#2f532f3c: field location: %w", err) + return fmt.Errorf("unable to encode channelFull#e9b27a17: field location: %w", err) } } if c.Flags.Has(17) { @@ -1635,7 +1635,7 @@ func (c *ChannelFull) EncodeBare(b *bin.Buffer) error { b.PutInt(c.Pts) if c.Flags.Has(21) { if err := c.Call.Encode(b); err != nil { - return fmt.Errorf("unable to encode channelFull#2f532f3c: field call: %w", err) + return fmt.Errorf("unable to encode channelFull#e9b27a17: field call: %w", err) } } if c.Flags.Has(24) { @@ -1649,10 +1649,10 @@ func (c *ChannelFull) EncodeBare(b *bin.Buffer) error { } if c.Flags.Has(26) { if c.GroupcallDefaultJoinAs == nil { - return fmt.Errorf("unable to encode channelFull#2f532f3c: field groupcall_default_join_as is nil") + return fmt.Errorf("unable to encode channelFull#e9b27a17: field groupcall_default_join_as is nil") } if err := c.GroupcallDefaultJoinAs.Encode(b); err != nil { - return fmt.Errorf("unable to encode channelFull#2f532f3c: field groupcall_default_join_as: %w", err) + return fmt.Errorf("unable to encode channelFull#e9b27a17: field groupcall_default_join_as: %w", err) } } if c.Flags.Has(27) { @@ -1664,10 +1664,10 @@ func (c *ChannelFull) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (c *ChannelFull) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode channelFull#2f532f3c to nil") + return fmt.Errorf("can't decode channelFull#e9b27a17 to nil") } if err := b.ConsumeID(ChannelFullTypeID); err != nil { - return fmt.Errorf("unable to decode channelFull#2f532f3c: %w", err) + return fmt.Errorf("unable to decode channelFull#e9b27a17: %w", err) } return c.DecodeBare(b) } @@ -1675,11 +1675,11 @@ func (c *ChannelFull) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (c *ChannelFull) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode channelFull#2f532f3c to nil") + return fmt.Errorf("can't decode channelFull#e9b27a17 to nil") } { if err := c.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode channelFull#2f532f3c: field flags: %w", err) + return fmt.Errorf("unable to decode channelFull#e9b27a17: field flags: %w", err) } } c.CanViewParticipants = c.Flags.Has(3) @@ -1691,96 +1691,96 @@ func (c *ChannelFull) DecodeBare(b *bin.Buffer) error { c.CanViewStats = c.Flags.Has(20) c.Blocked = c.Flags.Has(22) { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode channelFull#2f532f3c: field id: %w", err) + return fmt.Errorf("unable to decode channelFull#e9b27a17: field id: %w", err) } c.ID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode channelFull#2f532f3c: field about: %w", err) + return fmt.Errorf("unable to decode channelFull#e9b27a17: field about: %w", err) } c.About = value } if c.Flags.Has(0) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelFull#2f532f3c: field participants_count: %w", err) + return fmt.Errorf("unable to decode channelFull#e9b27a17: field participants_count: %w", err) } c.ParticipantsCount = value } if c.Flags.Has(1) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelFull#2f532f3c: field admins_count: %w", err) + return fmt.Errorf("unable to decode channelFull#e9b27a17: field admins_count: %w", err) } c.AdminsCount = value } if c.Flags.Has(2) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelFull#2f532f3c: field kicked_count: %w", err) + return fmt.Errorf("unable to decode channelFull#e9b27a17: field kicked_count: %w", err) } c.KickedCount = value } if c.Flags.Has(2) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelFull#2f532f3c: field banned_count: %w", err) + return fmt.Errorf("unable to decode channelFull#e9b27a17: field banned_count: %w", err) } c.BannedCount = value } if c.Flags.Has(13) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelFull#2f532f3c: field online_count: %w", err) + return fmt.Errorf("unable to decode channelFull#e9b27a17: field online_count: %w", err) } c.OnlineCount = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelFull#2f532f3c: field read_inbox_max_id: %w", err) + return fmt.Errorf("unable to decode channelFull#e9b27a17: field read_inbox_max_id: %w", err) } c.ReadInboxMaxID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelFull#2f532f3c: field read_outbox_max_id: %w", err) + return fmt.Errorf("unable to decode channelFull#e9b27a17: field read_outbox_max_id: %w", err) } c.ReadOutboxMaxID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelFull#2f532f3c: field unread_count: %w", err) + return fmt.Errorf("unable to decode channelFull#e9b27a17: field unread_count: %w", err) } c.UnreadCount = value } { value, err := DecodePhoto(b) if err != nil { - return fmt.Errorf("unable to decode channelFull#2f532f3c: field chat_photo: %w", err) + return fmt.Errorf("unable to decode channelFull#e9b27a17: field chat_photo: %w", err) } c.ChatPhoto = value } { if err := c.NotifySettings.Decode(b); err != nil { - return fmt.Errorf("unable to decode channelFull#2f532f3c: field notify_settings: %w", err) + return fmt.Errorf("unable to decode channelFull#e9b27a17: field notify_settings: %w", err) } } if c.Flags.Has(23) { if err := c.ExportedInvite.Decode(b); err != nil { - return fmt.Errorf("unable to decode channelFull#2f532f3c: field exported_invite: %w", err) + return fmt.Errorf("unable to decode channelFull#e9b27a17: field exported_invite: %w", err) } } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode channelFull#2f532f3c: field bot_info: %w", err) + return fmt.Errorf("unable to decode channelFull#e9b27a17: field bot_info: %w", err) } if headerLen > 0 { @@ -1789,109 +1789,109 @@ func (c *ChannelFull) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { var value BotInfo if err := value.Decode(b); err != nil { - return fmt.Errorf("unable to decode channelFull#2f532f3c: field bot_info: %w", err) + return fmt.Errorf("unable to decode channelFull#e9b27a17: field bot_info: %w", err) } c.BotInfo = append(c.BotInfo, value) } } if c.Flags.Has(4) { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode channelFull#2f532f3c: field migrated_from_chat_id: %w", err) + return fmt.Errorf("unable to decode channelFull#e9b27a17: field migrated_from_chat_id: %w", err) } c.MigratedFromChatID = value } if c.Flags.Has(4) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelFull#2f532f3c: field migrated_from_max_id: %w", err) + return fmt.Errorf("unable to decode channelFull#e9b27a17: field migrated_from_max_id: %w", err) } c.MigratedFromMaxID = value } if c.Flags.Has(5) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelFull#2f532f3c: field pinned_msg_id: %w", err) + return fmt.Errorf("unable to decode channelFull#e9b27a17: field pinned_msg_id: %w", err) } c.PinnedMsgID = value } if c.Flags.Has(8) { if err := c.Stickerset.Decode(b); err != nil { - return fmt.Errorf("unable to decode channelFull#2f532f3c: field stickerset: %w", err) + return fmt.Errorf("unable to decode channelFull#e9b27a17: field stickerset: %w", err) } } if c.Flags.Has(9) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelFull#2f532f3c: field available_min_id: %w", err) + return fmt.Errorf("unable to decode channelFull#e9b27a17: field available_min_id: %w", err) } c.AvailableMinID = value } if c.Flags.Has(11) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelFull#2f532f3c: field folder_id: %w", err) + return fmt.Errorf("unable to decode channelFull#e9b27a17: field folder_id: %w", err) } c.FolderID = value } if c.Flags.Has(14) { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode channelFull#2f532f3c: field linked_chat_id: %w", err) + return fmt.Errorf("unable to decode channelFull#e9b27a17: field linked_chat_id: %w", err) } c.LinkedChatID = value } if c.Flags.Has(15) { value, err := DecodeChannelLocation(b) if err != nil { - return fmt.Errorf("unable to decode channelFull#2f532f3c: field location: %w", err) + return fmt.Errorf("unable to decode channelFull#e9b27a17: field location: %w", err) } c.Location = value } if c.Flags.Has(17) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelFull#2f532f3c: field slowmode_seconds: %w", err) + return fmt.Errorf("unable to decode channelFull#e9b27a17: field slowmode_seconds: %w", err) } c.SlowmodeSeconds = value } if c.Flags.Has(18) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelFull#2f532f3c: field slowmode_next_send_date: %w", err) + return fmt.Errorf("unable to decode channelFull#e9b27a17: field slowmode_next_send_date: %w", err) } c.SlowmodeNextSendDate = value } if c.Flags.Has(12) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelFull#2f532f3c: field stats_dc: %w", err) + return fmt.Errorf("unable to decode channelFull#e9b27a17: field stats_dc: %w", err) } c.StatsDC = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelFull#2f532f3c: field pts: %w", err) + return fmt.Errorf("unable to decode channelFull#e9b27a17: field pts: %w", err) } c.Pts = value } if c.Flags.Has(21) { if err := c.Call.Decode(b); err != nil { - return fmt.Errorf("unable to decode channelFull#2f532f3c: field call: %w", err) + return fmt.Errorf("unable to decode channelFull#e9b27a17: field call: %w", err) } } if c.Flags.Has(24) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelFull#2f532f3c: field ttl_period: %w", err) + return fmt.Errorf("unable to decode channelFull#e9b27a17: field ttl_period: %w", err) } c.TTLPeriod = value } if c.Flags.Has(25) { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode channelFull#2f532f3c: field pending_suggestions: %w", err) + return fmt.Errorf("unable to decode channelFull#e9b27a17: field pending_suggestions: %w", err) } if headerLen > 0 { @@ -1900,7 +1900,7 @@ func (c *ChannelFull) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode channelFull#2f532f3c: field pending_suggestions: %w", err) + return fmt.Errorf("unable to decode channelFull#e9b27a17: field pending_suggestions: %w", err) } c.PendingSuggestions = append(c.PendingSuggestions, value) } @@ -1908,14 +1908,14 @@ func (c *ChannelFull) DecodeBare(b *bin.Buffer) error { if c.Flags.Has(26) { value, err := DecodePeer(b) if err != nil { - return fmt.Errorf("unable to decode channelFull#2f532f3c: field groupcall_default_join_as: %w", err) + return fmt.Errorf("unable to decode channelFull#e9b27a17: field groupcall_default_join_as: %w", err) } c.GroupcallDefaultJoinAs = value } if c.Flags.Has(27) { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode channelFull#2f532f3c: field theme_emoticon: %w", err) + return fmt.Errorf("unable to decode channelFull#e9b27a17: field theme_emoticon: %w", err) } c.ThemeEmoticon = value } @@ -2051,7 +2051,7 @@ func (c *ChannelFull) GetBlocked() (value bool) { } // GetID returns value of ID field. -func (c *ChannelFull) GetID() (value int) { +func (c *ChannelFull) GetID() (value int64) { return c.ID } @@ -2181,14 +2181,14 @@ func (c *ChannelFull) GetBotInfo() (value []BotInfo) { } // SetMigratedFromChatID sets value of MigratedFromChatID conditional field. -func (c *ChannelFull) SetMigratedFromChatID(value int) { +func (c *ChannelFull) SetMigratedFromChatID(value int64) { c.Flags.Set(4) c.MigratedFromChatID = value } // GetMigratedFromChatID returns value of MigratedFromChatID conditional field and // boolean which is true if field was set. -func (c *ChannelFull) GetMigratedFromChatID() (value int, ok bool) { +func (c *ChannelFull) GetMigratedFromChatID() (value int64, ok bool) { if !c.Flags.Has(4) { return value, false } @@ -2271,14 +2271,14 @@ func (c *ChannelFull) GetFolderID() (value int, ok bool) { } // SetLinkedChatID sets value of LinkedChatID conditional field. -func (c *ChannelFull) SetLinkedChatID(value int) { +func (c *ChannelFull) SetLinkedChatID(value int64) { c.Flags.Set(14) c.LinkedChatID = value } // GetLinkedChatID returns value of LinkedChatID conditional field and // boolean which is true if field was set. -func (c *ChannelFull) GetLinkedChatID() (value int, ok bool) { +func (c *ChannelFull) GetLinkedChatID() (value int64, ok bool) { if !c.Flags.Has(14) { return value, false } @@ -2435,8 +2435,8 @@ func (c *ChannelFull) GetThemeEmoticon() (value string, ok bool) { // panic(err) // } // switch v := g.(type) { -// case *tg.ChatFull: // chatFull#49a0a5d9 -// case *tg.ChannelFull: // channelFull#2f532f3c +// case *tg.ChatFull: // chatFull#4dbdc099 +// case *tg.ChannelFull: // channelFull#e9b27a17 // default: panic(v) // } type ChatFullClass interface { @@ -2467,7 +2467,7 @@ type ChatFullClass interface { GetHasScheduled() (value bool) // ID of the chat - GetID() (value int) + GetID() (value int64) // About string for this chat GetAbout() (value string) @@ -2511,14 +2511,14 @@ func DecodeChatFull(buf *bin.Buffer) (ChatFullClass, error) { } switch id { case ChatFullTypeID: - // Decoding chatFull#49a0a5d9. + // Decoding chatFull#4dbdc099. v := ChatFull{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode ChatFullClass: %w", err) } return &v, nil case ChannelFullTypeID: - // Decoding channelFull#2f532f3c. + // Decoding channelFull#e9b27a17. v := ChannelFull{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode ChatFullClass: %w", err) diff --git a/tg/tl_chat_full_slices_gen.go b/tg/tl_chat_full_slices_gen.go index 0bd9c22405..a7bb31abb5 100644 --- a/tg/tl_chat_full_slices_gen.go +++ b/tg/tl_chat_full_slices_gen.go @@ -129,7 +129,7 @@ func (s ChatFullClassArray) SortStableByID() ChatFullClassArray { } // FillChatFullMap fills only ChatFull constructors to given map. -func (s ChatFullClassArray) FillChatFullMap(to map[int]*ChatFull) { +func (s ChatFullClassArray) FillChatFullMap(to map[int64]*ChatFull) { for _, elem := range s { value, ok := elem.(*ChatFull) if !ok { @@ -140,8 +140,8 @@ func (s ChatFullClassArray) FillChatFullMap(to map[int]*ChatFull) { } // ChatFullToMap collects only ChatFull constructors to map. -func (s ChatFullClassArray) ChatFullToMap() map[int]*ChatFull { - r := make(map[int]*ChatFull, len(s)) +func (s ChatFullClassArray) ChatFullToMap() map[int64]*ChatFull { + r := make(map[int64]*ChatFull, len(s)) s.FillChatFullMap(r) return r } @@ -160,7 +160,7 @@ func (s ChatFullClassArray) AsChatFull() (to ChatFullArray) { } // FillChannelFullMap fills only ChannelFull constructors to given map. -func (s ChatFullClassArray) FillChannelFullMap(to map[int]*ChannelFull) { +func (s ChatFullClassArray) FillChannelFullMap(to map[int64]*ChannelFull) { for _, elem := range s { value, ok := elem.(*ChannelFull) if !ok { @@ -171,8 +171,8 @@ func (s ChatFullClassArray) FillChannelFullMap(to map[int]*ChannelFull) { } // ChannelFullToMap collects only ChannelFull constructors to map. -func (s ChatFullClassArray) ChannelFullToMap() map[int]*ChannelFull { - r := make(map[int]*ChannelFull, len(s)) +func (s ChatFullClassArray) ChannelFullToMap() map[int64]*ChannelFull { + r := make(map[int64]*ChannelFull, len(s)) s.FillChannelFullMap(r) return r } @@ -287,15 +287,15 @@ func (s ChatFullArray) SortStableByID() ChatFullArray { } // FillMap fills constructors to given map. -func (s ChatFullArray) FillMap(to map[int]ChatFull) { +func (s ChatFullArray) FillMap(to map[int64]ChatFull) { for _, value := range s { to[value.GetID()] = value } } // ToMap collects constructors to map. -func (s ChatFullArray) ToMap() map[int]ChatFull { - r := make(map[int]ChatFull, len(s)) +func (s ChatFullArray) ToMap() map[int64]ChatFull { + r := make(map[int64]ChatFull, len(s)) s.FillMap(r) return r } @@ -397,15 +397,15 @@ func (s ChannelFullArray) SortStableByID() ChannelFullArray { } // FillMap fills constructors to given map. -func (s ChannelFullArray) FillMap(to map[int]ChannelFull) { +func (s ChannelFullArray) FillMap(to map[int64]ChannelFull) { for _, value := range s { to[value.GetID()] = value } } // ToMap collects constructors to map. -func (s ChannelFullArray) ToMap() map[int]ChannelFull { - r := make(map[int]ChannelFull, len(s)) +func (s ChannelFullArray) ToMap() map[int64]ChannelFull { + r := make(map[int64]ChannelFull, len(s)) s.FillMap(r) return r } diff --git a/tg/tl_chat_gen.go b/tg/tl_chat_gen.go index 7461b5a8f5..07d57282d4 100644 --- a/tg/tl_chat_gen.go +++ b/tg/tl_chat_gen.go @@ -29,17 +29,17 @@ var ( _ = tgerr.Error{} ) -// ChatEmpty represents TL type `chatEmpty#9ba2d800`. +// ChatEmpty represents TL type `chatEmpty#29562865`. // Empty constructor, group doesn't exist // // See https://core.telegram.org/constructor/chatEmpty for reference. type ChatEmpty struct { // Group identifier - ID int + ID int64 } // ChatEmptyTypeID is TL type id of ChatEmpty. -const ChatEmptyTypeID = 0x9ba2d800 +const ChatEmptyTypeID = 0x29562865 // construct implements constructor of ChatClass. func (c ChatEmpty) construct() ChatClass { return &c } @@ -76,7 +76,7 @@ func (c *ChatEmpty) String() string { // FillFrom fills ChatEmpty from given interface. func (c *ChatEmpty) FillFrom(from interface { - GetID() (value int) + GetID() (value int64) }) { c.ID = from.GetID() } @@ -115,7 +115,7 @@ func (c *ChatEmpty) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (c *ChatEmpty) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chatEmpty#9ba2d800 as nil") + return fmt.Errorf("can't encode chatEmpty#29562865 as nil") } b.PutID(ChatEmptyTypeID) return c.EncodeBare(b) @@ -124,19 +124,19 @@ func (c *ChatEmpty) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (c *ChatEmpty) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chatEmpty#9ba2d800 as nil") + return fmt.Errorf("can't encode chatEmpty#29562865 as nil") } - b.PutInt(c.ID) + b.PutLong(c.ID) return nil } // Decode implements bin.Decoder. func (c *ChatEmpty) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode chatEmpty#9ba2d800 to nil") + return fmt.Errorf("can't decode chatEmpty#29562865 to nil") } if err := b.ConsumeID(ChatEmptyTypeID); err != nil { - return fmt.Errorf("unable to decode chatEmpty#9ba2d800: %w", err) + return fmt.Errorf("unable to decode chatEmpty#29562865: %w", err) } return c.DecodeBare(b) } @@ -144,12 +144,12 @@ func (c *ChatEmpty) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (c *ChatEmpty) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode chatEmpty#9ba2d800 to nil") + return fmt.Errorf("can't decode chatEmpty#29562865 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode chatEmpty#9ba2d800: field id: %w", err) + return fmt.Errorf("unable to decode chatEmpty#29562865: field id: %w", err) } c.ID = value } @@ -157,11 +157,11 @@ func (c *ChatEmpty) DecodeBare(b *bin.Buffer) error { } // GetID returns value of ID field. -func (c *ChatEmpty) GetID() (value int) { +func (c *ChatEmpty) GetID() (value int64) { return c.ID } -// Chat represents TL type `chat#3bda1bde`. +// Chat represents TL type `chat#41cbf256`. // Info about a group // // See https://core.telegram.org/constructor/chat for reference. @@ -187,7 +187,7 @@ type Chat struct { // CallNotEmpty field of Chat. CallNotEmpty bool // ID of the group - ID int + ID int64 // Title Title string // Chat photo @@ -222,7 +222,7 @@ type Chat struct { } // ChatTypeID is TL type id of Chat. -const ChatTypeID = 0x3bda1bde +const ChatTypeID = 0x41cbf256 // construct implements constructor of ChatClass. func (c Chat) construct() ChatClass { return &c } @@ -310,7 +310,7 @@ func (c *Chat) FillFrom(from interface { GetDeactivated() (value bool) GetCallActive() (value bool) GetCallNotEmpty() (value bool) - GetID() (value int) + GetID() (value int64) GetTitle() (value string) GetPhoto() (value ChatPhotoClass) GetParticipantsCount() (value int) @@ -445,7 +445,7 @@ func (c *Chat) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (c *Chat) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chat#3bda1bde as nil") + return fmt.Errorf("can't encode chat#41cbf256 as nil") } b.PutID(ChatTypeID) return c.EncodeBare(b) @@ -454,7 +454,7 @@ func (c *Chat) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (c *Chat) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chat#3bda1bde as nil") + return fmt.Errorf("can't encode chat#41cbf256 as nil") } if !(c.Creator == false) { c.Flags.Set(0) @@ -484,35 +484,35 @@ func (c *Chat) EncodeBare(b *bin.Buffer) error { c.Flags.Set(18) } if err := c.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#3bda1bde: field flags: %w", err) + return fmt.Errorf("unable to encode chat#41cbf256: field flags: %w", err) } - b.PutInt(c.ID) + b.PutLong(c.ID) b.PutString(c.Title) if c.Photo == nil { - return fmt.Errorf("unable to encode chat#3bda1bde: field photo is nil") + return fmt.Errorf("unable to encode chat#41cbf256: field photo is nil") } if err := c.Photo.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#3bda1bde: field photo: %w", err) + return fmt.Errorf("unable to encode chat#41cbf256: field photo: %w", err) } b.PutInt(c.ParticipantsCount) b.PutInt(c.Date) b.PutInt(c.Version) if c.Flags.Has(6) { if c.MigratedTo == nil { - return fmt.Errorf("unable to encode chat#3bda1bde: field migrated_to is nil") + return fmt.Errorf("unable to encode chat#41cbf256: field migrated_to is nil") } if err := c.MigratedTo.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#3bda1bde: field migrated_to: %w", err) + return fmt.Errorf("unable to encode chat#41cbf256: field migrated_to: %w", err) } } if c.Flags.Has(14) { if err := c.AdminRights.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#3bda1bde: field admin_rights: %w", err) + return fmt.Errorf("unable to encode chat#41cbf256: field admin_rights: %w", err) } } if c.Flags.Has(18) { if err := c.DefaultBannedRights.Encode(b); err != nil { - return fmt.Errorf("unable to encode chat#3bda1bde: field default_banned_rights: %w", err) + return fmt.Errorf("unable to encode chat#41cbf256: field default_banned_rights: %w", err) } } return nil @@ -521,10 +521,10 @@ func (c *Chat) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (c *Chat) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode chat#3bda1bde to nil") + return fmt.Errorf("can't decode chat#41cbf256 to nil") } if err := b.ConsumeID(ChatTypeID); err != nil { - return fmt.Errorf("unable to decode chat#3bda1bde: %w", err) + return fmt.Errorf("unable to decode chat#41cbf256: %w", err) } return c.DecodeBare(b) } @@ -532,11 +532,11 @@ func (c *Chat) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (c *Chat) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode chat#3bda1bde to nil") + return fmt.Errorf("can't decode chat#41cbf256 to nil") } { if err := c.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode chat#3bda1bde: field flags: %w", err) + return fmt.Errorf("unable to decode chat#41cbf256: field flags: %w", err) } } c.Creator = c.Flags.Has(0) @@ -546,62 +546,62 @@ func (c *Chat) DecodeBare(b *bin.Buffer) error { c.CallActive = c.Flags.Has(23) c.CallNotEmpty = c.Flags.Has(24) { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode chat#3bda1bde: field id: %w", err) + return fmt.Errorf("unable to decode chat#41cbf256: field id: %w", err) } c.ID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode chat#3bda1bde: field title: %w", err) + return fmt.Errorf("unable to decode chat#41cbf256: field title: %w", err) } c.Title = value } { value, err := DecodeChatPhoto(b) if err != nil { - return fmt.Errorf("unable to decode chat#3bda1bde: field photo: %w", err) + return fmt.Errorf("unable to decode chat#41cbf256: field photo: %w", err) } c.Photo = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode chat#3bda1bde: field participants_count: %w", err) + return fmt.Errorf("unable to decode chat#41cbf256: field participants_count: %w", err) } c.ParticipantsCount = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode chat#3bda1bde: field date: %w", err) + return fmt.Errorf("unable to decode chat#41cbf256: field date: %w", err) } c.Date = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode chat#3bda1bde: field version: %w", err) + return fmt.Errorf("unable to decode chat#41cbf256: field version: %w", err) } c.Version = value } if c.Flags.Has(6) { value, err := DecodeInputChannel(b) if err != nil { - return fmt.Errorf("unable to decode chat#3bda1bde: field migrated_to: %w", err) + return fmt.Errorf("unable to decode chat#41cbf256: field migrated_to: %w", err) } c.MigratedTo = value } if c.Flags.Has(14) { if err := c.AdminRights.Decode(b); err != nil { - return fmt.Errorf("unable to decode chat#3bda1bde: field admin_rights: %w", err) + return fmt.Errorf("unable to decode chat#41cbf256: field admin_rights: %w", err) } } if c.Flags.Has(18) { if err := c.DefaultBannedRights.Decode(b); err != nil { - return fmt.Errorf("unable to decode chat#3bda1bde: field default_banned_rights: %w", err) + return fmt.Errorf("unable to decode chat#41cbf256: field default_banned_rights: %w", err) } } return nil @@ -704,7 +704,7 @@ func (c *Chat) GetCallNotEmpty() (value bool) { } // GetID returns value of ID field. -func (c *Chat) GetID() (value int) { +func (c *Chat) GetID() (value int64) { return c.ID } @@ -778,20 +778,20 @@ func (c *Chat) GetDefaultBannedRights() (value ChatBannedRights, ok bool) { return c.DefaultBannedRights, true } -// ChatForbidden represents TL type `chatForbidden#7328bdb`. +// ChatForbidden represents TL type `chatForbidden#6592a1a7`. // A group to which the user has no access. E.g., because the user was kicked from the // group. // // See https://core.telegram.org/constructor/chatForbidden for reference. type ChatForbidden struct { // User identifier - ID int + ID int64 // Group name Title string } // ChatForbiddenTypeID is TL type id of ChatForbidden. -const ChatForbiddenTypeID = 0x7328bdb +const ChatForbiddenTypeID = 0x6592a1a7 // construct implements constructor of ChatClass. func (c ChatForbidden) construct() ChatClass { return &c } @@ -831,7 +831,7 @@ func (c *ChatForbidden) String() string { // FillFrom fills ChatForbidden from given interface. func (c *ChatForbidden) FillFrom(from interface { - GetID() (value int) + GetID() (value int64) GetTitle() (value string) }) { c.ID = from.GetID() @@ -876,7 +876,7 @@ func (c *ChatForbidden) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (c *ChatForbidden) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chatForbidden#7328bdb as nil") + return fmt.Errorf("can't encode chatForbidden#6592a1a7 as nil") } b.PutID(ChatForbiddenTypeID) return c.EncodeBare(b) @@ -885,9 +885,9 @@ func (c *ChatForbidden) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (c *ChatForbidden) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chatForbidden#7328bdb as nil") + return fmt.Errorf("can't encode chatForbidden#6592a1a7 as nil") } - b.PutInt(c.ID) + b.PutLong(c.ID) b.PutString(c.Title) return nil } @@ -895,10 +895,10 @@ func (c *ChatForbidden) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (c *ChatForbidden) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode chatForbidden#7328bdb to nil") + return fmt.Errorf("can't decode chatForbidden#6592a1a7 to nil") } if err := b.ConsumeID(ChatForbiddenTypeID); err != nil { - return fmt.Errorf("unable to decode chatForbidden#7328bdb: %w", err) + return fmt.Errorf("unable to decode chatForbidden#6592a1a7: %w", err) } return c.DecodeBare(b) } @@ -906,19 +906,19 @@ func (c *ChatForbidden) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (c *ChatForbidden) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode chatForbidden#7328bdb to nil") + return fmt.Errorf("can't decode chatForbidden#6592a1a7 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode chatForbidden#7328bdb: field id: %w", err) + return fmt.Errorf("unable to decode chatForbidden#6592a1a7: field id: %w", err) } c.ID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode chatForbidden#7328bdb: field title: %w", err) + return fmt.Errorf("unable to decode chatForbidden#6592a1a7: field title: %w", err) } c.Title = value } @@ -926,7 +926,7 @@ func (c *ChatForbidden) DecodeBare(b *bin.Buffer) error { } // GetID returns value of ID field. -func (c *ChatForbidden) GetID() (value int) { +func (c *ChatForbidden) GetID() (value int64) { return c.ID } @@ -935,7 +935,7 @@ func (c *ChatForbidden) GetTitle() (value string) { return c.Title } -// Channel represents TL type `channel#d31a961e`. +// Channel represents TL type `channel#8261ac61`. // Channel/supergroup info // // See https://core.telegram.org/constructor/channel for reference. @@ -981,7 +981,7 @@ type Channel struct { // Gigagroup field of Channel. Gigagroup bool // ID of the channel - ID int + ID int64 // Access hash // // Use SetAccessHash and GetAccessHash helpers. @@ -997,8 +997,6 @@ type Channel struct { // Date when the user joined the supergroup/channel, or if the user isn't a member, its // creation date Date int - // Version of the channel (always 0) - Version int // Contains the reason why access to this channel must be restricted. // // Use SetRestrictionReason and GetRestrictionReason helpers. @@ -1031,7 +1029,7 @@ type Channel struct { } // ChannelTypeID is TL type id of Channel. -const ChannelTypeID = 0xd31a961e +const ChannelTypeID = 0x8261ac61 // construct implements constructor of ChatClass. func (c Channel) construct() ChatClass { return &c } @@ -1119,9 +1117,6 @@ func (c *Channel) Zero() bool { if !(c.Date == 0) { return false } - if !(c.Version == 0) { - return false - } if !(c.RestrictionReason == nil) { return false } @@ -1168,13 +1163,12 @@ func (c *Channel) FillFrom(from interface { GetCallNotEmpty() (value bool) GetFake() (value bool) GetGigagroup() (value bool) - GetID() (value int) + GetID() (value int64) GetAccessHash() (value int64, ok bool) GetTitle() (value string) GetUsername() (value string, ok bool) GetPhoto() (value ChatPhotoClass) GetDate() (value int) - GetVersion() (value int) GetRestrictionReason() (value []RestrictionReason, ok bool) GetAdminRights() (value ChatAdminRights, ok bool) GetBannedRights() (value ChatBannedRights, ok bool) @@ -1209,7 +1203,6 @@ func (c *Channel) FillFrom(from interface { c.Photo = from.GetPhoto() c.Date = from.GetDate() - c.Version = from.GetVersion() if val, ok := from.GetRestrictionReason(); ok { c.RestrictionReason = val } @@ -1361,10 +1354,6 @@ func (c *Channel) TypeInfo() tdp.Type { Name: "Date", SchemaName: "date", }, - { - Name: "Version", - SchemaName: "version", - }, { Name: "RestrictionReason", SchemaName: "restriction_reason", @@ -1397,7 +1386,7 @@ func (c *Channel) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (c *Channel) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode channel#d31a961e as nil") + return fmt.Errorf("can't encode channel#8261ac61 as nil") } b.PutID(ChannelTypeID) return c.EncodeBare(b) @@ -1406,7 +1395,7 @@ func (c *Channel) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (c *Channel) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode channel#d31a961e as nil") + return fmt.Errorf("can't encode channel#8261ac61 as nil") } if !(c.Creator == false) { c.Flags.Set(0) @@ -1478,9 +1467,9 @@ func (c *Channel) EncodeBare(b *bin.Buffer) error { c.Flags.Set(17) } if err := c.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode channel#d31a961e: field flags: %w", err) + return fmt.Errorf("unable to encode channel#8261ac61: field flags: %w", err) } - b.PutInt(c.ID) + b.PutLong(c.ID) if c.Flags.Has(13) { b.PutLong(c.AccessHash) } @@ -1489,34 +1478,33 @@ func (c *Channel) EncodeBare(b *bin.Buffer) error { b.PutString(c.Username) } if c.Photo == nil { - return fmt.Errorf("unable to encode channel#d31a961e: field photo is nil") + return fmt.Errorf("unable to encode channel#8261ac61: field photo is nil") } if err := c.Photo.Encode(b); err != nil { - return fmt.Errorf("unable to encode channel#d31a961e: field photo: %w", err) + return fmt.Errorf("unable to encode channel#8261ac61: field photo: %w", err) } b.PutInt(c.Date) - b.PutInt(c.Version) if c.Flags.Has(9) { b.PutVectorHeader(len(c.RestrictionReason)) for idx, v := range c.RestrictionReason { if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode channel#d31a961e: field restriction_reason element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode channel#8261ac61: field restriction_reason element with index %d: %w", idx, err) } } } if c.Flags.Has(14) { if err := c.AdminRights.Encode(b); err != nil { - return fmt.Errorf("unable to encode channel#d31a961e: field admin_rights: %w", err) + return fmt.Errorf("unable to encode channel#8261ac61: field admin_rights: %w", err) } } if c.Flags.Has(15) { if err := c.BannedRights.Encode(b); err != nil { - return fmt.Errorf("unable to encode channel#d31a961e: field banned_rights: %w", err) + return fmt.Errorf("unable to encode channel#8261ac61: field banned_rights: %w", err) } } if c.Flags.Has(18) { if err := c.DefaultBannedRights.Encode(b); err != nil { - return fmt.Errorf("unable to encode channel#d31a961e: field default_banned_rights: %w", err) + return fmt.Errorf("unable to encode channel#8261ac61: field default_banned_rights: %w", err) } } if c.Flags.Has(17) { @@ -1528,10 +1516,10 @@ func (c *Channel) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (c *Channel) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode channel#d31a961e to nil") + return fmt.Errorf("can't decode channel#8261ac61 to nil") } if err := b.ConsumeID(ChannelTypeID); err != nil { - return fmt.Errorf("unable to decode channel#d31a961e: %w", err) + return fmt.Errorf("unable to decode channel#8261ac61: %w", err) } return c.DecodeBare(b) } @@ -1539,11 +1527,11 @@ func (c *Channel) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (c *Channel) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode channel#d31a961e to nil") + return fmt.Errorf("can't decode channel#8261ac61 to nil") } { if err := c.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode channel#d31a961e: field flags: %w", err) + return fmt.Errorf("unable to decode channel#8261ac61: field flags: %w", err) } } c.Creator = c.Flags.Has(0) @@ -1563,58 +1551,51 @@ func (c *Channel) DecodeBare(b *bin.Buffer) error { c.Fake = c.Flags.Has(25) c.Gigagroup = c.Flags.Has(26) { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode channel#d31a961e: field id: %w", err) + return fmt.Errorf("unable to decode channel#8261ac61: field id: %w", err) } c.ID = value } if c.Flags.Has(13) { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode channel#d31a961e: field access_hash: %w", err) + return fmt.Errorf("unable to decode channel#8261ac61: field access_hash: %w", err) } c.AccessHash = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode channel#d31a961e: field title: %w", err) + return fmt.Errorf("unable to decode channel#8261ac61: field title: %w", err) } c.Title = value } if c.Flags.Has(6) { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode channel#d31a961e: field username: %w", err) + return fmt.Errorf("unable to decode channel#8261ac61: field username: %w", err) } c.Username = value } { value, err := DecodeChatPhoto(b) if err != nil { - return fmt.Errorf("unable to decode channel#d31a961e: field photo: %w", err) + return fmt.Errorf("unable to decode channel#8261ac61: field photo: %w", err) } c.Photo = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channel#d31a961e: field date: %w", err) + return fmt.Errorf("unable to decode channel#8261ac61: field date: %w", err) } c.Date = value } - { - value, err := b.Int() - if err != nil { - return fmt.Errorf("unable to decode channel#d31a961e: field version: %w", err) - } - c.Version = value - } if c.Flags.Has(9) { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode channel#d31a961e: field restriction_reason: %w", err) + return fmt.Errorf("unable to decode channel#8261ac61: field restriction_reason: %w", err) } if headerLen > 0 { @@ -1623,30 +1604,30 @@ func (c *Channel) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { var value RestrictionReason if err := value.Decode(b); err != nil { - return fmt.Errorf("unable to decode channel#d31a961e: field restriction_reason: %w", err) + return fmt.Errorf("unable to decode channel#8261ac61: field restriction_reason: %w", err) } c.RestrictionReason = append(c.RestrictionReason, value) } } if c.Flags.Has(14) { if err := c.AdminRights.Decode(b); err != nil { - return fmt.Errorf("unable to decode channel#d31a961e: field admin_rights: %w", err) + return fmt.Errorf("unable to decode channel#8261ac61: field admin_rights: %w", err) } } if c.Flags.Has(15) { if err := c.BannedRights.Decode(b); err != nil { - return fmt.Errorf("unable to decode channel#d31a961e: field banned_rights: %w", err) + return fmt.Errorf("unable to decode channel#8261ac61: field banned_rights: %w", err) } } if c.Flags.Has(18) { if err := c.DefaultBannedRights.Decode(b); err != nil { - return fmt.Errorf("unable to decode channel#d31a961e: field default_banned_rights: %w", err) + return fmt.Errorf("unable to decode channel#8261ac61: field default_banned_rights: %w", err) } } if c.Flags.Has(17) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channel#d31a961e: field participants_count: %w", err) + return fmt.Errorf("unable to decode channel#8261ac61: field participants_count: %w", err) } c.ParticipantsCount = value } @@ -1910,7 +1891,7 @@ func (c *Channel) GetGigagroup() (value bool) { } // GetID returns value of ID field. -func (c *Channel) GetID() (value int) { +func (c *Channel) GetID() (value int64) { return c.ID } @@ -1959,11 +1940,6 @@ func (c *Channel) GetDate() (value int) { return c.Date } -// GetVersion returns value of Version field. -func (c *Channel) GetVersion() (value int) { - return c.Version -} - // SetRestrictionReason sets value of RestrictionReason conditional field. func (c *Channel) SetRestrictionReason(value []RestrictionReason) { c.Flags.Set(9) @@ -2039,7 +2015,7 @@ func (c *Channel) GetParticipantsCount() (value int, ok bool) { return c.ParticipantsCount, true } -// ChannelForbidden represents TL type `channelForbidden#289da732`. +// ChannelForbidden represents TL type `channelForbidden#17d493d5`. // Indicates a channel/supergroup we can't access because we were banned, or for some // other reason. // @@ -2055,7 +2031,7 @@ type ChannelForbidden struct { // Is this a supergroup Megagroup bool // Channel ID - ID int + ID int64 // Access hash AccessHash int64 // Title @@ -2067,7 +2043,7 @@ type ChannelForbidden struct { } // ChannelForbiddenTypeID is TL type id of ChannelForbidden. -const ChannelForbiddenTypeID = 0x289da732 +const ChannelForbiddenTypeID = 0x17d493d5 // construct implements constructor of ChatClass. func (c ChannelForbidden) construct() ChatClass { return &c } @@ -2124,7 +2100,7 @@ func (c *ChannelForbidden) String() string { func (c *ChannelForbidden) FillFrom(from interface { GetBroadcast() (value bool) GetMegagroup() (value bool) - GetID() (value int) + GetID() (value int64) GetAccessHash() (value int64) GetTitle() (value string) GetUntilDate() (value int, ok bool) @@ -2197,7 +2173,7 @@ func (c *ChannelForbidden) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (c *ChannelForbidden) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode channelForbidden#289da732 as nil") + return fmt.Errorf("can't encode channelForbidden#17d493d5 as nil") } b.PutID(ChannelForbiddenTypeID) return c.EncodeBare(b) @@ -2206,7 +2182,7 @@ func (c *ChannelForbidden) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (c *ChannelForbidden) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode channelForbidden#289da732 as nil") + return fmt.Errorf("can't encode channelForbidden#17d493d5 as nil") } if !(c.Broadcast == false) { c.Flags.Set(5) @@ -2218,9 +2194,9 @@ func (c *ChannelForbidden) EncodeBare(b *bin.Buffer) error { c.Flags.Set(16) } if err := c.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode channelForbidden#289da732: field flags: %w", err) + return fmt.Errorf("unable to encode channelForbidden#17d493d5: field flags: %w", err) } - b.PutInt(c.ID) + b.PutLong(c.ID) b.PutLong(c.AccessHash) b.PutString(c.Title) if c.Flags.Has(16) { @@ -2232,10 +2208,10 @@ func (c *ChannelForbidden) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (c *ChannelForbidden) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode channelForbidden#289da732 to nil") + return fmt.Errorf("can't decode channelForbidden#17d493d5 to nil") } if err := b.ConsumeID(ChannelForbiddenTypeID); err != nil { - return fmt.Errorf("unable to decode channelForbidden#289da732: %w", err) + return fmt.Errorf("unable to decode channelForbidden#17d493d5: %w", err) } return c.DecodeBare(b) } @@ -2243,40 +2219,40 @@ func (c *ChannelForbidden) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (c *ChannelForbidden) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode channelForbidden#289da732 to nil") + return fmt.Errorf("can't decode channelForbidden#17d493d5 to nil") } { if err := c.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode channelForbidden#289da732: field flags: %w", err) + return fmt.Errorf("unable to decode channelForbidden#17d493d5: field flags: %w", err) } } c.Broadcast = c.Flags.Has(5) c.Megagroup = c.Flags.Has(8) { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode channelForbidden#289da732: field id: %w", err) + return fmt.Errorf("unable to decode channelForbidden#17d493d5: field id: %w", err) } c.ID = value } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode channelForbidden#289da732: field access_hash: %w", err) + return fmt.Errorf("unable to decode channelForbidden#17d493d5: field access_hash: %w", err) } c.AccessHash = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode channelForbidden#289da732: field title: %w", err) + return fmt.Errorf("unable to decode channelForbidden#17d493d5: field title: %w", err) } c.Title = value } if c.Flags.Has(16) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelForbidden#289da732: field until_date: %w", err) + return fmt.Errorf("unable to decode channelForbidden#17d493d5: field until_date: %w", err) } c.UntilDate = value } @@ -2316,7 +2292,7 @@ func (c *ChannelForbidden) GetMegagroup() (value bool) { } // GetID returns value of ID field. -func (c *ChannelForbidden) GetID() (value int) { +func (c *ChannelForbidden) GetID() (value int64) { return c.ID } @@ -2355,11 +2331,11 @@ func (c *ChannelForbidden) GetUntilDate() (value int, ok bool) { // panic(err) // } // switch v := g.(type) { -// case *tg.ChatEmpty: // chatEmpty#9ba2d800 -// case *tg.Chat: // chat#3bda1bde -// case *tg.ChatForbidden: // chatForbidden#7328bdb -// case *tg.Channel: // channel#d31a961e -// case *tg.ChannelForbidden: // channelForbidden#289da732 +// case *tg.ChatEmpty: // chatEmpty#29562865 +// case *tg.Chat: // chat#41cbf256 +// case *tg.ChatForbidden: // chatForbidden#6592a1a7 +// case *tg.Channel: // channel#8261ac61 +// case *tg.ChannelForbidden: // channelForbidden#17d493d5 // default: panic(v) // } type ChatClass interface { @@ -2381,7 +2357,7 @@ type ChatClass interface { Zero() bool // Group identifier - GetID() (value int) + GetID() (value int64) // AsNotEmpty tries to map ChatClass to NotEmptyChat. AsNotEmpty() (NotEmptyChat, bool) @@ -2441,7 +2417,7 @@ type NotEmptyChat interface { Zero() bool // ID of the group - GetID() (value int) + GetID() (value int64) // Title GetTitle() (value string) @@ -2497,7 +2473,7 @@ type NotForbiddenChat interface { Zero() bool // Group identifier - GetID() (value int) + GetID() (value int64) } // AsNotForbidden tries to map ChatEmpty to NotForbiddenChat. @@ -2562,7 +2538,7 @@ type FullChat interface { GetCallNotEmpty() (value bool) // ID of the group - GetID() (value int) + GetID() (value int64) // Title GetTitle() (value string) @@ -2573,9 +2549,6 @@ type FullChat interface { // Date of creation of the group GetDate() (value int) - // Used in basic groups to reorder updates and make sure that all of them were received. - GetVersion() (value int) - // Admin rights¹ of the user in the group // // Links: @@ -2627,35 +2600,35 @@ func DecodeChat(buf *bin.Buffer) (ChatClass, error) { } switch id { case ChatEmptyTypeID: - // Decoding chatEmpty#9ba2d800. + // Decoding chatEmpty#29562865. v := ChatEmpty{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode ChatClass: %w", err) } return &v, nil case ChatTypeID: - // Decoding chat#3bda1bde. + // Decoding chat#41cbf256. v := Chat{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode ChatClass: %w", err) } return &v, nil case ChatForbiddenTypeID: - // Decoding chatForbidden#7328bdb. + // Decoding chatForbidden#6592a1a7. v := ChatForbidden{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode ChatClass: %w", err) } return &v, nil case ChannelTypeID: - // Decoding channel#d31a961e. + // Decoding channel#8261ac61. v := Channel{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode ChatClass: %w", err) } return &v, nil case ChannelForbiddenTypeID: - // Decoding channelForbidden#289da732. + // Decoding channelForbidden#17d493d5. v := ChannelForbidden{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode ChatClass: %w", err) diff --git a/tg/tl_chat_invite_exported_gen.go b/tg/tl_chat_invite_exported_gen.go index 3a1867912e..01b98d844b 100644 --- a/tg/tl_chat_invite_exported_gen.go +++ b/tg/tl_chat_invite_exported_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// ChatInviteExported represents TL type `chatInviteExported#6e24fc9d`. +// ChatInviteExported represents TL type `chatInviteExported#b18105e8`. // Exported chat invite // // See https://core.telegram.org/constructor/chatInviteExported for reference. @@ -43,7 +43,7 @@ type ChatInviteExported struct { // Chat invitation link Link string // AdminID field of ChatInviteExported. - AdminID int + AdminID int64 // Date field of ChatInviteExported. Date int // StartDate field of ChatInviteExported. @@ -65,7 +65,7 @@ type ChatInviteExported struct { } // ChatInviteExportedTypeID is TL type id of ChatInviteExported. -const ChatInviteExportedTypeID = 0x6e24fc9d +const ChatInviteExportedTypeID = 0xb18105e8 // Ensuring interfaces in compile-time for ChatInviteExported. var ( @@ -127,7 +127,7 @@ func (c *ChatInviteExported) FillFrom(from interface { GetRevoked() (value bool) GetPermanent() (value bool) GetLink() (value string) - GetAdminID() (value int) + GetAdminID() (value int64) GetDate() (value int) GetStartDate() (value int, ok bool) GetExpireDate() (value int, ok bool) @@ -229,7 +229,7 @@ func (c *ChatInviteExported) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (c *ChatInviteExported) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chatInviteExported#6e24fc9d as nil") + return fmt.Errorf("can't encode chatInviteExported#b18105e8 as nil") } b.PutID(ChatInviteExportedTypeID) return c.EncodeBare(b) @@ -238,7 +238,7 @@ func (c *ChatInviteExported) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (c *ChatInviteExported) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chatInviteExported#6e24fc9d as nil") + return fmt.Errorf("can't encode chatInviteExported#b18105e8 as nil") } if !(c.Revoked == false) { c.Flags.Set(0) @@ -259,10 +259,10 @@ func (c *ChatInviteExported) EncodeBare(b *bin.Buffer) error { c.Flags.Set(3) } if err := c.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode chatInviteExported#6e24fc9d: field flags: %w", err) + return fmt.Errorf("unable to encode chatInviteExported#b18105e8: field flags: %w", err) } b.PutString(c.Link) - b.PutInt(c.AdminID) + b.PutLong(c.AdminID) b.PutInt(c.Date) if c.Flags.Has(4) { b.PutInt(c.StartDate) @@ -282,10 +282,10 @@ func (c *ChatInviteExported) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (c *ChatInviteExported) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode chatInviteExported#6e24fc9d to nil") + return fmt.Errorf("can't decode chatInviteExported#b18105e8 to nil") } if err := b.ConsumeID(ChatInviteExportedTypeID); err != nil { - return fmt.Errorf("unable to decode chatInviteExported#6e24fc9d: %w", err) + return fmt.Errorf("unable to decode chatInviteExported#b18105e8: %w", err) } return c.DecodeBare(b) } @@ -293,11 +293,11 @@ func (c *ChatInviteExported) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (c *ChatInviteExported) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode chatInviteExported#6e24fc9d to nil") + return fmt.Errorf("can't decode chatInviteExported#b18105e8 to nil") } { if err := c.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode chatInviteExported#6e24fc9d: field flags: %w", err) + return fmt.Errorf("unable to decode chatInviteExported#b18105e8: field flags: %w", err) } } c.Revoked = c.Flags.Has(0) @@ -305,49 +305,49 @@ func (c *ChatInviteExported) DecodeBare(b *bin.Buffer) error { { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode chatInviteExported#6e24fc9d: field link: %w", err) + return fmt.Errorf("unable to decode chatInviteExported#b18105e8: field link: %w", err) } c.Link = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode chatInviteExported#6e24fc9d: field admin_id: %w", err) + return fmt.Errorf("unable to decode chatInviteExported#b18105e8: field admin_id: %w", err) } c.AdminID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode chatInviteExported#6e24fc9d: field date: %w", err) + return fmt.Errorf("unable to decode chatInviteExported#b18105e8: field date: %w", err) } c.Date = value } if c.Flags.Has(4) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode chatInviteExported#6e24fc9d: field start_date: %w", err) + return fmt.Errorf("unable to decode chatInviteExported#b18105e8: field start_date: %w", err) } c.StartDate = value } if c.Flags.Has(1) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode chatInviteExported#6e24fc9d: field expire_date: %w", err) + return fmt.Errorf("unable to decode chatInviteExported#b18105e8: field expire_date: %w", err) } c.ExpireDate = value } if c.Flags.Has(2) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode chatInviteExported#6e24fc9d: field usage_limit: %w", err) + return fmt.Errorf("unable to decode chatInviteExported#b18105e8: field usage_limit: %w", err) } c.UsageLimit = value } if c.Flags.Has(3) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode chatInviteExported#6e24fc9d: field usage: %w", err) + return fmt.Errorf("unable to decode chatInviteExported#b18105e8: field usage: %w", err) } c.Usage = value } @@ -392,7 +392,7 @@ func (c *ChatInviteExported) GetLink() (value string) { } // GetAdminID returns value of AdminID field. -func (c *ChatInviteExported) GetAdminID() (value int) { +func (c *ChatInviteExported) GetAdminID() (value int64) { return c.AdminID } diff --git a/tg/tl_chat_invite_importer_gen.go b/tg/tl_chat_invite_importer_gen.go index 7e5b1c1347..5c21dfa07e 100644 --- a/tg/tl_chat_invite_importer_gen.go +++ b/tg/tl_chat_invite_importer_gen.go @@ -29,18 +29,18 @@ var ( _ = tgerr.Error{} ) -// ChatInviteImporter represents TL type `chatInviteImporter#1e3e6680`. +// ChatInviteImporter represents TL type `chatInviteImporter#b5cd5f4`. // // See https://core.telegram.org/constructor/chatInviteImporter for reference. type ChatInviteImporter struct { // UserID field of ChatInviteImporter. - UserID int + UserID int64 // Date field of ChatInviteImporter. Date int } // ChatInviteImporterTypeID is TL type id of ChatInviteImporter. -const ChatInviteImporterTypeID = 0x1e3e6680 +const ChatInviteImporterTypeID = 0xb5cd5f4 // Ensuring interfaces in compile-time for ChatInviteImporter. var ( @@ -75,7 +75,7 @@ func (c *ChatInviteImporter) String() string { // FillFrom fills ChatInviteImporter from given interface. func (c *ChatInviteImporter) FillFrom(from interface { - GetUserID() (value int) + GetUserID() (value int64) GetDate() (value int) }) { c.UserID = from.GetUserID() @@ -120,7 +120,7 @@ func (c *ChatInviteImporter) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (c *ChatInviteImporter) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chatInviteImporter#1e3e6680 as nil") + return fmt.Errorf("can't encode chatInviteImporter#b5cd5f4 as nil") } b.PutID(ChatInviteImporterTypeID) return c.EncodeBare(b) @@ -129,9 +129,9 @@ func (c *ChatInviteImporter) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (c *ChatInviteImporter) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chatInviteImporter#1e3e6680 as nil") + return fmt.Errorf("can't encode chatInviteImporter#b5cd5f4 as nil") } - b.PutInt(c.UserID) + b.PutLong(c.UserID) b.PutInt(c.Date) return nil } @@ -139,10 +139,10 @@ func (c *ChatInviteImporter) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (c *ChatInviteImporter) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode chatInviteImporter#1e3e6680 to nil") + return fmt.Errorf("can't decode chatInviteImporter#b5cd5f4 to nil") } if err := b.ConsumeID(ChatInviteImporterTypeID); err != nil { - return fmt.Errorf("unable to decode chatInviteImporter#1e3e6680: %w", err) + return fmt.Errorf("unable to decode chatInviteImporter#b5cd5f4: %w", err) } return c.DecodeBare(b) } @@ -150,19 +150,19 @@ func (c *ChatInviteImporter) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (c *ChatInviteImporter) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode chatInviteImporter#1e3e6680 to nil") + return fmt.Errorf("can't decode chatInviteImporter#b5cd5f4 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode chatInviteImporter#1e3e6680: field user_id: %w", err) + return fmt.Errorf("unable to decode chatInviteImporter#b5cd5f4: field user_id: %w", err) } c.UserID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode chatInviteImporter#1e3e6680: field date: %w", err) + return fmt.Errorf("unable to decode chatInviteImporter#b5cd5f4: field date: %w", err) } c.Date = value } @@ -170,7 +170,7 @@ func (c *ChatInviteImporter) DecodeBare(b *bin.Buffer) error { } // GetUserID returns value of UserID field. -func (c *ChatInviteImporter) GetUserID() (value int) { +func (c *ChatInviteImporter) GetUserID() (value int64) { return c.UserID } diff --git a/tg/tl_chat_participant_gen.go b/tg/tl_chat_participant_gen.go index 9f61529573..983e25fd2f 100644 --- a/tg/tl_chat_participant_gen.go +++ b/tg/tl_chat_participant_gen.go @@ -29,21 +29,21 @@ var ( _ = tgerr.Error{} ) -// ChatParticipant represents TL type `chatParticipant#c8d7493e`. +// ChatParticipant represents TL type `chatParticipant#c02d4007`. // Group member. // // See https://core.telegram.org/constructor/chatParticipant for reference. type ChatParticipant struct { // Member user ID - UserID int + UserID int64 // ID of the user that added the member to the group - InviterID int + InviterID int64 // Date added to the group Date int } // ChatParticipantTypeID is TL type id of ChatParticipant. -const ChatParticipantTypeID = 0xc8d7493e +const ChatParticipantTypeID = 0xc02d4007 // construct implements constructor of ChatParticipantClass. func (c ChatParticipant) construct() ChatParticipantClass { return &c } @@ -86,8 +86,8 @@ func (c *ChatParticipant) String() string { // FillFrom fills ChatParticipant from given interface. func (c *ChatParticipant) FillFrom(from interface { - GetUserID() (value int) - GetInviterID() (value int) + GetUserID() (value int64) + GetInviterID() (value int64) GetDate() (value int) }) { c.UserID = from.GetUserID() @@ -137,7 +137,7 @@ func (c *ChatParticipant) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (c *ChatParticipant) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chatParticipant#c8d7493e as nil") + return fmt.Errorf("can't encode chatParticipant#c02d4007 as nil") } b.PutID(ChatParticipantTypeID) return c.EncodeBare(b) @@ -146,10 +146,10 @@ func (c *ChatParticipant) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (c *ChatParticipant) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chatParticipant#c8d7493e as nil") + return fmt.Errorf("can't encode chatParticipant#c02d4007 as nil") } - b.PutInt(c.UserID) - b.PutInt(c.InviterID) + b.PutLong(c.UserID) + b.PutLong(c.InviterID) b.PutInt(c.Date) return nil } @@ -157,10 +157,10 @@ func (c *ChatParticipant) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (c *ChatParticipant) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode chatParticipant#c8d7493e to nil") + return fmt.Errorf("can't decode chatParticipant#c02d4007 to nil") } if err := b.ConsumeID(ChatParticipantTypeID); err != nil { - return fmt.Errorf("unable to decode chatParticipant#c8d7493e: %w", err) + return fmt.Errorf("unable to decode chatParticipant#c02d4007: %w", err) } return c.DecodeBare(b) } @@ -168,26 +168,26 @@ func (c *ChatParticipant) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (c *ChatParticipant) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode chatParticipant#c8d7493e to nil") + return fmt.Errorf("can't decode chatParticipant#c02d4007 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode chatParticipant#c8d7493e: field user_id: %w", err) + return fmt.Errorf("unable to decode chatParticipant#c02d4007: field user_id: %w", err) } c.UserID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode chatParticipant#c8d7493e: field inviter_id: %w", err) + return fmt.Errorf("unable to decode chatParticipant#c02d4007: field inviter_id: %w", err) } c.InviterID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode chatParticipant#c8d7493e: field date: %w", err) + return fmt.Errorf("unable to decode chatParticipant#c02d4007: field date: %w", err) } c.Date = value } @@ -195,12 +195,12 @@ func (c *ChatParticipant) DecodeBare(b *bin.Buffer) error { } // GetUserID returns value of UserID field. -func (c *ChatParticipant) GetUserID() (value int) { +func (c *ChatParticipant) GetUserID() (value int64) { return c.UserID } // GetInviterID returns value of InviterID field. -func (c *ChatParticipant) GetInviterID() (value int) { +func (c *ChatParticipant) GetInviterID() (value int64) { return c.InviterID } @@ -209,17 +209,17 @@ func (c *ChatParticipant) GetDate() (value int) { return c.Date } -// ChatParticipantCreator represents TL type `chatParticipantCreator#da13538a`. +// ChatParticipantCreator represents TL type `chatParticipantCreator#e46bcee4`. // Represents the creator of the group // // See https://core.telegram.org/constructor/chatParticipantCreator for reference. type ChatParticipantCreator struct { // ID of the user that created the group - UserID int + UserID int64 } // ChatParticipantCreatorTypeID is TL type id of ChatParticipantCreator. -const ChatParticipantCreatorTypeID = 0xda13538a +const ChatParticipantCreatorTypeID = 0xe46bcee4 // construct implements constructor of ChatParticipantClass. func (c ChatParticipantCreator) construct() ChatParticipantClass { return &c } @@ -256,7 +256,7 @@ func (c *ChatParticipantCreator) String() string { // FillFrom fills ChatParticipantCreator from given interface. func (c *ChatParticipantCreator) FillFrom(from interface { - GetUserID() (value int) + GetUserID() (value int64) }) { c.UserID = from.GetUserID() } @@ -295,7 +295,7 @@ func (c *ChatParticipantCreator) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (c *ChatParticipantCreator) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chatParticipantCreator#da13538a as nil") + return fmt.Errorf("can't encode chatParticipantCreator#e46bcee4 as nil") } b.PutID(ChatParticipantCreatorTypeID) return c.EncodeBare(b) @@ -304,19 +304,19 @@ func (c *ChatParticipantCreator) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (c *ChatParticipantCreator) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chatParticipantCreator#da13538a as nil") + return fmt.Errorf("can't encode chatParticipantCreator#e46bcee4 as nil") } - b.PutInt(c.UserID) + b.PutLong(c.UserID) return nil } // Decode implements bin.Decoder. func (c *ChatParticipantCreator) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode chatParticipantCreator#da13538a to nil") + return fmt.Errorf("can't decode chatParticipantCreator#e46bcee4 to nil") } if err := b.ConsumeID(ChatParticipantCreatorTypeID); err != nil { - return fmt.Errorf("unable to decode chatParticipantCreator#da13538a: %w", err) + return fmt.Errorf("unable to decode chatParticipantCreator#e46bcee4: %w", err) } return c.DecodeBare(b) } @@ -324,12 +324,12 @@ func (c *ChatParticipantCreator) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (c *ChatParticipantCreator) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode chatParticipantCreator#da13538a to nil") + return fmt.Errorf("can't decode chatParticipantCreator#e46bcee4 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode chatParticipantCreator#da13538a: field user_id: %w", err) + return fmt.Errorf("unable to decode chatParticipantCreator#e46bcee4: field user_id: %w", err) } c.UserID = value } @@ -337,25 +337,25 @@ func (c *ChatParticipantCreator) DecodeBare(b *bin.Buffer) error { } // GetUserID returns value of UserID field. -func (c *ChatParticipantCreator) GetUserID() (value int) { +func (c *ChatParticipantCreator) GetUserID() (value int64) { return c.UserID } -// ChatParticipantAdmin represents TL type `chatParticipantAdmin#e2d6e436`. +// ChatParticipantAdmin represents TL type `chatParticipantAdmin#a0933f5b`. // Chat admin // // See https://core.telegram.org/constructor/chatParticipantAdmin for reference. type ChatParticipantAdmin struct { // ID of a group member that is admin - UserID int + UserID int64 // ID of the user that added the member to the group - InviterID int + InviterID int64 // Date when the user was added Date int } // ChatParticipantAdminTypeID is TL type id of ChatParticipantAdmin. -const ChatParticipantAdminTypeID = 0xe2d6e436 +const ChatParticipantAdminTypeID = 0xa0933f5b // construct implements constructor of ChatParticipantClass. func (c ChatParticipantAdmin) construct() ChatParticipantClass { return &c } @@ -398,8 +398,8 @@ func (c *ChatParticipantAdmin) String() string { // FillFrom fills ChatParticipantAdmin from given interface. func (c *ChatParticipantAdmin) FillFrom(from interface { - GetUserID() (value int) - GetInviterID() (value int) + GetUserID() (value int64) + GetInviterID() (value int64) GetDate() (value int) }) { c.UserID = from.GetUserID() @@ -449,7 +449,7 @@ func (c *ChatParticipantAdmin) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (c *ChatParticipantAdmin) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chatParticipantAdmin#e2d6e436 as nil") + return fmt.Errorf("can't encode chatParticipantAdmin#a0933f5b as nil") } b.PutID(ChatParticipantAdminTypeID) return c.EncodeBare(b) @@ -458,10 +458,10 @@ func (c *ChatParticipantAdmin) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (c *ChatParticipantAdmin) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chatParticipantAdmin#e2d6e436 as nil") + return fmt.Errorf("can't encode chatParticipantAdmin#a0933f5b as nil") } - b.PutInt(c.UserID) - b.PutInt(c.InviterID) + b.PutLong(c.UserID) + b.PutLong(c.InviterID) b.PutInt(c.Date) return nil } @@ -469,10 +469,10 @@ func (c *ChatParticipantAdmin) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (c *ChatParticipantAdmin) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode chatParticipantAdmin#e2d6e436 to nil") + return fmt.Errorf("can't decode chatParticipantAdmin#a0933f5b to nil") } if err := b.ConsumeID(ChatParticipantAdminTypeID); err != nil { - return fmt.Errorf("unable to decode chatParticipantAdmin#e2d6e436: %w", err) + return fmt.Errorf("unable to decode chatParticipantAdmin#a0933f5b: %w", err) } return c.DecodeBare(b) } @@ -480,26 +480,26 @@ func (c *ChatParticipantAdmin) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (c *ChatParticipantAdmin) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode chatParticipantAdmin#e2d6e436 to nil") + return fmt.Errorf("can't decode chatParticipantAdmin#a0933f5b to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode chatParticipantAdmin#e2d6e436: field user_id: %w", err) + return fmt.Errorf("unable to decode chatParticipantAdmin#a0933f5b: field user_id: %w", err) } c.UserID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode chatParticipantAdmin#e2d6e436: field inviter_id: %w", err) + return fmt.Errorf("unable to decode chatParticipantAdmin#a0933f5b: field inviter_id: %w", err) } c.InviterID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode chatParticipantAdmin#e2d6e436: field date: %w", err) + return fmt.Errorf("unable to decode chatParticipantAdmin#a0933f5b: field date: %w", err) } c.Date = value } @@ -507,12 +507,12 @@ func (c *ChatParticipantAdmin) DecodeBare(b *bin.Buffer) error { } // GetUserID returns value of UserID field. -func (c *ChatParticipantAdmin) GetUserID() (value int) { +func (c *ChatParticipantAdmin) GetUserID() (value int64) { return c.UserID } // GetInviterID returns value of InviterID field. -func (c *ChatParticipantAdmin) GetInviterID() (value int) { +func (c *ChatParticipantAdmin) GetInviterID() (value int64) { return c.InviterID } @@ -531,9 +531,9 @@ func (c *ChatParticipantAdmin) GetDate() (value int) { // panic(err) // } // switch v := g.(type) { -// case *tg.ChatParticipant: // chatParticipant#c8d7493e -// case *tg.ChatParticipantCreator: // chatParticipantCreator#da13538a -// case *tg.ChatParticipantAdmin: // chatParticipantAdmin#e2d6e436 +// case *tg.ChatParticipant: // chatParticipant#c02d4007 +// case *tg.ChatParticipantCreator: // chatParticipantCreator#e46bcee4 +// case *tg.ChatParticipantAdmin: // chatParticipantAdmin#a0933f5b // default: panic(v) // } type ChatParticipantClass interface { @@ -555,7 +555,7 @@ type ChatParticipantClass interface { Zero() bool // Member user ID - GetUserID() (value int) + GetUserID() (value int64) } // DecodeChatParticipant implements binary de-serialization for ChatParticipantClass. @@ -566,21 +566,21 @@ func DecodeChatParticipant(buf *bin.Buffer) (ChatParticipantClass, error) { } switch id { case ChatParticipantTypeID: - // Decoding chatParticipant#c8d7493e. + // Decoding chatParticipant#c02d4007. v := ChatParticipant{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode ChatParticipantClass: %w", err) } return &v, nil case ChatParticipantCreatorTypeID: - // Decoding chatParticipantCreator#da13538a. + // Decoding chatParticipantCreator#e46bcee4. v := ChatParticipantCreator{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode ChatParticipantClass: %w", err) } return &v, nil case ChatParticipantAdminTypeID: - // Decoding chatParticipantAdmin#e2d6e436. + // Decoding chatParticipantAdmin#a0933f5b. v := ChatParticipantAdmin{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode ChatParticipantClass: %w", err) diff --git a/tg/tl_chat_participants_gen.go b/tg/tl_chat_participants_gen.go index 024eaa16f7..d62adec2f9 100644 --- a/tg/tl_chat_participants_gen.go +++ b/tg/tl_chat_participants_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// ChatParticipantsForbidden represents TL type `chatParticipantsForbidden#fc900c2b`. +// ChatParticipantsForbidden represents TL type `chatParticipantsForbidden#8763d3e1`. // Info on members is unavailable // // See https://core.telegram.org/constructor/chatParticipantsForbidden for reference. @@ -40,7 +40,7 @@ type ChatParticipantsForbidden struct { // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields // Group ID - ChatID int + ChatID int64 // Info about the group membership of the current user // // Use SetSelfParticipant and GetSelfParticipant helpers. @@ -48,7 +48,7 @@ type ChatParticipantsForbidden struct { } // ChatParticipantsForbiddenTypeID is TL type id of ChatParticipantsForbidden. -const ChatParticipantsForbiddenTypeID = 0xfc900c2b +const ChatParticipantsForbiddenTypeID = 0x8763d3e1 // construct implements constructor of ChatParticipantsClass. func (c ChatParticipantsForbidden) construct() ChatParticipantsClass { return &c } @@ -91,7 +91,7 @@ func (c *ChatParticipantsForbidden) String() string { // FillFrom fills ChatParticipantsForbidden from given interface. func (c *ChatParticipantsForbidden) FillFrom(from interface { - GetChatID() (value int) + GetChatID() (value int64) GetSelfParticipant() (value ChatParticipantClass, ok bool) }) { c.ChatID = from.GetChatID() @@ -140,7 +140,7 @@ func (c *ChatParticipantsForbidden) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (c *ChatParticipantsForbidden) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chatParticipantsForbidden#fc900c2b as nil") + return fmt.Errorf("can't encode chatParticipantsForbidden#8763d3e1 as nil") } b.PutID(ChatParticipantsForbiddenTypeID) return c.EncodeBare(b) @@ -149,21 +149,21 @@ func (c *ChatParticipantsForbidden) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (c *ChatParticipantsForbidden) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chatParticipantsForbidden#fc900c2b as nil") + return fmt.Errorf("can't encode chatParticipantsForbidden#8763d3e1 as nil") } if !(c.SelfParticipant == nil) { c.Flags.Set(0) } if err := c.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode chatParticipantsForbidden#fc900c2b: field flags: %w", err) + return fmt.Errorf("unable to encode chatParticipantsForbidden#8763d3e1: field flags: %w", err) } - b.PutInt(c.ChatID) + b.PutLong(c.ChatID) if c.Flags.Has(0) { if c.SelfParticipant == nil { - return fmt.Errorf("unable to encode chatParticipantsForbidden#fc900c2b: field self_participant is nil") + return fmt.Errorf("unable to encode chatParticipantsForbidden#8763d3e1: field self_participant is nil") } if err := c.SelfParticipant.Encode(b); err != nil { - return fmt.Errorf("unable to encode chatParticipantsForbidden#fc900c2b: field self_participant: %w", err) + return fmt.Errorf("unable to encode chatParticipantsForbidden#8763d3e1: field self_participant: %w", err) } } return nil @@ -172,10 +172,10 @@ func (c *ChatParticipantsForbidden) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (c *ChatParticipantsForbidden) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode chatParticipantsForbidden#fc900c2b to nil") + return fmt.Errorf("can't decode chatParticipantsForbidden#8763d3e1 to nil") } if err := b.ConsumeID(ChatParticipantsForbiddenTypeID); err != nil { - return fmt.Errorf("unable to decode chatParticipantsForbidden#fc900c2b: %w", err) + return fmt.Errorf("unable to decode chatParticipantsForbidden#8763d3e1: %w", err) } return c.DecodeBare(b) } @@ -183,24 +183,24 @@ func (c *ChatParticipantsForbidden) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (c *ChatParticipantsForbidden) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode chatParticipantsForbidden#fc900c2b to nil") + return fmt.Errorf("can't decode chatParticipantsForbidden#8763d3e1 to nil") } { if err := c.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode chatParticipantsForbidden#fc900c2b: field flags: %w", err) + return fmt.Errorf("unable to decode chatParticipantsForbidden#8763d3e1: field flags: %w", err) } } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode chatParticipantsForbidden#fc900c2b: field chat_id: %w", err) + return fmt.Errorf("unable to decode chatParticipantsForbidden#8763d3e1: field chat_id: %w", err) } c.ChatID = value } if c.Flags.Has(0) { value, err := DecodeChatParticipant(b) if err != nil { - return fmt.Errorf("unable to decode chatParticipantsForbidden#fc900c2b: field self_participant: %w", err) + return fmt.Errorf("unable to decode chatParticipantsForbidden#8763d3e1: field self_participant: %w", err) } c.SelfParticipant = value } @@ -208,7 +208,7 @@ func (c *ChatParticipantsForbidden) DecodeBare(b *bin.Buffer) error { } // GetChatID returns value of ChatID field. -func (c *ChatParticipantsForbidden) GetChatID() (value int) { +func (c *ChatParticipantsForbidden) GetChatID() (value int64) { return c.ChatID } @@ -227,13 +227,13 @@ func (c *ChatParticipantsForbidden) GetSelfParticipant() (value ChatParticipantC return c.SelfParticipant, true } -// ChatParticipants represents TL type `chatParticipants#3f460fed`. +// ChatParticipants represents TL type `chatParticipants#3cbc93f8`. // Group members. // // See https://core.telegram.org/constructor/chatParticipants for reference. type ChatParticipants struct { // Group identifier - ChatID int + ChatID int64 // List of group members Participants []ChatParticipantClass // Group version number @@ -241,7 +241,7 @@ type ChatParticipants struct { } // ChatParticipantsTypeID is TL type id of ChatParticipants. -const ChatParticipantsTypeID = 0x3f460fed +const ChatParticipantsTypeID = 0x3cbc93f8 // construct implements constructor of ChatParticipantsClass. func (c ChatParticipants) construct() ChatParticipantsClass { return &c } @@ -284,7 +284,7 @@ func (c *ChatParticipants) String() string { // FillFrom fills ChatParticipants from given interface. func (c *ChatParticipants) FillFrom(from interface { - GetChatID() (value int) + GetChatID() (value int64) GetParticipants() (value []ChatParticipantClass) GetVersion() (value int) }) { @@ -335,7 +335,7 @@ func (c *ChatParticipants) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (c *ChatParticipants) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chatParticipants#3f460fed as nil") + return fmt.Errorf("can't encode chatParticipants#3cbc93f8 as nil") } b.PutID(ChatParticipantsTypeID) return c.EncodeBare(b) @@ -344,16 +344,16 @@ func (c *ChatParticipants) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (c *ChatParticipants) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode chatParticipants#3f460fed as nil") + return fmt.Errorf("can't encode chatParticipants#3cbc93f8 as nil") } - b.PutInt(c.ChatID) + b.PutLong(c.ChatID) b.PutVectorHeader(len(c.Participants)) for idx, v := range c.Participants { if v == nil { - return fmt.Errorf("unable to encode chatParticipants#3f460fed: field participants element with index %d is nil", idx) + return fmt.Errorf("unable to encode chatParticipants#3cbc93f8: field participants element with index %d is nil", idx) } if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode chatParticipants#3f460fed: field participants element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode chatParticipants#3cbc93f8: field participants element with index %d: %w", idx, err) } } b.PutInt(c.Version) @@ -363,10 +363,10 @@ func (c *ChatParticipants) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (c *ChatParticipants) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode chatParticipants#3f460fed to nil") + return fmt.Errorf("can't decode chatParticipants#3cbc93f8 to nil") } if err := b.ConsumeID(ChatParticipantsTypeID); err != nil { - return fmt.Errorf("unable to decode chatParticipants#3f460fed: %w", err) + return fmt.Errorf("unable to decode chatParticipants#3cbc93f8: %w", err) } return c.DecodeBare(b) } @@ -374,19 +374,19 @@ func (c *ChatParticipants) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (c *ChatParticipants) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode chatParticipants#3f460fed to nil") + return fmt.Errorf("can't decode chatParticipants#3cbc93f8 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode chatParticipants#3f460fed: field chat_id: %w", err) + return fmt.Errorf("unable to decode chatParticipants#3cbc93f8: field chat_id: %w", err) } c.ChatID = value } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode chatParticipants#3f460fed: field participants: %w", err) + return fmt.Errorf("unable to decode chatParticipants#3cbc93f8: field participants: %w", err) } if headerLen > 0 { @@ -395,7 +395,7 @@ func (c *ChatParticipants) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := DecodeChatParticipant(b) if err != nil { - return fmt.Errorf("unable to decode chatParticipants#3f460fed: field participants: %w", err) + return fmt.Errorf("unable to decode chatParticipants#3cbc93f8: field participants: %w", err) } c.Participants = append(c.Participants, value) } @@ -403,7 +403,7 @@ func (c *ChatParticipants) DecodeBare(b *bin.Buffer) error { { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode chatParticipants#3f460fed: field version: %w", err) + return fmt.Errorf("unable to decode chatParticipants#3cbc93f8: field version: %w", err) } c.Version = value } @@ -411,7 +411,7 @@ func (c *ChatParticipants) DecodeBare(b *bin.Buffer) error { } // GetChatID returns value of ChatID field. -func (c *ChatParticipants) GetChatID() (value int) { +func (c *ChatParticipants) GetChatID() (value int64) { return c.ChatID } @@ -440,8 +440,8 @@ func (c *ChatParticipants) MapParticipants() (value ChatParticipantClassArray) { // panic(err) // } // switch v := g.(type) { -// case *tg.ChatParticipantsForbidden: // chatParticipantsForbidden#fc900c2b -// case *tg.ChatParticipants: // chatParticipants#3f460fed +// case *tg.ChatParticipantsForbidden: // chatParticipantsForbidden#8763d3e1 +// case *tg.ChatParticipants: // chatParticipants#3cbc93f8 // default: panic(v) // } type ChatParticipantsClass interface { @@ -463,7 +463,7 @@ type ChatParticipantsClass interface { Zero() bool // Group ID - GetChatID() (value int) + GetChatID() (value int64) // AsNotForbidden tries to map ChatParticipantsClass to ChatParticipants. AsNotForbidden() (*ChatParticipants, bool) @@ -487,14 +487,14 @@ func DecodeChatParticipants(buf *bin.Buffer) (ChatParticipantsClass, error) { } switch id { case ChatParticipantsForbiddenTypeID: - // Decoding chatParticipantsForbidden#fc900c2b. + // Decoding chatParticipantsForbidden#8763d3e1. v := ChatParticipantsForbidden{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode ChatParticipantsClass: %w", err) } return &v, nil case ChatParticipantsTypeID: - // Decoding chatParticipants#3f460fed. + // Decoding chatParticipants#3cbc93f8. v := ChatParticipants{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode ChatParticipantsClass: %w", err) diff --git a/tg/tl_chat_slices_gen.go b/tg/tl_chat_slices_gen.go index 3e587074de..796717c934 100644 --- a/tg/tl_chat_slices_gen.go +++ b/tg/tl_chat_slices_gen.go @@ -129,7 +129,7 @@ func (s ChatClassArray) SortStableByID() ChatClassArray { } // FillChatEmptyMap fills only ChatEmpty constructors to given map. -func (s ChatClassArray) FillChatEmptyMap(to map[int]*ChatEmpty) { +func (s ChatClassArray) FillChatEmptyMap(to map[int64]*ChatEmpty) { for _, elem := range s { value, ok := elem.(*ChatEmpty) if !ok { @@ -140,8 +140,8 @@ func (s ChatClassArray) FillChatEmptyMap(to map[int]*ChatEmpty) { } // ChatEmptyToMap collects only ChatEmpty constructors to map. -func (s ChatClassArray) ChatEmptyToMap() map[int]*ChatEmpty { - r := make(map[int]*ChatEmpty, len(s)) +func (s ChatClassArray) ChatEmptyToMap() map[int64]*ChatEmpty { + r := make(map[int64]*ChatEmpty, len(s)) s.FillChatEmptyMap(r) return r } @@ -160,7 +160,7 @@ func (s ChatClassArray) AsChatEmpty() (to ChatEmptyArray) { } // FillChatMap fills only Chat constructors to given map. -func (s ChatClassArray) FillChatMap(to map[int]*Chat) { +func (s ChatClassArray) FillChatMap(to map[int64]*Chat) { for _, elem := range s { value, ok := elem.(*Chat) if !ok { @@ -171,8 +171,8 @@ func (s ChatClassArray) FillChatMap(to map[int]*Chat) { } // ChatToMap collects only Chat constructors to map. -func (s ChatClassArray) ChatToMap() map[int]*Chat { - r := make(map[int]*Chat, len(s)) +func (s ChatClassArray) ChatToMap() map[int64]*Chat { + r := make(map[int64]*Chat, len(s)) s.FillChatMap(r) return r } @@ -191,7 +191,7 @@ func (s ChatClassArray) AsChat() (to ChatArray) { } // FillChatForbiddenMap fills only ChatForbidden constructors to given map. -func (s ChatClassArray) FillChatForbiddenMap(to map[int]*ChatForbidden) { +func (s ChatClassArray) FillChatForbiddenMap(to map[int64]*ChatForbidden) { for _, elem := range s { value, ok := elem.(*ChatForbidden) if !ok { @@ -202,8 +202,8 @@ func (s ChatClassArray) FillChatForbiddenMap(to map[int]*ChatForbidden) { } // ChatForbiddenToMap collects only ChatForbidden constructors to map. -func (s ChatClassArray) ChatForbiddenToMap() map[int]*ChatForbidden { - r := make(map[int]*ChatForbidden, len(s)) +func (s ChatClassArray) ChatForbiddenToMap() map[int64]*ChatForbidden { + r := make(map[int64]*ChatForbidden, len(s)) s.FillChatForbiddenMap(r) return r } @@ -222,7 +222,7 @@ func (s ChatClassArray) AsChatForbidden() (to ChatForbiddenArray) { } // FillChannelMap fills only Channel constructors to given map. -func (s ChatClassArray) FillChannelMap(to map[int]*Channel) { +func (s ChatClassArray) FillChannelMap(to map[int64]*Channel) { for _, elem := range s { value, ok := elem.(*Channel) if !ok { @@ -233,8 +233,8 @@ func (s ChatClassArray) FillChannelMap(to map[int]*Channel) { } // ChannelToMap collects only Channel constructors to map. -func (s ChatClassArray) ChannelToMap() map[int]*Channel { - r := make(map[int]*Channel, len(s)) +func (s ChatClassArray) ChannelToMap() map[int64]*Channel { + r := make(map[int64]*Channel, len(s)) s.FillChannelMap(r) return r } @@ -253,7 +253,7 @@ func (s ChatClassArray) AsChannel() (to ChannelArray) { } // FillChannelForbiddenMap fills only ChannelForbidden constructors to given map. -func (s ChatClassArray) FillChannelForbiddenMap(to map[int]*ChannelForbidden) { +func (s ChatClassArray) FillChannelForbiddenMap(to map[int64]*ChannelForbidden) { for _, elem := range s { value, ok := elem.(*ChannelForbidden) if !ok { @@ -264,8 +264,8 @@ func (s ChatClassArray) FillChannelForbiddenMap(to map[int]*ChannelForbidden) { } // ChannelForbiddenToMap collects only ChannelForbidden constructors to map. -func (s ChatClassArray) ChannelForbiddenToMap() map[int]*ChannelForbidden { - r := make(map[int]*ChannelForbidden, len(s)) +func (s ChatClassArray) ChannelForbiddenToMap() map[int64]*ChannelForbidden { + r := make(map[int64]*ChannelForbidden, len(s)) s.FillChannelForbiddenMap(r) return r } @@ -284,7 +284,7 @@ func (s ChatClassArray) AsChannelForbidden() (to ChannelForbiddenArray) { } // FillNotEmptyMap fills only NotEmpty constructors to given map. -func (s ChatClassArray) FillNotEmptyMap(to map[int]NotEmptyChat) { +func (s ChatClassArray) FillNotEmptyMap(to map[int64]NotEmptyChat) { for _, elem := range s { value, ok := elem.AsNotEmpty() if !ok { @@ -295,8 +295,8 @@ func (s ChatClassArray) FillNotEmptyMap(to map[int]NotEmptyChat) { } // NotEmptyToMap collects only NotEmpty constructors to map. -func (s ChatClassArray) NotEmptyToMap() map[int]NotEmptyChat { - r := make(map[int]NotEmptyChat, len(s)) +func (s ChatClassArray) NotEmptyToMap() map[int64]NotEmptyChat { + r := make(map[int64]NotEmptyChat, len(s)) s.FillNotEmptyMap(r) return r } @@ -357,7 +357,7 @@ func (s *ChatClassArray) PopAsNotEmpty() (v NotEmptyChat, ok bool) { } // FillNotForbiddenMap fills only NotForbidden constructors to given map. -func (s ChatClassArray) FillNotForbiddenMap(to map[int]NotForbiddenChat) { +func (s ChatClassArray) FillNotForbiddenMap(to map[int64]NotForbiddenChat) { for _, elem := range s { value, ok := elem.AsNotForbidden() if !ok { @@ -368,8 +368,8 @@ func (s ChatClassArray) FillNotForbiddenMap(to map[int]NotForbiddenChat) { } // NotForbiddenToMap collects only NotForbidden constructors to map. -func (s ChatClassArray) NotForbiddenToMap() map[int]NotForbiddenChat { - r := make(map[int]NotForbiddenChat, len(s)) +func (s ChatClassArray) NotForbiddenToMap() map[int64]NotForbiddenChat { + r := make(map[int64]NotForbiddenChat, len(s)) s.FillNotForbiddenMap(r) return r } @@ -430,7 +430,7 @@ func (s *ChatClassArray) PopAsNotForbidden() (v NotForbiddenChat, ok bool) { } // FillFullMap fills only Full constructors to given map. -func (s ChatClassArray) FillFullMap(to map[int]FullChat) { +func (s ChatClassArray) FillFullMap(to map[int64]FullChat) { for _, elem := range s { value, ok := elem.AsFull() if !ok { @@ -441,8 +441,8 @@ func (s ChatClassArray) FillFullMap(to map[int]FullChat) { } // FullToMap collects only Full constructors to map. -func (s ChatClassArray) FullToMap() map[int]FullChat { - r := make(map[int]FullChat, len(s)) +func (s ChatClassArray) FullToMap() map[int64]FullChat { + r := make(map[int64]FullChat, len(s)) s.FillFullMap(r) return r } @@ -599,15 +599,15 @@ func (s ChatEmptyArray) SortStableByID() ChatEmptyArray { } // FillMap fills constructors to given map. -func (s ChatEmptyArray) FillMap(to map[int]ChatEmpty) { +func (s ChatEmptyArray) FillMap(to map[int64]ChatEmpty) { for _, value := range s { to[value.GetID()] = value } } // ToMap collects constructors to map. -func (s ChatEmptyArray) ToMap() map[int]ChatEmpty { - r := make(map[int]ChatEmpty, len(s)) +func (s ChatEmptyArray) ToMap() map[int64]ChatEmpty { + r := make(map[int64]ChatEmpty, len(s)) s.FillMap(r) return r } @@ -723,15 +723,15 @@ func (s ChatArray) SortStableByDate() ChatArray { } // FillMap fills constructors to given map. -func (s ChatArray) FillMap(to map[int]Chat) { +func (s ChatArray) FillMap(to map[int64]Chat) { for _, value := range s { to[value.GetID()] = value } } // ToMap collects constructors to map. -func (s ChatArray) ToMap() map[int]Chat { - r := make(map[int]Chat, len(s)) +func (s ChatArray) ToMap() map[int64]Chat { + r := make(map[int64]Chat, len(s)) s.FillMap(r) return r } @@ -833,15 +833,15 @@ func (s ChatForbiddenArray) SortStableByID() ChatForbiddenArray { } // FillMap fills constructors to given map. -func (s ChatForbiddenArray) FillMap(to map[int]ChatForbidden) { +func (s ChatForbiddenArray) FillMap(to map[int64]ChatForbidden) { for _, value := range s { to[value.GetID()] = value } } // ToMap collects constructors to map. -func (s ChatForbiddenArray) ToMap() map[int]ChatForbidden { - r := make(map[int]ChatForbidden, len(s)) +func (s ChatForbiddenArray) ToMap() map[int64]ChatForbidden { + r := make(map[int64]ChatForbidden, len(s)) s.FillMap(r) return r } @@ -957,15 +957,15 @@ func (s ChannelArray) SortStableByDate() ChannelArray { } // FillMap fills constructors to given map. -func (s ChannelArray) FillMap(to map[int]Channel) { +func (s ChannelArray) FillMap(to map[int64]Channel) { for _, value := range s { to[value.GetID()] = value } } // ToMap collects constructors to map. -func (s ChannelArray) ToMap() map[int]Channel { - r := make(map[int]Channel, len(s)) +func (s ChannelArray) ToMap() map[int64]Channel { + r := make(map[int64]Channel, len(s)) s.FillMap(r) return r } @@ -1067,15 +1067,15 @@ func (s ChannelForbiddenArray) SortStableByID() ChannelForbiddenArray { } // FillMap fills constructors to given map. -func (s ChannelForbiddenArray) FillMap(to map[int]ChannelForbidden) { +func (s ChannelForbiddenArray) FillMap(to map[int64]ChannelForbidden) { for _, value := range s { to[value.GetID()] = value } } // ToMap collects constructors to map. -func (s ChannelForbiddenArray) ToMap() map[int]ChannelForbidden { - r := make(map[int]ChannelForbidden, len(s)) +func (s ChannelForbiddenArray) ToMap() map[int64]ChannelForbidden { + r := make(map[int64]ChannelForbidden, len(s)) s.FillMap(r) return r } diff --git a/tg/tl_contact_gen.go b/tg/tl_contact_gen.go index 52706cb695..5a049197c4 100644 --- a/tg/tl_contact_gen.go +++ b/tg/tl_contact_gen.go @@ -29,19 +29,19 @@ var ( _ = tgerr.Error{} ) -// Contact represents TL type `contact#f911c994`. +// Contact represents TL type `contact#145ade0b`. // A contact of the current user that is registered in the system. // // See https://core.telegram.org/constructor/contact for reference. type Contact struct { // User identifier - UserID int + UserID int64 // Current user is in the user's contact list Mutual bool } // ContactTypeID is TL type id of Contact. -const ContactTypeID = 0xf911c994 +const ContactTypeID = 0x145ade0b // Ensuring interfaces in compile-time for Contact. var ( @@ -76,7 +76,7 @@ func (c *Contact) String() string { // FillFrom fills Contact from given interface. func (c *Contact) FillFrom(from interface { - GetUserID() (value int) + GetUserID() (value int64) GetMutual() (value bool) }) { c.UserID = from.GetUserID() @@ -121,7 +121,7 @@ func (c *Contact) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (c *Contact) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode contact#f911c994 as nil") + return fmt.Errorf("can't encode contact#145ade0b as nil") } b.PutID(ContactTypeID) return c.EncodeBare(b) @@ -130,9 +130,9 @@ func (c *Contact) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (c *Contact) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode contact#f911c994 as nil") + return fmt.Errorf("can't encode contact#145ade0b as nil") } - b.PutInt(c.UserID) + b.PutLong(c.UserID) b.PutBool(c.Mutual) return nil } @@ -140,10 +140,10 @@ func (c *Contact) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (c *Contact) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode contact#f911c994 to nil") + return fmt.Errorf("can't decode contact#145ade0b to nil") } if err := b.ConsumeID(ContactTypeID); err != nil { - return fmt.Errorf("unable to decode contact#f911c994: %w", err) + return fmt.Errorf("unable to decode contact#145ade0b: %w", err) } return c.DecodeBare(b) } @@ -151,19 +151,19 @@ func (c *Contact) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (c *Contact) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode contact#f911c994 to nil") + return fmt.Errorf("can't decode contact#145ade0b to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode contact#f911c994: field user_id: %w", err) + return fmt.Errorf("unable to decode contact#145ade0b: field user_id: %w", err) } c.UserID = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode contact#f911c994: field mutual: %w", err) + return fmt.Errorf("unable to decode contact#145ade0b: field mutual: %w", err) } c.Mutual = value } @@ -171,7 +171,7 @@ func (c *Contact) DecodeBare(b *bin.Buffer) error { } // GetUserID returns value of UserID field. -func (c *Contact) GetUserID() (value int) { +func (c *Contact) GetUserID() (value int64) { return c.UserID } diff --git a/tg/tl_contact_status_gen.go b/tg/tl_contact_status_gen.go index d0bb04b499..a87a5b23bd 100644 --- a/tg/tl_contact_status_gen.go +++ b/tg/tl_contact_status_gen.go @@ -29,19 +29,19 @@ var ( _ = tgerr.Error{} ) -// ContactStatus represents TL type `contactStatus#d3680c61`. +// ContactStatus represents TL type `contactStatus#16d9703b`. // Contact status: online / offline. // // See https://core.telegram.org/constructor/contactStatus for reference. type ContactStatus struct { // User identifier - UserID int + UserID int64 // Online status Status UserStatusClass } // ContactStatusTypeID is TL type id of ContactStatus. -const ContactStatusTypeID = 0xd3680c61 +const ContactStatusTypeID = 0x16d9703b // Ensuring interfaces in compile-time for ContactStatus. var ( @@ -76,7 +76,7 @@ func (c *ContactStatus) String() string { // FillFrom fills ContactStatus from given interface. func (c *ContactStatus) FillFrom(from interface { - GetUserID() (value int) + GetUserID() (value int64) GetStatus() (value UserStatusClass) }) { c.UserID = from.GetUserID() @@ -121,7 +121,7 @@ func (c *ContactStatus) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (c *ContactStatus) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode contactStatus#d3680c61 as nil") + return fmt.Errorf("can't encode contactStatus#16d9703b as nil") } b.PutID(ContactStatusTypeID) return c.EncodeBare(b) @@ -130,14 +130,14 @@ func (c *ContactStatus) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (c *ContactStatus) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode contactStatus#d3680c61 as nil") + return fmt.Errorf("can't encode contactStatus#16d9703b as nil") } - b.PutInt(c.UserID) + b.PutLong(c.UserID) if c.Status == nil { - return fmt.Errorf("unable to encode contactStatus#d3680c61: field status is nil") + return fmt.Errorf("unable to encode contactStatus#16d9703b: field status is nil") } if err := c.Status.Encode(b); err != nil { - return fmt.Errorf("unable to encode contactStatus#d3680c61: field status: %w", err) + return fmt.Errorf("unable to encode contactStatus#16d9703b: field status: %w", err) } return nil } @@ -145,10 +145,10 @@ func (c *ContactStatus) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (c *ContactStatus) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode contactStatus#d3680c61 to nil") + return fmt.Errorf("can't decode contactStatus#16d9703b to nil") } if err := b.ConsumeID(ContactStatusTypeID); err != nil { - return fmt.Errorf("unable to decode contactStatus#d3680c61: %w", err) + return fmt.Errorf("unable to decode contactStatus#16d9703b: %w", err) } return c.DecodeBare(b) } @@ -156,19 +156,19 @@ func (c *ContactStatus) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (c *ContactStatus) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode contactStatus#d3680c61 to nil") + return fmt.Errorf("can't decode contactStatus#16d9703b to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode contactStatus#d3680c61: field user_id: %w", err) + return fmt.Errorf("unable to decode contactStatus#16d9703b: field user_id: %w", err) } c.UserID = value } { value, err := DecodeUserStatus(b) if err != nil { - return fmt.Errorf("unable to decode contactStatus#d3680c61: field status: %w", err) + return fmt.Errorf("unable to decode contactStatus#16d9703b: field status: %w", err) } c.Status = value } @@ -176,7 +176,7 @@ func (c *ContactStatus) DecodeBare(b *bin.Buffer) error { } // GetUserID returns value of UserID field. -func (c *ContactStatus) GetUserID() (value int) { +func (c *ContactStatus) GetUserID() (value int64) { return c.UserID } diff --git a/tg/tl_contacts_get_contact_ids_gen.go b/tg/tl_contacts_get_contact_ids_gen.go index 05073e0b6c..b005407a8c 100644 --- a/tg/tl_contacts_get_contact_ids_gen.go +++ b/tg/tl_contacts_get_contact_ids_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// ContactsGetContactIDsRequest represents TL type `contacts.getContactIDs#2caa4a42`. +// ContactsGetContactIDsRequest represents TL type `contacts.getContactIDs#7adc669d`. // Get contact by telegram IDs // // See https://core.telegram.org/method/contacts.getContactIDs for reference. @@ -38,11 +38,11 @@ type ContactsGetContactIDsRequest struct { // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation - Hash int + Hash int64 } // ContactsGetContactIDsRequestTypeID is TL type id of ContactsGetContactIDsRequest. -const ContactsGetContactIDsRequestTypeID = 0x2caa4a42 +const ContactsGetContactIDsRequestTypeID = 0x7adc669d // Ensuring interfaces in compile-time for ContactsGetContactIDsRequest. var ( @@ -74,7 +74,7 @@ func (g *ContactsGetContactIDsRequest) String() string { // FillFrom fills ContactsGetContactIDsRequest from given interface. func (g *ContactsGetContactIDsRequest) FillFrom(from interface { - GetHash() (value int) + GetHash() (value int64) }) { g.Hash = from.GetHash() } @@ -113,7 +113,7 @@ func (g *ContactsGetContactIDsRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (g *ContactsGetContactIDsRequest) Encode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode contacts.getContactIDs#2caa4a42 as nil") + return fmt.Errorf("can't encode contacts.getContactIDs#7adc669d as nil") } b.PutID(ContactsGetContactIDsRequestTypeID) return g.EncodeBare(b) @@ -122,19 +122,19 @@ func (g *ContactsGetContactIDsRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (g *ContactsGetContactIDsRequest) EncodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode contacts.getContactIDs#2caa4a42 as nil") + return fmt.Errorf("can't encode contacts.getContactIDs#7adc669d as nil") } - b.PutInt(g.Hash) + b.PutLong(g.Hash) return nil } // Decode implements bin.Decoder. func (g *ContactsGetContactIDsRequest) Decode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode contacts.getContactIDs#2caa4a42 to nil") + return fmt.Errorf("can't decode contacts.getContactIDs#7adc669d to nil") } if err := b.ConsumeID(ContactsGetContactIDsRequestTypeID); err != nil { - return fmt.Errorf("unable to decode contacts.getContactIDs#2caa4a42: %w", err) + return fmt.Errorf("unable to decode contacts.getContactIDs#7adc669d: %w", err) } return g.DecodeBare(b) } @@ -142,12 +142,12 @@ func (g *ContactsGetContactIDsRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (g *ContactsGetContactIDsRequest) DecodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode contacts.getContactIDs#2caa4a42 to nil") + return fmt.Errorf("can't decode contacts.getContactIDs#7adc669d to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode contacts.getContactIDs#2caa4a42: field hash: %w", err) + return fmt.Errorf("unable to decode contacts.getContactIDs#7adc669d: field hash: %w", err) } g.Hash = value } @@ -155,15 +155,15 @@ func (g *ContactsGetContactIDsRequest) DecodeBare(b *bin.Buffer) error { } // GetHash returns value of Hash field. -func (g *ContactsGetContactIDsRequest) GetHash() (value int) { +func (g *ContactsGetContactIDsRequest) GetHash() (value int64) { return g.Hash } -// ContactsGetContactIDs invokes method contacts.getContactIDs#2caa4a42 returning error if any. +// ContactsGetContactIDs invokes method contacts.getContactIDs#7adc669d returning error if any. // Get contact by telegram IDs // // See https://core.telegram.org/method/contacts.getContactIDs for reference. -func (c *Client) ContactsGetContactIDs(ctx context.Context, hash int) ([]int, error) { +func (c *Client) ContactsGetContactIDs(ctx context.Context, hash int64) ([]int, error) { var result IntVector request := &ContactsGetContactIDsRequest{ diff --git a/tg/tl_contacts_get_contacts_gen.go b/tg/tl_contacts_get_contacts_gen.go index faee0bc115..0c6a8afd82 100644 --- a/tg/tl_contacts_get_contacts_gen.go +++ b/tg/tl_contacts_get_contacts_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// ContactsGetContactsRequest represents TL type `contacts.getContacts#c023849f`. +// ContactsGetContactsRequest represents TL type `contacts.getContacts#5dd69e12`. // Returns the current user's contact list. // // See https://core.telegram.org/method/contacts.getContacts for reference. @@ -41,11 +41,11 @@ type ContactsGetContactsRequest struct { // Links: // 1) https://core.telegram.org/api/offsets#hash-generation // 2) https://core.telegram.org/constructor/contacts.contactsNotModified - Hash int + Hash int64 } // ContactsGetContactsRequestTypeID is TL type id of ContactsGetContactsRequest. -const ContactsGetContactsRequestTypeID = 0xc023849f +const ContactsGetContactsRequestTypeID = 0x5dd69e12 // Ensuring interfaces in compile-time for ContactsGetContactsRequest. var ( @@ -77,7 +77,7 @@ func (g *ContactsGetContactsRequest) String() string { // FillFrom fills ContactsGetContactsRequest from given interface. func (g *ContactsGetContactsRequest) FillFrom(from interface { - GetHash() (value int) + GetHash() (value int64) }) { g.Hash = from.GetHash() } @@ -116,7 +116,7 @@ func (g *ContactsGetContactsRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (g *ContactsGetContactsRequest) Encode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode contacts.getContacts#c023849f as nil") + return fmt.Errorf("can't encode contacts.getContacts#5dd69e12 as nil") } b.PutID(ContactsGetContactsRequestTypeID) return g.EncodeBare(b) @@ -125,19 +125,19 @@ func (g *ContactsGetContactsRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (g *ContactsGetContactsRequest) EncodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode contacts.getContacts#c023849f as nil") + return fmt.Errorf("can't encode contacts.getContacts#5dd69e12 as nil") } - b.PutInt(g.Hash) + b.PutLong(g.Hash) return nil } // Decode implements bin.Decoder. func (g *ContactsGetContactsRequest) Decode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode contacts.getContacts#c023849f to nil") + return fmt.Errorf("can't decode contacts.getContacts#5dd69e12 to nil") } if err := b.ConsumeID(ContactsGetContactsRequestTypeID); err != nil { - return fmt.Errorf("unable to decode contacts.getContacts#c023849f: %w", err) + return fmt.Errorf("unable to decode contacts.getContacts#5dd69e12: %w", err) } return g.DecodeBare(b) } @@ -145,12 +145,12 @@ func (g *ContactsGetContactsRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (g *ContactsGetContactsRequest) DecodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode contacts.getContacts#c023849f to nil") + return fmt.Errorf("can't decode contacts.getContacts#5dd69e12 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode contacts.getContacts#c023849f: field hash: %w", err) + return fmt.Errorf("unable to decode contacts.getContacts#5dd69e12: field hash: %w", err) } g.Hash = value } @@ -158,15 +158,15 @@ func (g *ContactsGetContactsRequest) DecodeBare(b *bin.Buffer) error { } // GetHash returns value of Hash field. -func (g *ContactsGetContactsRequest) GetHash() (value int) { +func (g *ContactsGetContactsRequest) GetHash() (value int64) { return g.Hash } -// ContactsGetContacts invokes method contacts.getContacts#c023849f returning error if any. +// ContactsGetContacts invokes method contacts.getContacts#5dd69e12 returning error if any. // Returns the current user's contact list. // // See https://core.telegram.org/method/contacts.getContacts for reference. -func (c *Client) ContactsGetContacts(ctx context.Context, hash int) (ContactsContactsClass, error) { +func (c *Client) ContactsGetContacts(ctx context.Context, hash int64) (ContactsContactsClass, error) { var result ContactsContactsBox request := &ContactsGetContactsRequest{ diff --git a/tg/tl_contacts_get_top_peers_gen.go b/tg/tl_contacts_get_top_peers_gen.go index fc1c771c79..82dc56e57b 100644 --- a/tg/tl_contacts_get_top_peers_gen.go +++ b/tg/tl_contacts_get_top_peers_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// ContactsGetTopPeersRequest represents TL type `contacts.getTopPeers#d4982db5`. +// ContactsGetTopPeersRequest represents TL type `contacts.getTopPeers#973478b6`. // Get most used peers // // See https://core.telegram.org/method/contacts.getTopPeers for reference. @@ -69,11 +69,11 @@ type ContactsGetTopPeersRequest struct { // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation - Hash int + Hash int64 } // ContactsGetTopPeersRequestTypeID is TL type id of ContactsGetTopPeersRequest. -const ContactsGetTopPeersRequestTypeID = 0xd4982db5 +const ContactsGetTopPeersRequestTypeID = 0x973478b6 // Ensuring interfaces in compile-time for ContactsGetTopPeersRequest. var ( @@ -148,7 +148,7 @@ func (g *ContactsGetTopPeersRequest) FillFrom(from interface { GetChannels() (value bool) GetOffset() (value int) GetLimit() (value int) - GetHash() (value int) + GetHash() (value int64) }) { g.Correspondents = from.GetCorrespondents() g.BotsPm = from.GetBotsPm() @@ -245,7 +245,7 @@ func (g *ContactsGetTopPeersRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (g *ContactsGetTopPeersRequest) Encode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode contacts.getTopPeers#d4982db5 as nil") + return fmt.Errorf("can't encode contacts.getTopPeers#973478b6 as nil") } b.PutID(ContactsGetTopPeersRequestTypeID) return g.EncodeBare(b) @@ -254,7 +254,7 @@ func (g *ContactsGetTopPeersRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (g *ContactsGetTopPeersRequest) EncodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode contacts.getTopPeers#d4982db5 as nil") + return fmt.Errorf("can't encode contacts.getTopPeers#973478b6 as nil") } if !(g.Correspondents == false) { g.Flags.Set(0) @@ -281,21 +281,21 @@ func (g *ContactsGetTopPeersRequest) EncodeBare(b *bin.Buffer) error { g.Flags.Set(15) } if err := g.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode contacts.getTopPeers#d4982db5: field flags: %w", err) + return fmt.Errorf("unable to encode contacts.getTopPeers#973478b6: field flags: %w", err) } b.PutInt(g.Offset) b.PutInt(g.Limit) - b.PutInt(g.Hash) + b.PutLong(g.Hash) return nil } // Decode implements bin.Decoder. func (g *ContactsGetTopPeersRequest) Decode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode contacts.getTopPeers#d4982db5 to nil") + return fmt.Errorf("can't decode contacts.getTopPeers#973478b6 to nil") } if err := b.ConsumeID(ContactsGetTopPeersRequestTypeID); err != nil { - return fmt.Errorf("unable to decode contacts.getTopPeers#d4982db5: %w", err) + return fmt.Errorf("unable to decode contacts.getTopPeers#973478b6: %w", err) } return g.DecodeBare(b) } @@ -303,11 +303,11 @@ func (g *ContactsGetTopPeersRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (g *ContactsGetTopPeersRequest) DecodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode contacts.getTopPeers#d4982db5 to nil") + return fmt.Errorf("can't decode contacts.getTopPeers#973478b6 to nil") } { if err := g.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode contacts.getTopPeers#d4982db5: field flags: %w", err) + return fmt.Errorf("unable to decode contacts.getTopPeers#973478b6: field flags: %w", err) } } g.Correspondents = g.Flags.Has(0) @@ -321,21 +321,21 @@ func (g *ContactsGetTopPeersRequest) DecodeBare(b *bin.Buffer) error { { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode contacts.getTopPeers#d4982db5: field offset: %w", err) + return fmt.Errorf("unable to decode contacts.getTopPeers#973478b6: field offset: %w", err) } g.Offset = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode contacts.getTopPeers#d4982db5: field limit: %w", err) + return fmt.Errorf("unable to decode contacts.getTopPeers#973478b6: field limit: %w", err) } g.Limit = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode contacts.getTopPeers#d4982db5: field hash: %w", err) + return fmt.Errorf("unable to decode contacts.getTopPeers#973478b6: field hash: %w", err) } g.Hash = value } @@ -481,11 +481,11 @@ func (g *ContactsGetTopPeersRequest) GetLimit() (value int) { } // GetHash returns value of Hash field. -func (g *ContactsGetTopPeersRequest) GetHash() (value int) { +func (g *ContactsGetTopPeersRequest) GetHash() (value int64) { return g.Hash } -// ContactsGetTopPeers invokes method contacts.getTopPeers#d4982db5 returning error if any. +// ContactsGetTopPeers invokes method contacts.getTopPeers#973478b6 returning error if any. // Get most used peers // // Possible errors: diff --git a/tg/tl_document_slices_gen.go b/tg/tl_document_slices_gen.go index 9d83f16d30..b88e64853a 100644 --- a/tg/tl_document_slices_gen.go +++ b/tg/tl_document_slices_gen.go @@ -114,6 +114,38 @@ func (s *DocumentClassArray) Pop() (v DocumentClass, ok bool) { return v, true } +// SortByID sorts slice of DocumentClass by ID. +func (s DocumentClassArray) SortByID() DocumentClassArray { + return s.Sort(func(a, b DocumentClass) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of DocumentClass by ID. +func (s DocumentClassArray) SortStableByID() DocumentClassArray { + return s.SortStable(func(a, b DocumentClass) bool { + return a.GetID() < b.GetID() + }) +} + +// FillDocumentEmptyMap fills only DocumentEmpty constructors to given map. +func (s DocumentClassArray) FillDocumentEmptyMap(to map[int64]*DocumentEmpty) { + for _, elem := range s { + value, ok := elem.(*DocumentEmpty) + if !ok { + continue + } + to[value.GetID()] = value + } +} + +// DocumentEmptyToMap collects only DocumentEmpty constructors to map. +func (s DocumentClassArray) DocumentEmptyToMap() map[int64]*DocumentEmpty { + r := make(map[int64]*DocumentEmpty, len(s)) + s.FillDocumentEmptyMap(r) + return r +} + // AsDocumentEmpty returns copy with only DocumentEmpty constructors. func (s DocumentClassArray) AsDocumentEmpty() (to DocumentEmptyArray) { for _, elem := range s { @@ -127,6 +159,24 @@ func (s DocumentClassArray) AsDocumentEmpty() (to DocumentEmptyArray) { return to } +// FillDocumentMap fills only Document constructors to given map. +func (s DocumentClassArray) FillDocumentMap(to map[int64]*Document) { + for _, elem := range s { + value, ok := elem.(*Document) + if !ok { + continue + } + to[value.GetID()] = value + } +} + +// DocumentToMap collects only Document constructors to map. +func (s DocumentClassArray) DocumentToMap() map[int64]*Document { + r := make(map[int64]*Document, len(s)) + s.FillDocumentMap(r) + return r +} + // AsDocument returns copy with only Document constructors. func (s DocumentClassArray) AsDocument() (to DocumentArray) { for _, elem := range s { @@ -140,6 +190,24 @@ func (s DocumentClassArray) AsDocument() (to DocumentArray) { return to } +// FillNotEmptyMap fills only NotEmpty constructors to given map. +func (s DocumentClassArray) FillNotEmptyMap(to map[int64]*Document) { + for _, elem := range s { + value, ok := elem.AsNotEmpty() + if !ok { + continue + } + to[value.GetID()] = value + } +} + +// NotEmptyToMap collects only NotEmpty constructors to map. +func (s DocumentClassArray) NotEmptyToMap() map[int64]*Document { + r := make(map[int64]*Document, len(s)) + s.FillNotEmptyMap(r) + return r +} + // AppendOnlyNotEmpty appends only NotEmpty constructors to // given slice. func (s DocumentClassArray) AppendOnlyNotEmpty(to []*Document) []*Document { @@ -277,6 +345,34 @@ func (s *DocumentEmptyArray) Pop() (v DocumentEmpty, ok bool) { return v, true } +// SortByID sorts slice of DocumentEmpty by ID. +func (s DocumentEmptyArray) SortByID() DocumentEmptyArray { + return s.Sort(func(a, b DocumentEmpty) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of DocumentEmpty by ID. +func (s DocumentEmptyArray) SortStableByID() DocumentEmptyArray { + return s.SortStable(func(a, b DocumentEmpty) bool { + return a.GetID() < b.GetID() + }) +} + +// FillMap fills constructors to given map. +func (s DocumentEmptyArray) FillMap(to map[int64]DocumentEmpty) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s DocumentEmptyArray) ToMap() map[int64]DocumentEmpty { + r := make(map[int64]DocumentEmpty, len(s)) + s.FillMap(r) + return r +} + // DocumentArray is adapter for slice of Document. type DocumentArray []Document @@ -359,6 +455,20 @@ func (s *DocumentArray) Pop() (v Document, ok bool) { return v, true } +// SortByID sorts slice of Document by ID. +func (s DocumentArray) SortByID() DocumentArray { + return s.Sort(func(a, b Document) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of Document by ID. +func (s DocumentArray) SortStableByID() DocumentArray { + return s.SortStable(func(a, b Document) bool { + return a.GetID() < b.GetID() + }) +} + // SortByDate sorts slice of Document by Date. func (s DocumentArray) SortByDate() DocumentArray { return s.Sort(func(a, b Document) bool { @@ -372,3 +482,17 @@ func (s DocumentArray) SortStableByDate() DocumentArray { return a.GetDate() < b.GetDate() }) } + +// FillMap fills constructors to given map. +func (s DocumentArray) FillMap(to map[int64]Document) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s DocumentArray) ToMap() map[int64]Document { + r := make(map[int64]Document, len(s)) + s.FillMap(r) + return r +} diff --git a/tg/tl_encrypted_chat_gen.go b/tg/tl_encrypted_chat_gen.go index 6a3995d66e..306b947a77 100644 --- a/tg/tl_encrypted_chat_gen.go +++ b/tg/tl_encrypted_chat_gen.go @@ -161,7 +161,7 @@ func (e *EncryptedChatEmpty) GetID() (value int) { return e.ID } -// EncryptedChatWaiting represents TL type `encryptedChatWaiting#3bf703dc`. +// EncryptedChatWaiting represents TL type `encryptedChatWaiting#66b25953`. // Chat waiting for approval of second participant. // // See https://core.telegram.org/constructor/encryptedChatWaiting for reference. @@ -173,13 +173,13 @@ type EncryptedChatWaiting struct { // Date of chat creation Date int // Chat creator ID - AdminID int + AdminID int64 // ID of second chat participant - ParticipantID int + ParticipantID int64 } // EncryptedChatWaitingTypeID is TL type id of EncryptedChatWaiting. -const EncryptedChatWaitingTypeID = 0x3bf703dc +const EncryptedChatWaitingTypeID = 0x66b25953 // construct implements constructor of EncryptedChatClass. func (e EncryptedChatWaiting) construct() EncryptedChatClass { return &e } @@ -231,8 +231,8 @@ func (e *EncryptedChatWaiting) FillFrom(from interface { GetID() (value int) GetAccessHash() (value int64) GetDate() (value int) - GetAdminID() (value int) - GetParticipantID() (value int) + GetAdminID() (value int64) + GetParticipantID() (value int64) }) { e.ID = from.GetID() e.AccessHash = from.GetAccessHash() @@ -291,7 +291,7 @@ func (e *EncryptedChatWaiting) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (e *EncryptedChatWaiting) Encode(b *bin.Buffer) error { if e == nil { - return fmt.Errorf("can't encode encryptedChatWaiting#3bf703dc as nil") + return fmt.Errorf("can't encode encryptedChatWaiting#66b25953 as nil") } b.PutID(EncryptedChatWaitingTypeID) return e.EncodeBare(b) @@ -300,23 +300,23 @@ func (e *EncryptedChatWaiting) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (e *EncryptedChatWaiting) EncodeBare(b *bin.Buffer) error { if e == nil { - return fmt.Errorf("can't encode encryptedChatWaiting#3bf703dc as nil") + return fmt.Errorf("can't encode encryptedChatWaiting#66b25953 as nil") } b.PutInt(e.ID) b.PutLong(e.AccessHash) b.PutInt(e.Date) - b.PutInt(e.AdminID) - b.PutInt(e.ParticipantID) + b.PutLong(e.AdminID) + b.PutLong(e.ParticipantID) return nil } // Decode implements bin.Decoder. func (e *EncryptedChatWaiting) Decode(b *bin.Buffer) error { if e == nil { - return fmt.Errorf("can't decode encryptedChatWaiting#3bf703dc to nil") + return fmt.Errorf("can't decode encryptedChatWaiting#66b25953 to nil") } if err := b.ConsumeID(EncryptedChatWaitingTypeID); err != nil { - return fmt.Errorf("unable to decode encryptedChatWaiting#3bf703dc: %w", err) + return fmt.Errorf("unable to decode encryptedChatWaiting#66b25953: %w", err) } return e.DecodeBare(b) } @@ -324,40 +324,40 @@ func (e *EncryptedChatWaiting) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (e *EncryptedChatWaiting) DecodeBare(b *bin.Buffer) error { if e == nil { - return fmt.Errorf("can't decode encryptedChatWaiting#3bf703dc to nil") + return fmt.Errorf("can't decode encryptedChatWaiting#66b25953 to nil") } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode encryptedChatWaiting#3bf703dc: field id: %w", err) + return fmt.Errorf("unable to decode encryptedChatWaiting#66b25953: field id: %w", err) } e.ID = value } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode encryptedChatWaiting#3bf703dc: field access_hash: %w", err) + return fmt.Errorf("unable to decode encryptedChatWaiting#66b25953: field access_hash: %w", err) } e.AccessHash = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode encryptedChatWaiting#3bf703dc: field date: %w", err) + return fmt.Errorf("unable to decode encryptedChatWaiting#66b25953: field date: %w", err) } e.Date = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode encryptedChatWaiting#3bf703dc: field admin_id: %w", err) + return fmt.Errorf("unable to decode encryptedChatWaiting#66b25953: field admin_id: %w", err) } e.AdminID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode encryptedChatWaiting#3bf703dc: field participant_id: %w", err) + return fmt.Errorf("unable to decode encryptedChatWaiting#66b25953: field participant_id: %w", err) } e.ParticipantID = value } @@ -380,16 +380,16 @@ func (e *EncryptedChatWaiting) GetDate() (value int) { } // GetAdminID returns value of AdminID field. -func (e *EncryptedChatWaiting) GetAdminID() (value int) { +func (e *EncryptedChatWaiting) GetAdminID() (value int64) { return e.AdminID } // GetParticipantID returns value of ParticipantID field. -func (e *EncryptedChatWaiting) GetParticipantID() (value int) { +func (e *EncryptedChatWaiting) GetParticipantID() (value int64) { return e.ParticipantID } -// EncryptedChatRequested represents TL type `encryptedChatRequested#62718a82`. +// EncryptedChatRequested represents TL type `encryptedChatRequested#48f1d94c`. // Request to create an encrypted chat. // // See https://core.telegram.org/constructor/encryptedChatRequested for reference. @@ -413,9 +413,9 @@ type EncryptedChatRequested struct { // Chat creation date Date int // Chat creator ID - AdminID int + AdminID int64 // ID of second chat participant - ParticipantID int + ParticipantID int64 // A = g ^ a mod p, see Wikipedia¹ // // Links: @@ -424,7 +424,7 @@ type EncryptedChatRequested struct { } // EncryptedChatRequestedTypeID is TL type id of EncryptedChatRequested. -const EncryptedChatRequestedTypeID = 0x62718a82 +const EncryptedChatRequestedTypeID = 0x48f1d94c // construct implements constructor of EncryptedChatClass. func (e EncryptedChatRequested) construct() EncryptedChatClass { return &e } @@ -486,8 +486,8 @@ func (e *EncryptedChatRequested) FillFrom(from interface { GetID() (value int) GetAccessHash() (value int64) GetDate() (value int) - GetAdminID() (value int) - GetParticipantID() (value int) + GetAdminID() (value int64) + GetParticipantID() (value int64) GetGA() (value []byte) }) { if val, ok := from.GetFolderID(); ok { @@ -561,7 +561,7 @@ func (e *EncryptedChatRequested) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (e *EncryptedChatRequested) Encode(b *bin.Buffer) error { if e == nil { - return fmt.Errorf("can't encode encryptedChatRequested#62718a82 as nil") + return fmt.Errorf("can't encode encryptedChatRequested#48f1d94c as nil") } b.PutID(EncryptedChatRequestedTypeID) return e.EncodeBare(b) @@ -570,13 +570,13 @@ func (e *EncryptedChatRequested) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (e *EncryptedChatRequested) EncodeBare(b *bin.Buffer) error { if e == nil { - return fmt.Errorf("can't encode encryptedChatRequested#62718a82 as nil") + return fmt.Errorf("can't encode encryptedChatRequested#48f1d94c as nil") } if !(e.FolderID == 0) { e.Flags.Set(0) } if err := e.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode encryptedChatRequested#62718a82: field flags: %w", err) + return fmt.Errorf("unable to encode encryptedChatRequested#48f1d94c: field flags: %w", err) } if e.Flags.Has(0) { b.PutInt(e.FolderID) @@ -584,8 +584,8 @@ func (e *EncryptedChatRequested) EncodeBare(b *bin.Buffer) error { b.PutInt(e.ID) b.PutLong(e.AccessHash) b.PutInt(e.Date) - b.PutInt(e.AdminID) - b.PutInt(e.ParticipantID) + b.PutLong(e.AdminID) + b.PutLong(e.ParticipantID) b.PutBytes(e.GA) return nil } @@ -593,10 +593,10 @@ func (e *EncryptedChatRequested) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (e *EncryptedChatRequested) Decode(b *bin.Buffer) error { if e == nil { - return fmt.Errorf("can't decode encryptedChatRequested#62718a82 to nil") + return fmt.Errorf("can't decode encryptedChatRequested#48f1d94c to nil") } if err := b.ConsumeID(EncryptedChatRequestedTypeID); err != nil { - return fmt.Errorf("unable to decode encryptedChatRequested#62718a82: %w", err) + return fmt.Errorf("unable to decode encryptedChatRequested#48f1d94c: %w", err) } return e.DecodeBare(b) } @@ -604,59 +604,59 @@ func (e *EncryptedChatRequested) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (e *EncryptedChatRequested) DecodeBare(b *bin.Buffer) error { if e == nil { - return fmt.Errorf("can't decode encryptedChatRequested#62718a82 to nil") + return fmt.Errorf("can't decode encryptedChatRequested#48f1d94c to nil") } { if err := e.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode encryptedChatRequested#62718a82: field flags: %w", err) + return fmt.Errorf("unable to decode encryptedChatRequested#48f1d94c: field flags: %w", err) } } if e.Flags.Has(0) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode encryptedChatRequested#62718a82: field folder_id: %w", err) + return fmt.Errorf("unable to decode encryptedChatRequested#48f1d94c: field folder_id: %w", err) } e.FolderID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode encryptedChatRequested#62718a82: field id: %w", err) + return fmt.Errorf("unable to decode encryptedChatRequested#48f1d94c: field id: %w", err) } e.ID = value } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode encryptedChatRequested#62718a82: field access_hash: %w", err) + return fmt.Errorf("unable to decode encryptedChatRequested#48f1d94c: field access_hash: %w", err) } e.AccessHash = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode encryptedChatRequested#62718a82: field date: %w", err) + return fmt.Errorf("unable to decode encryptedChatRequested#48f1d94c: field date: %w", err) } e.Date = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode encryptedChatRequested#62718a82: field admin_id: %w", err) + return fmt.Errorf("unable to decode encryptedChatRequested#48f1d94c: field admin_id: %w", err) } e.AdminID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode encryptedChatRequested#62718a82: field participant_id: %w", err) + return fmt.Errorf("unable to decode encryptedChatRequested#48f1d94c: field participant_id: %w", err) } e.ParticipantID = value } { value, err := b.Bytes() if err != nil { - return fmt.Errorf("unable to decode encryptedChatRequested#62718a82: field g_a: %w", err) + return fmt.Errorf("unable to decode encryptedChatRequested#48f1d94c: field g_a: %w", err) } e.GA = value } @@ -694,12 +694,12 @@ func (e *EncryptedChatRequested) GetDate() (value int) { } // GetAdminID returns value of AdminID field. -func (e *EncryptedChatRequested) GetAdminID() (value int) { +func (e *EncryptedChatRequested) GetAdminID() (value int64) { return e.AdminID } // GetParticipantID returns value of ParticipantID field. -func (e *EncryptedChatRequested) GetParticipantID() (value int) { +func (e *EncryptedChatRequested) GetParticipantID() (value int64) { return e.ParticipantID } @@ -708,7 +708,7 @@ func (e *EncryptedChatRequested) GetGA() (value []byte) { return e.GA } -// EncryptedChat represents TL type `encryptedChat#fa56ce36`. +// EncryptedChat represents TL type `encryptedChat#61f0d4c7`. // Encrypted chat // // See https://core.telegram.org/constructor/encryptedChat for reference. @@ -720,9 +720,9 @@ type EncryptedChat struct { // Date chat was created Date int // Chat creator ID - AdminID int + AdminID int64 // ID of the second chat participant - ParticipantID int + ParticipantID int64 // B = g ^ b mod p, if the currently authorized user is the chat's creator,or A = g ^ a // mod p otherwiseSee Wikipedia¹ for more info // @@ -734,7 +734,7 @@ type EncryptedChat struct { } // EncryptedChatTypeID is TL type id of EncryptedChat. -const EncryptedChatTypeID = 0xfa56ce36 +const EncryptedChatTypeID = 0x61f0d4c7 // construct implements constructor of EncryptedChatClass. func (e EncryptedChat) construct() EncryptedChatClass { return &e } @@ -792,8 +792,8 @@ func (e *EncryptedChat) FillFrom(from interface { GetID() (value int) GetAccessHash() (value int64) GetDate() (value int) - GetAdminID() (value int) - GetParticipantID() (value int) + GetAdminID() (value int64) + GetParticipantID() (value int64) GetGAOrB() (value []byte) GetKeyFingerprint() (value int64) }) { @@ -864,7 +864,7 @@ func (e *EncryptedChat) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (e *EncryptedChat) Encode(b *bin.Buffer) error { if e == nil { - return fmt.Errorf("can't encode encryptedChat#fa56ce36 as nil") + return fmt.Errorf("can't encode encryptedChat#61f0d4c7 as nil") } b.PutID(EncryptedChatTypeID) return e.EncodeBare(b) @@ -873,13 +873,13 @@ func (e *EncryptedChat) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (e *EncryptedChat) EncodeBare(b *bin.Buffer) error { if e == nil { - return fmt.Errorf("can't encode encryptedChat#fa56ce36 as nil") + return fmt.Errorf("can't encode encryptedChat#61f0d4c7 as nil") } b.PutInt(e.ID) b.PutLong(e.AccessHash) b.PutInt(e.Date) - b.PutInt(e.AdminID) - b.PutInt(e.ParticipantID) + b.PutLong(e.AdminID) + b.PutLong(e.ParticipantID) b.PutBytes(e.GAOrB) b.PutLong(e.KeyFingerprint) return nil @@ -888,10 +888,10 @@ func (e *EncryptedChat) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (e *EncryptedChat) Decode(b *bin.Buffer) error { if e == nil { - return fmt.Errorf("can't decode encryptedChat#fa56ce36 to nil") + return fmt.Errorf("can't decode encryptedChat#61f0d4c7 to nil") } if err := b.ConsumeID(EncryptedChatTypeID); err != nil { - return fmt.Errorf("unable to decode encryptedChat#fa56ce36: %w", err) + return fmt.Errorf("unable to decode encryptedChat#61f0d4c7: %w", err) } return e.DecodeBare(b) } @@ -899,54 +899,54 @@ func (e *EncryptedChat) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (e *EncryptedChat) DecodeBare(b *bin.Buffer) error { if e == nil { - return fmt.Errorf("can't decode encryptedChat#fa56ce36 to nil") + return fmt.Errorf("can't decode encryptedChat#61f0d4c7 to nil") } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode encryptedChat#fa56ce36: field id: %w", err) + return fmt.Errorf("unable to decode encryptedChat#61f0d4c7: field id: %w", err) } e.ID = value } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode encryptedChat#fa56ce36: field access_hash: %w", err) + return fmt.Errorf("unable to decode encryptedChat#61f0d4c7: field access_hash: %w", err) } e.AccessHash = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode encryptedChat#fa56ce36: field date: %w", err) + return fmt.Errorf("unable to decode encryptedChat#61f0d4c7: field date: %w", err) } e.Date = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode encryptedChat#fa56ce36: field admin_id: %w", err) + return fmt.Errorf("unable to decode encryptedChat#61f0d4c7: field admin_id: %w", err) } e.AdminID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode encryptedChat#fa56ce36: field participant_id: %w", err) + return fmt.Errorf("unable to decode encryptedChat#61f0d4c7: field participant_id: %w", err) } e.ParticipantID = value } { value, err := b.Bytes() if err != nil { - return fmt.Errorf("unable to decode encryptedChat#fa56ce36: field g_a_or_b: %w", err) + return fmt.Errorf("unable to decode encryptedChat#61f0d4c7: field g_a_or_b: %w", err) } e.GAOrB = value } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode encryptedChat#fa56ce36: field key_fingerprint: %w", err) + return fmt.Errorf("unable to decode encryptedChat#61f0d4c7: field key_fingerprint: %w", err) } e.KeyFingerprint = value } @@ -969,12 +969,12 @@ func (e *EncryptedChat) GetDate() (value int) { } // GetAdminID returns value of AdminID field. -func (e *EncryptedChat) GetAdminID() (value int) { +func (e *EncryptedChat) GetAdminID() (value int64) { return e.AdminID } // GetParticipantID returns value of ParticipantID field. -func (e *EncryptedChat) GetParticipantID() (value int) { +func (e *EncryptedChat) GetParticipantID() (value int64) { return e.ParticipantID } @@ -1176,9 +1176,9 @@ func (e *EncryptedChatDiscarded) GetID() (value int) { // } // switch v := g.(type) { // case *tg.EncryptedChatEmpty: // encryptedChatEmpty#ab7ec0a0 -// case *tg.EncryptedChatWaiting: // encryptedChatWaiting#3bf703dc -// case *tg.EncryptedChatRequested: // encryptedChatRequested#62718a82 -// case *tg.EncryptedChat: // encryptedChat#fa56ce36 +// case *tg.EncryptedChatWaiting: // encryptedChatWaiting#66b25953 +// case *tg.EncryptedChatRequested: // encryptedChatRequested#48f1d94c +// case *tg.EncryptedChat: // encryptedChat#61f0d4c7 // case *tg.EncryptedChatDiscarded: // encryptedChatDiscarded#1e1c7c45 // default: panic(v) // } @@ -1284,21 +1284,21 @@ func DecodeEncryptedChat(buf *bin.Buffer) (EncryptedChatClass, error) { } return &v, nil case EncryptedChatWaitingTypeID: - // Decoding encryptedChatWaiting#3bf703dc. + // Decoding encryptedChatWaiting#66b25953. v := EncryptedChatWaiting{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode EncryptedChatClass: %w", err) } return &v, nil case EncryptedChatRequestedTypeID: - // Decoding encryptedChatRequested#62718a82. + // Decoding encryptedChatRequested#48f1d94c. v := EncryptedChatRequested{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode EncryptedChatClass: %w", err) } return &v, nil case EncryptedChatTypeID: - // Decoding encryptedChat#fa56ce36. + // Decoding encryptedChat#61f0d4c7. v := EncryptedChat{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode EncryptedChatClass: %w", err) diff --git a/tg/tl_encrypted_file_slices_gen.go b/tg/tl_encrypted_file_slices_gen.go index fd0f12ef38..992d1771dd 100644 --- a/tg/tl_encrypted_file_slices_gen.go +++ b/tg/tl_encrypted_file_slices_gen.go @@ -127,6 +127,24 @@ func (s EncryptedFileClassArray) AsEncryptedFile() (to EncryptedFileArray) { return to } +// FillNotEmptyMap fills only NotEmpty constructors to given map. +func (s EncryptedFileClassArray) FillNotEmptyMap(to map[int64]*EncryptedFile) { + for _, elem := range s { + value, ok := elem.AsNotEmpty() + if !ok { + continue + } + to[value.GetID()] = value + } +} + +// NotEmptyToMap collects only NotEmpty constructors to map. +func (s EncryptedFileClassArray) NotEmptyToMap() map[int64]*EncryptedFile { + r := make(map[int64]*EncryptedFile, len(s)) + s.FillNotEmptyMap(r) + return r +} + // AppendOnlyNotEmpty appends only NotEmpty constructors to // given slice. func (s EncryptedFileClassArray) AppendOnlyNotEmpty(to []*EncryptedFile) []*EncryptedFile { @@ -263,3 +281,31 @@ func (s *EncryptedFileArray) Pop() (v EncryptedFile, ok bool) { return v, true } + +// SortByID sorts slice of EncryptedFile by ID. +func (s EncryptedFileArray) SortByID() EncryptedFileArray { + return s.Sort(func(a, b EncryptedFile) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of EncryptedFile by ID. +func (s EncryptedFileArray) SortStableByID() EncryptedFileArray { + return s.SortStable(func(a, b EncryptedFile) bool { + return a.GetID() < b.GetID() + }) +} + +// FillMap fills constructors to given map. +func (s EncryptedFileArray) FillMap(to map[int64]EncryptedFile) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s EncryptedFileArray) ToMap() map[int64]EncryptedFile { + r := make(map[int64]EncryptedFile, len(s)) + s.FillMap(r) + return r +} diff --git a/tg/tl_group_call_slices_gen.go b/tg/tl_group_call_slices_gen.go index ee6cc786a3..ff2417489f 100644 --- a/tg/tl_group_call_slices_gen.go +++ b/tg/tl_group_call_slices_gen.go @@ -114,6 +114,38 @@ func (s *GroupCallClassArray) Pop() (v GroupCallClass, ok bool) { return v, true } +// SortByID sorts slice of GroupCallClass by ID. +func (s GroupCallClassArray) SortByID() GroupCallClassArray { + return s.Sort(func(a, b GroupCallClass) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of GroupCallClass by ID. +func (s GroupCallClassArray) SortStableByID() GroupCallClassArray { + return s.SortStable(func(a, b GroupCallClass) bool { + return a.GetID() < b.GetID() + }) +} + +// FillGroupCallDiscardedMap fills only GroupCallDiscarded constructors to given map. +func (s GroupCallClassArray) FillGroupCallDiscardedMap(to map[int64]*GroupCallDiscarded) { + for _, elem := range s { + value, ok := elem.(*GroupCallDiscarded) + if !ok { + continue + } + to[value.GetID()] = value + } +} + +// GroupCallDiscardedToMap collects only GroupCallDiscarded constructors to map. +func (s GroupCallClassArray) GroupCallDiscardedToMap() map[int64]*GroupCallDiscarded { + r := make(map[int64]*GroupCallDiscarded, len(s)) + s.FillGroupCallDiscardedMap(r) + return r +} + // AsGroupCallDiscarded returns copy with only GroupCallDiscarded constructors. func (s GroupCallClassArray) AsGroupCallDiscarded() (to GroupCallDiscardedArray) { for _, elem := range s { @@ -127,6 +159,24 @@ func (s GroupCallClassArray) AsGroupCallDiscarded() (to GroupCallDiscardedArray) return to } +// FillGroupCallMap fills only GroupCall constructors to given map. +func (s GroupCallClassArray) FillGroupCallMap(to map[int64]*GroupCall) { + for _, elem := range s { + value, ok := elem.(*GroupCall) + if !ok { + continue + } + to[value.GetID()] = value + } +} + +// GroupCallToMap collects only GroupCall constructors to map. +func (s GroupCallClassArray) GroupCallToMap() map[int64]*GroupCall { + r := make(map[int64]*GroupCall, len(s)) + s.FillGroupCallMap(r) + return r +} + // AsGroupCall returns copy with only GroupCall constructors. func (s GroupCallClassArray) AsGroupCall() (to GroupCallArray) { for _, elem := range s { @@ -222,6 +272,34 @@ func (s *GroupCallDiscardedArray) Pop() (v GroupCallDiscarded, ok bool) { return v, true } +// SortByID sorts slice of GroupCallDiscarded by ID. +func (s GroupCallDiscardedArray) SortByID() GroupCallDiscardedArray { + return s.Sort(func(a, b GroupCallDiscarded) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of GroupCallDiscarded by ID. +func (s GroupCallDiscardedArray) SortStableByID() GroupCallDiscardedArray { + return s.SortStable(func(a, b GroupCallDiscarded) bool { + return a.GetID() < b.GetID() + }) +} + +// FillMap fills constructors to given map. +func (s GroupCallDiscardedArray) FillMap(to map[int64]GroupCallDiscarded) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s GroupCallDiscardedArray) ToMap() map[int64]GroupCallDiscarded { + r := make(map[int64]GroupCallDiscarded, len(s)) + s.FillMap(r) + return r +} + // GroupCallArray is adapter for slice of GroupCall. type GroupCallArray []GroupCall @@ -303,3 +381,31 @@ func (s *GroupCallArray) Pop() (v GroupCall, ok bool) { return v, true } + +// SortByID sorts slice of GroupCall by ID. +func (s GroupCallArray) SortByID() GroupCallArray { + return s.Sort(func(a, b GroupCall) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of GroupCall by ID. +func (s GroupCallArray) SortStableByID() GroupCallArray { + return s.SortStable(func(a, b GroupCall) bool { + return a.GetID() < b.GetID() + }) +} + +// FillMap fills constructors to given map. +func (s GroupCallArray) FillMap(to map[int64]GroupCall) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s GroupCallArray) ToMap() map[int64]GroupCall { + r := make(map[int64]GroupCall, len(s)) + s.FillMap(r) + return r +} diff --git a/tg/tl_handlers_gen.go b/tg/tl_handlers_gen.go index 965a3fc6c2..c4941c90d5 100644 --- a/tg/tl_handlers_gen.go +++ b/tg/tl_handlers_gen.go @@ -43,16 +43,16 @@ func NewUpdateDispatcher() UpdateDispatcher { type Entities struct { Short bool - Users map[int]*User - Chats map[int]*Chat - Channels map[int]*Channel + Users map[int64]*User + Chats map[int64]*Chat + Channels map[int64]*Channel } func (u *Entities) short() { u.Short = true - u.Users = make(map[int]*User, 0) - u.Chats = make(map[int]*Chat, 0) - u.Channels = make(map[int]*Channel, 0) + u.Users = make(map[int64]*User, 0) + u.Chats = make(map[int64]*Chat, 0) + u.Channels = make(map[int64]*Channel, 0) } // Handle implements UpdateDispatcher. diff --git a/tg/tl_high_score_gen.go b/tg/tl_high_score_gen.go index 654a4fcda8..f0bdf668a4 100644 --- a/tg/tl_high_score_gen.go +++ b/tg/tl_high_score_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// HighScore represents TL type `highScore#58fffcd0`. +// HighScore represents TL type `highScore#73a379eb`. // Game highscore // // See https://core.telegram.org/constructor/highScore for reference. @@ -37,13 +37,13 @@ type HighScore struct { // Position in highscore list Pos int // User ID - UserID int + UserID int64 // Score Score int } // HighScoreTypeID is TL type id of HighScore. -const HighScoreTypeID = 0x58fffcd0 +const HighScoreTypeID = 0x73a379eb // Ensuring interfaces in compile-time for HighScore. var ( @@ -82,7 +82,7 @@ func (h *HighScore) String() string { // FillFrom fills HighScore from given interface. func (h *HighScore) FillFrom(from interface { GetPos() (value int) - GetUserID() (value int) + GetUserID() (value int64) GetScore() (value int) }) { h.Pos = from.GetPos() @@ -132,7 +132,7 @@ func (h *HighScore) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (h *HighScore) Encode(b *bin.Buffer) error { if h == nil { - return fmt.Errorf("can't encode highScore#58fffcd0 as nil") + return fmt.Errorf("can't encode highScore#73a379eb as nil") } b.PutID(HighScoreTypeID) return h.EncodeBare(b) @@ -141,10 +141,10 @@ func (h *HighScore) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (h *HighScore) EncodeBare(b *bin.Buffer) error { if h == nil { - return fmt.Errorf("can't encode highScore#58fffcd0 as nil") + return fmt.Errorf("can't encode highScore#73a379eb as nil") } b.PutInt(h.Pos) - b.PutInt(h.UserID) + b.PutLong(h.UserID) b.PutInt(h.Score) return nil } @@ -152,10 +152,10 @@ func (h *HighScore) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (h *HighScore) Decode(b *bin.Buffer) error { if h == nil { - return fmt.Errorf("can't decode highScore#58fffcd0 to nil") + return fmt.Errorf("can't decode highScore#73a379eb to nil") } if err := b.ConsumeID(HighScoreTypeID); err != nil { - return fmt.Errorf("unable to decode highScore#58fffcd0: %w", err) + return fmt.Errorf("unable to decode highScore#73a379eb: %w", err) } return h.DecodeBare(b) } @@ -163,26 +163,26 @@ func (h *HighScore) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (h *HighScore) DecodeBare(b *bin.Buffer) error { if h == nil { - return fmt.Errorf("can't decode highScore#58fffcd0 to nil") + return fmt.Errorf("can't decode highScore#73a379eb to nil") } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode highScore#58fffcd0: field pos: %w", err) + return fmt.Errorf("unable to decode highScore#73a379eb: field pos: %w", err) } h.Pos = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode highScore#58fffcd0: field user_id: %w", err) + return fmt.Errorf("unable to decode highScore#73a379eb: field user_id: %w", err) } h.UserID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode highScore#58fffcd0: field score: %w", err) + return fmt.Errorf("unable to decode highScore#73a379eb: field score: %w", err) } h.Score = value } @@ -195,7 +195,7 @@ func (h *HighScore) GetPos() (value int) { } // GetUserID returns value of UserID field. -func (h *HighScore) GetUserID() (value int) { +func (h *HighScore) GetUserID() (value int64) { return h.UserID } diff --git a/tg/tl_imported_contact_gen.go b/tg/tl_imported_contact_gen.go index 684de091ca..776dd2ae53 100644 --- a/tg/tl_imported_contact_gen.go +++ b/tg/tl_imported_contact_gen.go @@ -29,13 +29,13 @@ var ( _ = tgerr.Error{} ) -// ImportedContact represents TL type `importedContact#d0028438`. +// ImportedContact represents TL type `importedContact#c13e3c50`. // Successfully imported contact. // // See https://core.telegram.org/constructor/importedContact for reference. type ImportedContact struct { // User identifier - UserID int + UserID int64 // The contact's client identifier (passed to one of the InputContact¹ constructors) // // Links: @@ -44,7 +44,7 @@ type ImportedContact struct { } // ImportedContactTypeID is TL type id of ImportedContact. -const ImportedContactTypeID = 0xd0028438 +const ImportedContactTypeID = 0xc13e3c50 // Ensuring interfaces in compile-time for ImportedContact. var ( @@ -79,7 +79,7 @@ func (i *ImportedContact) String() string { // FillFrom fills ImportedContact from given interface. func (i *ImportedContact) FillFrom(from interface { - GetUserID() (value int) + GetUserID() (value int64) GetClientID() (value int64) }) { i.UserID = from.GetUserID() @@ -124,7 +124,7 @@ func (i *ImportedContact) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (i *ImportedContact) Encode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode importedContact#d0028438 as nil") + return fmt.Errorf("can't encode importedContact#c13e3c50 as nil") } b.PutID(ImportedContactTypeID) return i.EncodeBare(b) @@ -133,9 +133,9 @@ func (i *ImportedContact) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (i *ImportedContact) EncodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode importedContact#d0028438 as nil") + return fmt.Errorf("can't encode importedContact#c13e3c50 as nil") } - b.PutInt(i.UserID) + b.PutLong(i.UserID) b.PutLong(i.ClientID) return nil } @@ -143,10 +143,10 @@ func (i *ImportedContact) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (i *ImportedContact) Decode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode importedContact#d0028438 to nil") + return fmt.Errorf("can't decode importedContact#c13e3c50 to nil") } if err := b.ConsumeID(ImportedContactTypeID); err != nil { - return fmt.Errorf("unable to decode importedContact#d0028438: %w", err) + return fmt.Errorf("unable to decode importedContact#c13e3c50: %w", err) } return i.DecodeBare(b) } @@ -154,19 +154,19 @@ func (i *ImportedContact) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (i *ImportedContact) DecodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode importedContact#d0028438 to nil") + return fmt.Errorf("can't decode importedContact#c13e3c50 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode importedContact#d0028438: field user_id: %w", err) + return fmt.Errorf("unable to decode importedContact#c13e3c50: field user_id: %w", err) } i.UserID = value } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode importedContact#d0028438: field client_id: %w", err) + return fmt.Errorf("unable to decode importedContact#c13e3c50: field client_id: %w", err) } i.ClientID = value } @@ -174,7 +174,7 @@ func (i *ImportedContact) DecodeBare(b *bin.Buffer) error { } // GetUserID returns value of UserID field. -func (i *ImportedContact) GetUserID() (value int) { +func (i *ImportedContact) GetUserID() (value int64) { return i.UserID } diff --git a/tg/tl_input_bot_inline_message_id_gen.go b/tg/tl_input_bot_inline_message_id_gen.go index c4e1a1596c..d7ddfaa1b6 100644 --- a/tg/tl_input_bot_inline_message_id_gen.go +++ b/tg/tl_input_bot_inline_message_id_gen.go @@ -45,12 +45,17 @@ type InputBotInlineMessageID struct { // InputBotInlineMessageIDTypeID is TL type id of InputBotInlineMessageID. const InputBotInlineMessageIDTypeID = 0x890c3d89 +// construct implements constructor of InputBotInlineMessageIDClass. +func (i InputBotInlineMessageID) construct() InputBotInlineMessageIDClass { return &i } + // Ensuring interfaces in compile-time for InputBotInlineMessageID. var ( _ bin.Encoder = &InputBotInlineMessageID{} _ bin.Decoder = &InputBotInlineMessageID{} _ bin.BareEncoder = &InputBotInlineMessageID{} _ bin.BareDecoder = &InputBotInlineMessageID{} + + _ InputBotInlineMessageIDClass = &InputBotInlineMessageID{} ) func (i *InputBotInlineMessageID) Zero() bool { @@ -203,3 +208,297 @@ func (i *InputBotInlineMessageID) GetID() (value int64) { func (i *InputBotInlineMessageID) GetAccessHash() (value int64) { return i.AccessHash } + +// InputBotInlineMessageID64 represents TL type `inputBotInlineMessageID64#b6d915d7`. +// +// See https://core.telegram.org/constructor/inputBotInlineMessageID64 for reference. +type InputBotInlineMessageID64 struct { + // DCID field of InputBotInlineMessageID64. + DCID int + // OwnerID field of InputBotInlineMessageID64. + OwnerID int64 + // ID field of InputBotInlineMessageID64. + ID int + // AccessHash field of InputBotInlineMessageID64. + AccessHash int64 +} + +// InputBotInlineMessageID64TypeID is TL type id of InputBotInlineMessageID64. +const InputBotInlineMessageID64TypeID = 0xb6d915d7 + +// construct implements constructor of InputBotInlineMessageIDClass. +func (i InputBotInlineMessageID64) construct() InputBotInlineMessageIDClass { return &i } + +// Ensuring interfaces in compile-time for InputBotInlineMessageID64. +var ( + _ bin.Encoder = &InputBotInlineMessageID64{} + _ bin.Decoder = &InputBotInlineMessageID64{} + _ bin.BareEncoder = &InputBotInlineMessageID64{} + _ bin.BareDecoder = &InputBotInlineMessageID64{} + + _ InputBotInlineMessageIDClass = &InputBotInlineMessageID64{} +) + +func (i *InputBotInlineMessageID64) Zero() bool { + if i == nil { + return true + } + if !(i.DCID == 0) { + return false + } + if !(i.OwnerID == 0) { + return false + } + if !(i.ID == 0) { + return false + } + if !(i.AccessHash == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (i *InputBotInlineMessageID64) String() string { + if i == nil { + return "InputBotInlineMessageID64(nil)" + } + type Alias InputBotInlineMessageID64 + return fmt.Sprintf("InputBotInlineMessageID64%+v", Alias(*i)) +} + +// FillFrom fills InputBotInlineMessageID64 from given interface. +func (i *InputBotInlineMessageID64) FillFrom(from interface { + GetDCID() (value int) + GetOwnerID() (value int64) + GetID() (value int) + GetAccessHash() (value int64) +}) { + i.DCID = from.GetDCID() + i.OwnerID = from.GetOwnerID() + i.ID = from.GetID() + i.AccessHash = from.GetAccessHash() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*InputBotInlineMessageID64) TypeID() uint32 { + return InputBotInlineMessageID64TypeID +} + +// TypeName returns name of type in TL schema. +func (*InputBotInlineMessageID64) TypeName() string { + return "inputBotInlineMessageID64" +} + +// TypeInfo returns info about TL type. +func (i *InputBotInlineMessageID64) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "inputBotInlineMessageID64", + ID: InputBotInlineMessageID64TypeID, + } + if i == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "DCID", + SchemaName: "dc_id", + }, + { + Name: "OwnerID", + SchemaName: "owner_id", + }, + { + Name: "ID", + SchemaName: "id", + }, + { + Name: "AccessHash", + SchemaName: "access_hash", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (i *InputBotInlineMessageID64) Encode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode inputBotInlineMessageID64#b6d915d7 as nil") + } + b.PutID(InputBotInlineMessageID64TypeID) + return i.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (i *InputBotInlineMessageID64) EncodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode inputBotInlineMessageID64#b6d915d7 as nil") + } + b.PutInt(i.DCID) + b.PutLong(i.OwnerID) + b.PutInt(i.ID) + b.PutLong(i.AccessHash) + return nil +} + +// Decode implements bin.Decoder. +func (i *InputBotInlineMessageID64) Decode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode inputBotInlineMessageID64#b6d915d7 to nil") + } + if err := b.ConsumeID(InputBotInlineMessageID64TypeID); err != nil { + return fmt.Errorf("unable to decode inputBotInlineMessageID64#b6d915d7: %w", err) + } + return i.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (i *InputBotInlineMessageID64) DecodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode inputBotInlineMessageID64#b6d915d7 to nil") + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode inputBotInlineMessageID64#b6d915d7: field dc_id: %w", err) + } + i.DCID = value + } + { + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode inputBotInlineMessageID64#b6d915d7: field owner_id: %w", err) + } + i.OwnerID = value + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode inputBotInlineMessageID64#b6d915d7: field id: %w", err) + } + i.ID = value + } + { + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode inputBotInlineMessageID64#b6d915d7: field access_hash: %w", err) + } + i.AccessHash = value + } + return nil +} + +// GetDCID returns value of DCID field. +func (i *InputBotInlineMessageID64) GetDCID() (value int) { + return i.DCID +} + +// GetOwnerID returns value of OwnerID field. +func (i *InputBotInlineMessageID64) GetOwnerID() (value int64) { + return i.OwnerID +} + +// GetID returns value of ID field. +func (i *InputBotInlineMessageID64) GetID() (value int) { + return i.ID +} + +// GetAccessHash returns value of AccessHash field. +func (i *InputBotInlineMessageID64) GetAccessHash() (value int64) { + return i.AccessHash +} + +// InputBotInlineMessageIDClass represents InputBotInlineMessageID generic type. +// +// See https://core.telegram.org/type/InputBotInlineMessageID for reference. +// +// Example: +// g, err := tg.DecodeInputBotInlineMessageID(buf) +// if err != nil { +// panic(err) +// } +// switch v := g.(type) { +// case *tg.InputBotInlineMessageID: // inputBotInlineMessageID#890c3d89 +// case *tg.InputBotInlineMessageID64: // inputBotInlineMessageID64#b6d915d7 +// default: panic(v) +// } +type InputBotInlineMessageIDClass interface { + bin.Encoder + bin.Decoder + bin.BareEncoder + bin.BareDecoder + construct() InputBotInlineMessageIDClass + + // TypeID returns type id in TL schema. + // + // See https://core.telegram.org/mtproto/TL-tl#remarks. + TypeID() uint32 + // TypeName returns name of type in TL schema. + TypeName() string + // String implements fmt.Stringer. + String() string + // Zero returns true if current object has a zero value. + Zero() bool + + // DC ID to use when working with this inline message + GetDCID() (value int) + + // Access hash of message + GetAccessHash() (value int64) +} + +// DecodeInputBotInlineMessageID implements binary de-serialization for InputBotInlineMessageIDClass. +func DecodeInputBotInlineMessageID(buf *bin.Buffer) (InputBotInlineMessageIDClass, error) { + id, err := buf.PeekID() + if err != nil { + return nil, err + } + switch id { + case InputBotInlineMessageIDTypeID: + // Decoding inputBotInlineMessageID#890c3d89. + v := InputBotInlineMessageID{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode InputBotInlineMessageIDClass: %w", err) + } + return &v, nil + case InputBotInlineMessageID64TypeID: + // Decoding inputBotInlineMessageID64#b6d915d7. + v := InputBotInlineMessageID64{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode InputBotInlineMessageIDClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode InputBotInlineMessageIDClass: %w", bin.NewUnexpectedID(id)) + } +} + +// InputBotInlineMessageID boxes the InputBotInlineMessageIDClass providing a helper. +type InputBotInlineMessageIDBox struct { + InputBotInlineMessageID InputBotInlineMessageIDClass +} + +// Decode implements bin.Decoder for InputBotInlineMessageIDBox. +func (b *InputBotInlineMessageIDBox) Decode(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("unable to decode InputBotInlineMessageIDBox to nil") + } + v, err := DecodeInputBotInlineMessageID(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.InputBotInlineMessageID = v + return nil +} + +// Encode implements bin.Encode for InputBotInlineMessageIDBox. +func (b *InputBotInlineMessageIDBox) Encode(buf *bin.Buffer) error { + if b == nil || b.InputBotInlineMessageID == nil { + return fmt.Errorf("unable to encode InputBotInlineMessageIDClass as nil") + } + return b.InputBotInlineMessageID.Encode(buf) +} diff --git a/tg/tl_input_bot_inline_message_id_slices_gen.go b/tg/tl_input_bot_inline_message_id_slices_gen.go index 3f6f19f6f5..cb086a33c5 100644 --- a/tg/tl_input_bot_inline_message_id_slices_gen.go +++ b/tg/tl_input_bot_inline_message_id_slices_gen.go @@ -31,3 +31,331 @@ var ( _ = tdp.Format _ = tgerr.Error{} ) + +// InputBotInlineMessageIDClassArray is adapter for slice of InputBotInlineMessageIDClass. +type InputBotInlineMessageIDClassArray []InputBotInlineMessageIDClass + +// Sort sorts slice of InputBotInlineMessageIDClass. +func (s InputBotInlineMessageIDClassArray) Sort(less func(a, b InputBotInlineMessageIDClass) bool) InputBotInlineMessageIDClassArray { + sort.Slice(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// SortStable sorts slice of InputBotInlineMessageIDClass. +func (s InputBotInlineMessageIDClassArray) SortStable(less func(a, b InputBotInlineMessageIDClass) bool) InputBotInlineMessageIDClassArray { + sort.SliceStable(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// Retain filters in-place slice of InputBotInlineMessageIDClass. +func (s InputBotInlineMessageIDClassArray) Retain(keep func(x InputBotInlineMessageIDClass) bool) InputBotInlineMessageIDClassArray { + n := 0 + for _, x := range s { + if keep(x) { + s[n] = x + n++ + } + } + s = s[:n] + + return s +} + +// First returns first element of slice (if exists). +func (s InputBotInlineMessageIDClassArray) First() (v InputBotInlineMessageIDClass, ok bool) { + if len(s) < 1 { + return + } + return s[0], true +} + +// Last returns last element of slice (if exists). +func (s InputBotInlineMessageIDClassArray) Last() (v InputBotInlineMessageIDClass, ok bool) { + if len(s) < 1 { + return + } + return s[len(s)-1], true +} + +// PopFirst returns first element of slice (if exists) and deletes it. +func (s *InputBotInlineMessageIDClassArray) PopFirst() (v InputBotInlineMessageIDClass, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[0] + + // Delete by index from SliceTricks. + copy(a[0:], a[1:]) + var zero InputBotInlineMessageIDClass + a[len(a)-1] = zero + a = a[:len(a)-1] + *s = a + + return v, true +} + +// Pop returns last element of slice (if exists) and deletes it. +func (s *InputBotInlineMessageIDClassArray) Pop() (v InputBotInlineMessageIDClass, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[len(a)-1] + a = a[:len(a)-1] + *s = a + + return v, true +} + +// AsInputBotInlineMessageID returns copy with only InputBotInlineMessageID constructors. +func (s InputBotInlineMessageIDClassArray) AsInputBotInlineMessageID() (to InputBotInlineMessageIDArray) { + for _, elem := range s { + value, ok := elem.(*InputBotInlineMessageID) + if !ok { + continue + } + to = append(to, *value) + } + + return to +} + +// AsInputBotInlineMessageID64 returns copy with only InputBotInlineMessageID64 constructors. +func (s InputBotInlineMessageIDClassArray) AsInputBotInlineMessageID64() (to InputBotInlineMessageID64Array) { + for _, elem := range s { + value, ok := elem.(*InputBotInlineMessageID64) + if !ok { + continue + } + to = append(to, *value) + } + + return to +} + +// InputBotInlineMessageIDArray is adapter for slice of InputBotInlineMessageID. +type InputBotInlineMessageIDArray []InputBotInlineMessageID + +// Sort sorts slice of InputBotInlineMessageID. +func (s InputBotInlineMessageIDArray) Sort(less func(a, b InputBotInlineMessageID) bool) InputBotInlineMessageIDArray { + sort.Slice(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// SortStable sorts slice of InputBotInlineMessageID. +func (s InputBotInlineMessageIDArray) SortStable(less func(a, b InputBotInlineMessageID) bool) InputBotInlineMessageIDArray { + sort.SliceStable(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// Retain filters in-place slice of InputBotInlineMessageID. +func (s InputBotInlineMessageIDArray) Retain(keep func(x InputBotInlineMessageID) bool) InputBotInlineMessageIDArray { + n := 0 + for _, x := range s { + if keep(x) { + s[n] = x + n++ + } + } + s = s[:n] + + return s +} + +// First returns first element of slice (if exists). +func (s InputBotInlineMessageIDArray) First() (v InputBotInlineMessageID, ok bool) { + if len(s) < 1 { + return + } + return s[0], true +} + +// Last returns last element of slice (if exists). +func (s InputBotInlineMessageIDArray) Last() (v InputBotInlineMessageID, ok bool) { + if len(s) < 1 { + return + } + return s[len(s)-1], true +} + +// PopFirst returns first element of slice (if exists) and deletes it. +func (s *InputBotInlineMessageIDArray) PopFirst() (v InputBotInlineMessageID, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[0] + + // Delete by index from SliceTricks. + copy(a[0:], a[1:]) + var zero InputBotInlineMessageID + a[len(a)-1] = zero + a = a[:len(a)-1] + *s = a + + return v, true +} + +// Pop returns last element of slice (if exists) and deletes it. +func (s *InputBotInlineMessageIDArray) Pop() (v InputBotInlineMessageID, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[len(a)-1] + a = a[:len(a)-1] + *s = a + + return v, true +} + +// SortByID sorts slice of InputBotInlineMessageID by ID. +func (s InputBotInlineMessageIDArray) SortByID() InputBotInlineMessageIDArray { + return s.Sort(func(a, b InputBotInlineMessageID) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of InputBotInlineMessageID by ID. +func (s InputBotInlineMessageIDArray) SortStableByID() InputBotInlineMessageIDArray { + return s.SortStable(func(a, b InputBotInlineMessageID) bool { + return a.GetID() < b.GetID() + }) +} + +// FillMap fills constructors to given map. +func (s InputBotInlineMessageIDArray) FillMap(to map[int64]InputBotInlineMessageID) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s InputBotInlineMessageIDArray) ToMap() map[int64]InputBotInlineMessageID { + r := make(map[int64]InputBotInlineMessageID, len(s)) + s.FillMap(r) + return r +} + +// InputBotInlineMessageID64Array is adapter for slice of InputBotInlineMessageID64. +type InputBotInlineMessageID64Array []InputBotInlineMessageID64 + +// Sort sorts slice of InputBotInlineMessageID64. +func (s InputBotInlineMessageID64Array) Sort(less func(a, b InputBotInlineMessageID64) bool) InputBotInlineMessageID64Array { + sort.Slice(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// SortStable sorts slice of InputBotInlineMessageID64. +func (s InputBotInlineMessageID64Array) SortStable(less func(a, b InputBotInlineMessageID64) bool) InputBotInlineMessageID64Array { + sort.SliceStable(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// Retain filters in-place slice of InputBotInlineMessageID64. +func (s InputBotInlineMessageID64Array) Retain(keep func(x InputBotInlineMessageID64) bool) InputBotInlineMessageID64Array { + n := 0 + for _, x := range s { + if keep(x) { + s[n] = x + n++ + } + } + s = s[:n] + + return s +} + +// First returns first element of slice (if exists). +func (s InputBotInlineMessageID64Array) First() (v InputBotInlineMessageID64, ok bool) { + if len(s) < 1 { + return + } + return s[0], true +} + +// Last returns last element of slice (if exists). +func (s InputBotInlineMessageID64Array) Last() (v InputBotInlineMessageID64, ok bool) { + if len(s) < 1 { + return + } + return s[len(s)-1], true +} + +// PopFirst returns first element of slice (if exists) and deletes it. +func (s *InputBotInlineMessageID64Array) PopFirst() (v InputBotInlineMessageID64, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[0] + + // Delete by index from SliceTricks. + copy(a[0:], a[1:]) + var zero InputBotInlineMessageID64 + a[len(a)-1] = zero + a = a[:len(a)-1] + *s = a + + return v, true +} + +// Pop returns last element of slice (if exists) and deletes it. +func (s *InputBotInlineMessageID64Array) Pop() (v InputBotInlineMessageID64, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[len(a)-1] + a = a[:len(a)-1] + *s = a + + return v, true +} + +// SortByID sorts slice of InputBotInlineMessageID64 by ID. +func (s InputBotInlineMessageID64Array) SortByID() InputBotInlineMessageID64Array { + return s.Sort(func(a, b InputBotInlineMessageID64) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of InputBotInlineMessageID64 by ID. +func (s InputBotInlineMessageID64Array) SortStableByID() InputBotInlineMessageID64Array { + return s.SortStable(func(a, b InputBotInlineMessageID64) bool { + return a.GetID() < b.GetID() + }) +} + +// FillMap fills constructors to given map. +func (s InputBotInlineMessageID64Array) FillMap(to map[int]InputBotInlineMessageID64) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s InputBotInlineMessageID64Array) ToMap() map[int]InputBotInlineMessageID64 { + r := make(map[int]InputBotInlineMessageID64, len(s)) + s.FillMap(r) + return r +} diff --git a/tg/tl_input_channel_gen.go b/tg/tl_input_channel_gen.go index d88c3d0bb0..fdcd7efad8 100644 --- a/tg/tl_input_channel_gen.go +++ b/tg/tl_input_channel_gen.go @@ -131,13 +131,13 @@ func (i *InputChannelEmpty) DecodeBare(b *bin.Buffer) error { return nil } -// InputChannel represents TL type `inputChannel#afeb712e`. +// InputChannel represents TL type `inputChannel#f35aec28`. // Represents a channel // // See https://core.telegram.org/constructor/inputChannel for reference. type InputChannel struct { // Channel ID - ChannelID int + ChannelID int64 // Access hash taken from the channel¹ constructor // // Links: @@ -146,7 +146,7 @@ type InputChannel struct { } // InputChannelTypeID is TL type id of InputChannel. -const InputChannelTypeID = 0xafeb712e +const InputChannelTypeID = 0xf35aec28 // construct implements constructor of InputChannelClass. func (i InputChannel) construct() InputChannelClass { return &i } @@ -186,7 +186,7 @@ func (i *InputChannel) String() string { // FillFrom fills InputChannel from given interface. func (i *InputChannel) FillFrom(from interface { - GetChannelID() (value int) + GetChannelID() (value int64) GetAccessHash() (value int64) }) { i.ChannelID = from.GetChannelID() @@ -231,7 +231,7 @@ func (i *InputChannel) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (i *InputChannel) Encode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode inputChannel#afeb712e as nil") + return fmt.Errorf("can't encode inputChannel#f35aec28 as nil") } b.PutID(InputChannelTypeID) return i.EncodeBare(b) @@ -240,9 +240,9 @@ func (i *InputChannel) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (i *InputChannel) EncodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode inputChannel#afeb712e as nil") + return fmt.Errorf("can't encode inputChannel#f35aec28 as nil") } - b.PutInt(i.ChannelID) + b.PutLong(i.ChannelID) b.PutLong(i.AccessHash) return nil } @@ -250,10 +250,10 @@ func (i *InputChannel) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (i *InputChannel) Decode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode inputChannel#afeb712e to nil") + return fmt.Errorf("can't decode inputChannel#f35aec28 to nil") } if err := b.ConsumeID(InputChannelTypeID); err != nil { - return fmt.Errorf("unable to decode inputChannel#afeb712e: %w", err) + return fmt.Errorf("unable to decode inputChannel#f35aec28: %w", err) } return i.DecodeBare(b) } @@ -261,19 +261,19 @@ func (i *InputChannel) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (i *InputChannel) DecodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode inputChannel#afeb712e to nil") + return fmt.Errorf("can't decode inputChannel#f35aec28 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode inputChannel#afeb712e: field channel_id: %w", err) + return fmt.Errorf("unable to decode inputChannel#f35aec28: field channel_id: %w", err) } i.ChannelID = value } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode inputChannel#afeb712e: field access_hash: %w", err) + return fmt.Errorf("unable to decode inputChannel#f35aec28: field access_hash: %w", err) } i.AccessHash = value } @@ -281,7 +281,7 @@ func (i *InputChannel) DecodeBare(b *bin.Buffer) error { } // GetChannelID returns value of ChannelID field. -func (i *InputChannel) GetChannelID() (value int) { +func (i *InputChannel) GetChannelID() (value int64) { return i.ChannelID } @@ -290,7 +290,7 @@ func (i *InputChannel) GetAccessHash() (value int64) { return i.AccessHash } -// InputChannelFromMessage represents TL type `inputChannelFromMessage#2a286531`. +// InputChannelFromMessage represents TL type `inputChannelFromMessage#5b934f9d`. // Defines a min¹ channel that was seen in a certain message of a certain chat. // // Links: @@ -303,11 +303,11 @@ type InputChannelFromMessage struct { // The message ID in the chat where the channel was seen MsgID int // The channel ID - ChannelID int + ChannelID int64 } // InputChannelFromMessageTypeID is TL type id of InputChannelFromMessage. -const InputChannelFromMessageTypeID = 0x2a286531 +const InputChannelFromMessageTypeID = 0x5b934f9d // construct implements constructor of InputChannelClass. func (i InputChannelFromMessage) construct() InputChannelClass { return &i } @@ -352,7 +352,7 @@ func (i *InputChannelFromMessage) String() string { func (i *InputChannelFromMessage) FillFrom(from interface { GetPeer() (value InputPeerClass) GetMsgID() (value int) - GetChannelID() (value int) + GetChannelID() (value int64) }) { i.Peer = from.GetPeer() i.MsgID = from.GetMsgID() @@ -401,7 +401,7 @@ func (i *InputChannelFromMessage) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (i *InputChannelFromMessage) Encode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode inputChannelFromMessage#2a286531 as nil") + return fmt.Errorf("can't encode inputChannelFromMessage#5b934f9d as nil") } b.PutID(InputChannelFromMessageTypeID) return i.EncodeBare(b) @@ -410,26 +410,26 @@ func (i *InputChannelFromMessage) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (i *InputChannelFromMessage) EncodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode inputChannelFromMessage#2a286531 as nil") + return fmt.Errorf("can't encode inputChannelFromMessage#5b934f9d as nil") } if i.Peer == nil { - return fmt.Errorf("unable to encode inputChannelFromMessage#2a286531: field peer is nil") + return fmt.Errorf("unable to encode inputChannelFromMessage#5b934f9d: field peer is nil") } if err := i.Peer.Encode(b); err != nil { - return fmt.Errorf("unable to encode inputChannelFromMessage#2a286531: field peer: %w", err) + return fmt.Errorf("unable to encode inputChannelFromMessage#5b934f9d: field peer: %w", err) } b.PutInt(i.MsgID) - b.PutInt(i.ChannelID) + b.PutLong(i.ChannelID) return nil } // Decode implements bin.Decoder. func (i *InputChannelFromMessage) Decode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode inputChannelFromMessage#2a286531 to nil") + return fmt.Errorf("can't decode inputChannelFromMessage#5b934f9d to nil") } if err := b.ConsumeID(InputChannelFromMessageTypeID); err != nil { - return fmt.Errorf("unable to decode inputChannelFromMessage#2a286531: %w", err) + return fmt.Errorf("unable to decode inputChannelFromMessage#5b934f9d: %w", err) } return i.DecodeBare(b) } @@ -437,26 +437,26 @@ func (i *InputChannelFromMessage) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (i *InputChannelFromMessage) DecodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode inputChannelFromMessage#2a286531 to nil") + return fmt.Errorf("can't decode inputChannelFromMessage#5b934f9d to nil") } { value, err := DecodeInputPeer(b) if err != nil { - return fmt.Errorf("unable to decode inputChannelFromMessage#2a286531: field peer: %w", err) + return fmt.Errorf("unable to decode inputChannelFromMessage#5b934f9d: field peer: %w", err) } i.Peer = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode inputChannelFromMessage#2a286531: field msg_id: %w", err) + return fmt.Errorf("unable to decode inputChannelFromMessage#5b934f9d: field msg_id: %w", err) } i.MsgID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode inputChannelFromMessage#2a286531: field channel_id: %w", err) + return fmt.Errorf("unable to decode inputChannelFromMessage#5b934f9d: field channel_id: %w", err) } i.ChannelID = value } @@ -474,7 +474,7 @@ func (i *InputChannelFromMessage) GetMsgID() (value int) { } // GetChannelID returns value of ChannelID field. -func (i *InputChannelFromMessage) GetChannelID() (value int) { +func (i *InputChannelFromMessage) GetChannelID() (value int64) { return i.ChannelID } @@ -489,8 +489,8 @@ func (i *InputChannelFromMessage) GetChannelID() (value int) { // } // switch v := g.(type) { // case *tg.InputChannelEmpty: // inputChannelEmpty#ee8c1e86 -// case *tg.InputChannel: // inputChannel#afeb712e -// case *tg.InputChannelFromMessage: // inputChannelFromMessage#2a286531 +// case *tg.InputChannel: // inputChannel#f35aec28 +// case *tg.InputChannelFromMessage: // inputChannelFromMessage#5b934f9d // default: panic(v) // } type InputChannelClass interface { @@ -535,7 +535,7 @@ type NotEmptyInputChannel interface { Zero() bool // Channel ID - GetChannelID() (value int) + GetChannelID() (value int64) } // AsNotEmpty tries to map InputChannelEmpty to NotEmptyInputChannel. @@ -571,14 +571,14 @@ func DecodeInputChannel(buf *bin.Buffer) (InputChannelClass, error) { } return &v, nil case InputChannelTypeID: - // Decoding inputChannel#afeb712e. + // Decoding inputChannel#f35aec28. v := InputChannel{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode InputChannelClass: %w", err) } return &v, nil case InputChannelFromMessageTypeID: - // Decoding inputChannelFromMessage#2a286531. + // Decoding inputChannelFromMessage#5b934f9d. v := InputChannelFromMessage{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode InputChannelClass: %w", err) diff --git a/tg/tl_input_document_slices_gen.go b/tg/tl_input_document_slices_gen.go index 015efebf80..14f84f244a 100644 --- a/tg/tl_input_document_slices_gen.go +++ b/tg/tl_input_document_slices_gen.go @@ -127,6 +127,24 @@ func (s InputDocumentClassArray) AsInputDocument() (to InputDocumentArray) { return to } +// FillNotEmptyMap fills only NotEmpty constructors to given map. +func (s InputDocumentClassArray) FillNotEmptyMap(to map[int64]*InputDocument) { + for _, elem := range s { + value, ok := elem.AsNotEmpty() + if !ok { + continue + } + to[value.GetID()] = value + } +} + +// NotEmptyToMap collects only NotEmpty constructors to map. +func (s InputDocumentClassArray) NotEmptyToMap() map[int64]*InputDocument { + r := make(map[int64]*InputDocument, len(s)) + s.FillNotEmptyMap(r) + return r +} + // AppendOnlyNotEmpty appends only NotEmpty constructors to // given slice. func (s InputDocumentClassArray) AppendOnlyNotEmpty(to []*InputDocument) []*InputDocument { @@ -263,3 +281,31 @@ func (s *InputDocumentArray) Pop() (v InputDocument, ok bool) { return v, true } + +// SortByID sorts slice of InputDocument by ID. +func (s InputDocumentArray) SortByID() InputDocumentArray { + return s.Sort(func(a, b InputDocument) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of InputDocument by ID. +func (s InputDocumentArray) SortStableByID() InputDocumentArray { + return s.SortStable(func(a, b InputDocument) bool { + return a.GetID() < b.GetID() + }) +} + +// FillMap fills constructors to given map. +func (s InputDocumentArray) FillMap(to map[int64]InputDocument) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s InputDocumentArray) ToMap() map[int64]InputDocument { + r := make(map[int64]InputDocument, len(s)) + s.FillMap(r) + return r +} diff --git a/tg/tl_input_encrypted_file_slices_gen.go b/tg/tl_input_encrypted_file_slices_gen.go index 37039db4bb..eb5102e906 100644 --- a/tg/tl_input_encrypted_file_slices_gen.go +++ b/tg/tl_input_encrypted_file_slices_gen.go @@ -153,6 +153,24 @@ func (s InputEncryptedFileClassArray) AsInputEncryptedFileBigUploaded() (to Inpu return to } +// FillNotEmptyMap fills only NotEmpty constructors to given map. +func (s InputEncryptedFileClassArray) FillNotEmptyMap(to map[int64]NotEmptyInputEncryptedFile) { + for _, elem := range s { + value, ok := elem.AsNotEmpty() + if !ok { + continue + } + to[value.GetID()] = value + } +} + +// NotEmptyToMap collects only NotEmpty constructors to map. +func (s InputEncryptedFileClassArray) NotEmptyToMap() map[int64]NotEmptyInputEncryptedFile { + r := make(map[int64]NotEmptyInputEncryptedFile, len(s)) + s.FillNotEmptyMap(r) + return r +} + // AppendOnlyNotEmpty appends only NotEmpty constructors to // given slice. func (s InputEncryptedFileClassArray) AppendOnlyNotEmpty(to []NotEmptyInputEncryptedFile) []NotEmptyInputEncryptedFile { @@ -290,6 +308,34 @@ func (s *InputEncryptedFileUploadedArray) Pop() (v InputEncryptedFileUploaded, o return v, true } +// SortByID sorts slice of InputEncryptedFileUploaded by ID. +func (s InputEncryptedFileUploadedArray) SortByID() InputEncryptedFileUploadedArray { + return s.Sort(func(a, b InputEncryptedFileUploaded) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of InputEncryptedFileUploaded by ID. +func (s InputEncryptedFileUploadedArray) SortStableByID() InputEncryptedFileUploadedArray { + return s.SortStable(func(a, b InputEncryptedFileUploaded) bool { + return a.GetID() < b.GetID() + }) +} + +// FillMap fills constructors to given map. +func (s InputEncryptedFileUploadedArray) FillMap(to map[int64]InputEncryptedFileUploaded) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s InputEncryptedFileUploadedArray) ToMap() map[int64]InputEncryptedFileUploaded { + r := make(map[int64]InputEncryptedFileUploaded, len(s)) + s.FillMap(r) + return r +} + // InputEncryptedFileArray is adapter for slice of InputEncryptedFile. type InputEncryptedFileArray []InputEncryptedFile @@ -372,6 +418,34 @@ func (s *InputEncryptedFileArray) Pop() (v InputEncryptedFile, ok bool) { return v, true } +// SortByID sorts slice of InputEncryptedFile by ID. +func (s InputEncryptedFileArray) SortByID() InputEncryptedFileArray { + return s.Sort(func(a, b InputEncryptedFile) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of InputEncryptedFile by ID. +func (s InputEncryptedFileArray) SortStableByID() InputEncryptedFileArray { + return s.SortStable(func(a, b InputEncryptedFile) bool { + return a.GetID() < b.GetID() + }) +} + +// FillMap fills constructors to given map. +func (s InputEncryptedFileArray) FillMap(to map[int64]InputEncryptedFile) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s InputEncryptedFileArray) ToMap() map[int64]InputEncryptedFile { + r := make(map[int64]InputEncryptedFile, len(s)) + s.FillMap(r) + return r +} + // InputEncryptedFileBigUploadedArray is adapter for slice of InputEncryptedFileBigUploaded. type InputEncryptedFileBigUploadedArray []InputEncryptedFileBigUploaded @@ -453,3 +527,31 @@ func (s *InputEncryptedFileBigUploadedArray) Pop() (v InputEncryptedFileBigUploa return v, true } + +// SortByID sorts slice of InputEncryptedFileBigUploaded by ID. +func (s InputEncryptedFileBigUploadedArray) SortByID() InputEncryptedFileBigUploadedArray { + return s.Sort(func(a, b InputEncryptedFileBigUploaded) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of InputEncryptedFileBigUploaded by ID. +func (s InputEncryptedFileBigUploadedArray) SortStableByID() InputEncryptedFileBigUploadedArray { + return s.SortStable(func(a, b InputEncryptedFileBigUploaded) bool { + return a.GetID() < b.GetID() + }) +} + +// FillMap fills constructors to given map. +func (s InputEncryptedFileBigUploadedArray) FillMap(to map[int64]InputEncryptedFileBigUploaded) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s InputEncryptedFileBigUploadedArray) ToMap() map[int64]InputEncryptedFileBigUploaded { + r := make(map[int64]InputEncryptedFileBigUploaded, len(s)) + s.FillMap(r) + return r +} diff --git a/tg/tl_input_file_location_slices_gen.go b/tg/tl_input_file_location_slices_gen.go index 88693e3996..54e670eacc 100644 --- a/tg/tl_input_file_location_slices_gen.go +++ b/tg/tl_input_file_location_slices_gen.go @@ -585,6 +585,34 @@ func (s *InputEncryptedFileLocationArray) Pop() (v InputEncryptedFileLocation, o return v, true } +// SortByID sorts slice of InputEncryptedFileLocation by ID. +func (s InputEncryptedFileLocationArray) SortByID() InputEncryptedFileLocationArray { + return s.Sort(func(a, b InputEncryptedFileLocation) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of InputEncryptedFileLocation by ID. +func (s InputEncryptedFileLocationArray) SortStableByID() InputEncryptedFileLocationArray { + return s.SortStable(func(a, b InputEncryptedFileLocation) bool { + return a.GetID() < b.GetID() + }) +} + +// FillMap fills constructors to given map. +func (s InputEncryptedFileLocationArray) FillMap(to map[int64]InputEncryptedFileLocation) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s InputEncryptedFileLocationArray) ToMap() map[int64]InputEncryptedFileLocation { + r := make(map[int64]InputEncryptedFileLocation, len(s)) + s.FillMap(r) + return r +} + // InputDocumentFileLocationArray is adapter for slice of InputDocumentFileLocation. type InputDocumentFileLocationArray []InputDocumentFileLocation @@ -667,6 +695,34 @@ func (s *InputDocumentFileLocationArray) Pop() (v InputDocumentFileLocation, ok return v, true } +// SortByID sorts slice of InputDocumentFileLocation by ID. +func (s InputDocumentFileLocationArray) SortByID() InputDocumentFileLocationArray { + return s.Sort(func(a, b InputDocumentFileLocation) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of InputDocumentFileLocation by ID. +func (s InputDocumentFileLocationArray) SortStableByID() InputDocumentFileLocationArray { + return s.SortStable(func(a, b InputDocumentFileLocation) bool { + return a.GetID() < b.GetID() + }) +} + +// FillMap fills constructors to given map. +func (s InputDocumentFileLocationArray) FillMap(to map[int64]InputDocumentFileLocation) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s InputDocumentFileLocationArray) ToMap() map[int64]InputDocumentFileLocation { + r := make(map[int64]InputDocumentFileLocation, len(s)) + s.FillMap(r) + return r +} + // InputSecureFileLocationArray is adapter for slice of InputSecureFileLocation. type InputSecureFileLocationArray []InputSecureFileLocation @@ -749,6 +805,34 @@ func (s *InputSecureFileLocationArray) Pop() (v InputSecureFileLocation, ok bool return v, true } +// SortByID sorts slice of InputSecureFileLocation by ID. +func (s InputSecureFileLocationArray) SortByID() InputSecureFileLocationArray { + return s.Sort(func(a, b InputSecureFileLocation) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of InputSecureFileLocation by ID. +func (s InputSecureFileLocationArray) SortStableByID() InputSecureFileLocationArray { + return s.SortStable(func(a, b InputSecureFileLocation) bool { + return a.GetID() < b.GetID() + }) +} + +// FillMap fills constructors to given map. +func (s InputSecureFileLocationArray) FillMap(to map[int64]InputSecureFileLocation) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s InputSecureFileLocationArray) ToMap() map[int64]InputSecureFileLocation { + r := make(map[int64]InputSecureFileLocation, len(s)) + s.FillMap(r) + return r +} + // InputPhotoFileLocationArray is adapter for slice of InputPhotoFileLocation. type InputPhotoFileLocationArray []InputPhotoFileLocation @@ -831,6 +915,34 @@ func (s *InputPhotoFileLocationArray) Pop() (v InputPhotoFileLocation, ok bool) return v, true } +// SortByID sorts slice of InputPhotoFileLocation by ID. +func (s InputPhotoFileLocationArray) SortByID() InputPhotoFileLocationArray { + return s.Sort(func(a, b InputPhotoFileLocation) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of InputPhotoFileLocation by ID. +func (s InputPhotoFileLocationArray) SortStableByID() InputPhotoFileLocationArray { + return s.SortStable(func(a, b InputPhotoFileLocation) bool { + return a.GetID() < b.GetID() + }) +} + +// FillMap fills constructors to given map. +func (s InputPhotoFileLocationArray) FillMap(to map[int64]InputPhotoFileLocation) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s InputPhotoFileLocationArray) ToMap() map[int64]InputPhotoFileLocation { + r := make(map[int64]InputPhotoFileLocation, len(s)) + s.FillMap(r) + return r +} + // InputPhotoLegacyFileLocationArray is adapter for slice of InputPhotoLegacyFileLocation. type InputPhotoLegacyFileLocationArray []InputPhotoLegacyFileLocation @@ -913,6 +1025,34 @@ func (s *InputPhotoLegacyFileLocationArray) Pop() (v InputPhotoLegacyFileLocatio return v, true } +// SortByID sorts slice of InputPhotoLegacyFileLocation by ID. +func (s InputPhotoLegacyFileLocationArray) SortByID() InputPhotoLegacyFileLocationArray { + return s.Sort(func(a, b InputPhotoLegacyFileLocation) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of InputPhotoLegacyFileLocation by ID. +func (s InputPhotoLegacyFileLocationArray) SortStableByID() InputPhotoLegacyFileLocationArray { + return s.SortStable(func(a, b InputPhotoLegacyFileLocation) bool { + return a.GetID() < b.GetID() + }) +} + +// FillMap fills constructors to given map. +func (s InputPhotoLegacyFileLocationArray) FillMap(to map[int64]InputPhotoLegacyFileLocation) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s InputPhotoLegacyFileLocationArray) ToMap() map[int64]InputPhotoLegacyFileLocation { + r := make(map[int64]InputPhotoLegacyFileLocation, len(s)) + s.FillMap(r) + return r +} + // InputPeerPhotoFileLocationArray is adapter for slice of InputPeerPhotoFileLocation. type InputPeerPhotoFileLocationArray []InputPeerPhotoFileLocation diff --git a/tg/tl_input_file_slices_gen.go b/tg/tl_input_file_slices_gen.go index 6376700926..6172fa2720 100644 --- a/tg/tl_input_file_slices_gen.go +++ b/tg/tl_input_file_slices_gen.go @@ -114,6 +114,38 @@ func (s *InputFileClassArray) Pop() (v InputFileClass, ok bool) { return v, true } +// SortByID sorts slice of InputFileClass by ID. +func (s InputFileClassArray) SortByID() InputFileClassArray { + return s.Sort(func(a, b InputFileClass) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of InputFileClass by ID. +func (s InputFileClassArray) SortStableByID() InputFileClassArray { + return s.SortStable(func(a, b InputFileClass) bool { + return a.GetID() < b.GetID() + }) +} + +// FillInputFileMap fills only InputFile constructors to given map. +func (s InputFileClassArray) FillInputFileMap(to map[int64]*InputFile) { + for _, elem := range s { + value, ok := elem.(*InputFile) + if !ok { + continue + } + to[value.GetID()] = value + } +} + +// InputFileToMap collects only InputFile constructors to map. +func (s InputFileClassArray) InputFileToMap() map[int64]*InputFile { + r := make(map[int64]*InputFile, len(s)) + s.FillInputFileMap(r) + return r +} + // AsInputFile returns copy with only InputFile constructors. func (s InputFileClassArray) AsInputFile() (to InputFileArray) { for _, elem := range s { @@ -127,6 +159,24 @@ func (s InputFileClassArray) AsInputFile() (to InputFileArray) { return to } +// FillInputFileBigMap fills only InputFileBig constructors to given map. +func (s InputFileClassArray) FillInputFileBigMap(to map[int64]*InputFileBig) { + for _, elem := range s { + value, ok := elem.(*InputFileBig) + if !ok { + continue + } + to[value.GetID()] = value + } +} + +// InputFileBigToMap collects only InputFileBig constructors to map. +func (s InputFileClassArray) InputFileBigToMap() map[int64]*InputFileBig { + r := make(map[int64]*InputFileBig, len(s)) + s.FillInputFileBigMap(r) + return r +} + // AsInputFileBig returns copy with only InputFileBig constructors. func (s InputFileClassArray) AsInputFileBig() (to InputFileBigArray) { for _, elem := range s { @@ -222,6 +272,34 @@ func (s *InputFileArray) Pop() (v InputFile, ok bool) { return v, true } +// SortByID sorts slice of InputFile by ID. +func (s InputFileArray) SortByID() InputFileArray { + return s.Sort(func(a, b InputFile) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of InputFile by ID. +func (s InputFileArray) SortStableByID() InputFileArray { + return s.SortStable(func(a, b InputFile) bool { + return a.GetID() < b.GetID() + }) +} + +// FillMap fills constructors to given map. +func (s InputFileArray) FillMap(to map[int64]InputFile) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s InputFileArray) ToMap() map[int64]InputFile { + r := make(map[int64]InputFile, len(s)) + s.FillMap(r) + return r +} + // InputFileBigArray is adapter for slice of InputFileBig. type InputFileBigArray []InputFileBig @@ -303,3 +381,31 @@ func (s *InputFileBigArray) Pop() (v InputFileBig, ok bool) { return v, true } + +// SortByID sorts slice of InputFileBig by ID. +func (s InputFileBigArray) SortByID() InputFileBigArray { + return s.Sort(func(a, b InputFileBig) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of InputFileBig by ID. +func (s InputFileBigArray) SortStableByID() InputFileBigArray { + return s.SortStable(func(a, b InputFileBig) bool { + return a.GetID() < b.GetID() + }) +} + +// FillMap fills constructors to given map. +func (s InputFileBigArray) FillMap(to map[int64]InputFileBig) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s InputFileBigArray) ToMap() map[int64]InputFileBig { + r := make(map[int64]InputFileBig, len(s)) + s.FillMap(r) + return r +} diff --git a/tg/tl_input_game_slices_gen.go b/tg/tl_input_game_slices_gen.go index fe0bc654d7..39fa7ed04b 100644 --- a/tg/tl_input_game_slices_gen.go +++ b/tg/tl_input_game_slices_gen.go @@ -222,6 +222,34 @@ func (s *InputGameIDArray) Pop() (v InputGameID, ok bool) { return v, true } +// SortByID sorts slice of InputGameID by ID. +func (s InputGameIDArray) SortByID() InputGameIDArray { + return s.Sort(func(a, b InputGameID) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of InputGameID by ID. +func (s InputGameIDArray) SortStableByID() InputGameIDArray { + return s.SortStable(func(a, b InputGameID) bool { + return a.GetID() < b.GetID() + }) +} + +// FillMap fills constructors to given map. +func (s InputGameIDArray) FillMap(to map[int64]InputGameID) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s InputGameIDArray) ToMap() map[int64]InputGameID { + r := make(map[int64]InputGameID, len(s)) + s.FillMap(r) + return r +} + // InputGameShortNameArray is adapter for slice of InputGameShortName. type InputGameShortNameArray []InputGameShortName diff --git a/tg/tl_input_peer_gen.go b/tg/tl_input_peer_gen.go index b5cb22fad6..b81d6b2a9a 100644 --- a/tg/tl_input_peer_gen.go +++ b/tg/tl_input_peer_gen.go @@ -233,17 +233,17 @@ func (i *InputPeerSelf) DecodeBare(b *bin.Buffer) error { return nil } -// InputPeerChat represents TL type `inputPeerChat#179be863`. +// InputPeerChat represents TL type `inputPeerChat#35a95cb9`. // Defines a chat for further interaction. // // See https://core.telegram.org/constructor/inputPeerChat for reference. type InputPeerChat struct { // Chat idientifier - ChatID int + ChatID int64 } // InputPeerChatTypeID is TL type id of InputPeerChat. -const InputPeerChatTypeID = 0x179be863 +const InputPeerChatTypeID = 0x35a95cb9 // construct implements constructor of InputPeerClass. func (i InputPeerChat) construct() InputPeerClass { return &i } @@ -280,7 +280,7 @@ func (i *InputPeerChat) String() string { // FillFrom fills InputPeerChat from given interface. func (i *InputPeerChat) FillFrom(from interface { - GetChatID() (value int) + GetChatID() (value int64) }) { i.ChatID = from.GetChatID() } @@ -319,7 +319,7 @@ func (i *InputPeerChat) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (i *InputPeerChat) Encode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode inputPeerChat#179be863 as nil") + return fmt.Errorf("can't encode inputPeerChat#35a95cb9 as nil") } b.PutID(InputPeerChatTypeID) return i.EncodeBare(b) @@ -328,19 +328,19 @@ func (i *InputPeerChat) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (i *InputPeerChat) EncodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode inputPeerChat#179be863 as nil") + return fmt.Errorf("can't encode inputPeerChat#35a95cb9 as nil") } - b.PutInt(i.ChatID) + b.PutLong(i.ChatID) return nil } // Decode implements bin.Decoder. func (i *InputPeerChat) Decode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode inputPeerChat#179be863 to nil") + return fmt.Errorf("can't decode inputPeerChat#35a95cb9 to nil") } if err := b.ConsumeID(InputPeerChatTypeID); err != nil { - return fmt.Errorf("unable to decode inputPeerChat#179be863: %w", err) + return fmt.Errorf("unable to decode inputPeerChat#35a95cb9: %w", err) } return i.DecodeBare(b) } @@ -348,12 +348,12 @@ func (i *InputPeerChat) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (i *InputPeerChat) DecodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode inputPeerChat#179be863 to nil") + return fmt.Errorf("can't decode inputPeerChat#35a95cb9 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode inputPeerChat#179be863: field chat_id: %w", err) + return fmt.Errorf("unable to decode inputPeerChat#35a95cb9: field chat_id: %w", err) } i.ChatID = value } @@ -361,17 +361,17 @@ func (i *InputPeerChat) DecodeBare(b *bin.Buffer) error { } // GetChatID returns value of ChatID field. -func (i *InputPeerChat) GetChatID() (value int) { +func (i *InputPeerChat) GetChatID() (value int64) { return i.ChatID } -// InputPeerUser represents TL type `inputPeerUser#7b8e7de6`. +// InputPeerUser represents TL type `inputPeerUser#dde8a54c`. // Defines a user for further interaction. // // See https://core.telegram.org/constructor/inputPeerUser for reference. type InputPeerUser struct { // User identifier - UserID int + UserID int64 // access_hash value from the user¹ constructor // // Links: @@ -380,7 +380,7 @@ type InputPeerUser struct { } // InputPeerUserTypeID is TL type id of InputPeerUser. -const InputPeerUserTypeID = 0x7b8e7de6 +const InputPeerUserTypeID = 0xdde8a54c // construct implements constructor of InputPeerClass. func (i InputPeerUser) construct() InputPeerClass { return &i } @@ -420,7 +420,7 @@ func (i *InputPeerUser) String() string { // FillFrom fills InputPeerUser from given interface. func (i *InputPeerUser) FillFrom(from interface { - GetUserID() (value int) + GetUserID() (value int64) GetAccessHash() (value int64) }) { i.UserID = from.GetUserID() @@ -465,7 +465,7 @@ func (i *InputPeerUser) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (i *InputPeerUser) Encode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode inputPeerUser#7b8e7de6 as nil") + return fmt.Errorf("can't encode inputPeerUser#dde8a54c as nil") } b.PutID(InputPeerUserTypeID) return i.EncodeBare(b) @@ -474,9 +474,9 @@ func (i *InputPeerUser) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (i *InputPeerUser) EncodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode inputPeerUser#7b8e7de6 as nil") + return fmt.Errorf("can't encode inputPeerUser#dde8a54c as nil") } - b.PutInt(i.UserID) + b.PutLong(i.UserID) b.PutLong(i.AccessHash) return nil } @@ -484,10 +484,10 @@ func (i *InputPeerUser) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (i *InputPeerUser) Decode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode inputPeerUser#7b8e7de6 to nil") + return fmt.Errorf("can't decode inputPeerUser#dde8a54c to nil") } if err := b.ConsumeID(InputPeerUserTypeID); err != nil { - return fmt.Errorf("unable to decode inputPeerUser#7b8e7de6: %w", err) + return fmt.Errorf("unable to decode inputPeerUser#dde8a54c: %w", err) } return i.DecodeBare(b) } @@ -495,19 +495,19 @@ func (i *InputPeerUser) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (i *InputPeerUser) DecodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode inputPeerUser#7b8e7de6 to nil") + return fmt.Errorf("can't decode inputPeerUser#dde8a54c to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode inputPeerUser#7b8e7de6: field user_id: %w", err) + return fmt.Errorf("unable to decode inputPeerUser#dde8a54c: field user_id: %w", err) } i.UserID = value } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode inputPeerUser#7b8e7de6: field access_hash: %w", err) + return fmt.Errorf("unable to decode inputPeerUser#dde8a54c: field access_hash: %w", err) } i.AccessHash = value } @@ -515,7 +515,7 @@ func (i *InputPeerUser) DecodeBare(b *bin.Buffer) error { } // GetUserID returns value of UserID field. -func (i *InputPeerUser) GetUserID() (value int) { +func (i *InputPeerUser) GetUserID() (value int64) { return i.UserID } @@ -524,13 +524,13 @@ func (i *InputPeerUser) GetAccessHash() (value int64) { return i.AccessHash } -// InputPeerChannel represents TL type `inputPeerChannel#20adaef8`. +// InputPeerChannel represents TL type `inputPeerChannel#27bcbbfc`. // Defines a channel for further interaction. // // See https://core.telegram.org/constructor/inputPeerChannel for reference. type InputPeerChannel struct { // Channel identifier - ChannelID int + ChannelID int64 // access_hash value from the channel¹ constructor // // Links: @@ -539,7 +539,7 @@ type InputPeerChannel struct { } // InputPeerChannelTypeID is TL type id of InputPeerChannel. -const InputPeerChannelTypeID = 0x20adaef8 +const InputPeerChannelTypeID = 0x27bcbbfc // construct implements constructor of InputPeerClass. func (i InputPeerChannel) construct() InputPeerClass { return &i } @@ -579,7 +579,7 @@ func (i *InputPeerChannel) String() string { // FillFrom fills InputPeerChannel from given interface. func (i *InputPeerChannel) FillFrom(from interface { - GetChannelID() (value int) + GetChannelID() (value int64) GetAccessHash() (value int64) }) { i.ChannelID = from.GetChannelID() @@ -624,7 +624,7 @@ func (i *InputPeerChannel) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (i *InputPeerChannel) Encode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode inputPeerChannel#20adaef8 as nil") + return fmt.Errorf("can't encode inputPeerChannel#27bcbbfc as nil") } b.PutID(InputPeerChannelTypeID) return i.EncodeBare(b) @@ -633,9 +633,9 @@ func (i *InputPeerChannel) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (i *InputPeerChannel) EncodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode inputPeerChannel#20adaef8 as nil") + return fmt.Errorf("can't encode inputPeerChannel#27bcbbfc as nil") } - b.PutInt(i.ChannelID) + b.PutLong(i.ChannelID) b.PutLong(i.AccessHash) return nil } @@ -643,10 +643,10 @@ func (i *InputPeerChannel) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (i *InputPeerChannel) Decode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode inputPeerChannel#20adaef8 to nil") + return fmt.Errorf("can't decode inputPeerChannel#27bcbbfc to nil") } if err := b.ConsumeID(InputPeerChannelTypeID); err != nil { - return fmt.Errorf("unable to decode inputPeerChannel#20adaef8: %w", err) + return fmt.Errorf("unable to decode inputPeerChannel#27bcbbfc: %w", err) } return i.DecodeBare(b) } @@ -654,19 +654,19 @@ func (i *InputPeerChannel) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (i *InputPeerChannel) DecodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode inputPeerChannel#20adaef8 to nil") + return fmt.Errorf("can't decode inputPeerChannel#27bcbbfc to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode inputPeerChannel#20adaef8: field channel_id: %w", err) + return fmt.Errorf("unable to decode inputPeerChannel#27bcbbfc: field channel_id: %w", err) } i.ChannelID = value } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode inputPeerChannel#20adaef8: field access_hash: %w", err) + return fmt.Errorf("unable to decode inputPeerChannel#27bcbbfc: field access_hash: %w", err) } i.AccessHash = value } @@ -674,7 +674,7 @@ func (i *InputPeerChannel) DecodeBare(b *bin.Buffer) error { } // GetChannelID returns value of ChannelID field. -func (i *InputPeerChannel) GetChannelID() (value int) { +func (i *InputPeerChannel) GetChannelID() (value int64) { return i.ChannelID } @@ -683,7 +683,7 @@ func (i *InputPeerChannel) GetAccessHash() (value int64) { return i.AccessHash } -// InputPeerUserFromMessage represents TL type `inputPeerUserFromMessage#17bae2e6`. +// InputPeerUserFromMessage represents TL type `inputPeerUserFromMessage#a87b0a1c`. // Defines a min¹ user that was seen in a certain message of a certain chat. // // Links: @@ -696,11 +696,11 @@ type InputPeerUserFromMessage struct { // The message ID MsgID int // The identifier of the user that was seen - UserID int + UserID int64 } // InputPeerUserFromMessageTypeID is TL type id of InputPeerUserFromMessage. -const InputPeerUserFromMessageTypeID = 0x17bae2e6 +const InputPeerUserFromMessageTypeID = 0xa87b0a1c // construct implements constructor of InputPeerClass. func (i InputPeerUserFromMessage) construct() InputPeerClass { return &i } @@ -745,7 +745,7 @@ func (i *InputPeerUserFromMessage) String() string { func (i *InputPeerUserFromMessage) FillFrom(from interface { GetPeer() (value InputPeerClass) GetMsgID() (value int) - GetUserID() (value int) + GetUserID() (value int64) }) { i.Peer = from.GetPeer() i.MsgID = from.GetMsgID() @@ -794,7 +794,7 @@ func (i *InputPeerUserFromMessage) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (i *InputPeerUserFromMessage) Encode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode inputPeerUserFromMessage#17bae2e6 as nil") + return fmt.Errorf("can't encode inputPeerUserFromMessage#a87b0a1c as nil") } b.PutID(InputPeerUserFromMessageTypeID) return i.EncodeBare(b) @@ -803,26 +803,26 @@ func (i *InputPeerUserFromMessage) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (i *InputPeerUserFromMessage) EncodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode inputPeerUserFromMessage#17bae2e6 as nil") + return fmt.Errorf("can't encode inputPeerUserFromMessage#a87b0a1c as nil") } if i.Peer == nil { - return fmt.Errorf("unable to encode inputPeerUserFromMessage#17bae2e6: field peer is nil") + return fmt.Errorf("unable to encode inputPeerUserFromMessage#a87b0a1c: field peer is nil") } if err := i.Peer.Encode(b); err != nil { - return fmt.Errorf("unable to encode inputPeerUserFromMessage#17bae2e6: field peer: %w", err) + return fmt.Errorf("unable to encode inputPeerUserFromMessage#a87b0a1c: field peer: %w", err) } b.PutInt(i.MsgID) - b.PutInt(i.UserID) + b.PutLong(i.UserID) return nil } // Decode implements bin.Decoder. func (i *InputPeerUserFromMessage) Decode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode inputPeerUserFromMessage#17bae2e6 to nil") + return fmt.Errorf("can't decode inputPeerUserFromMessage#a87b0a1c to nil") } if err := b.ConsumeID(InputPeerUserFromMessageTypeID); err != nil { - return fmt.Errorf("unable to decode inputPeerUserFromMessage#17bae2e6: %w", err) + return fmt.Errorf("unable to decode inputPeerUserFromMessage#a87b0a1c: %w", err) } return i.DecodeBare(b) } @@ -830,26 +830,26 @@ func (i *InputPeerUserFromMessage) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (i *InputPeerUserFromMessage) DecodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode inputPeerUserFromMessage#17bae2e6 to nil") + return fmt.Errorf("can't decode inputPeerUserFromMessage#a87b0a1c to nil") } { value, err := DecodeInputPeer(b) if err != nil { - return fmt.Errorf("unable to decode inputPeerUserFromMessage#17bae2e6: field peer: %w", err) + return fmt.Errorf("unable to decode inputPeerUserFromMessage#a87b0a1c: field peer: %w", err) } i.Peer = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode inputPeerUserFromMessage#17bae2e6: field msg_id: %w", err) + return fmt.Errorf("unable to decode inputPeerUserFromMessage#a87b0a1c: field msg_id: %w", err) } i.MsgID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode inputPeerUserFromMessage#17bae2e6: field user_id: %w", err) + return fmt.Errorf("unable to decode inputPeerUserFromMessage#a87b0a1c: field user_id: %w", err) } i.UserID = value } @@ -867,11 +867,11 @@ func (i *InputPeerUserFromMessage) GetMsgID() (value int) { } // GetUserID returns value of UserID field. -func (i *InputPeerUserFromMessage) GetUserID() (value int) { +func (i *InputPeerUserFromMessage) GetUserID() (value int64) { return i.UserID } -// InputPeerChannelFromMessage represents TL type `inputPeerChannelFromMessage#9c95f7bb`. +// InputPeerChannelFromMessage represents TL type `inputPeerChannelFromMessage#bd2a0840`. // Defines a min¹ channel that was seen in a certain message of a certain chat. // // Links: @@ -884,11 +884,11 @@ type InputPeerChannelFromMessage struct { // The message ID MsgID int // The identifier of the channel that was seen - ChannelID int + ChannelID int64 } // InputPeerChannelFromMessageTypeID is TL type id of InputPeerChannelFromMessage. -const InputPeerChannelFromMessageTypeID = 0x9c95f7bb +const InputPeerChannelFromMessageTypeID = 0xbd2a0840 // construct implements constructor of InputPeerClass. func (i InputPeerChannelFromMessage) construct() InputPeerClass { return &i } @@ -933,7 +933,7 @@ func (i *InputPeerChannelFromMessage) String() string { func (i *InputPeerChannelFromMessage) FillFrom(from interface { GetPeer() (value InputPeerClass) GetMsgID() (value int) - GetChannelID() (value int) + GetChannelID() (value int64) }) { i.Peer = from.GetPeer() i.MsgID = from.GetMsgID() @@ -982,7 +982,7 @@ func (i *InputPeerChannelFromMessage) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (i *InputPeerChannelFromMessage) Encode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode inputPeerChannelFromMessage#9c95f7bb as nil") + return fmt.Errorf("can't encode inputPeerChannelFromMessage#bd2a0840 as nil") } b.PutID(InputPeerChannelFromMessageTypeID) return i.EncodeBare(b) @@ -991,26 +991,26 @@ func (i *InputPeerChannelFromMessage) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (i *InputPeerChannelFromMessage) EncodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode inputPeerChannelFromMessage#9c95f7bb as nil") + return fmt.Errorf("can't encode inputPeerChannelFromMessage#bd2a0840 as nil") } if i.Peer == nil { - return fmt.Errorf("unable to encode inputPeerChannelFromMessage#9c95f7bb: field peer is nil") + return fmt.Errorf("unable to encode inputPeerChannelFromMessage#bd2a0840: field peer is nil") } if err := i.Peer.Encode(b); err != nil { - return fmt.Errorf("unable to encode inputPeerChannelFromMessage#9c95f7bb: field peer: %w", err) + return fmt.Errorf("unable to encode inputPeerChannelFromMessage#bd2a0840: field peer: %w", err) } b.PutInt(i.MsgID) - b.PutInt(i.ChannelID) + b.PutLong(i.ChannelID) return nil } // Decode implements bin.Decoder. func (i *InputPeerChannelFromMessage) Decode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode inputPeerChannelFromMessage#9c95f7bb to nil") + return fmt.Errorf("can't decode inputPeerChannelFromMessage#bd2a0840 to nil") } if err := b.ConsumeID(InputPeerChannelFromMessageTypeID); err != nil { - return fmt.Errorf("unable to decode inputPeerChannelFromMessage#9c95f7bb: %w", err) + return fmt.Errorf("unable to decode inputPeerChannelFromMessage#bd2a0840: %w", err) } return i.DecodeBare(b) } @@ -1018,26 +1018,26 @@ func (i *InputPeerChannelFromMessage) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (i *InputPeerChannelFromMessage) DecodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode inputPeerChannelFromMessage#9c95f7bb to nil") + return fmt.Errorf("can't decode inputPeerChannelFromMessage#bd2a0840 to nil") } { value, err := DecodeInputPeer(b) if err != nil { - return fmt.Errorf("unable to decode inputPeerChannelFromMessage#9c95f7bb: field peer: %w", err) + return fmt.Errorf("unable to decode inputPeerChannelFromMessage#bd2a0840: field peer: %w", err) } i.Peer = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode inputPeerChannelFromMessage#9c95f7bb: field msg_id: %w", err) + return fmt.Errorf("unable to decode inputPeerChannelFromMessage#bd2a0840: field msg_id: %w", err) } i.MsgID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode inputPeerChannelFromMessage#9c95f7bb: field channel_id: %w", err) + return fmt.Errorf("unable to decode inputPeerChannelFromMessage#bd2a0840: field channel_id: %w", err) } i.ChannelID = value } @@ -1055,7 +1055,7 @@ func (i *InputPeerChannelFromMessage) GetMsgID() (value int) { } // GetChannelID returns value of ChannelID field. -func (i *InputPeerChannelFromMessage) GetChannelID() (value int) { +func (i *InputPeerChannelFromMessage) GetChannelID() (value int64) { return i.ChannelID } @@ -1071,11 +1071,11 @@ func (i *InputPeerChannelFromMessage) GetChannelID() (value int) { // switch v := g.(type) { // case *tg.InputPeerEmpty: // inputPeerEmpty#7f3b18ea // case *tg.InputPeerSelf: // inputPeerSelf#7da07ec9 -// case *tg.InputPeerChat: // inputPeerChat#179be863 -// case *tg.InputPeerUser: // inputPeerUser#7b8e7de6 -// case *tg.InputPeerChannel: // inputPeerChannel#20adaef8 -// case *tg.InputPeerUserFromMessage: // inputPeerUserFromMessage#17bae2e6 -// case *tg.InputPeerChannelFromMessage: // inputPeerChannelFromMessage#9c95f7bb +// case *tg.InputPeerChat: // inputPeerChat#35a95cb9 +// case *tg.InputPeerUser: // inputPeerUser#dde8a54c +// case *tg.InputPeerChannel: // inputPeerChannel#27bcbbfc +// case *tg.InputPeerUserFromMessage: // inputPeerUserFromMessage#a87b0a1c +// case *tg.InputPeerChannelFromMessage: // inputPeerChannelFromMessage#bd2a0840 // default: panic(v) // } type InputPeerClass interface { @@ -1119,35 +1119,35 @@ func DecodeInputPeer(buf *bin.Buffer) (InputPeerClass, error) { } return &v, nil case InputPeerChatTypeID: - // Decoding inputPeerChat#179be863. + // Decoding inputPeerChat#35a95cb9. v := InputPeerChat{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode InputPeerClass: %w", err) } return &v, nil case InputPeerUserTypeID: - // Decoding inputPeerUser#7b8e7de6. + // Decoding inputPeerUser#dde8a54c. v := InputPeerUser{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode InputPeerClass: %w", err) } return &v, nil case InputPeerChannelTypeID: - // Decoding inputPeerChannel#20adaef8. + // Decoding inputPeerChannel#27bcbbfc. v := InputPeerChannel{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode InputPeerClass: %w", err) } return &v, nil case InputPeerUserFromMessageTypeID: - // Decoding inputPeerUserFromMessage#17bae2e6. + // Decoding inputPeerUserFromMessage#a87b0a1c. v := InputPeerUserFromMessage{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode InputPeerClass: %w", err) } return &v, nil case InputPeerChannelFromMessageTypeID: - // Decoding inputPeerChannelFromMessage#9c95f7bb. + // Decoding inputPeerChannelFromMessage#bd2a0840. v := InputPeerChannelFromMessage{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode InputPeerClass: %w", err) diff --git a/tg/tl_input_photo_slices_gen.go b/tg/tl_input_photo_slices_gen.go index 2a85f7479d..d7c5818028 100644 --- a/tg/tl_input_photo_slices_gen.go +++ b/tg/tl_input_photo_slices_gen.go @@ -127,6 +127,24 @@ func (s InputPhotoClassArray) AsInputPhoto() (to InputPhotoArray) { return to } +// FillNotEmptyMap fills only NotEmpty constructors to given map. +func (s InputPhotoClassArray) FillNotEmptyMap(to map[int64]*InputPhoto) { + for _, elem := range s { + value, ok := elem.AsNotEmpty() + if !ok { + continue + } + to[value.GetID()] = value + } +} + +// NotEmptyToMap collects only NotEmpty constructors to map. +func (s InputPhotoClassArray) NotEmptyToMap() map[int64]*InputPhoto { + r := make(map[int64]*InputPhoto, len(s)) + s.FillNotEmptyMap(r) + return r +} + // AppendOnlyNotEmpty appends only NotEmpty constructors to // given slice. func (s InputPhotoClassArray) AppendOnlyNotEmpty(to []*InputPhoto) []*InputPhoto { @@ -263,3 +281,31 @@ func (s *InputPhotoArray) Pop() (v InputPhoto, ok bool) { return v, true } + +// SortByID sorts slice of InputPhoto by ID. +func (s InputPhotoArray) SortByID() InputPhotoArray { + return s.Sort(func(a, b InputPhoto) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of InputPhoto by ID. +func (s InputPhotoArray) SortStableByID() InputPhotoArray { + return s.SortStable(func(a, b InputPhoto) bool { + return a.GetID() < b.GetID() + }) +} + +// FillMap fills constructors to given map. +func (s InputPhotoArray) FillMap(to map[int64]InputPhoto) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s InputPhotoArray) ToMap() map[int64]InputPhoto { + r := make(map[int64]InputPhoto, len(s)) + s.FillMap(r) + return r +} diff --git a/tg/tl_input_privacy_rule_gen.go b/tg/tl_input_privacy_rule_gen.go index 67c80285c9..f5e7b39e14 100644 --- a/tg/tl_input_privacy_rule_gen.go +++ b/tg/tl_input_privacy_rule_gen.go @@ -747,17 +747,17 @@ func (i *InputPrivacyValueDisallowUsers) MapUsers() (value InputUserClassArray) return InputUserClassArray(i.Users) } -// InputPrivacyValueAllowChatParticipants represents TL type `inputPrivacyValueAllowChatParticipants#4c81c1ba`. +// InputPrivacyValueAllowChatParticipants represents TL type `inputPrivacyValueAllowChatParticipants#840649cf`. // Allow only participants of certain chats // // See https://core.telegram.org/constructor/inputPrivacyValueAllowChatParticipants for reference. type InputPrivacyValueAllowChatParticipants struct { // Allowed chat IDs - Chats []int + Chats []int64 } // InputPrivacyValueAllowChatParticipantsTypeID is TL type id of InputPrivacyValueAllowChatParticipants. -const InputPrivacyValueAllowChatParticipantsTypeID = 0x4c81c1ba +const InputPrivacyValueAllowChatParticipantsTypeID = 0x840649cf // construct implements constructor of InputPrivacyRuleClass. func (i InputPrivacyValueAllowChatParticipants) construct() InputPrivacyRuleClass { return &i } @@ -794,7 +794,7 @@ func (i *InputPrivacyValueAllowChatParticipants) String() string { // FillFrom fills InputPrivacyValueAllowChatParticipants from given interface. func (i *InputPrivacyValueAllowChatParticipants) FillFrom(from interface { - GetChats() (value []int) + GetChats() (value []int64) }) { i.Chats = from.GetChats() } @@ -833,7 +833,7 @@ func (i *InputPrivacyValueAllowChatParticipants) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (i *InputPrivacyValueAllowChatParticipants) Encode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode inputPrivacyValueAllowChatParticipants#4c81c1ba as nil") + return fmt.Errorf("can't encode inputPrivacyValueAllowChatParticipants#840649cf as nil") } b.PutID(InputPrivacyValueAllowChatParticipantsTypeID) return i.EncodeBare(b) @@ -842,11 +842,11 @@ func (i *InputPrivacyValueAllowChatParticipants) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (i *InputPrivacyValueAllowChatParticipants) EncodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode inputPrivacyValueAllowChatParticipants#4c81c1ba as nil") + return fmt.Errorf("can't encode inputPrivacyValueAllowChatParticipants#840649cf as nil") } b.PutVectorHeader(len(i.Chats)) for _, v := range i.Chats { - b.PutInt(v) + b.PutLong(v) } return nil } @@ -854,10 +854,10 @@ func (i *InputPrivacyValueAllowChatParticipants) EncodeBare(b *bin.Buffer) error // Decode implements bin.Decoder. func (i *InputPrivacyValueAllowChatParticipants) Decode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode inputPrivacyValueAllowChatParticipants#4c81c1ba to nil") + return fmt.Errorf("can't decode inputPrivacyValueAllowChatParticipants#840649cf to nil") } if err := b.ConsumeID(InputPrivacyValueAllowChatParticipantsTypeID); err != nil { - return fmt.Errorf("unable to decode inputPrivacyValueAllowChatParticipants#4c81c1ba: %w", err) + return fmt.Errorf("unable to decode inputPrivacyValueAllowChatParticipants#840649cf: %w", err) } return i.DecodeBare(b) } @@ -865,21 +865,21 @@ func (i *InputPrivacyValueAllowChatParticipants) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (i *InputPrivacyValueAllowChatParticipants) DecodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode inputPrivacyValueAllowChatParticipants#4c81c1ba to nil") + return fmt.Errorf("can't decode inputPrivacyValueAllowChatParticipants#840649cf to nil") } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode inputPrivacyValueAllowChatParticipants#4c81c1ba: field chats: %w", err) + return fmt.Errorf("unable to decode inputPrivacyValueAllowChatParticipants#840649cf: field chats: %w", err) } if headerLen > 0 { - i.Chats = make([]int, 0, headerLen%bin.PreallocateLimit) + i.Chats = make([]int64, 0, headerLen%bin.PreallocateLimit) } for idx := 0; idx < headerLen; idx++ { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode inputPrivacyValueAllowChatParticipants#4c81c1ba: field chats: %w", err) + return fmt.Errorf("unable to decode inputPrivacyValueAllowChatParticipants#840649cf: field chats: %w", err) } i.Chats = append(i.Chats, value) } @@ -888,21 +888,21 @@ func (i *InputPrivacyValueAllowChatParticipants) DecodeBare(b *bin.Buffer) error } // GetChats returns value of Chats field. -func (i *InputPrivacyValueAllowChatParticipants) GetChats() (value []int) { +func (i *InputPrivacyValueAllowChatParticipants) GetChats() (value []int64) { return i.Chats } -// InputPrivacyValueDisallowChatParticipants represents TL type `inputPrivacyValueDisallowChatParticipants#d82363af`. +// InputPrivacyValueDisallowChatParticipants represents TL type `inputPrivacyValueDisallowChatParticipants#e94f0f86`. // Disallow only participants of certain chats // // See https://core.telegram.org/constructor/inputPrivacyValueDisallowChatParticipants for reference. type InputPrivacyValueDisallowChatParticipants struct { // Disallowed chat IDs - Chats []int + Chats []int64 } // InputPrivacyValueDisallowChatParticipantsTypeID is TL type id of InputPrivacyValueDisallowChatParticipants. -const InputPrivacyValueDisallowChatParticipantsTypeID = 0xd82363af +const InputPrivacyValueDisallowChatParticipantsTypeID = 0xe94f0f86 // construct implements constructor of InputPrivacyRuleClass. func (i InputPrivacyValueDisallowChatParticipants) construct() InputPrivacyRuleClass { return &i } @@ -939,7 +939,7 @@ func (i *InputPrivacyValueDisallowChatParticipants) String() string { // FillFrom fills InputPrivacyValueDisallowChatParticipants from given interface. func (i *InputPrivacyValueDisallowChatParticipants) FillFrom(from interface { - GetChats() (value []int) + GetChats() (value []int64) }) { i.Chats = from.GetChats() } @@ -978,7 +978,7 @@ func (i *InputPrivacyValueDisallowChatParticipants) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (i *InputPrivacyValueDisallowChatParticipants) Encode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode inputPrivacyValueDisallowChatParticipants#d82363af as nil") + return fmt.Errorf("can't encode inputPrivacyValueDisallowChatParticipants#e94f0f86 as nil") } b.PutID(InputPrivacyValueDisallowChatParticipantsTypeID) return i.EncodeBare(b) @@ -987,11 +987,11 @@ func (i *InputPrivacyValueDisallowChatParticipants) Encode(b *bin.Buffer) error // EncodeBare implements bin.BareEncoder. func (i *InputPrivacyValueDisallowChatParticipants) EncodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode inputPrivacyValueDisallowChatParticipants#d82363af as nil") + return fmt.Errorf("can't encode inputPrivacyValueDisallowChatParticipants#e94f0f86 as nil") } b.PutVectorHeader(len(i.Chats)) for _, v := range i.Chats { - b.PutInt(v) + b.PutLong(v) } return nil } @@ -999,10 +999,10 @@ func (i *InputPrivacyValueDisallowChatParticipants) EncodeBare(b *bin.Buffer) er // Decode implements bin.Decoder. func (i *InputPrivacyValueDisallowChatParticipants) Decode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode inputPrivacyValueDisallowChatParticipants#d82363af to nil") + return fmt.Errorf("can't decode inputPrivacyValueDisallowChatParticipants#e94f0f86 to nil") } if err := b.ConsumeID(InputPrivacyValueDisallowChatParticipantsTypeID); err != nil { - return fmt.Errorf("unable to decode inputPrivacyValueDisallowChatParticipants#d82363af: %w", err) + return fmt.Errorf("unable to decode inputPrivacyValueDisallowChatParticipants#e94f0f86: %w", err) } return i.DecodeBare(b) } @@ -1010,21 +1010,21 @@ func (i *InputPrivacyValueDisallowChatParticipants) Decode(b *bin.Buffer) error // DecodeBare implements bin.BareDecoder. func (i *InputPrivacyValueDisallowChatParticipants) DecodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode inputPrivacyValueDisallowChatParticipants#d82363af to nil") + return fmt.Errorf("can't decode inputPrivacyValueDisallowChatParticipants#e94f0f86 to nil") } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode inputPrivacyValueDisallowChatParticipants#d82363af: field chats: %w", err) + return fmt.Errorf("unable to decode inputPrivacyValueDisallowChatParticipants#e94f0f86: field chats: %w", err) } if headerLen > 0 { - i.Chats = make([]int, 0, headerLen%bin.PreallocateLimit) + i.Chats = make([]int64, 0, headerLen%bin.PreallocateLimit) } for idx := 0; idx < headerLen; idx++ { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode inputPrivacyValueDisallowChatParticipants#d82363af: field chats: %w", err) + return fmt.Errorf("unable to decode inputPrivacyValueDisallowChatParticipants#e94f0f86: field chats: %w", err) } i.Chats = append(i.Chats, value) } @@ -1033,7 +1033,7 @@ func (i *InputPrivacyValueDisallowChatParticipants) DecodeBare(b *bin.Buffer) er } // GetChats returns value of Chats field. -func (i *InputPrivacyValueDisallowChatParticipants) GetChats() (value []int) { +func (i *InputPrivacyValueDisallowChatParticipants) GetChats() (value []int64) { return i.Chats } @@ -1053,8 +1053,8 @@ func (i *InputPrivacyValueDisallowChatParticipants) GetChats() (value []int) { // case *tg.InputPrivacyValueDisallowContacts: // inputPrivacyValueDisallowContacts#ba52007 // case *tg.InputPrivacyValueDisallowAll: // inputPrivacyValueDisallowAll#d66b66c9 // case *tg.InputPrivacyValueDisallowUsers: // inputPrivacyValueDisallowUsers#90110467 -// case *tg.InputPrivacyValueAllowChatParticipants: // inputPrivacyValueAllowChatParticipants#4c81c1ba -// case *tg.InputPrivacyValueDisallowChatParticipants: // inputPrivacyValueDisallowChatParticipants#d82363af +// case *tg.InputPrivacyValueAllowChatParticipants: // inputPrivacyValueAllowChatParticipants#840649cf +// case *tg.InputPrivacyValueDisallowChatParticipants: // inputPrivacyValueDisallowChatParticipants#e94f0f86 // default: panic(v) // } type InputPrivacyRuleClass interface { @@ -1126,14 +1126,14 @@ func DecodeInputPrivacyRule(buf *bin.Buffer) (InputPrivacyRuleClass, error) { } return &v, nil case InputPrivacyValueAllowChatParticipantsTypeID: - // Decoding inputPrivacyValueAllowChatParticipants#4c81c1ba. + // Decoding inputPrivacyValueAllowChatParticipants#840649cf. v := InputPrivacyValueAllowChatParticipants{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode InputPrivacyRuleClass: %w", err) } return &v, nil case InputPrivacyValueDisallowChatParticipantsTypeID: - // Decoding inputPrivacyValueDisallowChatParticipants#d82363af. + // Decoding inputPrivacyValueDisallowChatParticipants#e94f0f86. v := InputPrivacyValueDisallowChatParticipants{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode InputPrivacyRuleClass: %w", err) diff --git a/tg/tl_input_secure_file_slices_gen.go b/tg/tl_input_secure_file_slices_gen.go index da0bbcebf9..1a677037c5 100644 --- a/tg/tl_input_secure_file_slices_gen.go +++ b/tg/tl_input_secure_file_slices_gen.go @@ -114,6 +114,38 @@ func (s *InputSecureFileClassArray) Pop() (v InputSecureFileClass, ok bool) { return v, true } +// SortByID sorts slice of InputSecureFileClass by ID. +func (s InputSecureFileClassArray) SortByID() InputSecureFileClassArray { + return s.Sort(func(a, b InputSecureFileClass) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of InputSecureFileClass by ID. +func (s InputSecureFileClassArray) SortStableByID() InputSecureFileClassArray { + return s.SortStable(func(a, b InputSecureFileClass) bool { + return a.GetID() < b.GetID() + }) +} + +// FillInputSecureFileUploadedMap fills only InputSecureFileUploaded constructors to given map. +func (s InputSecureFileClassArray) FillInputSecureFileUploadedMap(to map[int64]*InputSecureFileUploaded) { + for _, elem := range s { + value, ok := elem.(*InputSecureFileUploaded) + if !ok { + continue + } + to[value.GetID()] = value + } +} + +// InputSecureFileUploadedToMap collects only InputSecureFileUploaded constructors to map. +func (s InputSecureFileClassArray) InputSecureFileUploadedToMap() map[int64]*InputSecureFileUploaded { + r := make(map[int64]*InputSecureFileUploaded, len(s)) + s.FillInputSecureFileUploadedMap(r) + return r +} + // AsInputSecureFileUploaded returns copy with only InputSecureFileUploaded constructors. func (s InputSecureFileClassArray) AsInputSecureFileUploaded() (to InputSecureFileUploadedArray) { for _, elem := range s { @@ -127,6 +159,24 @@ func (s InputSecureFileClassArray) AsInputSecureFileUploaded() (to InputSecureFi return to } +// FillInputSecureFileMap fills only InputSecureFile constructors to given map. +func (s InputSecureFileClassArray) FillInputSecureFileMap(to map[int64]*InputSecureFile) { + for _, elem := range s { + value, ok := elem.(*InputSecureFile) + if !ok { + continue + } + to[value.GetID()] = value + } +} + +// InputSecureFileToMap collects only InputSecureFile constructors to map. +func (s InputSecureFileClassArray) InputSecureFileToMap() map[int64]*InputSecureFile { + r := make(map[int64]*InputSecureFile, len(s)) + s.FillInputSecureFileMap(r) + return r +} + // AsInputSecureFile returns copy with only InputSecureFile constructors. func (s InputSecureFileClassArray) AsInputSecureFile() (to InputSecureFileArray) { for _, elem := range s { @@ -222,6 +272,34 @@ func (s *InputSecureFileUploadedArray) Pop() (v InputSecureFileUploaded, ok bool return v, true } +// SortByID sorts slice of InputSecureFileUploaded by ID. +func (s InputSecureFileUploadedArray) SortByID() InputSecureFileUploadedArray { + return s.Sort(func(a, b InputSecureFileUploaded) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of InputSecureFileUploaded by ID. +func (s InputSecureFileUploadedArray) SortStableByID() InputSecureFileUploadedArray { + return s.SortStable(func(a, b InputSecureFileUploaded) bool { + return a.GetID() < b.GetID() + }) +} + +// FillMap fills constructors to given map. +func (s InputSecureFileUploadedArray) FillMap(to map[int64]InputSecureFileUploaded) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s InputSecureFileUploadedArray) ToMap() map[int64]InputSecureFileUploaded { + r := make(map[int64]InputSecureFileUploaded, len(s)) + s.FillMap(r) + return r +} + // InputSecureFileArray is adapter for slice of InputSecureFile. type InputSecureFileArray []InputSecureFile @@ -303,3 +381,31 @@ func (s *InputSecureFileArray) Pop() (v InputSecureFile, ok bool) { return v, true } + +// SortByID sorts slice of InputSecureFile by ID. +func (s InputSecureFileArray) SortByID() InputSecureFileArray { + return s.Sort(func(a, b InputSecureFile) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of InputSecureFile by ID. +func (s InputSecureFileArray) SortStableByID() InputSecureFileArray { + return s.SortStable(func(a, b InputSecureFile) bool { + return a.GetID() < b.GetID() + }) +} + +// FillMap fills constructors to given map. +func (s InputSecureFileArray) FillMap(to map[int64]InputSecureFile) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s InputSecureFileArray) ToMap() map[int64]InputSecureFile { + r := make(map[int64]InputSecureFile, len(s)) + s.FillMap(r) + return r +} diff --git a/tg/tl_input_sticker_set_gen.go b/tg/tl_input_sticker_set_gen.go index a6e107a253..e98c4d5b61 100644 --- a/tg/tl_input_sticker_set_gen.go +++ b/tg/tl_input_sticker_set_gen.go @@ -656,6 +656,107 @@ func (i *InputStickerSetDice) GetEmoticon() (value string) { return i.Emoticon } +// InputStickerSetAnimatedEmojiAnimations represents TL type `inputStickerSetAnimatedEmojiAnimations#cde3739`. +// +// See https://core.telegram.org/constructor/inputStickerSetAnimatedEmojiAnimations for reference. +type InputStickerSetAnimatedEmojiAnimations struct { +} + +// InputStickerSetAnimatedEmojiAnimationsTypeID is TL type id of InputStickerSetAnimatedEmojiAnimations. +const InputStickerSetAnimatedEmojiAnimationsTypeID = 0xcde3739 + +// construct implements constructor of InputStickerSetClass. +func (i InputStickerSetAnimatedEmojiAnimations) construct() InputStickerSetClass { return &i } + +// Ensuring interfaces in compile-time for InputStickerSetAnimatedEmojiAnimations. +var ( + _ bin.Encoder = &InputStickerSetAnimatedEmojiAnimations{} + _ bin.Decoder = &InputStickerSetAnimatedEmojiAnimations{} + _ bin.BareEncoder = &InputStickerSetAnimatedEmojiAnimations{} + _ bin.BareDecoder = &InputStickerSetAnimatedEmojiAnimations{} + + _ InputStickerSetClass = &InputStickerSetAnimatedEmojiAnimations{} +) + +func (i *InputStickerSetAnimatedEmojiAnimations) Zero() bool { + if i == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (i *InputStickerSetAnimatedEmojiAnimations) String() string { + if i == nil { + return "InputStickerSetAnimatedEmojiAnimations(nil)" + } + type Alias InputStickerSetAnimatedEmojiAnimations + return fmt.Sprintf("InputStickerSetAnimatedEmojiAnimations%+v", Alias(*i)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*InputStickerSetAnimatedEmojiAnimations) TypeID() uint32 { + return InputStickerSetAnimatedEmojiAnimationsTypeID +} + +// TypeName returns name of type in TL schema. +func (*InputStickerSetAnimatedEmojiAnimations) TypeName() string { + return "inputStickerSetAnimatedEmojiAnimations" +} + +// TypeInfo returns info about TL type. +func (i *InputStickerSetAnimatedEmojiAnimations) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "inputStickerSetAnimatedEmojiAnimations", + ID: InputStickerSetAnimatedEmojiAnimationsTypeID, + } + if i == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (i *InputStickerSetAnimatedEmojiAnimations) Encode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode inputStickerSetAnimatedEmojiAnimations#cde3739 as nil") + } + b.PutID(InputStickerSetAnimatedEmojiAnimationsTypeID) + return i.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (i *InputStickerSetAnimatedEmojiAnimations) EncodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode inputStickerSetAnimatedEmojiAnimations#cde3739 as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (i *InputStickerSetAnimatedEmojiAnimations) Decode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode inputStickerSetAnimatedEmojiAnimations#cde3739 to nil") + } + if err := b.ConsumeID(InputStickerSetAnimatedEmojiAnimationsTypeID); err != nil { + return fmt.Errorf("unable to decode inputStickerSetAnimatedEmojiAnimations#cde3739: %w", err) + } + return i.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (i *InputStickerSetAnimatedEmojiAnimations) DecodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode inputStickerSetAnimatedEmojiAnimations#cde3739 to nil") + } + return nil +} + // InputStickerSetClass represents InputStickerSet generic type. // // See https://core.telegram.org/type/InputStickerSet for reference. @@ -671,6 +772,7 @@ func (i *InputStickerSetDice) GetEmoticon() (value string) { // case *tg.InputStickerSetShortName: // inputStickerSetShortName#861cc8a0 // case *tg.InputStickerSetAnimatedEmoji: // inputStickerSetAnimatedEmoji#28703c8 // case *tg.InputStickerSetDice: // inputStickerSetDice#e67f520e +// case *tg.InputStickerSetAnimatedEmojiAnimations: // inputStickerSetAnimatedEmojiAnimations#cde3739 // default: panic(v) // } type InputStickerSetClass interface { @@ -734,6 +836,13 @@ func DecodeInputStickerSet(buf *bin.Buffer) (InputStickerSetClass, error) { return nil, fmt.Errorf("unable to decode InputStickerSetClass: %w", err) } return &v, nil + case InputStickerSetAnimatedEmojiAnimationsTypeID: + // Decoding inputStickerSetAnimatedEmojiAnimations#cde3739. + v := InputStickerSetAnimatedEmojiAnimations{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode InputStickerSetClass: %w", err) + } + return &v, nil default: return nil, fmt.Errorf("unable to decode InputStickerSetClass: %w", bin.NewUnexpectedID(id)) } diff --git a/tg/tl_input_sticker_set_slices_gen.go b/tg/tl_input_sticker_set_slices_gen.go index 5ab25d7305..b65eed5c11 100644 --- a/tg/tl_input_sticker_set_slices_gen.go +++ b/tg/tl_input_sticker_set_slices_gen.go @@ -235,6 +235,34 @@ func (s *InputStickerSetIDArray) Pop() (v InputStickerSetID, ok bool) { return v, true } +// SortByID sorts slice of InputStickerSetID by ID. +func (s InputStickerSetIDArray) SortByID() InputStickerSetIDArray { + return s.Sort(func(a, b InputStickerSetID) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of InputStickerSetID by ID. +func (s InputStickerSetIDArray) SortStableByID() InputStickerSetIDArray { + return s.SortStable(func(a, b InputStickerSetID) bool { + return a.GetID() < b.GetID() + }) +} + +// FillMap fills constructors to given map. +func (s InputStickerSetIDArray) FillMap(to map[int64]InputStickerSetID) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s InputStickerSetIDArray) ToMap() map[int64]InputStickerSetID { + r := make(map[int64]InputStickerSetID, len(s)) + s.FillMap(r) + return r +} + // InputStickerSetShortNameArray is adapter for slice of InputStickerSetShortName. type InputStickerSetShortNameArray []InputStickerSetShortName diff --git a/tg/tl_input_theme_settings_gen.go b/tg/tl_input_theme_settings_gen.go index b88e911bb0..08d4f600fd 100644 --- a/tg/tl_input_theme_settings_gen.go +++ b/tg/tl_input_theme_settings_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// InputThemeSettings represents TL type `inputThemeSettings#ff38f912`. +// InputThemeSettings represents TL type `inputThemeSettings#8fde504f`. // Theme settings // // See https://core.telegram.org/constructor/inputThemeSettings for reference. @@ -45,6 +45,10 @@ type InputThemeSettings struct { BaseTheme BaseThemeClass // Accent color, RGB24 format AccentColor int + // OutboxAccentColor field of InputThemeSettings. + // + // Use SetOutboxAccentColor and GetOutboxAccentColor helpers. + OutboxAccentColor int // MessageColors field of InputThemeSettings. // // Use SetMessageColors and GetMessageColors helpers. @@ -60,7 +64,7 @@ type InputThemeSettings struct { } // InputThemeSettingsTypeID is TL type id of InputThemeSettings. -const InputThemeSettingsTypeID = 0xff38f912 +const InputThemeSettingsTypeID = 0x8fde504f // Ensuring interfaces in compile-time for InputThemeSettings. var ( @@ -86,6 +90,9 @@ func (i *InputThemeSettings) Zero() bool { if !(i.AccentColor == 0) { return false } + if !(i.OutboxAccentColor == 0) { + return false + } if !(i.MessageColors == nil) { return false } @@ -113,6 +120,7 @@ func (i *InputThemeSettings) FillFrom(from interface { GetMessageColorsAnimated() (value bool) GetBaseTheme() (value BaseThemeClass) GetAccentColor() (value int) + GetOutboxAccentColor() (value int, ok bool) GetMessageColors() (value []int, ok bool) GetWallpaper() (value InputWallPaperClass, ok bool) GetWallpaperSettings() (value WallPaperSettings, ok bool) @@ -120,6 +128,10 @@ func (i *InputThemeSettings) FillFrom(from interface { i.MessageColorsAnimated = from.GetMessageColorsAnimated() i.BaseTheme = from.GetBaseTheme() i.AccentColor = from.GetAccentColor() + if val, ok := from.GetOutboxAccentColor(); ok { + i.OutboxAccentColor = val + } + if val, ok := from.GetMessageColors(); ok { i.MessageColors = val } @@ -170,6 +182,11 @@ func (i *InputThemeSettings) TypeInfo() tdp.Type { Name: "AccentColor", SchemaName: "accent_color", }, + { + Name: "OutboxAccentColor", + SchemaName: "outbox_accent_color", + Null: !i.Flags.Has(3), + }, { Name: "MessageColors", SchemaName: "message_colors", @@ -192,7 +209,7 @@ func (i *InputThemeSettings) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (i *InputThemeSettings) Encode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode inputThemeSettings#ff38f912 as nil") + return fmt.Errorf("can't encode inputThemeSettings#8fde504f as nil") } b.PutID(InputThemeSettingsTypeID) return i.EncodeBare(b) @@ -201,11 +218,14 @@ func (i *InputThemeSettings) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (i *InputThemeSettings) EncodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode inputThemeSettings#ff38f912 as nil") + return fmt.Errorf("can't encode inputThemeSettings#8fde504f as nil") } if !(i.MessageColorsAnimated == false) { i.Flags.Set(2) } + if !(i.OutboxAccentColor == 0) { + i.Flags.Set(3) + } if !(i.MessageColors == nil) { i.Flags.Set(0) } @@ -216,15 +236,18 @@ func (i *InputThemeSettings) EncodeBare(b *bin.Buffer) error { i.Flags.Set(1) } if err := i.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode inputThemeSettings#ff38f912: field flags: %w", err) + return fmt.Errorf("unable to encode inputThemeSettings#8fde504f: field flags: %w", err) } if i.BaseTheme == nil { - return fmt.Errorf("unable to encode inputThemeSettings#ff38f912: field base_theme is nil") + return fmt.Errorf("unable to encode inputThemeSettings#8fde504f: field base_theme is nil") } if err := i.BaseTheme.Encode(b); err != nil { - return fmt.Errorf("unable to encode inputThemeSettings#ff38f912: field base_theme: %w", err) + return fmt.Errorf("unable to encode inputThemeSettings#8fde504f: field base_theme: %w", err) } b.PutInt(i.AccentColor) + if i.Flags.Has(3) { + b.PutInt(i.OutboxAccentColor) + } if i.Flags.Has(0) { b.PutVectorHeader(len(i.MessageColors)) for _, v := range i.MessageColors { @@ -233,15 +256,15 @@ func (i *InputThemeSettings) EncodeBare(b *bin.Buffer) error { } if i.Flags.Has(1) { if i.Wallpaper == nil { - return fmt.Errorf("unable to encode inputThemeSettings#ff38f912: field wallpaper is nil") + return fmt.Errorf("unable to encode inputThemeSettings#8fde504f: field wallpaper is nil") } if err := i.Wallpaper.Encode(b); err != nil { - return fmt.Errorf("unable to encode inputThemeSettings#ff38f912: field wallpaper: %w", err) + return fmt.Errorf("unable to encode inputThemeSettings#8fde504f: field wallpaper: %w", err) } } if i.Flags.Has(1) { if err := i.WallpaperSettings.Encode(b); err != nil { - return fmt.Errorf("unable to encode inputThemeSettings#ff38f912: field wallpaper_settings: %w", err) + return fmt.Errorf("unable to encode inputThemeSettings#8fde504f: field wallpaper_settings: %w", err) } } return nil @@ -250,10 +273,10 @@ func (i *InputThemeSettings) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (i *InputThemeSettings) Decode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode inputThemeSettings#ff38f912 to nil") + return fmt.Errorf("can't decode inputThemeSettings#8fde504f to nil") } if err := b.ConsumeID(InputThemeSettingsTypeID); err != nil { - return fmt.Errorf("unable to decode inputThemeSettings#ff38f912: %w", err) + return fmt.Errorf("unable to decode inputThemeSettings#8fde504f: %w", err) } return i.DecodeBare(b) } @@ -261,32 +284,39 @@ func (i *InputThemeSettings) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (i *InputThemeSettings) DecodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode inputThemeSettings#ff38f912 to nil") + return fmt.Errorf("can't decode inputThemeSettings#8fde504f to nil") } { if err := i.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode inputThemeSettings#ff38f912: field flags: %w", err) + return fmt.Errorf("unable to decode inputThemeSettings#8fde504f: field flags: %w", err) } } i.MessageColorsAnimated = i.Flags.Has(2) { value, err := DecodeBaseTheme(b) if err != nil { - return fmt.Errorf("unable to decode inputThemeSettings#ff38f912: field base_theme: %w", err) + return fmt.Errorf("unable to decode inputThemeSettings#8fde504f: field base_theme: %w", err) } i.BaseTheme = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode inputThemeSettings#ff38f912: field accent_color: %w", err) + return fmt.Errorf("unable to decode inputThemeSettings#8fde504f: field accent_color: %w", err) } i.AccentColor = value } + if i.Flags.Has(3) { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode inputThemeSettings#8fde504f: field outbox_accent_color: %w", err) + } + i.OutboxAccentColor = value + } if i.Flags.Has(0) { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode inputThemeSettings#ff38f912: field message_colors: %w", err) + return fmt.Errorf("unable to decode inputThemeSettings#8fde504f: field message_colors: %w", err) } if headerLen > 0 { @@ -295,7 +325,7 @@ func (i *InputThemeSettings) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode inputThemeSettings#ff38f912: field message_colors: %w", err) + return fmt.Errorf("unable to decode inputThemeSettings#8fde504f: field message_colors: %w", err) } i.MessageColors = append(i.MessageColors, value) } @@ -303,13 +333,13 @@ func (i *InputThemeSettings) DecodeBare(b *bin.Buffer) error { if i.Flags.Has(1) { value, err := DecodeInputWallPaper(b) if err != nil { - return fmt.Errorf("unable to decode inputThemeSettings#ff38f912: field wallpaper: %w", err) + return fmt.Errorf("unable to decode inputThemeSettings#8fde504f: field wallpaper: %w", err) } i.Wallpaper = value } if i.Flags.Has(1) { if err := i.WallpaperSettings.Decode(b); err != nil { - return fmt.Errorf("unable to decode inputThemeSettings#ff38f912: field wallpaper_settings: %w", err) + return fmt.Errorf("unable to decode inputThemeSettings#8fde504f: field wallpaper_settings: %w", err) } } return nil @@ -341,6 +371,21 @@ func (i *InputThemeSettings) GetAccentColor() (value int) { return i.AccentColor } +// SetOutboxAccentColor sets value of OutboxAccentColor conditional field. +func (i *InputThemeSettings) SetOutboxAccentColor(value int) { + i.Flags.Set(3) + i.OutboxAccentColor = value +} + +// GetOutboxAccentColor returns value of OutboxAccentColor conditional field and +// boolean which is true if field was set. +func (i *InputThemeSettings) GetOutboxAccentColor() (value int, ok bool) { + if !i.Flags.Has(3) { + return value, false + } + return i.OutboxAccentColor, true +} + // SetMessageColors sets value of MessageColors conditional field. func (i *InputThemeSettings) SetMessageColors(value []int) { i.Flags.Set(0) diff --git a/tg/tl_input_theme_slices_gen.go b/tg/tl_input_theme_slices_gen.go index 6343bcc759..b653c4f2f7 100644 --- a/tg/tl_input_theme_slices_gen.go +++ b/tg/tl_input_theme_slices_gen.go @@ -222,6 +222,34 @@ func (s *InputThemeArray) Pop() (v InputTheme, ok bool) { return v, true } +// SortByID sorts slice of InputTheme by ID. +func (s InputThemeArray) SortByID() InputThemeArray { + return s.Sort(func(a, b InputTheme) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of InputTheme by ID. +func (s InputThemeArray) SortStableByID() InputThemeArray { + return s.SortStable(func(a, b InputTheme) bool { + return a.GetID() < b.GetID() + }) +} + +// FillMap fills constructors to given map. +func (s InputThemeArray) FillMap(to map[int64]InputTheme) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s InputThemeArray) ToMap() map[int64]InputTheme { + r := make(map[int64]InputTheme, len(s)) + s.FillMap(r) + return r +} + // InputThemeSlugArray is adapter for slice of InputThemeSlug. type InputThemeSlugArray []InputThemeSlug diff --git a/tg/tl_input_user_gen.go b/tg/tl_input_user_gen.go index b9c312a229..b811383b2b 100644 --- a/tg/tl_input_user_gen.go +++ b/tg/tl_input_user_gen.go @@ -233,13 +233,13 @@ func (i *InputUserSelf) DecodeBare(b *bin.Buffer) error { return nil } -// InputUser represents TL type `inputUser#d8292816`. +// InputUser represents TL type `inputUser#f21158c6`. // Defines a user for further interaction. // // See https://core.telegram.org/constructor/inputUser for reference. type InputUser struct { // User identifier - UserID int + UserID int64 // access_hash value from the user¹ constructor // // Links: @@ -248,7 +248,7 @@ type InputUser struct { } // InputUserTypeID is TL type id of InputUser. -const InputUserTypeID = 0xd8292816 +const InputUserTypeID = 0xf21158c6 // construct implements constructor of InputUserClass. func (i InputUser) construct() InputUserClass { return &i } @@ -288,7 +288,7 @@ func (i *InputUser) String() string { // FillFrom fills InputUser from given interface. func (i *InputUser) FillFrom(from interface { - GetUserID() (value int) + GetUserID() (value int64) GetAccessHash() (value int64) }) { i.UserID = from.GetUserID() @@ -333,7 +333,7 @@ func (i *InputUser) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (i *InputUser) Encode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode inputUser#d8292816 as nil") + return fmt.Errorf("can't encode inputUser#f21158c6 as nil") } b.PutID(InputUserTypeID) return i.EncodeBare(b) @@ -342,9 +342,9 @@ func (i *InputUser) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (i *InputUser) EncodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode inputUser#d8292816 as nil") + return fmt.Errorf("can't encode inputUser#f21158c6 as nil") } - b.PutInt(i.UserID) + b.PutLong(i.UserID) b.PutLong(i.AccessHash) return nil } @@ -352,10 +352,10 @@ func (i *InputUser) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (i *InputUser) Decode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode inputUser#d8292816 to nil") + return fmt.Errorf("can't decode inputUser#f21158c6 to nil") } if err := b.ConsumeID(InputUserTypeID); err != nil { - return fmt.Errorf("unable to decode inputUser#d8292816: %w", err) + return fmt.Errorf("unable to decode inputUser#f21158c6: %w", err) } return i.DecodeBare(b) } @@ -363,19 +363,19 @@ func (i *InputUser) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (i *InputUser) DecodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode inputUser#d8292816 to nil") + return fmt.Errorf("can't decode inputUser#f21158c6 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode inputUser#d8292816: field user_id: %w", err) + return fmt.Errorf("unable to decode inputUser#f21158c6: field user_id: %w", err) } i.UserID = value } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode inputUser#d8292816: field access_hash: %w", err) + return fmt.Errorf("unable to decode inputUser#f21158c6: field access_hash: %w", err) } i.AccessHash = value } @@ -383,7 +383,7 @@ func (i *InputUser) DecodeBare(b *bin.Buffer) error { } // GetUserID returns value of UserID field. -func (i *InputUser) GetUserID() (value int) { +func (i *InputUser) GetUserID() (value int64) { return i.UserID } @@ -392,7 +392,7 @@ func (i *InputUser) GetAccessHash() (value int64) { return i.AccessHash } -// InputUserFromMessage represents TL type `inputUserFromMessage#2d117597`. +// InputUserFromMessage represents TL type `inputUserFromMessage#1da448e2`. // Defines a min¹ user that was seen in a certain message of a certain chat. // // Links: @@ -405,11 +405,11 @@ type InputUserFromMessage struct { // The message ID MsgID int // The identifier of the user that was seen - UserID int + UserID int64 } // InputUserFromMessageTypeID is TL type id of InputUserFromMessage. -const InputUserFromMessageTypeID = 0x2d117597 +const InputUserFromMessageTypeID = 0x1da448e2 // construct implements constructor of InputUserClass. func (i InputUserFromMessage) construct() InputUserClass { return &i } @@ -454,7 +454,7 @@ func (i *InputUserFromMessage) String() string { func (i *InputUserFromMessage) FillFrom(from interface { GetPeer() (value InputPeerClass) GetMsgID() (value int) - GetUserID() (value int) + GetUserID() (value int64) }) { i.Peer = from.GetPeer() i.MsgID = from.GetMsgID() @@ -503,7 +503,7 @@ func (i *InputUserFromMessage) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (i *InputUserFromMessage) Encode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode inputUserFromMessage#2d117597 as nil") + return fmt.Errorf("can't encode inputUserFromMessage#1da448e2 as nil") } b.PutID(InputUserFromMessageTypeID) return i.EncodeBare(b) @@ -512,26 +512,26 @@ func (i *InputUserFromMessage) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (i *InputUserFromMessage) EncodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode inputUserFromMessage#2d117597 as nil") + return fmt.Errorf("can't encode inputUserFromMessage#1da448e2 as nil") } if i.Peer == nil { - return fmt.Errorf("unable to encode inputUserFromMessage#2d117597: field peer is nil") + return fmt.Errorf("unable to encode inputUserFromMessage#1da448e2: field peer is nil") } if err := i.Peer.Encode(b); err != nil { - return fmt.Errorf("unable to encode inputUserFromMessage#2d117597: field peer: %w", err) + return fmt.Errorf("unable to encode inputUserFromMessage#1da448e2: field peer: %w", err) } b.PutInt(i.MsgID) - b.PutInt(i.UserID) + b.PutLong(i.UserID) return nil } // Decode implements bin.Decoder. func (i *InputUserFromMessage) Decode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode inputUserFromMessage#2d117597 to nil") + return fmt.Errorf("can't decode inputUserFromMessage#1da448e2 to nil") } if err := b.ConsumeID(InputUserFromMessageTypeID); err != nil { - return fmt.Errorf("unable to decode inputUserFromMessage#2d117597: %w", err) + return fmt.Errorf("unable to decode inputUserFromMessage#1da448e2: %w", err) } return i.DecodeBare(b) } @@ -539,26 +539,26 @@ func (i *InputUserFromMessage) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (i *InputUserFromMessage) DecodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode inputUserFromMessage#2d117597 to nil") + return fmt.Errorf("can't decode inputUserFromMessage#1da448e2 to nil") } { value, err := DecodeInputPeer(b) if err != nil { - return fmt.Errorf("unable to decode inputUserFromMessage#2d117597: field peer: %w", err) + return fmt.Errorf("unable to decode inputUserFromMessage#1da448e2: field peer: %w", err) } i.Peer = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode inputUserFromMessage#2d117597: field msg_id: %w", err) + return fmt.Errorf("unable to decode inputUserFromMessage#1da448e2: field msg_id: %w", err) } i.MsgID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode inputUserFromMessage#2d117597: field user_id: %w", err) + return fmt.Errorf("unable to decode inputUserFromMessage#1da448e2: field user_id: %w", err) } i.UserID = value } @@ -576,7 +576,7 @@ func (i *InputUserFromMessage) GetMsgID() (value int) { } // GetUserID returns value of UserID field. -func (i *InputUserFromMessage) GetUserID() (value int) { +func (i *InputUserFromMessage) GetUserID() (value int64) { return i.UserID } @@ -592,8 +592,8 @@ func (i *InputUserFromMessage) GetUserID() (value int) { // switch v := g.(type) { // case *tg.InputUserEmpty: // inputUserEmpty#b98886cf // case *tg.InputUserSelf: // inputUserSelf#f7c1b13f -// case *tg.InputUser: // inputUser#d8292816 -// case *tg.InputUserFromMessage: // inputUserFromMessage#2d117597 +// case *tg.InputUser: // inputUser#f21158c6 +// case *tg.InputUserFromMessage: // inputUserFromMessage#1da448e2 // default: panic(v) // } type InputUserClass interface { @@ -637,14 +637,14 @@ func DecodeInputUser(buf *bin.Buffer) (InputUserClass, error) { } return &v, nil case InputUserTypeID: - // Decoding inputUser#d8292816. + // Decoding inputUser#f21158c6. v := InputUser{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode InputUserClass: %w", err) } return &v, nil case InputUserFromMessageTypeID: - // Decoding inputUserFromMessage#2d117597. + // Decoding inputUserFromMessage#1da448e2. v := InputUserFromMessage{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode InputUserClass: %w", err) diff --git a/tg/tl_input_wall_paper_slices_gen.go b/tg/tl_input_wall_paper_slices_gen.go index 80233a4a0f..cf4b06b7b9 100644 --- a/tg/tl_input_wall_paper_slices_gen.go +++ b/tg/tl_input_wall_paper_slices_gen.go @@ -235,6 +235,34 @@ func (s *InputWallPaperArray) Pop() (v InputWallPaper, ok bool) { return v, true } +// SortByID sorts slice of InputWallPaper by ID. +func (s InputWallPaperArray) SortByID() InputWallPaperArray { + return s.Sort(func(a, b InputWallPaper) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of InputWallPaper by ID. +func (s InputWallPaperArray) SortStableByID() InputWallPaperArray { + return s.SortStable(func(a, b InputWallPaper) bool { + return a.GetID() < b.GetID() + }) +} + +// FillMap fills constructors to given map. +func (s InputWallPaperArray) FillMap(to map[int64]InputWallPaper) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s InputWallPaperArray) ToMap() map[int64]InputWallPaper { + r := make(map[int64]InputWallPaper, len(s)) + s.FillMap(r) + return r +} + // InputWallPaperSlugArray is adapter for slice of InputWallPaperSlug. type InputWallPaperSlugArray []InputWallPaperSlug @@ -398,3 +426,31 @@ func (s *InputWallPaperNoFileArray) Pop() (v InputWallPaperNoFile, ok bool) { return v, true } + +// SortByID sorts slice of InputWallPaperNoFile by ID. +func (s InputWallPaperNoFileArray) SortByID() InputWallPaperNoFileArray { + return s.Sort(func(a, b InputWallPaperNoFile) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of InputWallPaperNoFile by ID. +func (s InputWallPaperNoFileArray) SortStableByID() InputWallPaperNoFileArray { + return s.SortStable(func(a, b InputWallPaperNoFile) bool { + return a.GetID() < b.GetID() + }) +} + +// FillMap fills constructors to given map. +func (s InputWallPaperNoFileArray) FillMap(to map[int64]InputWallPaperNoFile) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s InputWallPaperNoFileArray) ToMap() map[int64]InputWallPaperNoFile { + r := make(map[int64]InputWallPaperNoFile, len(s)) + s.FillMap(r) + return r +} diff --git a/tg/tl_message_action_gen.go b/tg/tl_message_action_gen.go index 7b7b9d9741..437c999fed 100644 --- a/tg/tl_message_action_gen.go +++ b/tg/tl_message_action_gen.go @@ -131,7 +131,7 @@ func (m *MessageActionEmpty) DecodeBare(b *bin.Buffer) error { return nil } -// MessageActionChatCreate represents TL type `messageActionChatCreate#a6638b9a`. +// MessageActionChatCreate represents TL type `messageActionChatCreate#bd47cbad`. // Group created // // See https://core.telegram.org/constructor/messageActionChatCreate for reference. @@ -139,11 +139,11 @@ type MessageActionChatCreate struct { // Group name Title string // List of group members - Users []int + Users []int64 } // MessageActionChatCreateTypeID is TL type id of MessageActionChatCreate. -const MessageActionChatCreateTypeID = 0xa6638b9a +const MessageActionChatCreateTypeID = 0xbd47cbad // construct implements constructor of MessageActionClass. func (m MessageActionChatCreate) construct() MessageActionClass { return &m } @@ -184,7 +184,7 @@ func (m *MessageActionChatCreate) String() string { // FillFrom fills MessageActionChatCreate from given interface. func (m *MessageActionChatCreate) FillFrom(from interface { GetTitle() (value string) - GetUsers() (value []int) + GetUsers() (value []int64) }) { m.Title = from.GetTitle() m.Users = from.GetUsers() @@ -228,7 +228,7 @@ func (m *MessageActionChatCreate) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (m *MessageActionChatCreate) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageActionChatCreate#a6638b9a as nil") + return fmt.Errorf("can't encode messageActionChatCreate#bd47cbad as nil") } b.PutID(MessageActionChatCreateTypeID) return m.EncodeBare(b) @@ -237,12 +237,12 @@ func (m *MessageActionChatCreate) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (m *MessageActionChatCreate) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageActionChatCreate#a6638b9a as nil") + return fmt.Errorf("can't encode messageActionChatCreate#bd47cbad as nil") } b.PutString(m.Title) b.PutVectorHeader(len(m.Users)) for _, v := range m.Users { - b.PutInt(v) + b.PutLong(v) } return nil } @@ -250,10 +250,10 @@ func (m *MessageActionChatCreate) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (m *MessageActionChatCreate) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageActionChatCreate#a6638b9a to nil") + return fmt.Errorf("can't decode messageActionChatCreate#bd47cbad to nil") } if err := b.ConsumeID(MessageActionChatCreateTypeID); err != nil { - return fmt.Errorf("unable to decode messageActionChatCreate#a6638b9a: %w", err) + return fmt.Errorf("unable to decode messageActionChatCreate#bd47cbad: %w", err) } return m.DecodeBare(b) } @@ -261,28 +261,28 @@ func (m *MessageActionChatCreate) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (m *MessageActionChatCreate) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageActionChatCreate#a6638b9a to nil") + return fmt.Errorf("can't decode messageActionChatCreate#bd47cbad to nil") } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode messageActionChatCreate#a6638b9a: field title: %w", err) + return fmt.Errorf("unable to decode messageActionChatCreate#bd47cbad: field title: %w", err) } m.Title = value } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode messageActionChatCreate#a6638b9a: field users: %w", err) + return fmt.Errorf("unable to decode messageActionChatCreate#bd47cbad: field users: %w", err) } if headerLen > 0 { - m.Users = make([]int, 0, headerLen%bin.PreallocateLimit) + m.Users = make([]int64, 0, headerLen%bin.PreallocateLimit) } for idx := 0; idx < headerLen; idx++ { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messageActionChatCreate#a6638b9a: field users: %w", err) + return fmt.Errorf("unable to decode messageActionChatCreate#bd47cbad: field users: %w", err) } m.Users = append(m.Users, value) } @@ -296,7 +296,7 @@ func (m *MessageActionChatCreate) GetTitle() (value string) { } // GetUsers returns value of Users field. -func (m *MessageActionChatCreate) GetUsers() (value []int) { +func (m *MessageActionChatCreate) GetUsers() (value []int64) { return m.Users } @@ -671,17 +671,17 @@ func (m *MessageActionChatDeletePhoto) DecodeBare(b *bin.Buffer) error { return nil } -// MessageActionChatAddUser represents TL type `messageActionChatAddUser#488a7337`. +// MessageActionChatAddUser represents TL type `messageActionChatAddUser#15cefd00`. // New member in the group // // See https://core.telegram.org/constructor/messageActionChatAddUser for reference. type MessageActionChatAddUser struct { // Users that were invited to the chat - Users []int + Users []int64 } // MessageActionChatAddUserTypeID is TL type id of MessageActionChatAddUser. -const MessageActionChatAddUserTypeID = 0x488a7337 +const MessageActionChatAddUserTypeID = 0x15cefd00 // construct implements constructor of MessageActionClass. func (m MessageActionChatAddUser) construct() MessageActionClass { return &m } @@ -718,7 +718,7 @@ func (m *MessageActionChatAddUser) String() string { // FillFrom fills MessageActionChatAddUser from given interface. func (m *MessageActionChatAddUser) FillFrom(from interface { - GetUsers() (value []int) + GetUsers() (value []int64) }) { m.Users = from.GetUsers() } @@ -757,7 +757,7 @@ func (m *MessageActionChatAddUser) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (m *MessageActionChatAddUser) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageActionChatAddUser#488a7337 as nil") + return fmt.Errorf("can't encode messageActionChatAddUser#15cefd00 as nil") } b.PutID(MessageActionChatAddUserTypeID) return m.EncodeBare(b) @@ -766,11 +766,11 @@ func (m *MessageActionChatAddUser) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (m *MessageActionChatAddUser) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageActionChatAddUser#488a7337 as nil") + return fmt.Errorf("can't encode messageActionChatAddUser#15cefd00 as nil") } b.PutVectorHeader(len(m.Users)) for _, v := range m.Users { - b.PutInt(v) + b.PutLong(v) } return nil } @@ -778,10 +778,10 @@ func (m *MessageActionChatAddUser) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (m *MessageActionChatAddUser) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageActionChatAddUser#488a7337 to nil") + return fmt.Errorf("can't decode messageActionChatAddUser#15cefd00 to nil") } if err := b.ConsumeID(MessageActionChatAddUserTypeID); err != nil { - return fmt.Errorf("unable to decode messageActionChatAddUser#488a7337: %w", err) + return fmt.Errorf("unable to decode messageActionChatAddUser#15cefd00: %w", err) } return m.DecodeBare(b) } @@ -789,21 +789,21 @@ func (m *MessageActionChatAddUser) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (m *MessageActionChatAddUser) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageActionChatAddUser#488a7337 to nil") + return fmt.Errorf("can't decode messageActionChatAddUser#15cefd00 to nil") } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode messageActionChatAddUser#488a7337: field users: %w", err) + return fmt.Errorf("unable to decode messageActionChatAddUser#15cefd00: field users: %w", err) } if headerLen > 0 { - m.Users = make([]int, 0, headerLen%bin.PreallocateLimit) + m.Users = make([]int64, 0, headerLen%bin.PreallocateLimit) } for idx := 0; idx < headerLen; idx++ { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messageActionChatAddUser#488a7337: field users: %w", err) + return fmt.Errorf("unable to decode messageActionChatAddUser#15cefd00: field users: %w", err) } m.Users = append(m.Users, value) } @@ -812,21 +812,21 @@ func (m *MessageActionChatAddUser) DecodeBare(b *bin.Buffer) error { } // GetUsers returns value of Users field. -func (m *MessageActionChatAddUser) GetUsers() (value []int) { +func (m *MessageActionChatAddUser) GetUsers() (value []int64) { return m.Users } -// MessageActionChatDeleteUser represents TL type `messageActionChatDeleteUser#b2ae9b0c`. +// MessageActionChatDeleteUser represents TL type `messageActionChatDeleteUser#a43f30cc`. // User left the group. // // See https://core.telegram.org/constructor/messageActionChatDeleteUser for reference. type MessageActionChatDeleteUser struct { // Leaving user ID - UserID int + UserID int64 } // MessageActionChatDeleteUserTypeID is TL type id of MessageActionChatDeleteUser. -const MessageActionChatDeleteUserTypeID = 0xb2ae9b0c +const MessageActionChatDeleteUserTypeID = 0xa43f30cc // construct implements constructor of MessageActionClass. func (m MessageActionChatDeleteUser) construct() MessageActionClass { return &m } @@ -863,7 +863,7 @@ func (m *MessageActionChatDeleteUser) String() string { // FillFrom fills MessageActionChatDeleteUser from given interface. func (m *MessageActionChatDeleteUser) FillFrom(from interface { - GetUserID() (value int) + GetUserID() (value int64) }) { m.UserID = from.GetUserID() } @@ -902,7 +902,7 @@ func (m *MessageActionChatDeleteUser) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (m *MessageActionChatDeleteUser) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageActionChatDeleteUser#b2ae9b0c as nil") + return fmt.Errorf("can't encode messageActionChatDeleteUser#a43f30cc as nil") } b.PutID(MessageActionChatDeleteUserTypeID) return m.EncodeBare(b) @@ -911,19 +911,19 @@ func (m *MessageActionChatDeleteUser) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (m *MessageActionChatDeleteUser) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageActionChatDeleteUser#b2ae9b0c as nil") + return fmt.Errorf("can't encode messageActionChatDeleteUser#a43f30cc as nil") } - b.PutInt(m.UserID) + b.PutLong(m.UserID) return nil } // Decode implements bin.Decoder. func (m *MessageActionChatDeleteUser) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageActionChatDeleteUser#b2ae9b0c to nil") + return fmt.Errorf("can't decode messageActionChatDeleteUser#a43f30cc to nil") } if err := b.ConsumeID(MessageActionChatDeleteUserTypeID); err != nil { - return fmt.Errorf("unable to decode messageActionChatDeleteUser#b2ae9b0c: %w", err) + return fmt.Errorf("unable to decode messageActionChatDeleteUser#a43f30cc: %w", err) } return m.DecodeBare(b) } @@ -931,12 +931,12 @@ func (m *MessageActionChatDeleteUser) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (m *MessageActionChatDeleteUser) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageActionChatDeleteUser#b2ae9b0c to nil") + return fmt.Errorf("can't decode messageActionChatDeleteUser#a43f30cc to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messageActionChatDeleteUser#b2ae9b0c: field user_id: %w", err) + return fmt.Errorf("unable to decode messageActionChatDeleteUser#a43f30cc: field user_id: %w", err) } m.UserID = value } @@ -944,21 +944,21 @@ func (m *MessageActionChatDeleteUser) DecodeBare(b *bin.Buffer) error { } // GetUserID returns value of UserID field. -func (m *MessageActionChatDeleteUser) GetUserID() (value int) { +func (m *MessageActionChatDeleteUser) GetUserID() (value int64) { return m.UserID } -// MessageActionChatJoinedByLink represents TL type `messageActionChatJoinedByLink#f89cf5e8`. +// MessageActionChatJoinedByLink represents TL type `messageActionChatJoinedByLink#31224c3`. // A user joined the chat via an invite link // // See https://core.telegram.org/constructor/messageActionChatJoinedByLink for reference. type MessageActionChatJoinedByLink struct { // ID of the user that created the invite link - InviterID int + InviterID int64 } // MessageActionChatJoinedByLinkTypeID is TL type id of MessageActionChatJoinedByLink. -const MessageActionChatJoinedByLinkTypeID = 0xf89cf5e8 +const MessageActionChatJoinedByLinkTypeID = 0x31224c3 // construct implements constructor of MessageActionClass. func (m MessageActionChatJoinedByLink) construct() MessageActionClass { return &m } @@ -995,7 +995,7 @@ func (m *MessageActionChatJoinedByLink) String() string { // FillFrom fills MessageActionChatJoinedByLink from given interface. func (m *MessageActionChatJoinedByLink) FillFrom(from interface { - GetInviterID() (value int) + GetInviterID() (value int64) }) { m.InviterID = from.GetInviterID() } @@ -1034,7 +1034,7 @@ func (m *MessageActionChatJoinedByLink) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (m *MessageActionChatJoinedByLink) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageActionChatJoinedByLink#f89cf5e8 as nil") + return fmt.Errorf("can't encode messageActionChatJoinedByLink#31224c3 as nil") } b.PutID(MessageActionChatJoinedByLinkTypeID) return m.EncodeBare(b) @@ -1043,19 +1043,19 @@ func (m *MessageActionChatJoinedByLink) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (m *MessageActionChatJoinedByLink) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageActionChatJoinedByLink#f89cf5e8 as nil") + return fmt.Errorf("can't encode messageActionChatJoinedByLink#31224c3 as nil") } - b.PutInt(m.InviterID) + b.PutLong(m.InviterID) return nil } // Decode implements bin.Decoder. func (m *MessageActionChatJoinedByLink) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageActionChatJoinedByLink#f89cf5e8 to nil") + return fmt.Errorf("can't decode messageActionChatJoinedByLink#31224c3 to nil") } if err := b.ConsumeID(MessageActionChatJoinedByLinkTypeID); err != nil { - return fmt.Errorf("unable to decode messageActionChatJoinedByLink#f89cf5e8: %w", err) + return fmt.Errorf("unable to decode messageActionChatJoinedByLink#31224c3: %w", err) } return m.DecodeBare(b) } @@ -1063,12 +1063,12 @@ func (m *MessageActionChatJoinedByLink) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (m *MessageActionChatJoinedByLink) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageActionChatJoinedByLink#f89cf5e8 to nil") + return fmt.Errorf("can't decode messageActionChatJoinedByLink#31224c3 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messageActionChatJoinedByLink#f89cf5e8: field inviter_id: %w", err) + return fmt.Errorf("unable to decode messageActionChatJoinedByLink#31224c3: field inviter_id: %w", err) } m.InviterID = value } @@ -1076,7 +1076,7 @@ func (m *MessageActionChatJoinedByLink) DecodeBare(b *bin.Buffer) error { } // GetInviterID returns value of InviterID field. -func (m *MessageActionChatJoinedByLink) GetInviterID() (value int) { +func (m *MessageActionChatJoinedByLink) GetInviterID() (value int64) { return m.InviterID } @@ -1212,7 +1212,7 @@ func (m *MessageActionChannelCreate) GetTitle() (value string) { return m.Title } -// MessageActionChatMigrateTo represents TL type `messageActionChatMigrateTo#51bdb021`. +// MessageActionChatMigrateTo represents TL type `messageActionChatMigrateTo#e1037f92`. // Indicates the chat was migrated¹ to the specified supergroup // // Links: @@ -1221,11 +1221,11 @@ func (m *MessageActionChannelCreate) GetTitle() (value string) { // See https://core.telegram.org/constructor/messageActionChatMigrateTo for reference. type MessageActionChatMigrateTo struct { // The supergroup it was migrated to - ChannelID int + ChannelID int64 } // MessageActionChatMigrateToTypeID is TL type id of MessageActionChatMigrateTo. -const MessageActionChatMigrateToTypeID = 0x51bdb021 +const MessageActionChatMigrateToTypeID = 0xe1037f92 // construct implements constructor of MessageActionClass. func (m MessageActionChatMigrateTo) construct() MessageActionClass { return &m } @@ -1262,7 +1262,7 @@ func (m *MessageActionChatMigrateTo) String() string { // FillFrom fills MessageActionChatMigrateTo from given interface. func (m *MessageActionChatMigrateTo) FillFrom(from interface { - GetChannelID() (value int) + GetChannelID() (value int64) }) { m.ChannelID = from.GetChannelID() } @@ -1301,7 +1301,7 @@ func (m *MessageActionChatMigrateTo) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (m *MessageActionChatMigrateTo) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageActionChatMigrateTo#51bdb021 as nil") + return fmt.Errorf("can't encode messageActionChatMigrateTo#e1037f92 as nil") } b.PutID(MessageActionChatMigrateToTypeID) return m.EncodeBare(b) @@ -1310,19 +1310,19 @@ func (m *MessageActionChatMigrateTo) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (m *MessageActionChatMigrateTo) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageActionChatMigrateTo#51bdb021 as nil") + return fmt.Errorf("can't encode messageActionChatMigrateTo#e1037f92 as nil") } - b.PutInt(m.ChannelID) + b.PutLong(m.ChannelID) return nil } // Decode implements bin.Decoder. func (m *MessageActionChatMigrateTo) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageActionChatMigrateTo#51bdb021 to nil") + return fmt.Errorf("can't decode messageActionChatMigrateTo#e1037f92 to nil") } if err := b.ConsumeID(MessageActionChatMigrateToTypeID); err != nil { - return fmt.Errorf("unable to decode messageActionChatMigrateTo#51bdb021: %w", err) + return fmt.Errorf("unable to decode messageActionChatMigrateTo#e1037f92: %w", err) } return m.DecodeBare(b) } @@ -1330,12 +1330,12 @@ func (m *MessageActionChatMigrateTo) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (m *MessageActionChatMigrateTo) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageActionChatMigrateTo#51bdb021 to nil") + return fmt.Errorf("can't decode messageActionChatMigrateTo#e1037f92 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messageActionChatMigrateTo#51bdb021: field channel_id: %w", err) + return fmt.Errorf("unable to decode messageActionChatMigrateTo#e1037f92: field channel_id: %w", err) } m.ChannelID = value } @@ -1343,11 +1343,11 @@ func (m *MessageActionChatMigrateTo) DecodeBare(b *bin.Buffer) error { } // GetChannelID returns value of ChannelID field. -func (m *MessageActionChatMigrateTo) GetChannelID() (value int) { +func (m *MessageActionChatMigrateTo) GetChannelID() (value int64) { return m.ChannelID } -// MessageActionChannelMigrateFrom represents TL type `messageActionChannelMigrateFrom#b055eaee`. +// MessageActionChannelMigrateFrom represents TL type `messageActionChannelMigrateFrom#ea3948e9`. // Indicates the channel was migrated¹ from the specified chat // // Links: @@ -1358,11 +1358,11 @@ type MessageActionChannelMigrateFrom struct { // The old chat tite Title string // The old chat ID - ChatID int + ChatID int64 } // MessageActionChannelMigrateFromTypeID is TL type id of MessageActionChannelMigrateFrom. -const MessageActionChannelMigrateFromTypeID = 0xb055eaee +const MessageActionChannelMigrateFromTypeID = 0xea3948e9 // construct implements constructor of MessageActionClass. func (m MessageActionChannelMigrateFrom) construct() MessageActionClass { return &m } @@ -1403,7 +1403,7 @@ func (m *MessageActionChannelMigrateFrom) String() string { // FillFrom fills MessageActionChannelMigrateFrom from given interface. func (m *MessageActionChannelMigrateFrom) FillFrom(from interface { GetTitle() (value string) - GetChatID() (value int) + GetChatID() (value int64) }) { m.Title = from.GetTitle() m.ChatID = from.GetChatID() @@ -1447,7 +1447,7 @@ func (m *MessageActionChannelMigrateFrom) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (m *MessageActionChannelMigrateFrom) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageActionChannelMigrateFrom#b055eaee as nil") + return fmt.Errorf("can't encode messageActionChannelMigrateFrom#ea3948e9 as nil") } b.PutID(MessageActionChannelMigrateFromTypeID) return m.EncodeBare(b) @@ -1456,20 +1456,20 @@ func (m *MessageActionChannelMigrateFrom) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (m *MessageActionChannelMigrateFrom) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageActionChannelMigrateFrom#b055eaee as nil") + return fmt.Errorf("can't encode messageActionChannelMigrateFrom#ea3948e9 as nil") } b.PutString(m.Title) - b.PutInt(m.ChatID) + b.PutLong(m.ChatID) return nil } // Decode implements bin.Decoder. func (m *MessageActionChannelMigrateFrom) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageActionChannelMigrateFrom#b055eaee to nil") + return fmt.Errorf("can't decode messageActionChannelMigrateFrom#ea3948e9 to nil") } if err := b.ConsumeID(MessageActionChannelMigrateFromTypeID); err != nil { - return fmt.Errorf("unable to decode messageActionChannelMigrateFrom#b055eaee: %w", err) + return fmt.Errorf("unable to decode messageActionChannelMigrateFrom#ea3948e9: %w", err) } return m.DecodeBare(b) } @@ -1477,19 +1477,19 @@ func (m *MessageActionChannelMigrateFrom) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (m *MessageActionChannelMigrateFrom) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageActionChannelMigrateFrom#b055eaee to nil") + return fmt.Errorf("can't decode messageActionChannelMigrateFrom#ea3948e9 to nil") } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode messageActionChannelMigrateFrom#b055eaee: field title: %w", err) + return fmt.Errorf("unable to decode messageActionChannelMigrateFrom#ea3948e9: field title: %w", err) } m.Title = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messageActionChannelMigrateFrom#b055eaee: field chat_id: %w", err) + return fmt.Errorf("unable to decode messageActionChannelMigrateFrom#ea3948e9: field chat_id: %w", err) } m.ChatID = value } @@ -1502,7 +1502,7 @@ func (m *MessageActionChannelMigrateFrom) GetTitle() (value string) { } // GetChatID returns value of ChatID field. -func (m *MessageActionChannelMigrateFrom) GetChatID() (value int) { +func (m *MessageActionChannelMigrateFrom) GetChatID() (value int64) { return m.ChatID } @@ -3813,18 +3813,18 @@ func (m *MessageActionGroupCall) GetDuration() (value int, ok bool) { return m.Duration, true } -// MessageActionInviteToGroupCall represents TL type `messageActionInviteToGroupCall#76b9f11a`. +// MessageActionInviteToGroupCall represents TL type `messageActionInviteToGroupCall#502f92f7`. // // See https://core.telegram.org/constructor/messageActionInviteToGroupCall for reference. type MessageActionInviteToGroupCall struct { // Call field of MessageActionInviteToGroupCall. Call InputGroupCall // Users field of MessageActionInviteToGroupCall. - Users []int + Users []int64 } // MessageActionInviteToGroupCallTypeID is TL type id of MessageActionInviteToGroupCall. -const MessageActionInviteToGroupCallTypeID = 0x76b9f11a +const MessageActionInviteToGroupCallTypeID = 0x502f92f7 // construct implements constructor of MessageActionClass. func (m MessageActionInviteToGroupCall) construct() MessageActionClass { return &m } @@ -3865,7 +3865,7 @@ func (m *MessageActionInviteToGroupCall) String() string { // FillFrom fills MessageActionInviteToGroupCall from given interface. func (m *MessageActionInviteToGroupCall) FillFrom(from interface { GetCall() (value InputGroupCall) - GetUsers() (value []int) + GetUsers() (value []int64) }) { m.Call = from.GetCall() m.Users = from.GetUsers() @@ -3909,7 +3909,7 @@ func (m *MessageActionInviteToGroupCall) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (m *MessageActionInviteToGroupCall) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageActionInviteToGroupCall#76b9f11a as nil") + return fmt.Errorf("can't encode messageActionInviteToGroupCall#502f92f7 as nil") } b.PutID(MessageActionInviteToGroupCallTypeID) return m.EncodeBare(b) @@ -3918,14 +3918,14 @@ func (m *MessageActionInviteToGroupCall) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (m *MessageActionInviteToGroupCall) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageActionInviteToGroupCall#76b9f11a as nil") + return fmt.Errorf("can't encode messageActionInviteToGroupCall#502f92f7 as nil") } if err := m.Call.Encode(b); err != nil { - return fmt.Errorf("unable to encode messageActionInviteToGroupCall#76b9f11a: field call: %w", err) + return fmt.Errorf("unable to encode messageActionInviteToGroupCall#502f92f7: field call: %w", err) } b.PutVectorHeader(len(m.Users)) for _, v := range m.Users { - b.PutInt(v) + b.PutLong(v) } return nil } @@ -3933,10 +3933,10 @@ func (m *MessageActionInviteToGroupCall) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (m *MessageActionInviteToGroupCall) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageActionInviteToGroupCall#76b9f11a to nil") + return fmt.Errorf("can't decode messageActionInviteToGroupCall#502f92f7 to nil") } if err := b.ConsumeID(MessageActionInviteToGroupCallTypeID); err != nil { - return fmt.Errorf("unable to decode messageActionInviteToGroupCall#76b9f11a: %w", err) + return fmt.Errorf("unable to decode messageActionInviteToGroupCall#502f92f7: %w", err) } return m.DecodeBare(b) } @@ -3944,26 +3944,26 @@ func (m *MessageActionInviteToGroupCall) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (m *MessageActionInviteToGroupCall) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageActionInviteToGroupCall#76b9f11a to nil") + return fmt.Errorf("can't decode messageActionInviteToGroupCall#502f92f7 to nil") } { if err := m.Call.Decode(b); err != nil { - return fmt.Errorf("unable to decode messageActionInviteToGroupCall#76b9f11a: field call: %w", err) + return fmt.Errorf("unable to decode messageActionInviteToGroupCall#502f92f7: field call: %w", err) } } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode messageActionInviteToGroupCall#76b9f11a: field users: %w", err) + return fmt.Errorf("unable to decode messageActionInviteToGroupCall#502f92f7: field users: %w", err) } if headerLen > 0 { - m.Users = make([]int, 0, headerLen%bin.PreallocateLimit) + m.Users = make([]int64, 0, headerLen%bin.PreallocateLimit) } for idx := 0; idx < headerLen; idx++ { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messageActionInviteToGroupCall#76b9f11a: field users: %w", err) + return fmt.Errorf("unable to decode messageActionInviteToGroupCall#502f92f7: field users: %w", err) } m.Users = append(m.Users, value) } @@ -3977,7 +3977,7 @@ func (m *MessageActionInviteToGroupCall) GetCall() (value InputGroupCall) { } // GetUsers returns value of Users field. -func (m *MessageActionInviteToGroupCall) GetUsers() (value []int) { +func (m *MessageActionInviteToGroupCall) GetUsers() (value []int64) { return m.Users } @@ -4409,16 +4409,16 @@ func (m *MessageActionSetChatTheme) GetEmoticon() (value string) { // } // switch v := g.(type) { // case *tg.MessageActionEmpty: // messageActionEmpty#b6aef7b0 -// case *tg.MessageActionChatCreate: // messageActionChatCreate#a6638b9a +// case *tg.MessageActionChatCreate: // messageActionChatCreate#bd47cbad // case *tg.MessageActionChatEditTitle: // messageActionChatEditTitle#b5a1ce5a // case *tg.MessageActionChatEditPhoto: // messageActionChatEditPhoto#7fcb13a8 // case *tg.MessageActionChatDeletePhoto: // messageActionChatDeletePhoto#95e3fbef -// case *tg.MessageActionChatAddUser: // messageActionChatAddUser#488a7337 -// case *tg.MessageActionChatDeleteUser: // messageActionChatDeleteUser#b2ae9b0c -// case *tg.MessageActionChatJoinedByLink: // messageActionChatJoinedByLink#f89cf5e8 +// case *tg.MessageActionChatAddUser: // messageActionChatAddUser#15cefd00 +// case *tg.MessageActionChatDeleteUser: // messageActionChatDeleteUser#a43f30cc +// case *tg.MessageActionChatJoinedByLink: // messageActionChatJoinedByLink#31224c3 // case *tg.MessageActionChannelCreate: // messageActionChannelCreate#95d2ac92 -// case *tg.MessageActionChatMigrateTo: // messageActionChatMigrateTo#51bdb021 -// case *tg.MessageActionChannelMigrateFrom: // messageActionChannelMigrateFrom#b055eaee +// case *tg.MessageActionChatMigrateTo: // messageActionChatMigrateTo#e1037f92 +// case *tg.MessageActionChannelMigrateFrom: // messageActionChannelMigrateFrom#ea3948e9 // case *tg.MessageActionPinMessage: // messageActionPinMessage#94bd38ed // case *tg.MessageActionHistoryClear: // messageActionHistoryClear#9fbab604 // case *tg.MessageActionGameScore: // messageActionGameScore#92a72876 @@ -4433,7 +4433,7 @@ func (m *MessageActionSetChatTheme) GetEmoticon() (value string) { // case *tg.MessageActionContactSignUp: // messageActionContactSignUp#f3f25f76 // case *tg.MessageActionGeoProximityReached: // messageActionGeoProximityReached#98e0d697 // case *tg.MessageActionGroupCall: // messageActionGroupCall#7a0d7f42 -// case *tg.MessageActionInviteToGroupCall: // messageActionInviteToGroupCall#76b9f11a +// case *tg.MessageActionInviteToGroupCall: // messageActionInviteToGroupCall#502f92f7 // case *tg.MessageActionSetMessagesTTL: // messageActionSetMessagesTTL#aa1afbfd // case *tg.MessageActionGroupCallScheduled: // messageActionGroupCallScheduled#b3a07661 // case *tg.MessageActionSetChatTheme: // messageActionSetChatTheme#aa786345 @@ -4473,7 +4473,7 @@ func DecodeMessageAction(buf *bin.Buffer) (MessageActionClass, error) { } return &v, nil case MessageActionChatCreateTypeID: - // Decoding messageActionChatCreate#a6638b9a. + // Decoding messageActionChatCreate#bd47cbad. v := MessageActionChatCreate{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageActionClass: %w", err) @@ -4501,21 +4501,21 @@ func DecodeMessageAction(buf *bin.Buffer) (MessageActionClass, error) { } return &v, nil case MessageActionChatAddUserTypeID: - // Decoding messageActionChatAddUser#488a7337. + // Decoding messageActionChatAddUser#15cefd00. v := MessageActionChatAddUser{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageActionClass: %w", err) } return &v, nil case MessageActionChatDeleteUserTypeID: - // Decoding messageActionChatDeleteUser#b2ae9b0c. + // Decoding messageActionChatDeleteUser#a43f30cc. v := MessageActionChatDeleteUser{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageActionClass: %w", err) } return &v, nil case MessageActionChatJoinedByLinkTypeID: - // Decoding messageActionChatJoinedByLink#f89cf5e8. + // Decoding messageActionChatJoinedByLink#31224c3. v := MessageActionChatJoinedByLink{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageActionClass: %w", err) @@ -4529,14 +4529,14 @@ func DecodeMessageAction(buf *bin.Buffer) (MessageActionClass, error) { } return &v, nil case MessageActionChatMigrateToTypeID: - // Decoding messageActionChatMigrateTo#51bdb021. + // Decoding messageActionChatMigrateTo#e1037f92. v := MessageActionChatMigrateTo{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageActionClass: %w", err) } return &v, nil case MessageActionChannelMigrateFromTypeID: - // Decoding messageActionChannelMigrateFrom#b055eaee. + // Decoding messageActionChannelMigrateFrom#ea3948e9. v := MessageActionChannelMigrateFrom{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageActionClass: %w", err) @@ -4641,7 +4641,7 @@ func DecodeMessageAction(buf *bin.Buffer) (MessageActionClass, error) { } return &v, nil case MessageActionInviteToGroupCallTypeID: - // Decoding messageActionInviteToGroupCall#76b9f11a. + // Decoding messageActionInviteToGroupCall#502f92f7. v := MessageActionInviteToGroupCall{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageActionClass: %w", err) diff --git a/tg/tl_message_entity_gen.go b/tg/tl_message_entity_gen.go index 2204f964a4..776d768ebe 100644 --- a/tg/tl_message_entity_gen.go +++ b/tg/tl_message_entity_gen.go @@ -1812,7 +1812,7 @@ func (m *MessageEntityTextURL) GetURL() (value string) { return m.URL } -// MessageEntityMentionName represents TL type `messageEntityMentionName#352dca58`. +// MessageEntityMentionName represents TL type `messageEntityMentionName#dc7b1140`. // Message entity representing a user mention¹: for creating a mention use // inputMessageEntityMentionName². // @@ -1827,11 +1827,11 @@ type MessageEntityMentionName struct { // Length of message entity within message (in UTF-8 codepoints) Length int // Identifier of the user that was mentioned - UserID int + UserID int64 } // MessageEntityMentionNameTypeID is TL type id of MessageEntityMentionName. -const MessageEntityMentionNameTypeID = 0x352dca58 +const MessageEntityMentionNameTypeID = 0xdc7b1140 // construct implements constructor of MessageEntityClass. func (m MessageEntityMentionName) construct() MessageEntityClass { return &m } @@ -1876,7 +1876,7 @@ func (m *MessageEntityMentionName) String() string { func (m *MessageEntityMentionName) FillFrom(from interface { GetOffset() (value int) GetLength() (value int) - GetUserID() (value int) + GetUserID() (value int64) }) { m.Offset = from.GetOffset() m.Length = from.GetLength() @@ -1925,7 +1925,7 @@ func (m *MessageEntityMentionName) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (m *MessageEntityMentionName) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageEntityMentionName#352dca58 as nil") + return fmt.Errorf("can't encode messageEntityMentionName#dc7b1140 as nil") } b.PutID(MessageEntityMentionNameTypeID) return m.EncodeBare(b) @@ -1934,21 +1934,21 @@ func (m *MessageEntityMentionName) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (m *MessageEntityMentionName) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageEntityMentionName#352dca58 as nil") + return fmt.Errorf("can't encode messageEntityMentionName#dc7b1140 as nil") } b.PutInt(m.Offset) b.PutInt(m.Length) - b.PutInt(m.UserID) + b.PutLong(m.UserID) return nil } // Decode implements bin.Decoder. func (m *MessageEntityMentionName) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageEntityMentionName#352dca58 to nil") + return fmt.Errorf("can't decode messageEntityMentionName#dc7b1140 to nil") } if err := b.ConsumeID(MessageEntityMentionNameTypeID); err != nil { - return fmt.Errorf("unable to decode messageEntityMentionName#352dca58: %w", err) + return fmt.Errorf("unable to decode messageEntityMentionName#dc7b1140: %w", err) } return m.DecodeBare(b) } @@ -1956,26 +1956,26 @@ func (m *MessageEntityMentionName) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (m *MessageEntityMentionName) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageEntityMentionName#352dca58 to nil") + return fmt.Errorf("can't decode messageEntityMentionName#dc7b1140 to nil") } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messageEntityMentionName#352dca58: field offset: %w", err) + return fmt.Errorf("unable to decode messageEntityMentionName#dc7b1140: field offset: %w", err) } m.Offset = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messageEntityMentionName#352dca58: field length: %w", err) + return fmt.Errorf("unable to decode messageEntityMentionName#dc7b1140: field length: %w", err) } m.Length = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messageEntityMentionName#352dca58: field user_id: %w", err) + return fmt.Errorf("unable to decode messageEntityMentionName#dc7b1140: field user_id: %w", err) } m.UserID = value } @@ -1993,7 +1993,7 @@ func (m *MessageEntityMentionName) GetLength() (value int) { } // GetUserID returns value of UserID field. -func (m *MessageEntityMentionName) GetUserID() (value int) { +func (m *MessageEntityMentionName) GetUserID() (value int64) { return m.UserID } @@ -3144,7 +3144,7 @@ func (m *MessageEntityBankCard) GetLength() (value int) { // case *tg.MessageEntityCode: // messageEntityCode#28a20571 // case *tg.MessageEntityPre: // messageEntityPre#73924be0 // case *tg.MessageEntityTextURL: // messageEntityTextUrl#76a6d327 -// case *tg.MessageEntityMentionName: // messageEntityMentionName#352dca58 +// case *tg.MessageEntityMentionName: // messageEntityMentionName#dc7b1140 // case *tg.InputMessageEntityMentionName: // inputMessageEntityMentionName#208e68c9 // case *tg.MessageEntityPhone: // messageEntityPhone#9b69e34b // case *tg.MessageEntityCashtag: // messageEntityCashtag#4c4e743f @@ -3264,7 +3264,7 @@ func DecodeMessageEntity(buf *bin.Buffer) (MessageEntityClass, error) { } return &v, nil case MessageEntityMentionNameTypeID: - // Decoding messageEntityMentionName#352dca58. + // Decoding messageEntityMentionName#dc7b1140. v := MessageEntityMentionName{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageEntityClass: %w", err) diff --git a/tg/tl_message_gen.go b/tg/tl_message_gen.go index 0c8c5a4591..33acb41672 100644 --- a/tg/tl_message_gen.go +++ b/tg/tl_message_gen.go @@ -224,7 +224,7 @@ func (m *MessageEmpty) GetPeerID() (value PeerClass, ok bool) { return m.PeerID, true } -// Message represents TL type `message#bce383d2`. +// Message represents TL type `message#85d6cbe2`. // A message // // See https://core.telegram.org/constructor/message for reference. @@ -277,7 +277,7 @@ type Message struct { // ID of the inline bot that generated the message // // Use SetViaBotID and GetViaBotID helpers. - ViaBotID int + ViaBotID int64 // Reply information // // Use SetReplyTo and GetReplyTo helpers. @@ -344,7 +344,7 @@ type Message struct { } // MessageTypeID is TL type id of Message. -const MessageTypeID = 0xbce383d2 +const MessageTypeID = 0x85d6cbe2 // construct implements constructor of MessageClass. func (m Message) construct() MessageClass { return &m } @@ -478,7 +478,7 @@ func (m *Message) FillFrom(from interface { GetFromID() (value PeerClass, ok bool) GetPeerID() (value PeerClass) GetFwdFrom() (value MessageFwdHeader, ok bool) - GetViaBotID() (value int, ok bool) + GetViaBotID() (value int64, ok bool) GetReplyTo() (value MessageReplyHeader, ok bool) GetDate() (value int) GetMessage() (value string) @@ -735,7 +735,7 @@ func (m *Message) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (m *Message) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode message#bce383d2 as nil") + return fmt.Errorf("can't encode message#85d6cbe2 as nil") } b.PutID(MessageTypeID) return m.EncodeBare(b) @@ -744,7 +744,7 @@ func (m *Message) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (m *Message) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode message#bce383d2 as nil") + return fmt.Errorf("can't encode message#85d6cbe2 as nil") } if !(m.Out == false) { m.Flags.Set(1) @@ -819,62 +819,62 @@ func (m *Message) EncodeBare(b *bin.Buffer) error { m.Flags.Set(25) } if err := m.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode message#bce383d2: field flags: %w", err) + return fmt.Errorf("unable to encode message#85d6cbe2: field flags: %w", err) } b.PutInt(m.ID) if m.Flags.Has(8) { if m.FromID == nil { - return fmt.Errorf("unable to encode message#bce383d2: field from_id is nil") + return fmt.Errorf("unable to encode message#85d6cbe2: field from_id is nil") } if err := m.FromID.Encode(b); err != nil { - return fmt.Errorf("unable to encode message#bce383d2: field from_id: %w", err) + return fmt.Errorf("unable to encode message#85d6cbe2: field from_id: %w", err) } } if m.PeerID == nil { - return fmt.Errorf("unable to encode message#bce383d2: field peer_id is nil") + return fmt.Errorf("unable to encode message#85d6cbe2: field peer_id is nil") } if err := m.PeerID.Encode(b); err != nil { - return fmt.Errorf("unable to encode message#bce383d2: field peer_id: %w", err) + return fmt.Errorf("unable to encode message#85d6cbe2: field peer_id: %w", err) } if m.Flags.Has(2) { if err := m.FwdFrom.Encode(b); err != nil { - return fmt.Errorf("unable to encode message#bce383d2: field fwd_from: %w", err) + return fmt.Errorf("unable to encode message#85d6cbe2: field fwd_from: %w", err) } } if m.Flags.Has(11) { - b.PutInt(m.ViaBotID) + b.PutLong(m.ViaBotID) } if m.Flags.Has(3) { if err := m.ReplyTo.Encode(b); err != nil { - return fmt.Errorf("unable to encode message#bce383d2: field reply_to: %w", err) + return fmt.Errorf("unable to encode message#85d6cbe2: field reply_to: %w", err) } } b.PutInt(m.Date) b.PutString(m.Message) if m.Flags.Has(9) { if m.Media == nil { - return fmt.Errorf("unable to encode message#bce383d2: field media is nil") + return fmt.Errorf("unable to encode message#85d6cbe2: field media is nil") } if err := m.Media.Encode(b); err != nil { - return fmt.Errorf("unable to encode message#bce383d2: field media: %w", err) + return fmt.Errorf("unable to encode message#85d6cbe2: field media: %w", err) } } if m.Flags.Has(6) { if m.ReplyMarkup == nil { - return fmt.Errorf("unable to encode message#bce383d2: field reply_markup is nil") + return fmt.Errorf("unable to encode message#85d6cbe2: field reply_markup is nil") } if err := m.ReplyMarkup.Encode(b); err != nil { - return fmt.Errorf("unable to encode message#bce383d2: field reply_markup: %w", err) + return fmt.Errorf("unable to encode message#85d6cbe2: field reply_markup: %w", err) } } if m.Flags.Has(7) { b.PutVectorHeader(len(m.Entities)) for idx, v := range m.Entities { if v == nil { - return fmt.Errorf("unable to encode message#bce383d2: field entities element with index %d is nil", idx) + return fmt.Errorf("unable to encode message#85d6cbe2: field entities element with index %d is nil", idx) } if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode message#bce383d2: field entities element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode message#85d6cbe2: field entities element with index %d: %w", idx, err) } } } @@ -886,7 +886,7 @@ func (m *Message) EncodeBare(b *bin.Buffer) error { } if m.Flags.Has(23) { if err := m.Replies.Encode(b); err != nil { - return fmt.Errorf("unable to encode message#bce383d2: field replies: %w", err) + return fmt.Errorf("unable to encode message#85d6cbe2: field replies: %w", err) } } if m.Flags.Has(15) { @@ -902,7 +902,7 @@ func (m *Message) EncodeBare(b *bin.Buffer) error { b.PutVectorHeader(len(m.RestrictionReason)) for idx, v := range m.RestrictionReason { if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode message#bce383d2: field restriction_reason element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode message#85d6cbe2: field restriction_reason element with index %d: %w", idx, err) } } } @@ -915,10 +915,10 @@ func (m *Message) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (m *Message) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode message#bce383d2 to nil") + return fmt.Errorf("can't decode message#85d6cbe2 to nil") } if err := b.ConsumeID(MessageTypeID); err != nil { - return fmt.Errorf("unable to decode message#bce383d2: %w", err) + return fmt.Errorf("unable to decode message#85d6cbe2: %w", err) } return m.DecodeBare(b) } @@ -926,11 +926,11 @@ func (m *Message) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (m *Message) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode message#bce383d2 to nil") + return fmt.Errorf("can't decode message#85d6cbe2 to nil") } { if err := m.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode message#bce383d2: field flags: %w", err) + return fmt.Errorf("unable to decode message#85d6cbe2: field flags: %w", err) } } m.Out = m.Flags.Has(1) @@ -945,73 +945,73 @@ func (m *Message) DecodeBare(b *bin.Buffer) error { { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode message#bce383d2: field id: %w", err) + return fmt.Errorf("unable to decode message#85d6cbe2: field id: %w", err) } m.ID = value } if m.Flags.Has(8) { value, err := DecodePeer(b) if err != nil { - return fmt.Errorf("unable to decode message#bce383d2: field from_id: %w", err) + return fmt.Errorf("unable to decode message#85d6cbe2: field from_id: %w", err) } m.FromID = value } { value, err := DecodePeer(b) if err != nil { - return fmt.Errorf("unable to decode message#bce383d2: field peer_id: %w", err) + return fmt.Errorf("unable to decode message#85d6cbe2: field peer_id: %w", err) } m.PeerID = value } if m.Flags.Has(2) { if err := m.FwdFrom.Decode(b); err != nil { - return fmt.Errorf("unable to decode message#bce383d2: field fwd_from: %w", err) + return fmt.Errorf("unable to decode message#85d6cbe2: field fwd_from: %w", err) } } if m.Flags.Has(11) { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode message#bce383d2: field via_bot_id: %w", err) + return fmt.Errorf("unable to decode message#85d6cbe2: field via_bot_id: %w", err) } m.ViaBotID = value } if m.Flags.Has(3) { if err := m.ReplyTo.Decode(b); err != nil { - return fmt.Errorf("unable to decode message#bce383d2: field reply_to: %w", err) + return fmt.Errorf("unable to decode message#85d6cbe2: field reply_to: %w", err) } } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode message#bce383d2: field date: %w", err) + return fmt.Errorf("unable to decode message#85d6cbe2: field date: %w", err) } m.Date = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode message#bce383d2: field message: %w", err) + return fmt.Errorf("unable to decode message#85d6cbe2: field message: %w", err) } m.Message = value } if m.Flags.Has(9) { value, err := DecodeMessageMedia(b) if err != nil { - return fmt.Errorf("unable to decode message#bce383d2: field media: %w", err) + return fmt.Errorf("unable to decode message#85d6cbe2: field media: %w", err) } m.Media = value } if m.Flags.Has(6) { value, err := DecodeReplyMarkup(b) if err != nil { - return fmt.Errorf("unable to decode message#bce383d2: field reply_markup: %w", err) + return fmt.Errorf("unable to decode message#85d6cbe2: field reply_markup: %w", err) } m.ReplyMarkup = value } if m.Flags.Has(7) { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode message#bce383d2: field entities: %w", err) + return fmt.Errorf("unable to decode message#85d6cbe2: field entities: %w", err) } if headerLen > 0 { @@ -1020,7 +1020,7 @@ func (m *Message) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := DecodeMessageEntity(b) if err != nil { - return fmt.Errorf("unable to decode message#bce383d2: field entities: %w", err) + return fmt.Errorf("unable to decode message#85d6cbe2: field entities: %w", err) } m.Entities = append(m.Entities, value) } @@ -1028,47 +1028,47 @@ func (m *Message) DecodeBare(b *bin.Buffer) error { if m.Flags.Has(10) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode message#bce383d2: field views: %w", err) + return fmt.Errorf("unable to decode message#85d6cbe2: field views: %w", err) } m.Views = value } if m.Flags.Has(10) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode message#bce383d2: field forwards: %w", err) + return fmt.Errorf("unable to decode message#85d6cbe2: field forwards: %w", err) } m.Forwards = value } if m.Flags.Has(23) { if err := m.Replies.Decode(b); err != nil { - return fmt.Errorf("unable to decode message#bce383d2: field replies: %w", err) + return fmt.Errorf("unable to decode message#85d6cbe2: field replies: %w", err) } } if m.Flags.Has(15) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode message#bce383d2: field edit_date: %w", err) + return fmt.Errorf("unable to decode message#85d6cbe2: field edit_date: %w", err) } m.EditDate = value } if m.Flags.Has(16) { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode message#bce383d2: field post_author: %w", err) + return fmt.Errorf("unable to decode message#85d6cbe2: field post_author: %w", err) } m.PostAuthor = value } if m.Flags.Has(17) { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode message#bce383d2: field grouped_id: %w", err) + return fmt.Errorf("unable to decode message#85d6cbe2: field grouped_id: %w", err) } m.GroupedID = value } if m.Flags.Has(22) { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode message#bce383d2: field restriction_reason: %w", err) + return fmt.Errorf("unable to decode message#85d6cbe2: field restriction_reason: %w", err) } if headerLen > 0 { @@ -1077,7 +1077,7 @@ func (m *Message) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { var value RestrictionReason if err := value.Decode(b); err != nil { - return fmt.Errorf("unable to decode message#bce383d2: field restriction_reason: %w", err) + return fmt.Errorf("unable to decode message#85d6cbe2: field restriction_reason: %w", err) } m.RestrictionReason = append(m.RestrictionReason, value) } @@ -1085,7 +1085,7 @@ func (m *Message) DecodeBare(b *bin.Buffer) error { if m.Flags.Has(25) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode message#bce383d2: field ttl_period: %w", err) + return fmt.Errorf("unable to decode message#85d6cbe2: field ttl_period: %w", err) } m.TTLPeriod = value } @@ -1277,14 +1277,14 @@ func (m *Message) GetFwdFrom() (value MessageFwdHeader, ok bool) { } // SetViaBotID sets value of ViaBotID conditional field. -func (m *Message) SetViaBotID(value int) { +func (m *Message) SetViaBotID(value int64) { m.Flags.Set(11) m.ViaBotID = value } // GetViaBotID returns value of ViaBotID conditional field and // boolean which is true if field was set. -func (m *Message) GetViaBotID() (value int, ok bool) { +func (m *Message) GetViaBotID() (value int64, ok bool) { if !m.Flags.Has(11) { return value, false } @@ -2062,7 +2062,7 @@ func (m *MessageService) GetTTLPeriod() (value int, ok bool) { // } // switch v := g.(type) { // case *tg.MessageEmpty: // messageEmpty#90a6ca84 -// case *tg.Message: // message#bce383d2 +// case *tg.Message: // message#85d6cbe2 // case *tg.MessageService: // messageService#2b085862 // default: panic(v) // } @@ -2199,7 +2199,7 @@ func DecodeMessage(buf *bin.Buffer) (MessageClass, error) { } return &v, nil case MessageTypeID: - // Decoding message#bce383d2. + // Decoding message#85d6cbe2. v := Message{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageClass: %w", err) diff --git a/tg/tl_message_media_gen.go b/tg/tl_message_media_gen.go index 79f2f095d3..3eeb826c9e 100644 --- a/tg/tl_message_media_gen.go +++ b/tg/tl_message_media_gen.go @@ -487,7 +487,7 @@ func (m *MessageMediaGeo) GetGeo() (value GeoPointClass) { return m.Geo } -// MessageMediaContact represents TL type `messageMediaContact#cbf24940`. +// MessageMediaContact represents TL type `messageMediaContact#70322949`. // Attached contact. // // See https://core.telegram.org/constructor/messageMediaContact for reference. @@ -501,11 +501,11 @@ type MessageMediaContact struct { // VCARD of contact Vcard string // User identifier or 0, if the user with the given phone number is not registered - UserID int + UserID int64 } // MessageMediaContactTypeID is TL type id of MessageMediaContact. -const MessageMediaContactTypeID = 0xcbf24940 +const MessageMediaContactTypeID = 0x70322949 // construct implements constructor of MessageMediaClass. func (m MessageMediaContact) construct() MessageMediaClass { return &m } @@ -558,7 +558,7 @@ func (m *MessageMediaContact) FillFrom(from interface { GetFirstName() (value string) GetLastName() (value string) GetVcard() (value string) - GetUserID() (value int) + GetUserID() (value int64) }) { m.PhoneNumber = from.GetPhoneNumber() m.FirstName = from.GetFirstName() @@ -617,7 +617,7 @@ func (m *MessageMediaContact) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (m *MessageMediaContact) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageMediaContact#cbf24940 as nil") + return fmt.Errorf("can't encode messageMediaContact#70322949 as nil") } b.PutID(MessageMediaContactTypeID) return m.EncodeBare(b) @@ -626,23 +626,23 @@ func (m *MessageMediaContact) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (m *MessageMediaContact) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageMediaContact#cbf24940 as nil") + return fmt.Errorf("can't encode messageMediaContact#70322949 as nil") } b.PutString(m.PhoneNumber) b.PutString(m.FirstName) b.PutString(m.LastName) b.PutString(m.Vcard) - b.PutInt(m.UserID) + b.PutLong(m.UserID) return nil } // Decode implements bin.Decoder. func (m *MessageMediaContact) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageMediaContact#cbf24940 to nil") + return fmt.Errorf("can't decode messageMediaContact#70322949 to nil") } if err := b.ConsumeID(MessageMediaContactTypeID); err != nil { - return fmt.Errorf("unable to decode messageMediaContact#cbf24940: %w", err) + return fmt.Errorf("unable to decode messageMediaContact#70322949: %w", err) } return m.DecodeBare(b) } @@ -650,40 +650,40 @@ func (m *MessageMediaContact) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (m *MessageMediaContact) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageMediaContact#cbf24940 to nil") + return fmt.Errorf("can't decode messageMediaContact#70322949 to nil") } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode messageMediaContact#cbf24940: field phone_number: %w", err) + return fmt.Errorf("unable to decode messageMediaContact#70322949: field phone_number: %w", err) } m.PhoneNumber = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode messageMediaContact#cbf24940: field first_name: %w", err) + return fmt.Errorf("unable to decode messageMediaContact#70322949: field first_name: %w", err) } m.FirstName = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode messageMediaContact#cbf24940: field last_name: %w", err) + return fmt.Errorf("unable to decode messageMediaContact#70322949: field last_name: %w", err) } m.LastName = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode messageMediaContact#cbf24940: field vcard: %w", err) + return fmt.Errorf("unable to decode messageMediaContact#70322949: field vcard: %w", err) } m.Vcard = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messageMediaContact#cbf24940: field user_id: %w", err) + return fmt.Errorf("unable to decode messageMediaContact#70322949: field user_id: %w", err) } m.UserID = value } @@ -711,7 +711,7 @@ func (m *MessageMediaContact) GetVcard() (value string) { } // GetUserID returns value of UserID field. -func (m *MessageMediaContact) GetUserID() (value int) { +func (m *MessageMediaContact) GetUserID() (value int64) { return m.UserID } @@ -2589,7 +2589,7 @@ func (m *MessageMediaDice) GetEmoticon() (value string) { // case *tg.MessageMediaEmpty: // messageMediaEmpty#3ded6320 // case *tg.MessageMediaPhoto: // messageMediaPhoto#695150d7 // case *tg.MessageMediaGeo: // messageMediaGeo#56e0d474 -// case *tg.MessageMediaContact: // messageMediaContact#cbf24940 +// case *tg.MessageMediaContact: // messageMediaContact#70322949 // case *tg.MessageMediaUnsupported: // messageMediaUnsupported#9f84f49e // case *tg.MessageMediaDocument: // messageMediaDocument#9cb070d7 // case *tg.MessageMediaWebPage: // messageMediaWebPage#a32dd600 @@ -2649,7 +2649,7 @@ func DecodeMessageMedia(buf *bin.Buffer) (MessageMediaClass, error) { } return &v, nil case MessageMediaContactTypeID: - // Decoding messageMediaContact#cbf24940. + // Decoding messageMediaContact#70322949. v := MessageMediaContact{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageMediaClass: %w", err) diff --git a/tg/tl_message_replies_gen.go b/tg/tl_message_replies_gen.go index d7778188ac..dee8125d73 100644 --- a/tg/tl_message_replies_gen.go +++ b/tg/tl_message_replies_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// MessageReplies represents TL type `messageReplies#4128faac`. +// MessageReplies represents TL type `messageReplies#83d60fc2`. // Info about the comment section of a channel post, or a simple message thread¹ // // Links: @@ -67,7 +67,7 @@ type MessageReplies struct { // 1) https://core.telegram.org/api/discussion // // Use SetChannelID and GetChannelID helpers. - ChannelID int + ChannelID int64 // ID of the latest message in this thread or comment section. // // Use SetMaxID and GetMaxID helpers. @@ -79,7 +79,7 @@ type MessageReplies struct { } // MessageRepliesTypeID is TL type id of MessageReplies. -const MessageRepliesTypeID = 0x4128faac +const MessageRepliesTypeID = 0x83d60fc2 // Ensuring interfaces in compile-time for MessageReplies. var ( @@ -136,7 +136,7 @@ func (m *MessageReplies) FillFrom(from interface { GetReplies() (value int) GetRepliesPts() (value int) GetRecentRepliers() (value []PeerClass, ok bool) - GetChannelID() (value int, ok bool) + GetChannelID() (value int64, ok bool) GetMaxID() (value int, ok bool) GetReadMaxID() (value int, ok bool) }) { @@ -224,7 +224,7 @@ func (m *MessageReplies) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (m *MessageReplies) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageReplies#4128faac as nil") + return fmt.Errorf("can't encode messageReplies#83d60fc2 as nil") } b.PutID(MessageRepliesTypeID) return m.EncodeBare(b) @@ -233,7 +233,7 @@ func (m *MessageReplies) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (m *MessageReplies) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageReplies#4128faac as nil") + return fmt.Errorf("can't encode messageReplies#83d60fc2 as nil") } if !(m.Comments == false) { m.Flags.Set(0) @@ -251,7 +251,7 @@ func (m *MessageReplies) EncodeBare(b *bin.Buffer) error { m.Flags.Set(3) } if err := m.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode messageReplies#4128faac: field flags: %w", err) + return fmt.Errorf("unable to encode messageReplies#83d60fc2: field flags: %w", err) } b.PutInt(m.Replies) b.PutInt(m.RepliesPts) @@ -259,15 +259,15 @@ func (m *MessageReplies) EncodeBare(b *bin.Buffer) error { b.PutVectorHeader(len(m.RecentRepliers)) for idx, v := range m.RecentRepliers { if v == nil { - return fmt.Errorf("unable to encode messageReplies#4128faac: field recent_repliers element with index %d is nil", idx) + return fmt.Errorf("unable to encode messageReplies#83d60fc2: field recent_repliers element with index %d is nil", idx) } if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode messageReplies#4128faac: field recent_repliers element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode messageReplies#83d60fc2: field recent_repliers element with index %d: %w", idx, err) } } } if m.Flags.Has(0) { - b.PutInt(m.ChannelID) + b.PutLong(m.ChannelID) } if m.Flags.Has(2) { b.PutInt(m.MaxID) @@ -281,10 +281,10 @@ func (m *MessageReplies) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (m *MessageReplies) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageReplies#4128faac to nil") + return fmt.Errorf("can't decode messageReplies#83d60fc2 to nil") } if err := b.ConsumeID(MessageRepliesTypeID); err != nil { - return fmt.Errorf("unable to decode messageReplies#4128faac: %w", err) + return fmt.Errorf("unable to decode messageReplies#83d60fc2: %w", err) } return m.DecodeBare(b) } @@ -292,32 +292,32 @@ func (m *MessageReplies) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (m *MessageReplies) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageReplies#4128faac to nil") + return fmt.Errorf("can't decode messageReplies#83d60fc2 to nil") } { if err := m.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode messageReplies#4128faac: field flags: %w", err) + return fmt.Errorf("unable to decode messageReplies#83d60fc2: field flags: %w", err) } } m.Comments = m.Flags.Has(0) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messageReplies#4128faac: field replies: %w", err) + return fmt.Errorf("unable to decode messageReplies#83d60fc2: field replies: %w", err) } m.Replies = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messageReplies#4128faac: field replies_pts: %w", err) + return fmt.Errorf("unable to decode messageReplies#83d60fc2: field replies_pts: %w", err) } m.RepliesPts = value } if m.Flags.Has(1) { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode messageReplies#4128faac: field recent_repliers: %w", err) + return fmt.Errorf("unable to decode messageReplies#83d60fc2: field recent_repliers: %w", err) } if headerLen > 0 { @@ -326,29 +326,29 @@ func (m *MessageReplies) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := DecodePeer(b) if err != nil { - return fmt.Errorf("unable to decode messageReplies#4128faac: field recent_repliers: %w", err) + return fmt.Errorf("unable to decode messageReplies#83d60fc2: field recent_repliers: %w", err) } m.RecentRepliers = append(m.RecentRepliers, value) } } if m.Flags.Has(0) { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messageReplies#4128faac: field channel_id: %w", err) + return fmt.Errorf("unable to decode messageReplies#83d60fc2: field channel_id: %w", err) } m.ChannelID = value } if m.Flags.Has(2) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messageReplies#4128faac: field max_id: %w", err) + return fmt.Errorf("unable to decode messageReplies#83d60fc2: field max_id: %w", err) } m.MaxID = value } if m.Flags.Has(3) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messageReplies#4128faac: field read_max_id: %w", err) + return fmt.Errorf("unable to decode messageReplies#83d60fc2: field read_max_id: %w", err) } m.ReadMaxID = value } @@ -397,14 +397,14 @@ func (m *MessageReplies) GetRecentRepliers() (value []PeerClass, ok bool) { } // SetChannelID sets value of ChannelID conditional field. -func (m *MessageReplies) SetChannelID(value int) { +func (m *MessageReplies) SetChannelID(value int64) { m.Flags.Set(0) m.ChannelID = value } // GetChannelID returns value of ChannelID conditional field and // boolean which is true if field was set. -func (m *MessageReplies) GetChannelID() (value int, ok bool) { +func (m *MessageReplies) GetChannelID() (value int64, ok bool) { if !m.Flags.Has(0) { return value, false } diff --git a/tg/tl_message_user_vote_gen.go b/tg/tl_message_user_vote_gen.go index 06c44102a8..15d10e6f44 100644 --- a/tg/tl_message_user_vote_gen.go +++ b/tg/tl_message_user_vote_gen.go @@ -29,13 +29,13 @@ var ( _ = tgerr.Error{} ) -// MessageUserVote represents TL type `messageUserVote#a28e5559`. +// MessageUserVote represents TL type `messageUserVote#34d247b4`. // How a user voted in a poll // // See https://core.telegram.org/constructor/messageUserVote for reference. type MessageUserVote struct { // User ID - UserID int + UserID int64 // The option chosen by the user Option []byte // When did the user cast the vote @@ -43,7 +43,7 @@ type MessageUserVote struct { } // MessageUserVoteTypeID is TL type id of MessageUserVote. -const MessageUserVoteTypeID = 0xa28e5559 +const MessageUserVoteTypeID = 0x34d247b4 // construct implements constructor of MessageUserVoteClass. func (m MessageUserVote) construct() MessageUserVoteClass { return &m } @@ -86,7 +86,7 @@ func (m *MessageUserVote) String() string { // FillFrom fills MessageUserVote from given interface. func (m *MessageUserVote) FillFrom(from interface { - GetUserID() (value int) + GetUserID() (value int64) GetOption() (value []byte) GetDate() (value int) }) { @@ -137,7 +137,7 @@ func (m *MessageUserVote) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (m *MessageUserVote) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageUserVote#a28e5559 as nil") + return fmt.Errorf("can't encode messageUserVote#34d247b4 as nil") } b.PutID(MessageUserVoteTypeID) return m.EncodeBare(b) @@ -146,9 +146,9 @@ func (m *MessageUserVote) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (m *MessageUserVote) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageUserVote#a28e5559 as nil") + return fmt.Errorf("can't encode messageUserVote#34d247b4 as nil") } - b.PutInt(m.UserID) + b.PutLong(m.UserID) b.PutBytes(m.Option) b.PutInt(m.Date) return nil @@ -157,10 +157,10 @@ func (m *MessageUserVote) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (m *MessageUserVote) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageUserVote#a28e5559 to nil") + return fmt.Errorf("can't decode messageUserVote#34d247b4 to nil") } if err := b.ConsumeID(MessageUserVoteTypeID); err != nil { - return fmt.Errorf("unable to decode messageUserVote#a28e5559: %w", err) + return fmt.Errorf("unable to decode messageUserVote#34d247b4: %w", err) } return m.DecodeBare(b) } @@ -168,26 +168,26 @@ func (m *MessageUserVote) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (m *MessageUserVote) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageUserVote#a28e5559 to nil") + return fmt.Errorf("can't decode messageUserVote#34d247b4 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messageUserVote#a28e5559: field user_id: %w", err) + return fmt.Errorf("unable to decode messageUserVote#34d247b4: field user_id: %w", err) } m.UserID = value } { value, err := b.Bytes() if err != nil { - return fmt.Errorf("unable to decode messageUserVote#a28e5559: field option: %w", err) + return fmt.Errorf("unable to decode messageUserVote#34d247b4: field option: %w", err) } m.Option = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messageUserVote#a28e5559: field date: %w", err) + return fmt.Errorf("unable to decode messageUserVote#34d247b4: field date: %w", err) } m.Date = value } @@ -195,7 +195,7 @@ func (m *MessageUserVote) DecodeBare(b *bin.Buffer) error { } // GetUserID returns value of UserID field. -func (m *MessageUserVote) GetUserID() (value int) { +func (m *MessageUserVote) GetUserID() (value int64) { return m.UserID } @@ -209,7 +209,7 @@ func (m *MessageUserVote) GetDate() (value int) { return m.Date } -// MessageUserVoteInputOption represents TL type `messageUserVoteInputOption#36377430`. +// MessageUserVoteInputOption represents TL type `messageUserVoteInputOption#3ca5b0ec`. // How a user voted in a poll (reduced constructor, returned if an option was provided to // messages.getPollVotes¹) // @@ -219,13 +219,13 @@ func (m *MessageUserVote) GetDate() (value int) { // See https://core.telegram.org/constructor/messageUserVoteInputOption for reference. type MessageUserVoteInputOption struct { // The user that voted for the queried option - UserID int + UserID int64 // When did the user cast the vote Date int } // MessageUserVoteInputOptionTypeID is TL type id of MessageUserVoteInputOption. -const MessageUserVoteInputOptionTypeID = 0x36377430 +const MessageUserVoteInputOptionTypeID = 0x3ca5b0ec // construct implements constructor of MessageUserVoteClass. func (m MessageUserVoteInputOption) construct() MessageUserVoteClass { return &m } @@ -265,7 +265,7 @@ func (m *MessageUserVoteInputOption) String() string { // FillFrom fills MessageUserVoteInputOption from given interface. func (m *MessageUserVoteInputOption) FillFrom(from interface { - GetUserID() (value int) + GetUserID() (value int64) GetDate() (value int) }) { m.UserID = from.GetUserID() @@ -310,7 +310,7 @@ func (m *MessageUserVoteInputOption) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (m *MessageUserVoteInputOption) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageUserVoteInputOption#36377430 as nil") + return fmt.Errorf("can't encode messageUserVoteInputOption#3ca5b0ec as nil") } b.PutID(MessageUserVoteInputOptionTypeID) return m.EncodeBare(b) @@ -319,9 +319,9 @@ func (m *MessageUserVoteInputOption) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (m *MessageUserVoteInputOption) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageUserVoteInputOption#36377430 as nil") + return fmt.Errorf("can't encode messageUserVoteInputOption#3ca5b0ec as nil") } - b.PutInt(m.UserID) + b.PutLong(m.UserID) b.PutInt(m.Date) return nil } @@ -329,10 +329,10 @@ func (m *MessageUserVoteInputOption) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (m *MessageUserVoteInputOption) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageUserVoteInputOption#36377430 to nil") + return fmt.Errorf("can't decode messageUserVoteInputOption#3ca5b0ec to nil") } if err := b.ConsumeID(MessageUserVoteInputOptionTypeID); err != nil { - return fmt.Errorf("unable to decode messageUserVoteInputOption#36377430: %w", err) + return fmt.Errorf("unable to decode messageUserVoteInputOption#3ca5b0ec: %w", err) } return m.DecodeBare(b) } @@ -340,19 +340,19 @@ func (m *MessageUserVoteInputOption) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (m *MessageUserVoteInputOption) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageUserVoteInputOption#36377430 to nil") + return fmt.Errorf("can't decode messageUserVoteInputOption#3ca5b0ec to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messageUserVoteInputOption#36377430: field user_id: %w", err) + return fmt.Errorf("unable to decode messageUserVoteInputOption#3ca5b0ec: field user_id: %w", err) } m.UserID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messageUserVoteInputOption#36377430: field date: %w", err) + return fmt.Errorf("unable to decode messageUserVoteInputOption#3ca5b0ec: field date: %w", err) } m.Date = value } @@ -360,7 +360,7 @@ func (m *MessageUserVoteInputOption) DecodeBare(b *bin.Buffer) error { } // GetUserID returns value of UserID field. -func (m *MessageUserVoteInputOption) GetUserID() (value int) { +func (m *MessageUserVoteInputOption) GetUserID() (value int64) { return m.UserID } @@ -369,13 +369,13 @@ func (m *MessageUserVoteInputOption) GetDate() (value int) { return m.Date } -// MessageUserVoteMultiple represents TL type `messageUserVoteMultiple#e8fe0de`. +// MessageUserVoteMultiple represents TL type `messageUserVoteMultiple#8a65e557`. // How a user voted in a multiple-choice poll // // See https://core.telegram.org/constructor/messageUserVoteMultiple for reference. type MessageUserVoteMultiple struct { // User ID - UserID int + UserID int64 // Options chosen by the user Options [][]byte // When did the user cast their votes @@ -383,7 +383,7 @@ type MessageUserVoteMultiple struct { } // MessageUserVoteMultipleTypeID is TL type id of MessageUserVoteMultiple. -const MessageUserVoteMultipleTypeID = 0xe8fe0de +const MessageUserVoteMultipleTypeID = 0x8a65e557 // construct implements constructor of MessageUserVoteClass. func (m MessageUserVoteMultiple) construct() MessageUserVoteClass { return &m } @@ -426,7 +426,7 @@ func (m *MessageUserVoteMultiple) String() string { // FillFrom fills MessageUserVoteMultiple from given interface. func (m *MessageUserVoteMultiple) FillFrom(from interface { - GetUserID() (value int) + GetUserID() (value int64) GetOptions() (value [][]byte) GetDate() (value int) }) { @@ -477,7 +477,7 @@ func (m *MessageUserVoteMultiple) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (m *MessageUserVoteMultiple) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageUserVoteMultiple#e8fe0de as nil") + return fmt.Errorf("can't encode messageUserVoteMultiple#8a65e557 as nil") } b.PutID(MessageUserVoteMultipleTypeID) return m.EncodeBare(b) @@ -486,9 +486,9 @@ func (m *MessageUserVoteMultiple) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (m *MessageUserVoteMultiple) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageUserVoteMultiple#e8fe0de as nil") + return fmt.Errorf("can't encode messageUserVoteMultiple#8a65e557 as nil") } - b.PutInt(m.UserID) + b.PutLong(m.UserID) b.PutVectorHeader(len(m.Options)) for _, v := range m.Options { b.PutBytes(v) @@ -500,10 +500,10 @@ func (m *MessageUserVoteMultiple) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (m *MessageUserVoteMultiple) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageUserVoteMultiple#e8fe0de to nil") + return fmt.Errorf("can't decode messageUserVoteMultiple#8a65e557 to nil") } if err := b.ConsumeID(MessageUserVoteMultipleTypeID); err != nil { - return fmt.Errorf("unable to decode messageUserVoteMultiple#e8fe0de: %w", err) + return fmt.Errorf("unable to decode messageUserVoteMultiple#8a65e557: %w", err) } return m.DecodeBare(b) } @@ -511,19 +511,19 @@ func (m *MessageUserVoteMultiple) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (m *MessageUserVoteMultiple) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageUserVoteMultiple#e8fe0de to nil") + return fmt.Errorf("can't decode messageUserVoteMultiple#8a65e557 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messageUserVoteMultiple#e8fe0de: field user_id: %w", err) + return fmt.Errorf("unable to decode messageUserVoteMultiple#8a65e557: field user_id: %w", err) } m.UserID = value } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode messageUserVoteMultiple#e8fe0de: field options: %w", err) + return fmt.Errorf("unable to decode messageUserVoteMultiple#8a65e557: field options: %w", err) } if headerLen > 0 { @@ -532,7 +532,7 @@ func (m *MessageUserVoteMultiple) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := b.Bytes() if err != nil { - return fmt.Errorf("unable to decode messageUserVoteMultiple#e8fe0de: field options: %w", err) + return fmt.Errorf("unable to decode messageUserVoteMultiple#8a65e557: field options: %w", err) } m.Options = append(m.Options, value) } @@ -540,7 +540,7 @@ func (m *MessageUserVoteMultiple) DecodeBare(b *bin.Buffer) error { { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messageUserVoteMultiple#e8fe0de: field date: %w", err) + return fmt.Errorf("unable to decode messageUserVoteMultiple#8a65e557: field date: %w", err) } m.Date = value } @@ -548,7 +548,7 @@ func (m *MessageUserVoteMultiple) DecodeBare(b *bin.Buffer) error { } // GetUserID returns value of UserID field. -func (m *MessageUserVoteMultiple) GetUserID() (value int) { +func (m *MessageUserVoteMultiple) GetUserID() (value int64) { return m.UserID } @@ -572,9 +572,9 @@ func (m *MessageUserVoteMultiple) GetDate() (value int) { // panic(err) // } // switch v := g.(type) { -// case *tg.MessageUserVote: // messageUserVote#a28e5559 -// case *tg.MessageUserVoteInputOption: // messageUserVoteInputOption#36377430 -// case *tg.MessageUserVoteMultiple: // messageUserVoteMultiple#e8fe0de +// case *tg.MessageUserVote: // messageUserVote#34d247b4 +// case *tg.MessageUserVoteInputOption: // messageUserVoteInputOption#3ca5b0ec +// case *tg.MessageUserVoteMultiple: // messageUserVoteMultiple#8a65e557 // default: panic(v) // } type MessageUserVoteClass interface { @@ -596,7 +596,7 @@ type MessageUserVoteClass interface { Zero() bool // User ID - GetUserID() (value int) + GetUserID() (value int64) // When did the user cast the vote GetDate() (value int) @@ -610,21 +610,21 @@ func DecodeMessageUserVote(buf *bin.Buffer) (MessageUserVoteClass, error) { } switch id { case MessageUserVoteTypeID: - // Decoding messageUserVote#a28e5559. + // Decoding messageUserVote#34d247b4. v := MessageUserVote{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageUserVoteClass: %w", err) } return &v, nil case MessageUserVoteInputOptionTypeID: - // Decoding messageUserVoteInputOption#36377430. + // Decoding messageUserVoteInputOption#3ca5b0ec. v := MessageUserVoteInputOption{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageUserVoteClass: %w", err) } return &v, nil case MessageUserVoteMultipleTypeID: - // Decoding messageUserVoteMultiple#e8fe0de. + // Decoding messageUserVoteMultiple#8a65e557. v := MessageUserVoteMultiple{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageUserVoteClass: %w", err) diff --git a/tg/tl_messages_add_chat_user_gen.go b/tg/tl_messages_add_chat_user_gen.go index 6527da4b86..52cd3ec49b 100644 --- a/tg/tl_messages_add_chat_user_gen.go +++ b/tg/tl_messages_add_chat_user_gen.go @@ -29,13 +29,13 @@ var ( _ = tgerr.Error{} ) -// MessagesAddChatUserRequest represents TL type `messages.addChatUser#f9a0aa09`. +// MessagesAddChatUserRequest represents TL type `messages.addChatUser#f24753e3`. // Adds a user to a chat and sends a service message on it. // // See https://core.telegram.org/method/messages.addChatUser for reference. type MessagesAddChatUserRequest struct { // Chat ID - ChatID int + ChatID int64 // User ID to be added UserID InputUserClass // Number of last messages to be forwarded @@ -43,7 +43,7 @@ type MessagesAddChatUserRequest struct { } // MessagesAddChatUserRequestTypeID is TL type id of MessagesAddChatUserRequest. -const MessagesAddChatUserRequestTypeID = 0xf9a0aa09 +const MessagesAddChatUserRequestTypeID = 0xf24753e3 // Ensuring interfaces in compile-time for MessagesAddChatUserRequest. var ( @@ -81,7 +81,7 @@ func (a *MessagesAddChatUserRequest) String() string { // FillFrom fills MessagesAddChatUserRequest from given interface. func (a *MessagesAddChatUserRequest) FillFrom(from interface { - GetChatID() (value int) + GetChatID() (value int64) GetUserID() (value InputUserClass) GetFwdLimit() (value int) }) { @@ -132,7 +132,7 @@ func (a *MessagesAddChatUserRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (a *MessagesAddChatUserRequest) Encode(b *bin.Buffer) error { if a == nil { - return fmt.Errorf("can't encode messages.addChatUser#f9a0aa09 as nil") + return fmt.Errorf("can't encode messages.addChatUser#f24753e3 as nil") } b.PutID(MessagesAddChatUserRequestTypeID) return a.EncodeBare(b) @@ -141,14 +141,14 @@ func (a *MessagesAddChatUserRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (a *MessagesAddChatUserRequest) EncodeBare(b *bin.Buffer) error { if a == nil { - return fmt.Errorf("can't encode messages.addChatUser#f9a0aa09 as nil") + return fmt.Errorf("can't encode messages.addChatUser#f24753e3 as nil") } - b.PutInt(a.ChatID) + b.PutLong(a.ChatID) if a.UserID == nil { - return fmt.Errorf("unable to encode messages.addChatUser#f9a0aa09: field user_id is nil") + return fmt.Errorf("unable to encode messages.addChatUser#f24753e3: field user_id is nil") } if err := a.UserID.Encode(b); err != nil { - return fmt.Errorf("unable to encode messages.addChatUser#f9a0aa09: field user_id: %w", err) + return fmt.Errorf("unable to encode messages.addChatUser#f24753e3: field user_id: %w", err) } b.PutInt(a.FwdLimit) return nil @@ -157,10 +157,10 @@ func (a *MessagesAddChatUserRequest) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (a *MessagesAddChatUserRequest) Decode(b *bin.Buffer) error { if a == nil { - return fmt.Errorf("can't decode messages.addChatUser#f9a0aa09 to nil") + return fmt.Errorf("can't decode messages.addChatUser#f24753e3 to nil") } if err := b.ConsumeID(MessagesAddChatUserRequestTypeID); err != nil { - return fmt.Errorf("unable to decode messages.addChatUser#f9a0aa09: %w", err) + return fmt.Errorf("unable to decode messages.addChatUser#f24753e3: %w", err) } return a.DecodeBare(b) } @@ -168,26 +168,26 @@ func (a *MessagesAddChatUserRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (a *MessagesAddChatUserRequest) DecodeBare(b *bin.Buffer) error { if a == nil { - return fmt.Errorf("can't decode messages.addChatUser#f9a0aa09 to nil") + return fmt.Errorf("can't decode messages.addChatUser#f24753e3 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messages.addChatUser#f9a0aa09: field chat_id: %w", err) + return fmt.Errorf("unable to decode messages.addChatUser#f24753e3: field chat_id: %w", err) } a.ChatID = value } { value, err := DecodeInputUser(b) if err != nil { - return fmt.Errorf("unable to decode messages.addChatUser#f9a0aa09: field user_id: %w", err) + return fmt.Errorf("unable to decode messages.addChatUser#f24753e3: field user_id: %w", err) } a.UserID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messages.addChatUser#f9a0aa09: field fwd_limit: %w", err) + return fmt.Errorf("unable to decode messages.addChatUser#f24753e3: field fwd_limit: %w", err) } a.FwdLimit = value } @@ -195,7 +195,7 @@ func (a *MessagesAddChatUserRequest) DecodeBare(b *bin.Buffer) error { } // GetChatID returns value of ChatID field. -func (a *MessagesAddChatUserRequest) GetChatID() (value int) { +func (a *MessagesAddChatUserRequest) GetChatID() (value int64) { return a.ChatID } @@ -209,7 +209,7 @@ func (a *MessagesAddChatUserRequest) GetFwdLimit() (value int) { return a.FwdLimit } -// MessagesAddChatUser invokes method messages.addChatUser#f9a0aa09 returning error if any. +// MessagesAddChatUser invokes method messages.addChatUser#f24753e3 returning error if any. // Adds a user to a chat and sends a service message on it. // // Possible errors: diff --git a/tg/tl_messages_all_stickers_gen.go b/tg/tl_messages_all_stickers_gen.go index 7d449198f4..b54fd82ccd 100644 --- a/tg/tl_messages_all_stickers_gen.go +++ b/tg/tl_messages_all_stickers_gen.go @@ -131,7 +131,7 @@ func (a *MessagesAllStickersNotModified) DecodeBare(b *bin.Buffer) error { return nil } -// MessagesAllStickers represents TL type `messages.allStickers#edfd405f`. +// MessagesAllStickers represents TL type `messages.allStickers#cdbbcebb`. // Info about all installed stickers // // See https://core.telegram.org/constructor/messages.allStickers for reference. @@ -140,13 +140,13 @@ type MessagesAllStickers struct { // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation - Hash int + Hash int64 // All stickersets Sets []StickerSet } // MessagesAllStickersTypeID is TL type id of MessagesAllStickers. -const MessagesAllStickersTypeID = 0xedfd405f +const MessagesAllStickersTypeID = 0xcdbbcebb // construct implements constructor of MessagesAllStickersClass. func (a MessagesAllStickers) construct() MessagesAllStickersClass { return &a } @@ -186,7 +186,7 @@ func (a *MessagesAllStickers) String() string { // FillFrom fills MessagesAllStickers from given interface. func (a *MessagesAllStickers) FillFrom(from interface { - GetHash() (value int) + GetHash() (value int64) GetSets() (value []StickerSet) }) { a.Hash = from.GetHash() @@ -231,7 +231,7 @@ func (a *MessagesAllStickers) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (a *MessagesAllStickers) Encode(b *bin.Buffer) error { if a == nil { - return fmt.Errorf("can't encode messages.allStickers#edfd405f as nil") + return fmt.Errorf("can't encode messages.allStickers#cdbbcebb as nil") } b.PutID(MessagesAllStickersTypeID) return a.EncodeBare(b) @@ -240,13 +240,13 @@ func (a *MessagesAllStickers) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (a *MessagesAllStickers) EncodeBare(b *bin.Buffer) error { if a == nil { - return fmt.Errorf("can't encode messages.allStickers#edfd405f as nil") + return fmt.Errorf("can't encode messages.allStickers#cdbbcebb as nil") } - b.PutInt(a.Hash) + b.PutLong(a.Hash) b.PutVectorHeader(len(a.Sets)) for idx, v := range a.Sets { if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode messages.allStickers#edfd405f: field sets element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode messages.allStickers#cdbbcebb: field sets element with index %d: %w", idx, err) } } return nil @@ -255,10 +255,10 @@ func (a *MessagesAllStickers) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (a *MessagesAllStickers) Decode(b *bin.Buffer) error { if a == nil { - return fmt.Errorf("can't decode messages.allStickers#edfd405f to nil") + return fmt.Errorf("can't decode messages.allStickers#cdbbcebb to nil") } if err := b.ConsumeID(MessagesAllStickersTypeID); err != nil { - return fmt.Errorf("unable to decode messages.allStickers#edfd405f: %w", err) + return fmt.Errorf("unable to decode messages.allStickers#cdbbcebb: %w", err) } return a.DecodeBare(b) } @@ -266,19 +266,19 @@ func (a *MessagesAllStickers) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (a *MessagesAllStickers) DecodeBare(b *bin.Buffer) error { if a == nil { - return fmt.Errorf("can't decode messages.allStickers#edfd405f to nil") + return fmt.Errorf("can't decode messages.allStickers#cdbbcebb to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messages.allStickers#edfd405f: field hash: %w", err) + return fmt.Errorf("unable to decode messages.allStickers#cdbbcebb: field hash: %w", err) } a.Hash = value } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode messages.allStickers#edfd405f: field sets: %w", err) + return fmt.Errorf("unable to decode messages.allStickers#cdbbcebb: field sets: %w", err) } if headerLen > 0 { @@ -287,7 +287,7 @@ func (a *MessagesAllStickers) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { var value StickerSet if err := value.Decode(b); err != nil { - return fmt.Errorf("unable to decode messages.allStickers#edfd405f: field sets: %w", err) + return fmt.Errorf("unable to decode messages.allStickers#cdbbcebb: field sets: %w", err) } a.Sets = append(a.Sets, value) } @@ -296,7 +296,7 @@ func (a *MessagesAllStickers) DecodeBare(b *bin.Buffer) error { } // GetHash returns value of Hash field. -func (a *MessagesAllStickers) GetHash() (value int) { +func (a *MessagesAllStickers) GetHash() (value int64) { return a.Hash } @@ -316,7 +316,7 @@ func (a *MessagesAllStickers) GetSets() (value []StickerSet) { // } // switch v := g.(type) { // case *tg.MessagesAllStickersNotModified: // messages.allStickersNotModified#e86602c3 -// case *tg.MessagesAllStickers: // messages.allStickers#edfd405f +// case *tg.MessagesAllStickers: // messages.allStickers#cdbbcebb // default: panic(v) // } type MessagesAllStickersClass interface { @@ -366,7 +366,7 @@ func DecodeMessagesAllStickers(buf *bin.Buffer) (MessagesAllStickersClass, error } return &v, nil case MessagesAllStickersTypeID: - // Decoding messages.allStickers#edfd405f. + // Decoding messages.allStickers#cdbbcebb. v := MessagesAllStickers{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode MessagesAllStickersClass: %w", err) diff --git a/tg/tl_messages_delete_chat_gen.go b/tg/tl_messages_delete_chat_gen.go index 7234cfa026..de277a83a8 100644 --- a/tg/tl_messages_delete_chat_gen.go +++ b/tg/tl_messages_delete_chat_gen.go @@ -29,16 +29,16 @@ var ( _ = tgerr.Error{} ) -// MessagesDeleteChatRequest represents TL type `messages.deleteChat#83247d11`. +// MessagesDeleteChatRequest represents TL type `messages.deleteChat#5bd0ee50`. // // See https://core.telegram.org/method/messages.deleteChat for reference. type MessagesDeleteChatRequest struct { // ChatID field of MessagesDeleteChatRequest. - ChatID int + ChatID int64 } // MessagesDeleteChatRequestTypeID is TL type id of MessagesDeleteChatRequest. -const MessagesDeleteChatRequestTypeID = 0x83247d11 +const MessagesDeleteChatRequestTypeID = 0x5bd0ee50 // Ensuring interfaces in compile-time for MessagesDeleteChatRequest. var ( @@ -70,7 +70,7 @@ func (d *MessagesDeleteChatRequest) String() string { // FillFrom fills MessagesDeleteChatRequest from given interface. func (d *MessagesDeleteChatRequest) FillFrom(from interface { - GetChatID() (value int) + GetChatID() (value int64) }) { d.ChatID = from.GetChatID() } @@ -109,7 +109,7 @@ func (d *MessagesDeleteChatRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (d *MessagesDeleteChatRequest) Encode(b *bin.Buffer) error { if d == nil { - return fmt.Errorf("can't encode messages.deleteChat#83247d11 as nil") + return fmt.Errorf("can't encode messages.deleteChat#5bd0ee50 as nil") } b.PutID(MessagesDeleteChatRequestTypeID) return d.EncodeBare(b) @@ -118,19 +118,19 @@ func (d *MessagesDeleteChatRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (d *MessagesDeleteChatRequest) EncodeBare(b *bin.Buffer) error { if d == nil { - return fmt.Errorf("can't encode messages.deleteChat#83247d11 as nil") + return fmt.Errorf("can't encode messages.deleteChat#5bd0ee50 as nil") } - b.PutInt(d.ChatID) + b.PutLong(d.ChatID) return nil } // Decode implements bin.Decoder. func (d *MessagesDeleteChatRequest) Decode(b *bin.Buffer) error { if d == nil { - return fmt.Errorf("can't decode messages.deleteChat#83247d11 to nil") + return fmt.Errorf("can't decode messages.deleteChat#5bd0ee50 to nil") } if err := b.ConsumeID(MessagesDeleteChatRequestTypeID); err != nil { - return fmt.Errorf("unable to decode messages.deleteChat#83247d11: %w", err) + return fmt.Errorf("unable to decode messages.deleteChat#5bd0ee50: %w", err) } return d.DecodeBare(b) } @@ -138,12 +138,12 @@ func (d *MessagesDeleteChatRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (d *MessagesDeleteChatRequest) DecodeBare(b *bin.Buffer) error { if d == nil { - return fmt.Errorf("can't decode messages.deleteChat#83247d11 to nil") + return fmt.Errorf("can't decode messages.deleteChat#5bd0ee50 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messages.deleteChat#83247d11: field chat_id: %w", err) + return fmt.Errorf("unable to decode messages.deleteChat#5bd0ee50: field chat_id: %w", err) } d.ChatID = value } @@ -151,14 +151,14 @@ func (d *MessagesDeleteChatRequest) DecodeBare(b *bin.Buffer) error { } // GetChatID returns value of ChatID field. -func (d *MessagesDeleteChatRequest) GetChatID() (value int) { +func (d *MessagesDeleteChatRequest) GetChatID() (value int64) { return d.ChatID } -// MessagesDeleteChat invokes method messages.deleteChat#83247d11 returning error if any. +// MessagesDeleteChat invokes method messages.deleteChat#5bd0ee50 returning error if any. // // See https://core.telegram.org/method/messages.deleteChat for reference. -func (c *Client) MessagesDeleteChat(ctx context.Context, chatid int) (bool, error) { +func (c *Client) MessagesDeleteChat(ctx context.Context, chatid int64) (bool, error) { var result BoolBox request := &MessagesDeleteChatRequest{ diff --git a/tg/tl_messages_delete_chat_user_gen.go b/tg/tl_messages_delete_chat_user_gen.go index ba9e9d9ec8..a42246ce8d 100644 --- a/tg/tl_messages_delete_chat_user_gen.go +++ b/tg/tl_messages_delete_chat_user_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// MessagesDeleteChatUserRequest represents TL type `messages.deleteChatUser#c534459a`. +// MessagesDeleteChatUserRequest represents TL type `messages.deleteChatUser#a2185cab`. // Deletes a user from a chat and sends a service message on it. // // See https://core.telegram.org/method/messages.deleteChatUser for reference. @@ -39,13 +39,13 @@ type MessagesDeleteChatUserRequest struct { // RevokeHistory field of MessagesDeleteChatUserRequest. RevokeHistory bool // Chat ID - ChatID int + ChatID int64 // User ID to be deleted UserID InputUserClass } // MessagesDeleteChatUserRequestTypeID is TL type id of MessagesDeleteChatUserRequest. -const MessagesDeleteChatUserRequestTypeID = 0xc534459a +const MessagesDeleteChatUserRequestTypeID = 0xa2185cab // Ensuring interfaces in compile-time for MessagesDeleteChatUserRequest. var ( @@ -87,7 +87,7 @@ func (d *MessagesDeleteChatUserRequest) String() string { // FillFrom fills MessagesDeleteChatUserRequest from given interface. func (d *MessagesDeleteChatUserRequest) FillFrom(from interface { GetRevokeHistory() (value bool) - GetChatID() (value int) + GetChatID() (value int64) GetUserID() (value InputUserClass) }) { d.RevokeHistory = from.GetRevokeHistory() @@ -138,7 +138,7 @@ func (d *MessagesDeleteChatUserRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (d *MessagesDeleteChatUserRequest) Encode(b *bin.Buffer) error { if d == nil { - return fmt.Errorf("can't encode messages.deleteChatUser#c534459a as nil") + return fmt.Errorf("can't encode messages.deleteChatUser#a2185cab as nil") } b.PutID(MessagesDeleteChatUserRequestTypeID) return d.EncodeBare(b) @@ -147,20 +147,20 @@ func (d *MessagesDeleteChatUserRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (d *MessagesDeleteChatUserRequest) EncodeBare(b *bin.Buffer) error { if d == nil { - return fmt.Errorf("can't encode messages.deleteChatUser#c534459a as nil") + return fmt.Errorf("can't encode messages.deleteChatUser#a2185cab as nil") } if !(d.RevokeHistory == false) { d.Flags.Set(0) } if err := d.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode messages.deleteChatUser#c534459a: field flags: %w", err) + return fmt.Errorf("unable to encode messages.deleteChatUser#a2185cab: field flags: %w", err) } - b.PutInt(d.ChatID) + b.PutLong(d.ChatID) if d.UserID == nil { - return fmt.Errorf("unable to encode messages.deleteChatUser#c534459a: field user_id is nil") + return fmt.Errorf("unable to encode messages.deleteChatUser#a2185cab: field user_id is nil") } if err := d.UserID.Encode(b); err != nil { - return fmt.Errorf("unable to encode messages.deleteChatUser#c534459a: field user_id: %w", err) + return fmt.Errorf("unable to encode messages.deleteChatUser#a2185cab: field user_id: %w", err) } return nil } @@ -168,10 +168,10 @@ func (d *MessagesDeleteChatUserRequest) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (d *MessagesDeleteChatUserRequest) Decode(b *bin.Buffer) error { if d == nil { - return fmt.Errorf("can't decode messages.deleteChatUser#c534459a to nil") + return fmt.Errorf("can't decode messages.deleteChatUser#a2185cab to nil") } if err := b.ConsumeID(MessagesDeleteChatUserRequestTypeID); err != nil { - return fmt.Errorf("unable to decode messages.deleteChatUser#c534459a: %w", err) + return fmt.Errorf("unable to decode messages.deleteChatUser#a2185cab: %w", err) } return d.DecodeBare(b) } @@ -179,25 +179,25 @@ func (d *MessagesDeleteChatUserRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (d *MessagesDeleteChatUserRequest) DecodeBare(b *bin.Buffer) error { if d == nil { - return fmt.Errorf("can't decode messages.deleteChatUser#c534459a to nil") + return fmt.Errorf("can't decode messages.deleteChatUser#a2185cab to nil") } { if err := d.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode messages.deleteChatUser#c534459a: field flags: %w", err) + return fmt.Errorf("unable to decode messages.deleteChatUser#a2185cab: field flags: %w", err) } } d.RevokeHistory = d.Flags.Has(0) { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messages.deleteChatUser#c534459a: field chat_id: %w", err) + return fmt.Errorf("unable to decode messages.deleteChatUser#a2185cab: field chat_id: %w", err) } d.ChatID = value } { value, err := DecodeInputUser(b) if err != nil { - return fmt.Errorf("unable to decode messages.deleteChatUser#c534459a: field user_id: %w", err) + return fmt.Errorf("unable to decode messages.deleteChatUser#a2185cab: field user_id: %w", err) } d.UserID = value } @@ -221,7 +221,7 @@ func (d *MessagesDeleteChatUserRequest) GetRevokeHistory() (value bool) { } // GetChatID returns value of ChatID field. -func (d *MessagesDeleteChatUserRequest) GetChatID() (value int) { +func (d *MessagesDeleteChatUserRequest) GetChatID() (value int64) { return d.ChatID } @@ -230,7 +230,7 @@ func (d *MessagesDeleteChatUserRequest) GetUserID() (value InputUserClass) { return d.UserID } -// MessagesDeleteChatUser invokes method messages.deleteChatUser#c534459a returning error if any. +// MessagesDeleteChatUser invokes method messages.deleteChatUser#a2185cab returning error if any. // Deletes a user from a chat and sends a service message on it. // // Possible errors: diff --git a/tg/tl_messages_edit_chat_admin_gen.go b/tg/tl_messages_edit_chat_admin_gen.go index 2017c81b40..3d13152280 100644 --- a/tg/tl_messages_edit_chat_admin_gen.go +++ b/tg/tl_messages_edit_chat_admin_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// MessagesEditChatAdminRequest represents TL type `messages.editChatAdmin#a9e69f2e`. +// MessagesEditChatAdminRequest represents TL type `messages.editChatAdmin#a85bd1c2`. // Make a user admin in a legacy group¹. // // Links: @@ -38,7 +38,7 @@ var ( // See https://core.telegram.org/method/messages.editChatAdmin for reference. type MessagesEditChatAdminRequest struct { // The ID of the group - ChatID int + ChatID int64 // The user to make admin UserID InputUserClass // Whether to make him admin @@ -46,7 +46,7 @@ type MessagesEditChatAdminRequest struct { } // MessagesEditChatAdminRequestTypeID is TL type id of MessagesEditChatAdminRequest. -const MessagesEditChatAdminRequestTypeID = 0xa9e69f2e +const MessagesEditChatAdminRequestTypeID = 0xa85bd1c2 // Ensuring interfaces in compile-time for MessagesEditChatAdminRequest. var ( @@ -84,7 +84,7 @@ func (e *MessagesEditChatAdminRequest) String() string { // FillFrom fills MessagesEditChatAdminRequest from given interface. func (e *MessagesEditChatAdminRequest) FillFrom(from interface { - GetChatID() (value int) + GetChatID() (value int64) GetUserID() (value InputUserClass) GetIsAdmin() (value bool) }) { @@ -135,7 +135,7 @@ func (e *MessagesEditChatAdminRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (e *MessagesEditChatAdminRequest) Encode(b *bin.Buffer) error { if e == nil { - return fmt.Errorf("can't encode messages.editChatAdmin#a9e69f2e as nil") + return fmt.Errorf("can't encode messages.editChatAdmin#a85bd1c2 as nil") } b.PutID(MessagesEditChatAdminRequestTypeID) return e.EncodeBare(b) @@ -144,14 +144,14 @@ func (e *MessagesEditChatAdminRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (e *MessagesEditChatAdminRequest) EncodeBare(b *bin.Buffer) error { if e == nil { - return fmt.Errorf("can't encode messages.editChatAdmin#a9e69f2e as nil") + return fmt.Errorf("can't encode messages.editChatAdmin#a85bd1c2 as nil") } - b.PutInt(e.ChatID) + b.PutLong(e.ChatID) if e.UserID == nil { - return fmt.Errorf("unable to encode messages.editChatAdmin#a9e69f2e: field user_id is nil") + return fmt.Errorf("unable to encode messages.editChatAdmin#a85bd1c2: field user_id is nil") } if err := e.UserID.Encode(b); err != nil { - return fmt.Errorf("unable to encode messages.editChatAdmin#a9e69f2e: field user_id: %w", err) + return fmt.Errorf("unable to encode messages.editChatAdmin#a85bd1c2: field user_id: %w", err) } b.PutBool(e.IsAdmin) return nil @@ -160,10 +160,10 @@ func (e *MessagesEditChatAdminRequest) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (e *MessagesEditChatAdminRequest) Decode(b *bin.Buffer) error { if e == nil { - return fmt.Errorf("can't decode messages.editChatAdmin#a9e69f2e to nil") + return fmt.Errorf("can't decode messages.editChatAdmin#a85bd1c2 to nil") } if err := b.ConsumeID(MessagesEditChatAdminRequestTypeID); err != nil { - return fmt.Errorf("unable to decode messages.editChatAdmin#a9e69f2e: %w", err) + return fmt.Errorf("unable to decode messages.editChatAdmin#a85bd1c2: %w", err) } return e.DecodeBare(b) } @@ -171,26 +171,26 @@ func (e *MessagesEditChatAdminRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (e *MessagesEditChatAdminRequest) DecodeBare(b *bin.Buffer) error { if e == nil { - return fmt.Errorf("can't decode messages.editChatAdmin#a9e69f2e to nil") + return fmt.Errorf("can't decode messages.editChatAdmin#a85bd1c2 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messages.editChatAdmin#a9e69f2e: field chat_id: %w", err) + return fmt.Errorf("unable to decode messages.editChatAdmin#a85bd1c2: field chat_id: %w", err) } e.ChatID = value } { value, err := DecodeInputUser(b) if err != nil { - return fmt.Errorf("unable to decode messages.editChatAdmin#a9e69f2e: field user_id: %w", err) + return fmt.Errorf("unable to decode messages.editChatAdmin#a85bd1c2: field user_id: %w", err) } e.UserID = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode messages.editChatAdmin#a9e69f2e: field is_admin: %w", err) + return fmt.Errorf("unable to decode messages.editChatAdmin#a85bd1c2: field is_admin: %w", err) } e.IsAdmin = value } @@ -198,7 +198,7 @@ func (e *MessagesEditChatAdminRequest) DecodeBare(b *bin.Buffer) error { } // GetChatID returns value of ChatID field. -func (e *MessagesEditChatAdminRequest) GetChatID() (value int) { +func (e *MessagesEditChatAdminRequest) GetChatID() (value int64) { return e.ChatID } @@ -212,7 +212,7 @@ func (e *MessagesEditChatAdminRequest) GetIsAdmin() (value bool) { return e.IsAdmin } -// MessagesEditChatAdmin invokes method messages.editChatAdmin#a9e69f2e returning error if any. +// MessagesEditChatAdmin invokes method messages.editChatAdmin#a85bd1c2 returning error if any. // Make a user admin in a legacy group¹. // // Links: diff --git a/tg/tl_messages_edit_chat_photo_gen.go b/tg/tl_messages_edit_chat_photo_gen.go index e543005f1d..38500ebc6f 100644 --- a/tg/tl_messages_edit_chat_photo_gen.go +++ b/tg/tl_messages_edit_chat_photo_gen.go @@ -29,19 +29,19 @@ var ( _ = tgerr.Error{} ) -// MessagesEditChatPhotoRequest represents TL type `messages.editChatPhoto#ca4c79d8`. +// MessagesEditChatPhotoRequest represents TL type `messages.editChatPhoto#35ddd674`. // Changes chat photo and sends a service message on it // // See https://core.telegram.org/method/messages.editChatPhoto for reference. type MessagesEditChatPhotoRequest struct { // Chat ID - ChatID int + ChatID int64 // Photo to be set Photo InputChatPhotoClass } // MessagesEditChatPhotoRequestTypeID is TL type id of MessagesEditChatPhotoRequest. -const MessagesEditChatPhotoRequestTypeID = 0xca4c79d8 +const MessagesEditChatPhotoRequestTypeID = 0x35ddd674 // Ensuring interfaces in compile-time for MessagesEditChatPhotoRequest. var ( @@ -76,7 +76,7 @@ func (e *MessagesEditChatPhotoRequest) String() string { // FillFrom fills MessagesEditChatPhotoRequest from given interface. func (e *MessagesEditChatPhotoRequest) FillFrom(from interface { - GetChatID() (value int) + GetChatID() (value int64) GetPhoto() (value InputChatPhotoClass) }) { e.ChatID = from.GetChatID() @@ -121,7 +121,7 @@ func (e *MessagesEditChatPhotoRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (e *MessagesEditChatPhotoRequest) Encode(b *bin.Buffer) error { if e == nil { - return fmt.Errorf("can't encode messages.editChatPhoto#ca4c79d8 as nil") + return fmt.Errorf("can't encode messages.editChatPhoto#35ddd674 as nil") } b.PutID(MessagesEditChatPhotoRequestTypeID) return e.EncodeBare(b) @@ -130,14 +130,14 @@ func (e *MessagesEditChatPhotoRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (e *MessagesEditChatPhotoRequest) EncodeBare(b *bin.Buffer) error { if e == nil { - return fmt.Errorf("can't encode messages.editChatPhoto#ca4c79d8 as nil") + return fmt.Errorf("can't encode messages.editChatPhoto#35ddd674 as nil") } - b.PutInt(e.ChatID) + b.PutLong(e.ChatID) if e.Photo == nil { - return fmt.Errorf("unable to encode messages.editChatPhoto#ca4c79d8: field photo is nil") + return fmt.Errorf("unable to encode messages.editChatPhoto#35ddd674: field photo is nil") } if err := e.Photo.Encode(b); err != nil { - return fmt.Errorf("unable to encode messages.editChatPhoto#ca4c79d8: field photo: %w", err) + return fmt.Errorf("unable to encode messages.editChatPhoto#35ddd674: field photo: %w", err) } return nil } @@ -145,10 +145,10 @@ func (e *MessagesEditChatPhotoRequest) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (e *MessagesEditChatPhotoRequest) Decode(b *bin.Buffer) error { if e == nil { - return fmt.Errorf("can't decode messages.editChatPhoto#ca4c79d8 to nil") + return fmt.Errorf("can't decode messages.editChatPhoto#35ddd674 to nil") } if err := b.ConsumeID(MessagesEditChatPhotoRequestTypeID); err != nil { - return fmt.Errorf("unable to decode messages.editChatPhoto#ca4c79d8: %w", err) + return fmt.Errorf("unable to decode messages.editChatPhoto#35ddd674: %w", err) } return e.DecodeBare(b) } @@ -156,19 +156,19 @@ func (e *MessagesEditChatPhotoRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (e *MessagesEditChatPhotoRequest) DecodeBare(b *bin.Buffer) error { if e == nil { - return fmt.Errorf("can't decode messages.editChatPhoto#ca4c79d8 to nil") + return fmt.Errorf("can't decode messages.editChatPhoto#35ddd674 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messages.editChatPhoto#ca4c79d8: field chat_id: %w", err) + return fmt.Errorf("unable to decode messages.editChatPhoto#35ddd674: field chat_id: %w", err) } e.ChatID = value } { value, err := DecodeInputChatPhoto(b) if err != nil { - return fmt.Errorf("unable to decode messages.editChatPhoto#ca4c79d8: field photo: %w", err) + return fmt.Errorf("unable to decode messages.editChatPhoto#35ddd674: field photo: %w", err) } e.Photo = value } @@ -176,7 +176,7 @@ func (e *MessagesEditChatPhotoRequest) DecodeBare(b *bin.Buffer) error { } // GetChatID returns value of ChatID field. -func (e *MessagesEditChatPhotoRequest) GetChatID() (value int) { +func (e *MessagesEditChatPhotoRequest) GetChatID() (value int64) { return e.ChatID } @@ -185,7 +185,7 @@ func (e *MessagesEditChatPhotoRequest) GetPhoto() (value InputChatPhotoClass) { return e.Photo } -// MessagesEditChatPhoto invokes method messages.editChatPhoto#ca4c79d8 returning error if any. +// MessagesEditChatPhoto invokes method messages.editChatPhoto#35ddd674 returning error if any. // Changes chat photo and sends a service message on it // // Possible errors: diff --git a/tg/tl_messages_edit_chat_title_gen.go b/tg/tl_messages_edit_chat_title_gen.go index 5b155849d7..b9750fbfd2 100644 --- a/tg/tl_messages_edit_chat_title_gen.go +++ b/tg/tl_messages_edit_chat_title_gen.go @@ -29,19 +29,19 @@ var ( _ = tgerr.Error{} ) -// MessagesEditChatTitleRequest represents TL type `messages.editChatTitle#dc452855`. +// MessagesEditChatTitleRequest represents TL type `messages.editChatTitle#73783ffd`. // Chanages chat name and sends a service message on it. // // See https://core.telegram.org/method/messages.editChatTitle for reference. type MessagesEditChatTitleRequest struct { // Chat ID - ChatID int + ChatID int64 // New chat name, different from the old one Title string } // MessagesEditChatTitleRequestTypeID is TL type id of MessagesEditChatTitleRequest. -const MessagesEditChatTitleRequestTypeID = 0xdc452855 +const MessagesEditChatTitleRequestTypeID = 0x73783ffd // Ensuring interfaces in compile-time for MessagesEditChatTitleRequest. var ( @@ -76,7 +76,7 @@ func (e *MessagesEditChatTitleRequest) String() string { // FillFrom fills MessagesEditChatTitleRequest from given interface. func (e *MessagesEditChatTitleRequest) FillFrom(from interface { - GetChatID() (value int) + GetChatID() (value int64) GetTitle() (value string) }) { e.ChatID = from.GetChatID() @@ -121,7 +121,7 @@ func (e *MessagesEditChatTitleRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (e *MessagesEditChatTitleRequest) Encode(b *bin.Buffer) error { if e == nil { - return fmt.Errorf("can't encode messages.editChatTitle#dc452855 as nil") + return fmt.Errorf("can't encode messages.editChatTitle#73783ffd as nil") } b.PutID(MessagesEditChatTitleRequestTypeID) return e.EncodeBare(b) @@ -130,9 +130,9 @@ func (e *MessagesEditChatTitleRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (e *MessagesEditChatTitleRequest) EncodeBare(b *bin.Buffer) error { if e == nil { - return fmt.Errorf("can't encode messages.editChatTitle#dc452855 as nil") + return fmt.Errorf("can't encode messages.editChatTitle#73783ffd as nil") } - b.PutInt(e.ChatID) + b.PutLong(e.ChatID) b.PutString(e.Title) return nil } @@ -140,10 +140,10 @@ func (e *MessagesEditChatTitleRequest) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (e *MessagesEditChatTitleRequest) Decode(b *bin.Buffer) error { if e == nil { - return fmt.Errorf("can't decode messages.editChatTitle#dc452855 to nil") + return fmt.Errorf("can't decode messages.editChatTitle#73783ffd to nil") } if err := b.ConsumeID(MessagesEditChatTitleRequestTypeID); err != nil { - return fmt.Errorf("unable to decode messages.editChatTitle#dc452855: %w", err) + return fmt.Errorf("unable to decode messages.editChatTitle#73783ffd: %w", err) } return e.DecodeBare(b) } @@ -151,19 +151,19 @@ func (e *MessagesEditChatTitleRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (e *MessagesEditChatTitleRequest) DecodeBare(b *bin.Buffer) error { if e == nil { - return fmt.Errorf("can't decode messages.editChatTitle#dc452855 to nil") + return fmt.Errorf("can't decode messages.editChatTitle#73783ffd to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messages.editChatTitle#dc452855: field chat_id: %w", err) + return fmt.Errorf("unable to decode messages.editChatTitle#73783ffd: field chat_id: %w", err) } e.ChatID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode messages.editChatTitle#dc452855: field title: %w", err) + return fmt.Errorf("unable to decode messages.editChatTitle#73783ffd: field title: %w", err) } e.Title = value } @@ -171,7 +171,7 @@ func (e *MessagesEditChatTitleRequest) DecodeBare(b *bin.Buffer) error { } // GetChatID returns value of ChatID field. -func (e *MessagesEditChatTitleRequest) GetChatID() (value int) { +func (e *MessagesEditChatTitleRequest) GetChatID() (value int64) { return e.ChatID } @@ -180,7 +180,7 @@ func (e *MessagesEditChatTitleRequest) GetTitle() (value string) { return e.Title } -// MessagesEditChatTitle invokes method messages.editChatTitle#dc452855 returning error if any. +// MessagesEditChatTitle invokes method messages.editChatTitle#73783ffd returning error if any. // Chanages chat name and sends a service message on it. // // Possible errors: diff --git a/tg/tl_messages_edit_inline_bot_message_gen.go b/tg/tl_messages_edit_inline_bot_message_gen.go index 9c396c0dd4..3c4ceabe44 100644 --- a/tg/tl_messages_edit_inline_bot_message_gen.go +++ b/tg/tl_messages_edit_inline_bot_message_gen.go @@ -42,7 +42,7 @@ type MessagesEditInlineBotMessageRequest struct { // Disable webpage preview NoWebpage bool // Sent inline message ID - ID InputBotInlineMessageID + ID InputBotInlineMessageIDClass // Message // // Use SetMessage and GetMessage helpers. @@ -85,7 +85,7 @@ func (e *MessagesEditInlineBotMessageRequest) Zero() bool { if !(e.NoWebpage == false) { return false } - if !(e.ID.Zero()) { + if !(e.ID == nil) { return false } if !(e.Message == "") { @@ -116,7 +116,7 @@ func (e *MessagesEditInlineBotMessageRequest) String() string { // FillFrom fills MessagesEditInlineBotMessageRequest from given interface. func (e *MessagesEditInlineBotMessageRequest) FillFrom(from interface { GetNoWebpage() (value bool) - GetID() (value InputBotInlineMessageID) + GetID() (value InputBotInlineMessageIDClass) GetMessage() (value string, ok bool) GetMedia() (value InputMediaClass, ok bool) GetReplyMarkup() (value ReplyMarkupClass, ok bool) @@ -230,6 +230,9 @@ func (e *MessagesEditInlineBotMessageRequest) EncodeBare(b *bin.Buffer) error { if err := e.Flags.Encode(b); err != nil { return fmt.Errorf("unable to encode messages.editInlineBotMessage#83557dba: field flags: %w", err) } + if e.ID == nil { + return fmt.Errorf("unable to encode messages.editInlineBotMessage#83557dba: field id is nil") + } if err := e.ID.Encode(b); err != nil { return fmt.Errorf("unable to encode messages.editInlineBotMessage#83557dba: field id: %w", err) } @@ -289,9 +292,11 @@ func (e *MessagesEditInlineBotMessageRequest) DecodeBare(b *bin.Buffer) error { } e.NoWebpage = e.Flags.Has(1) { - if err := e.ID.Decode(b); err != nil { + value, err := DecodeInputBotInlineMessageID(b) + if err != nil { return fmt.Errorf("unable to decode messages.editInlineBotMessage#83557dba: field id: %w", err) } + e.ID = value } if e.Flags.Has(11) { value, err := b.String() @@ -351,7 +356,7 @@ func (e *MessagesEditInlineBotMessageRequest) GetNoWebpage() (value bool) { } // GetID returns value of ID field. -func (e *MessagesEditInlineBotMessageRequest) GetID() (value InputBotInlineMessageID) { +func (e *MessagesEditInlineBotMessageRequest) GetID() (value InputBotInlineMessageIDClass) { return e.ID } diff --git a/tg/tl_messages_faved_stickers_gen.go b/tg/tl_messages_faved_stickers_gen.go index 417fc46113..c988cfa845 100644 --- a/tg/tl_messages_faved_stickers_gen.go +++ b/tg/tl_messages_faved_stickers_gen.go @@ -131,7 +131,7 @@ func (f *MessagesFavedStickersNotModified) DecodeBare(b *bin.Buffer) error { return nil } -// MessagesFavedStickers represents TL type `messages.favedStickers#f37f2f16`. +// MessagesFavedStickers represents TL type `messages.favedStickers#2cb51097`. // Favorited stickers // // See https://core.telegram.org/constructor/messages.favedStickers for reference. @@ -140,7 +140,7 @@ type MessagesFavedStickers struct { // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation - Hash int + Hash int64 // Emojis associated to stickers Packs []StickerPack // Favorited stickers @@ -148,7 +148,7 @@ type MessagesFavedStickers struct { } // MessagesFavedStickersTypeID is TL type id of MessagesFavedStickers. -const MessagesFavedStickersTypeID = 0xf37f2f16 +const MessagesFavedStickersTypeID = 0x2cb51097 // construct implements constructor of MessagesFavedStickersClass. func (f MessagesFavedStickers) construct() MessagesFavedStickersClass { return &f } @@ -191,7 +191,7 @@ func (f *MessagesFavedStickers) String() string { // FillFrom fills MessagesFavedStickers from given interface. func (f *MessagesFavedStickers) FillFrom(from interface { - GetHash() (value int) + GetHash() (value int64) GetPacks() (value []StickerPack) GetStickers() (value []DocumentClass) }) { @@ -242,7 +242,7 @@ func (f *MessagesFavedStickers) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (f *MessagesFavedStickers) Encode(b *bin.Buffer) error { if f == nil { - return fmt.Errorf("can't encode messages.favedStickers#f37f2f16 as nil") + return fmt.Errorf("can't encode messages.favedStickers#2cb51097 as nil") } b.PutID(MessagesFavedStickersTypeID) return f.EncodeBare(b) @@ -251,22 +251,22 @@ func (f *MessagesFavedStickers) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (f *MessagesFavedStickers) EncodeBare(b *bin.Buffer) error { if f == nil { - return fmt.Errorf("can't encode messages.favedStickers#f37f2f16 as nil") + return fmt.Errorf("can't encode messages.favedStickers#2cb51097 as nil") } - b.PutInt(f.Hash) + b.PutLong(f.Hash) b.PutVectorHeader(len(f.Packs)) for idx, v := range f.Packs { if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode messages.favedStickers#f37f2f16: field packs element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode messages.favedStickers#2cb51097: field packs element with index %d: %w", idx, err) } } b.PutVectorHeader(len(f.Stickers)) for idx, v := range f.Stickers { if v == nil { - return fmt.Errorf("unable to encode messages.favedStickers#f37f2f16: field stickers element with index %d is nil", idx) + return fmt.Errorf("unable to encode messages.favedStickers#2cb51097: field stickers element with index %d is nil", idx) } if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode messages.favedStickers#f37f2f16: field stickers element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode messages.favedStickers#2cb51097: field stickers element with index %d: %w", idx, err) } } return nil @@ -275,10 +275,10 @@ func (f *MessagesFavedStickers) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (f *MessagesFavedStickers) Decode(b *bin.Buffer) error { if f == nil { - return fmt.Errorf("can't decode messages.favedStickers#f37f2f16 to nil") + return fmt.Errorf("can't decode messages.favedStickers#2cb51097 to nil") } if err := b.ConsumeID(MessagesFavedStickersTypeID); err != nil { - return fmt.Errorf("unable to decode messages.favedStickers#f37f2f16: %w", err) + return fmt.Errorf("unable to decode messages.favedStickers#2cb51097: %w", err) } return f.DecodeBare(b) } @@ -286,19 +286,19 @@ func (f *MessagesFavedStickers) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (f *MessagesFavedStickers) DecodeBare(b *bin.Buffer) error { if f == nil { - return fmt.Errorf("can't decode messages.favedStickers#f37f2f16 to nil") + return fmt.Errorf("can't decode messages.favedStickers#2cb51097 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messages.favedStickers#f37f2f16: field hash: %w", err) + return fmt.Errorf("unable to decode messages.favedStickers#2cb51097: field hash: %w", err) } f.Hash = value } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode messages.favedStickers#f37f2f16: field packs: %w", err) + return fmt.Errorf("unable to decode messages.favedStickers#2cb51097: field packs: %w", err) } if headerLen > 0 { @@ -307,7 +307,7 @@ func (f *MessagesFavedStickers) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { var value StickerPack if err := value.Decode(b); err != nil { - return fmt.Errorf("unable to decode messages.favedStickers#f37f2f16: field packs: %w", err) + return fmt.Errorf("unable to decode messages.favedStickers#2cb51097: field packs: %w", err) } f.Packs = append(f.Packs, value) } @@ -315,7 +315,7 @@ func (f *MessagesFavedStickers) DecodeBare(b *bin.Buffer) error { { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode messages.favedStickers#f37f2f16: field stickers: %w", err) + return fmt.Errorf("unable to decode messages.favedStickers#2cb51097: field stickers: %w", err) } if headerLen > 0 { @@ -324,7 +324,7 @@ func (f *MessagesFavedStickers) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := DecodeDocument(b) if err != nil { - return fmt.Errorf("unable to decode messages.favedStickers#f37f2f16: field stickers: %w", err) + return fmt.Errorf("unable to decode messages.favedStickers#2cb51097: field stickers: %w", err) } f.Stickers = append(f.Stickers, value) } @@ -333,7 +333,7 @@ func (f *MessagesFavedStickers) DecodeBare(b *bin.Buffer) error { } // GetHash returns value of Hash field. -func (f *MessagesFavedStickers) GetHash() (value int) { +func (f *MessagesFavedStickers) GetHash() (value int64) { return f.Hash } @@ -363,7 +363,7 @@ func (f *MessagesFavedStickers) MapStickers() (value DocumentClassArray) { // } // switch v := g.(type) { // case *tg.MessagesFavedStickersNotModified: // messages.favedStickersNotModified#9e8fa6d3 -// case *tg.MessagesFavedStickers: // messages.favedStickers#f37f2f16 +// case *tg.MessagesFavedStickers: // messages.favedStickers#2cb51097 // default: panic(v) // } type MessagesFavedStickersClass interface { @@ -413,7 +413,7 @@ func DecodeMessagesFavedStickers(buf *bin.Buffer) (MessagesFavedStickersClass, e } return &v, nil case MessagesFavedStickersTypeID: - // Decoding messages.favedStickers#f37f2f16. + // Decoding messages.favedStickers#2cb51097. v := MessagesFavedStickers{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode MessagesFavedStickersClass: %w", err) diff --git a/tg/tl_messages_featured_stickers_gen.go b/tg/tl_messages_featured_stickers_gen.go index 90ab27a742..020061d7fb 100644 --- a/tg/tl_messages_featured_stickers_gen.go +++ b/tg/tl_messages_featured_stickers_gen.go @@ -161,7 +161,7 @@ func (f *MessagesFeaturedStickersNotModified) GetCount() (value int) { return f.Count } -// MessagesFeaturedStickers represents TL type `messages.featuredStickers#b6abc341`. +// MessagesFeaturedStickers represents TL type `messages.featuredStickers#84c02310`. // Featured stickersets // // See https://core.telegram.org/constructor/messages.featuredStickers for reference. @@ -170,7 +170,7 @@ type MessagesFeaturedStickers struct { // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation - Hash int + Hash int64 // Total number of featured stickers Count int // Featured stickersets @@ -180,7 +180,7 @@ type MessagesFeaturedStickers struct { } // MessagesFeaturedStickersTypeID is TL type id of MessagesFeaturedStickers. -const MessagesFeaturedStickersTypeID = 0xb6abc341 +const MessagesFeaturedStickersTypeID = 0x84c02310 // construct implements constructor of MessagesFeaturedStickersClass. func (f MessagesFeaturedStickers) construct() MessagesFeaturedStickersClass { return &f } @@ -226,7 +226,7 @@ func (f *MessagesFeaturedStickers) String() string { // FillFrom fills MessagesFeaturedStickers from given interface. func (f *MessagesFeaturedStickers) FillFrom(from interface { - GetHash() (value int) + GetHash() (value int64) GetCount() (value int) GetSets() (value []StickerSetCoveredClass) GetUnread() (value []int64) @@ -283,7 +283,7 @@ func (f *MessagesFeaturedStickers) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (f *MessagesFeaturedStickers) Encode(b *bin.Buffer) error { if f == nil { - return fmt.Errorf("can't encode messages.featuredStickers#b6abc341 as nil") + return fmt.Errorf("can't encode messages.featuredStickers#84c02310 as nil") } b.PutID(MessagesFeaturedStickersTypeID) return f.EncodeBare(b) @@ -292,17 +292,17 @@ func (f *MessagesFeaturedStickers) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (f *MessagesFeaturedStickers) EncodeBare(b *bin.Buffer) error { if f == nil { - return fmt.Errorf("can't encode messages.featuredStickers#b6abc341 as nil") + return fmt.Errorf("can't encode messages.featuredStickers#84c02310 as nil") } - b.PutInt(f.Hash) + b.PutLong(f.Hash) b.PutInt(f.Count) b.PutVectorHeader(len(f.Sets)) for idx, v := range f.Sets { if v == nil { - return fmt.Errorf("unable to encode messages.featuredStickers#b6abc341: field sets element with index %d is nil", idx) + return fmt.Errorf("unable to encode messages.featuredStickers#84c02310: field sets element with index %d is nil", idx) } if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode messages.featuredStickers#b6abc341: field sets element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode messages.featuredStickers#84c02310: field sets element with index %d: %w", idx, err) } } b.PutVectorHeader(len(f.Unread)) @@ -315,10 +315,10 @@ func (f *MessagesFeaturedStickers) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (f *MessagesFeaturedStickers) Decode(b *bin.Buffer) error { if f == nil { - return fmt.Errorf("can't decode messages.featuredStickers#b6abc341 to nil") + return fmt.Errorf("can't decode messages.featuredStickers#84c02310 to nil") } if err := b.ConsumeID(MessagesFeaturedStickersTypeID); err != nil { - return fmt.Errorf("unable to decode messages.featuredStickers#b6abc341: %w", err) + return fmt.Errorf("unable to decode messages.featuredStickers#84c02310: %w", err) } return f.DecodeBare(b) } @@ -326,26 +326,26 @@ func (f *MessagesFeaturedStickers) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (f *MessagesFeaturedStickers) DecodeBare(b *bin.Buffer) error { if f == nil { - return fmt.Errorf("can't decode messages.featuredStickers#b6abc341 to nil") + return fmt.Errorf("can't decode messages.featuredStickers#84c02310 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messages.featuredStickers#b6abc341: field hash: %w", err) + return fmt.Errorf("unable to decode messages.featuredStickers#84c02310: field hash: %w", err) } f.Hash = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messages.featuredStickers#b6abc341: field count: %w", err) + return fmt.Errorf("unable to decode messages.featuredStickers#84c02310: field count: %w", err) } f.Count = value } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode messages.featuredStickers#b6abc341: field sets: %w", err) + return fmt.Errorf("unable to decode messages.featuredStickers#84c02310: field sets: %w", err) } if headerLen > 0 { @@ -354,7 +354,7 @@ func (f *MessagesFeaturedStickers) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := DecodeStickerSetCovered(b) if err != nil { - return fmt.Errorf("unable to decode messages.featuredStickers#b6abc341: field sets: %w", err) + return fmt.Errorf("unable to decode messages.featuredStickers#84c02310: field sets: %w", err) } f.Sets = append(f.Sets, value) } @@ -362,7 +362,7 @@ func (f *MessagesFeaturedStickers) DecodeBare(b *bin.Buffer) error { { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode messages.featuredStickers#b6abc341: field unread: %w", err) + return fmt.Errorf("unable to decode messages.featuredStickers#84c02310: field unread: %w", err) } if headerLen > 0 { @@ -371,7 +371,7 @@ func (f *MessagesFeaturedStickers) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messages.featuredStickers#b6abc341: field unread: %w", err) + return fmt.Errorf("unable to decode messages.featuredStickers#84c02310: field unread: %w", err) } f.Unread = append(f.Unread, value) } @@ -380,7 +380,7 @@ func (f *MessagesFeaturedStickers) DecodeBare(b *bin.Buffer) error { } // GetHash returns value of Hash field. -func (f *MessagesFeaturedStickers) GetHash() (value int) { +func (f *MessagesFeaturedStickers) GetHash() (value int64) { return f.Hash } @@ -415,7 +415,7 @@ func (f *MessagesFeaturedStickers) MapSets() (value StickerSetCoveredClassArray) // } // switch v := g.(type) { // case *tg.MessagesFeaturedStickersNotModified: // messages.featuredStickersNotModified#c6dc0c66 -// case *tg.MessagesFeaturedStickers: // messages.featuredStickers#b6abc341 +// case *tg.MessagesFeaturedStickers: // messages.featuredStickers#84c02310 // default: panic(v) // } type MessagesFeaturedStickersClass interface { @@ -468,7 +468,7 @@ func DecodeMessagesFeaturedStickers(buf *bin.Buffer) (MessagesFeaturedStickersCl } return &v, nil case MessagesFeaturedStickersTypeID: - // Decoding messages.featuredStickers#b6abc341. + // Decoding messages.featuredStickers#84c02310. v := MessagesFeaturedStickers{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode MessagesFeaturedStickersClass: %w", err) diff --git a/tg/tl_messages_found_sticker_sets_gen.go b/tg/tl_messages_found_sticker_sets_gen.go index 128fcf3fa4..d3ce7c216b 100644 --- a/tg/tl_messages_found_sticker_sets_gen.go +++ b/tg/tl_messages_found_sticker_sets_gen.go @@ -131,7 +131,7 @@ func (f *MessagesFoundStickerSetsNotModified) DecodeBare(b *bin.Buffer) error { return nil } -// MessagesFoundStickerSets represents TL type `messages.foundStickerSets#5108d648`. +// MessagesFoundStickerSets represents TL type `messages.foundStickerSets#8af09dd2`. // Found stickersets // // See https://core.telegram.org/constructor/messages.foundStickerSets for reference. @@ -140,13 +140,13 @@ type MessagesFoundStickerSets struct { // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation - Hash int + Hash int64 // Found stickersets Sets []StickerSetCoveredClass } // MessagesFoundStickerSetsTypeID is TL type id of MessagesFoundStickerSets. -const MessagesFoundStickerSetsTypeID = 0x5108d648 +const MessagesFoundStickerSetsTypeID = 0x8af09dd2 // construct implements constructor of MessagesFoundStickerSetsClass. func (f MessagesFoundStickerSets) construct() MessagesFoundStickerSetsClass { return &f } @@ -186,7 +186,7 @@ func (f *MessagesFoundStickerSets) String() string { // FillFrom fills MessagesFoundStickerSets from given interface. func (f *MessagesFoundStickerSets) FillFrom(from interface { - GetHash() (value int) + GetHash() (value int64) GetSets() (value []StickerSetCoveredClass) }) { f.Hash = from.GetHash() @@ -231,7 +231,7 @@ func (f *MessagesFoundStickerSets) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (f *MessagesFoundStickerSets) Encode(b *bin.Buffer) error { if f == nil { - return fmt.Errorf("can't encode messages.foundStickerSets#5108d648 as nil") + return fmt.Errorf("can't encode messages.foundStickerSets#8af09dd2 as nil") } b.PutID(MessagesFoundStickerSetsTypeID) return f.EncodeBare(b) @@ -240,16 +240,16 @@ func (f *MessagesFoundStickerSets) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (f *MessagesFoundStickerSets) EncodeBare(b *bin.Buffer) error { if f == nil { - return fmt.Errorf("can't encode messages.foundStickerSets#5108d648 as nil") + return fmt.Errorf("can't encode messages.foundStickerSets#8af09dd2 as nil") } - b.PutInt(f.Hash) + b.PutLong(f.Hash) b.PutVectorHeader(len(f.Sets)) for idx, v := range f.Sets { if v == nil { - return fmt.Errorf("unable to encode messages.foundStickerSets#5108d648: field sets element with index %d is nil", idx) + return fmt.Errorf("unable to encode messages.foundStickerSets#8af09dd2: field sets element with index %d is nil", idx) } if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode messages.foundStickerSets#5108d648: field sets element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode messages.foundStickerSets#8af09dd2: field sets element with index %d: %w", idx, err) } } return nil @@ -258,10 +258,10 @@ func (f *MessagesFoundStickerSets) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (f *MessagesFoundStickerSets) Decode(b *bin.Buffer) error { if f == nil { - return fmt.Errorf("can't decode messages.foundStickerSets#5108d648 to nil") + return fmt.Errorf("can't decode messages.foundStickerSets#8af09dd2 to nil") } if err := b.ConsumeID(MessagesFoundStickerSetsTypeID); err != nil { - return fmt.Errorf("unable to decode messages.foundStickerSets#5108d648: %w", err) + return fmt.Errorf("unable to decode messages.foundStickerSets#8af09dd2: %w", err) } return f.DecodeBare(b) } @@ -269,19 +269,19 @@ func (f *MessagesFoundStickerSets) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (f *MessagesFoundStickerSets) DecodeBare(b *bin.Buffer) error { if f == nil { - return fmt.Errorf("can't decode messages.foundStickerSets#5108d648 to nil") + return fmt.Errorf("can't decode messages.foundStickerSets#8af09dd2 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messages.foundStickerSets#5108d648: field hash: %w", err) + return fmt.Errorf("unable to decode messages.foundStickerSets#8af09dd2: field hash: %w", err) } f.Hash = value } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode messages.foundStickerSets#5108d648: field sets: %w", err) + return fmt.Errorf("unable to decode messages.foundStickerSets#8af09dd2: field sets: %w", err) } if headerLen > 0 { @@ -290,7 +290,7 @@ func (f *MessagesFoundStickerSets) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := DecodeStickerSetCovered(b) if err != nil { - return fmt.Errorf("unable to decode messages.foundStickerSets#5108d648: field sets: %w", err) + return fmt.Errorf("unable to decode messages.foundStickerSets#8af09dd2: field sets: %w", err) } f.Sets = append(f.Sets, value) } @@ -299,7 +299,7 @@ func (f *MessagesFoundStickerSets) DecodeBare(b *bin.Buffer) error { } // GetHash returns value of Hash field. -func (f *MessagesFoundStickerSets) GetHash() (value int) { +func (f *MessagesFoundStickerSets) GetHash() (value int64) { return f.Hash } @@ -324,7 +324,7 @@ func (f *MessagesFoundStickerSets) MapSets() (value StickerSetCoveredClassArray) // } // switch v := g.(type) { // case *tg.MessagesFoundStickerSetsNotModified: // messages.foundStickerSetsNotModified#d54b65d -// case *tg.MessagesFoundStickerSets: // messages.foundStickerSets#5108d648 +// case *tg.MessagesFoundStickerSets: // messages.foundStickerSets#8af09dd2 // default: panic(v) // } type MessagesFoundStickerSetsClass interface { @@ -374,7 +374,7 @@ func DecodeMessagesFoundStickerSets(buf *bin.Buffer) (MessagesFoundStickerSetsCl } return &v, nil case MessagesFoundStickerSetsTypeID: - // Decoding messages.foundStickerSets#5108d648. + // Decoding messages.foundStickerSets#8af09dd2. v := MessagesFoundStickerSets{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode MessagesFoundStickerSetsClass: %w", err) diff --git a/tg/tl_messages_get_all_chats_gen.go b/tg/tl_messages_get_all_chats_gen.go index 8ea801aba5..5feefd5d9d 100644 --- a/tg/tl_messages_get_all_chats_gen.go +++ b/tg/tl_messages_get_all_chats_gen.go @@ -29,17 +29,17 @@ var ( _ = tgerr.Error{} ) -// MessagesGetAllChatsRequest represents TL type `messages.getAllChats#eba80ff0`. +// MessagesGetAllChatsRequest represents TL type `messages.getAllChats#875f74be`. // Get all chats, channels and supergroups // // See https://core.telegram.org/method/messages.getAllChats for reference. type MessagesGetAllChatsRequest struct { // Except these chats/channels/supergroups - ExceptIDs []int + ExceptIDs []int64 } // MessagesGetAllChatsRequestTypeID is TL type id of MessagesGetAllChatsRequest. -const MessagesGetAllChatsRequestTypeID = 0xeba80ff0 +const MessagesGetAllChatsRequestTypeID = 0x875f74be // Ensuring interfaces in compile-time for MessagesGetAllChatsRequest. var ( @@ -71,7 +71,7 @@ func (g *MessagesGetAllChatsRequest) String() string { // FillFrom fills MessagesGetAllChatsRequest from given interface. func (g *MessagesGetAllChatsRequest) FillFrom(from interface { - GetExceptIDs() (value []int) + GetExceptIDs() (value []int64) }) { g.ExceptIDs = from.GetExceptIDs() } @@ -110,7 +110,7 @@ func (g *MessagesGetAllChatsRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (g *MessagesGetAllChatsRequest) Encode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode messages.getAllChats#eba80ff0 as nil") + return fmt.Errorf("can't encode messages.getAllChats#875f74be as nil") } b.PutID(MessagesGetAllChatsRequestTypeID) return g.EncodeBare(b) @@ -119,11 +119,11 @@ func (g *MessagesGetAllChatsRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (g *MessagesGetAllChatsRequest) EncodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode messages.getAllChats#eba80ff0 as nil") + return fmt.Errorf("can't encode messages.getAllChats#875f74be as nil") } b.PutVectorHeader(len(g.ExceptIDs)) for _, v := range g.ExceptIDs { - b.PutInt(v) + b.PutLong(v) } return nil } @@ -131,10 +131,10 @@ func (g *MessagesGetAllChatsRequest) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (g *MessagesGetAllChatsRequest) Decode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode messages.getAllChats#eba80ff0 to nil") + return fmt.Errorf("can't decode messages.getAllChats#875f74be to nil") } if err := b.ConsumeID(MessagesGetAllChatsRequestTypeID); err != nil { - return fmt.Errorf("unable to decode messages.getAllChats#eba80ff0: %w", err) + return fmt.Errorf("unable to decode messages.getAllChats#875f74be: %w", err) } return g.DecodeBare(b) } @@ -142,21 +142,21 @@ func (g *MessagesGetAllChatsRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (g *MessagesGetAllChatsRequest) DecodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode messages.getAllChats#eba80ff0 to nil") + return fmt.Errorf("can't decode messages.getAllChats#875f74be to nil") } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode messages.getAllChats#eba80ff0: field except_ids: %w", err) + return fmt.Errorf("unable to decode messages.getAllChats#875f74be: field except_ids: %w", err) } if headerLen > 0 { - g.ExceptIDs = make([]int, 0, headerLen%bin.PreallocateLimit) + g.ExceptIDs = make([]int64, 0, headerLen%bin.PreallocateLimit) } for idx := 0; idx < headerLen; idx++ { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messages.getAllChats#eba80ff0: field except_ids: %w", err) + return fmt.Errorf("unable to decode messages.getAllChats#875f74be: field except_ids: %w", err) } g.ExceptIDs = append(g.ExceptIDs, value) } @@ -165,15 +165,15 @@ func (g *MessagesGetAllChatsRequest) DecodeBare(b *bin.Buffer) error { } // GetExceptIDs returns value of ExceptIDs field. -func (g *MessagesGetAllChatsRequest) GetExceptIDs() (value []int) { +func (g *MessagesGetAllChatsRequest) GetExceptIDs() (value []int64) { return g.ExceptIDs } -// MessagesGetAllChats invokes method messages.getAllChats#eba80ff0 returning error if any. +// MessagesGetAllChats invokes method messages.getAllChats#875f74be returning error if any. // Get all chats, channels and supergroups // // See https://core.telegram.org/method/messages.getAllChats for reference. -func (c *Client) MessagesGetAllChats(ctx context.Context, exceptids []int) (MessagesChatsClass, error) { +func (c *Client) MessagesGetAllChats(ctx context.Context, exceptids []int64) (MessagesChatsClass, error) { var result MessagesChatsBox request := &MessagesGetAllChatsRequest{ diff --git a/tg/tl_messages_get_all_stickers_gen.go b/tg/tl_messages_get_all_stickers_gen.go index 895dc0ba8a..84d5f1fa30 100644 --- a/tg/tl_messages_get_all_stickers_gen.go +++ b/tg/tl_messages_get_all_stickers_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// MessagesGetAllStickersRequest represents TL type `messages.getAllStickers#1c9618b1`. +// MessagesGetAllStickersRequest represents TL type `messages.getAllStickers#b8a0a1a8`. // Get all installed stickers // // See https://core.telegram.org/method/messages.getAllStickers for reference. @@ -38,11 +38,11 @@ type MessagesGetAllStickersRequest struct { // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation - Hash int + Hash int64 } // MessagesGetAllStickersRequestTypeID is TL type id of MessagesGetAllStickersRequest. -const MessagesGetAllStickersRequestTypeID = 0x1c9618b1 +const MessagesGetAllStickersRequestTypeID = 0xb8a0a1a8 // Ensuring interfaces in compile-time for MessagesGetAllStickersRequest. var ( @@ -74,7 +74,7 @@ func (g *MessagesGetAllStickersRequest) String() string { // FillFrom fills MessagesGetAllStickersRequest from given interface. func (g *MessagesGetAllStickersRequest) FillFrom(from interface { - GetHash() (value int) + GetHash() (value int64) }) { g.Hash = from.GetHash() } @@ -113,7 +113,7 @@ func (g *MessagesGetAllStickersRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (g *MessagesGetAllStickersRequest) Encode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode messages.getAllStickers#1c9618b1 as nil") + return fmt.Errorf("can't encode messages.getAllStickers#b8a0a1a8 as nil") } b.PutID(MessagesGetAllStickersRequestTypeID) return g.EncodeBare(b) @@ -122,19 +122,19 @@ func (g *MessagesGetAllStickersRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (g *MessagesGetAllStickersRequest) EncodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode messages.getAllStickers#1c9618b1 as nil") + return fmt.Errorf("can't encode messages.getAllStickers#b8a0a1a8 as nil") } - b.PutInt(g.Hash) + b.PutLong(g.Hash) return nil } // Decode implements bin.Decoder. func (g *MessagesGetAllStickersRequest) Decode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode messages.getAllStickers#1c9618b1 to nil") + return fmt.Errorf("can't decode messages.getAllStickers#b8a0a1a8 to nil") } if err := b.ConsumeID(MessagesGetAllStickersRequestTypeID); err != nil { - return fmt.Errorf("unable to decode messages.getAllStickers#1c9618b1: %w", err) + return fmt.Errorf("unable to decode messages.getAllStickers#b8a0a1a8: %w", err) } return g.DecodeBare(b) } @@ -142,12 +142,12 @@ func (g *MessagesGetAllStickersRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (g *MessagesGetAllStickersRequest) DecodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode messages.getAllStickers#1c9618b1 to nil") + return fmt.Errorf("can't decode messages.getAllStickers#b8a0a1a8 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messages.getAllStickers#1c9618b1: field hash: %w", err) + return fmt.Errorf("unable to decode messages.getAllStickers#b8a0a1a8: field hash: %w", err) } g.Hash = value } @@ -155,15 +155,15 @@ func (g *MessagesGetAllStickersRequest) DecodeBare(b *bin.Buffer) error { } // GetHash returns value of Hash field. -func (g *MessagesGetAllStickersRequest) GetHash() (value int) { +func (g *MessagesGetAllStickersRequest) GetHash() (value int64) { return g.Hash } -// MessagesGetAllStickers invokes method messages.getAllStickers#1c9618b1 returning error if any. +// MessagesGetAllStickers invokes method messages.getAllStickers#b8a0a1a8 returning error if any. // Get all installed stickers // // See https://core.telegram.org/method/messages.getAllStickers for reference. -func (c *Client) MessagesGetAllStickers(ctx context.Context, hash int) (MessagesAllStickersClass, error) { +func (c *Client) MessagesGetAllStickers(ctx context.Context, hash int64) (MessagesAllStickersClass, error) { var result MessagesAllStickersBox request := &MessagesGetAllStickersRequest{ diff --git a/tg/tl_messages_get_chats_gen.go b/tg/tl_messages_get_chats_gen.go index 13db71da17..a206f73788 100644 --- a/tg/tl_messages_get_chats_gen.go +++ b/tg/tl_messages_get_chats_gen.go @@ -29,17 +29,17 @@ var ( _ = tgerr.Error{} ) -// MessagesGetChatsRequest represents TL type `messages.getChats#3c6aa187`. +// MessagesGetChatsRequest represents TL type `messages.getChats#49e9528f`. // Returns chat basic info on their IDs. // // See https://core.telegram.org/method/messages.getChats for reference. type MessagesGetChatsRequest struct { // List of chat IDs - ID []int + ID []int64 } // MessagesGetChatsRequestTypeID is TL type id of MessagesGetChatsRequest. -const MessagesGetChatsRequestTypeID = 0x3c6aa187 +const MessagesGetChatsRequestTypeID = 0x49e9528f // Ensuring interfaces in compile-time for MessagesGetChatsRequest. var ( @@ -71,7 +71,7 @@ func (g *MessagesGetChatsRequest) String() string { // FillFrom fills MessagesGetChatsRequest from given interface. func (g *MessagesGetChatsRequest) FillFrom(from interface { - GetID() (value []int) + GetID() (value []int64) }) { g.ID = from.GetID() } @@ -110,7 +110,7 @@ func (g *MessagesGetChatsRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (g *MessagesGetChatsRequest) Encode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode messages.getChats#3c6aa187 as nil") + return fmt.Errorf("can't encode messages.getChats#49e9528f as nil") } b.PutID(MessagesGetChatsRequestTypeID) return g.EncodeBare(b) @@ -119,11 +119,11 @@ func (g *MessagesGetChatsRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (g *MessagesGetChatsRequest) EncodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode messages.getChats#3c6aa187 as nil") + return fmt.Errorf("can't encode messages.getChats#49e9528f as nil") } b.PutVectorHeader(len(g.ID)) for _, v := range g.ID { - b.PutInt(v) + b.PutLong(v) } return nil } @@ -131,10 +131,10 @@ func (g *MessagesGetChatsRequest) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (g *MessagesGetChatsRequest) Decode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode messages.getChats#3c6aa187 to nil") + return fmt.Errorf("can't decode messages.getChats#49e9528f to nil") } if err := b.ConsumeID(MessagesGetChatsRequestTypeID); err != nil { - return fmt.Errorf("unable to decode messages.getChats#3c6aa187: %w", err) + return fmt.Errorf("unable to decode messages.getChats#49e9528f: %w", err) } return g.DecodeBare(b) } @@ -142,21 +142,21 @@ func (g *MessagesGetChatsRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (g *MessagesGetChatsRequest) DecodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode messages.getChats#3c6aa187 to nil") + return fmt.Errorf("can't decode messages.getChats#49e9528f to nil") } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode messages.getChats#3c6aa187: field id: %w", err) + return fmt.Errorf("unable to decode messages.getChats#49e9528f: field id: %w", err) } if headerLen > 0 { - g.ID = make([]int, 0, headerLen%bin.PreallocateLimit) + g.ID = make([]int64, 0, headerLen%bin.PreallocateLimit) } for idx := 0; idx < headerLen; idx++ { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messages.getChats#3c6aa187: field id: %w", err) + return fmt.Errorf("unable to decode messages.getChats#49e9528f: field id: %w", err) } g.ID = append(g.ID, value) } @@ -165,11 +165,11 @@ func (g *MessagesGetChatsRequest) DecodeBare(b *bin.Buffer) error { } // GetID returns value of ID field. -func (g *MessagesGetChatsRequest) GetID() (value []int) { +func (g *MessagesGetChatsRequest) GetID() (value []int64) { return g.ID } -// MessagesGetChats invokes method messages.getChats#3c6aa187 returning error if any. +// MessagesGetChats invokes method messages.getChats#49e9528f returning error if any. // Returns chat basic info on their IDs. // // Possible errors: @@ -178,7 +178,7 @@ func (g *MessagesGetChatsRequest) GetID() (value []int) { // // See https://core.telegram.org/method/messages.getChats for reference. // Can be used by bots. -func (c *Client) MessagesGetChats(ctx context.Context, id []int) (MessagesChatsClass, error) { +func (c *Client) MessagesGetChats(ctx context.Context, id []int64) (MessagesChatsClass, error) { var result MessagesChatsBox request := &MessagesGetChatsRequest{ diff --git a/tg/tl_messages_get_common_chats_gen.go b/tg/tl_messages_get_common_chats_gen.go index aa5c337032..b98febf479 100644 --- a/tg/tl_messages_get_common_chats_gen.go +++ b/tg/tl_messages_get_common_chats_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// MessagesGetCommonChatsRequest represents TL type `messages.getCommonChats#d0a48c4`. +// MessagesGetCommonChatsRequest represents TL type `messages.getCommonChats#e40ca104`. // Get chats in common with a user // // See https://core.telegram.org/method/messages.getCommonChats for reference. @@ -40,7 +40,7 @@ type MessagesGetCommonChatsRequest struct { // // Links: // 1) https://core.telegram.org/api/offsets - MaxID int + MaxID int64 // Maximum number of results to return, see pagination¹ // // Links: @@ -49,7 +49,7 @@ type MessagesGetCommonChatsRequest struct { } // MessagesGetCommonChatsRequestTypeID is TL type id of MessagesGetCommonChatsRequest. -const MessagesGetCommonChatsRequestTypeID = 0xd0a48c4 +const MessagesGetCommonChatsRequestTypeID = 0xe40ca104 // Ensuring interfaces in compile-time for MessagesGetCommonChatsRequest. var ( @@ -88,7 +88,7 @@ func (g *MessagesGetCommonChatsRequest) String() string { // FillFrom fills MessagesGetCommonChatsRequest from given interface. func (g *MessagesGetCommonChatsRequest) FillFrom(from interface { GetUserID() (value InputUserClass) - GetMaxID() (value int) + GetMaxID() (value int64) GetLimit() (value int) }) { g.UserID = from.GetUserID() @@ -138,7 +138,7 @@ func (g *MessagesGetCommonChatsRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (g *MessagesGetCommonChatsRequest) Encode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode messages.getCommonChats#d0a48c4 as nil") + return fmt.Errorf("can't encode messages.getCommonChats#e40ca104 as nil") } b.PutID(MessagesGetCommonChatsRequestTypeID) return g.EncodeBare(b) @@ -147,15 +147,15 @@ func (g *MessagesGetCommonChatsRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (g *MessagesGetCommonChatsRequest) EncodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode messages.getCommonChats#d0a48c4 as nil") + return fmt.Errorf("can't encode messages.getCommonChats#e40ca104 as nil") } if g.UserID == nil { - return fmt.Errorf("unable to encode messages.getCommonChats#d0a48c4: field user_id is nil") + return fmt.Errorf("unable to encode messages.getCommonChats#e40ca104: field user_id is nil") } if err := g.UserID.Encode(b); err != nil { - return fmt.Errorf("unable to encode messages.getCommonChats#d0a48c4: field user_id: %w", err) + return fmt.Errorf("unable to encode messages.getCommonChats#e40ca104: field user_id: %w", err) } - b.PutInt(g.MaxID) + b.PutLong(g.MaxID) b.PutInt(g.Limit) return nil } @@ -163,10 +163,10 @@ func (g *MessagesGetCommonChatsRequest) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (g *MessagesGetCommonChatsRequest) Decode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode messages.getCommonChats#d0a48c4 to nil") + return fmt.Errorf("can't decode messages.getCommonChats#e40ca104 to nil") } if err := b.ConsumeID(MessagesGetCommonChatsRequestTypeID); err != nil { - return fmt.Errorf("unable to decode messages.getCommonChats#d0a48c4: %w", err) + return fmt.Errorf("unable to decode messages.getCommonChats#e40ca104: %w", err) } return g.DecodeBare(b) } @@ -174,26 +174,26 @@ func (g *MessagesGetCommonChatsRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (g *MessagesGetCommonChatsRequest) DecodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode messages.getCommonChats#d0a48c4 to nil") + return fmt.Errorf("can't decode messages.getCommonChats#e40ca104 to nil") } { value, err := DecodeInputUser(b) if err != nil { - return fmt.Errorf("unable to decode messages.getCommonChats#d0a48c4: field user_id: %w", err) + return fmt.Errorf("unable to decode messages.getCommonChats#e40ca104: field user_id: %w", err) } g.UserID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messages.getCommonChats#d0a48c4: field max_id: %w", err) + return fmt.Errorf("unable to decode messages.getCommonChats#e40ca104: field max_id: %w", err) } g.MaxID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messages.getCommonChats#d0a48c4: field limit: %w", err) + return fmt.Errorf("unable to decode messages.getCommonChats#e40ca104: field limit: %w", err) } g.Limit = value } @@ -206,7 +206,7 @@ func (g *MessagesGetCommonChatsRequest) GetUserID() (value InputUserClass) { } // GetMaxID returns value of MaxID field. -func (g *MessagesGetCommonChatsRequest) GetMaxID() (value int) { +func (g *MessagesGetCommonChatsRequest) GetMaxID() (value int64) { return g.MaxID } @@ -215,7 +215,7 @@ func (g *MessagesGetCommonChatsRequest) GetLimit() (value int) { return g.Limit } -// MessagesGetCommonChats invokes method messages.getCommonChats#d0a48c4 returning error if any. +// MessagesGetCommonChats invokes method messages.getCommonChats#e40ca104 returning error if any. // Get chats in common with a user // // Possible errors: diff --git a/tg/tl_messages_get_dialogs_gen.go b/tg/tl_messages_get_dialogs_gen.go index 0ba0017f98..3963b5e98c 100644 --- a/tg/tl_messages_get_dialogs_gen.go +++ b/tg/tl_messages_get_dialogs_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// MessagesGetDialogsRequest represents TL type `messages.getDialogs#a0ee3b73`. +// MessagesGetDialogsRequest represents TL type `messages.getDialogs#a0f4cb4f`. // Returns the current user dialog list. // // See https://core.telegram.org/method/messages.getDialogs for reference. @@ -69,11 +69,11 @@ type MessagesGetDialogsRequest struct { // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation - Hash int + Hash int64 } // MessagesGetDialogsRequestTypeID is TL type id of MessagesGetDialogsRequest. -const MessagesGetDialogsRequestTypeID = 0xa0ee3b73 +const MessagesGetDialogsRequestTypeID = 0xa0f4cb4f // Ensuring interfaces in compile-time for MessagesGetDialogsRequest. var ( @@ -132,7 +132,7 @@ func (g *MessagesGetDialogsRequest) FillFrom(from interface { GetOffsetID() (value int) GetOffsetPeer() (value InputPeerClass) GetLimit() (value int) - GetHash() (value int) + GetHash() (value int64) }) { g.ExcludePinned = from.GetExcludePinned() if val, ok := from.GetFolderID(); ok { @@ -206,7 +206,7 @@ func (g *MessagesGetDialogsRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (g *MessagesGetDialogsRequest) Encode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode messages.getDialogs#a0ee3b73 as nil") + return fmt.Errorf("can't encode messages.getDialogs#a0f4cb4f as nil") } b.PutID(MessagesGetDialogsRequestTypeID) return g.EncodeBare(b) @@ -215,7 +215,7 @@ func (g *MessagesGetDialogsRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (g *MessagesGetDialogsRequest) EncodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode messages.getDialogs#a0ee3b73 as nil") + return fmt.Errorf("can't encode messages.getDialogs#a0f4cb4f as nil") } if !(g.ExcludePinned == false) { g.Flags.Set(0) @@ -224,7 +224,7 @@ func (g *MessagesGetDialogsRequest) EncodeBare(b *bin.Buffer) error { g.Flags.Set(1) } if err := g.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode messages.getDialogs#a0ee3b73: field flags: %w", err) + return fmt.Errorf("unable to encode messages.getDialogs#a0f4cb4f: field flags: %w", err) } if g.Flags.Has(1) { b.PutInt(g.FolderID) @@ -232,23 +232,23 @@ func (g *MessagesGetDialogsRequest) EncodeBare(b *bin.Buffer) error { b.PutInt(g.OffsetDate) b.PutInt(g.OffsetID) if g.OffsetPeer == nil { - return fmt.Errorf("unable to encode messages.getDialogs#a0ee3b73: field offset_peer is nil") + return fmt.Errorf("unable to encode messages.getDialogs#a0f4cb4f: field offset_peer is nil") } if err := g.OffsetPeer.Encode(b); err != nil { - return fmt.Errorf("unable to encode messages.getDialogs#a0ee3b73: field offset_peer: %w", err) + return fmt.Errorf("unable to encode messages.getDialogs#a0f4cb4f: field offset_peer: %w", err) } b.PutInt(g.Limit) - b.PutInt(g.Hash) + b.PutLong(g.Hash) return nil } // Decode implements bin.Decoder. func (g *MessagesGetDialogsRequest) Decode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode messages.getDialogs#a0ee3b73 to nil") + return fmt.Errorf("can't decode messages.getDialogs#a0f4cb4f to nil") } if err := b.ConsumeID(MessagesGetDialogsRequestTypeID); err != nil { - return fmt.Errorf("unable to decode messages.getDialogs#a0ee3b73: %w", err) + return fmt.Errorf("unable to decode messages.getDialogs#a0f4cb4f: %w", err) } return g.DecodeBare(b) } @@ -256,53 +256,53 @@ func (g *MessagesGetDialogsRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (g *MessagesGetDialogsRequest) DecodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode messages.getDialogs#a0ee3b73 to nil") + return fmt.Errorf("can't decode messages.getDialogs#a0f4cb4f to nil") } { if err := g.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode messages.getDialogs#a0ee3b73: field flags: %w", err) + return fmt.Errorf("unable to decode messages.getDialogs#a0f4cb4f: field flags: %w", err) } } g.ExcludePinned = g.Flags.Has(0) if g.Flags.Has(1) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messages.getDialogs#a0ee3b73: field folder_id: %w", err) + return fmt.Errorf("unable to decode messages.getDialogs#a0f4cb4f: field folder_id: %w", err) } g.FolderID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messages.getDialogs#a0ee3b73: field offset_date: %w", err) + return fmt.Errorf("unable to decode messages.getDialogs#a0f4cb4f: field offset_date: %w", err) } g.OffsetDate = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messages.getDialogs#a0ee3b73: field offset_id: %w", err) + return fmt.Errorf("unable to decode messages.getDialogs#a0f4cb4f: field offset_id: %w", err) } g.OffsetID = value } { value, err := DecodeInputPeer(b) if err != nil { - return fmt.Errorf("unable to decode messages.getDialogs#a0ee3b73: field offset_peer: %w", err) + return fmt.Errorf("unable to decode messages.getDialogs#a0f4cb4f: field offset_peer: %w", err) } g.OffsetPeer = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messages.getDialogs#a0ee3b73: field limit: %w", err) + return fmt.Errorf("unable to decode messages.getDialogs#a0f4cb4f: field limit: %w", err) } g.Limit = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messages.getDialogs#a0ee3b73: field hash: %w", err) + return fmt.Errorf("unable to decode messages.getDialogs#a0f4cb4f: field hash: %w", err) } g.Hash = value } @@ -361,11 +361,11 @@ func (g *MessagesGetDialogsRequest) GetLimit() (value int) { } // GetHash returns value of Hash field. -func (g *MessagesGetDialogsRequest) GetHash() (value int) { +func (g *MessagesGetDialogsRequest) GetHash() (value int64) { return g.Hash } -// MessagesGetDialogs invokes method messages.getDialogs#a0ee3b73 returning error if any. +// MessagesGetDialogs invokes method messages.getDialogs#a0f4cb4f returning error if any. // Returns the current user dialog list. // // Possible errors: diff --git a/tg/tl_messages_get_faved_stickers_gen.go b/tg/tl_messages_get_faved_stickers_gen.go index 2eec49ded7..2850bb2a8f 100644 --- a/tg/tl_messages_get_faved_stickers_gen.go +++ b/tg/tl_messages_get_faved_stickers_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// MessagesGetFavedStickersRequest represents TL type `messages.getFavedStickers#21ce0b0e`. +// MessagesGetFavedStickersRequest represents TL type `messages.getFavedStickers#4f1aaa9`. // Get faved stickers // // See https://core.telegram.org/method/messages.getFavedStickers for reference. @@ -38,11 +38,11 @@ type MessagesGetFavedStickersRequest struct { // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation - Hash int + Hash int64 } // MessagesGetFavedStickersRequestTypeID is TL type id of MessagesGetFavedStickersRequest. -const MessagesGetFavedStickersRequestTypeID = 0x21ce0b0e +const MessagesGetFavedStickersRequestTypeID = 0x4f1aaa9 // Ensuring interfaces in compile-time for MessagesGetFavedStickersRequest. var ( @@ -74,7 +74,7 @@ func (g *MessagesGetFavedStickersRequest) String() string { // FillFrom fills MessagesGetFavedStickersRequest from given interface. func (g *MessagesGetFavedStickersRequest) FillFrom(from interface { - GetHash() (value int) + GetHash() (value int64) }) { g.Hash = from.GetHash() } @@ -113,7 +113,7 @@ func (g *MessagesGetFavedStickersRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (g *MessagesGetFavedStickersRequest) Encode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode messages.getFavedStickers#21ce0b0e as nil") + return fmt.Errorf("can't encode messages.getFavedStickers#4f1aaa9 as nil") } b.PutID(MessagesGetFavedStickersRequestTypeID) return g.EncodeBare(b) @@ -122,19 +122,19 @@ func (g *MessagesGetFavedStickersRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (g *MessagesGetFavedStickersRequest) EncodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode messages.getFavedStickers#21ce0b0e as nil") + return fmt.Errorf("can't encode messages.getFavedStickers#4f1aaa9 as nil") } - b.PutInt(g.Hash) + b.PutLong(g.Hash) return nil } // Decode implements bin.Decoder. func (g *MessagesGetFavedStickersRequest) Decode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode messages.getFavedStickers#21ce0b0e to nil") + return fmt.Errorf("can't decode messages.getFavedStickers#4f1aaa9 to nil") } if err := b.ConsumeID(MessagesGetFavedStickersRequestTypeID); err != nil { - return fmt.Errorf("unable to decode messages.getFavedStickers#21ce0b0e: %w", err) + return fmt.Errorf("unable to decode messages.getFavedStickers#4f1aaa9: %w", err) } return g.DecodeBare(b) } @@ -142,12 +142,12 @@ func (g *MessagesGetFavedStickersRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (g *MessagesGetFavedStickersRequest) DecodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode messages.getFavedStickers#21ce0b0e to nil") + return fmt.Errorf("can't decode messages.getFavedStickers#4f1aaa9 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messages.getFavedStickers#21ce0b0e: field hash: %w", err) + return fmt.Errorf("unable to decode messages.getFavedStickers#4f1aaa9: field hash: %w", err) } g.Hash = value } @@ -155,15 +155,15 @@ func (g *MessagesGetFavedStickersRequest) DecodeBare(b *bin.Buffer) error { } // GetHash returns value of Hash field. -func (g *MessagesGetFavedStickersRequest) GetHash() (value int) { +func (g *MessagesGetFavedStickersRequest) GetHash() (value int64) { return g.Hash } -// MessagesGetFavedStickers invokes method messages.getFavedStickers#21ce0b0e returning error if any. +// MessagesGetFavedStickers invokes method messages.getFavedStickers#4f1aaa9 returning error if any. // Get faved stickers // // See https://core.telegram.org/method/messages.getFavedStickers for reference. -func (c *Client) MessagesGetFavedStickers(ctx context.Context, hash int) (MessagesFavedStickersClass, error) { +func (c *Client) MessagesGetFavedStickers(ctx context.Context, hash int64) (MessagesFavedStickersClass, error) { var result MessagesFavedStickersBox request := &MessagesGetFavedStickersRequest{ diff --git a/tg/tl_messages_get_featured_stickers_gen.go b/tg/tl_messages_get_featured_stickers_gen.go index 7e37f2784d..6c15adc204 100644 --- a/tg/tl_messages_get_featured_stickers_gen.go +++ b/tg/tl_messages_get_featured_stickers_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// MessagesGetFeaturedStickersRequest represents TL type `messages.getFeaturedStickers#2dacca4f`. +// MessagesGetFeaturedStickersRequest represents TL type `messages.getFeaturedStickers#64780b14`. // Get featured stickers // // See https://core.telegram.org/method/messages.getFeaturedStickers for reference. @@ -38,11 +38,11 @@ type MessagesGetFeaturedStickersRequest struct { // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation - Hash int + Hash int64 } // MessagesGetFeaturedStickersRequestTypeID is TL type id of MessagesGetFeaturedStickersRequest. -const MessagesGetFeaturedStickersRequestTypeID = 0x2dacca4f +const MessagesGetFeaturedStickersRequestTypeID = 0x64780b14 // Ensuring interfaces in compile-time for MessagesGetFeaturedStickersRequest. var ( @@ -74,7 +74,7 @@ func (g *MessagesGetFeaturedStickersRequest) String() string { // FillFrom fills MessagesGetFeaturedStickersRequest from given interface. func (g *MessagesGetFeaturedStickersRequest) FillFrom(from interface { - GetHash() (value int) + GetHash() (value int64) }) { g.Hash = from.GetHash() } @@ -113,7 +113,7 @@ func (g *MessagesGetFeaturedStickersRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (g *MessagesGetFeaturedStickersRequest) Encode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode messages.getFeaturedStickers#2dacca4f as nil") + return fmt.Errorf("can't encode messages.getFeaturedStickers#64780b14 as nil") } b.PutID(MessagesGetFeaturedStickersRequestTypeID) return g.EncodeBare(b) @@ -122,19 +122,19 @@ func (g *MessagesGetFeaturedStickersRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (g *MessagesGetFeaturedStickersRequest) EncodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode messages.getFeaturedStickers#2dacca4f as nil") + return fmt.Errorf("can't encode messages.getFeaturedStickers#64780b14 as nil") } - b.PutInt(g.Hash) + b.PutLong(g.Hash) return nil } // Decode implements bin.Decoder. func (g *MessagesGetFeaturedStickersRequest) Decode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode messages.getFeaturedStickers#2dacca4f to nil") + return fmt.Errorf("can't decode messages.getFeaturedStickers#64780b14 to nil") } if err := b.ConsumeID(MessagesGetFeaturedStickersRequestTypeID); err != nil { - return fmt.Errorf("unable to decode messages.getFeaturedStickers#2dacca4f: %w", err) + return fmt.Errorf("unable to decode messages.getFeaturedStickers#64780b14: %w", err) } return g.DecodeBare(b) } @@ -142,12 +142,12 @@ func (g *MessagesGetFeaturedStickersRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (g *MessagesGetFeaturedStickersRequest) DecodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode messages.getFeaturedStickers#2dacca4f to nil") + return fmt.Errorf("can't decode messages.getFeaturedStickers#64780b14 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messages.getFeaturedStickers#2dacca4f: field hash: %w", err) + return fmt.Errorf("unable to decode messages.getFeaturedStickers#64780b14: field hash: %w", err) } g.Hash = value } @@ -155,15 +155,15 @@ func (g *MessagesGetFeaturedStickersRequest) DecodeBare(b *bin.Buffer) error { } // GetHash returns value of Hash field. -func (g *MessagesGetFeaturedStickersRequest) GetHash() (value int) { +func (g *MessagesGetFeaturedStickersRequest) GetHash() (value int64) { return g.Hash } -// MessagesGetFeaturedStickers invokes method messages.getFeaturedStickers#2dacca4f returning error if any. +// MessagesGetFeaturedStickers invokes method messages.getFeaturedStickers#64780b14 returning error if any. // Get featured stickers // // See https://core.telegram.org/method/messages.getFeaturedStickers for reference. -func (c *Client) MessagesGetFeaturedStickers(ctx context.Context, hash int) (MessagesFeaturedStickersClass, error) { +func (c *Client) MessagesGetFeaturedStickers(ctx context.Context, hash int64) (MessagesFeaturedStickersClass, error) { var result MessagesFeaturedStickersBox request := &MessagesGetFeaturedStickersRequest{ diff --git a/tg/tl_messages_get_full_chat_gen.go b/tg/tl_messages_get_full_chat_gen.go index de64a79a22..3f07593423 100644 --- a/tg/tl_messages_get_full_chat_gen.go +++ b/tg/tl_messages_get_full_chat_gen.go @@ -29,17 +29,17 @@ var ( _ = tgerr.Error{} ) -// MessagesGetFullChatRequest represents TL type `messages.getFullChat#3b831c66`. +// MessagesGetFullChatRequest represents TL type `messages.getFullChat#aeb00b34`. // Returns full chat info according to its ID. // // See https://core.telegram.org/method/messages.getFullChat for reference. type MessagesGetFullChatRequest struct { // Chat ID - ChatID int + ChatID int64 } // MessagesGetFullChatRequestTypeID is TL type id of MessagesGetFullChatRequest. -const MessagesGetFullChatRequestTypeID = 0x3b831c66 +const MessagesGetFullChatRequestTypeID = 0xaeb00b34 // Ensuring interfaces in compile-time for MessagesGetFullChatRequest. var ( @@ -71,7 +71,7 @@ func (g *MessagesGetFullChatRequest) String() string { // FillFrom fills MessagesGetFullChatRequest from given interface. func (g *MessagesGetFullChatRequest) FillFrom(from interface { - GetChatID() (value int) + GetChatID() (value int64) }) { g.ChatID = from.GetChatID() } @@ -110,7 +110,7 @@ func (g *MessagesGetFullChatRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (g *MessagesGetFullChatRequest) Encode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode messages.getFullChat#3b831c66 as nil") + return fmt.Errorf("can't encode messages.getFullChat#aeb00b34 as nil") } b.PutID(MessagesGetFullChatRequestTypeID) return g.EncodeBare(b) @@ -119,19 +119,19 @@ func (g *MessagesGetFullChatRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (g *MessagesGetFullChatRequest) EncodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode messages.getFullChat#3b831c66 as nil") + return fmt.Errorf("can't encode messages.getFullChat#aeb00b34 as nil") } - b.PutInt(g.ChatID) + b.PutLong(g.ChatID) return nil } // Decode implements bin.Decoder. func (g *MessagesGetFullChatRequest) Decode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode messages.getFullChat#3b831c66 to nil") + return fmt.Errorf("can't decode messages.getFullChat#aeb00b34 to nil") } if err := b.ConsumeID(MessagesGetFullChatRequestTypeID); err != nil { - return fmt.Errorf("unable to decode messages.getFullChat#3b831c66: %w", err) + return fmt.Errorf("unable to decode messages.getFullChat#aeb00b34: %w", err) } return g.DecodeBare(b) } @@ -139,12 +139,12 @@ func (g *MessagesGetFullChatRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (g *MessagesGetFullChatRequest) DecodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode messages.getFullChat#3b831c66 to nil") + return fmt.Errorf("can't decode messages.getFullChat#aeb00b34 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messages.getFullChat#3b831c66: field chat_id: %w", err) + return fmt.Errorf("unable to decode messages.getFullChat#aeb00b34: field chat_id: %w", err) } g.ChatID = value } @@ -152,11 +152,11 @@ func (g *MessagesGetFullChatRequest) DecodeBare(b *bin.Buffer) error { } // GetChatID returns value of ChatID field. -func (g *MessagesGetFullChatRequest) GetChatID() (value int) { +func (g *MessagesGetFullChatRequest) GetChatID() (value int64) { return g.ChatID } -// MessagesGetFullChat invokes method messages.getFullChat#3b831c66 returning error if any. +// MessagesGetFullChat invokes method messages.getFullChat#aeb00b34 returning error if any. // Returns full chat info according to its ID. // // Possible errors: @@ -165,7 +165,7 @@ func (g *MessagesGetFullChatRequest) GetChatID() (value int) { // // See https://core.telegram.org/method/messages.getFullChat for reference. // Can be used by bots. -func (c *Client) MessagesGetFullChat(ctx context.Context, chatid int) (*MessagesChatFull, error) { +func (c *Client) MessagesGetFullChat(ctx context.Context, chatid int64) (*MessagesChatFull, error) { var result MessagesChatFull request := &MessagesGetFullChatRequest{ diff --git a/tg/tl_messages_get_history_gen.go b/tg/tl_messages_get_history_gen.go index b579e3d876..be6ac6e162 100644 --- a/tg/tl_messages_get_history_gen.go +++ b/tg/tl_messages_get_history_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// MessagesGetHistoryRequest represents TL type `messages.getHistory#dcbb8260`. +// MessagesGetHistoryRequest represents TL type `messages.getHistory#4423e6c5`. // Gets back the conversation history with one interlocutor / within a chat // // See https://core.telegram.org/method/messages.getHistory for reference. @@ -54,11 +54,11 @@ type MessagesGetHistoryRequest struct { // // Links: // 1) https://core.telegram.org/api/offsets - Hash int + Hash int64 } // MessagesGetHistoryRequestTypeID is TL type id of MessagesGetHistoryRequest. -const MessagesGetHistoryRequestTypeID = 0xdcbb8260 +const MessagesGetHistoryRequestTypeID = 0x4423e6c5 // Ensuring interfaces in compile-time for MessagesGetHistoryRequest. var ( @@ -118,7 +118,7 @@ func (g *MessagesGetHistoryRequest) FillFrom(from interface { GetLimit() (value int) GetMaxID() (value int) GetMinID() (value int) - GetHash() (value int) + GetHash() (value int64) }) { g.Peer = from.GetPeer() g.OffsetID = from.GetOffsetID() @@ -192,7 +192,7 @@ func (g *MessagesGetHistoryRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (g *MessagesGetHistoryRequest) Encode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode messages.getHistory#dcbb8260 as nil") + return fmt.Errorf("can't encode messages.getHistory#4423e6c5 as nil") } b.PutID(MessagesGetHistoryRequestTypeID) return g.EncodeBare(b) @@ -201,13 +201,13 @@ func (g *MessagesGetHistoryRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (g *MessagesGetHistoryRequest) EncodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode messages.getHistory#dcbb8260 as nil") + return fmt.Errorf("can't encode messages.getHistory#4423e6c5 as nil") } if g.Peer == nil { - return fmt.Errorf("unable to encode messages.getHistory#dcbb8260: field peer is nil") + return fmt.Errorf("unable to encode messages.getHistory#4423e6c5: field peer is nil") } if err := g.Peer.Encode(b); err != nil { - return fmt.Errorf("unable to encode messages.getHistory#dcbb8260: field peer: %w", err) + return fmt.Errorf("unable to encode messages.getHistory#4423e6c5: field peer: %w", err) } b.PutInt(g.OffsetID) b.PutInt(g.OffsetDate) @@ -215,17 +215,17 @@ func (g *MessagesGetHistoryRequest) EncodeBare(b *bin.Buffer) error { b.PutInt(g.Limit) b.PutInt(g.MaxID) b.PutInt(g.MinID) - b.PutInt(g.Hash) + b.PutLong(g.Hash) return nil } // Decode implements bin.Decoder. func (g *MessagesGetHistoryRequest) Decode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode messages.getHistory#dcbb8260 to nil") + return fmt.Errorf("can't decode messages.getHistory#4423e6c5 to nil") } if err := b.ConsumeID(MessagesGetHistoryRequestTypeID); err != nil { - return fmt.Errorf("unable to decode messages.getHistory#dcbb8260: %w", err) + return fmt.Errorf("unable to decode messages.getHistory#4423e6c5: %w", err) } return g.DecodeBare(b) } @@ -233,61 +233,61 @@ func (g *MessagesGetHistoryRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (g *MessagesGetHistoryRequest) DecodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode messages.getHistory#dcbb8260 to nil") + return fmt.Errorf("can't decode messages.getHistory#4423e6c5 to nil") } { value, err := DecodeInputPeer(b) if err != nil { - return fmt.Errorf("unable to decode messages.getHistory#dcbb8260: field peer: %w", err) + return fmt.Errorf("unable to decode messages.getHistory#4423e6c5: field peer: %w", err) } g.Peer = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messages.getHistory#dcbb8260: field offset_id: %w", err) + return fmt.Errorf("unable to decode messages.getHistory#4423e6c5: field offset_id: %w", err) } g.OffsetID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messages.getHistory#dcbb8260: field offset_date: %w", err) + return fmt.Errorf("unable to decode messages.getHistory#4423e6c5: field offset_date: %w", err) } g.OffsetDate = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messages.getHistory#dcbb8260: field add_offset: %w", err) + return fmt.Errorf("unable to decode messages.getHistory#4423e6c5: field add_offset: %w", err) } g.AddOffset = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messages.getHistory#dcbb8260: field limit: %w", err) + return fmt.Errorf("unable to decode messages.getHistory#4423e6c5: field limit: %w", err) } g.Limit = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messages.getHistory#dcbb8260: field max_id: %w", err) + return fmt.Errorf("unable to decode messages.getHistory#4423e6c5: field max_id: %w", err) } g.MaxID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messages.getHistory#dcbb8260: field min_id: %w", err) + return fmt.Errorf("unable to decode messages.getHistory#4423e6c5: field min_id: %w", err) } g.MinID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messages.getHistory#dcbb8260: field hash: %w", err) + return fmt.Errorf("unable to decode messages.getHistory#4423e6c5: field hash: %w", err) } g.Hash = value } @@ -330,11 +330,11 @@ func (g *MessagesGetHistoryRequest) GetMinID() (value int) { } // GetHash returns value of Hash field. -func (g *MessagesGetHistoryRequest) GetHash() (value int) { +func (g *MessagesGetHistoryRequest) GetHash() (value int64) { return g.Hash } -// MessagesGetHistory invokes method messages.getHistory#dcbb8260 returning error if any. +// MessagesGetHistory invokes method messages.getHistory#4423e6c5 returning error if any. // Gets back the conversation history with one interlocutor / within a chat // // Possible errors: diff --git a/tg/tl_messages_get_inline_game_high_scores_gen.go b/tg/tl_messages_get_inline_game_high_scores_gen.go index 615f788758..6a42b0e8b2 100644 --- a/tg/tl_messages_get_inline_game_high_scores_gen.go +++ b/tg/tl_messages_get_inline_game_high_scores_gen.go @@ -35,7 +35,7 @@ var ( // See https://core.telegram.org/method/messages.getInlineGameHighScores for reference. type MessagesGetInlineGameHighScoresRequest struct { // ID of inline message - ID InputBotInlineMessageID + ID InputBotInlineMessageIDClass // Get high scores of a certain user UserID InputUserClass } @@ -55,7 +55,7 @@ func (g *MessagesGetInlineGameHighScoresRequest) Zero() bool { if g == nil { return true } - if !(g.ID.Zero()) { + if !(g.ID == nil) { return false } if !(g.UserID == nil) { @@ -76,7 +76,7 @@ func (g *MessagesGetInlineGameHighScoresRequest) String() string { // FillFrom fills MessagesGetInlineGameHighScoresRequest from given interface. func (g *MessagesGetInlineGameHighScoresRequest) FillFrom(from interface { - GetID() (value InputBotInlineMessageID) + GetID() (value InputBotInlineMessageIDClass) GetUserID() (value InputUserClass) }) { g.ID = from.GetID() @@ -132,6 +132,9 @@ func (g *MessagesGetInlineGameHighScoresRequest) EncodeBare(b *bin.Buffer) error if g == nil { return fmt.Errorf("can't encode messages.getInlineGameHighScores#f635e1b as nil") } + if g.ID == nil { + return fmt.Errorf("unable to encode messages.getInlineGameHighScores#f635e1b: field id is nil") + } if err := g.ID.Encode(b); err != nil { return fmt.Errorf("unable to encode messages.getInlineGameHighScores#f635e1b: field id: %w", err) } @@ -161,9 +164,11 @@ func (g *MessagesGetInlineGameHighScoresRequest) DecodeBare(b *bin.Buffer) error return fmt.Errorf("can't decode messages.getInlineGameHighScores#f635e1b to nil") } { - if err := g.ID.Decode(b); err != nil { + value, err := DecodeInputBotInlineMessageID(b) + if err != nil { return fmt.Errorf("unable to decode messages.getInlineGameHighScores#f635e1b: field id: %w", err) } + g.ID = value } { value, err := DecodeInputUser(b) @@ -176,7 +181,7 @@ func (g *MessagesGetInlineGameHighScoresRequest) DecodeBare(b *bin.Buffer) error } // GetID returns value of ID field. -func (g *MessagesGetInlineGameHighScoresRequest) GetID() (value InputBotInlineMessageID) { +func (g *MessagesGetInlineGameHighScoresRequest) GetID() (value InputBotInlineMessageIDClass) { return g.ID } diff --git a/tg/tl_messages_get_mask_stickers_gen.go b/tg/tl_messages_get_mask_stickers_gen.go index 47619f1106..c2c5dcc824 100644 --- a/tg/tl_messages_get_mask_stickers_gen.go +++ b/tg/tl_messages_get_mask_stickers_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// MessagesGetMaskStickersRequest represents TL type `messages.getMaskStickers#65b8c79f`. +// MessagesGetMaskStickersRequest represents TL type `messages.getMaskStickers#640f82b8`. // Get installed mask stickers // // See https://core.telegram.org/method/messages.getMaskStickers for reference. @@ -38,11 +38,11 @@ type MessagesGetMaskStickersRequest struct { // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation - Hash int + Hash int64 } // MessagesGetMaskStickersRequestTypeID is TL type id of MessagesGetMaskStickersRequest. -const MessagesGetMaskStickersRequestTypeID = 0x65b8c79f +const MessagesGetMaskStickersRequestTypeID = 0x640f82b8 // Ensuring interfaces in compile-time for MessagesGetMaskStickersRequest. var ( @@ -74,7 +74,7 @@ func (g *MessagesGetMaskStickersRequest) String() string { // FillFrom fills MessagesGetMaskStickersRequest from given interface. func (g *MessagesGetMaskStickersRequest) FillFrom(from interface { - GetHash() (value int) + GetHash() (value int64) }) { g.Hash = from.GetHash() } @@ -113,7 +113,7 @@ func (g *MessagesGetMaskStickersRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (g *MessagesGetMaskStickersRequest) Encode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode messages.getMaskStickers#65b8c79f as nil") + return fmt.Errorf("can't encode messages.getMaskStickers#640f82b8 as nil") } b.PutID(MessagesGetMaskStickersRequestTypeID) return g.EncodeBare(b) @@ -122,19 +122,19 @@ func (g *MessagesGetMaskStickersRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (g *MessagesGetMaskStickersRequest) EncodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode messages.getMaskStickers#65b8c79f as nil") + return fmt.Errorf("can't encode messages.getMaskStickers#640f82b8 as nil") } - b.PutInt(g.Hash) + b.PutLong(g.Hash) return nil } // Decode implements bin.Decoder. func (g *MessagesGetMaskStickersRequest) Decode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode messages.getMaskStickers#65b8c79f to nil") + return fmt.Errorf("can't decode messages.getMaskStickers#640f82b8 to nil") } if err := b.ConsumeID(MessagesGetMaskStickersRequestTypeID); err != nil { - return fmt.Errorf("unable to decode messages.getMaskStickers#65b8c79f: %w", err) + return fmt.Errorf("unable to decode messages.getMaskStickers#640f82b8: %w", err) } return g.DecodeBare(b) } @@ -142,12 +142,12 @@ func (g *MessagesGetMaskStickersRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (g *MessagesGetMaskStickersRequest) DecodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode messages.getMaskStickers#65b8c79f to nil") + return fmt.Errorf("can't decode messages.getMaskStickers#640f82b8 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messages.getMaskStickers#65b8c79f: field hash: %w", err) + return fmt.Errorf("unable to decode messages.getMaskStickers#640f82b8: field hash: %w", err) } g.Hash = value } @@ -155,15 +155,15 @@ func (g *MessagesGetMaskStickersRequest) DecodeBare(b *bin.Buffer) error { } // GetHash returns value of Hash field. -func (g *MessagesGetMaskStickersRequest) GetHash() (value int) { +func (g *MessagesGetMaskStickersRequest) GetHash() (value int64) { return g.Hash } -// MessagesGetMaskStickers invokes method messages.getMaskStickers#65b8c79f returning error if any. +// MessagesGetMaskStickers invokes method messages.getMaskStickers#640f82b8 returning error if any. // Get installed mask stickers // // See https://core.telegram.org/method/messages.getMaskStickers for reference. -func (c *Client) MessagesGetMaskStickers(ctx context.Context, hash int) (MessagesAllStickersClass, error) { +func (c *Client) MessagesGetMaskStickers(ctx context.Context, hash int64) (MessagesAllStickersClass, error) { var result MessagesAllStickersBox request := &MessagesGetMaskStickersRequest{ diff --git a/tg/tl_messages_get_message_read_participants_gen.go b/tg/tl_messages_get_message_read_participants_gen.go new file mode 100644 index 0000000000..e927ed5bd3 --- /dev/null +++ b/tg/tl_messages_get_message_read_participants_gen.go @@ -0,0 +1,197 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} +) + +// MessagesGetMessageReadParticipantsRequest represents TL type `messages.getMessageReadParticipants#2c6f97b7`. +// +// See https://core.telegram.org/method/messages.getMessageReadParticipants for reference. +type MessagesGetMessageReadParticipantsRequest struct { + // Peer field of MessagesGetMessageReadParticipantsRequest. + Peer InputPeerClass + // MsgID field of MessagesGetMessageReadParticipantsRequest. + MsgID int +} + +// MessagesGetMessageReadParticipantsRequestTypeID is TL type id of MessagesGetMessageReadParticipantsRequest. +const MessagesGetMessageReadParticipantsRequestTypeID = 0x2c6f97b7 + +// Ensuring interfaces in compile-time for MessagesGetMessageReadParticipantsRequest. +var ( + _ bin.Encoder = &MessagesGetMessageReadParticipantsRequest{} + _ bin.Decoder = &MessagesGetMessageReadParticipantsRequest{} + _ bin.BareEncoder = &MessagesGetMessageReadParticipantsRequest{} + _ bin.BareDecoder = &MessagesGetMessageReadParticipantsRequest{} +) + +func (g *MessagesGetMessageReadParticipantsRequest) Zero() bool { + if g == nil { + return true + } + if !(g.Peer == nil) { + return false + } + if !(g.MsgID == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (g *MessagesGetMessageReadParticipantsRequest) String() string { + if g == nil { + return "MessagesGetMessageReadParticipantsRequest(nil)" + } + type Alias MessagesGetMessageReadParticipantsRequest + return fmt.Sprintf("MessagesGetMessageReadParticipantsRequest%+v", Alias(*g)) +} + +// FillFrom fills MessagesGetMessageReadParticipantsRequest from given interface. +func (g *MessagesGetMessageReadParticipantsRequest) FillFrom(from interface { + GetPeer() (value InputPeerClass) + GetMsgID() (value int) +}) { + g.Peer = from.GetPeer() + g.MsgID = from.GetMsgID() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*MessagesGetMessageReadParticipantsRequest) TypeID() uint32 { + return MessagesGetMessageReadParticipantsRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*MessagesGetMessageReadParticipantsRequest) TypeName() string { + return "messages.getMessageReadParticipants" +} + +// TypeInfo returns info about TL type. +func (g *MessagesGetMessageReadParticipantsRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "messages.getMessageReadParticipants", + ID: MessagesGetMessageReadParticipantsRequestTypeID, + } + if g == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Peer", + SchemaName: "peer", + }, + { + Name: "MsgID", + SchemaName: "msg_id", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (g *MessagesGetMessageReadParticipantsRequest) Encode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode messages.getMessageReadParticipants#2c6f97b7 as nil") + } + b.PutID(MessagesGetMessageReadParticipantsRequestTypeID) + return g.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (g *MessagesGetMessageReadParticipantsRequest) EncodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode messages.getMessageReadParticipants#2c6f97b7 as nil") + } + if g.Peer == nil { + return fmt.Errorf("unable to encode messages.getMessageReadParticipants#2c6f97b7: field peer is nil") + } + if err := g.Peer.Encode(b); err != nil { + return fmt.Errorf("unable to encode messages.getMessageReadParticipants#2c6f97b7: field peer: %w", err) + } + b.PutInt(g.MsgID) + return nil +} + +// Decode implements bin.Decoder. +func (g *MessagesGetMessageReadParticipantsRequest) Decode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode messages.getMessageReadParticipants#2c6f97b7 to nil") + } + if err := b.ConsumeID(MessagesGetMessageReadParticipantsRequestTypeID); err != nil { + return fmt.Errorf("unable to decode messages.getMessageReadParticipants#2c6f97b7: %w", err) + } + return g.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (g *MessagesGetMessageReadParticipantsRequest) DecodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode messages.getMessageReadParticipants#2c6f97b7 to nil") + } + { + value, err := DecodeInputPeer(b) + if err != nil { + return fmt.Errorf("unable to decode messages.getMessageReadParticipants#2c6f97b7: field peer: %w", err) + } + g.Peer = value + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode messages.getMessageReadParticipants#2c6f97b7: field msg_id: %w", err) + } + g.MsgID = value + } + return nil +} + +// GetPeer returns value of Peer field. +func (g *MessagesGetMessageReadParticipantsRequest) GetPeer() (value InputPeerClass) { + return g.Peer +} + +// GetMsgID returns value of MsgID field. +func (g *MessagesGetMessageReadParticipantsRequest) GetMsgID() (value int) { + return g.MsgID +} + +// MessagesGetMessageReadParticipants invokes method messages.getMessageReadParticipants#2c6f97b7 returning error if any. +// +// See https://core.telegram.org/method/messages.getMessageReadParticipants for reference. +func (c *Client) MessagesGetMessageReadParticipants(ctx context.Context, request *MessagesGetMessageReadParticipantsRequest) ([]int64, error) { + var result LongVector + + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return []int64(result.Elems), nil +} diff --git a/tg/tl_messages_get_message_read_participants_slices_gen.go b/tg/tl_messages_get_message_read_participants_slices_gen.go new file mode 100644 index 0000000000..3f6f19f6f5 --- /dev/null +++ b/tg/tl_messages_get_message_read_participants_slices_gen.go @@ -0,0 +1,33 @@ +//go:build !no_gotd_slices +// +build !no_gotd_slices + +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} +) diff --git a/tg/tl_messages_get_old_featured_stickers_gen.go b/tg/tl_messages_get_old_featured_stickers_gen.go index c6d17b870c..b0a3c6d21b 100644 --- a/tg/tl_messages_get_old_featured_stickers_gen.go +++ b/tg/tl_messages_get_old_featured_stickers_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// MessagesGetOldFeaturedStickersRequest represents TL type `messages.getOldFeaturedStickers#5fe7025b`. +// MessagesGetOldFeaturedStickersRequest represents TL type `messages.getOldFeaturedStickers#7ed094a1`. // Method for fetching previously featured stickers // // See https://core.telegram.org/method/messages.getOldFeaturedStickers for reference. @@ -45,11 +45,11 @@ type MessagesGetOldFeaturedStickersRequest struct { // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation - Hash int + Hash int64 } // MessagesGetOldFeaturedStickersRequestTypeID is TL type id of MessagesGetOldFeaturedStickersRequest. -const MessagesGetOldFeaturedStickersRequestTypeID = 0x5fe7025b +const MessagesGetOldFeaturedStickersRequestTypeID = 0x7ed094a1 // Ensuring interfaces in compile-time for MessagesGetOldFeaturedStickersRequest. var ( @@ -89,7 +89,7 @@ func (g *MessagesGetOldFeaturedStickersRequest) String() string { func (g *MessagesGetOldFeaturedStickersRequest) FillFrom(from interface { GetOffset() (value int) GetLimit() (value int) - GetHash() (value int) + GetHash() (value int64) }) { g.Offset = from.GetOffset() g.Limit = from.GetLimit() @@ -138,7 +138,7 @@ func (g *MessagesGetOldFeaturedStickersRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (g *MessagesGetOldFeaturedStickersRequest) Encode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode messages.getOldFeaturedStickers#5fe7025b as nil") + return fmt.Errorf("can't encode messages.getOldFeaturedStickers#7ed094a1 as nil") } b.PutID(MessagesGetOldFeaturedStickersRequestTypeID) return g.EncodeBare(b) @@ -147,21 +147,21 @@ func (g *MessagesGetOldFeaturedStickersRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (g *MessagesGetOldFeaturedStickersRequest) EncodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode messages.getOldFeaturedStickers#5fe7025b as nil") + return fmt.Errorf("can't encode messages.getOldFeaturedStickers#7ed094a1 as nil") } b.PutInt(g.Offset) b.PutInt(g.Limit) - b.PutInt(g.Hash) + b.PutLong(g.Hash) return nil } // Decode implements bin.Decoder. func (g *MessagesGetOldFeaturedStickersRequest) Decode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode messages.getOldFeaturedStickers#5fe7025b to nil") + return fmt.Errorf("can't decode messages.getOldFeaturedStickers#7ed094a1 to nil") } if err := b.ConsumeID(MessagesGetOldFeaturedStickersRequestTypeID); err != nil { - return fmt.Errorf("unable to decode messages.getOldFeaturedStickers#5fe7025b: %w", err) + return fmt.Errorf("unable to decode messages.getOldFeaturedStickers#7ed094a1: %w", err) } return g.DecodeBare(b) } @@ -169,26 +169,26 @@ func (g *MessagesGetOldFeaturedStickersRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (g *MessagesGetOldFeaturedStickersRequest) DecodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode messages.getOldFeaturedStickers#5fe7025b to nil") + return fmt.Errorf("can't decode messages.getOldFeaturedStickers#7ed094a1 to nil") } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messages.getOldFeaturedStickers#5fe7025b: field offset: %w", err) + return fmt.Errorf("unable to decode messages.getOldFeaturedStickers#7ed094a1: field offset: %w", err) } g.Offset = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messages.getOldFeaturedStickers#5fe7025b: field limit: %w", err) + return fmt.Errorf("unable to decode messages.getOldFeaturedStickers#7ed094a1: field limit: %w", err) } g.Limit = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messages.getOldFeaturedStickers#5fe7025b: field hash: %w", err) + return fmt.Errorf("unable to decode messages.getOldFeaturedStickers#7ed094a1: field hash: %w", err) } g.Hash = value } @@ -206,11 +206,11 @@ func (g *MessagesGetOldFeaturedStickersRequest) GetLimit() (value int) { } // GetHash returns value of Hash field. -func (g *MessagesGetOldFeaturedStickersRequest) GetHash() (value int) { +func (g *MessagesGetOldFeaturedStickersRequest) GetHash() (value int64) { return g.Hash } -// MessagesGetOldFeaturedStickers invokes method messages.getOldFeaturedStickers#5fe7025b returning error if any. +// MessagesGetOldFeaturedStickers invokes method messages.getOldFeaturedStickers#7ed094a1 returning error if any. // Method for fetching previously featured stickers // // See https://core.telegram.org/method/messages.getOldFeaturedStickers for reference. diff --git a/tg/tl_messages_get_recent_locations_gen.go b/tg/tl_messages_get_recent_locations_gen.go index 74bdf8a569..75b5ca79a6 100644 --- a/tg/tl_messages_get_recent_locations_gen.go +++ b/tg/tl_messages_get_recent_locations_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// MessagesGetRecentLocationsRequest represents TL type `messages.getRecentLocations#bbc45b09`. +// MessagesGetRecentLocationsRequest represents TL type `messages.getRecentLocations#702a40e0`. // Get live location history of a certain user // // See https://core.telegram.org/method/messages.getRecentLocations for reference. @@ -45,11 +45,11 @@ type MessagesGetRecentLocationsRequest struct { // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation - Hash int + Hash int64 } // MessagesGetRecentLocationsRequestTypeID is TL type id of MessagesGetRecentLocationsRequest. -const MessagesGetRecentLocationsRequestTypeID = 0xbbc45b09 +const MessagesGetRecentLocationsRequestTypeID = 0x702a40e0 // Ensuring interfaces in compile-time for MessagesGetRecentLocationsRequest. var ( @@ -89,7 +89,7 @@ func (g *MessagesGetRecentLocationsRequest) String() string { func (g *MessagesGetRecentLocationsRequest) FillFrom(from interface { GetPeer() (value InputPeerClass) GetLimit() (value int) - GetHash() (value int) + GetHash() (value int64) }) { g.Peer = from.GetPeer() g.Limit = from.GetLimit() @@ -138,7 +138,7 @@ func (g *MessagesGetRecentLocationsRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (g *MessagesGetRecentLocationsRequest) Encode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode messages.getRecentLocations#bbc45b09 as nil") + return fmt.Errorf("can't encode messages.getRecentLocations#702a40e0 as nil") } b.PutID(MessagesGetRecentLocationsRequestTypeID) return g.EncodeBare(b) @@ -147,26 +147,26 @@ func (g *MessagesGetRecentLocationsRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (g *MessagesGetRecentLocationsRequest) EncodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode messages.getRecentLocations#bbc45b09 as nil") + return fmt.Errorf("can't encode messages.getRecentLocations#702a40e0 as nil") } if g.Peer == nil { - return fmt.Errorf("unable to encode messages.getRecentLocations#bbc45b09: field peer is nil") + return fmt.Errorf("unable to encode messages.getRecentLocations#702a40e0: field peer is nil") } if err := g.Peer.Encode(b); err != nil { - return fmt.Errorf("unable to encode messages.getRecentLocations#bbc45b09: field peer: %w", err) + return fmt.Errorf("unable to encode messages.getRecentLocations#702a40e0: field peer: %w", err) } b.PutInt(g.Limit) - b.PutInt(g.Hash) + b.PutLong(g.Hash) return nil } // Decode implements bin.Decoder. func (g *MessagesGetRecentLocationsRequest) Decode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode messages.getRecentLocations#bbc45b09 to nil") + return fmt.Errorf("can't decode messages.getRecentLocations#702a40e0 to nil") } if err := b.ConsumeID(MessagesGetRecentLocationsRequestTypeID); err != nil { - return fmt.Errorf("unable to decode messages.getRecentLocations#bbc45b09: %w", err) + return fmt.Errorf("unable to decode messages.getRecentLocations#702a40e0: %w", err) } return g.DecodeBare(b) } @@ -174,26 +174,26 @@ func (g *MessagesGetRecentLocationsRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (g *MessagesGetRecentLocationsRequest) DecodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode messages.getRecentLocations#bbc45b09 to nil") + return fmt.Errorf("can't decode messages.getRecentLocations#702a40e0 to nil") } { value, err := DecodeInputPeer(b) if err != nil { - return fmt.Errorf("unable to decode messages.getRecentLocations#bbc45b09: field peer: %w", err) + return fmt.Errorf("unable to decode messages.getRecentLocations#702a40e0: field peer: %w", err) } g.Peer = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messages.getRecentLocations#bbc45b09: field limit: %w", err) + return fmt.Errorf("unable to decode messages.getRecentLocations#702a40e0: field limit: %w", err) } g.Limit = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messages.getRecentLocations#bbc45b09: field hash: %w", err) + return fmt.Errorf("unable to decode messages.getRecentLocations#702a40e0: field hash: %w", err) } g.Hash = value } @@ -211,11 +211,11 @@ func (g *MessagesGetRecentLocationsRequest) GetLimit() (value int) { } // GetHash returns value of Hash field. -func (g *MessagesGetRecentLocationsRequest) GetHash() (value int) { +func (g *MessagesGetRecentLocationsRequest) GetHash() (value int64) { return g.Hash } -// MessagesGetRecentLocations invokes method messages.getRecentLocations#bbc45b09 returning error if any. +// MessagesGetRecentLocations invokes method messages.getRecentLocations#702a40e0 returning error if any. // Get live location history of a certain user // // See https://core.telegram.org/method/messages.getRecentLocations for reference. diff --git a/tg/tl_messages_get_recent_stickers_gen.go b/tg/tl_messages_get_recent_stickers_gen.go index db89792d86..7ea94698d2 100644 --- a/tg/tl_messages_get_recent_stickers_gen.go +++ b/tg/tl_messages_get_recent_stickers_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// MessagesGetRecentStickersRequest represents TL type `messages.getRecentStickers#5ea192c9`. +// MessagesGetRecentStickersRequest represents TL type `messages.getRecentStickers#9da9403b`. // Get recent stickers // // See https://core.telegram.org/method/messages.getRecentStickers for reference. @@ -45,11 +45,11 @@ type MessagesGetRecentStickersRequest struct { // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation - Hash int + Hash int64 } // MessagesGetRecentStickersRequestTypeID is TL type id of MessagesGetRecentStickersRequest. -const MessagesGetRecentStickersRequestTypeID = 0x5ea192c9 +const MessagesGetRecentStickersRequestTypeID = 0x9da9403b // Ensuring interfaces in compile-time for MessagesGetRecentStickersRequest. var ( @@ -88,7 +88,7 @@ func (g *MessagesGetRecentStickersRequest) String() string { // FillFrom fills MessagesGetRecentStickersRequest from given interface. func (g *MessagesGetRecentStickersRequest) FillFrom(from interface { GetAttached() (value bool) - GetHash() (value int) + GetHash() (value int64) }) { g.Attached = from.GetAttached() g.Hash = from.GetHash() @@ -133,7 +133,7 @@ func (g *MessagesGetRecentStickersRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (g *MessagesGetRecentStickersRequest) Encode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode messages.getRecentStickers#5ea192c9 as nil") + return fmt.Errorf("can't encode messages.getRecentStickers#9da9403b as nil") } b.PutID(MessagesGetRecentStickersRequestTypeID) return g.EncodeBare(b) @@ -142,25 +142,25 @@ func (g *MessagesGetRecentStickersRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (g *MessagesGetRecentStickersRequest) EncodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode messages.getRecentStickers#5ea192c9 as nil") + return fmt.Errorf("can't encode messages.getRecentStickers#9da9403b as nil") } if !(g.Attached == false) { g.Flags.Set(0) } if err := g.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode messages.getRecentStickers#5ea192c9: field flags: %w", err) + return fmt.Errorf("unable to encode messages.getRecentStickers#9da9403b: field flags: %w", err) } - b.PutInt(g.Hash) + b.PutLong(g.Hash) return nil } // Decode implements bin.Decoder. func (g *MessagesGetRecentStickersRequest) Decode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode messages.getRecentStickers#5ea192c9 to nil") + return fmt.Errorf("can't decode messages.getRecentStickers#9da9403b to nil") } if err := b.ConsumeID(MessagesGetRecentStickersRequestTypeID); err != nil { - return fmt.Errorf("unable to decode messages.getRecentStickers#5ea192c9: %w", err) + return fmt.Errorf("unable to decode messages.getRecentStickers#9da9403b: %w", err) } return g.DecodeBare(b) } @@ -168,18 +168,18 @@ func (g *MessagesGetRecentStickersRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (g *MessagesGetRecentStickersRequest) DecodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode messages.getRecentStickers#5ea192c9 to nil") + return fmt.Errorf("can't decode messages.getRecentStickers#9da9403b to nil") } { if err := g.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode messages.getRecentStickers#5ea192c9: field flags: %w", err) + return fmt.Errorf("unable to decode messages.getRecentStickers#9da9403b: field flags: %w", err) } } g.Attached = g.Flags.Has(0) { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messages.getRecentStickers#5ea192c9: field hash: %w", err) + return fmt.Errorf("unable to decode messages.getRecentStickers#9da9403b: field hash: %w", err) } g.Hash = value } @@ -203,11 +203,11 @@ func (g *MessagesGetRecentStickersRequest) GetAttached() (value bool) { } // GetHash returns value of Hash field. -func (g *MessagesGetRecentStickersRequest) GetHash() (value int) { +func (g *MessagesGetRecentStickersRequest) GetHash() (value int64) { return g.Hash } -// MessagesGetRecentStickers invokes method messages.getRecentStickers#5ea192c9 returning error if any. +// MessagesGetRecentStickers invokes method messages.getRecentStickers#9da9403b returning error if any. // Get recent stickers // // See https://core.telegram.org/method/messages.getRecentStickers for reference. diff --git a/tg/tl_messages_get_replies_gen.go b/tg/tl_messages_get_replies_gen.go index dcdcaabea7..fe138cba45 100644 --- a/tg/tl_messages_get_replies_gen.go +++ b/tg/tl_messages_get_replies_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// MessagesGetRepliesRequest represents TL type `messages.getReplies#24b581ba`. +// MessagesGetRepliesRequest represents TL type `messages.getReplies#22ddd30c`. // Get messages in a reply thread // // See https://core.telegram.org/method/messages.getReplies for reference. @@ -68,11 +68,11 @@ type MessagesGetRepliesRequest struct { // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation - Hash int + Hash int64 } // MessagesGetRepliesRequestTypeID is TL type id of MessagesGetRepliesRequest. -const MessagesGetRepliesRequestTypeID = 0x24b581ba +const MessagesGetRepliesRequestTypeID = 0x22ddd30c // Ensuring interfaces in compile-time for MessagesGetRepliesRequest. var ( @@ -136,7 +136,7 @@ func (g *MessagesGetRepliesRequest) FillFrom(from interface { GetLimit() (value int) GetMaxID() (value int) GetMinID() (value int) - GetHash() (value int) + GetHash() (value int64) }) { g.Peer = from.GetPeer() g.MsgID = from.GetMsgID() @@ -215,7 +215,7 @@ func (g *MessagesGetRepliesRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (g *MessagesGetRepliesRequest) Encode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode messages.getReplies#24b581ba as nil") + return fmt.Errorf("can't encode messages.getReplies#22ddd30c as nil") } b.PutID(MessagesGetRepliesRequestTypeID) return g.EncodeBare(b) @@ -224,13 +224,13 @@ func (g *MessagesGetRepliesRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (g *MessagesGetRepliesRequest) EncodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode messages.getReplies#24b581ba as nil") + return fmt.Errorf("can't encode messages.getReplies#22ddd30c as nil") } if g.Peer == nil { - return fmt.Errorf("unable to encode messages.getReplies#24b581ba: field peer is nil") + return fmt.Errorf("unable to encode messages.getReplies#22ddd30c: field peer is nil") } if err := g.Peer.Encode(b); err != nil { - return fmt.Errorf("unable to encode messages.getReplies#24b581ba: field peer: %w", err) + return fmt.Errorf("unable to encode messages.getReplies#22ddd30c: field peer: %w", err) } b.PutInt(g.MsgID) b.PutInt(g.OffsetID) @@ -239,17 +239,17 @@ func (g *MessagesGetRepliesRequest) EncodeBare(b *bin.Buffer) error { b.PutInt(g.Limit) b.PutInt(g.MaxID) b.PutInt(g.MinID) - b.PutInt(g.Hash) + b.PutLong(g.Hash) return nil } // Decode implements bin.Decoder. func (g *MessagesGetRepliesRequest) Decode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode messages.getReplies#24b581ba to nil") + return fmt.Errorf("can't decode messages.getReplies#22ddd30c to nil") } if err := b.ConsumeID(MessagesGetRepliesRequestTypeID); err != nil { - return fmt.Errorf("unable to decode messages.getReplies#24b581ba: %w", err) + return fmt.Errorf("unable to decode messages.getReplies#22ddd30c: %w", err) } return g.DecodeBare(b) } @@ -257,68 +257,68 @@ func (g *MessagesGetRepliesRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (g *MessagesGetRepliesRequest) DecodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode messages.getReplies#24b581ba to nil") + return fmt.Errorf("can't decode messages.getReplies#22ddd30c to nil") } { value, err := DecodeInputPeer(b) if err != nil { - return fmt.Errorf("unable to decode messages.getReplies#24b581ba: field peer: %w", err) + return fmt.Errorf("unable to decode messages.getReplies#22ddd30c: field peer: %w", err) } g.Peer = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messages.getReplies#24b581ba: field msg_id: %w", err) + return fmt.Errorf("unable to decode messages.getReplies#22ddd30c: field msg_id: %w", err) } g.MsgID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messages.getReplies#24b581ba: field offset_id: %w", err) + return fmt.Errorf("unable to decode messages.getReplies#22ddd30c: field offset_id: %w", err) } g.OffsetID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messages.getReplies#24b581ba: field offset_date: %w", err) + return fmt.Errorf("unable to decode messages.getReplies#22ddd30c: field offset_date: %w", err) } g.OffsetDate = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messages.getReplies#24b581ba: field add_offset: %w", err) + return fmt.Errorf("unable to decode messages.getReplies#22ddd30c: field add_offset: %w", err) } g.AddOffset = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messages.getReplies#24b581ba: field limit: %w", err) + return fmt.Errorf("unable to decode messages.getReplies#22ddd30c: field limit: %w", err) } g.Limit = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messages.getReplies#24b581ba: field max_id: %w", err) + return fmt.Errorf("unable to decode messages.getReplies#22ddd30c: field max_id: %w", err) } g.MaxID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messages.getReplies#24b581ba: field min_id: %w", err) + return fmt.Errorf("unable to decode messages.getReplies#22ddd30c: field min_id: %w", err) } g.MinID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messages.getReplies#24b581ba: field hash: %w", err) + return fmt.Errorf("unable to decode messages.getReplies#22ddd30c: field hash: %w", err) } g.Hash = value } @@ -366,11 +366,11 @@ func (g *MessagesGetRepliesRequest) GetMinID() (value int) { } // GetHash returns value of Hash field. -func (g *MessagesGetRepliesRequest) GetHash() (value int) { +func (g *MessagesGetRepliesRequest) GetHash() (value int64) { return g.Hash } -// MessagesGetReplies invokes method messages.getReplies#24b581ba returning error if any. +// MessagesGetReplies invokes method messages.getReplies#22ddd30c returning error if any. // Get messages in a reply thread // // See https://core.telegram.org/method/messages.getReplies for reference. diff --git a/tg/tl_messages_get_saved_gifs_gen.go b/tg/tl_messages_get_saved_gifs_gen.go index 9ef0f296cc..c60e6cad6c 100644 --- a/tg/tl_messages_get_saved_gifs_gen.go +++ b/tg/tl_messages_get_saved_gifs_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// MessagesGetSavedGifsRequest represents TL type `messages.getSavedGifs#83bf3d52`. +// MessagesGetSavedGifsRequest represents TL type `messages.getSavedGifs#5cf09635`. // Get saved GIFs // // See https://core.telegram.org/method/messages.getSavedGifs for reference. @@ -38,11 +38,11 @@ type MessagesGetSavedGifsRequest struct { // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation - Hash int + Hash int64 } // MessagesGetSavedGifsRequestTypeID is TL type id of MessagesGetSavedGifsRequest. -const MessagesGetSavedGifsRequestTypeID = 0x83bf3d52 +const MessagesGetSavedGifsRequestTypeID = 0x5cf09635 // Ensuring interfaces in compile-time for MessagesGetSavedGifsRequest. var ( @@ -74,7 +74,7 @@ func (g *MessagesGetSavedGifsRequest) String() string { // FillFrom fills MessagesGetSavedGifsRequest from given interface. func (g *MessagesGetSavedGifsRequest) FillFrom(from interface { - GetHash() (value int) + GetHash() (value int64) }) { g.Hash = from.GetHash() } @@ -113,7 +113,7 @@ func (g *MessagesGetSavedGifsRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (g *MessagesGetSavedGifsRequest) Encode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode messages.getSavedGifs#83bf3d52 as nil") + return fmt.Errorf("can't encode messages.getSavedGifs#5cf09635 as nil") } b.PutID(MessagesGetSavedGifsRequestTypeID) return g.EncodeBare(b) @@ -122,19 +122,19 @@ func (g *MessagesGetSavedGifsRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (g *MessagesGetSavedGifsRequest) EncodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode messages.getSavedGifs#83bf3d52 as nil") + return fmt.Errorf("can't encode messages.getSavedGifs#5cf09635 as nil") } - b.PutInt(g.Hash) + b.PutLong(g.Hash) return nil } // Decode implements bin.Decoder. func (g *MessagesGetSavedGifsRequest) Decode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode messages.getSavedGifs#83bf3d52 to nil") + return fmt.Errorf("can't decode messages.getSavedGifs#5cf09635 to nil") } if err := b.ConsumeID(MessagesGetSavedGifsRequestTypeID); err != nil { - return fmt.Errorf("unable to decode messages.getSavedGifs#83bf3d52: %w", err) + return fmt.Errorf("unable to decode messages.getSavedGifs#5cf09635: %w", err) } return g.DecodeBare(b) } @@ -142,12 +142,12 @@ func (g *MessagesGetSavedGifsRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (g *MessagesGetSavedGifsRequest) DecodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode messages.getSavedGifs#83bf3d52 to nil") + return fmt.Errorf("can't decode messages.getSavedGifs#5cf09635 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messages.getSavedGifs#83bf3d52: field hash: %w", err) + return fmt.Errorf("unable to decode messages.getSavedGifs#5cf09635: field hash: %w", err) } g.Hash = value } @@ -155,15 +155,15 @@ func (g *MessagesGetSavedGifsRequest) DecodeBare(b *bin.Buffer) error { } // GetHash returns value of Hash field. -func (g *MessagesGetSavedGifsRequest) GetHash() (value int) { +func (g *MessagesGetSavedGifsRequest) GetHash() (value int64) { return g.Hash } -// MessagesGetSavedGifs invokes method messages.getSavedGifs#83bf3d52 returning error if any. +// MessagesGetSavedGifs invokes method messages.getSavedGifs#5cf09635 returning error if any. // Get saved GIFs // // See https://core.telegram.org/method/messages.getSavedGifs for reference. -func (c *Client) MessagesGetSavedGifs(ctx context.Context, hash int) (MessagesSavedGifsClass, error) { +func (c *Client) MessagesGetSavedGifs(ctx context.Context, hash int64) (MessagesSavedGifsClass, error) { var result MessagesSavedGifsBox request := &MessagesGetSavedGifsRequest{ diff --git a/tg/tl_messages_get_scheduled_history_gen.go b/tg/tl_messages_get_scheduled_history_gen.go index cb8a54252c..345e3cd7d4 100644 --- a/tg/tl_messages_get_scheduled_history_gen.go +++ b/tg/tl_messages_get_scheduled_history_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// MessagesGetScheduledHistoryRequest represents TL type `messages.getScheduledHistory#e2c2685b`. +// MessagesGetScheduledHistoryRequest represents TL type `messages.getScheduledHistory#f516760b`. // Get scheduled messages // // See https://core.telegram.org/method/messages.getScheduledHistory for reference. @@ -40,11 +40,11 @@ type MessagesGetScheduledHistoryRequest struct { // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation - Hash int + Hash int64 } // MessagesGetScheduledHistoryRequestTypeID is TL type id of MessagesGetScheduledHistoryRequest. -const MessagesGetScheduledHistoryRequestTypeID = 0xe2c2685b +const MessagesGetScheduledHistoryRequestTypeID = 0xf516760b // Ensuring interfaces in compile-time for MessagesGetScheduledHistoryRequest. var ( @@ -80,7 +80,7 @@ func (g *MessagesGetScheduledHistoryRequest) String() string { // FillFrom fills MessagesGetScheduledHistoryRequest from given interface. func (g *MessagesGetScheduledHistoryRequest) FillFrom(from interface { GetPeer() (value InputPeerClass) - GetHash() (value int) + GetHash() (value int64) }) { g.Peer = from.GetPeer() g.Hash = from.GetHash() @@ -124,7 +124,7 @@ func (g *MessagesGetScheduledHistoryRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (g *MessagesGetScheduledHistoryRequest) Encode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode messages.getScheduledHistory#e2c2685b as nil") + return fmt.Errorf("can't encode messages.getScheduledHistory#f516760b as nil") } b.PutID(MessagesGetScheduledHistoryRequestTypeID) return g.EncodeBare(b) @@ -133,25 +133,25 @@ func (g *MessagesGetScheduledHistoryRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (g *MessagesGetScheduledHistoryRequest) EncodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode messages.getScheduledHistory#e2c2685b as nil") + return fmt.Errorf("can't encode messages.getScheduledHistory#f516760b as nil") } if g.Peer == nil { - return fmt.Errorf("unable to encode messages.getScheduledHistory#e2c2685b: field peer is nil") + return fmt.Errorf("unable to encode messages.getScheduledHistory#f516760b: field peer is nil") } if err := g.Peer.Encode(b); err != nil { - return fmt.Errorf("unable to encode messages.getScheduledHistory#e2c2685b: field peer: %w", err) + return fmt.Errorf("unable to encode messages.getScheduledHistory#f516760b: field peer: %w", err) } - b.PutInt(g.Hash) + b.PutLong(g.Hash) return nil } // Decode implements bin.Decoder. func (g *MessagesGetScheduledHistoryRequest) Decode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode messages.getScheduledHistory#e2c2685b to nil") + return fmt.Errorf("can't decode messages.getScheduledHistory#f516760b to nil") } if err := b.ConsumeID(MessagesGetScheduledHistoryRequestTypeID); err != nil { - return fmt.Errorf("unable to decode messages.getScheduledHistory#e2c2685b: %w", err) + return fmt.Errorf("unable to decode messages.getScheduledHistory#f516760b: %w", err) } return g.DecodeBare(b) } @@ -159,19 +159,19 @@ func (g *MessagesGetScheduledHistoryRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (g *MessagesGetScheduledHistoryRequest) DecodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode messages.getScheduledHistory#e2c2685b to nil") + return fmt.Errorf("can't decode messages.getScheduledHistory#f516760b to nil") } { value, err := DecodeInputPeer(b) if err != nil { - return fmt.Errorf("unable to decode messages.getScheduledHistory#e2c2685b: field peer: %w", err) + return fmt.Errorf("unable to decode messages.getScheduledHistory#f516760b: field peer: %w", err) } g.Peer = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messages.getScheduledHistory#e2c2685b: field hash: %w", err) + return fmt.Errorf("unable to decode messages.getScheduledHistory#f516760b: field hash: %w", err) } g.Hash = value } @@ -184,11 +184,11 @@ func (g *MessagesGetScheduledHistoryRequest) GetPeer() (value InputPeerClass) { } // GetHash returns value of Hash field. -func (g *MessagesGetScheduledHistoryRequest) GetHash() (value int) { +func (g *MessagesGetScheduledHistoryRequest) GetHash() (value int64) { return g.Hash } -// MessagesGetScheduledHistory invokes method messages.getScheduledHistory#e2c2685b returning error if any. +// MessagesGetScheduledHistory invokes method messages.getScheduledHistory#f516760b returning error if any. // Get scheduled messages // // Possible errors: diff --git a/tg/tl_messages_get_stickers_gen.go b/tg/tl_messages_get_stickers_gen.go index f868e062f3..2c003a40c5 100644 --- a/tg/tl_messages_get_stickers_gen.go +++ b/tg/tl_messages_get_stickers_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// MessagesGetStickersRequest represents TL type `messages.getStickers#43d4f2c`. +// MessagesGetStickersRequest represents TL type `messages.getStickers#d5a5d3a1`. // Get stickers by emoji // // See https://core.telegram.org/method/messages.getStickers for reference. @@ -40,11 +40,11 @@ type MessagesGetStickersRequest struct { // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation - Hash int + Hash int64 } // MessagesGetStickersRequestTypeID is TL type id of MessagesGetStickersRequest. -const MessagesGetStickersRequestTypeID = 0x43d4f2c +const MessagesGetStickersRequestTypeID = 0xd5a5d3a1 // Ensuring interfaces in compile-time for MessagesGetStickersRequest. var ( @@ -80,7 +80,7 @@ func (g *MessagesGetStickersRequest) String() string { // FillFrom fills MessagesGetStickersRequest from given interface. func (g *MessagesGetStickersRequest) FillFrom(from interface { GetEmoticon() (value string) - GetHash() (value int) + GetHash() (value int64) }) { g.Emoticon = from.GetEmoticon() g.Hash = from.GetHash() @@ -124,7 +124,7 @@ func (g *MessagesGetStickersRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (g *MessagesGetStickersRequest) Encode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode messages.getStickers#43d4f2c as nil") + return fmt.Errorf("can't encode messages.getStickers#d5a5d3a1 as nil") } b.PutID(MessagesGetStickersRequestTypeID) return g.EncodeBare(b) @@ -133,20 +133,20 @@ func (g *MessagesGetStickersRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (g *MessagesGetStickersRequest) EncodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode messages.getStickers#43d4f2c as nil") + return fmt.Errorf("can't encode messages.getStickers#d5a5d3a1 as nil") } b.PutString(g.Emoticon) - b.PutInt(g.Hash) + b.PutLong(g.Hash) return nil } // Decode implements bin.Decoder. func (g *MessagesGetStickersRequest) Decode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode messages.getStickers#43d4f2c to nil") + return fmt.Errorf("can't decode messages.getStickers#d5a5d3a1 to nil") } if err := b.ConsumeID(MessagesGetStickersRequestTypeID); err != nil { - return fmt.Errorf("unable to decode messages.getStickers#43d4f2c: %w", err) + return fmt.Errorf("unable to decode messages.getStickers#d5a5d3a1: %w", err) } return g.DecodeBare(b) } @@ -154,19 +154,19 @@ func (g *MessagesGetStickersRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (g *MessagesGetStickersRequest) DecodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode messages.getStickers#43d4f2c to nil") + return fmt.Errorf("can't decode messages.getStickers#d5a5d3a1 to nil") } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode messages.getStickers#43d4f2c: field emoticon: %w", err) + return fmt.Errorf("unable to decode messages.getStickers#d5a5d3a1: field emoticon: %w", err) } g.Emoticon = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messages.getStickers#43d4f2c: field hash: %w", err) + return fmt.Errorf("unable to decode messages.getStickers#d5a5d3a1: field hash: %w", err) } g.Hash = value } @@ -179,11 +179,11 @@ func (g *MessagesGetStickersRequest) GetEmoticon() (value string) { } // GetHash returns value of Hash field. -func (g *MessagesGetStickersRequest) GetHash() (value int) { +func (g *MessagesGetStickersRequest) GetHash() (value int64) { return g.Hash } -// MessagesGetStickers invokes method messages.getStickers#43d4f2c returning error if any. +// MessagesGetStickers invokes method messages.getStickers#d5a5d3a1 returning error if any. // Get stickers by emoji // // See https://core.telegram.org/method/messages.getStickers for reference. diff --git a/tg/tl_messages_migrate_chat_gen.go b/tg/tl_messages_migrate_chat_gen.go index cee33ce758..d99b6a3008 100644 --- a/tg/tl_messages_migrate_chat_gen.go +++ b/tg/tl_messages_migrate_chat_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// MessagesMigrateChatRequest represents TL type `messages.migrateChat#15a3b8e3`. +// MessagesMigrateChatRequest represents TL type `messages.migrateChat#a2875319`. // Turn a legacy group into a supergroup¹ // // Links: @@ -38,11 +38,11 @@ var ( // See https://core.telegram.org/method/messages.migrateChat for reference. type MessagesMigrateChatRequest struct { // Legacy group to migrate - ChatID int + ChatID int64 } // MessagesMigrateChatRequestTypeID is TL type id of MessagesMigrateChatRequest. -const MessagesMigrateChatRequestTypeID = 0x15a3b8e3 +const MessagesMigrateChatRequestTypeID = 0xa2875319 // Ensuring interfaces in compile-time for MessagesMigrateChatRequest. var ( @@ -74,7 +74,7 @@ func (m *MessagesMigrateChatRequest) String() string { // FillFrom fills MessagesMigrateChatRequest from given interface. func (m *MessagesMigrateChatRequest) FillFrom(from interface { - GetChatID() (value int) + GetChatID() (value int64) }) { m.ChatID = from.GetChatID() } @@ -113,7 +113,7 @@ func (m *MessagesMigrateChatRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (m *MessagesMigrateChatRequest) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messages.migrateChat#15a3b8e3 as nil") + return fmt.Errorf("can't encode messages.migrateChat#a2875319 as nil") } b.PutID(MessagesMigrateChatRequestTypeID) return m.EncodeBare(b) @@ -122,19 +122,19 @@ func (m *MessagesMigrateChatRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (m *MessagesMigrateChatRequest) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messages.migrateChat#15a3b8e3 as nil") + return fmt.Errorf("can't encode messages.migrateChat#a2875319 as nil") } - b.PutInt(m.ChatID) + b.PutLong(m.ChatID) return nil } // Decode implements bin.Decoder. func (m *MessagesMigrateChatRequest) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messages.migrateChat#15a3b8e3 to nil") + return fmt.Errorf("can't decode messages.migrateChat#a2875319 to nil") } if err := b.ConsumeID(MessagesMigrateChatRequestTypeID); err != nil { - return fmt.Errorf("unable to decode messages.migrateChat#15a3b8e3: %w", err) + return fmt.Errorf("unable to decode messages.migrateChat#a2875319: %w", err) } return m.DecodeBare(b) } @@ -142,12 +142,12 @@ func (m *MessagesMigrateChatRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (m *MessagesMigrateChatRequest) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messages.migrateChat#15a3b8e3 to nil") + return fmt.Errorf("can't decode messages.migrateChat#a2875319 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messages.migrateChat#15a3b8e3: field chat_id: %w", err) + return fmt.Errorf("unable to decode messages.migrateChat#a2875319: field chat_id: %w", err) } m.ChatID = value } @@ -155,11 +155,11 @@ func (m *MessagesMigrateChatRequest) DecodeBare(b *bin.Buffer) error { } // GetChatID returns value of ChatID field. -func (m *MessagesMigrateChatRequest) GetChatID() (value int) { +func (m *MessagesMigrateChatRequest) GetChatID() (value int64) { return m.ChatID } -// MessagesMigrateChat invokes method messages.migrateChat#15a3b8e3 returning error if any. +// MessagesMigrateChat invokes method messages.migrateChat#a2875319 returning error if any. // Turn a legacy group into a supergroup¹ // // Links: @@ -171,7 +171,7 @@ func (m *MessagesMigrateChatRequest) GetChatID() (value int) { // 400 PEER_ID_INVALID: The provided peer id is invalid // // See https://core.telegram.org/method/messages.migrateChat for reference. -func (c *Client) MessagesMigrateChat(ctx context.Context, chatid int) (UpdatesClass, error) { +func (c *Client) MessagesMigrateChat(ctx context.Context, chatid int64) (UpdatesClass, error) { var result UpdatesBox request := &MessagesMigrateChatRequest{ diff --git a/tg/tl_messages_recent_stickers_gen.go b/tg/tl_messages_recent_stickers_gen.go index dd67381ddf..9844528c91 100644 --- a/tg/tl_messages_recent_stickers_gen.go +++ b/tg/tl_messages_recent_stickers_gen.go @@ -131,7 +131,7 @@ func (r *MessagesRecentStickersNotModified) DecodeBare(b *bin.Buffer) error { return nil } -// MessagesRecentStickers represents TL type `messages.recentStickers#22f3afb3`. +// MessagesRecentStickers represents TL type `messages.recentStickers#88d37c56`. // Recently used stickers // // See https://core.telegram.org/constructor/messages.recentStickers for reference. @@ -140,7 +140,7 @@ type MessagesRecentStickers struct { // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation - Hash int + Hash int64 // Emojis associated to stickers Packs []StickerPack // Recent stickers @@ -150,7 +150,7 @@ type MessagesRecentStickers struct { } // MessagesRecentStickersTypeID is TL type id of MessagesRecentStickers. -const MessagesRecentStickersTypeID = 0x22f3afb3 +const MessagesRecentStickersTypeID = 0x88d37c56 // construct implements constructor of MessagesRecentStickersClass. func (r MessagesRecentStickers) construct() MessagesRecentStickersClass { return &r } @@ -196,7 +196,7 @@ func (r *MessagesRecentStickers) String() string { // FillFrom fills MessagesRecentStickers from given interface. func (r *MessagesRecentStickers) FillFrom(from interface { - GetHash() (value int) + GetHash() (value int64) GetPacks() (value []StickerPack) GetStickers() (value []DocumentClass) GetDates() (value []int) @@ -253,7 +253,7 @@ func (r *MessagesRecentStickers) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (r *MessagesRecentStickers) Encode(b *bin.Buffer) error { if r == nil { - return fmt.Errorf("can't encode messages.recentStickers#22f3afb3 as nil") + return fmt.Errorf("can't encode messages.recentStickers#88d37c56 as nil") } b.PutID(MessagesRecentStickersTypeID) return r.EncodeBare(b) @@ -262,22 +262,22 @@ func (r *MessagesRecentStickers) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (r *MessagesRecentStickers) EncodeBare(b *bin.Buffer) error { if r == nil { - return fmt.Errorf("can't encode messages.recentStickers#22f3afb3 as nil") + return fmt.Errorf("can't encode messages.recentStickers#88d37c56 as nil") } - b.PutInt(r.Hash) + b.PutLong(r.Hash) b.PutVectorHeader(len(r.Packs)) for idx, v := range r.Packs { if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode messages.recentStickers#22f3afb3: field packs element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode messages.recentStickers#88d37c56: field packs element with index %d: %w", idx, err) } } b.PutVectorHeader(len(r.Stickers)) for idx, v := range r.Stickers { if v == nil { - return fmt.Errorf("unable to encode messages.recentStickers#22f3afb3: field stickers element with index %d is nil", idx) + return fmt.Errorf("unable to encode messages.recentStickers#88d37c56: field stickers element with index %d is nil", idx) } if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode messages.recentStickers#22f3afb3: field stickers element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode messages.recentStickers#88d37c56: field stickers element with index %d: %w", idx, err) } } b.PutVectorHeader(len(r.Dates)) @@ -290,10 +290,10 @@ func (r *MessagesRecentStickers) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (r *MessagesRecentStickers) Decode(b *bin.Buffer) error { if r == nil { - return fmt.Errorf("can't decode messages.recentStickers#22f3afb3 to nil") + return fmt.Errorf("can't decode messages.recentStickers#88d37c56 to nil") } if err := b.ConsumeID(MessagesRecentStickersTypeID); err != nil { - return fmt.Errorf("unable to decode messages.recentStickers#22f3afb3: %w", err) + return fmt.Errorf("unable to decode messages.recentStickers#88d37c56: %w", err) } return r.DecodeBare(b) } @@ -301,19 +301,19 @@ func (r *MessagesRecentStickers) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (r *MessagesRecentStickers) DecodeBare(b *bin.Buffer) error { if r == nil { - return fmt.Errorf("can't decode messages.recentStickers#22f3afb3 to nil") + return fmt.Errorf("can't decode messages.recentStickers#88d37c56 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messages.recentStickers#22f3afb3: field hash: %w", err) + return fmt.Errorf("unable to decode messages.recentStickers#88d37c56: field hash: %w", err) } r.Hash = value } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode messages.recentStickers#22f3afb3: field packs: %w", err) + return fmt.Errorf("unable to decode messages.recentStickers#88d37c56: field packs: %w", err) } if headerLen > 0 { @@ -322,7 +322,7 @@ func (r *MessagesRecentStickers) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { var value StickerPack if err := value.Decode(b); err != nil { - return fmt.Errorf("unable to decode messages.recentStickers#22f3afb3: field packs: %w", err) + return fmt.Errorf("unable to decode messages.recentStickers#88d37c56: field packs: %w", err) } r.Packs = append(r.Packs, value) } @@ -330,7 +330,7 @@ func (r *MessagesRecentStickers) DecodeBare(b *bin.Buffer) error { { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode messages.recentStickers#22f3afb3: field stickers: %w", err) + return fmt.Errorf("unable to decode messages.recentStickers#88d37c56: field stickers: %w", err) } if headerLen > 0 { @@ -339,7 +339,7 @@ func (r *MessagesRecentStickers) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := DecodeDocument(b) if err != nil { - return fmt.Errorf("unable to decode messages.recentStickers#22f3afb3: field stickers: %w", err) + return fmt.Errorf("unable to decode messages.recentStickers#88d37c56: field stickers: %w", err) } r.Stickers = append(r.Stickers, value) } @@ -347,7 +347,7 @@ func (r *MessagesRecentStickers) DecodeBare(b *bin.Buffer) error { { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode messages.recentStickers#22f3afb3: field dates: %w", err) + return fmt.Errorf("unable to decode messages.recentStickers#88d37c56: field dates: %w", err) } if headerLen > 0 { @@ -356,7 +356,7 @@ func (r *MessagesRecentStickers) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messages.recentStickers#22f3afb3: field dates: %w", err) + return fmt.Errorf("unable to decode messages.recentStickers#88d37c56: field dates: %w", err) } r.Dates = append(r.Dates, value) } @@ -365,7 +365,7 @@ func (r *MessagesRecentStickers) DecodeBare(b *bin.Buffer) error { } // GetHash returns value of Hash field. -func (r *MessagesRecentStickers) GetHash() (value int) { +func (r *MessagesRecentStickers) GetHash() (value int64) { return r.Hash } @@ -400,7 +400,7 @@ func (r *MessagesRecentStickers) MapStickers() (value DocumentClassArray) { // } // switch v := g.(type) { // case *tg.MessagesRecentStickersNotModified: // messages.recentStickersNotModified#b17f890 -// case *tg.MessagesRecentStickers: // messages.recentStickers#22f3afb3 +// case *tg.MessagesRecentStickers: // messages.recentStickers#88d37c56 // default: panic(v) // } type MessagesRecentStickersClass interface { @@ -450,7 +450,7 @@ func DecodeMessagesRecentStickers(buf *bin.Buffer) (MessagesRecentStickersClass, } return &v, nil case MessagesRecentStickersTypeID: - // Decoding messages.recentStickers#22f3afb3. + // Decoding messages.recentStickers#88d37c56. v := MessagesRecentStickers{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode MessagesRecentStickersClass: %w", err) diff --git a/tg/tl_messages_saved_gifs_gen.go b/tg/tl_messages_saved_gifs_gen.go index 6ece5b9bb3..59248facd1 100644 --- a/tg/tl_messages_saved_gifs_gen.go +++ b/tg/tl_messages_saved_gifs_gen.go @@ -131,7 +131,7 @@ func (s *MessagesSavedGifsNotModified) DecodeBare(b *bin.Buffer) error { return nil } -// MessagesSavedGifs represents TL type `messages.savedGifs#2e0709a5`. +// MessagesSavedGifs represents TL type `messages.savedGifs#84a02a0d`. // Saved gifs // // See https://core.telegram.org/constructor/messages.savedGifs for reference. @@ -140,13 +140,13 @@ type MessagesSavedGifs struct { // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation - Hash int + Hash int64 // List of saved gifs Gifs []DocumentClass } // MessagesSavedGifsTypeID is TL type id of MessagesSavedGifs. -const MessagesSavedGifsTypeID = 0x2e0709a5 +const MessagesSavedGifsTypeID = 0x84a02a0d // construct implements constructor of MessagesSavedGifsClass. func (s MessagesSavedGifs) construct() MessagesSavedGifsClass { return &s } @@ -186,7 +186,7 @@ func (s *MessagesSavedGifs) String() string { // FillFrom fills MessagesSavedGifs from given interface. func (s *MessagesSavedGifs) FillFrom(from interface { - GetHash() (value int) + GetHash() (value int64) GetGifs() (value []DocumentClass) }) { s.Hash = from.GetHash() @@ -231,7 +231,7 @@ func (s *MessagesSavedGifs) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (s *MessagesSavedGifs) Encode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode messages.savedGifs#2e0709a5 as nil") + return fmt.Errorf("can't encode messages.savedGifs#84a02a0d as nil") } b.PutID(MessagesSavedGifsTypeID) return s.EncodeBare(b) @@ -240,16 +240,16 @@ func (s *MessagesSavedGifs) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (s *MessagesSavedGifs) EncodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode messages.savedGifs#2e0709a5 as nil") + return fmt.Errorf("can't encode messages.savedGifs#84a02a0d as nil") } - b.PutInt(s.Hash) + b.PutLong(s.Hash) b.PutVectorHeader(len(s.Gifs)) for idx, v := range s.Gifs { if v == nil { - return fmt.Errorf("unable to encode messages.savedGifs#2e0709a5: field gifs element with index %d is nil", idx) + return fmt.Errorf("unable to encode messages.savedGifs#84a02a0d: field gifs element with index %d is nil", idx) } if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode messages.savedGifs#2e0709a5: field gifs element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode messages.savedGifs#84a02a0d: field gifs element with index %d: %w", idx, err) } } return nil @@ -258,10 +258,10 @@ func (s *MessagesSavedGifs) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (s *MessagesSavedGifs) Decode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode messages.savedGifs#2e0709a5 to nil") + return fmt.Errorf("can't decode messages.savedGifs#84a02a0d to nil") } if err := b.ConsumeID(MessagesSavedGifsTypeID); err != nil { - return fmt.Errorf("unable to decode messages.savedGifs#2e0709a5: %w", err) + return fmt.Errorf("unable to decode messages.savedGifs#84a02a0d: %w", err) } return s.DecodeBare(b) } @@ -269,19 +269,19 @@ func (s *MessagesSavedGifs) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (s *MessagesSavedGifs) DecodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode messages.savedGifs#2e0709a5 to nil") + return fmt.Errorf("can't decode messages.savedGifs#84a02a0d to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messages.savedGifs#2e0709a5: field hash: %w", err) + return fmt.Errorf("unable to decode messages.savedGifs#84a02a0d: field hash: %w", err) } s.Hash = value } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode messages.savedGifs#2e0709a5: field gifs: %w", err) + return fmt.Errorf("unable to decode messages.savedGifs#84a02a0d: field gifs: %w", err) } if headerLen > 0 { @@ -290,7 +290,7 @@ func (s *MessagesSavedGifs) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := DecodeDocument(b) if err != nil { - return fmt.Errorf("unable to decode messages.savedGifs#2e0709a5: field gifs: %w", err) + return fmt.Errorf("unable to decode messages.savedGifs#84a02a0d: field gifs: %w", err) } s.Gifs = append(s.Gifs, value) } @@ -299,7 +299,7 @@ func (s *MessagesSavedGifs) DecodeBare(b *bin.Buffer) error { } // GetHash returns value of Hash field. -func (s *MessagesSavedGifs) GetHash() (value int) { +func (s *MessagesSavedGifs) GetHash() (value int64) { return s.Hash } @@ -324,7 +324,7 @@ func (s *MessagesSavedGifs) MapGifs() (value DocumentClassArray) { // } // switch v := g.(type) { // case *tg.MessagesSavedGifsNotModified: // messages.savedGifsNotModified#e8025ca2 -// case *tg.MessagesSavedGifs: // messages.savedGifs#2e0709a5 +// case *tg.MessagesSavedGifs: // messages.savedGifs#84a02a0d // default: panic(v) // } type MessagesSavedGifsClass interface { @@ -374,7 +374,7 @@ func DecodeMessagesSavedGifs(buf *bin.Buffer) (MessagesSavedGifsClass, error) { } return &v, nil case MessagesSavedGifsTypeID: - // Decoding messages.savedGifs#2e0709a5. + // Decoding messages.savedGifs#84a02a0d. v := MessagesSavedGifs{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode MessagesSavedGifsClass: %w", err) diff --git a/tg/tl_messages_search_gen.go b/tg/tl_messages_search_gen.go index d6a83cc90f..f4c08f655f 100644 --- a/tg/tl_messages_search_gen.go +++ b/tg/tl_messages_search_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// MessagesSearchRequest represents TL type `messages.search#c352eec`. +// MessagesSearchRequest represents TL type `messages.search#a0fda762`. // Gets back found messages // // See https://core.telegram.org/method/messages.search for reference. @@ -92,11 +92,11 @@ type MessagesSearchRequest struct { // // Links: // 1) https://core.telegram.org/api/offsets - Hash int + Hash int64 } // MessagesSearchRequestTypeID is TL type id of MessagesSearchRequest. -const MessagesSearchRequestTypeID = 0xc352eec +const MessagesSearchRequestTypeID = 0xa0fda762 // Ensuring interfaces in compile-time for MessagesSearchRequest. var ( @@ -179,7 +179,7 @@ func (s *MessagesSearchRequest) FillFrom(from interface { GetLimit() (value int) GetMaxID() (value int) GetMinID() (value int) - GetHash() (value int) + GetHash() (value int64) }) { s.Peer = from.GetPeer() s.Q = from.GetQ() @@ -286,7 +286,7 @@ func (s *MessagesSearchRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (s *MessagesSearchRequest) Encode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode messages.search#c352eec as nil") + return fmt.Errorf("can't encode messages.search#a0fda762 as nil") } b.PutID(MessagesSearchRequestTypeID) return s.EncodeBare(b) @@ -295,7 +295,7 @@ func (s *MessagesSearchRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (s *MessagesSearchRequest) EncodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode messages.search#c352eec as nil") + return fmt.Errorf("can't encode messages.search#a0fda762 as nil") } if !(s.FromID == nil) { s.Flags.Set(0) @@ -304,31 +304,31 @@ func (s *MessagesSearchRequest) EncodeBare(b *bin.Buffer) error { s.Flags.Set(1) } if err := s.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode messages.search#c352eec: field flags: %w", err) + return fmt.Errorf("unable to encode messages.search#a0fda762: field flags: %w", err) } if s.Peer == nil { - return fmt.Errorf("unable to encode messages.search#c352eec: field peer is nil") + return fmt.Errorf("unable to encode messages.search#a0fda762: field peer is nil") } if err := s.Peer.Encode(b); err != nil { - return fmt.Errorf("unable to encode messages.search#c352eec: field peer: %w", err) + return fmt.Errorf("unable to encode messages.search#a0fda762: field peer: %w", err) } b.PutString(s.Q) if s.Flags.Has(0) { if s.FromID == nil { - return fmt.Errorf("unable to encode messages.search#c352eec: field from_id is nil") + return fmt.Errorf("unable to encode messages.search#a0fda762: field from_id is nil") } if err := s.FromID.Encode(b); err != nil { - return fmt.Errorf("unable to encode messages.search#c352eec: field from_id: %w", err) + return fmt.Errorf("unable to encode messages.search#a0fda762: field from_id: %w", err) } } if s.Flags.Has(1) { b.PutInt(s.TopMsgID) } if s.Filter == nil { - return fmt.Errorf("unable to encode messages.search#c352eec: field filter is nil") + return fmt.Errorf("unable to encode messages.search#a0fda762: field filter is nil") } if err := s.Filter.Encode(b); err != nil { - return fmt.Errorf("unable to encode messages.search#c352eec: field filter: %w", err) + return fmt.Errorf("unable to encode messages.search#a0fda762: field filter: %w", err) } b.PutInt(s.MinDate) b.PutInt(s.MaxDate) @@ -337,17 +337,17 @@ func (s *MessagesSearchRequest) EncodeBare(b *bin.Buffer) error { b.PutInt(s.Limit) b.PutInt(s.MaxID) b.PutInt(s.MinID) - b.PutInt(s.Hash) + b.PutLong(s.Hash) return nil } // Decode implements bin.Decoder. func (s *MessagesSearchRequest) Decode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode messages.search#c352eec to nil") + return fmt.Errorf("can't decode messages.search#a0fda762 to nil") } if err := b.ConsumeID(MessagesSearchRequestTypeID); err != nil { - return fmt.Errorf("unable to decode messages.search#c352eec: %w", err) + return fmt.Errorf("unable to decode messages.search#a0fda762: %w", err) } return s.DecodeBare(b) } @@ -355,101 +355,101 @@ func (s *MessagesSearchRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (s *MessagesSearchRequest) DecodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode messages.search#c352eec to nil") + return fmt.Errorf("can't decode messages.search#a0fda762 to nil") } { if err := s.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode messages.search#c352eec: field flags: %w", err) + return fmt.Errorf("unable to decode messages.search#a0fda762: field flags: %w", err) } } { value, err := DecodeInputPeer(b) if err != nil { - return fmt.Errorf("unable to decode messages.search#c352eec: field peer: %w", err) + return fmt.Errorf("unable to decode messages.search#a0fda762: field peer: %w", err) } s.Peer = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode messages.search#c352eec: field q: %w", err) + return fmt.Errorf("unable to decode messages.search#a0fda762: field q: %w", err) } s.Q = value } if s.Flags.Has(0) { value, err := DecodeInputPeer(b) if err != nil { - return fmt.Errorf("unable to decode messages.search#c352eec: field from_id: %w", err) + return fmt.Errorf("unable to decode messages.search#a0fda762: field from_id: %w", err) } s.FromID = value } if s.Flags.Has(1) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messages.search#c352eec: field top_msg_id: %w", err) + return fmt.Errorf("unable to decode messages.search#a0fda762: field top_msg_id: %w", err) } s.TopMsgID = value } { value, err := DecodeMessagesFilter(b) if err != nil { - return fmt.Errorf("unable to decode messages.search#c352eec: field filter: %w", err) + return fmt.Errorf("unable to decode messages.search#a0fda762: field filter: %w", err) } s.Filter = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messages.search#c352eec: field min_date: %w", err) + return fmt.Errorf("unable to decode messages.search#a0fda762: field min_date: %w", err) } s.MinDate = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messages.search#c352eec: field max_date: %w", err) + return fmt.Errorf("unable to decode messages.search#a0fda762: field max_date: %w", err) } s.MaxDate = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messages.search#c352eec: field offset_id: %w", err) + return fmt.Errorf("unable to decode messages.search#a0fda762: field offset_id: %w", err) } s.OffsetID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messages.search#c352eec: field add_offset: %w", err) + return fmt.Errorf("unable to decode messages.search#a0fda762: field add_offset: %w", err) } s.AddOffset = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messages.search#c352eec: field limit: %w", err) + return fmt.Errorf("unable to decode messages.search#a0fda762: field limit: %w", err) } s.Limit = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messages.search#c352eec: field max_id: %w", err) + return fmt.Errorf("unable to decode messages.search#a0fda762: field max_id: %w", err) } s.MaxID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messages.search#c352eec: field min_id: %w", err) + return fmt.Errorf("unable to decode messages.search#a0fda762: field min_id: %w", err) } s.MinID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messages.search#c352eec: field hash: %w", err) + return fmt.Errorf("unable to decode messages.search#a0fda762: field hash: %w", err) } s.Hash = value } @@ -537,11 +537,11 @@ func (s *MessagesSearchRequest) GetMinID() (value int) { } // GetHash returns value of Hash field. -func (s *MessagesSearchRequest) GetHash() (value int) { +func (s *MessagesSearchRequest) GetHash() (value int64) { return s.Hash } -// MessagesSearch invokes method messages.search#c352eec returning error if any. +// MessagesSearch invokes method messages.search#a0fda762 returning error if any. // Gets back found messages // // Possible errors: diff --git a/tg/tl_messages_search_sticker_sets_gen.go b/tg/tl_messages_search_sticker_sets_gen.go index 409482690d..6e85e11d20 100644 --- a/tg/tl_messages_search_sticker_sets_gen.go +++ b/tg/tl_messages_search_sticker_sets_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// MessagesSearchStickerSetsRequest represents TL type `messages.searchStickerSets#c2b7d08b`. +// MessagesSearchStickerSetsRequest represents TL type `messages.searchStickerSets#35705b8a`. // Search for stickersets // // See https://core.telegram.org/method/messages.searchStickerSets for reference. @@ -47,11 +47,11 @@ type MessagesSearchStickerSetsRequest struct { // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation - Hash int + Hash int64 } // MessagesSearchStickerSetsRequestTypeID is TL type id of MessagesSearchStickerSetsRequest. -const MessagesSearchStickerSetsRequestTypeID = 0xc2b7d08b +const MessagesSearchStickerSetsRequestTypeID = 0x35705b8a // Ensuring interfaces in compile-time for MessagesSearchStickerSetsRequest. var ( @@ -94,7 +94,7 @@ func (s *MessagesSearchStickerSetsRequest) String() string { func (s *MessagesSearchStickerSetsRequest) FillFrom(from interface { GetExcludeFeatured() (value bool) GetQ() (value string) - GetHash() (value int) + GetHash() (value int64) }) { s.ExcludeFeatured = from.GetExcludeFeatured() s.Q = from.GetQ() @@ -144,7 +144,7 @@ func (s *MessagesSearchStickerSetsRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (s *MessagesSearchStickerSetsRequest) Encode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode messages.searchStickerSets#c2b7d08b as nil") + return fmt.Errorf("can't encode messages.searchStickerSets#35705b8a as nil") } b.PutID(MessagesSearchStickerSetsRequestTypeID) return s.EncodeBare(b) @@ -153,26 +153,26 @@ func (s *MessagesSearchStickerSetsRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (s *MessagesSearchStickerSetsRequest) EncodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode messages.searchStickerSets#c2b7d08b as nil") + return fmt.Errorf("can't encode messages.searchStickerSets#35705b8a as nil") } if !(s.ExcludeFeatured == false) { s.Flags.Set(0) } if err := s.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode messages.searchStickerSets#c2b7d08b: field flags: %w", err) + return fmt.Errorf("unable to encode messages.searchStickerSets#35705b8a: field flags: %w", err) } b.PutString(s.Q) - b.PutInt(s.Hash) + b.PutLong(s.Hash) return nil } // Decode implements bin.Decoder. func (s *MessagesSearchStickerSetsRequest) Decode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode messages.searchStickerSets#c2b7d08b to nil") + return fmt.Errorf("can't decode messages.searchStickerSets#35705b8a to nil") } if err := b.ConsumeID(MessagesSearchStickerSetsRequestTypeID); err != nil { - return fmt.Errorf("unable to decode messages.searchStickerSets#c2b7d08b: %w", err) + return fmt.Errorf("unable to decode messages.searchStickerSets#35705b8a: %w", err) } return s.DecodeBare(b) } @@ -180,25 +180,25 @@ func (s *MessagesSearchStickerSetsRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (s *MessagesSearchStickerSetsRequest) DecodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode messages.searchStickerSets#c2b7d08b to nil") + return fmt.Errorf("can't decode messages.searchStickerSets#35705b8a to nil") } { if err := s.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode messages.searchStickerSets#c2b7d08b: field flags: %w", err) + return fmt.Errorf("unable to decode messages.searchStickerSets#35705b8a: field flags: %w", err) } } s.ExcludeFeatured = s.Flags.Has(0) { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode messages.searchStickerSets#c2b7d08b: field q: %w", err) + return fmt.Errorf("unable to decode messages.searchStickerSets#35705b8a: field q: %w", err) } s.Q = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messages.searchStickerSets#c2b7d08b: field hash: %w", err) + return fmt.Errorf("unable to decode messages.searchStickerSets#35705b8a: field hash: %w", err) } s.Hash = value } @@ -227,11 +227,11 @@ func (s *MessagesSearchStickerSetsRequest) GetQ() (value string) { } // GetHash returns value of Hash field. -func (s *MessagesSearchStickerSetsRequest) GetHash() (value int) { +func (s *MessagesSearchStickerSetsRequest) GetHash() (value int64) { return s.Hash } -// MessagesSearchStickerSets invokes method messages.searchStickerSets#c2b7d08b returning error if any. +// MessagesSearchStickerSets invokes method messages.searchStickerSets#35705b8a returning error if any. // Search for stickersets // // See https://core.telegram.org/method/messages.searchStickerSets for reference. diff --git a/tg/tl_messages_set_inline_game_score_gen.go b/tg/tl_messages_set_inline_game_score_gen.go index 6a1d0440f8..35d8f018d1 100644 --- a/tg/tl_messages_set_inline_game_score_gen.go +++ b/tg/tl_messages_set_inline_game_score_gen.go @@ -47,7 +47,7 @@ type MessagesSetInlineGameScoreRequest struct { // mistakes or banning cheaters Force bool // ID of the inline message - ID InputBotInlineMessageID + ID InputBotInlineMessageIDClass // User identifier UserID InputUserClass // New score @@ -78,7 +78,7 @@ func (s *MessagesSetInlineGameScoreRequest) Zero() bool { if !(s.Force == false) { return false } - if !(s.ID.Zero()) { + if !(s.ID == nil) { return false } if !(s.UserID == nil) { @@ -104,7 +104,7 @@ func (s *MessagesSetInlineGameScoreRequest) String() string { func (s *MessagesSetInlineGameScoreRequest) FillFrom(from interface { GetEditMessage() (value bool) GetForce() (value bool) - GetID() (value InputBotInlineMessageID) + GetID() (value InputBotInlineMessageIDClass) GetUserID() (value InputUserClass) GetScore() (value int) }) { @@ -187,6 +187,9 @@ func (s *MessagesSetInlineGameScoreRequest) EncodeBare(b *bin.Buffer) error { if err := s.Flags.Encode(b); err != nil { return fmt.Errorf("unable to encode messages.setInlineGameScore#15ad9f64: field flags: %w", err) } + if s.ID == nil { + return fmt.Errorf("unable to encode messages.setInlineGameScore#15ad9f64: field id is nil") + } if err := s.ID.Encode(b); err != nil { return fmt.Errorf("unable to encode messages.setInlineGameScore#15ad9f64: field id: %w", err) } @@ -224,9 +227,11 @@ func (s *MessagesSetInlineGameScoreRequest) DecodeBare(b *bin.Buffer) error { s.EditMessage = s.Flags.Has(0) s.Force = s.Flags.Has(1) { - if err := s.ID.Decode(b); err != nil { + value, err := DecodeInputBotInlineMessageID(b) + if err != nil { return fmt.Errorf("unable to decode messages.setInlineGameScore#15ad9f64: field id: %w", err) } + s.ID = value } { value, err := DecodeInputUser(b) @@ -278,7 +283,7 @@ func (s *MessagesSetInlineGameScoreRequest) GetForce() (value bool) { } // GetID returns value of ID field. -func (s *MessagesSetInlineGameScoreRequest) GetID() (value InputBotInlineMessageID) { +func (s *MessagesSetInlineGameScoreRequest) GetID() (value InputBotInlineMessageIDClass) { return s.ID } diff --git a/tg/tl_messages_stickers_gen.go b/tg/tl_messages_stickers_gen.go index b00a981d29..1b5dfb1f80 100644 --- a/tg/tl_messages_stickers_gen.go +++ b/tg/tl_messages_stickers_gen.go @@ -131,7 +131,7 @@ func (s *MessagesStickersNotModified) DecodeBare(b *bin.Buffer) error { return nil } -// MessagesStickers represents TL type `messages.stickers#e4599bbd`. +// MessagesStickers represents TL type `messages.stickers#30a6ec7e`. // Found stickers // // See https://core.telegram.org/constructor/messages.stickers for reference. @@ -140,13 +140,13 @@ type MessagesStickers struct { // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation - Hash int + Hash int64 // Stickers Stickers []DocumentClass } // MessagesStickersTypeID is TL type id of MessagesStickers. -const MessagesStickersTypeID = 0xe4599bbd +const MessagesStickersTypeID = 0x30a6ec7e // construct implements constructor of MessagesStickersClass. func (s MessagesStickers) construct() MessagesStickersClass { return &s } @@ -186,7 +186,7 @@ func (s *MessagesStickers) String() string { // FillFrom fills MessagesStickers from given interface. func (s *MessagesStickers) FillFrom(from interface { - GetHash() (value int) + GetHash() (value int64) GetStickers() (value []DocumentClass) }) { s.Hash = from.GetHash() @@ -231,7 +231,7 @@ func (s *MessagesStickers) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (s *MessagesStickers) Encode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode messages.stickers#e4599bbd as nil") + return fmt.Errorf("can't encode messages.stickers#30a6ec7e as nil") } b.PutID(MessagesStickersTypeID) return s.EncodeBare(b) @@ -240,16 +240,16 @@ func (s *MessagesStickers) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (s *MessagesStickers) EncodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode messages.stickers#e4599bbd as nil") + return fmt.Errorf("can't encode messages.stickers#30a6ec7e as nil") } - b.PutInt(s.Hash) + b.PutLong(s.Hash) b.PutVectorHeader(len(s.Stickers)) for idx, v := range s.Stickers { if v == nil { - return fmt.Errorf("unable to encode messages.stickers#e4599bbd: field stickers element with index %d is nil", idx) + return fmt.Errorf("unable to encode messages.stickers#30a6ec7e: field stickers element with index %d is nil", idx) } if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode messages.stickers#e4599bbd: field stickers element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode messages.stickers#30a6ec7e: field stickers element with index %d: %w", idx, err) } } return nil @@ -258,10 +258,10 @@ func (s *MessagesStickers) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (s *MessagesStickers) Decode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode messages.stickers#e4599bbd to nil") + return fmt.Errorf("can't decode messages.stickers#30a6ec7e to nil") } if err := b.ConsumeID(MessagesStickersTypeID); err != nil { - return fmt.Errorf("unable to decode messages.stickers#e4599bbd: %w", err) + return fmt.Errorf("unable to decode messages.stickers#30a6ec7e: %w", err) } return s.DecodeBare(b) } @@ -269,19 +269,19 @@ func (s *MessagesStickers) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (s *MessagesStickers) DecodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode messages.stickers#e4599bbd to nil") + return fmt.Errorf("can't decode messages.stickers#30a6ec7e to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messages.stickers#e4599bbd: field hash: %w", err) + return fmt.Errorf("unable to decode messages.stickers#30a6ec7e: field hash: %w", err) } s.Hash = value } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode messages.stickers#e4599bbd: field stickers: %w", err) + return fmt.Errorf("unable to decode messages.stickers#30a6ec7e: field stickers: %w", err) } if headerLen > 0 { @@ -290,7 +290,7 @@ func (s *MessagesStickers) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := DecodeDocument(b) if err != nil { - return fmt.Errorf("unable to decode messages.stickers#e4599bbd: field stickers: %w", err) + return fmt.Errorf("unable to decode messages.stickers#30a6ec7e: field stickers: %w", err) } s.Stickers = append(s.Stickers, value) } @@ -299,7 +299,7 @@ func (s *MessagesStickers) DecodeBare(b *bin.Buffer) error { } // GetHash returns value of Hash field. -func (s *MessagesStickers) GetHash() (value int) { +func (s *MessagesStickers) GetHash() (value int64) { return s.Hash } @@ -324,7 +324,7 @@ func (s *MessagesStickers) MapStickers() (value DocumentClassArray) { // } // switch v := g.(type) { // case *tg.MessagesStickersNotModified: // messages.stickersNotModified#f1749a22 -// case *tg.MessagesStickers: // messages.stickers#e4599bbd +// case *tg.MessagesStickers: // messages.stickers#30a6ec7e // default: panic(v) // } type MessagesStickersClass interface { @@ -374,7 +374,7 @@ func DecodeMessagesStickers(buf *bin.Buffer) (MessagesStickersClass, error) { } return &v, nil case MessagesStickersTypeID: - // Decoding messages.stickers#e4599bbd. + // Decoding messages.stickers#30a6ec7e. v := MessagesStickers{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode MessagesStickersClass: %w", err) diff --git a/tg/tl_payments_payment_form_gen.go b/tg/tl_payments_payment_form_gen.go index e2a9d037aa..17dcf8fa63 100644 --- a/tg/tl_payments_payment_form_gen.go +++ b/tg/tl_payments_payment_form_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// PaymentsPaymentForm represents TL type `payments.paymentForm#8d0b2415`. +// PaymentsPaymentForm represents TL type `payments.paymentForm#1694761b`. // Payment form // // See https://core.telegram.org/constructor/payments.paymentForm for reference. @@ -51,11 +51,11 @@ type PaymentsPaymentForm struct { // FormID field of PaymentsPaymentForm. FormID int64 // Bot ID - BotID int + BotID int64 // Invoice Invoice Invoice // Payment provider ID. - ProviderID int + ProviderID int64 // Payment form URL URL string // Payment provider name.One of the following:- stripe @@ -86,7 +86,7 @@ type PaymentsPaymentForm struct { } // PaymentsPaymentFormTypeID is TL type id of PaymentsPaymentForm. -const PaymentsPaymentFormTypeID = 0x8d0b2415 +const PaymentsPaymentFormTypeID = 0x1694761b // Ensuring interfaces in compile-time for PaymentsPaymentForm. var ( @@ -157,9 +157,9 @@ func (p *PaymentsPaymentForm) FillFrom(from interface { GetCanSaveCredentials() (value bool) GetPasswordMissing() (value bool) GetFormID() (value int64) - GetBotID() (value int) + GetBotID() (value int64) GetInvoice() (value Invoice) - GetProviderID() (value int) + GetProviderID() (value int64) GetURL() (value string) GetNativeProvider() (value string, ok bool) GetNativeParams() (value DataJSON, ok bool) @@ -277,7 +277,7 @@ func (p *PaymentsPaymentForm) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (p *PaymentsPaymentForm) Encode(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't encode payments.paymentForm#8d0b2415 as nil") + return fmt.Errorf("can't encode payments.paymentForm#1694761b as nil") } b.PutID(PaymentsPaymentFormTypeID) return p.EncodeBare(b) @@ -286,7 +286,7 @@ func (p *PaymentsPaymentForm) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (p *PaymentsPaymentForm) EncodeBare(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't encode payments.paymentForm#8d0b2415 as nil") + return fmt.Errorf("can't encode payments.paymentForm#1694761b as nil") } if !(p.CanSaveCredentials == false) { p.Flags.Set(2) @@ -307,40 +307,40 @@ func (p *PaymentsPaymentForm) EncodeBare(b *bin.Buffer) error { p.Flags.Set(1) } if err := p.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode payments.paymentForm#8d0b2415: field flags: %w", err) + return fmt.Errorf("unable to encode payments.paymentForm#1694761b: field flags: %w", err) } b.PutLong(p.FormID) - b.PutInt(p.BotID) + b.PutLong(p.BotID) if err := p.Invoice.Encode(b); err != nil { - return fmt.Errorf("unable to encode payments.paymentForm#8d0b2415: field invoice: %w", err) + return fmt.Errorf("unable to encode payments.paymentForm#1694761b: field invoice: %w", err) } - b.PutInt(p.ProviderID) + b.PutLong(p.ProviderID) b.PutString(p.URL) if p.Flags.Has(4) { b.PutString(p.NativeProvider) } if p.Flags.Has(4) { if err := p.NativeParams.Encode(b); err != nil { - return fmt.Errorf("unable to encode payments.paymentForm#8d0b2415: field native_params: %w", err) + return fmt.Errorf("unable to encode payments.paymentForm#1694761b: field native_params: %w", err) } } if p.Flags.Has(0) { if err := p.SavedInfo.Encode(b); err != nil { - return fmt.Errorf("unable to encode payments.paymentForm#8d0b2415: field saved_info: %w", err) + return fmt.Errorf("unable to encode payments.paymentForm#1694761b: field saved_info: %w", err) } } if p.Flags.Has(1) { if err := p.SavedCredentials.Encode(b); err != nil { - return fmt.Errorf("unable to encode payments.paymentForm#8d0b2415: field saved_credentials: %w", err) + return fmt.Errorf("unable to encode payments.paymentForm#1694761b: field saved_credentials: %w", err) } } b.PutVectorHeader(len(p.Users)) for idx, v := range p.Users { if v == nil { - return fmt.Errorf("unable to encode payments.paymentForm#8d0b2415: field users element with index %d is nil", idx) + return fmt.Errorf("unable to encode payments.paymentForm#1694761b: field users element with index %d is nil", idx) } if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode payments.paymentForm#8d0b2415: field users element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode payments.paymentForm#1694761b: field users element with index %d: %w", idx, err) } } return nil @@ -349,10 +349,10 @@ func (p *PaymentsPaymentForm) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (p *PaymentsPaymentForm) Decode(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't decode payments.paymentForm#8d0b2415 to nil") + return fmt.Errorf("can't decode payments.paymentForm#1694761b to nil") } if err := b.ConsumeID(PaymentsPaymentFormTypeID); err != nil { - return fmt.Errorf("unable to decode payments.paymentForm#8d0b2415: %w", err) + return fmt.Errorf("unable to decode payments.paymentForm#1694761b: %w", err) } return p.DecodeBare(b) } @@ -360,11 +360,11 @@ func (p *PaymentsPaymentForm) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (p *PaymentsPaymentForm) DecodeBare(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't decode payments.paymentForm#8d0b2415 to nil") + return fmt.Errorf("can't decode payments.paymentForm#1694761b to nil") } { if err := p.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode payments.paymentForm#8d0b2415: field flags: %w", err) + return fmt.Errorf("unable to decode payments.paymentForm#1694761b: field flags: %w", err) } } p.CanSaveCredentials = p.Flags.Has(2) @@ -372,62 +372,62 @@ func (p *PaymentsPaymentForm) DecodeBare(b *bin.Buffer) error { { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode payments.paymentForm#8d0b2415: field form_id: %w", err) + return fmt.Errorf("unable to decode payments.paymentForm#1694761b: field form_id: %w", err) } p.FormID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode payments.paymentForm#8d0b2415: field bot_id: %w", err) + return fmt.Errorf("unable to decode payments.paymentForm#1694761b: field bot_id: %w", err) } p.BotID = value } { if err := p.Invoice.Decode(b); err != nil { - return fmt.Errorf("unable to decode payments.paymentForm#8d0b2415: field invoice: %w", err) + return fmt.Errorf("unable to decode payments.paymentForm#1694761b: field invoice: %w", err) } } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode payments.paymentForm#8d0b2415: field provider_id: %w", err) + return fmt.Errorf("unable to decode payments.paymentForm#1694761b: field provider_id: %w", err) } p.ProviderID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode payments.paymentForm#8d0b2415: field url: %w", err) + return fmt.Errorf("unable to decode payments.paymentForm#1694761b: field url: %w", err) } p.URL = value } if p.Flags.Has(4) { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode payments.paymentForm#8d0b2415: field native_provider: %w", err) + return fmt.Errorf("unable to decode payments.paymentForm#1694761b: field native_provider: %w", err) } p.NativeProvider = value } if p.Flags.Has(4) { if err := p.NativeParams.Decode(b); err != nil { - return fmt.Errorf("unable to decode payments.paymentForm#8d0b2415: field native_params: %w", err) + return fmt.Errorf("unable to decode payments.paymentForm#1694761b: field native_params: %w", err) } } if p.Flags.Has(0) { if err := p.SavedInfo.Decode(b); err != nil { - return fmt.Errorf("unable to decode payments.paymentForm#8d0b2415: field saved_info: %w", err) + return fmt.Errorf("unable to decode payments.paymentForm#1694761b: field saved_info: %w", err) } } if p.Flags.Has(1) { if err := p.SavedCredentials.Decode(b); err != nil { - return fmt.Errorf("unable to decode payments.paymentForm#8d0b2415: field saved_credentials: %w", err) + return fmt.Errorf("unable to decode payments.paymentForm#1694761b: field saved_credentials: %w", err) } } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode payments.paymentForm#8d0b2415: field users: %w", err) + return fmt.Errorf("unable to decode payments.paymentForm#1694761b: field users: %w", err) } if headerLen > 0 { @@ -436,7 +436,7 @@ func (p *PaymentsPaymentForm) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := DecodeUser(b) if err != nil { - return fmt.Errorf("unable to decode payments.paymentForm#8d0b2415: field users: %w", err) + return fmt.Errorf("unable to decode payments.paymentForm#1694761b: field users: %w", err) } p.Users = append(p.Users, value) } @@ -482,7 +482,7 @@ func (p *PaymentsPaymentForm) GetFormID() (value int64) { } // GetBotID returns value of BotID field. -func (p *PaymentsPaymentForm) GetBotID() (value int) { +func (p *PaymentsPaymentForm) GetBotID() (value int64) { return p.BotID } @@ -492,7 +492,7 @@ func (p *PaymentsPaymentForm) GetInvoice() (value Invoice) { } // GetProviderID returns value of ProviderID field. -func (p *PaymentsPaymentForm) GetProviderID() (value int) { +func (p *PaymentsPaymentForm) GetProviderID() (value int64) { return p.ProviderID } diff --git a/tg/tl_payments_payment_receipt_gen.go b/tg/tl_payments_payment_receipt_gen.go index 361d055de1..02f0d5e7b8 100644 --- a/tg/tl_payments_payment_receipt_gen.go +++ b/tg/tl_payments_payment_receipt_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// PaymentsPaymentReceipt represents TL type `payments.paymentReceipt#10b555d0`. +// PaymentsPaymentReceipt represents TL type `payments.paymentReceipt#70c4fe03`. // Receipt // // See https://core.telegram.org/constructor/payments.paymentReceipt for reference. @@ -42,9 +42,9 @@ type PaymentsPaymentReceipt struct { // Date of generation Date int // Bot ID - BotID int + BotID int64 // Provider ID - ProviderID int + ProviderID int64 // Title field of PaymentsPaymentReceipt. Title string // Description field of PaymentsPaymentReceipt. @@ -87,7 +87,7 @@ type PaymentsPaymentReceipt struct { } // PaymentsPaymentReceiptTypeID is TL type id of PaymentsPaymentReceipt. -const PaymentsPaymentReceiptTypeID = 0x10b555d0 +const PaymentsPaymentReceiptTypeID = 0x70c4fe03 // Ensuring interfaces in compile-time for PaymentsPaymentReceipt. var ( @@ -162,8 +162,8 @@ func (p *PaymentsPaymentReceipt) String() string { // FillFrom fills PaymentsPaymentReceipt from given interface. func (p *PaymentsPaymentReceipt) FillFrom(from interface { GetDate() (value int) - GetBotID() (value int) - GetProviderID() (value int) + GetBotID() (value int64) + GetProviderID() (value int64) GetTitle() (value string) GetDescription() (value string) GetPhoto() (value WebDocumentClass, ok bool) @@ -294,7 +294,7 @@ func (p *PaymentsPaymentReceipt) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (p *PaymentsPaymentReceipt) Encode(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't encode payments.paymentReceipt#10b555d0 as nil") + return fmt.Errorf("can't encode payments.paymentReceipt#70c4fe03 as nil") } b.PutID(PaymentsPaymentReceiptTypeID) return p.EncodeBare(b) @@ -303,7 +303,7 @@ func (p *PaymentsPaymentReceipt) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (p *PaymentsPaymentReceipt) EncodeBare(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't encode payments.paymentReceipt#10b555d0 as nil") + return fmt.Errorf("can't encode payments.paymentReceipt#70c4fe03 as nil") } if !(p.Photo == nil) { p.Flags.Set(2) @@ -318,32 +318,32 @@ func (p *PaymentsPaymentReceipt) EncodeBare(b *bin.Buffer) error { p.Flags.Set(3) } if err := p.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode payments.paymentReceipt#10b555d0: field flags: %w", err) + return fmt.Errorf("unable to encode payments.paymentReceipt#70c4fe03: field flags: %w", err) } b.PutInt(p.Date) - b.PutInt(p.BotID) - b.PutInt(p.ProviderID) + b.PutLong(p.BotID) + b.PutLong(p.ProviderID) b.PutString(p.Title) b.PutString(p.Description) if p.Flags.Has(2) { if p.Photo == nil { - return fmt.Errorf("unable to encode payments.paymentReceipt#10b555d0: field photo is nil") + return fmt.Errorf("unable to encode payments.paymentReceipt#70c4fe03: field photo is nil") } if err := p.Photo.Encode(b); err != nil { - return fmt.Errorf("unable to encode payments.paymentReceipt#10b555d0: field photo: %w", err) + return fmt.Errorf("unable to encode payments.paymentReceipt#70c4fe03: field photo: %w", err) } } if err := p.Invoice.Encode(b); err != nil { - return fmt.Errorf("unable to encode payments.paymentReceipt#10b555d0: field invoice: %w", err) + return fmt.Errorf("unable to encode payments.paymentReceipt#70c4fe03: field invoice: %w", err) } if p.Flags.Has(0) { if err := p.Info.Encode(b); err != nil { - return fmt.Errorf("unable to encode payments.paymentReceipt#10b555d0: field info: %w", err) + return fmt.Errorf("unable to encode payments.paymentReceipt#70c4fe03: field info: %w", err) } } if p.Flags.Has(1) { if err := p.Shipping.Encode(b); err != nil { - return fmt.Errorf("unable to encode payments.paymentReceipt#10b555d0: field shipping: %w", err) + return fmt.Errorf("unable to encode payments.paymentReceipt#70c4fe03: field shipping: %w", err) } } if p.Flags.Has(3) { @@ -355,10 +355,10 @@ func (p *PaymentsPaymentReceipt) EncodeBare(b *bin.Buffer) error { b.PutVectorHeader(len(p.Users)) for idx, v := range p.Users { if v == nil { - return fmt.Errorf("unable to encode payments.paymentReceipt#10b555d0: field users element with index %d is nil", idx) + return fmt.Errorf("unable to encode payments.paymentReceipt#70c4fe03: field users element with index %d is nil", idx) } if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode payments.paymentReceipt#10b555d0: field users element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode payments.paymentReceipt#70c4fe03: field users element with index %d: %w", idx, err) } } return nil @@ -367,10 +367,10 @@ func (p *PaymentsPaymentReceipt) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (p *PaymentsPaymentReceipt) Decode(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't decode payments.paymentReceipt#10b555d0 to nil") + return fmt.Errorf("can't decode payments.paymentReceipt#70c4fe03 to nil") } if err := b.ConsumeID(PaymentsPaymentReceiptTypeID); err != nil { - return fmt.Errorf("unable to decode payments.paymentReceipt#10b555d0: %w", err) + return fmt.Errorf("unable to decode payments.paymentReceipt#70c4fe03: %w", err) } return p.DecodeBare(b) } @@ -378,102 +378,102 @@ func (p *PaymentsPaymentReceipt) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (p *PaymentsPaymentReceipt) DecodeBare(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't decode payments.paymentReceipt#10b555d0 to nil") + return fmt.Errorf("can't decode payments.paymentReceipt#70c4fe03 to nil") } { if err := p.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode payments.paymentReceipt#10b555d0: field flags: %w", err) + return fmt.Errorf("unable to decode payments.paymentReceipt#70c4fe03: field flags: %w", err) } } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode payments.paymentReceipt#10b555d0: field date: %w", err) + return fmt.Errorf("unable to decode payments.paymentReceipt#70c4fe03: field date: %w", err) } p.Date = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode payments.paymentReceipt#10b555d0: field bot_id: %w", err) + return fmt.Errorf("unable to decode payments.paymentReceipt#70c4fe03: field bot_id: %w", err) } p.BotID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode payments.paymentReceipt#10b555d0: field provider_id: %w", err) + return fmt.Errorf("unable to decode payments.paymentReceipt#70c4fe03: field provider_id: %w", err) } p.ProviderID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode payments.paymentReceipt#10b555d0: field title: %w", err) + return fmt.Errorf("unable to decode payments.paymentReceipt#70c4fe03: field title: %w", err) } p.Title = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode payments.paymentReceipt#10b555d0: field description: %w", err) + return fmt.Errorf("unable to decode payments.paymentReceipt#70c4fe03: field description: %w", err) } p.Description = value } if p.Flags.Has(2) { value, err := DecodeWebDocument(b) if err != nil { - return fmt.Errorf("unable to decode payments.paymentReceipt#10b555d0: field photo: %w", err) + return fmt.Errorf("unable to decode payments.paymentReceipt#70c4fe03: field photo: %w", err) } p.Photo = value } { if err := p.Invoice.Decode(b); err != nil { - return fmt.Errorf("unable to decode payments.paymentReceipt#10b555d0: field invoice: %w", err) + return fmt.Errorf("unable to decode payments.paymentReceipt#70c4fe03: field invoice: %w", err) } } if p.Flags.Has(0) { if err := p.Info.Decode(b); err != nil { - return fmt.Errorf("unable to decode payments.paymentReceipt#10b555d0: field info: %w", err) + return fmt.Errorf("unable to decode payments.paymentReceipt#70c4fe03: field info: %w", err) } } if p.Flags.Has(1) { if err := p.Shipping.Decode(b); err != nil { - return fmt.Errorf("unable to decode payments.paymentReceipt#10b555d0: field shipping: %w", err) + return fmt.Errorf("unable to decode payments.paymentReceipt#70c4fe03: field shipping: %w", err) } } if p.Flags.Has(3) { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode payments.paymentReceipt#10b555d0: field tip_amount: %w", err) + return fmt.Errorf("unable to decode payments.paymentReceipt#70c4fe03: field tip_amount: %w", err) } p.TipAmount = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode payments.paymentReceipt#10b555d0: field currency: %w", err) + return fmt.Errorf("unable to decode payments.paymentReceipt#70c4fe03: field currency: %w", err) } p.Currency = value } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode payments.paymentReceipt#10b555d0: field total_amount: %w", err) + return fmt.Errorf("unable to decode payments.paymentReceipt#70c4fe03: field total_amount: %w", err) } p.TotalAmount = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode payments.paymentReceipt#10b555d0: field credentials_title: %w", err) + return fmt.Errorf("unable to decode payments.paymentReceipt#70c4fe03: field credentials_title: %w", err) } p.CredentialsTitle = value } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode payments.paymentReceipt#10b555d0: field users: %w", err) + return fmt.Errorf("unable to decode payments.paymentReceipt#70c4fe03: field users: %w", err) } if headerLen > 0 { @@ -482,7 +482,7 @@ func (p *PaymentsPaymentReceipt) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := DecodeUser(b) if err != nil { - return fmt.Errorf("unable to decode payments.paymentReceipt#10b555d0: field users: %w", err) + return fmt.Errorf("unable to decode payments.paymentReceipt#70c4fe03: field users: %w", err) } p.Users = append(p.Users, value) } @@ -496,12 +496,12 @@ func (p *PaymentsPaymentReceipt) GetDate() (value int) { } // GetBotID returns value of BotID field. -func (p *PaymentsPaymentReceipt) GetBotID() (value int) { +func (p *PaymentsPaymentReceipt) GetBotID() (value int64) { return p.BotID } // GetProviderID returns value of ProviderID field. -func (p *PaymentsPaymentReceipt) GetProviderID() (value int) { +func (p *PaymentsPaymentReceipt) GetProviderID() (value int64) { return p.ProviderID } diff --git a/tg/tl_peer_gen.go b/tg/tl_peer_gen.go index c83eb0efad..f30ff322ea 100644 --- a/tg/tl_peer_gen.go +++ b/tg/tl_peer_gen.go @@ -29,17 +29,17 @@ var ( _ = tgerr.Error{} ) -// PeerUser represents TL type `peerUser#9db1bc6d`. +// PeerUser represents TL type `peerUser#59511722`. // Chat partner // // See https://core.telegram.org/constructor/peerUser for reference. type PeerUser struct { // User identifier - UserID int + UserID int64 } // PeerUserTypeID is TL type id of PeerUser. -const PeerUserTypeID = 0x9db1bc6d +const PeerUserTypeID = 0x59511722 // construct implements constructor of PeerClass. func (p PeerUser) construct() PeerClass { return &p } @@ -76,7 +76,7 @@ func (p *PeerUser) String() string { // FillFrom fills PeerUser from given interface. func (p *PeerUser) FillFrom(from interface { - GetUserID() (value int) + GetUserID() (value int64) }) { p.UserID = from.GetUserID() } @@ -115,7 +115,7 @@ func (p *PeerUser) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (p *PeerUser) Encode(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't encode peerUser#9db1bc6d as nil") + return fmt.Errorf("can't encode peerUser#59511722 as nil") } b.PutID(PeerUserTypeID) return p.EncodeBare(b) @@ -124,19 +124,19 @@ func (p *PeerUser) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (p *PeerUser) EncodeBare(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't encode peerUser#9db1bc6d as nil") + return fmt.Errorf("can't encode peerUser#59511722 as nil") } - b.PutInt(p.UserID) + b.PutLong(p.UserID) return nil } // Decode implements bin.Decoder. func (p *PeerUser) Decode(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't decode peerUser#9db1bc6d to nil") + return fmt.Errorf("can't decode peerUser#59511722 to nil") } if err := b.ConsumeID(PeerUserTypeID); err != nil { - return fmt.Errorf("unable to decode peerUser#9db1bc6d: %w", err) + return fmt.Errorf("unable to decode peerUser#59511722: %w", err) } return p.DecodeBare(b) } @@ -144,12 +144,12 @@ func (p *PeerUser) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (p *PeerUser) DecodeBare(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't decode peerUser#9db1bc6d to nil") + return fmt.Errorf("can't decode peerUser#59511722 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode peerUser#9db1bc6d: field user_id: %w", err) + return fmt.Errorf("unable to decode peerUser#59511722: field user_id: %w", err) } p.UserID = value } @@ -157,21 +157,21 @@ func (p *PeerUser) DecodeBare(b *bin.Buffer) error { } // GetUserID returns value of UserID field. -func (p *PeerUser) GetUserID() (value int) { +func (p *PeerUser) GetUserID() (value int64) { return p.UserID } -// PeerChat represents TL type `peerChat#bad0e5bb`. +// PeerChat represents TL type `peerChat#36c6019a`. // Group. // // See https://core.telegram.org/constructor/peerChat for reference. type PeerChat struct { // Group identifier - ChatID int + ChatID int64 } // PeerChatTypeID is TL type id of PeerChat. -const PeerChatTypeID = 0xbad0e5bb +const PeerChatTypeID = 0x36c6019a // construct implements constructor of PeerClass. func (p PeerChat) construct() PeerClass { return &p } @@ -208,7 +208,7 @@ func (p *PeerChat) String() string { // FillFrom fills PeerChat from given interface. func (p *PeerChat) FillFrom(from interface { - GetChatID() (value int) + GetChatID() (value int64) }) { p.ChatID = from.GetChatID() } @@ -247,7 +247,7 @@ func (p *PeerChat) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (p *PeerChat) Encode(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't encode peerChat#bad0e5bb as nil") + return fmt.Errorf("can't encode peerChat#36c6019a as nil") } b.PutID(PeerChatTypeID) return p.EncodeBare(b) @@ -256,19 +256,19 @@ func (p *PeerChat) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (p *PeerChat) EncodeBare(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't encode peerChat#bad0e5bb as nil") + return fmt.Errorf("can't encode peerChat#36c6019a as nil") } - b.PutInt(p.ChatID) + b.PutLong(p.ChatID) return nil } // Decode implements bin.Decoder. func (p *PeerChat) Decode(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't decode peerChat#bad0e5bb to nil") + return fmt.Errorf("can't decode peerChat#36c6019a to nil") } if err := b.ConsumeID(PeerChatTypeID); err != nil { - return fmt.Errorf("unable to decode peerChat#bad0e5bb: %w", err) + return fmt.Errorf("unable to decode peerChat#36c6019a: %w", err) } return p.DecodeBare(b) } @@ -276,12 +276,12 @@ func (p *PeerChat) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (p *PeerChat) DecodeBare(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't decode peerChat#bad0e5bb to nil") + return fmt.Errorf("can't decode peerChat#36c6019a to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode peerChat#bad0e5bb: field chat_id: %w", err) + return fmt.Errorf("unable to decode peerChat#36c6019a: field chat_id: %w", err) } p.ChatID = value } @@ -289,21 +289,21 @@ func (p *PeerChat) DecodeBare(b *bin.Buffer) error { } // GetChatID returns value of ChatID field. -func (p *PeerChat) GetChatID() (value int) { +func (p *PeerChat) GetChatID() (value int64) { return p.ChatID } -// PeerChannel represents TL type `peerChannel#bddde532`. +// PeerChannel represents TL type `peerChannel#a2a5371e`. // Channel/supergroup // // See https://core.telegram.org/constructor/peerChannel for reference. type PeerChannel struct { // Channel ID - ChannelID int + ChannelID int64 } // PeerChannelTypeID is TL type id of PeerChannel. -const PeerChannelTypeID = 0xbddde532 +const PeerChannelTypeID = 0xa2a5371e // construct implements constructor of PeerClass. func (p PeerChannel) construct() PeerClass { return &p } @@ -340,7 +340,7 @@ func (p *PeerChannel) String() string { // FillFrom fills PeerChannel from given interface. func (p *PeerChannel) FillFrom(from interface { - GetChannelID() (value int) + GetChannelID() (value int64) }) { p.ChannelID = from.GetChannelID() } @@ -379,7 +379,7 @@ func (p *PeerChannel) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (p *PeerChannel) Encode(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't encode peerChannel#bddde532 as nil") + return fmt.Errorf("can't encode peerChannel#a2a5371e as nil") } b.PutID(PeerChannelTypeID) return p.EncodeBare(b) @@ -388,19 +388,19 @@ func (p *PeerChannel) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (p *PeerChannel) EncodeBare(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't encode peerChannel#bddde532 as nil") + return fmt.Errorf("can't encode peerChannel#a2a5371e as nil") } - b.PutInt(p.ChannelID) + b.PutLong(p.ChannelID) return nil } // Decode implements bin.Decoder. func (p *PeerChannel) Decode(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't decode peerChannel#bddde532 to nil") + return fmt.Errorf("can't decode peerChannel#a2a5371e to nil") } if err := b.ConsumeID(PeerChannelTypeID); err != nil { - return fmt.Errorf("unable to decode peerChannel#bddde532: %w", err) + return fmt.Errorf("unable to decode peerChannel#a2a5371e: %w", err) } return p.DecodeBare(b) } @@ -408,12 +408,12 @@ func (p *PeerChannel) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (p *PeerChannel) DecodeBare(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't decode peerChannel#bddde532 to nil") + return fmt.Errorf("can't decode peerChannel#a2a5371e to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode peerChannel#bddde532: field channel_id: %w", err) + return fmt.Errorf("unable to decode peerChannel#a2a5371e: field channel_id: %w", err) } p.ChannelID = value } @@ -421,7 +421,7 @@ func (p *PeerChannel) DecodeBare(b *bin.Buffer) error { } // GetChannelID returns value of ChannelID field. -func (p *PeerChannel) GetChannelID() (value int) { +func (p *PeerChannel) GetChannelID() (value int64) { return p.ChannelID } @@ -435,9 +435,9 @@ func (p *PeerChannel) GetChannelID() (value int) { // panic(err) // } // switch v := g.(type) { -// case *tg.PeerUser: // peerUser#9db1bc6d -// case *tg.PeerChat: // peerChat#bad0e5bb -// case *tg.PeerChannel: // peerChannel#bddde532 +// case *tg.PeerUser: // peerUser#59511722 +// case *tg.PeerChat: // peerChat#36c6019a +// case *tg.PeerChannel: // peerChannel#a2a5371e // default: panic(v) // } type PeerClass interface { @@ -475,21 +475,21 @@ func DecodePeer(buf *bin.Buffer) (PeerClass, error) { } switch id { case PeerUserTypeID: - // Decoding peerUser#9db1bc6d. + // Decoding peerUser#59511722. v := PeerUser{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode PeerClass: %w", err) } return &v, nil case PeerChatTypeID: - // Decoding peerChat#bad0e5bb. + // Decoding peerChat#36c6019a. v := PeerChat{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode PeerClass: %w", err) } return &v, nil case PeerChannelTypeID: - // Decoding peerChannel#bddde532. + // Decoding peerChannel#a2a5371e. v := PeerChannel{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode PeerClass: %w", err) diff --git a/tg/tl_phone_call_gen.go b/tg/tl_phone_call_gen.go index feb190dad9..2f9ca0ef57 100644 --- a/tg/tl_phone_call_gen.go +++ b/tg/tl_phone_call_gen.go @@ -161,7 +161,7 @@ func (p *PhoneCallEmpty) GetID() (value int64) { return p.ID } -// PhoneCallWaiting represents TL type `phoneCallWaiting#1b8f4ad1`. +// PhoneCallWaiting represents TL type `phoneCallWaiting#c5226f17`. // Incoming phone call // // See https://core.telegram.org/constructor/phoneCallWaiting for reference. @@ -180,9 +180,9 @@ type PhoneCallWaiting struct { // Date Date int // Admin ID - AdminID int + AdminID int64 // Participant ID - ParticipantID int + ParticipantID int64 // Phone call protocol info Protocol PhoneCallProtocol // When was the phone call received @@ -192,7 +192,7 @@ type PhoneCallWaiting struct { } // PhoneCallWaitingTypeID is TL type id of PhoneCallWaiting. -const PhoneCallWaitingTypeID = 0x1b8f4ad1 +const PhoneCallWaitingTypeID = 0xc5226f17 // construct implements constructor of PhoneCallClass. func (p PhoneCallWaiting) construct() PhoneCallClass { return &p } @@ -257,8 +257,8 @@ func (p *PhoneCallWaiting) FillFrom(from interface { GetID() (value int64) GetAccessHash() (value int64) GetDate() (value int) - GetAdminID() (value int) - GetParticipantID() (value int) + GetAdminID() (value int64) + GetParticipantID() (value int64) GetProtocol() (value PhoneCallProtocol) GetReceiveDate() (value int, ok bool) }) { @@ -339,7 +339,7 @@ func (p *PhoneCallWaiting) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (p *PhoneCallWaiting) Encode(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't encode phoneCallWaiting#1b8f4ad1 as nil") + return fmt.Errorf("can't encode phoneCallWaiting#c5226f17 as nil") } b.PutID(PhoneCallWaitingTypeID) return p.EncodeBare(b) @@ -348,7 +348,7 @@ func (p *PhoneCallWaiting) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (p *PhoneCallWaiting) EncodeBare(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't encode phoneCallWaiting#1b8f4ad1 as nil") + return fmt.Errorf("can't encode phoneCallWaiting#c5226f17 as nil") } if !(p.Video == false) { p.Flags.Set(6) @@ -357,15 +357,15 @@ func (p *PhoneCallWaiting) EncodeBare(b *bin.Buffer) error { p.Flags.Set(0) } if err := p.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode phoneCallWaiting#1b8f4ad1: field flags: %w", err) + return fmt.Errorf("unable to encode phoneCallWaiting#c5226f17: field flags: %w", err) } b.PutLong(p.ID) b.PutLong(p.AccessHash) b.PutInt(p.Date) - b.PutInt(p.AdminID) - b.PutInt(p.ParticipantID) + b.PutLong(p.AdminID) + b.PutLong(p.ParticipantID) if err := p.Protocol.Encode(b); err != nil { - return fmt.Errorf("unable to encode phoneCallWaiting#1b8f4ad1: field protocol: %w", err) + return fmt.Errorf("unable to encode phoneCallWaiting#c5226f17: field protocol: %w", err) } if p.Flags.Has(0) { b.PutInt(p.ReceiveDate) @@ -376,10 +376,10 @@ func (p *PhoneCallWaiting) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (p *PhoneCallWaiting) Decode(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't decode phoneCallWaiting#1b8f4ad1 to nil") + return fmt.Errorf("can't decode phoneCallWaiting#c5226f17 to nil") } if err := b.ConsumeID(PhoneCallWaitingTypeID); err != nil { - return fmt.Errorf("unable to decode phoneCallWaiting#1b8f4ad1: %w", err) + return fmt.Errorf("unable to decode phoneCallWaiting#c5226f17: %w", err) } return p.DecodeBare(b) } @@ -387,58 +387,58 @@ func (p *PhoneCallWaiting) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (p *PhoneCallWaiting) DecodeBare(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't decode phoneCallWaiting#1b8f4ad1 to nil") + return fmt.Errorf("can't decode phoneCallWaiting#c5226f17 to nil") } { if err := p.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode phoneCallWaiting#1b8f4ad1: field flags: %w", err) + return fmt.Errorf("unable to decode phoneCallWaiting#c5226f17: field flags: %w", err) } } p.Video = p.Flags.Has(6) { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode phoneCallWaiting#1b8f4ad1: field id: %w", err) + return fmt.Errorf("unable to decode phoneCallWaiting#c5226f17: field id: %w", err) } p.ID = value } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode phoneCallWaiting#1b8f4ad1: field access_hash: %w", err) + return fmt.Errorf("unable to decode phoneCallWaiting#c5226f17: field access_hash: %w", err) } p.AccessHash = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode phoneCallWaiting#1b8f4ad1: field date: %w", err) + return fmt.Errorf("unable to decode phoneCallWaiting#c5226f17: field date: %w", err) } p.Date = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode phoneCallWaiting#1b8f4ad1: field admin_id: %w", err) + return fmt.Errorf("unable to decode phoneCallWaiting#c5226f17: field admin_id: %w", err) } p.AdminID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode phoneCallWaiting#1b8f4ad1: field participant_id: %w", err) + return fmt.Errorf("unable to decode phoneCallWaiting#c5226f17: field participant_id: %w", err) } p.ParticipantID = value } { if err := p.Protocol.Decode(b); err != nil { - return fmt.Errorf("unable to decode phoneCallWaiting#1b8f4ad1: field protocol: %w", err) + return fmt.Errorf("unable to decode phoneCallWaiting#c5226f17: field protocol: %w", err) } } if p.Flags.Has(0) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode phoneCallWaiting#1b8f4ad1: field receive_date: %w", err) + return fmt.Errorf("unable to decode phoneCallWaiting#c5226f17: field receive_date: %w", err) } p.ReceiveDate = value } @@ -477,12 +477,12 @@ func (p *PhoneCallWaiting) GetDate() (value int) { } // GetAdminID returns value of AdminID field. -func (p *PhoneCallWaiting) GetAdminID() (value int) { +func (p *PhoneCallWaiting) GetAdminID() (value int64) { return p.AdminID } // GetParticipantID returns value of ParticipantID field. -func (p *PhoneCallWaiting) GetParticipantID() (value int) { +func (p *PhoneCallWaiting) GetParticipantID() (value int64) { return p.ParticipantID } @@ -506,7 +506,7 @@ func (p *PhoneCallWaiting) GetReceiveDate() (value int, ok bool) { return p.ReceiveDate, true } -// PhoneCallRequested represents TL type `phoneCallRequested#87eabb53`. +// PhoneCallRequested represents TL type `phoneCallRequested#14b0ed0c`. // Requested phone call // // See https://core.telegram.org/constructor/phoneCallRequested for reference. @@ -525,9 +525,9 @@ type PhoneCallRequested struct { // When was the phone call created Date int // ID of the creator of the phone call - AdminID int + AdminID int64 // ID of the other participant of the phone call - ParticipantID int + ParticipantID int64 // Parameter for key exchange¹ // // Links: @@ -538,7 +538,7 @@ type PhoneCallRequested struct { } // PhoneCallRequestedTypeID is TL type id of PhoneCallRequested. -const PhoneCallRequestedTypeID = 0x87eabb53 +const PhoneCallRequestedTypeID = 0x14b0ed0c // construct implements constructor of PhoneCallClass. func (p PhoneCallRequested) construct() PhoneCallClass { return &p } @@ -603,8 +603,8 @@ func (p *PhoneCallRequested) FillFrom(from interface { GetID() (value int64) GetAccessHash() (value int64) GetDate() (value int) - GetAdminID() (value int) - GetParticipantID() (value int) + GetAdminID() (value int64) + GetParticipantID() (value int64) GetGAHash() (value []byte) GetProtocol() (value PhoneCallProtocol) }) { @@ -681,7 +681,7 @@ func (p *PhoneCallRequested) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (p *PhoneCallRequested) Encode(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't encode phoneCallRequested#87eabb53 as nil") + return fmt.Errorf("can't encode phoneCallRequested#14b0ed0c as nil") } b.PutID(PhoneCallRequestedTypeID) return p.EncodeBare(b) @@ -690,22 +690,22 @@ func (p *PhoneCallRequested) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (p *PhoneCallRequested) EncodeBare(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't encode phoneCallRequested#87eabb53 as nil") + return fmt.Errorf("can't encode phoneCallRequested#14b0ed0c as nil") } if !(p.Video == false) { p.Flags.Set(6) } if err := p.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode phoneCallRequested#87eabb53: field flags: %w", err) + return fmt.Errorf("unable to encode phoneCallRequested#14b0ed0c: field flags: %w", err) } b.PutLong(p.ID) b.PutLong(p.AccessHash) b.PutInt(p.Date) - b.PutInt(p.AdminID) - b.PutInt(p.ParticipantID) + b.PutLong(p.AdminID) + b.PutLong(p.ParticipantID) b.PutBytes(p.GAHash) if err := p.Protocol.Encode(b); err != nil { - return fmt.Errorf("unable to encode phoneCallRequested#87eabb53: field protocol: %w", err) + return fmt.Errorf("unable to encode phoneCallRequested#14b0ed0c: field protocol: %w", err) } return nil } @@ -713,10 +713,10 @@ func (p *PhoneCallRequested) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (p *PhoneCallRequested) Decode(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't decode phoneCallRequested#87eabb53 to nil") + return fmt.Errorf("can't decode phoneCallRequested#14b0ed0c to nil") } if err := b.ConsumeID(PhoneCallRequestedTypeID); err != nil { - return fmt.Errorf("unable to decode phoneCallRequested#87eabb53: %w", err) + return fmt.Errorf("unable to decode phoneCallRequested#14b0ed0c: %w", err) } return p.DecodeBare(b) } @@ -724,59 +724,59 @@ func (p *PhoneCallRequested) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (p *PhoneCallRequested) DecodeBare(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't decode phoneCallRequested#87eabb53 to nil") + return fmt.Errorf("can't decode phoneCallRequested#14b0ed0c to nil") } { if err := p.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode phoneCallRequested#87eabb53: field flags: %w", err) + return fmt.Errorf("unable to decode phoneCallRequested#14b0ed0c: field flags: %w", err) } } p.Video = p.Flags.Has(6) { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode phoneCallRequested#87eabb53: field id: %w", err) + return fmt.Errorf("unable to decode phoneCallRequested#14b0ed0c: field id: %w", err) } p.ID = value } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode phoneCallRequested#87eabb53: field access_hash: %w", err) + return fmt.Errorf("unable to decode phoneCallRequested#14b0ed0c: field access_hash: %w", err) } p.AccessHash = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode phoneCallRequested#87eabb53: field date: %w", err) + return fmt.Errorf("unable to decode phoneCallRequested#14b0ed0c: field date: %w", err) } p.Date = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode phoneCallRequested#87eabb53: field admin_id: %w", err) + return fmt.Errorf("unable to decode phoneCallRequested#14b0ed0c: field admin_id: %w", err) } p.AdminID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode phoneCallRequested#87eabb53: field participant_id: %w", err) + return fmt.Errorf("unable to decode phoneCallRequested#14b0ed0c: field participant_id: %w", err) } p.ParticipantID = value } { value, err := b.Bytes() if err != nil { - return fmt.Errorf("unable to decode phoneCallRequested#87eabb53: field g_a_hash: %w", err) + return fmt.Errorf("unable to decode phoneCallRequested#14b0ed0c: field g_a_hash: %w", err) } p.GAHash = value } { if err := p.Protocol.Decode(b); err != nil { - return fmt.Errorf("unable to decode phoneCallRequested#87eabb53: field protocol: %w", err) + return fmt.Errorf("unable to decode phoneCallRequested#14b0ed0c: field protocol: %w", err) } } return nil @@ -814,12 +814,12 @@ func (p *PhoneCallRequested) GetDate() (value int) { } // GetAdminID returns value of AdminID field. -func (p *PhoneCallRequested) GetAdminID() (value int) { +func (p *PhoneCallRequested) GetAdminID() (value int64) { return p.AdminID } // GetParticipantID returns value of ParticipantID field. -func (p *PhoneCallRequested) GetParticipantID() (value int) { +func (p *PhoneCallRequested) GetParticipantID() (value int64) { return p.ParticipantID } @@ -833,7 +833,7 @@ func (p *PhoneCallRequested) GetProtocol() (value PhoneCallProtocol) { return p.Protocol } -// PhoneCallAccepted represents TL type `phoneCallAccepted#997c454a`. +// PhoneCallAccepted represents TL type `phoneCallAccepted#3660c311`. // An accepted phone call // // See https://core.telegram.org/constructor/phoneCallAccepted for reference. @@ -852,9 +852,9 @@ type PhoneCallAccepted struct { // When was the call accepted Date int // ID of the call creator - AdminID int + AdminID int64 // ID of the other user in the call - ParticipantID int + ParticipantID int64 // B parameter for secure E2E phone call key exchange¹ // // Links: @@ -865,7 +865,7 @@ type PhoneCallAccepted struct { } // PhoneCallAcceptedTypeID is TL type id of PhoneCallAccepted. -const PhoneCallAcceptedTypeID = 0x997c454a +const PhoneCallAcceptedTypeID = 0x3660c311 // construct implements constructor of PhoneCallClass. func (p PhoneCallAccepted) construct() PhoneCallClass { return &p } @@ -930,8 +930,8 @@ func (p *PhoneCallAccepted) FillFrom(from interface { GetID() (value int64) GetAccessHash() (value int64) GetDate() (value int) - GetAdminID() (value int) - GetParticipantID() (value int) + GetAdminID() (value int64) + GetParticipantID() (value int64) GetGB() (value []byte) GetProtocol() (value PhoneCallProtocol) }) { @@ -1008,7 +1008,7 @@ func (p *PhoneCallAccepted) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (p *PhoneCallAccepted) Encode(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't encode phoneCallAccepted#997c454a as nil") + return fmt.Errorf("can't encode phoneCallAccepted#3660c311 as nil") } b.PutID(PhoneCallAcceptedTypeID) return p.EncodeBare(b) @@ -1017,22 +1017,22 @@ func (p *PhoneCallAccepted) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (p *PhoneCallAccepted) EncodeBare(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't encode phoneCallAccepted#997c454a as nil") + return fmt.Errorf("can't encode phoneCallAccepted#3660c311 as nil") } if !(p.Video == false) { p.Flags.Set(6) } if err := p.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode phoneCallAccepted#997c454a: field flags: %w", err) + return fmt.Errorf("unable to encode phoneCallAccepted#3660c311: field flags: %w", err) } b.PutLong(p.ID) b.PutLong(p.AccessHash) b.PutInt(p.Date) - b.PutInt(p.AdminID) - b.PutInt(p.ParticipantID) + b.PutLong(p.AdminID) + b.PutLong(p.ParticipantID) b.PutBytes(p.GB) if err := p.Protocol.Encode(b); err != nil { - return fmt.Errorf("unable to encode phoneCallAccepted#997c454a: field protocol: %w", err) + return fmt.Errorf("unable to encode phoneCallAccepted#3660c311: field protocol: %w", err) } return nil } @@ -1040,10 +1040,10 @@ func (p *PhoneCallAccepted) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (p *PhoneCallAccepted) Decode(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't decode phoneCallAccepted#997c454a to nil") + return fmt.Errorf("can't decode phoneCallAccepted#3660c311 to nil") } if err := b.ConsumeID(PhoneCallAcceptedTypeID); err != nil { - return fmt.Errorf("unable to decode phoneCallAccepted#997c454a: %w", err) + return fmt.Errorf("unable to decode phoneCallAccepted#3660c311: %w", err) } return p.DecodeBare(b) } @@ -1051,59 +1051,59 @@ func (p *PhoneCallAccepted) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (p *PhoneCallAccepted) DecodeBare(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't decode phoneCallAccepted#997c454a to nil") + return fmt.Errorf("can't decode phoneCallAccepted#3660c311 to nil") } { if err := p.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode phoneCallAccepted#997c454a: field flags: %w", err) + return fmt.Errorf("unable to decode phoneCallAccepted#3660c311: field flags: %w", err) } } p.Video = p.Flags.Has(6) { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode phoneCallAccepted#997c454a: field id: %w", err) + return fmt.Errorf("unable to decode phoneCallAccepted#3660c311: field id: %w", err) } p.ID = value } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode phoneCallAccepted#997c454a: field access_hash: %w", err) + return fmt.Errorf("unable to decode phoneCallAccepted#3660c311: field access_hash: %w", err) } p.AccessHash = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode phoneCallAccepted#997c454a: field date: %w", err) + return fmt.Errorf("unable to decode phoneCallAccepted#3660c311: field date: %w", err) } p.Date = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode phoneCallAccepted#997c454a: field admin_id: %w", err) + return fmt.Errorf("unable to decode phoneCallAccepted#3660c311: field admin_id: %w", err) } p.AdminID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode phoneCallAccepted#997c454a: field participant_id: %w", err) + return fmt.Errorf("unable to decode phoneCallAccepted#3660c311: field participant_id: %w", err) } p.ParticipantID = value } { value, err := b.Bytes() if err != nil { - return fmt.Errorf("unable to decode phoneCallAccepted#997c454a: field g_b: %w", err) + return fmt.Errorf("unable to decode phoneCallAccepted#3660c311: field g_b: %w", err) } p.GB = value } { if err := p.Protocol.Decode(b); err != nil { - return fmt.Errorf("unable to decode phoneCallAccepted#997c454a: field protocol: %w", err) + return fmt.Errorf("unable to decode phoneCallAccepted#3660c311: field protocol: %w", err) } } return nil @@ -1141,12 +1141,12 @@ func (p *PhoneCallAccepted) GetDate() (value int) { } // GetAdminID returns value of AdminID field. -func (p *PhoneCallAccepted) GetAdminID() (value int) { +func (p *PhoneCallAccepted) GetAdminID() (value int64) { return p.AdminID } // GetParticipantID returns value of ParticipantID field. -func (p *PhoneCallAccepted) GetParticipantID() (value int) { +func (p *PhoneCallAccepted) GetParticipantID() (value int64) { return p.ParticipantID } @@ -1160,7 +1160,7 @@ func (p *PhoneCallAccepted) GetProtocol() (value PhoneCallProtocol) { return p.Protocol } -// PhoneCall represents TL type `phoneCall#8742ae7f`. +// PhoneCall represents TL type `phoneCall#967f7c67`. // Phone call // // See https://core.telegram.org/constructor/phoneCall for reference. @@ -1181,9 +1181,9 @@ type PhoneCall struct { // Date of creation of the call Date int // User ID of the creator of the call - AdminID int + AdminID int64 // User ID of the other participant in the call - ParticipantID int + ParticipantID int64 // Parameter for key exchange¹ // // Links: @@ -1203,7 +1203,7 @@ type PhoneCall struct { } // PhoneCallTypeID is TL type id of PhoneCall. -const PhoneCallTypeID = 0x8742ae7f +const PhoneCallTypeID = 0x967f7c67 // construct implements constructor of PhoneCallClass. func (p PhoneCall) construct() PhoneCallClass { return &p } @@ -1281,8 +1281,8 @@ func (p *PhoneCall) FillFrom(from interface { GetID() (value int64) GetAccessHash() (value int64) GetDate() (value int) - GetAdminID() (value int) - GetParticipantID() (value int) + GetAdminID() (value int64) + GetParticipantID() (value int64) GetGAOrB() (value []byte) GetKeyFingerprint() (value int64) GetProtocol() (value PhoneCallProtocol) @@ -1383,7 +1383,7 @@ func (p *PhoneCall) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (p *PhoneCall) Encode(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't encode phoneCall#8742ae7f as nil") + return fmt.Errorf("can't encode phoneCall#967f7c67 as nil") } b.PutID(PhoneCallTypeID) return p.EncodeBare(b) @@ -1392,7 +1392,7 @@ func (p *PhoneCall) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (p *PhoneCall) EncodeBare(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't encode phoneCall#8742ae7f as nil") + return fmt.Errorf("can't encode phoneCall#967f7c67 as nil") } if !(p.P2PAllowed == false) { p.Flags.Set(5) @@ -1401,25 +1401,25 @@ func (p *PhoneCall) EncodeBare(b *bin.Buffer) error { p.Flags.Set(6) } if err := p.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode phoneCall#8742ae7f: field flags: %w", err) + return fmt.Errorf("unable to encode phoneCall#967f7c67: field flags: %w", err) } b.PutLong(p.ID) b.PutLong(p.AccessHash) b.PutInt(p.Date) - b.PutInt(p.AdminID) - b.PutInt(p.ParticipantID) + b.PutLong(p.AdminID) + b.PutLong(p.ParticipantID) b.PutBytes(p.GAOrB) b.PutLong(p.KeyFingerprint) if err := p.Protocol.Encode(b); err != nil { - return fmt.Errorf("unable to encode phoneCall#8742ae7f: field protocol: %w", err) + return fmt.Errorf("unable to encode phoneCall#967f7c67: field protocol: %w", err) } b.PutVectorHeader(len(p.Connections)) for idx, v := range p.Connections { if v == nil { - return fmt.Errorf("unable to encode phoneCall#8742ae7f: field connections element with index %d is nil", idx) + return fmt.Errorf("unable to encode phoneCall#967f7c67: field connections element with index %d is nil", idx) } if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode phoneCall#8742ae7f: field connections element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode phoneCall#967f7c67: field connections element with index %d: %w", idx, err) } } b.PutInt(p.StartDate) @@ -1429,10 +1429,10 @@ func (p *PhoneCall) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (p *PhoneCall) Decode(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't decode phoneCall#8742ae7f to nil") + return fmt.Errorf("can't decode phoneCall#967f7c67 to nil") } if err := b.ConsumeID(PhoneCallTypeID); err != nil { - return fmt.Errorf("unable to decode phoneCall#8742ae7f: %w", err) + return fmt.Errorf("unable to decode phoneCall#967f7c67: %w", err) } return p.DecodeBare(b) } @@ -1440,11 +1440,11 @@ func (p *PhoneCall) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (p *PhoneCall) DecodeBare(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't decode phoneCall#8742ae7f to nil") + return fmt.Errorf("can't decode phoneCall#967f7c67 to nil") } { if err := p.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode phoneCall#8742ae7f: field flags: %w", err) + return fmt.Errorf("unable to decode phoneCall#967f7c67: field flags: %w", err) } } p.P2PAllowed = p.Flags.Has(5) @@ -1452,61 +1452,61 @@ func (p *PhoneCall) DecodeBare(b *bin.Buffer) error { { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode phoneCall#8742ae7f: field id: %w", err) + return fmt.Errorf("unable to decode phoneCall#967f7c67: field id: %w", err) } p.ID = value } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode phoneCall#8742ae7f: field access_hash: %w", err) + return fmt.Errorf("unable to decode phoneCall#967f7c67: field access_hash: %w", err) } p.AccessHash = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode phoneCall#8742ae7f: field date: %w", err) + return fmt.Errorf("unable to decode phoneCall#967f7c67: field date: %w", err) } p.Date = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode phoneCall#8742ae7f: field admin_id: %w", err) + return fmt.Errorf("unable to decode phoneCall#967f7c67: field admin_id: %w", err) } p.AdminID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode phoneCall#8742ae7f: field participant_id: %w", err) + return fmt.Errorf("unable to decode phoneCall#967f7c67: field participant_id: %w", err) } p.ParticipantID = value } { value, err := b.Bytes() if err != nil { - return fmt.Errorf("unable to decode phoneCall#8742ae7f: field g_a_or_b: %w", err) + return fmt.Errorf("unable to decode phoneCall#967f7c67: field g_a_or_b: %w", err) } p.GAOrB = value } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode phoneCall#8742ae7f: field key_fingerprint: %w", err) + return fmt.Errorf("unable to decode phoneCall#967f7c67: field key_fingerprint: %w", err) } p.KeyFingerprint = value } { if err := p.Protocol.Decode(b); err != nil { - return fmt.Errorf("unable to decode phoneCall#8742ae7f: field protocol: %w", err) + return fmt.Errorf("unable to decode phoneCall#967f7c67: field protocol: %w", err) } } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode phoneCall#8742ae7f: field connections: %w", err) + return fmt.Errorf("unable to decode phoneCall#967f7c67: field connections: %w", err) } if headerLen > 0 { @@ -1515,7 +1515,7 @@ func (p *PhoneCall) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := DecodePhoneConnection(b) if err != nil { - return fmt.Errorf("unable to decode phoneCall#8742ae7f: field connections: %w", err) + return fmt.Errorf("unable to decode phoneCall#967f7c67: field connections: %w", err) } p.Connections = append(p.Connections, value) } @@ -1523,7 +1523,7 @@ func (p *PhoneCall) DecodeBare(b *bin.Buffer) error { { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode phoneCall#8742ae7f: field start_date: %w", err) + return fmt.Errorf("unable to decode phoneCall#967f7c67: field start_date: %w", err) } p.StartDate = value } @@ -1578,12 +1578,12 @@ func (p *PhoneCall) GetDate() (value int) { } // GetAdminID returns value of AdminID field. -func (p *PhoneCall) GetAdminID() (value int) { +func (p *PhoneCall) GetAdminID() (value int64) { return p.AdminID } // GetParticipantID returns value of ParticipantID field. -func (p *PhoneCall) GetParticipantID() (value int) { +func (p *PhoneCall) GetParticipantID() (value int64) { return p.ParticipantID } @@ -1973,10 +1973,10 @@ func (p *PhoneCallDiscarded) GetDuration() (value int, ok bool) { // } // switch v := g.(type) { // case *tg.PhoneCallEmpty: // phoneCallEmpty#5366c915 -// case *tg.PhoneCallWaiting: // phoneCallWaiting#1b8f4ad1 -// case *tg.PhoneCallRequested: // phoneCallRequested#87eabb53 -// case *tg.PhoneCallAccepted: // phoneCallAccepted#997c454a -// case *tg.PhoneCall: // phoneCall#8742ae7f +// case *tg.PhoneCallWaiting: // phoneCallWaiting#c5226f17 +// case *tg.PhoneCallRequested: // phoneCallRequested#14b0ed0c +// case *tg.PhoneCallAccepted: // phoneCallAccepted#3660c311 +// case *tg.PhoneCall: // phoneCall#967f7c67 // case *tg.PhoneCallDiscarded: // phoneCallDiscarded#50ca4de1 // default: panic(v) // } @@ -2091,28 +2091,28 @@ func DecodePhoneCall(buf *bin.Buffer) (PhoneCallClass, error) { } return &v, nil case PhoneCallWaitingTypeID: - // Decoding phoneCallWaiting#1b8f4ad1. + // Decoding phoneCallWaiting#c5226f17. v := PhoneCallWaiting{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode PhoneCallClass: %w", err) } return &v, nil case PhoneCallRequestedTypeID: - // Decoding phoneCallRequested#87eabb53. + // Decoding phoneCallRequested#14b0ed0c. v := PhoneCallRequested{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode PhoneCallClass: %w", err) } return &v, nil case PhoneCallAcceptedTypeID: - // Decoding phoneCallAccepted#997c454a. + // Decoding phoneCallAccepted#3660c311. v := PhoneCallAccepted{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode PhoneCallClass: %w", err) } return &v, nil case PhoneCallTypeID: - // Decoding phoneCall#8742ae7f. + // Decoding phoneCall#967f7c67. v := PhoneCall{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode PhoneCallClass: %w", err) diff --git a/tg/tl_phone_call_slices_gen.go b/tg/tl_phone_call_slices_gen.go index 58f5896d94..f6d7e03a7a 100644 --- a/tg/tl_phone_call_slices_gen.go +++ b/tg/tl_phone_call_slices_gen.go @@ -114,6 +114,38 @@ func (s *PhoneCallClassArray) Pop() (v PhoneCallClass, ok bool) { return v, true } +// SortByID sorts slice of PhoneCallClass by ID. +func (s PhoneCallClassArray) SortByID() PhoneCallClassArray { + return s.Sort(func(a, b PhoneCallClass) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of PhoneCallClass by ID. +func (s PhoneCallClassArray) SortStableByID() PhoneCallClassArray { + return s.SortStable(func(a, b PhoneCallClass) bool { + return a.GetID() < b.GetID() + }) +} + +// FillPhoneCallEmptyMap fills only PhoneCallEmpty constructors to given map. +func (s PhoneCallClassArray) FillPhoneCallEmptyMap(to map[int64]*PhoneCallEmpty) { + for _, elem := range s { + value, ok := elem.(*PhoneCallEmpty) + if !ok { + continue + } + to[value.GetID()] = value + } +} + +// PhoneCallEmptyToMap collects only PhoneCallEmpty constructors to map. +func (s PhoneCallClassArray) PhoneCallEmptyToMap() map[int64]*PhoneCallEmpty { + r := make(map[int64]*PhoneCallEmpty, len(s)) + s.FillPhoneCallEmptyMap(r) + return r +} + // AsPhoneCallEmpty returns copy with only PhoneCallEmpty constructors. func (s PhoneCallClassArray) AsPhoneCallEmpty() (to PhoneCallEmptyArray) { for _, elem := range s { @@ -127,6 +159,24 @@ func (s PhoneCallClassArray) AsPhoneCallEmpty() (to PhoneCallEmptyArray) { return to } +// FillPhoneCallWaitingMap fills only PhoneCallWaiting constructors to given map. +func (s PhoneCallClassArray) FillPhoneCallWaitingMap(to map[int64]*PhoneCallWaiting) { + for _, elem := range s { + value, ok := elem.(*PhoneCallWaiting) + if !ok { + continue + } + to[value.GetID()] = value + } +} + +// PhoneCallWaitingToMap collects only PhoneCallWaiting constructors to map. +func (s PhoneCallClassArray) PhoneCallWaitingToMap() map[int64]*PhoneCallWaiting { + r := make(map[int64]*PhoneCallWaiting, len(s)) + s.FillPhoneCallWaitingMap(r) + return r +} + // AsPhoneCallWaiting returns copy with only PhoneCallWaiting constructors. func (s PhoneCallClassArray) AsPhoneCallWaiting() (to PhoneCallWaitingArray) { for _, elem := range s { @@ -140,6 +190,24 @@ func (s PhoneCallClassArray) AsPhoneCallWaiting() (to PhoneCallWaitingArray) { return to } +// FillPhoneCallRequestedMap fills only PhoneCallRequested constructors to given map. +func (s PhoneCallClassArray) FillPhoneCallRequestedMap(to map[int64]*PhoneCallRequested) { + for _, elem := range s { + value, ok := elem.(*PhoneCallRequested) + if !ok { + continue + } + to[value.GetID()] = value + } +} + +// PhoneCallRequestedToMap collects only PhoneCallRequested constructors to map. +func (s PhoneCallClassArray) PhoneCallRequestedToMap() map[int64]*PhoneCallRequested { + r := make(map[int64]*PhoneCallRequested, len(s)) + s.FillPhoneCallRequestedMap(r) + return r +} + // AsPhoneCallRequested returns copy with only PhoneCallRequested constructors. func (s PhoneCallClassArray) AsPhoneCallRequested() (to PhoneCallRequestedArray) { for _, elem := range s { @@ -153,6 +221,24 @@ func (s PhoneCallClassArray) AsPhoneCallRequested() (to PhoneCallRequestedArray) return to } +// FillPhoneCallAcceptedMap fills only PhoneCallAccepted constructors to given map. +func (s PhoneCallClassArray) FillPhoneCallAcceptedMap(to map[int64]*PhoneCallAccepted) { + for _, elem := range s { + value, ok := elem.(*PhoneCallAccepted) + if !ok { + continue + } + to[value.GetID()] = value + } +} + +// PhoneCallAcceptedToMap collects only PhoneCallAccepted constructors to map. +func (s PhoneCallClassArray) PhoneCallAcceptedToMap() map[int64]*PhoneCallAccepted { + r := make(map[int64]*PhoneCallAccepted, len(s)) + s.FillPhoneCallAcceptedMap(r) + return r +} + // AsPhoneCallAccepted returns copy with only PhoneCallAccepted constructors. func (s PhoneCallClassArray) AsPhoneCallAccepted() (to PhoneCallAcceptedArray) { for _, elem := range s { @@ -166,6 +252,24 @@ func (s PhoneCallClassArray) AsPhoneCallAccepted() (to PhoneCallAcceptedArray) { return to } +// FillPhoneCallMap fills only PhoneCall constructors to given map. +func (s PhoneCallClassArray) FillPhoneCallMap(to map[int64]*PhoneCall) { + for _, elem := range s { + value, ok := elem.(*PhoneCall) + if !ok { + continue + } + to[value.GetID()] = value + } +} + +// PhoneCallToMap collects only PhoneCall constructors to map. +func (s PhoneCallClassArray) PhoneCallToMap() map[int64]*PhoneCall { + r := make(map[int64]*PhoneCall, len(s)) + s.FillPhoneCallMap(r) + return r +} + // AsPhoneCall returns copy with only PhoneCall constructors. func (s PhoneCallClassArray) AsPhoneCall() (to PhoneCallArray) { for _, elem := range s { @@ -179,6 +283,24 @@ func (s PhoneCallClassArray) AsPhoneCall() (to PhoneCallArray) { return to } +// FillPhoneCallDiscardedMap fills only PhoneCallDiscarded constructors to given map. +func (s PhoneCallClassArray) FillPhoneCallDiscardedMap(to map[int64]*PhoneCallDiscarded) { + for _, elem := range s { + value, ok := elem.(*PhoneCallDiscarded) + if !ok { + continue + } + to[value.GetID()] = value + } +} + +// PhoneCallDiscardedToMap collects only PhoneCallDiscarded constructors to map. +func (s PhoneCallClassArray) PhoneCallDiscardedToMap() map[int64]*PhoneCallDiscarded { + r := make(map[int64]*PhoneCallDiscarded, len(s)) + s.FillPhoneCallDiscardedMap(r) + return r +} + // AsPhoneCallDiscarded returns copy with only PhoneCallDiscarded constructors. func (s PhoneCallClassArray) AsPhoneCallDiscarded() (to PhoneCallDiscardedArray) { for _, elem := range s { @@ -192,6 +314,24 @@ func (s PhoneCallClassArray) AsPhoneCallDiscarded() (to PhoneCallDiscardedArray) return to } +// FillNotEmptyMap fills only NotEmpty constructors to given map. +func (s PhoneCallClassArray) FillNotEmptyMap(to map[int64]NotEmptyPhoneCall) { + for _, elem := range s { + value, ok := elem.AsNotEmpty() + if !ok { + continue + } + to[value.GetID()] = value + } +} + +// NotEmptyToMap collects only NotEmpty constructors to map. +func (s PhoneCallClassArray) NotEmptyToMap() map[int64]NotEmptyPhoneCall { + r := make(map[int64]NotEmptyPhoneCall, len(s)) + s.FillNotEmptyMap(r) + return r +} + // AppendOnlyNotEmpty appends only NotEmpty constructors to // given slice. func (s PhoneCallClassArray) AppendOnlyNotEmpty(to []NotEmptyPhoneCall) []NotEmptyPhoneCall { @@ -329,6 +469,34 @@ func (s *PhoneCallEmptyArray) Pop() (v PhoneCallEmpty, ok bool) { return v, true } +// SortByID sorts slice of PhoneCallEmpty by ID. +func (s PhoneCallEmptyArray) SortByID() PhoneCallEmptyArray { + return s.Sort(func(a, b PhoneCallEmpty) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of PhoneCallEmpty by ID. +func (s PhoneCallEmptyArray) SortStableByID() PhoneCallEmptyArray { + return s.SortStable(func(a, b PhoneCallEmpty) bool { + return a.GetID() < b.GetID() + }) +} + +// FillMap fills constructors to given map. +func (s PhoneCallEmptyArray) FillMap(to map[int64]PhoneCallEmpty) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s PhoneCallEmptyArray) ToMap() map[int64]PhoneCallEmpty { + r := make(map[int64]PhoneCallEmpty, len(s)) + s.FillMap(r) + return r +} + // PhoneCallWaitingArray is adapter for slice of PhoneCallWaiting. type PhoneCallWaitingArray []PhoneCallWaiting @@ -411,6 +579,20 @@ func (s *PhoneCallWaitingArray) Pop() (v PhoneCallWaiting, ok bool) { return v, true } +// SortByID sorts slice of PhoneCallWaiting by ID. +func (s PhoneCallWaitingArray) SortByID() PhoneCallWaitingArray { + return s.Sort(func(a, b PhoneCallWaiting) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of PhoneCallWaiting by ID. +func (s PhoneCallWaitingArray) SortStableByID() PhoneCallWaitingArray { + return s.SortStable(func(a, b PhoneCallWaiting) bool { + return a.GetID() < b.GetID() + }) +} + // SortByDate sorts slice of PhoneCallWaiting by Date. func (s PhoneCallWaitingArray) SortByDate() PhoneCallWaitingArray { return s.Sort(func(a, b PhoneCallWaiting) bool { @@ -425,6 +607,20 @@ func (s PhoneCallWaitingArray) SortStableByDate() PhoneCallWaitingArray { }) } +// FillMap fills constructors to given map. +func (s PhoneCallWaitingArray) FillMap(to map[int64]PhoneCallWaiting) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s PhoneCallWaitingArray) ToMap() map[int64]PhoneCallWaiting { + r := make(map[int64]PhoneCallWaiting, len(s)) + s.FillMap(r) + return r +} + // PhoneCallRequestedArray is adapter for slice of PhoneCallRequested. type PhoneCallRequestedArray []PhoneCallRequested @@ -507,6 +703,20 @@ func (s *PhoneCallRequestedArray) Pop() (v PhoneCallRequested, ok bool) { return v, true } +// SortByID sorts slice of PhoneCallRequested by ID. +func (s PhoneCallRequestedArray) SortByID() PhoneCallRequestedArray { + return s.Sort(func(a, b PhoneCallRequested) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of PhoneCallRequested by ID. +func (s PhoneCallRequestedArray) SortStableByID() PhoneCallRequestedArray { + return s.SortStable(func(a, b PhoneCallRequested) bool { + return a.GetID() < b.GetID() + }) +} + // SortByDate sorts slice of PhoneCallRequested by Date. func (s PhoneCallRequestedArray) SortByDate() PhoneCallRequestedArray { return s.Sort(func(a, b PhoneCallRequested) bool { @@ -521,6 +731,20 @@ func (s PhoneCallRequestedArray) SortStableByDate() PhoneCallRequestedArray { }) } +// FillMap fills constructors to given map. +func (s PhoneCallRequestedArray) FillMap(to map[int64]PhoneCallRequested) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s PhoneCallRequestedArray) ToMap() map[int64]PhoneCallRequested { + r := make(map[int64]PhoneCallRequested, len(s)) + s.FillMap(r) + return r +} + // PhoneCallAcceptedArray is adapter for slice of PhoneCallAccepted. type PhoneCallAcceptedArray []PhoneCallAccepted @@ -603,6 +827,20 @@ func (s *PhoneCallAcceptedArray) Pop() (v PhoneCallAccepted, ok bool) { return v, true } +// SortByID sorts slice of PhoneCallAccepted by ID. +func (s PhoneCallAcceptedArray) SortByID() PhoneCallAcceptedArray { + return s.Sort(func(a, b PhoneCallAccepted) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of PhoneCallAccepted by ID. +func (s PhoneCallAcceptedArray) SortStableByID() PhoneCallAcceptedArray { + return s.SortStable(func(a, b PhoneCallAccepted) bool { + return a.GetID() < b.GetID() + }) +} + // SortByDate sorts slice of PhoneCallAccepted by Date. func (s PhoneCallAcceptedArray) SortByDate() PhoneCallAcceptedArray { return s.Sort(func(a, b PhoneCallAccepted) bool { @@ -617,6 +855,20 @@ func (s PhoneCallAcceptedArray) SortStableByDate() PhoneCallAcceptedArray { }) } +// FillMap fills constructors to given map. +func (s PhoneCallAcceptedArray) FillMap(to map[int64]PhoneCallAccepted) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s PhoneCallAcceptedArray) ToMap() map[int64]PhoneCallAccepted { + r := make(map[int64]PhoneCallAccepted, len(s)) + s.FillMap(r) + return r +} + // PhoneCallArray is adapter for slice of PhoneCall. type PhoneCallArray []PhoneCall @@ -699,6 +951,20 @@ func (s *PhoneCallArray) Pop() (v PhoneCall, ok bool) { return v, true } +// SortByID sorts slice of PhoneCall by ID. +func (s PhoneCallArray) SortByID() PhoneCallArray { + return s.Sort(func(a, b PhoneCall) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of PhoneCall by ID. +func (s PhoneCallArray) SortStableByID() PhoneCallArray { + return s.SortStable(func(a, b PhoneCall) bool { + return a.GetID() < b.GetID() + }) +} + // SortByDate sorts slice of PhoneCall by Date. func (s PhoneCallArray) SortByDate() PhoneCallArray { return s.Sort(func(a, b PhoneCall) bool { @@ -713,6 +979,20 @@ func (s PhoneCallArray) SortStableByDate() PhoneCallArray { }) } +// FillMap fills constructors to given map. +func (s PhoneCallArray) FillMap(to map[int64]PhoneCall) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s PhoneCallArray) ToMap() map[int64]PhoneCall { + r := make(map[int64]PhoneCall, len(s)) + s.FillMap(r) + return r +} + // PhoneCallDiscardedArray is adapter for slice of PhoneCallDiscarded. type PhoneCallDiscardedArray []PhoneCallDiscarded @@ -794,3 +1074,31 @@ func (s *PhoneCallDiscardedArray) Pop() (v PhoneCallDiscarded, ok bool) { return v, true } + +// SortByID sorts slice of PhoneCallDiscarded by ID. +func (s PhoneCallDiscardedArray) SortByID() PhoneCallDiscardedArray { + return s.Sort(func(a, b PhoneCallDiscarded) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of PhoneCallDiscarded by ID. +func (s PhoneCallDiscardedArray) SortStableByID() PhoneCallDiscardedArray { + return s.SortStable(func(a, b PhoneCallDiscarded) bool { + return a.GetID() < b.GetID() + }) +} + +// FillMap fills constructors to given map. +func (s PhoneCallDiscardedArray) FillMap(to map[int64]PhoneCallDiscarded) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s PhoneCallDiscardedArray) ToMap() map[int64]PhoneCallDiscarded { + r := make(map[int64]PhoneCallDiscarded, len(s)) + s.FillMap(r) + return r +} diff --git a/tg/tl_phone_connection_slices_gen.go b/tg/tl_phone_connection_slices_gen.go index b7a3cf13e8..9a532c9a2c 100644 --- a/tg/tl_phone_connection_slices_gen.go +++ b/tg/tl_phone_connection_slices_gen.go @@ -114,6 +114,38 @@ func (s *PhoneConnectionClassArray) Pop() (v PhoneConnectionClass, ok bool) { return v, true } +// SortByID sorts slice of PhoneConnectionClass by ID. +func (s PhoneConnectionClassArray) SortByID() PhoneConnectionClassArray { + return s.Sort(func(a, b PhoneConnectionClass) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of PhoneConnectionClass by ID. +func (s PhoneConnectionClassArray) SortStableByID() PhoneConnectionClassArray { + return s.SortStable(func(a, b PhoneConnectionClass) bool { + return a.GetID() < b.GetID() + }) +} + +// FillPhoneConnectionMap fills only PhoneConnection constructors to given map. +func (s PhoneConnectionClassArray) FillPhoneConnectionMap(to map[int64]*PhoneConnection) { + for _, elem := range s { + value, ok := elem.(*PhoneConnection) + if !ok { + continue + } + to[value.GetID()] = value + } +} + +// PhoneConnectionToMap collects only PhoneConnection constructors to map. +func (s PhoneConnectionClassArray) PhoneConnectionToMap() map[int64]*PhoneConnection { + r := make(map[int64]*PhoneConnection, len(s)) + s.FillPhoneConnectionMap(r) + return r +} + // AsPhoneConnection returns copy with only PhoneConnection constructors. func (s PhoneConnectionClassArray) AsPhoneConnection() (to PhoneConnectionArray) { for _, elem := range s { @@ -127,6 +159,24 @@ func (s PhoneConnectionClassArray) AsPhoneConnection() (to PhoneConnectionArray) return to } +// FillPhoneConnectionWebrtcMap fills only PhoneConnectionWebrtc constructors to given map. +func (s PhoneConnectionClassArray) FillPhoneConnectionWebrtcMap(to map[int64]*PhoneConnectionWebrtc) { + for _, elem := range s { + value, ok := elem.(*PhoneConnectionWebrtc) + if !ok { + continue + } + to[value.GetID()] = value + } +} + +// PhoneConnectionWebrtcToMap collects only PhoneConnectionWebrtc constructors to map. +func (s PhoneConnectionClassArray) PhoneConnectionWebrtcToMap() map[int64]*PhoneConnectionWebrtc { + r := make(map[int64]*PhoneConnectionWebrtc, len(s)) + s.FillPhoneConnectionWebrtcMap(r) + return r +} + // AsPhoneConnectionWebrtc returns copy with only PhoneConnectionWebrtc constructors. func (s PhoneConnectionClassArray) AsPhoneConnectionWebrtc() (to PhoneConnectionWebrtcArray) { for _, elem := range s { @@ -222,6 +272,34 @@ func (s *PhoneConnectionArray) Pop() (v PhoneConnection, ok bool) { return v, true } +// SortByID sorts slice of PhoneConnection by ID. +func (s PhoneConnectionArray) SortByID() PhoneConnectionArray { + return s.Sort(func(a, b PhoneConnection) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of PhoneConnection by ID. +func (s PhoneConnectionArray) SortStableByID() PhoneConnectionArray { + return s.SortStable(func(a, b PhoneConnection) bool { + return a.GetID() < b.GetID() + }) +} + +// FillMap fills constructors to given map. +func (s PhoneConnectionArray) FillMap(to map[int64]PhoneConnection) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s PhoneConnectionArray) ToMap() map[int64]PhoneConnection { + r := make(map[int64]PhoneConnection, len(s)) + s.FillMap(r) + return r +} + // PhoneConnectionWebrtcArray is adapter for slice of PhoneConnectionWebrtc. type PhoneConnectionWebrtcArray []PhoneConnectionWebrtc @@ -303,3 +381,31 @@ func (s *PhoneConnectionWebrtcArray) Pop() (v PhoneConnectionWebrtc, ok bool) { return v, true } + +// SortByID sorts slice of PhoneConnectionWebrtc by ID. +func (s PhoneConnectionWebrtcArray) SortByID() PhoneConnectionWebrtcArray { + return s.Sort(func(a, b PhoneConnectionWebrtc) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of PhoneConnectionWebrtc by ID. +func (s PhoneConnectionWebrtcArray) SortStableByID() PhoneConnectionWebrtcArray { + return s.SortStable(func(a, b PhoneConnectionWebrtc) bool { + return a.GetID() < b.GetID() + }) +} + +// FillMap fills constructors to given map. +func (s PhoneConnectionWebrtcArray) FillMap(to map[int64]PhoneConnectionWebrtc) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s PhoneConnectionWebrtcArray) ToMap() map[int64]PhoneConnectionWebrtc { + r := make(map[int64]PhoneConnectionWebrtc, len(s)) + s.FillMap(r) + return r +} diff --git a/tg/tl_photo_slices_gen.go b/tg/tl_photo_slices_gen.go index 050c26eb75..f375821542 100644 --- a/tg/tl_photo_slices_gen.go +++ b/tg/tl_photo_slices_gen.go @@ -114,6 +114,38 @@ func (s *PhotoClassArray) Pop() (v PhotoClass, ok bool) { return v, true } +// SortByID sorts slice of PhotoClass by ID. +func (s PhotoClassArray) SortByID() PhotoClassArray { + return s.Sort(func(a, b PhotoClass) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of PhotoClass by ID. +func (s PhotoClassArray) SortStableByID() PhotoClassArray { + return s.SortStable(func(a, b PhotoClass) bool { + return a.GetID() < b.GetID() + }) +} + +// FillPhotoEmptyMap fills only PhotoEmpty constructors to given map. +func (s PhotoClassArray) FillPhotoEmptyMap(to map[int64]*PhotoEmpty) { + for _, elem := range s { + value, ok := elem.(*PhotoEmpty) + if !ok { + continue + } + to[value.GetID()] = value + } +} + +// PhotoEmptyToMap collects only PhotoEmpty constructors to map. +func (s PhotoClassArray) PhotoEmptyToMap() map[int64]*PhotoEmpty { + r := make(map[int64]*PhotoEmpty, len(s)) + s.FillPhotoEmptyMap(r) + return r +} + // AsPhotoEmpty returns copy with only PhotoEmpty constructors. func (s PhotoClassArray) AsPhotoEmpty() (to PhotoEmptyArray) { for _, elem := range s { @@ -127,6 +159,24 @@ func (s PhotoClassArray) AsPhotoEmpty() (to PhotoEmptyArray) { return to } +// FillPhotoMap fills only Photo constructors to given map. +func (s PhotoClassArray) FillPhotoMap(to map[int64]*Photo) { + for _, elem := range s { + value, ok := elem.(*Photo) + if !ok { + continue + } + to[value.GetID()] = value + } +} + +// PhotoToMap collects only Photo constructors to map. +func (s PhotoClassArray) PhotoToMap() map[int64]*Photo { + r := make(map[int64]*Photo, len(s)) + s.FillPhotoMap(r) + return r +} + // AsPhoto returns copy with only Photo constructors. func (s PhotoClassArray) AsPhoto() (to PhotoArray) { for _, elem := range s { @@ -140,6 +190,24 @@ func (s PhotoClassArray) AsPhoto() (to PhotoArray) { return to } +// FillNotEmptyMap fills only NotEmpty constructors to given map. +func (s PhotoClassArray) FillNotEmptyMap(to map[int64]*Photo) { + for _, elem := range s { + value, ok := elem.AsNotEmpty() + if !ok { + continue + } + to[value.GetID()] = value + } +} + +// NotEmptyToMap collects only NotEmpty constructors to map. +func (s PhotoClassArray) NotEmptyToMap() map[int64]*Photo { + r := make(map[int64]*Photo, len(s)) + s.FillNotEmptyMap(r) + return r +} + // AppendOnlyNotEmpty appends only NotEmpty constructors to // given slice. func (s PhotoClassArray) AppendOnlyNotEmpty(to []*Photo) []*Photo { @@ -277,6 +345,34 @@ func (s *PhotoEmptyArray) Pop() (v PhotoEmpty, ok bool) { return v, true } +// SortByID sorts slice of PhotoEmpty by ID. +func (s PhotoEmptyArray) SortByID() PhotoEmptyArray { + return s.Sort(func(a, b PhotoEmpty) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of PhotoEmpty by ID. +func (s PhotoEmptyArray) SortStableByID() PhotoEmptyArray { + return s.SortStable(func(a, b PhotoEmpty) bool { + return a.GetID() < b.GetID() + }) +} + +// FillMap fills constructors to given map. +func (s PhotoEmptyArray) FillMap(to map[int64]PhotoEmpty) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s PhotoEmptyArray) ToMap() map[int64]PhotoEmpty { + r := make(map[int64]PhotoEmpty, len(s)) + s.FillMap(r) + return r +} + // PhotoArray is adapter for slice of Photo. type PhotoArray []Photo @@ -359,6 +455,20 @@ func (s *PhotoArray) Pop() (v Photo, ok bool) { return v, true } +// SortByID sorts slice of Photo by ID. +func (s PhotoArray) SortByID() PhotoArray { + return s.Sort(func(a, b Photo) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of Photo by ID. +func (s PhotoArray) SortStableByID() PhotoArray { + return s.SortStable(func(a, b Photo) bool { + return a.GetID() < b.GetID() + }) +} + // SortByDate sorts slice of Photo by Date. func (s PhotoArray) SortByDate() PhotoArray { return s.Sort(func(a, b Photo) bool { @@ -372,3 +482,17 @@ func (s PhotoArray) SortStableByDate() PhotoArray { return a.GetDate() < b.GetDate() }) } + +// FillMap fills constructors to given map. +func (s PhotoArray) FillMap(to map[int64]Photo) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s PhotoArray) ToMap() map[int64]Photo { + r := make(map[int64]Photo, len(s)) + s.FillMap(r) + return r +} diff --git a/tg/tl_poll_results_gen.go b/tg/tl_poll_results_gen.go index 080266e13a..4c78e16547 100644 --- a/tg/tl_poll_results_gen.go +++ b/tg/tl_poll_results_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// PollResults represents TL type `pollResults#badcc1a3`. +// PollResults represents TL type `pollResults#dcb82ea3`. // Results of poll // // See https://core.telegram.org/constructor/pollResults for reference. @@ -58,7 +58,7 @@ type PollResults struct { // IDs of the last users that recently voted in the poll // // Use SetRecentVoters and GetRecentVoters helpers. - RecentVoters []int + RecentVoters []int64 // Explanation of quiz solution // // Use SetSolution and GetSolution helpers. @@ -73,7 +73,7 @@ type PollResults struct { } // PollResultsTypeID is TL type id of PollResults. -const PollResultsTypeID = 0xbadcc1a3 +const PollResultsTypeID = 0xdcb82ea3 // Ensuring interfaces in compile-time for PollResults. var ( @@ -126,7 +126,7 @@ func (p *PollResults) FillFrom(from interface { GetMin() (value bool) GetResults() (value []PollAnswerVoters, ok bool) GetTotalVoters() (value int, ok bool) - GetRecentVoters() (value []int, ok bool) + GetRecentVoters() (value []int64, ok bool) GetSolution() (value string, ok bool) GetSolutionEntities() (value []MessageEntityClass, ok bool) }) { @@ -213,7 +213,7 @@ func (p *PollResults) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (p *PollResults) Encode(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't encode pollResults#badcc1a3 as nil") + return fmt.Errorf("can't encode pollResults#dcb82ea3 as nil") } b.PutID(PollResultsTypeID) return p.EncodeBare(b) @@ -222,7 +222,7 @@ func (p *PollResults) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (p *PollResults) EncodeBare(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't encode pollResults#badcc1a3 as nil") + return fmt.Errorf("can't encode pollResults#dcb82ea3 as nil") } if !(p.Min == false) { p.Flags.Set(0) @@ -243,13 +243,13 @@ func (p *PollResults) EncodeBare(b *bin.Buffer) error { p.Flags.Set(4) } if err := p.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode pollResults#badcc1a3: field flags: %w", err) + return fmt.Errorf("unable to encode pollResults#dcb82ea3: field flags: %w", err) } if p.Flags.Has(1) { b.PutVectorHeader(len(p.Results)) for idx, v := range p.Results { if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode pollResults#badcc1a3: field results element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode pollResults#dcb82ea3: field results element with index %d: %w", idx, err) } } } @@ -259,7 +259,7 @@ func (p *PollResults) EncodeBare(b *bin.Buffer) error { if p.Flags.Has(3) { b.PutVectorHeader(len(p.RecentVoters)) for _, v := range p.RecentVoters { - b.PutInt(v) + b.PutLong(v) } } if p.Flags.Has(4) { @@ -269,10 +269,10 @@ func (p *PollResults) EncodeBare(b *bin.Buffer) error { b.PutVectorHeader(len(p.SolutionEntities)) for idx, v := range p.SolutionEntities { if v == nil { - return fmt.Errorf("unable to encode pollResults#badcc1a3: field solution_entities element with index %d is nil", idx) + return fmt.Errorf("unable to encode pollResults#dcb82ea3: field solution_entities element with index %d is nil", idx) } if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode pollResults#badcc1a3: field solution_entities element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode pollResults#dcb82ea3: field solution_entities element with index %d: %w", idx, err) } } } @@ -282,10 +282,10 @@ func (p *PollResults) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (p *PollResults) Decode(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't decode pollResults#badcc1a3 to nil") + return fmt.Errorf("can't decode pollResults#dcb82ea3 to nil") } if err := b.ConsumeID(PollResultsTypeID); err != nil { - return fmt.Errorf("unable to decode pollResults#badcc1a3: %w", err) + return fmt.Errorf("unable to decode pollResults#dcb82ea3: %w", err) } return p.DecodeBare(b) } @@ -293,18 +293,18 @@ func (p *PollResults) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (p *PollResults) DecodeBare(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't decode pollResults#badcc1a3 to nil") + return fmt.Errorf("can't decode pollResults#dcb82ea3 to nil") } { if err := p.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode pollResults#badcc1a3: field flags: %w", err) + return fmt.Errorf("unable to decode pollResults#dcb82ea3: field flags: %w", err) } } p.Min = p.Flags.Has(0) if p.Flags.Has(1) { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode pollResults#badcc1a3: field results: %w", err) + return fmt.Errorf("unable to decode pollResults#dcb82ea3: field results: %w", err) } if headerLen > 0 { @@ -313,7 +313,7 @@ func (p *PollResults) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { var value PollAnswerVoters if err := value.Decode(b); err != nil { - return fmt.Errorf("unable to decode pollResults#badcc1a3: field results: %w", err) + return fmt.Errorf("unable to decode pollResults#dcb82ea3: field results: %w", err) } p.Results = append(p.Results, value) } @@ -321,23 +321,23 @@ func (p *PollResults) DecodeBare(b *bin.Buffer) error { if p.Flags.Has(2) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode pollResults#badcc1a3: field total_voters: %w", err) + return fmt.Errorf("unable to decode pollResults#dcb82ea3: field total_voters: %w", err) } p.TotalVoters = value } if p.Flags.Has(3) { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode pollResults#badcc1a3: field recent_voters: %w", err) + return fmt.Errorf("unable to decode pollResults#dcb82ea3: field recent_voters: %w", err) } if headerLen > 0 { - p.RecentVoters = make([]int, 0, headerLen%bin.PreallocateLimit) + p.RecentVoters = make([]int64, 0, headerLen%bin.PreallocateLimit) } for idx := 0; idx < headerLen; idx++ { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode pollResults#badcc1a3: field recent_voters: %w", err) + return fmt.Errorf("unable to decode pollResults#dcb82ea3: field recent_voters: %w", err) } p.RecentVoters = append(p.RecentVoters, value) } @@ -345,14 +345,14 @@ func (p *PollResults) DecodeBare(b *bin.Buffer) error { if p.Flags.Has(4) { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode pollResults#badcc1a3: field solution: %w", err) + return fmt.Errorf("unable to decode pollResults#dcb82ea3: field solution: %w", err) } p.Solution = value } if p.Flags.Has(4) { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode pollResults#badcc1a3: field solution_entities: %w", err) + return fmt.Errorf("unable to decode pollResults#dcb82ea3: field solution_entities: %w", err) } if headerLen > 0 { @@ -361,7 +361,7 @@ func (p *PollResults) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := DecodeMessageEntity(b) if err != nil { - return fmt.Errorf("unable to decode pollResults#badcc1a3: field solution_entities: %w", err) + return fmt.Errorf("unable to decode pollResults#dcb82ea3: field solution_entities: %w", err) } p.SolutionEntities = append(p.SolutionEntities, value) } @@ -416,14 +416,14 @@ func (p *PollResults) GetTotalVoters() (value int, ok bool) { } // SetRecentVoters sets value of RecentVoters conditional field. -func (p *PollResults) SetRecentVoters(value []int) { +func (p *PollResults) SetRecentVoters(value []int64) { p.Flags.Set(3) p.RecentVoters = value } // GetRecentVoters returns value of RecentVoters conditional field and // boolean which is true if field was set. -func (p *PollResults) GetRecentVoters() (value []int, ok bool) { +func (p *PollResults) GetRecentVoters() (value []int64, ok bool) { if !p.Flags.Has(3) { return value, false } diff --git a/tg/tl_privacy_rule_gen.go b/tg/tl_privacy_rule_gen.go index dd0c0820f9..f7181c2633 100644 --- a/tg/tl_privacy_rule_gen.go +++ b/tg/tl_privacy_rule_gen.go @@ -233,17 +233,17 @@ func (p *PrivacyValueAllowAll) DecodeBare(b *bin.Buffer) error { return nil } -// PrivacyValueAllowUsers represents TL type `privacyValueAllowUsers#4d5bbe0c`. +// PrivacyValueAllowUsers represents TL type `privacyValueAllowUsers#b8905fb2`. // Allow only certain users // // See https://core.telegram.org/constructor/privacyValueAllowUsers for reference. type PrivacyValueAllowUsers struct { // Allowed users - Users []int + Users []int64 } // PrivacyValueAllowUsersTypeID is TL type id of PrivacyValueAllowUsers. -const PrivacyValueAllowUsersTypeID = 0x4d5bbe0c +const PrivacyValueAllowUsersTypeID = 0xb8905fb2 // construct implements constructor of PrivacyRuleClass. func (p PrivacyValueAllowUsers) construct() PrivacyRuleClass { return &p } @@ -280,7 +280,7 @@ func (p *PrivacyValueAllowUsers) String() string { // FillFrom fills PrivacyValueAllowUsers from given interface. func (p *PrivacyValueAllowUsers) FillFrom(from interface { - GetUsers() (value []int) + GetUsers() (value []int64) }) { p.Users = from.GetUsers() } @@ -319,7 +319,7 @@ func (p *PrivacyValueAllowUsers) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (p *PrivacyValueAllowUsers) Encode(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't encode privacyValueAllowUsers#4d5bbe0c as nil") + return fmt.Errorf("can't encode privacyValueAllowUsers#b8905fb2 as nil") } b.PutID(PrivacyValueAllowUsersTypeID) return p.EncodeBare(b) @@ -328,11 +328,11 @@ func (p *PrivacyValueAllowUsers) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (p *PrivacyValueAllowUsers) EncodeBare(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't encode privacyValueAllowUsers#4d5bbe0c as nil") + return fmt.Errorf("can't encode privacyValueAllowUsers#b8905fb2 as nil") } b.PutVectorHeader(len(p.Users)) for _, v := range p.Users { - b.PutInt(v) + b.PutLong(v) } return nil } @@ -340,10 +340,10 @@ func (p *PrivacyValueAllowUsers) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (p *PrivacyValueAllowUsers) Decode(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't decode privacyValueAllowUsers#4d5bbe0c to nil") + return fmt.Errorf("can't decode privacyValueAllowUsers#b8905fb2 to nil") } if err := b.ConsumeID(PrivacyValueAllowUsersTypeID); err != nil { - return fmt.Errorf("unable to decode privacyValueAllowUsers#4d5bbe0c: %w", err) + return fmt.Errorf("unable to decode privacyValueAllowUsers#b8905fb2: %w", err) } return p.DecodeBare(b) } @@ -351,21 +351,21 @@ func (p *PrivacyValueAllowUsers) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (p *PrivacyValueAllowUsers) DecodeBare(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't decode privacyValueAllowUsers#4d5bbe0c to nil") + return fmt.Errorf("can't decode privacyValueAllowUsers#b8905fb2 to nil") } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode privacyValueAllowUsers#4d5bbe0c: field users: %w", err) + return fmt.Errorf("unable to decode privacyValueAllowUsers#b8905fb2: field users: %w", err) } if headerLen > 0 { - p.Users = make([]int, 0, headerLen%bin.PreallocateLimit) + p.Users = make([]int64, 0, headerLen%bin.PreallocateLimit) } for idx := 0; idx < headerLen; idx++ { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode privacyValueAllowUsers#4d5bbe0c: field users: %w", err) + return fmt.Errorf("unable to decode privacyValueAllowUsers#b8905fb2: field users: %w", err) } p.Users = append(p.Users, value) } @@ -374,7 +374,7 @@ func (p *PrivacyValueAllowUsers) DecodeBare(b *bin.Buffer) error { } // GetUsers returns value of Users field. -func (p *PrivacyValueAllowUsers) GetUsers() (value []int) { +func (p *PrivacyValueAllowUsers) GetUsers() (value []int64) { return p.Users } @@ -582,17 +582,17 @@ func (p *PrivacyValueDisallowAll) DecodeBare(b *bin.Buffer) error { return nil } -// PrivacyValueDisallowUsers represents TL type `privacyValueDisallowUsers#c7f49b7`. +// PrivacyValueDisallowUsers represents TL type `privacyValueDisallowUsers#e4621141`. // Disallow only certain users // // See https://core.telegram.org/constructor/privacyValueDisallowUsers for reference. type PrivacyValueDisallowUsers struct { // Disallowed users - Users []int + Users []int64 } // PrivacyValueDisallowUsersTypeID is TL type id of PrivacyValueDisallowUsers. -const PrivacyValueDisallowUsersTypeID = 0xc7f49b7 +const PrivacyValueDisallowUsersTypeID = 0xe4621141 // construct implements constructor of PrivacyRuleClass. func (p PrivacyValueDisallowUsers) construct() PrivacyRuleClass { return &p } @@ -629,7 +629,7 @@ func (p *PrivacyValueDisallowUsers) String() string { // FillFrom fills PrivacyValueDisallowUsers from given interface. func (p *PrivacyValueDisallowUsers) FillFrom(from interface { - GetUsers() (value []int) + GetUsers() (value []int64) }) { p.Users = from.GetUsers() } @@ -668,7 +668,7 @@ func (p *PrivacyValueDisallowUsers) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (p *PrivacyValueDisallowUsers) Encode(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't encode privacyValueDisallowUsers#c7f49b7 as nil") + return fmt.Errorf("can't encode privacyValueDisallowUsers#e4621141 as nil") } b.PutID(PrivacyValueDisallowUsersTypeID) return p.EncodeBare(b) @@ -677,11 +677,11 @@ func (p *PrivacyValueDisallowUsers) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (p *PrivacyValueDisallowUsers) EncodeBare(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't encode privacyValueDisallowUsers#c7f49b7 as nil") + return fmt.Errorf("can't encode privacyValueDisallowUsers#e4621141 as nil") } b.PutVectorHeader(len(p.Users)) for _, v := range p.Users { - b.PutInt(v) + b.PutLong(v) } return nil } @@ -689,10 +689,10 @@ func (p *PrivacyValueDisallowUsers) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (p *PrivacyValueDisallowUsers) Decode(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't decode privacyValueDisallowUsers#c7f49b7 to nil") + return fmt.Errorf("can't decode privacyValueDisallowUsers#e4621141 to nil") } if err := b.ConsumeID(PrivacyValueDisallowUsersTypeID); err != nil { - return fmt.Errorf("unable to decode privacyValueDisallowUsers#c7f49b7: %w", err) + return fmt.Errorf("unable to decode privacyValueDisallowUsers#e4621141: %w", err) } return p.DecodeBare(b) } @@ -700,21 +700,21 @@ func (p *PrivacyValueDisallowUsers) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (p *PrivacyValueDisallowUsers) DecodeBare(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't decode privacyValueDisallowUsers#c7f49b7 to nil") + return fmt.Errorf("can't decode privacyValueDisallowUsers#e4621141 to nil") } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode privacyValueDisallowUsers#c7f49b7: field users: %w", err) + return fmt.Errorf("unable to decode privacyValueDisallowUsers#e4621141: field users: %w", err) } if headerLen > 0 { - p.Users = make([]int, 0, headerLen%bin.PreallocateLimit) + p.Users = make([]int64, 0, headerLen%bin.PreallocateLimit) } for idx := 0; idx < headerLen; idx++ { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode privacyValueDisallowUsers#c7f49b7: field users: %w", err) + return fmt.Errorf("unable to decode privacyValueDisallowUsers#e4621141: field users: %w", err) } p.Users = append(p.Users, value) } @@ -723,21 +723,21 @@ func (p *PrivacyValueDisallowUsers) DecodeBare(b *bin.Buffer) error { } // GetUsers returns value of Users field. -func (p *PrivacyValueDisallowUsers) GetUsers() (value []int) { +func (p *PrivacyValueDisallowUsers) GetUsers() (value []int64) { return p.Users } -// PrivacyValueAllowChatParticipants represents TL type `privacyValueAllowChatParticipants#18be796b`. +// PrivacyValueAllowChatParticipants represents TL type `privacyValueAllowChatParticipants#6b134e8e`. // Allow all participants of certain chats // // See https://core.telegram.org/constructor/privacyValueAllowChatParticipants for reference. type PrivacyValueAllowChatParticipants struct { // Allowed chats - Chats []int + Chats []int64 } // PrivacyValueAllowChatParticipantsTypeID is TL type id of PrivacyValueAllowChatParticipants. -const PrivacyValueAllowChatParticipantsTypeID = 0x18be796b +const PrivacyValueAllowChatParticipantsTypeID = 0x6b134e8e // construct implements constructor of PrivacyRuleClass. func (p PrivacyValueAllowChatParticipants) construct() PrivacyRuleClass { return &p } @@ -774,7 +774,7 @@ func (p *PrivacyValueAllowChatParticipants) String() string { // FillFrom fills PrivacyValueAllowChatParticipants from given interface. func (p *PrivacyValueAllowChatParticipants) FillFrom(from interface { - GetChats() (value []int) + GetChats() (value []int64) }) { p.Chats = from.GetChats() } @@ -813,7 +813,7 @@ func (p *PrivacyValueAllowChatParticipants) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (p *PrivacyValueAllowChatParticipants) Encode(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't encode privacyValueAllowChatParticipants#18be796b as nil") + return fmt.Errorf("can't encode privacyValueAllowChatParticipants#6b134e8e as nil") } b.PutID(PrivacyValueAllowChatParticipantsTypeID) return p.EncodeBare(b) @@ -822,11 +822,11 @@ func (p *PrivacyValueAllowChatParticipants) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (p *PrivacyValueAllowChatParticipants) EncodeBare(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't encode privacyValueAllowChatParticipants#18be796b as nil") + return fmt.Errorf("can't encode privacyValueAllowChatParticipants#6b134e8e as nil") } b.PutVectorHeader(len(p.Chats)) for _, v := range p.Chats { - b.PutInt(v) + b.PutLong(v) } return nil } @@ -834,10 +834,10 @@ func (p *PrivacyValueAllowChatParticipants) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (p *PrivacyValueAllowChatParticipants) Decode(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't decode privacyValueAllowChatParticipants#18be796b to nil") + return fmt.Errorf("can't decode privacyValueAllowChatParticipants#6b134e8e to nil") } if err := b.ConsumeID(PrivacyValueAllowChatParticipantsTypeID); err != nil { - return fmt.Errorf("unable to decode privacyValueAllowChatParticipants#18be796b: %w", err) + return fmt.Errorf("unable to decode privacyValueAllowChatParticipants#6b134e8e: %w", err) } return p.DecodeBare(b) } @@ -845,21 +845,21 @@ func (p *PrivacyValueAllowChatParticipants) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (p *PrivacyValueAllowChatParticipants) DecodeBare(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't decode privacyValueAllowChatParticipants#18be796b to nil") + return fmt.Errorf("can't decode privacyValueAllowChatParticipants#6b134e8e to nil") } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode privacyValueAllowChatParticipants#18be796b: field chats: %w", err) + return fmt.Errorf("unable to decode privacyValueAllowChatParticipants#6b134e8e: field chats: %w", err) } if headerLen > 0 { - p.Chats = make([]int, 0, headerLen%bin.PreallocateLimit) + p.Chats = make([]int64, 0, headerLen%bin.PreallocateLimit) } for idx := 0; idx < headerLen; idx++ { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode privacyValueAllowChatParticipants#18be796b: field chats: %w", err) + return fmt.Errorf("unable to decode privacyValueAllowChatParticipants#6b134e8e: field chats: %w", err) } p.Chats = append(p.Chats, value) } @@ -868,21 +868,21 @@ func (p *PrivacyValueAllowChatParticipants) DecodeBare(b *bin.Buffer) error { } // GetChats returns value of Chats field. -func (p *PrivacyValueAllowChatParticipants) GetChats() (value []int) { +func (p *PrivacyValueAllowChatParticipants) GetChats() (value []int64) { return p.Chats } -// PrivacyValueDisallowChatParticipants represents TL type `privacyValueDisallowChatParticipants#acae0690`. +// PrivacyValueDisallowChatParticipants represents TL type `privacyValueDisallowChatParticipants#41c87565`. // Disallow only participants of certain chats // // See https://core.telegram.org/constructor/privacyValueDisallowChatParticipants for reference. type PrivacyValueDisallowChatParticipants struct { // Disallowed chats - Chats []int + Chats []int64 } // PrivacyValueDisallowChatParticipantsTypeID is TL type id of PrivacyValueDisallowChatParticipants. -const PrivacyValueDisallowChatParticipantsTypeID = 0xacae0690 +const PrivacyValueDisallowChatParticipantsTypeID = 0x41c87565 // construct implements constructor of PrivacyRuleClass. func (p PrivacyValueDisallowChatParticipants) construct() PrivacyRuleClass { return &p } @@ -919,7 +919,7 @@ func (p *PrivacyValueDisallowChatParticipants) String() string { // FillFrom fills PrivacyValueDisallowChatParticipants from given interface. func (p *PrivacyValueDisallowChatParticipants) FillFrom(from interface { - GetChats() (value []int) + GetChats() (value []int64) }) { p.Chats = from.GetChats() } @@ -958,7 +958,7 @@ func (p *PrivacyValueDisallowChatParticipants) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (p *PrivacyValueDisallowChatParticipants) Encode(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't encode privacyValueDisallowChatParticipants#acae0690 as nil") + return fmt.Errorf("can't encode privacyValueDisallowChatParticipants#41c87565 as nil") } b.PutID(PrivacyValueDisallowChatParticipantsTypeID) return p.EncodeBare(b) @@ -967,11 +967,11 @@ func (p *PrivacyValueDisallowChatParticipants) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (p *PrivacyValueDisallowChatParticipants) EncodeBare(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't encode privacyValueDisallowChatParticipants#acae0690 as nil") + return fmt.Errorf("can't encode privacyValueDisallowChatParticipants#41c87565 as nil") } b.PutVectorHeader(len(p.Chats)) for _, v := range p.Chats { - b.PutInt(v) + b.PutLong(v) } return nil } @@ -979,10 +979,10 @@ func (p *PrivacyValueDisallowChatParticipants) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (p *PrivacyValueDisallowChatParticipants) Decode(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't decode privacyValueDisallowChatParticipants#acae0690 to nil") + return fmt.Errorf("can't decode privacyValueDisallowChatParticipants#41c87565 to nil") } if err := b.ConsumeID(PrivacyValueDisallowChatParticipantsTypeID); err != nil { - return fmt.Errorf("unable to decode privacyValueDisallowChatParticipants#acae0690: %w", err) + return fmt.Errorf("unable to decode privacyValueDisallowChatParticipants#41c87565: %w", err) } return p.DecodeBare(b) } @@ -990,21 +990,21 @@ func (p *PrivacyValueDisallowChatParticipants) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (p *PrivacyValueDisallowChatParticipants) DecodeBare(b *bin.Buffer) error { if p == nil { - return fmt.Errorf("can't decode privacyValueDisallowChatParticipants#acae0690 to nil") + return fmt.Errorf("can't decode privacyValueDisallowChatParticipants#41c87565 to nil") } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode privacyValueDisallowChatParticipants#acae0690: field chats: %w", err) + return fmt.Errorf("unable to decode privacyValueDisallowChatParticipants#41c87565: field chats: %w", err) } if headerLen > 0 { - p.Chats = make([]int, 0, headerLen%bin.PreallocateLimit) + p.Chats = make([]int64, 0, headerLen%bin.PreallocateLimit) } for idx := 0; idx < headerLen; idx++ { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode privacyValueDisallowChatParticipants#acae0690: field chats: %w", err) + return fmt.Errorf("unable to decode privacyValueDisallowChatParticipants#41c87565: field chats: %w", err) } p.Chats = append(p.Chats, value) } @@ -1013,7 +1013,7 @@ func (p *PrivacyValueDisallowChatParticipants) DecodeBare(b *bin.Buffer) error { } // GetChats returns value of Chats field. -func (p *PrivacyValueDisallowChatParticipants) GetChats() (value []int) { +func (p *PrivacyValueDisallowChatParticipants) GetChats() (value []int64) { return p.Chats } @@ -1029,12 +1029,12 @@ func (p *PrivacyValueDisallowChatParticipants) GetChats() (value []int) { // switch v := g.(type) { // case *tg.PrivacyValueAllowContacts: // privacyValueAllowContacts#fffe1bac // case *tg.PrivacyValueAllowAll: // privacyValueAllowAll#65427b82 -// case *tg.PrivacyValueAllowUsers: // privacyValueAllowUsers#4d5bbe0c +// case *tg.PrivacyValueAllowUsers: // privacyValueAllowUsers#b8905fb2 // case *tg.PrivacyValueDisallowContacts: // privacyValueDisallowContacts#f888fa1a // case *tg.PrivacyValueDisallowAll: // privacyValueDisallowAll#8b73e763 -// case *tg.PrivacyValueDisallowUsers: // privacyValueDisallowUsers#c7f49b7 -// case *tg.PrivacyValueAllowChatParticipants: // privacyValueAllowChatParticipants#18be796b -// case *tg.PrivacyValueDisallowChatParticipants: // privacyValueDisallowChatParticipants#acae0690 +// case *tg.PrivacyValueDisallowUsers: // privacyValueDisallowUsers#e4621141 +// case *tg.PrivacyValueAllowChatParticipants: // privacyValueAllowChatParticipants#6b134e8e +// case *tg.PrivacyValueDisallowChatParticipants: // privacyValueDisallowChatParticipants#41c87565 // default: panic(v) // } type PrivacyRuleClass interface { @@ -1094,7 +1094,7 @@ func DecodePrivacyRule(buf *bin.Buffer) (PrivacyRuleClass, error) { } return &v, nil case PrivacyValueAllowUsersTypeID: - // Decoding privacyValueAllowUsers#4d5bbe0c. + // Decoding privacyValueAllowUsers#b8905fb2. v := PrivacyValueAllowUsers{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode PrivacyRuleClass: %w", err) @@ -1115,21 +1115,21 @@ func DecodePrivacyRule(buf *bin.Buffer) (PrivacyRuleClass, error) { } return &v, nil case PrivacyValueDisallowUsersTypeID: - // Decoding privacyValueDisallowUsers#c7f49b7. + // Decoding privacyValueDisallowUsers#e4621141. v := PrivacyValueDisallowUsers{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode PrivacyRuleClass: %w", err) } return &v, nil case PrivacyValueAllowChatParticipantsTypeID: - // Decoding privacyValueAllowChatParticipants#18be796b. + // Decoding privacyValueAllowChatParticipants#6b134e8e. v := PrivacyValueAllowChatParticipants{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode PrivacyRuleClass: %w", err) } return &v, nil case PrivacyValueDisallowChatParticipantsTypeID: - // Decoding privacyValueDisallowChatParticipants#acae0690. + // Decoding privacyValueDisallowChatParticipants#41c87565. v := PrivacyValueDisallowChatParticipants{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode PrivacyRuleClass: %w", err) diff --git a/tg/tl_recent_me_url_gen.go b/tg/tl_recent_me_url_gen.go index cd9044c298..5287272921 100644 --- a/tg/tl_recent_me_url_gen.go +++ b/tg/tl_recent_me_url_gen.go @@ -161,7 +161,7 @@ func (r *RecentMeURLUnknown) GetURL() (value string) { return r.URL } -// RecentMeURLUser represents TL type `recentMeUrlUser#8dbc3336`. +// RecentMeURLUser represents TL type `recentMeUrlUser#b92c09e2`. // Recent t.me link to a user // // See https://core.telegram.org/constructor/recentMeUrlUser for reference. @@ -169,11 +169,11 @@ type RecentMeURLUser struct { // URL URL string // User ID - UserID int + UserID int64 } // RecentMeURLUserTypeID is TL type id of RecentMeURLUser. -const RecentMeURLUserTypeID = 0x8dbc3336 +const RecentMeURLUserTypeID = 0xb92c09e2 // construct implements constructor of RecentMeURLClass. func (r RecentMeURLUser) construct() RecentMeURLClass { return &r } @@ -214,7 +214,7 @@ func (r *RecentMeURLUser) String() string { // FillFrom fills RecentMeURLUser from given interface. func (r *RecentMeURLUser) FillFrom(from interface { GetURL() (value string) - GetUserID() (value int) + GetUserID() (value int64) }) { r.URL = from.GetURL() r.UserID = from.GetUserID() @@ -258,7 +258,7 @@ func (r *RecentMeURLUser) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (r *RecentMeURLUser) Encode(b *bin.Buffer) error { if r == nil { - return fmt.Errorf("can't encode recentMeUrlUser#8dbc3336 as nil") + return fmt.Errorf("can't encode recentMeUrlUser#b92c09e2 as nil") } b.PutID(RecentMeURLUserTypeID) return r.EncodeBare(b) @@ -267,20 +267,20 @@ func (r *RecentMeURLUser) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (r *RecentMeURLUser) EncodeBare(b *bin.Buffer) error { if r == nil { - return fmt.Errorf("can't encode recentMeUrlUser#8dbc3336 as nil") + return fmt.Errorf("can't encode recentMeUrlUser#b92c09e2 as nil") } b.PutString(r.URL) - b.PutInt(r.UserID) + b.PutLong(r.UserID) return nil } // Decode implements bin.Decoder. func (r *RecentMeURLUser) Decode(b *bin.Buffer) error { if r == nil { - return fmt.Errorf("can't decode recentMeUrlUser#8dbc3336 to nil") + return fmt.Errorf("can't decode recentMeUrlUser#b92c09e2 to nil") } if err := b.ConsumeID(RecentMeURLUserTypeID); err != nil { - return fmt.Errorf("unable to decode recentMeUrlUser#8dbc3336: %w", err) + return fmt.Errorf("unable to decode recentMeUrlUser#b92c09e2: %w", err) } return r.DecodeBare(b) } @@ -288,19 +288,19 @@ func (r *RecentMeURLUser) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (r *RecentMeURLUser) DecodeBare(b *bin.Buffer) error { if r == nil { - return fmt.Errorf("can't decode recentMeUrlUser#8dbc3336 to nil") + return fmt.Errorf("can't decode recentMeUrlUser#b92c09e2 to nil") } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode recentMeUrlUser#8dbc3336: field url: %w", err) + return fmt.Errorf("unable to decode recentMeUrlUser#b92c09e2: field url: %w", err) } r.URL = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode recentMeUrlUser#8dbc3336: field user_id: %w", err) + return fmt.Errorf("unable to decode recentMeUrlUser#b92c09e2: field user_id: %w", err) } r.UserID = value } @@ -313,11 +313,11 @@ func (r *RecentMeURLUser) GetURL() (value string) { } // GetUserID returns value of UserID field. -func (r *RecentMeURLUser) GetUserID() (value int) { +func (r *RecentMeURLUser) GetUserID() (value int64) { return r.UserID } -// RecentMeURLChat represents TL type `recentMeUrlChat#a01b22f9`. +// RecentMeURLChat represents TL type `recentMeUrlChat#b2da71d2`. // Recent t.me link to a chat // // See https://core.telegram.org/constructor/recentMeUrlChat for reference. @@ -325,11 +325,11 @@ type RecentMeURLChat struct { // t.me URL URL string // Chat ID - ChatID int + ChatID int64 } // RecentMeURLChatTypeID is TL type id of RecentMeURLChat. -const RecentMeURLChatTypeID = 0xa01b22f9 +const RecentMeURLChatTypeID = 0xb2da71d2 // construct implements constructor of RecentMeURLClass. func (r RecentMeURLChat) construct() RecentMeURLClass { return &r } @@ -370,7 +370,7 @@ func (r *RecentMeURLChat) String() string { // FillFrom fills RecentMeURLChat from given interface. func (r *RecentMeURLChat) FillFrom(from interface { GetURL() (value string) - GetChatID() (value int) + GetChatID() (value int64) }) { r.URL = from.GetURL() r.ChatID = from.GetChatID() @@ -414,7 +414,7 @@ func (r *RecentMeURLChat) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (r *RecentMeURLChat) Encode(b *bin.Buffer) error { if r == nil { - return fmt.Errorf("can't encode recentMeUrlChat#a01b22f9 as nil") + return fmt.Errorf("can't encode recentMeUrlChat#b2da71d2 as nil") } b.PutID(RecentMeURLChatTypeID) return r.EncodeBare(b) @@ -423,20 +423,20 @@ func (r *RecentMeURLChat) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (r *RecentMeURLChat) EncodeBare(b *bin.Buffer) error { if r == nil { - return fmt.Errorf("can't encode recentMeUrlChat#a01b22f9 as nil") + return fmt.Errorf("can't encode recentMeUrlChat#b2da71d2 as nil") } b.PutString(r.URL) - b.PutInt(r.ChatID) + b.PutLong(r.ChatID) return nil } // Decode implements bin.Decoder. func (r *RecentMeURLChat) Decode(b *bin.Buffer) error { if r == nil { - return fmt.Errorf("can't decode recentMeUrlChat#a01b22f9 to nil") + return fmt.Errorf("can't decode recentMeUrlChat#b2da71d2 to nil") } if err := b.ConsumeID(RecentMeURLChatTypeID); err != nil { - return fmt.Errorf("unable to decode recentMeUrlChat#a01b22f9: %w", err) + return fmt.Errorf("unable to decode recentMeUrlChat#b2da71d2: %w", err) } return r.DecodeBare(b) } @@ -444,19 +444,19 @@ func (r *RecentMeURLChat) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (r *RecentMeURLChat) DecodeBare(b *bin.Buffer) error { if r == nil { - return fmt.Errorf("can't decode recentMeUrlChat#a01b22f9 to nil") + return fmt.Errorf("can't decode recentMeUrlChat#b2da71d2 to nil") } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode recentMeUrlChat#a01b22f9: field url: %w", err) + return fmt.Errorf("unable to decode recentMeUrlChat#b2da71d2: field url: %w", err) } r.URL = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode recentMeUrlChat#a01b22f9: field chat_id: %w", err) + return fmt.Errorf("unable to decode recentMeUrlChat#b2da71d2: field chat_id: %w", err) } r.ChatID = value } @@ -469,7 +469,7 @@ func (r *RecentMeURLChat) GetURL() (value string) { } // GetChatID returns value of ChatID field. -func (r *RecentMeURLChat) GetChatID() (value int) { +func (r *RecentMeURLChat) GetChatID() (value int64) { return r.ChatID } @@ -806,8 +806,8 @@ func (r *RecentMeURLStickerSet) GetSet() (value StickerSetCoveredClass) { // } // switch v := g.(type) { // case *tg.RecentMeURLUnknown: // recentMeUrlUnknown#46e1d13d -// case *tg.RecentMeURLUser: // recentMeUrlUser#8dbc3336 -// case *tg.RecentMeURLChat: // recentMeUrlChat#a01b22f9 +// case *tg.RecentMeURLUser: // recentMeUrlUser#b92c09e2 +// case *tg.RecentMeURLChat: // recentMeUrlChat#b2da71d2 // case *tg.RecentMeURLChatInvite: // recentMeUrlChatInvite#eb49081d // case *tg.RecentMeURLStickerSet: // recentMeUrlStickerSet#bc0a57dc // default: panic(v) @@ -849,14 +849,14 @@ func DecodeRecentMeURL(buf *bin.Buffer) (RecentMeURLClass, error) { } return &v, nil case RecentMeURLUserTypeID: - // Decoding recentMeUrlUser#8dbc3336. + // Decoding recentMeUrlUser#b92c09e2. v := RecentMeURLUser{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode RecentMeURLClass: %w", err) } return &v, nil case RecentMeURLChatTypeID: - // Decoding recentMeUrlChat#a01b22f9. + // Decoding recentMeUrlChat#b2da71d2. v := RecentMeURLChat{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode RecentMeURLClass: %w", err) diff --git a/tg/tl_registry_gen.go b/tg/tl_registry_gen.go index 671e4cd4bb..faac9ed984 100644 --- a/tg/tl_registry_gen.go +++ b/tg/tl_registry_gen.go @@ -30,7 +30,7 @@ var ( ) // Layer version of schema. -const Layer = 132 +const Layer = 133 // TypesMap returns mapping from type ids to TL type names. func TypesMap() map[uint32]string { @@ -54,15 +54,15 @@ func TypesMap() map[uint32]string { 0xf9b7b23d: "test.useConfigSimple#f9b7b23d", 0x7f3b18ea: "inputPeerEmpty#7f3b18ea", 0x7da07ec9: "inputPeerSelf#7da07ec9", - 0x179be863: "inputPeerChat#179be863", - 0x7b8e7de6: "inputPeerUser#7b8e7de6", - 0x20adaef8: "inputPeerChannel#20adaef8", - 0x17bae2e6: "inputPeerUserFromMessage#17bae2e6", - 0x9c95f7bb: "inputPeerChannelFromMessage#9c95f7bb", + 0x35a95cb9: "inputPeerChat#35a95cb9", + 0xdde8a54c: "inputPeerUser#dde8a54c", + 0x27bcbbfc: "inputPeerChannel#27bcbbfc", + 0xa87b0a1c: "inputPeerUserFromMessage#a87b0a1c", + 0xbd2a0840: "inputPeerChannelFromMessage#bd2a0840", 0xb98886cf: "inputUserEmpty#b98886cf", 0xf7c1b13f: "inputUserSelf#f7c1b13f", - 0xd8292816: "inputUser#d8292816", - 0x2d117597: "inputUserFromMessage#2d117597", + 0xf21158c6: "inputUser#f21158c6", + 0x1da448e2: "inputUserFromMessage#1da448e2", 0xf392b7f4: "inputPhoneContact#f392b7f4", 0xf52ff27f: "inputFile#f52ff27f", 0xfa4f0bb5: "inputFileBig#fa4f0bb5", @@ -98,9 +98,9 @@ func TypesMap() map[uint32]string { 0x37257e99: "inputPeerPhotoFileLocation#37257e99", 0x9d84f3db: "inputStickerSetThumb#9d84f3db", 0x598a92a: "inputGroupCallStream#598a92a", - 0x9db1bc6d: "peerUser#9db1bc6d", - 0xbad0e5bb: "peerChat#bad0e5bb", - 0xbddde532: "peerChannel#bddde532", + 0x59511722: "peerUser#59511722", + 0x36c6019a: "peerChat#36c6019a", + 0xa2a5371e: "peerChannel#a2a5371e", 0xaa963b05: "storage.fileUnknown#aa963b05", 0x40bc6f52: "storage.filePartial#40bc6f52", 0x7efe0e: "storage.fileJpeg#7efe0e", @@ -111,8 +111,8 @@ func TypesMap() map[uint32]string { 0x4b09ebbc: "storage.fileMov#4b09ebbc", 0xb3cea0e4: "storage.fileMp4#b3cea0e4", 0x1081464c: "storage.fileWebp#1081464c", - 0x200250ba: "userEmpty#200250ba", - 0x938458c1: "user#938458c1", + 0xd3bc4b7a: "userEmpty#d3bc4b7a", + 0x3ff6ecb0: "user#3ff6ecb0", 0x4f11bae1: "userProfilePhotoEmpty#4f11bae1", 0x82d1f706: "userProfilePhoto#82d1f706", 0x9d05049: "userStatusEmpty#9d05049", @@ -121,27 +121,27 @@ func TypesMap() map[uint32]string { 0xe26f42f1: "userStatusRecently#e26f42f1", 0x7bf09fc: "userStatusLastWeek#7bf09fc", 0x77ebc742: "userStatusLastMonth#77ebc742", - 0x9ba2d800: "chatEmpty#9ba2d800", - 0x3bda1bde: "chat#3bda1bde", - 0x7328bdb: "chatForbidden#7328bdb", - 0xd31a961e: "channel#d31a961e", - 0x289da732: "channelForbidden#289da732", - 0x49a0a5d9: "chatFull#49a0a5d9", - 0x2f532f3c: "channelFull#2f532f3c", - 0xc8d7493e: "chatParticipant#c8d7493e", - 0xda13538a: "chatParticipantCreator#da13538a", - 0xe2d6e436: "chatParticipantAdmin#e2d6e436", - 0xfc900c2b: "chatParticipantsForbidden#fc900c2b", - 0x3f460fed: "chatParticipants#3f460fed", + 0x29562865: "chatEmpty#29562865", + 0x41cbf256: "chat#41cbf256", + 0x6592a1a7: "chatForbidden#6592a1a7", + 0x8261ac61: "channel#8261ac61", + 0x17d493d5: "channelForbidden#17d493d5", + 0x4dbdc099: "chatFull#4dbdc099", + 0xe9b27a17: "channelFull#e9b27a17", + 0xc02d4007: "chatParticipant#c02d4007", + 0xe46bcee4: "chatParticipantCreator#e46bcee4", + 0xa0933f5b: "chatParticipantAdmin#a0933f5b", + 0x8763d3e1: "chatParticipantsForbidden#8763d3e1", + 0x3cbc93f8: "chatParticipants#3cbc93f8", 0x37c1011c: "chatPhotoEmpty#37c1011c", 0x1c6e1c11: "chatPhoto#1c6e1c11", 0x90a6ca84: "messageEmpty#90a6ca84", - 0xbce383d2: "message#bce383d2", + 0x85d6cbe2: "message#85d6cbe2", 0x2b085862: "messageService#2b085862", 0x3ded6320: "messageMediaEmpty#3ded6320", 0x695150d7: "messageMediaPhoto#695150d7", 0x56e0d474: "messageMediaGeo#56e0d474", - 0xcbf24940: "messageMediaContact#cbf24940", + 0x70322949: "messageMediaContact#70322949", 0x9f84f49e: "messageMediaUnsupported#9f84f49e", 0x9cb070d7: "messageMediaDocument#9cb070d7", 0xa32dd600: "messageMediaWebPage#a32dd600", @@ -152,16 +152,16 @@ func TypesMap() map[uint32]string { 0x4bd6e798: "messageMediaPoll#4bd6e798", 0x3f7ee58b: "messageMediaDice#3f7ee58b", 0xb6aef7b0: "messageActionEmpty#b6aef7b0", - 0xa6638b9a: "messageActionChatCreate#a6638b9a", + 0xbd47cbad: "messageActionChatCreate#bd47cbad", 0xb5a1ce5a: "messageActionChatEditTitle#b5a1ce5a", 0x7fcb13a8: "messageActionChatEditPhoto#7fcb13a8", 0x95e3fbef: "messageActionChatDeletePhoto#95e3fbef", - 0x488a7337: "messageActionChatAddUser#488a7337", - 0xb2ae9b0c: "messageActionChatDeleteUser#b2ae9b0c", - 0xf89cf5e8: "messageActionChatJoinedByLink#f89cf5e8", + 0x15cefd00: "messageActionChatAddUser#15cefd00", + 0xa43f30cc: "messageActionChatDeleteUser#a43f30cc", + 0x31224c3: "messageActionChatJoinedByLink#31224c3", 0x95d2ac92: "messageActionChannelCreate#95d2ac92", - 0x51bdb021: "messageActionChatMigrateTo#51bdb021", - 0xb055eaee: "messageActionChannelMigrateFrom#b055eaee", + 0xe1037f92: "messageActionChatMigrateTo#e1037f92", + 0xea3948e9: "messageActionChannelMigrateFrom#ea3948e9", 0x94bd38ed: "messageActionPinMessage#94bd38ed", 0x9fbab604: "messageActionHistoryClear#9fbab604", 0x92a72876: "messageActionGameScore#92a72876", @@ -176,7 +176,7 @@ func TypesMap() map[uint32]string { 0xf3f25f76: "messageActionContactSignUp#f3f25f76", 0x98e0d697: "messageActionGeoProximityReached#98e0d697", 0x7a0d7f42: "messageActionGroupCall#7a0d7f42", - 0x76b9f11a: "messageActionInviteToGroupCall#76b9f11a", + 0x502f92f7: "messageActionInviteToGroupCall#502f92f7", 0xaa1afbfd: "messageActionSetMessagesTTL#aa1afbfd", 0xb3a07661: "messageActionGroupCallScheduled#b3a07661", 0xaa786345: "messageActionSetChatTheme#aa786345", @@ -195,7 +195,7 @@ func TypesMap() map[uint32]string { 0x5e002502: "auth.sentCode#5e002502", 0xcd050916: "auth.authorization#cd050916", 0x44747e9a: "auth.authorizationSignUpRequired#44747e9a", - 0xdf969c2d: "auth.exportedAuthorization#df969c2d", + 0xb434e2b8: "auth.exportedAuthorization#b434e2b8", 0xb8bc5b0c: "inputNotifyPeer#b8bc5b0c", 0x193b4417: "inputNotifyUsers#193b4417", 0x4a95e84e: "inputNotifyChats#4a95e84e", @@ -214,9 +214,9 @@ func TypesMap() map[uint32]string { 0xdbd4feed: "inputReportReasonGeoIrrelevant#dbd4feed", 0xf5ddd6e7: "inputReportReasonFake#f5ddd6e7", 0xd697ff05: "userFull#d697ff05", - 0xf911c994: "contact#f911c994", - 0xd0028438: "importedContact#d0028438", - 0xd3680c61: "contactStatus#d3680c61", + 0x145ade0b: "contact#145ade0b", + 0xc13e3c50: "importedContact#c13e3c50", + 0x16d9703b: "contactStatus#16d9703b", 0xb74ba9d2: "contacts.contactsNotModified#b74ba9d2", 0xeae87e42: "contacts.contacts#eae87e42", 0x77d01c3b: "contacts.importedContacts#77d01c3b", @@ -253,64 +253,64 @@ func TypesMap() map[uint32]string { 0x1f2b0afd: "updateNewMessage#1f2b0afd", 0x4e90bfd6: "updateMessageID#4e90bfd6", 0xa20db0e5: "updateDeleteMessages#a20db0e5", - 0x5c486927: "updateUserTyping#5c486927", - 0x86cadb6c: "updateChatUserTyping#86cadb6c", + 0xc01e857f: "updateUserTyping#c01e857f", + 0x83487af0: "updateChatUserTyping#83487af0", 0x7761198: "updateChatParticipants#7761198", - 0x1bfbd823: "updateUserStatus#1bfbd823", - 0xa7332b73: "updateUserName#a7332b73", - 0x95313b0c: "updateUserPhoto#95313b0c", + 0xe5bdf8de: "updateUserStatus#e5bdf8de", + 0xc3f202e0: "updateUserName#c3f202e0", + 0xf227868c: "updateUserPhoto#f227868c", 0x12bcbd9a: "updateNewEncryptedMessage#12bcbd9a", 0x1710f156: "updateEncryptedChatTyping#1710f156", 0xb4a2e88d: "updateEncryption#b4a2e88d", 0x38fe25b7: "updateEncryptedMessagesRead#38fe25b7", - 0xea4b0e5c: "updateChatParticipantAdd#ea4b0e5c", - 0x6e5f8c22: "updateChatParticipantDelete#6e5f8c22", + 0x3dda5451: "updateChatParticipantAdd#3dda5451", + 0xe32f3d77: "updateChatParticipantDelete#e32f3d77", 0x8e5e9873: "updateDcOptions#8e5e9873", 0xbec268ef: "updateNotifySettings#bec268ef", 0xebe46819: "updateServiceNotification#ebe46819", 0xee3b272a: "updatePrivacy#ee3b272a", - 0x12b9417b: "updateUserPhone#12b9417b", + 0x5492a13: "updateUserPhone#5492a13", 0x9c974fdf: "updateReadHistoryInbox#9c974fdf", 0x2f2f21bf: "updateReadHistoryOutbox#2f2f21bf", 0x7f891213: "updateWebPage#7f891213", 0x68c13933: "updateReadMessagesContents#68c13933", - 0xeb0467fb: "updateChannelTooLong#eb0467fb", - 0xb6d45656: "updateChannel#b6d45656", + 0x108d941f: "updateChannelTooLong#108d941f", + 0x635b4c09: "updateChannel#635b4c09", 0x62ba04d9: "updateNewChannelMessage#62ba04d9", - 0x330b5424: "updateReadChannelInbox#330b5424", - 0xc37521c9: "updateDeleteChannelMessages#c37521c9", - 0x98a12b4b: "updateChannelMessageViews#98a12b4b", - 0xb6901959: "updateChatParticipantAdmin#b6901959", + 0x922e6e10: "updateReadChannelInbox#922e6e10", + 0xc32d5b12: "updateDeleteChannelMessages#c32d5b12", + 0xf226ac08: "updateChannelMessageViews#f226ac08", + 0xd7ca61a2: "updateChatParticipantAdmin#d7ca61a2", 0x688a30aa: "updateNewStickerSet#688a30aa", 0xbb2d201: "updateStickerSetsOrder#bb2d201", 0x43ae3dec: "updateStickerSets#43ae3dec", 0x9375341e: "updateSavedGifs#9375341e", - 0x3f2038db: "updateBotInlineQuery#3f2038db", - 0xe48f964: "updateBotInlineSend#e48f964", + 0x496f379c: "updateBotInlineQuery#496f379c", + 0x12f12a07: "updateBotInlineSend#12f12a07", 0x1b3f4df7: "updateEditChannelMessage#1b3f4df7", - 0xe73547e1: "updateBotCallbackQuery#e73547e1", + 0xb9cfc48d: "updateBotCallbackQuery#b9cfc48d", 0xe40370a3: "updateEditMessage#e40370a3", - 0xf9d27a5a: "updateInlineBotCallbackQuery#f9d27a5a", - 0x25d6c9c7: "updateReadChannelOutbox#25d6c9c7", + 0x691e9052: "updateInlineBotCallbackQuery#691e9052", + 0xb75f99a9: "updateReadChannelOutbox#b75f99a9", 0xee2bb969: "updateDraftMessage#ee2bb969", 0x571d2742: "updateReadFeaturedStickers#571d2742", 0x9a422c20: "updateRecentStickers#9a422c20", 0xa229dd06: "updateConfig#a229dd06", 0x3354678f: "updatePtsChanged#3354678f", - 0x40771900: "updateChannelWebPage#40771900", + 0x2f2ba99f: "updateChannelWebPage#2f2ba99f", 0x6e6fe51c: "updateDialogPinned#6e6fe51c", 0xfa0f3ca2: "updatePinnedDialogs#fa0f3ca2", 0x8317c0c3: "updateBotWebhookJSON#8317c0c3", 0x9b9240a6: "updateBotWebhookJSONQuery#9b9240a6", - 0xe0cdc940: "updateBotShippingQuery#e0cdc940", - 0x5d2f3aa9: "updateBotPrecheckoutQuery#5d2f3aa9", + 0xb5aefd7d: "updateBotShippingQuery#b5aefd7d", + 0x8caa9a96: "updateBotPrecheckoutQuery#8caa9a96", 0xab0f6b1e: "updatePhoneCall#ab0f6b1e", 0x46560264: "updateLangPackTooLong#46560264", 0x56022f4d: "updateLangPack#56022f4d", 0xe511996d: "updateFavedStickers#e511996d", - 0x89893b45: "updateChannelReadMessagesContents#89893b45", + 0x44bdd535: "updateChannelReadMessagesContents#44bdd535", 0x7084a7be: "updateContactsReset#7084a7be", - 0x70db6837: "updateChannelAvailableMessages#70db6837", + 0xb23fc698: "updateChannelAvailableMessages#b23fc698", 0xe16459c3: "updateDialogUnreadMark#e16459c3", 0xaca1657b: "updateMessagePoll#aca1657b", 0x54c01850: "updateChatDefaultBannedRights#54c01850", @@ -322,35 +322,35 @@ func TypesMap() map[uint32]string { 0x8216fba3: "updateTheme#8216fba3", 0x871fb939: "updateGeoLiveViewed#871fb939", 0x564fe691: "updateLoginToken#564fe691", - 0x37f69f0b: "updateMessagePollVote#37f69f0b", + 0x106395c9: "updateMessagePollVote#106395c9", 0x26ffde7d: "updateDialogFilter#26ffde7d", 0xa5d72105: "updateDialogFilterOrder#a5d72105", 0x3504914f: "updateDialogFilters#3504914f", 0x2661bf09: "updatePhoneCallSignalingData#2661bf09", - 0x6e8a84df: "updateChannelMessageForwards#6e8a84df", - 0x1cc7de54: "updateReadChannelDiscussionInbox#1cc7de54", - 0x4638a26c: "updateReadChannelDiscussionOutbox#4638a26c", + 0xd29a27f4: "updateChannelMessageForwards#d29a27f4", + 0xd6b19546: "updateReadChannelDiscussionInbox#d6b19546", + 0x695c9e7c: "updateReadChannelDiscussionOutbox#695c9e7c", 0x246a4b22: "updatePeerBlocked#246a4b22", - 0x6b171718: "updateChannelUserTyping#6b171718", + 0x8c88c923: "updateChannelUserTyping#8c88c923", 0xed85eab5: "updatePinnedMessages#ed85eab5", - 0x8588878b: "updatePinnedChannelMessages#8588878b", - 0x1330a196: "updateChat#1330a196", + 0x5bb98608: "updatePinnedChannelMessages#5bb98608", + 0xf89a6a4e: "updateChat#f89a6a4e", 0xf2ebdb4e: "updateGroupCallParticipants#f2ebdb4e", - 0xa45eb99b: "updateGroupCall#a45eb99b", + 0x14b24500: "updateGroupCall#14b24500", 0xbb9bb9a5: "updatePeerHistoryTTL#bb9bb9a5", - 0xf3b3781f: "updateChatParticipant#f3b3781f", - 0x7fecb1ec: "updateChannelParticipant#7fecb1ec", - 0x7f9488a: "updateBotStopped#7f9488a", + 0xd087663a: "updateChatParticipant#d087663a", + 0x985d3abb: "updateChannelParticipant#985d3abb", + 0xc4870a49: "updateBotStopped#c4870a49", 0xb783982: "updateGroupCallConnection#b783982", - 0xcf7e0873: "updateBotCommands#cf7e0873", + 0x4d712f2e: "updateBotCommands#4d712f2e", 0xa56c2a3e: "updates.state#a56c2a3e", 0x5d75a138: "updates.differenceEmpty#5d75a138", 0xf49ca0: "updates.difference#f49ca0", 0xa8fb1981: "updates.differenceSlice#a8fb1981", 0x4afe8f6d: "updates.differenceTooLong#4afe8f6d", 0xe317af7e: "updatesTooLong#e317af7e", - 0xfaeff833: "updateShortMessage#faeff833", - 0x1157b858: "updateShortChatMessage#1157b858", + 0x313bc7f8: "updateShortMessage#313bc7f8", + 0x4d6deea5: "updateShortChatMessage#4d6deea5", 0x78d4dec1: "updateShort#78d4dec1", 0x725b04c3: "updatesCombined#725b04c3", 0x74ae4240: "updates#74ae4240", @@ -367,9 +367,9 @@ func TypesMap() map[uint32]string { 0xc45a6536: "help.noAppUpdate#c45a6536", 0x18cb9f78: "help.inviteText#18cb9f78", 0xab7ec0a0: "encryptedChatEmpty#ab7ec0a0", - 0x3bf703dc: "encryptedChatWaiting#3bf703dc", - 0x62718a82: "encryptedChatRequested#62718a82", - 0xfa56ce36: "encryptedChat#fa56ce36", + 0x66b25953: "encryptedChatWaiting#66b25953", + 0x48f1d94c: "encryptedChatRequested#48f1d94c", + 0x61f0d4c7: "encryptedChat#61f0d4c7", 0x1e1c7c45: "encryptedChatDiscarded#1e1c7c45", 0xf141b5e1: "inputEncryptedChat#f141b5e1", 0xc21f497e: "encryptedFileEmpty#c21f497e", @@ -409,6 +409,8 @@ func TypesMap() map[uint32]string { 0xd92c2285: "speakingInGroupCallAction#d92c2285", 0xdbda9246: "sendMessageHistoryImportAction#dbda9246", 0xb05ac6b1: "sendMessageChooseStickerAction#b05ac6b1", + 0x25972bcb: "sendMessageEmojiInteraction#25972bcb", + 0xb665902e: "sendMessageEmojiInteractionSeen#b665902e", 0xb3134d9d: "contacts.found#b3134d9d", 0x4f96cb18: "inputPrivacyKeyStatusTimestamp#4f96cb18", 0xbdfb0426: "inputPrivacyKeyChatInvite#bdfb0426", @@ -432,16 +434,16 @@ func TypesMap() map[uint32]string { 0xba52007: "inputPrivacyValueDisallowContacts#ba52007", 0xd66b66c9: "inputPrivacyValueDisallowAll#d66b66c9", 0x90110467: "inputPrivacyValueDisallowUsers#90110467", - 0x4c81c1ba: "inputPrivacyValueAllowChatParticipants#4c81c1ba", - 0xd82363af: "inputPrivacyValueDisallowChatParticipants#d82363af", + 0x840649cf: "inputPrivacyValueAllowChatParticipants#840649cf", + 0xe94f0f86: "inputPrivacyValueDisallowChatParticipants#e94f0f86", 0xfffe1bac: "privacyValueAllowContacts#fffe1bac", 0x65427b82: "privacyValueAllowAll#65427b82", - 0x4d5bbe0c: "privacyValueAllowUsers#4d5bbe0c", + 0xb8905fb2: "privacyValueAllowUsers#b8905fb2", 0xf888fa1a: "privacyValueDisallowContacts#f888fa1a", 0x8b73e763: "privacyValueDisallowAll#8b73e763", - 0xc7f49b7: "privacyValueDisallowUsers#c7f49b7", - 0x18be796b: "privacyValueAllowChatParticipants#18be796b", - 0xacae0690: "privacyValueDisallowChatParticipants#acae0690", + 0xe4621141: "privacyValueDisallowUsers#e4621141", + 0x6b134e8e: "privacyValueAllowChatParticipants#6b134e8e", + 0x41c87565: "privacyValueDisallowChatParticipants#41c87565", 0x50a04e45: "account.privacyRules#50a04e45", 0xb8d0afdf: "accountDaysTTL#b8d0afdf", 0x6c37c15c: "documentAttributeImageSize#6c37c15c", @@ -452,10 +454,10 @@ func TypesMap() map[uint32]string { 0x15590068: "documentAttributeFilename#15590068", 0x9801d2f7: "documentAttributeHasStickers#9801d2f7", 0xf1749a22: "messages.stickersNotModified#f1749a22", - 0xe4599bbd: "messages.stickers#e4599bbd", + 0x30a6ec7e: "messages.stickers#30a6ec7e", 0x12b299d4: "stickerPack#12b299d4", 0xe86602c3: "messages.allStickersNotModified#e86602c3", - 0xedfd405f: "messages.allStickers#edfd405f", + 0xcdbbcebb: "messages.allStickers#cdbbcebb", 0x84d19185: "messages.affectedMessages#84d19185", 0xeb1477e8: "webPageEmpty#eb1477e8", 0xc586da1c: "webPagePending#c586da1c", @@ -468,7 +470,7 @@ func TypesMap() map[uint32]string { 0xc23727c9: "account.passwordInputSettings#c23727c9", 0x137948a5: "auth.passwordRecovery#137948a5", 0xa384b779: "receivedNotifyMessage#a384b779", - 0x6e24fc9d: "chatInviteExported#6e24fc9d", + 0xb18105e8: "chatInviteExported#b18105e8", 0x5a686d7c: "chatInviteAlready#5a686d7c", 0xdfc2f58e: "chatInvite#dfc2f58e", 0x61695cb0: "chatInvitePeek#61695cb0", @@ -477,10 +479,11 @@ func TypesMap() map[uint32]string { 0x861cc8a0: "inputStickerSetShortName#861cc8a0", 0x28703c8: "inputStickerSetAnimatedEmoji#28703c8", 0xe67f520e: "inputStickerSetDice#e67f520e", + 0xcde3739: "inputStickerSetAnimatedEmojiAnimations#cde3739", 0xd7df217a: "stickerSet#d7df217a", 0xb60a24a6: "messages.stickerSet#b60a24a6", 0xc27ac8c7: "botCommand#c27ac8c7", - 0x98e81d3a: "botInfo#98e81d3a", + 0x1b74b335: "botInfo#1b74b335", 0xa2fa4880: "keyboardButton#a2fa4880", 0x258aff05: "keyboardButtonUrl#258aff05", 0x35bbdb6b: "keyboardButtonCallback#35bbdb6b", @@ -508,7 +511,7 @@ func TypesMap() map[uint32]string { 0x28a20571: "messageEntityCode#28a20571", 0x73924be0: "messageEntityPre#73924be0", 0x76a6d327: "messageEntityTextUrl#76a6d327", - 0x352dca58: "messageEntityMentionName#352dca58", + 0xdc7b1140: "messageEntityMentionName#dc7b1140", 0x208e68c9: "inputMessageEntityMentionName#208e68c9", 0x9b69e34b: "messageEntityPhone#9b69e34b", 0x4c4e743f: "messageEntityCashtag#4c4e743f", @@ -517,8 +520,8 @@ func TypesMap() map[uint32]string { 0x20df5d0: "messageEntityBlockquote#20df5d0", 0x761e6af4: "messageEntityBankCard#761e6af4", 0xee8c1e86: "inputChannelEmpty#ee8c1e86", - 0xafeb712e: "inputChannel#afeb712e", - 0x2a286531: "inputChannelFromMessage#2a286531", + 0xf35aec28: "inputChannel#f35aec28", + 0x5b934f9d: "inputChannelFromMessage#5b934f9d", 0x7f077ad9: "contacts.resolvedPeer#7f077ad9", 0xae30253: "messageRange#ae30253", 0x3e11affb: "updates.channelDifferenceEmpty#3e11affb", @@ -526,11 +529,11 @@ func TypesMap() map[uint32]string { 0x2064674e: "updates.channelDifference#2064674e", 0x94d42ee7: "channelMessagesFilterEmpty#94d42ee7", 0xcd77d957: "channelMessagesFilter#cd77d957", - 0x15ebac1d: "channelParticipant#15ebac1d", - 0xa3289a6d: "channelParticipantSelf#a3289a6d", - 0x447dca4b: "channelParticipantCreator#447dca4b", - 0xccbebbaf: "channelParticipantAdmin#ccbebbaf", - 0x50a1dfd6: "channelParticipantBanned#50a1dfd6", + 0xc00c07c0: "channelParticipant#c00c07c0", + 0x28a8bc67: "channelParticipantSelf#28a8bc67", + 0x2fe601d3: "channelParticipantCreator#2fe601d3", + 0x34c3bb53: "channelParticipantAdmin#34c3bb53", + 0x6df8014e: "channelParticipantBanned#6df8014e", 0x1b03f006: "channelParticipantLeft#1b03f006", 0xde3f3c79: "channelParticipantsRecent#de3f3c79", 0xb4608969: "channelParticipantsAdmins#b4608969", @@ -545,7 +548,7 @@ func TypesMap() map[uint32]string { 0xdfb80317: "channels.channelParticipant#dfb80317", 0x780a0310: "help.termsOfService#780a0310", 0xe8025ca2: "messages.savedGifsNotModified#e8025ca2", - 0x2e0709a5: "messages.savedGifs#2e0709a5", + 0x84a02a0d: "messages.savedGifs#84a02a0d", 0x3380c786: "inputBotInlineMessageMediaAuto#3380c786", 0x3dcd7a87: "inputBotInlineMessageText#3dcd7a87", 0x96929a85: "inputBotInlineMessageMediaGeo#96929a85", @@ -578,6 +581,7 @@ func TypesMap() map[uint32]string { 0x36585ea4: "messages.botCallbackAnswer#36585ea4", 0x26b5dde6: "messages.messageEditData#26b5dde6", 0x890c3d89: "inputBotInlineMessageID#890c3d89", + 0xb6d915d7: "inputBotInlineMessageID64#b6d915d7", 0x3c20629f: "inlineBotSwitchPM#3c20629f", 0x3371c354: "messages.peerDialogs#3371c354", 0xedcdc05b: "topPeer#edcdc05b", @@ -596,9 +600,9 @@ func TypesMap() map[uint32]string { 0x1b0c841a: "draftMessageEmpty#1b0c841a", 0xfd8e711f: "draftMessage#fd8e711f", 0xc6dc0c66: "messages.featuredStickersNotModified#c6dc0c66", - 0xb6abc341: "messages.featuredStickers#b6abc341", + 0x84c02310: "messages.featuredStickers#84c02310", 0xb17f890: "messages.recentStickersNotModified#b17f890", - 0x22f3afb3: "messages.recentStickers#22f3afb3", + 0x88d37c56: "messages.recentStickers#88d37c56", 0x4fcba9c8: "messages.archivedStickers#4fcba9c8", 0x38641628: "messages.stickerSetInstallResultSuccess#38641628", 0x35e410a8: "messages.stickerSetInstallResultArchive#35e410a8", @@ -610,7 +614,7 @@ func TypesMap() map[uint32]string { 0xbdf9653b: "game#bdf9653b", 0x32c3e77: "inputGameID#32c3e77", 0xc331e80a: "inputGameShortName#c331e80a", - 0x58fffcd0: "highScore#58fffcd0", + 0x73a379eb: "highScore#73a379eb", 0x9a3bfd99: "messages.highScores#9a3bfd99", 0xdc3d824f: "textEmpty#dc3d824f", 0x744694e0: "textPlain#744694e0", @@ -674,11 +678,11 @@ func TypesMap() map[uint32]string { 0xc239d686: "inputWebFileLocation#c239d686", 0x9f2221c9: "inputWebFileGeoPointLocation#9f2221c9", 0x21e753bc: "upload.webFile#21e753bc", - 0x8d0b2415: "payments.paymentForm#8d0b2415", + 0x1694761b: "payments.paymentForm#1694761b", 0xd1451883: "payments.validatedRequestedInfo#d1451883", 0x4e5f810d: "payments.paymentResult#4e5f810d", 0xd8411139: "payments.paymentVerificationNeeded#d8411139", - 0x10b555d0: "payments.paymentReceipt#10b555d0", + 0x70c4fe03: "payments.paymentReceipt#70c4fe03", 0xfb8fe43c: "payments.savedInfo#fb8fe43c", 0xc10eb2cf: "inputPaymentCredentialsSaved#c10eb2cf", 0x3417d728: "inputPaymentCredentials#3417d728", @@ -689,10 +693,10 @@ func TypesMap() map[uint32]string { 0xffa0a496: "inputStickerSetItem#ffa0a496", 0x1e36fded: "inputPhoneCall#1e36fded", 0x5366c915: "phoneCallEmpty#5366c915", - 0x1b8f4ad1: "phoneCallWaiting#1b8f4ad1", - 0x87eabb53: "phoneCallRequested#87eabb53", - 0x997c454a: "phoneCallAccepted#997c454a", - 0x8742ae7f: "phoneCall#8742ae7f", + 0xc5226f17: "phoneCallWaiting#c5226f17", + 0x14b0ed0c: "phoneCallRequested#14b0ed0c", + 0x3660c311: "phoneCallAccepted#3660c311", + 0x967f7c67: "phoneCall#967f7c67", 0x50ca4de1: "phoneCallDiscarded#50ca4de1", 0x9d4c17c0: "phoneConnection#9d4c17c0", 0x635fe375: "phoneConnectionWebrtc#635fe375", @@ -725,7 +729,7 @@ func TypesMap() map[uint32]string { 0x5f5c95f1: "channelAdminLogEventActionTogglePreHistoryHidden#5f5c95f1", 0x2df5fc0a: "channelAdminLogEventActionDefaultBannedRights#2df5fc0a", 0x8f079643: "channelAdminLogEventActionStopPoll#8f079643", - 0xa26f881b: "channelAdminLogEventActionChangeLinkedChat#a26f881b", + 0x50c7ac8: "channelAdminLogEventActionChangeLinkedChat#50c7ac8", 0xe6b76ae: "channelAdminLogEventActionChangeLocation#e6b76ae", 0x53909779: "channelAdminLogEventActionToggleSlowMode#53909779", 0x23209745: "channelAdminLogEventActionStartGroupCall#23209745", @@ -739,21 +743,20 @@ func TypesMap() map[uint32]string { 0xe90ebb59: "channelAdminLogEventActionExportedInviteEdit#e90ebb59", 0x3e7f6847: "channelAdminLogEventActionParticipantVolume#3e7f6847", 0x6e941a38: "channelAdminLogEventActionChangeHistoryTTL#6e941a38", - 0xfe69018d: "channelAdminLogEventActionChangeTheme#fe69018d", - 0x3b5a3e40: "channelAdminLogEvent#3b5a3e40", + 0x1fad68cd: "channelAdminLogEvent#1fad68cd", 0xed8af74d: "channels.adminLogResults#ed8af74d", 0xea107ae4: "channelAdminLogEventsFilter#ea107ae4", 0x5ce14175: "popularContact#5ce14175", 0x9e8fa6d3: "messages.favedStickersNotModified#9e8fa6d3", - 0xf37f2f16: "messages.favedStickers#f37f2f16", + 0x2cb51097: "messages.favedStickers#2cb51097", 0x46e1d13d: "recentMeUrlUnknown#46e1d13d", - 0x8dbc3336: "recentMeUrlUser#8dbc3336", - 0xa01b22f9: "recentMeUrlChat#a01b22f9", + 0xb92c09e2: "recentMeUrlUser#b92c09e2", + 0xb2da71d2: "recentMeUrlChat#b2da71d2", 0xeb49081d: "recentMeUrlChatInvite#eb49081d", 0xbc0a57dc: "recentMeUrlStickerSet#bc0a57dc", 0xe0310d7: "help.recentMeUrls#e0310d7", 0x1cc6e91f: "inputSingleMedia#1cc6e91f", - 0xcac943f2: "webAuthorization#cac943f2", + 0xa6f8f452: "webAuthorization#a6f8f452", 0xed56c9fc: "account.webAuthorizations#ed56c9fc", 0xa676a322: "inputMessageID#a676a322", 0xbad88395: "inputMessageReplyTo#bad88395", @@ -764,7 +767,7 @@ func TypesMap() map[uint32]string { 0xe56dbf05: "dialogPeer#e56dbf05", 0x514519e2: "dialogPeerFolder#514519e2", 0xd54b65d: "messages.foundStickerSetsNotModified#d54b65d", - 0x5108d648: "messages.foundStickerSets#5108d648", + 0x8af09dd2: "messages.foundStickerSets#8af09dd2", 0x6242c773: "fileHash#6242c773", 0x75588b3f: "inputClientProxy#75588b3f", 0xe3309f7f: "help.termsOfServiceUpdateEmpty#e3309f7f", @@ -843,7 +846,7 @@ func TypesMap() map[uint32]string { 0x6ca9c2e9: "pollAnswer#6ca9c2e9", 0x86e18161: "poll#86e18161", 0x3b6ddad2: "pollAnswerVoters#3b6ddad2", - 0xbadcc1a3: "pollResults#badcc1a3", + 0xdcb82ea3: "pollResults#dcb82ea3", 0xf041e250: "chatOnlines#f041e250", 0x47a971e0: "statsURL#47a971e0", 0x5fb224d5: "chatAdminRights#5fb224d5", @@ -852,7 +855,7 @@ func TypesMap() map[uint32]string { 0x72091c80: "inputWallPaperSlug#72091c80", 0x967a462e: "inputWallPaperNoFile#967a462e", 0x1c199183: "account.wallPapersNotModified#1c199183", - 0x702b65a9: "account.wallPapers#702b65a9", + 0xcdc3858c: "account.wallPapers#cdc3858c", 0xdebebe83: "codeSettings#debebe83", 0x1dc1bca4: "wallPaperSettings#1dc1bca4", 0xe04232f3: "autoDownloadSettings#e04232f3", @@ -878,7 +881,7 @@ func TypesMap() map[uint32]string { 0xf5890df1: "inputThemeSlug#f5890df1", 0xe802b8dc: "theme#e802b8dc", 0xf41eb622: "account.themesNotModified#f41eb622", - 0x7f676421: "account.themes#7f676421", + 0x9a3d8c6d: "account.themes#9a3d8c6d", 0x629f1980: "auth.loginToken#629f1980", 0x68e9916: "auth.loginTokenMigrateTo#68e9916", 0x390d5c5e: "auth.loginTokenSuccess#390d5c5e", @@ -889,12 +892,12 @@ func TypesMap() map[uint32]string { 0xb7b31ea8: "baseThemeNight#b7b31ea8", 0x6d5f77ee: "baseThemeTinted#6d5f77ee", 0x5b11125a: "baseThemeArctic#5b11125a", - 0xff38f912: "inputThemeSettings#ff38f912", - 0x8db4e76c: "themeSettings#8db4e76c", + 0x8fde504f: "inputThemeSettings#8fde504f", + 0xfa58b6d4: "themeSettings#fa58b6d4", 0x54b56617: "webPageAttributeTheme#54b56617", - 0xa28e5559: "messageUserVote#a28e5559", - 0x36377430: "messageUserVoteInputOption#36377430", - 0xe8fe0de: "messageUserVoteMultiple#e8fe0de", + 0x34d247b4: "messageUserVote#34d247b4", + 0x3ca5b0ec: "messageUserVoteInputOption#3ca5b0ec", + 0x8a65e557: "messageUserVoteMultiple#8a65e557", 0x823f649: "messages.votesList#823f649", 0xf568028a: "bankCardOpenUrl#f568028a", 0x3e24e573: "payments.bankCardData#3e24e573", @@ -911,9 +914,9 @@ func TypesMap() map[uint32]string { 0x98f6ac75: "help.promoDataEmpty#98f6ac75", 0x8c39793f: "help.promoData#8c39793f", 0xde33b094: "videoSize#de33b094", - 0x18f3d0f7: "statsGroupTopPoster#18f3d0f7", - 0x6014f412: "statsGroupTopAdmin#6014f412", - 0x31962a4c: "statsGroupTopInviter#31962a4c", + 0x9d04af9b: "statsGroupTopPoster#9d04af9b", + 0xd7584c87: "statsGroupTopAdmin#d7584c87", + 0x535f779d: "statsGroupTopInviter#535f779d", 0xef7ff916: "stats.megagroupStats#ef7ff916", 0xbea2f424: "globalPrivacySettings#bea2f424", 0x4203c5ef: "help.countryCode#4203c5ef", @@ -924,7 +927,7 @@ func TypesMap() map[uint32]string { 0xb6c4f543: "messages.messageViews#b6c4f543", 0xa6341782: "messages.discussionMessage#a6341782", 0xa6d57763: "messageReplyHeader#a6d57763", - 0x4128faac: "messageReplies#4128faac", + 0x83d60fc2: "messageReplies#83d60fc2", 0xe8fd8014: "peerBlocked#e8fd8014", 0x8999f295: "stats.messageStats#8999f295", 0x7780bcb4: "groupCallDiscarded#7780bcb4", @@ -941,12 +944,12 @@ func TypesMap() map[uint32]string { 0x1662af0b: "messages.historyImport#1662af0b", 0x5e0fb7b9: "messages.historyImportParsed#5e0fb7b9", 0xef8d3e6c: "messages.affectedFoundMessages#ef8d3e6c", - 0x1e3e6680: "chatInviteImporter#1e3e6680", + 0xb5cd5f4: "chatInviteImporter#b5cd5f4", 0xbdc62dcc: "messages.exportedChatInvites#bdc62dcc", 0x1871be50: "messages.exportedChatInvite#1871be50", 0x222600ef: "messages.exportedChatInviteReplaced#222600ef", 0x81b6b00a: "messages.chatInviteImporters#81b6b00a", - 0xdfd2330f: "chatAdminWithInvites#dfd2330f", + 0xf2ecef23: "chatAdminWithInvites#f2ecef23", 0xb69b72d7: "messages.chatAdminsWithInvites#b69b72d7", 0xa24de717: "messages.checkedHistoryImportPeer#a24de717", 0xafe5623f: "phone.joinAsPeers#afe5623f", @@ -982,7 +985,7 @@ func TypesMap() map[uint32]string { 0x5717da40: "auth.logOut#5717da40", 0x9fab0d1a: "auth.resetAuthorizations#9fab0d1a", 0xe5bfffcd: "auth.exportAuthorization#e5bfffcd", - 0xe3ef9613: "auth.importAuthorization#e3ef9613", + 0xa57a7dad: "auth.importAuthorization#a57a7dad", 0xcdd42a05: "auth.bindTempAuthKey#cdd42a05", 0x67a3ff2c: "auth.importBotAuthorization#67a3ff2c", 0xd18b4d16: "auth.checkPassword#d18b4d16", @@ -991,18 +994,18 @@ func TypesMap() map[uint32]string { 0x3ef1a9bf: "auth.resendCode#3ef1a9bf", 0x1f040578: "auth.cancelCode#1f040578", 0x8e48a188: "auth.dropTempAuthKeys#8e48a188", - 0xb1b41517: "auth.exportLoginToken#b1b41517", + 0xb7e085fe: "auth.exportLoginToken#b7e085fe", 0x95ac5ce4: "auth.importLoginToken#95ac5ce4", 0xe894ad4d: "auth.acceptLoginToken#e894ad4d", 0xd36bf79: "auth.checkRecoveryPassword#d36bf79", - 0x68976c6f: "account.registerDevice#68976c6f", - 0x3076c4bf: "account.unregisterDevice#3076c4bf", + 0xec86017a: "account.registerDevice#ec86017a", + 0x6a0d3206: "account.unregisterDevice#6a0d3206", 0x84be5b93: "account.updateNotifySettings#84be5b93", 0x12b3ad31: "account.getNotifySettings#12b3ad31", 0xdb7e1747: "account.resetNotifySettings#db7e1747", 0x78515775: "account.updateProfile#78515775", 0x6628562c: "account.updateStatus#6628562c", - 0xaabb1763: "account.getWallPapers#aabb1763", + 0x7967d36: "account.getWallPapers#7967d36", 0xc5ba3d86: "account.reportPeer#c5ba3d86", 0x2714d86c: "account.checkUsername#2714d86c", 0x3e0bdd7c: "account.updateUsername#3e0bdd7c", @@ -1029,8 +1032,8 @@ func TypesMap() map[uint32]string { 0x73665bc2: "account.getSecureValue#73665bc2", 0x899fe31d: "account.saveSecureValue#899fe31d", 0xb880bc4b: "account.deleteSecureValue#b880bc4b", - 0xb86ba8e1: "account.getAuthorizationForm#b86ba8e1", - 0xe7027c94: "account.acceptAuthorization#e7027c94", + 0xa929597a: "account.getAuthorizationForm#a929597a", + 0xf3ed4c73: "account.acceptAuthorization#f3ed4c73", 0xa5a356f9: "account.sendVerifyPhoneCode#a5a356f9", 0x4dd3a7f6: "account.verifyPhone#4dd3a7f6", 0x7011509f: "account.sendVerifyEmailCode#7011509f", @@ -1056,7 +1059,7 @@ func TypesMap() map[uint32]string { 0xf257106c: "account.saveTheme#f257106c", 0x7ae43737: "account.installTheme#7ae43737", 0x8d9d742b: "account.getTheme#8d9d742b", - 0x285946f8: "account.getThemes#285946f8", + 0x7206e458: "account.getThemes#7206e458", 0xb574b16b: "account.setContentSettings#b574b16b", 0x8b9b4dae: "account.getContentSettings#8b9b4dae", 0x65ad71dc: "account.getMultiWallPapers#65ad71dc", @@ -1069,9 +1072,9 @@ func TypesMap() map[uint32]string { 0xd91a548: "users.getUsers#d91a548", 0xca30a5b1: "users.getFullUser#ca30a5b1", 0x90c894b5: "users.setSecureValueErrors#90c894b5", - 0x2caa4a42: "contacts.getContactIDs#2caa4a42", + 0x7adc669d: "contacts.getContactIDs#7adc669d", 0xc4a353ee: "contacts.getStatuses#c4a353ee", - 0xc023849f: "contacts.getContacts#c023849f", + 0x5dd69e12: "contacts.getContacts#5dd69e12", 0x2c800be5: "contacts.importContacts#2c800be5", 0x96a0e00: "contacts.deleteContacts#96a0e00", 0x1013fd9e: "contacts.deleteByPhones#1013fd9e", @@ -1080,7 +1083,7 @@ func TypesMap() map[uint32]string { 0xf57c350f: "contacts.getBlocked#f57c350f", 0x11f812d8: "contacts.search#11f812d8", 0xf93ccba3: "contacts.resolveUsername#f93ccba3", - 0xd4982db5: "contacts.getTopPeers#d4982db5", + 0x973478b6: "contacts.getTopPeers#973478b6", 0x1ae373ac: "contacts.resetTopPeerRating#1ae373ac", 0x879537f1: "contacts.resetSaved#879537f1", 0x82f1e39f: "contacts.getSaved#82f1e39f", @@ -1090,9 +1093,9 @@ func TypesMap() map[uint32]string { 0xd348bc44: "contacts.getLocated#d348bc44", 0x29a8962c: "contacts.blockFromReplies#29a8962c", 0x63c66506: "messages.getMessages#63c66506", - 0xa0ee3b73: "messages.getDialogs#a0ee3b73", - 0xdcbb8260: "messages.getHistory#dcbb8260", - 0xc352eec: "messages.search#c352eec", + 0xa0f4cb4f: "messages.getDialogs#a0f4cb4f", + 0x4423e6c5: "messages.getHistory#4423e6c5", + 0xa0fda762: "messages.search#a0fda762", 0xe306d3a: "messages.readHistory#e306d3a", 0x1c015b09: "messages.deleteHistory#1c015b09", 0xe58e95d2: "messages.deleteMessages#e58e95d2", @@ -1104,12 +1107,12 @@ func TypesMap() map[uint32]string { 0xcf1592db: "messages.reportSpam#cf1592db", 0x3672e09c: "messages.getPeerSettings#3672e09c", 0x8953ab4e: "messages.report#8953ab4e", - 0x3c6aa187: "messages.getChats#3c6aa187", - 0x3b831c66: "messages.getFullChat#3b831c66", - 0xdc452855: "messages.editChatTitle#dc452855", - 0xca4c79d8: "messages.editChatPhoto#ca4c79d8", - 0xf9a0aa09: "messages.addChatUser#f9a0aa09", - 0xc534459a: "messages.deleteChatUser#c534459a", + 0x49e9528f: "messages.getChats#49e9528f", + 0xaeb00b34: "messages.getFullChat#aeb00b34", + 0x73783ffd: "messages.editChatTitle#73783ffd", + 0x35ddd674: "messages.editChatPhoto#35ddd674", + 0xf24753e3: "messages.addChatUser#f24753e3", + 0xa2185cab: "messages.deleteChatUser#a2185cab", 0x9cb126e: "messages.createChat#9cb126e", 0x26cf8950: "messages.getDhConfig#26cf8950", 0xf64daf43: "messages.requestEncryption#f64daf43", @@ -1123,8 +1126,8 @@ func TypesMap() map[uint32]string { 0x55a5bb66: "messages.receivedQueue#55a5bb66", 0x4b0c8c0f: "messages.reportEncryptedSpam#4b0c8c0f", 0x36a73f77: "messages.readMessageContents#36a73f77", - 0x43d4f2c: "messages.getStickers#43d4f2c", - 0x1c9618b1: "messages.getAllStickers#1c9618b1", + 0xd5a5d3a1: "messages.getStickers#d5a5d3a1", + 0xb8a0a1a8: "messages.getAllStickers#b8a0a1a8", 0x8b68b0cc: "messages.getWebPagePreview#8b68b0cc", 0x14b9bcd7: "messages.exportChatInvite#14b9bcd7", 0x3eadb1bb: "messages.checkChatInvite#3eadb1bb", @@ -1134,12 +1137,12 @@ func TypesMap() map[uint32]string { 0xf96e55de: "messages.uninstallStickerSet#f96e55de", 0xe6df7378: "messages.startBot#e6df7378", 0x5784d3e1: "messages.getMessagesViews#5784d3e1", - 0xa9e69f2e: "messages.editChatAdmin#a9e69f2e", - 0x15a3b8e3: "messages.migrateChat#15a3b8e3", + 0xa85bd1c2: "messages.editChatAdmin#a85bd1c2", + 0xa2875319: "messages.migrateChat#a2875319", 0x4bc6589a: "messages.searchGlobal#4bc6589a", 0x78337739: "messages.reorderStickerSets#78337739", 0x338e2464: "messages.getDocumentByHash#338e2464", - 0x83bf3d52: "messages.getSavedGifs#83bf3d52", + 0x5cf09635: "messages.getSavedGifs#5cf09635", 0x327a30cb: "messages.saveGif#327a30cb", 0x514e999d: "messages.getInlineBotResults#514e999d", 0xeb5ea206: "messages.setInlineBotResults#eb5ea206", @@ -1152,20 +1155,20 @@ func TypesMap() map[uint32]string { 0xe470bcfd: "messages.getPeerDialogs#e470bcfd", 0xbc39e14b: "messages.saveDraft#bc39e14b", 0x6a3f8d65: "messages.getAllDrafts#6a3f8d65", - 0x2dacca4f: "messages.getFeaturedStickers#2dacca4f", + 0x64780b14: "messages.getFeaturedStickers#64780b14", 0x5b118126: "messages.readFeaturedStickers#5b118126", - 0x5ea192c9: "messages.getRecentStickers#5ea192c9", + 0x9da9403b: "messages.getRecentStickers#9da9403b", 0x392718f8: "messages.saveRecentSticker#392718f8", 0x8999602d: "messages.clearRecentStickers#8999602d", 0x57f17692: "messages.getArchivedStickers#57f17692", - 0x65b8c79f: "messages.getMaskStickers#65b8c79f", + 0x640f82b8: "messages.getMaskStickers#640f82b8", 0xcc5b67cc: "messages.getAttachedStickers#cc5b67cc", 0x8ef8ecc0: "messages.setGameScore#8ef8ecc0", 0x15ad9f64: "messages.setInlineGameScore#15ad9f64", 0xe822649d: "messages.getGameHighScores#e822649d", 0xf635e1b: "messages.getInlineGameHighScores#f635e1b", - 0xd0a48c4: "messages.getCommonChats#d0a48c4", - 0xeba80ff0: "messages.getAllChats#eba80ff0", + 0xe40ca104: "messages.getCommonChats#e40ca104", + 0x875f74be: "messages.getAllChats#875f74be", 0x32ca8f91: "messages.getWebPage#32ca8f91", 0xa731e257: "messages.toggleDialogPin#a731e257", 0x3b1adf37: "messages.reorderPinnedDialogs#3b1adf37", @@ -1174,14 +1177,14 @@ func TypesMap() map[uint32]string { 0x9c2dd95: "messages.setBotPrecheckoutResults#9c2dd95", 0x519bc2b1: "messages.uploadMedia#519bc2b1", 0xc97df020: "messages.sendScreenshotNotification#c97df020", - 0x21ce0b0e: "messages.getFavedStickers#21ce0b0e", + 0x4f1aaa9: "messages.getFavedStickers#4f1aaa9", 0xb9ffc55b: "messages.faveSticker#b9ffc55b", 0x46578472: "messages.getUnreadMentions#46578472", 0xf0189d3: "messages.readMentions#f0189d3", - 0xbbc45b09: "messages.getRecentLocations#bbc45b09", + 0x702a40e0: "messages.getRecentLocations#702a40e0", 0xcc0110cb: "messages.sendMultiMedia#cc0110cb", 0x5057c497: "messages.uploadEncryptedFile#5057c497", - 0xc2b7d08b: "messages.searchStickerSets#c2b7d08b", + 0x35705b8a: "messages.searchStickerSets#35705b8a", 0x1cff7e08: "messages.getSplitRanges#1cff7e08", 0xc286d98f: "messages.markDialogUnread#c286d98f", 0x22e24e22: "messages.getDialogUnreadMarks#22e24e22", @@ -1201,7 +1204,7 @@ func TypesMap() map[uint32]string { 0x198fb446: "messages.requestUrlAuth#198fb446", 0xb12c7125: "messages.acceptUrlAuth#b12c7125", 0x4facb138: "messages.hidePeerSettingsBar#4facb138", - 0xe2c2685b: "messages.getScheduledHistory#e2c2685b", + 0xf516760b: "messages.getScheduledHistory#f516760b", 0xbdbb0464: "messages.getScheduledMessages#bdbb0464", 0xbd38850a: "messages.sendScheduledMessages#bd38850a", 0x59ae2b16: "messages.deleteScheduledMessages#59ae2b16", @@ -1211,12 +1214,12 @@ func TypesMap() map[uint32]string { 0xa29cd42c: "messages.getSuggestedDialogFilters#a29cd42c", 0x1ad4a04a: "messages.updateDialogFilter#1ad4a04a", 0xc563c1e4: "messages.updateDialogFiltersOrder#c563c1e4", - 0x5fe7025b: "messages.getOldFeaturedStickers#5fe7025b", - 0x24b581ba: "messages.getReplies#24b581ba", + 0x7ed094a1: "messages.getOldFeaturedStickers#7ed094a1", + 0x22ddd30c: "messages.getReplies#22ddd30c", 0x446972fd: "messages.getDiscussionMessage#446972fd", 0xf731a9f4: "messages.readDiscussion#f731a9f4", 0xf025bc8b: "messages.unpinAllMessages#f025bc8b", - 0x83247d11: "messages.deleteChat#83247d11", + 0x5bd0ee50: "messages.deleteChat#5bd0ee50", 0xf9cbe409: "messages.deletePhoneCallHistory#f9cbe409", 0x43fe19f3: "messages.checkHistoryImport#43fe19f3", 0x34090c3b: "messages.initHistoryImport#34090c3b", @@ -1232,6 +1235,7 @@ func TypesMap() map[uint32]string { 0xb80e5fe4: "messages.setHistoryTTL#b80e5fe4", 0x5dc60f03: "messages.checkHistoryImportPeer#5dc60f03", 0xe63be13f: "messages.setChatTheme#e63be13f", + 0x2c6f97b7: "messages.getMessageReadParticipants#2c6f97b7", 0xedd4882a: "updates.getState#edd4882a", 0x25939651: "updates.getDifference#25939651", 0x3173d78: "updates.getChannelDifference#3173d78", @@ -1274,7 +1278,7 @@ func TypesMap() map[uint32]string { 0xd10dd71b: "channels.deleteUserHistory#d10dd71b", 0xfe087810: "channels.reportSpam#fe087810", 0xad8c9a23: "channels.getMessages#ad8c9a23", - 0x123e05e9: "channels.getParticipants#123e05e9", + 0x77ced9d0: "channels.getParticipants#77ced9d0", 0xa0ab6cc6: "channels.getParticipant#a0ab6cc6", 0xa7f6bbb: "channels.getChannels#a7f6bbb", 0x8736a09: "channels.getFullChannel#8736a09", @@ -1391,15 +1395,15 @@ func NamesMap() map[string]uint32 { "test.useConfigSimple": 0xf9b7b23d, "inputPeerEmpty": 0x7f3b18ea, "inputPeerSelf": 0x7da07ec9, - "inputPeerChat": 0x179be863, - "inputPeerUser": 0x7b8e7de6, - "inputPeerChannel": 0x20adaef8, - "inputPeerUserFromMessage": 0x17bae2e6, - "inputPeerChannelFromMessage": 0x9c95f7bb, + "inputPeerChat": 0x35a95cb9, + "inputPeerUser": 0xdde8a54c, + "inputPeerChannel": 0x27bcbbfc, + "inputPeerUserFromMessage": 0xa87b0a1c, + "inputPeerChannelFromMessage": 0xbd2a0840, "inputUserEmpty": 0xb98886cf, "inputUserSelf": 0xf7c1b13f, - "inputUser": 0xd8292816, - "inputUserFromMessage": 0x2d117597, + "inputUser": 0xf21158c6, + "inputUserFromMessage": 0x1da448e2, "inputPhoneContact": 0xf392b7f4, "inputFile": 0xf52ff27f, "inputFileBig": 0xfa4f0bb5, @@ -1435,9 +1439,9 @@ func NamesMap() map[string]uint32 { "inputPeerPhotoFileLocation": 0x37257e99, "inputStickerSetThumb": 0x9d84f3db, "inputGroupCallStream": 0x598a92a, - "peerUser": 0x9db1bc6d, - "peerChat": 0xbad0e5bb, - "peerChannel": 0xbddde532, + "peerUser": 0x59511722, + "peerChat": 0x36c6019a, + "peerChannel": 0xa2a5371e, "storage.fileUnknown": 0xaa963b05, "storage.filePartial": 0x40bc6f52, "storage.fileJpeg": 0x7efe0e, @@ -1448,8 +1452,8 @@ func NamesMap() map[string]uint32 { "storage.fileMov": 0x4b09ebbc, "storage.fileMp4": 0xb3cea0e4, "storage.fileWebp": 0x1081464c, - "userEmpty": 0x200250ba, - "user": 0x938458c1, + "userEmpty": 0xd3bc4b7a, + "user": 0x3ff6ecb0, "userProfilePhotoEmpty": 0x4f11bae1, "userProfilePhoto": 0x82d1f706, "userStatusEmpty": 0x9d05049, @@ -1458,27 +1462,27 @@ func NamesMap() map[string]uint32 { "userStatusRecently": 0xe26f42f1, "userStatusLastWeek": 0x7bf09fc, "userStatusLastMonth": 0x77ebc742, - "chatEmpty": 0x9ba2d800, - "chat": 0x3bda1bde, - "chatForbidden": 0x7328bdb, - "channel": 0xd31a961e, - "channelForbidden": 0x289da732, - "chatFull": 0x49a0a5d9, - "channelFull": 0x2f532f3c, - "chatParticipant": 0xc8d7493e, - "chatParticipantCreator": 0xda13538a, - "chatParticipantAdmin": 0xe2d6e436, - "chatParticipantsForbidden": 0xfc900c2b, - "chatParticipants": 0x3f460fed, + "chatEmpty": 0x29562865, + "chat": 0x41cbf256, + "chatForbidden": 0x6592a1a7, + "channel": 0x8261ac61, + "channelForbidden": 0x17d493d5, + "chatFull": 0x4dbdc099, + "channelFull": 0xe9b27a17, + "chatParticipant": 0xc02d4007, + "chatParticipantCreator": 0xe46bcee4, + "chatParticipantAdmin": 0xa0933f5b, + "chatParticipantsForbidden": 0x8763d3e1, + "chatParticipants": 0x3cbc93f8, "chatPhotoEmpty": 0x37c1011c, "chatPhoto": 0x1c6e1c11, "messageEmpty": 0x90a6ca84, - "message": 0xbce383d2, + "message": 0x85d6cbe2, "messageService": 0x2b085862, "messageMediaEmpty": 0x3ded6320, "messageMediaPhoto": 0x695150d7, "messageMediaGeo": 0x56e0d474, - "messageMediaContact": 0xcbf24940, + "messageMediaContact": 0x70322949, "messageMediaUnsupported": 0x9f84f49e, "messageMediaDocument": 0x9cb070d7, "messageMediaWebPage": 0xa32dd600, @@ -1489,16 +1493,16 @@ func NamesMap() map[string]uint32 { "messageMediaPoll": 0x4bd6e798, "messageMediaDice": 0x3f7ee58b, "messageActionEmpty": 0xb6aef7b0, - "messageActionChatCreate": 0xa6638b9a, + "messageActionChatCreate": 0xbd47cbad, "messageActionChatEditTitle": 0xb5a1ce5a, "messageActionChatEditPhoto": 0x7fcb13a8, "messageActionChatDeletePhoto": 0x95e3fbef, - "messageActionChatAddUser": 0x488a7337, - "messageActionChatDeleteUser": 0xb2ae9b0c, - "messageActionChatJoinedByLink": 0xf89cf5e8, + "messageActionChatAddUser": 0x15cefd00, + "messageActionChatDeleteUser": 0xa43f30cc, + "messageActionChatJoinedByLink": 0x31224c3, "messageActionChannelCreate": 0x95d2ac92, - "messageActionChatMigrateTo": 0x51bdb021, - "messageActionChannelMigrateFrom": 0xb055eaee, + "messageActionChatMigrateTo": 0xe1037f92, + "messageActionChannelMigrateFrom": 0xea3948e9, "messageActionPinMessage": 0x94bd38ed, "messageActionHistoryClear": 0x9fbab604, "messageActionGameScore": 0x92a72876, @@ -1513,7 +1517,7 @@ func NamesMap() map[string]uint32 { "messageActionContactSignUp": 0xf3f25f76, "messageActionGeoProximityReached": 0x98e0d697, "messageActionGroupCall": 0x7a0d7f42, - "messageActionInviteToGroupCall": 0x76b9f11a, + "messageActionInviteToGroupCall": 0x502f92f7, "messageActionSetMessagesTTL": 0xaa1afbfd, "messageActionGroupCallScheduled": 0xb3a07661, "messageActionSetChatTheme": 0xaa786345, @@ -1532,7 +1536,7 @@ func NamesMap() map[string]uint32 { "auth.sentCode": 0x5e002502, "auth.authorization": 0xcd050916, "auth.authorizationSignUpRequired": 0x44747e9a, - "auth.exportedAuthorization": 0xdf969c2d, + "auth.exportedAuthorization": 0xb434e2b8, "inputNotifyPeer": 0xb8bc5b0c, "inputNotifyUsers": 0x193b4417, "inputNotifyChats": 0x4a95e84e, @@ -1551,9 +1555,9 @@ func NamesMap() map[string]uint32 { "inputReportReasonGeoIrrelevant": 0xdbd4feed, "inputReportReasonFake": 0xf5ddd6e7, "userFull": 0xd697ff05, - "contact": 0xf911c994, - "importedContact": 0xd0028438, - "contactStatus": 0xd3680c61, + "contact": 0x145ade0b, + "importedContact": 0xc13e3c50, + "contactStatus": 0x16d9703b, "contacts.contactsNotModified": 0xb74ba9d2, "contacts.contacts": 0xeae87e42, "contacts.importedContacts": 0x77d01c3b, @@ -1590,64 +1594,64 @@ func NamesMap() map[string]uint32 { "updateNewMessage": 0x1f2b0afd, "updateMessageID": 0x4e90bfd6, "updateDeleteMessages": 0xa20db0e5, - "updateUserTyping": 0x5c486927, - "updateChatUserTyping": 0x86cadb6c, + "updateUserTyping": 0xc01e857f, + "updateChatUserTyping": 0x83487af0, "updateChatParticipants": 0x7761198, - "updateUserStatus": 0x1bfbd823, - "updateUserName": 0xa7332b73, - "updateUserPhoto": 0x95313b0c, + "updateUserStatus": 0xe5bdf8de, + "updateUserName": 0xc3f202e0, + "updateUserPhoto": 0xf227868c, "updateNewEncryptedMessage": 0x12bcbd9a, "updateEncryptedChatTyping": 0x1710f156, "updateEncryption": 0xb4a2e88d, "updateEncryptedMessagesRead": 0x38fe25b7, - "updateChatParticipantAdd": 0xea4b0e5c, - "updateChatParticipantDelete": 0x6e5f8c22, + "updateChatParticipantAdd": 0x3dda5451, + "updateChatParticipantDelete": 0xe32f3d77, "updateDcOptions": 0x8e5e9873, "updateNotifySettings": 0xbec268ef, "updateServiceNotification": 0xebe46819, "updatePrivacy": 0xee3b272a, - "updateUserPhone": 0x12b9417b, + "updateUserPhone": 0x5492a13, "updateReadHistoryInbox": 0x9c974fdf, "updateReadHistoryOutbox": 0x2f2f21bf, "updateWebPage": 0x7f891213, "updateReadMessagesContents": 0x68c13933, - "updateChannelTooLong": 0xeb0467fb, - "updateChannel": 0xb6d45656, + "updateChannelTooLong": 0x108d941f, + "updateChannel": 0x635b4c09, "updateNewChannelMessage": 0x62ba04d9, - "updateReadChannelInbox": 0x330b5424, - "updateDeleteChannelMessages": 0xc37521c9, - "updateChannelMessageViews": 0x98a12b4b, - "updateChatParticipantAdmin": 0xb6901959, + "updateReadChannelInbox": 0x922e6e10, + "updateDeleteChannelMessages": 0xc32d5b12, + "updateChannelMessageViews": 0xf226ac08, + "updateChatParticipantAdmin": 0xd7ca61a2, "updateNewStickerSet": 0x688a30aa, "updateStickerSetsOrder": 0xbb2d201, "updateStickerSets": 0x43ae3dec, "updateSavedGifs": 0x9375341e, - "updateBotInlineQuery": 0x3f2038db, - "updateBotInlineSend": 0xe48f964, + "updateBotInlineQuery": 0x496f379c, + "updateBotInlineSend": 0x12f12a07, "updateEditChannelMessage": 0x1b3f4df7, - "updateBotCallbackQuery": 0xe73547e1, + "updateBotCallbackQuery": 0xb9cfc48d, "updateEditMessage": 0xe40370a3, - "updateInlineBotCallbackQuery": 0xf9d27a5a, - "updateReadChannelOutbox": 0x25d6c9c7, + "updateInlineBotCallbackQuery": 0x691e9052, + "updateReadChannelOutbox": 0xb75f99a9, "updateDraftMessage": 0xee2bb969, "updateReadFeaturedStickers": 0x571d2742, "updateRecentStickers": 0x9a422c20, "updateConfig": 0xa229dd06, "updatePtsChanged": 0x3354678f, - "updateChannelWebPage": 0x40771900, + "updateChannelWebPage": 0x2f2ba99f, "updateDialogPinned": 0x6e6fe51c, "updatePinnedDialogs": 0xfa0f3ca2, "updateBotWebhookJSON": 0x8317c0c3, "updateBotWebhookJSONQuery": 0x9b9240a6, - "updateBotShippingQuery": 0xe0cdc940, - "updateBotPrecheckoutQuery": 0x5d2f3aa9, + "updateBotShippingQuery": 0xb5aefd7d, + "updateBotPrecheckoutQuery": 0x8caa9a96, "updatePhoneCall": 0xab0f6b1e, "updateLangPackTooLong": 0x46560264, "updateLangPack": 0x56022f4d, "updateFavedStickers": 0xe511996d, - "updateChannelReadMessagesContents": 0x89893b45, + "updateChannelReadMessagesContents": 0x44bdd535, "updateContactsReset": 0x7084a7be, - "updateChannelAvailableMessages": 0x70db6837, + "updateChannelAvailableMessages": 0xb23fc698, "updateDialogUnreadMark": 0xe16459c3, "updateMessagePoll": 0xaca1657b, "updateChatDefaultBannedRights": 0x54c01850, @@ -1659,35 +1663,35 @@ func NamesMap() map[string]uint32 { "updateTheme": 0x8216fba3, "updateGeoLiveViewed": 0x871fb939, "updateLoginToken": 0x564fe691, - "updateMessagePollVote": 0x37f69f0b, + "updateMessagePollVote": 0x106395c9, "updateDialogFilter": 0x26ffde7d, "updateDialogFilterOrder": 0xa5d72105, "updateDialogFilters": 0x3504914f, "updatePhoneCallSignalingData": 0x2661bf09, - "updateChannelMessageForwards": 0x6e8a84df, - "updateReadChannelDiscussionInbox": 0x1cc7de54, - "updateReadChannelDiscussionOutbox": 0x4638a26c, + "updateChannelMessageForwards": 0xd29a27f4, + "updateReadChannelDiscussionInbox": 0xd6b19546, + "updateReadChannelDiscussionOutbox": 0x695c9e7c, "updatePeerBlocked": 0x246a4b22, - "updateChannelUserTyping": 0x6b171718, + "updateChannelUserTyping": 0x8c88c923, "updatePinnedMessages": 0xed85eab5, - "updatePinnedChannelMessages": 0x8588878b, - "updateChat": 0x1330a196, + "updatePinnedChannelMessages": 0x5bb98608, + "updateChat": 0xf89a6a4e, "updateGroupCallParticipants": 0xf2ebdb4e, - "updateGroupCall": 0xa45eb99b, + "updateGroupCall": 0x14b24500, "updatePeerHistoryTTL": 0xbb9bb9a5, - "updateChatParticipant": 0xf3b3781f, - "updateChannelParticipant": 0x7fecb1ec, - "updateBotStopped": 0x7f9488a, + "updateChatParticipant": 0xd087663a, + "updateChannelParticipant": 0x985d3abb, + "updateBotStopped": 0xc4870a49, "updateGroupCallConnection": 0xb783982, - "updateBotCommands": 0xcf7e0873, + "updateBotCommands": 0x4d712f2e, "updates.state": 0xa56c2a3e, "updates.differenceEmpty": 0x5d75a138, "updates.difference": 0xf49ca0, "updates.differenceSlice": 0xa8fb1981, "updates.differenceTooLong": 0x4afe8f6d, "updatesTooLong": 0xe317af7e, - "updateShortMessage": 0xfaeff833, - "updateShortChatMessage": 0x1157b858, + "updateShortMessage": 0x313bc7f8, + "updateShortChatMessage": 0x4d6deea5, "updateShort": 0x78d4dec1, "updatesCombined": 0x725b04c3, "updates": 0x74ae4240, @@ -1704,9 +1708,9 @@ func NamesMap() map[string]uint32 { "help.noAppUpdate": 0xc45a6536, "help.inviteText": 0x18cb9f78, "encryptedChatEmpty": 0xab7ec0a0, - "encryptedChatWaiting": 0x3bf703dc, - "encryptedChatRequested": 0x62718a82, - "encryptedChat": 0xfa56ce36, + "encryptedChatWaiting": 0x66b25953, + "encryptedChatRequested": 0x48f1d94c, + "encryptedChat": 0x61f0d4c7, "encryptedChatDiscarded": 0x1e1c7c45, "inputEncryptedChat": 0xf141b5e1, "encryptedFileEmpty": 0xc21f497e, @@ -1746,6 +1750,8 @@ func NamesMap() map[string]uint32 { "speakingInGroupCallAction": 0xd92c2285, "sendMessageHistoryImportAction": 0xdbda9246, "sendMessageChooseStickerAction": 0xb05ac6b1, + "sendMessageEmojiInteraction": 0x25972bcb, + "sendMessageEmojiInteractionSeen": 0xb665902e, "contacts.found": 0xb3134d9d, "inputPrivacyKeyStatusTimestamp": 0x4f96cb18, "inputPrivacyKeyChatInvite": 0xbdfb0426, @@ -1769,16 +1775,16 @@ func NamesMap() map[string]uint32 { "inputPrivacyValueDisallowContacts": 0xba52007, "inputPrivacyValueDisallowAll": 0xd66b66c9, "inputPrivacyValueDisallowUsers": 0x90110467, - "inputPrivacyValueAllowChatParticipants": 0x4c81c1ba, - "inputPrivacyValueDisallowChatParticipants": 0xd82363af, + "inputPrivacyValueAllowChatParticipants": 0x840649cf, + "inputPrivacyValueDisallowChatParticipants": 0xe94f0f86, "privacyValueAllowContacts": 0xfffe1bac, "privacyValueAllowAll": 0x65427b82, - "privacyValueAllowUsers": 0x4d5bbe0c, + "privacyValueAllowUsers": 0xb8905fb2, "privacyValueDisallowContacts": 0xf888fa1a, "privacyValueDisallowAll": 0x8b73e763, - "privacyValueDisallowUsers": 0xc7f49b7, - "privacyValueAllowChatParticipants": 0x18be796b, - "privacyValueDisallowChatParticipants": 0xacae0690, + "privacyValueDisallowUsers": 0xe4621141, + "privacyValueAllowChatParticipants": 0x6b134e8e, + "privacyValueDisallowChatParticipants": 0x41c87565, "account.privacyRules": 0x50a04e45, "accountDaysTTL": 0xb8d0afdf, "documentAttributeImageSize": 0x6c37c15c, @@ -1789,10 +1795,10 @@ func NamesMap() map[string]uint32 { "documentAttributeFilename": 0x15590068, "documentAttributeHasStickers": 0x9801d2f7, "messages.stickersNotModified": 0xf1749a22, - "messages.stickers": 0xe4599bbd, + "messages.stickers": 0x30a6ec7e, "stickerPack": 0x12b299d4, "messages.allStickersNotModified": 0xe86602c3, - "messages.allStickers": 0xedfd405f, + "messages.allStickers": 0xcdbbcebb, "messages.affectedMessages": 0x84d19185, "webPageEmpty": 0xeb1477e8, "webPagePending": 0xc586da1c, @@ -1805,7 +1811,7 @@ func NamesMap() map[string]uint32 { "account.passwordInputSettings": 0xc23727c9, "auth.passwordRecovery": 0x137948a5, "receivedNotifyMessage": 0xa384b779, - "chatInviteExported": 0x6e24fc9d, + "chatInviteExported": 0xb18105e8, "chatInviteAlready": 0x5a686d7c, "chatInvite": 0xdfc2f58e, "chatInvitePeek": 0x61695cb0, @@ -1814,10 +1820,11 @@ func NamesMap() map[string]uint32 { "inputStickerSetShortName": 0x861cc8a0, "inputStickerSetAnimatedEmoji": 0x28703c8, "inputStickerSetDice": 0xe67f520e, + "inputStickerSetAnimatedEmojiAnimations": 0xcde3739, "stickerSet": 0xd7df217a, "messages.stickerSet": 0xb60a24a6, "botCommand": 0xc27ac8c7, - "botInfo": 0x98e81d3a, + "botInfo": 0x1b74b335, "keyboardButton": 0xa2fa4880, "keyboardButtonUrl": 0x258aff05, "keyboardButtonCallback": 0x35bbdb6b, @@ -1845,7 +1852,7 @@ func NamesMap() map[string]uint32 { "messageEntityCode": 0x28a20571, "messageEntityPre": 0x73924be0, "messageEntityTextUrl": 0x76a6d327, - "messageEntityMentionName": 0x352dca58, + "messageEntityMentionName": 0xdc7b1140, "inputMessageEntityMentionName": 0x208e68c9, "messageEntityPhone": 0x9b69e34b, "messageEntityCashtag": 0x4c4e743f, @@ -1854,8 +1861,8 @@ func NamesMap() map[string]uint32 { "messageEntityBlockquote": 0x20df5d0, "messageEntityBankCard": 0x761e6af4, "inputChannelEmpty": 0xee8c1e86, - "inputChannel": 0xafeb712e, - "inputChannelFromMessage": 0x2a286531, + "inputChannel": 0xf35aec28, + "inputChannelFromMessage": 0x5b934f9d, "contacts.resolvedPeer": 0x7f077ad9, "messageRange": 0xae30253, "updates.channelDifferenceEmpty": 0x3e11affb, @@ -1863,11 +1870,11 @@ func NamesMap() map[string]uint32 { "updates.channelDifference": 0x2064674e, "channelMessagesFilterEmpty": 0x94d42ee7, "channelMessagesFilter": 0xcd77d957, - "channelParticipant": 0x15ebac1d, - "channelParticipantSelf": 0xa3289a6d, - "channelParticipantCreator": 0x447dca4b, - "channelParticipantAdmin": 0xccbebbaf, - "channelParticipantBanned": 0x50a1dfd6, + "channelParticipant": 0xc00c07c0, + "channelParticipantSelf": 0x28a8bc67, + "channelParticipantCreator": 0x2fe601d3, + "channelParticipantAdmin": 0x34c3bb53, + "channelParticipantBanned": 0x6df8014e, "channelParticipantLeft": 0x1b03f006, "channelParticipantsRecent": 0xde3f3c79, "channelParticipantsAdmins": 0xb4608969, @@ -1882,7 +1889,7 @@ func NamesMap() map[string]uint32 { "channels.channelParticipant": 0xdfb80317, "help.termsOfService": 0x780a0310, "messages.savedGifsNotModified": 0xe8025ca2, - "messages.savedGifs": 0x2e0709a5, + "messages.savedGifs": 0x84a02a0d, "inputBotInlineMessageMediaAuto": 0x3380c786, "inputBotInlineMessageText": 0x3dcd7a87, "inputBotInlineMessageMediaGeo": 0x96929a85, @@ -1915,6 +1922,7 @@ func NamesMap() map[string]uint32 { "messages.botCallbackAnswer": 0x36585ea4, "messages.messageEditData": 0x26b5dde6, "inputBotInlineMessageID": 0x890c3d89, + "inputBotInlineMessageID64": 0xb6d915d7, "inlineBotSwitchPM": 0x3c20629f, "messages.peerDialogs": 0x3371c354, "topPeer": 0xedcdc05b, @@ -1933,9 +1941,9 @@ func NamesMap() map[string]uint32 { "draftMessageEmpty": 0x1b0c841a, "draftMessage": 0xfd8e711f, "messages.featuredStickersNotModified": 0xc6dc0c66, - "messages.featuredStickers": 0xb6abc341, + "messages.featuredStickers": 0x84c02310, "messages.recentStickersNotModified": 0xb17f890, - "messages.recentStickers": 0x22f3afb3, + "messages.recentStickers": 0x88d37c56, "messages.archivedStickers": 0x4fcba9c8, "messages.stickerSetInstallResultSuccess": 0x38641628, "messages.stickerSetInstallResultArchive": 0x35e410a8, @@ -1947,7 +1955,7 @@ func NamesMap() map[string]uint32 { "game": 0xbdf9653b, "inputGameID": 0x32c3e77, "inputGameShortName": 0xc331e80a, - "highScore": 0x58fffcd0, + "highScore": 0x73a379eb, "messages.highScores": 0x9a3bfd99, "textEmpty": 0xdc3d824f, "textPlain": 0x744694e0, @@ -2011,11 +2019,11 @@ func NamesMap() map[string]uint32 { "inputWebFileLocation": 0xc239d686, "inputWebFileGeoPointLocation": 0x9f2221c9, "upload.webFile": 0x21e753bc, - "payments.paymentForm": 0x8d0b2415, + "payments.paymentForm": 0x1694761b, "payments.validatedRequestedInfo": 0xd1451883, "payments.paymentResult": 0x4e5f810d, "payments.paymentVerificationNeeded": 0xd8411139, - "payments.paymentReceipt": 0x10b555d0, + "payments.paymentReceipt": 0x70c4fe03, "payments.savedInfo": 0xfb8fe43c, "inputPaymentCredentialsSaved": 0xc10eb2cf, "inputPaymentCredentials": 0x3417d728, @@ -2026,10 +2034,10 @@ func NamesMap() map[string]uint32 { "inputStickerSetItem": 0xffa0a496, "inputPhoneCall": 0x1e36fded, "phoneCallEmpty": 0x5366c915, - "phoneCallWaiting": 0x1b8f4ad1, - "phoneCallRequested": 0x87eabb53, - "phoneCallAccepted": 0x997c454a, - "phoneCall": 0x8742ae7f, + "phoneCallWaiting": 0xc5226f17, + "phoneCallRequested": 0x14b0ed0c, + "phoneCallAccepted": 0x3660c311, + "phoneCall": 0x967f7c67, "phoneCallDiscarded": 0x50ca4de1, "phoneConnection": 0x9d4c17c0, "phoneConnectionWebrtc": 0x635fe375, @@ -2062,7 +2070,7 @@ func NamesMap() map[string]uint32 { "channelAdminLogEventActionTogglePreHistoryHidden": 0x5f5c95f1, "channelAdminLogEventActionDefaultBannedRights": 0x2df5fc0a, "channelAdminLogEventActionStopPoll": 0x8f079643, - "channelAdminLogEventActionChangeLinkedChat": 0xa26f881b, + "channelAdminLogEventActionChangeLinkedChat": 0x50c7ac8, "channelAdminLogEventActionChangeLocation": 0xe6b76ae, "channelAdminLogEventActionToggleSlowMode": 0x53909779, "channelAdminLogEventActionStartGroupCall": 0x23209745, @@ -2076,21 +2084,20 @@ func NamesMap() map[string]uint32 { "channelAdminLogEventActionExportedInviteEdit": 0xe90ebb59, "channelAdminLogEventActionParticipantVolume": 0x3e7f6847, "channelAdminLogEventActionChangeHistoryTTL": 0x6e941a38, - "channelAdminLogEventActionChangeTheme": 0xfe69018d, - "channelAdminLogEvent": 0x3b5a3e40, + "channelAdminLogEvent": 0x1fad68cd, "channels.adminLogResults": 0xed8af74d, "channelAdminLogEventsFilter": 0xea107ae4, "popularContact": 0x5ce14175, "messages.favedStickersNotModified": 0x9e8fa6d3, - "messages.favedStickers": 0xf37f2f16, + "messages.favedStickers": 0x2cb51097, "recentMeUrlUnknown": 0x46e1d13d, - "recentMeUrlUser": 0x8dbc3336, - "recentMeUrlChat": 0xa01b22f9, + "recentMeUrlUser": 0xb92c09e2, + "recentMeUrlChat": 0xb2da71d2, "recentMeUrlChatInvite": 0xeb49081d, "recentMeUrlStickerSet": 0xbc0a57dc, "help.recentMeUrls": 0xe0310d7, "inputSingleMedia": 0x1cc6e91f, - "webAuthorization": 0xcac943f2, + "webAuthorization": 0xa6f8f452, "account.webAuthorizations": 0xed56c9fc, "inputMessageID": 0xa676a322, "inputMessageReplyTo": 0xbad88395, @@ -2101,7 +2108,7 @@ func NamesMap() map[string]uint32 { "dialogPeer": 0xe56dbf05, "dialogPeerFolder": 0x514519e2, "messages.foundStickerSetsNotModified": 0xd54b65d, - "messages.foundStickerSets": 0x5108d648, + "messages.foundStickerSets": 0x8af09dd2, "fileHash": 0x6242c773, "inputClientProxy": 0x75588b3f, "help.termsOfServiceUpdateEmpty": 0xe3309f7f, @@ -2180,7 +2187,7 @@ func NamesMap() map[string]uint32 { "pollAnswer": 0x6ca9c2e9, "poll": 0x86e18161, "pollAnswerVoters": 0x3b6ddad2, - "pollResults": 0xbadcc1a3, + "pollResults": 0xdcb82ea3, "chatOnlines": 0xf041e250, "statsURL": 0x47a971e0, "chatAdminRights": 0x5fb224d5, @@ -2189,7 +2196,7 @@ func NamesMap() map[string]uint32 { "inputWallPaperSlug": 0x72091c80, "inputWallPaperNoFile": 0x967a462e, "account.wallPapersNotModified": 0x1c199183, - "account.wallPapers": 0x702b65a9, + "account.wallPapers": 0xcdc3858c, "codeSettings": 0xdebebe83, "wallPaperSettings": 0x1dc1bca4, "autoDownloadSettings": 0xe04232f3, @@ -2215,7 +2222,7 @@ func NamesMap() map[string]uint32 { "inputThemeSlug": 0xf5890df1, "theme": 0xe802b8dc, "account.themesNotModified": 0xf41eb622, - "account.themes": 0x7f676421, + "account.themes": 0x9a3d8c6d, "auth.loginToken": 0x629f1980, "auth.loginTokenMigrateTo": 0x68e9916, "auth.loginTokenSuccess": 0x390d5c5e, @@ -2226,12 +2233,12 @@ func NamesMap() map[string]uint32 { "baseThemeNight": 0xb7b31ea8, "baseThemeTinted": 0x6d5f77ee, "baseThemeArctic": 0x5b11125a, - "inputThemeSettings": 0xff38f912, - "themeSettings": 0x8db4e76c, + "inputThemeSettings": 0x8fde504f, + "themeSettings": 0xfa58b6d4, "webPageAttributeTheme": 0x54b56617, - "messageUserVote": 0xa28e5559, - "messageUserVoteInputOption": 0x36377430, - "messageUserVoteMultiple": 0xe8fe0de, + "messageUserVote": 0x34d247b4, + "messageUserVoteInputOption": 0x3ca5b0ec, + "messageUserVoteMultiple": 0x8a65e557, "messages.votesList": 0x823f649, "bankCardOpenUrl": 0xf568028a, "payments.bankCardData": 0x3e24e573, @@ -2248,9 +2255,9 @@ func NamesMap() map[string]uint32 { "help.promoDataEmpty": 0x98f6ac75, "help.promoData": 0x8c39793f, "videoSize": 0xde33b094, - "statsGroupTopPoster": 0x18f3d0f7, - "statsGroupTopAdmin": 0x6014f412, - "statsGroupTopInviter": 0x31962a4c, + "statsGroupTopPoster": 0x9d04af9b, + "statsGroupTopAdmin": 0xd7584c87, + "statsGroupTopInviter": 0x535f779d, "stats.megagroupStats": 0xef7ff916, "globalPrivacySettings": 0xbea2f424, "help.countryCode": 0x4203c5ef, @@ -2261,7 +2268,7 @@ func NamesMap() map[string]uint32 { "messages.messageViews": 0xb6c4f543, "messages.discussionMessage": 0xa6341782, "messageReplyHeader": 0xa6d57763, - "messageReplies": 0x4128faac, + "messageReplies": 0x83d60fc2, "peerBlocked": 0xe8fd8014, "stats.messageStats": 0x8999f295, "groupCallDiscarded": 0x7780bcb4, @@ -2278,12 +2285,12 @@ func NamesMap() map[string]uint32 { "messages.historyImport": 0x1662af0b, "messages.historyImportParsed": 0x5e0fb7b9, "messages.affectedFoundMessages": 0xef8d3e6c, - "chatInviteImporter": 0x1e3e6680, + "chatInviteImporter": 0xb5cd5f4, "messages.exportedChatInvites": 0xbdc62dcc, "messages.exportedChatInvite": 0x1871be50, "messages.exportedChatInviteReplaced": 0x222600ef, "messages.chatInviteImporters": 0x81b6b00a, - "chatAdminWithInvites": 0xdfd2330f, + "chatAdminWithInvites": 0xf2ecef23, "messages.chatAdminsWithInvites": 0xb69b72d7, "messages.checkedHistoryImportPeer": 0xa24de717, "phone.joinAsPeers": 0xafe5623f, @@ -2319,7 +2326,7 @@ func NamesMap() map[string]uint32 { "auth.logOut": 0x5717da40, "auth.resetAuthorizations": 0x9fab0d1a, "auth.exportAuthorization": 0xe5bfffcd, - "auth.importAuthorization": 0xe3ef9613, + "auth.importAuthorization": 0xa57a7dad, "auth.bindTempAuthKey": 0xcdd42a05, "auth.importBotAuthorization": 0x67a3ff2c, "auth.checkPassword": 0xd18b4d16, @@ -2328,18 +2335,18 @@ func NamesMap() map[string]uint32 { "auth.resendCode": 0x3ef1a9bf, "auth.cancelCode": 0x1f040578, "auth.dropTempAuthKeys": 0x8e48a188, - "auth.exportLoginToken": 0xb1b41517, + "auth.exportLoginToken": 0xb7e085fe, "auth.importLoginToken": 0x95ac5ce4, "auth.acceptLoginToken": 0xe894ad4d, "auth.checkRecoveryPassword": 0xd36bf79, - "account.registerDevice": 0x68976c6f, - "account.unregisterDevice": 0x3076c4bf, + "account.registerDevice": 0xec86017a, + "account.unregisterDevice": 0x6a0d3206, "account.updateNotifySettings": 0x84be5b93, "account.getNotifySettings": 0x12b3ad31, "account.resetNotifySettings": 0xdb7e1747, "account.updateProfile": 0x78515775, "account.updateStatus": 0x6628562c, - "account.getWallPapers": 0xaabb1763, + "account.getWallPapers": 0x7967d36, "account.reportPeer": 0xc5ba3d86, "account.checkUsername": 0x2714d86c, "account.updateUsername": 0x3e0bdd7c, @@ -2366,8 +2373,8 @@ func NamesMap() map[string]uint32 { "account.getSecureValue": 0x73665bc2, "account.saveSecureValue": 0x899fe31d, "account.deleteSecureValue": 0xb880bc4b, - "account.getAuthorizationForm": 0xb86ba8e1, - "account.acceptAuthorization": 0xe7027c94, + "account.getAuthorizationForm": 0xa929597a, + "account.acceptAuthorization": 0xf3ed4c73, "account.sendVerifyPhoneCode": 0xa5a356f9, "account.verifyPhone": 0x4dd3a7f6, "account.sendVerifyEmailCode": 0x7011509f, @@ -2393,7 +2400,7 @@ func NamesMap() map[string]uint32 { "account.saveTheme": 0xf257106c, "account.installTheme": 0x7ae43737, "account.getTheme": 0x8d9d742b, - "account.getThemes": 0x285946f8, + "account.getThemes": 0x7206e458, "account.setContentSettings": 0xb574b16b, "account.getContentSettings": 0x8b9b4dae, "account.getMultiWallPapers": 0x65ad71dc, @@ -2406,9 +2413,9 @@ func NamesMap() map[string]uint32 { "users.getUsers": 0xd91a548, "users.getFullUser": 0xca30a5b1, "users.setSecureValueErrors": 0x90c894b5, - "contacts.getContactIDs": 0x2caa4a42, + "contacts.getContactIDs": 0x7adc669d, "contacts.getStatuses": 0xc4a353ee, - "contacts.getContacts": 0xc023849f, + "contacts.getContacts": 0x5dd69e12, "contacts.importContacts": 0x2c800be5, "contacts.deleteContacts": 0x96a0e00, "contacts.deleteByPhones": 0x1013fd9e, @@ -2417,7 +2424,7 @@ func NamesMap() map[string]uint32 { "contacts.getBlocked": 0xf57c350f, "contacts.search": 0x11f812d8, "contacts.resolveUsername": 0xf93ccba3, - "contacts.getTopPeers": 0xd4982db5, + "contacts.getTopPeers": 0x973478b6, "contacts.resetTopPeerRating": 0x1ae373ac, "contacts.resetSaved": 0x879537f1, "contacts.getSaved": 0x82f1e39f, @@ -2427,9 +2434,9 @@ func NamesMap() map[string]uint32 { "contacts.getLocated": 0xd348bc44, "contacts.blockFromReplies": 0x29a8962c, "messages.getMessages": 0x63c66506, - "messages.getDialogs": 0xa0ee3b73, - "messages.getHistory": 0xdcbb8260, - "messages.search": 0xc352eec, + "messages.getDialogs": 0xa0f4cb4f, + "messages.getHistory": 0x4423e6c5, + "messages.search": 0xa0fda762, "messages.readHistory": 0xe306d3a, "messages.deleteHistory": 0x1c015b09, "messages.deleteMessages": 0xe58e95d2, @@ -2441,12 +2448,12 @@ func NamesMap() map[string]uint32 { "messages.reportSpam": 0xcf1592db, "messages.getPeerSettings": 0x3672e09c, "messages.report": 0x8953ab4e, - "messages.getChats": 0x3c6aa187, - "messages.getFullChat": 0x3b831c66, - "messages.editChatTitle": 0xdc452855, - "messages.editChatPhoto": 0xca4c79d8, - "messages.addChatUser": 0xf9a0aa09, - "messages.deleteChatUser": 0xc534459a, + "messages.getChats": 0x49e9528f, + "messages.getFullChat": 0xaeb00b34, + "messages.editChatTitle": 0x73783ffd, + "messages.editChatPhoto": 0x35ddd674, + "messages.addChatUser": 0xf24753e3, + "messages.deleteChatUser": 0xa2185cab, "messages.createChat": 0x9cb126e, "messages.getDhConfig": 0x26cf8950, "messages.requestEncryption": 0xf64daf43, @@ -2460,8 +2467,8 @@ func NamesMap() map[string]uint32 { "messages.receivedQueue": 0x55a5bb66, "messages.reportEncryptedSpam": 0x4b0c8c0f, "messages.readMessageContents": 0x36a73f77, - "messages.getStickers": 0x43d4f2c, - "messages.getAllStickers": 0x1c9618b1, + "messages.getStickers": 0xd5a5d3a1, + "messages.getAllStickers": 0xb8a0a1a8, "messages.getWebPagePreview": 0x8b68b0cc, "messages.exportChatInvite": 0x14b9bcd7, "messages.checkChatInvite": 0x3eadb1bb, @@ -2471,12 +2478,12 @@ func NamesMap() map[string]uint32 { "messages.uninstallStickerSet": 0xf96e55de, "messages.startBot": 0xe6df7378, "messages.getMessagesViews": 0x5784d3e1, - "messages.editChatAdmin": 0xa9e69f2e, - "messages.migrateChat": 0x15a3b8e3, + "messages.editChatAdmin": 0xa85bd1c2, + "messages.migrateChat": 0xa2875319, "messages.searchGlobal": 0x4bc6589a, "messages.reorderStickerSets": 0x78337739, "messages.getDocumentByHash": 0x338e2464, - "messages.getSavedGifs": 0x83bf3d52, + "messages.getSavedGifs": 0x5cf09635, "messages.saveGif": 0x327a30cb, "messages.getInlineBotResults": 0x514e999d, "messages.setInlineBotResults": 0xeb5ea206, @@ -2489,20 +2496,20 @@ func NamesMap() map[string]uint32 { "messages.getPeerDialogs": 0xe470bcfd, "messages.saveDraft": 0xbc39e14b, "messages.getAllDrafts": 0x6a3f8d65, - "messages.getFeaturedStickers": 0x2dacca4f, + "messages.getFeaturedStickers": 0x64780b14, "messages.readFeaturedStickers": 0x5b118126, - "messages.getRecentStickers": 0x5ea192c9, + "messages.getRecentStickers": 0x9da9403b, "messages.saveRecentSticker": 0x392718f8, "messages.clearRecentStickers": 0x8999602d, "messages.getArchivedStickers": 0x57f17692, - "messages.getMaskStickers": 0x65b8c79f, + "messages.getMaskStickers": 0x640f82b8, "messages.getAttachedStickers": 0xcc5b67cc, "messages.setGameScore": 0x8ef8ecc0, "messages.setInlineGameScore": 0x15ad9f64, "messages.getGameHighScores": 0xe822649d, "messages.getInlineGameHighScores": 0xf635e1b, - "messages.getCommonChats": 0xd0a48c4, - "messages.getAllChats": 0xeba80ff0, + "messages.getCommonChats": 0xe40ca104, + "messages.getAllChats": 0x875f74be, "messages.getWebPage": 0x32ca8f91, "messages.toggleDialogPin": 0xa731e257, "messages.reorderPinnedDialogs": 0x3b1adf37, @@ -2511,14 +2518,14 @@ func NamesMap() map[string]uint32 { "messages.setBotPrecheckoutResults": 0x9c2dd95, "messages.uploadMedia": 0x519bc2b1, "messages.sendScreenshotNotification": 0xc97df020, - "messages.getFavedStickers": 0x21ce0b0e, + "messages.getFavedStickers": 0x4f1aaa9, "messages.faveSticker": 0xb9ffc55b, "messages.getUnreadMentions": 0x46578472, "messages.readMentions": 0xf0189d3, - "messages.getRecentLocations": 0xbbc45b09, + "messages.getRecentLocations": 0x702a40e0, "messages.sendMultiMedia": 0xcc0110cb, "messages.uploadEncryptedFile": 0x5057c497, - "messages.searchStickerSets": 0xc2b7d08b, + "messages.searchStickerSets": 0x35705b8a, "messages.getSplitRanges": 0x1cff7e08, "messages.markDialogUnread": 0xc286d98f, "messages.getDialogUnreadMarks": 0x22e24e22, @@ -2538,7 +2545,7 @@ func NamesMap() map[string]uint32 { "messages.requestUrlAuth": 0x198fb446, "messages.acceptUrlAuth": 0xb12c7125, "messages.hidePeerSettingsBar": 0x4facb138, - "messages.getScheduledHistory": 0xe2c2685b, + "messages.getScheduledHistory": 0xf516760b, "messages.getScheduledMessages": 0xbdbb0464, "messages.sendScheduledMessages": 0xbd38850a, "messages.deleteScheduledMessages": 0x59ae2b16, @@ -2548,12 +2555,12 @@ func NamesMap() map[string]uint32 { "messages.getSuggestedDialogFilters": 0xa29cd42c, "messages.updateDialogFilter": 0x1ad4a04a, "messages.updateDialogFiltersOrder": 0xc563c1e4, - "messages.getOldFeaturedStickers": 0x5fe7025b, - "messages.getReplies": 0x24b581ba, + "messages.getOldFeaturedStickers": 0x7ed094a1, + "messages.getReplies": 0x22ddd30c, "messages.getDiscussionMessage": 0x446972fd, "messages.readDiscussion": 0xf731a9f4, "messages.unpinAllMessages": 0xf025bc8b, - "messages.deleteChat": 0x83247d11, + "messages.deleteChat": 0x5bd0ee50, "messages.deletePhoneCallHistory": 0xf9cbe409, "messages.checkHistoryImport": 0x43fe19f3, "messages.initHistoryImport": 0x34090c3b, @@ -2569,6 +2576,7 @@ func NamesMap() map[string]uint32 { "messages.setHistoryTTL": 0xb80e5fe4, "messages.checkHistoryImportPeer": 0x5dc60f03, "messages.setChatTheme": 0xe63be13f, + "messages.getMessageReadParticipants": 0x2c6f97b7, "updates.getState": 0xedd4882a, "updates.getDifference": 0x25939651, "updates.getChannelDifference": 0x3173d78, @@ -2611,7 +2619,7 @@ func NamesMap() map[string]uint32 { "channels.deleteUserHistory": 0xd10dd71b, "channels.reportSpam": 0xfe087810, "channels.getMessages": 0xad8c9a23, - "channels.getParticipants": 0x123e05e9, + "channels.getParticipants": 0x77ced9d0, "channels.getParticipant": 0xa0ab6cc6, "channels.getChannels": 0xa7f6bbb, "channels.getFullChannel": 0x8736a09, @@ -2728,15 +2736,15 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0xf9b7b23d: func() bin.Object { return &TestUseConfigSimpleRequest{} }, 0x7f3b18ea: func() bin.Object { return &InputPeerEmpty{} }, 0x7da07ec9: func() bin.Object { return &InputPeerSelf{} }, - 0x179be863: func() bin.Object { return &InputPeerChat{} }, - 0x7b8e7de6: func() bin.Object { return &InputPeerUser{} }, - 0x20adaef8: func() bin.Object { return &InputPeerChannel{} }, - 0x17bae2e6: func() bin.Object { return &InputPeerUserFromMessage{} }, - 0x9c95f7bb: func() bin.Object { return &InputPeerChannelFromMessage{} }, + 0x35a95cb9: func() bin.Object { return &InputPeerChat{} }, + 0xdde8a54c: func() bin.Object { return &InputPeerUser{} }, + 0x27bcbbfc: func() bin.Object { return &InputPeerChannel{} }, + 0xa87b0a1c: func() bin.Object { return &InputPeerUserFromMessage{} }, + 0xbd2a0840: func() bin.Object { return &InputPeerChannelFromMessage{} }, 0xb98886cf: func() bin.Object { return &InputUserEmpty{} }, 0xf7c1b13f: func() bin.Object { return &InputUserSelf{} }, - 0xd8292816: func() bin.Object { return &InputUser{} }, - 0x2d117597: func() bin.Object { return &InputUserFromMessage{} }, + 0xf21158c6: func() bin.Object { return &InputUser{} }, + 0x1da448e2: func() bin.Object { return &InputUserFromMessage{} }, 0xf392b7f4: func() bin.Object { return &InputPhoneContact{} }, 0xf52ff27f: func() bin.Object { return &InputFile{} }, 0xfa4f0bb5: func() bin.Object { return &InputFileBig{} }, @@ -2772,9 +2780,9 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0x37257e99: func() bin.Object { return &InputPeerPhotoFileLocation{} }, 0x9d84f3db: func() bin.Object { return &InputStickerSetThumb{} }, 0x598a92a: func() bin.Object { return &InputGroupCallStream{} }, - 0x9db1bc6d: func() bin.Object { return &PeerUser{} }, - 0xbad0e5bb: func() bin.Object { return &PeerChat{} }, - 0xbddde532: func() bin.Object { return &PeerChannel{} }, + 0x59511722: func() bin.Object { return &PeerUser{} }, + 0x36c6019a: func() bin.Object { return &PeerChat{} }, + 0xa2a5371e: func() bin.Object { return &PeerChannel{} }, 0xaa963b05: func() bin.Object { return &StorageFileUnknown{} }, 0x40bc6f52: func() bin.Object { return &StorageFilePartial{} }, 0x7efe0e: func() bin.Object { return &StorageFileJpeg{} }, @@ -2785,8 +2793,8 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0x4b09ebbc: func() bin.Object { return &StorageFileMov{} }, 0xb3cea0e4: func() bin.Object { return &StorageFileMp4{} }, 0x1081464c: func() bin.Object { return &StorageFileWebp{} }, - 0x200250ba: func() bin.Object { return &UserEmpty{} }, - 0x938458c1: func() bin.Object { return &User{} }, + 0xd3bc4b7a: func() bin.Object { return &UserEmpty{} }, + 0x3ff6ecb0: func() bin.Object { return &User{} }, 0x4f11bae1: func() bin.Object { return &UserProfilePhotoEmpty{} }, 0x82d1f706: func() bin.Object { return &UserProfilePhoto{} }, 0x9d05049: func() bin.Object { return &UserStatusEmpty{} }, @@ -2795,27 +2803,27 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0xe26f42f1: func() bin.Object { return &UserStatusRecently{} }, 0x7bf09fc: func() bin.Object { return &UserStatusLastWeek{} }, 0x77ebc742: func() bin.Object { return &UserStatusLastMonth{} }, - 0x9ba2d800: func() bin.Object { return &ChatEmpty{} }, - 0x3bda1bde: func() bin.Object { return &Chat{} }, - 0x7328bdb: func() bin.Object { return &ChatForbidden{} }, - 0xd31a961e: func() bin.Object { return &Channel{} }, - 0x289da732: func() bin.Object { return &ChannelForbidden{} }, - 0x49a0a5d9: func() bin.Object { return &ChatFull{} }, - 0x2f532f3c: func() bin.Object { return &ChannelFull{} }, - 0xc8d7493e: func() bin.Object { return &ChatParticipant{} }, - 0xda13538a: func() bin.Object { return &ChatParticipantCreator{} }, - 0xe2d6e436: func() bin.Object { return &ChatParticipantAdmin{} }, - 0xfc900c2b: func() bin.Object { return &ChatParticipantsForbidden{} }, - 0x3f460fed: func() bin.Object { return &ChatParticipants{} }, + 0x29562865: func() bin.Object { return &ChatEmpty{} }, + 0x41cbf256: func() bin.Object { return &Chat{} }, + 0x6592a1a7: func() bin.Object { return &ChatForbidden{} }, + 0x8261ac61: func() bin.Object { return &Channel{} }, + 0x17d493d5: func() bin.Object { return &ChannelForbidden{} }, + 0x4dbdc099: func() bin.Object { return &ChatFull{} }, + 0xe9b27a17: func() bin.Object { return &ChannelFull{} }, + 0xc02d4007: func() bin.Object { return &ChatParticipant{} }, + 0xe46bcee4: func() bin.Object { return &ChatParticipantCreator{} }, + 0xa0933f5b: func() bin.Object { return &ChatParticipantAdmin{} }, + 0x8763d3e1: func() bin.Object { return &ChatParticipantsForbidden{} }, + 0x3cbc93f8: func() bin.Object { return &ChatParticipants{} }, 0x37c1011c: func() bin.Object { return &ChatPhotoEmpty{} }, 0x1c6e1c11: func() bin.Object { return &ChatPhoto{} }, 0x90a6ca84: func() bin.Object { return &MessageEmpty{} }, - 0xbce383d2: func() bin.Object { return &Message{} }, + 0x85d6cbe2: func() bin.Object { return &Message{} }, 0x2b085862: func() bin.Object { return &MessageService{} }, 0x3ded6320: func() bin.Object { return &MessageMediaEmpty{} }, 0x695150d7: func() bin.Object { return &MessageMediaPhoto{} }, 0x56e0d474: func() bin.Object { return &MessageMediaGeo{} }, - 0xcbf24940: func() bin.Object { return &MessageMediaContact{} }, + 0x70322949: func() bin.Object { return &MessageMediaContact{} }, 0x9f84f49e: func() bin.Object { return &MessageMediaUnsupported{} }, 0x9cb070d7: func() bin.Object { return &MessageMediaDocument{} }, 0xa32dd600: func() bin.Object { return &MessageMediaWebPage{} }, @@ -2826,16 +2834,16 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0x4bd6e798: func() bin.Object { return &MessageMediaPoll{} }, 0x3f7ee58b: func() bin.Object { return &MessageMediaDice{} }, 0xb6aef7b0: func() bin.Object { return &MessageActionEmpty{} }, - 0xa6638b9a: func() bin.Object { return &MessageActionChatCreate{} }, + 0xbd47cbad: func() bin.Object { return &MessageActionChatCreate{} }, 0xb5a1ce5a: func() bin.Object { return &MessageActionChatEditTitle{} }, 0x7fcb13a8: func() bin.Object { return &MessageActionChatEditPhoto{} }, 0x95e3fbef: func() bin.Object { return &MessageActionChatDeletePhoto{} }, - 0x488a7337: func() bin.Object { return &MessageActionChatAddUser{} }, - 0xb2ae9b0c: func() bin.Object { return &MessageActionChatDeleteUser{} }, - 0xf89cf5e8: func() bin.Object { return &MessageActionChatJoinedByLink{} }, + 0x15cefd00: func() bin.Object { return &MessageActionChatAddUser{} }, + 0xa43f30cc: func() bin.Object { return &MessageActionChatDeleteUser{} }, + 0x31224c3: func() bin.Object { return &MessageActionChatJoinedByLink{} }, 0x95d2ac92: func() bin.Object { return &MessageActionChannelCreate{} }, - 0x51bdb021: func() bin.Object { return &MessageActionChatMigrateTo{} }, - 0xb055eaee: func() bin.Object { return &MessageActionChannelMigrateFrom{} }, + 0xe1037f92: func() bin.Object { return &MessageActionChatMigrateTo{} }, + 0xea3948e9: func() bin.Object { return &MessageActionChannelMigrateFrom{} }, 0x94bd38ed: func() bin.Object { return &MessageActionPinMessage{} }, 0x9fbab604: func() bin.Object { return &MessageActionHistoryClear{} }, 0x92a72876: func() bin.Object { return &MessageActionGameScore{} }, @@ -2850,7 +2858,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0xf3f25f76: func() bin.Object { return &MessageActionContactSignUp{} }, 0x98e0d697: func() bin.Object { return &MessageActionGeoProximityReached{} }, 0x7a0d7f42: func() bin.Object { return &MessageActionGroupCall{} }, - 0x76b9f11a: func() bin.Object { return &MessageActionInviteToGroupCall{} }, + 0x502f92f7: func() bin.Object { return &MessageActionInviteToGroupCall{} }, 0xaa1afbfd: func() bin.Object { return &MessageActionSetMessagesTTL{} }, 0xb3a07661: func() bin.Object { return &MessageActionGroupCallScheduled{} }, 0xaa786345: func() bin.Object { return &MessageActionSetChatTheme{} }, @@ -2869,7 +2877,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0x5e002502: func() bin.Object { return &AuthSentCode{} }, 0xcd050916: func() bin.Object { return &AuthAuthorization{} }, 0x44747e9a: func() bin.Object { return &AuthAuthorizationSignUpRequired{} }, - 0xdf969c2d: func() bin.Object { return &AuthExportedAuthorization{} }, + 0xb434e2b8: func() bin.Object { return &AuthExportedAuthorization{} }, 0xb8bc5b0c: func() bin.Object { return &InputNotifyPeer{} }, 0x193b4417: func() bin.Object { return &InputNotifyUsers{} }, 0x4a95e84e: func() bin.Object { return &InputNotifyChats{} }, @@ -2888,9 +2896,9 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0xdbd4feed: func() bin.Object { return &InputReportReasonGeoIrrelevant{} }, 0xf5ddd6e7: func() bin.Object { return &InputReportReasonFake{} }, 0xd697ff05: func() bin.Object { return &UserFull{} }, - 0xf911c994: func() bin.Object { return &Contact{} }, - 0xd0028438: func() bin.Object { return &ImportedContact{} }, - 0xd3680c61: func() bin.Object { return &ContactStatus{} }, + 0x145ade0b: func() bin.Object { return &Contact{} }, + 0xc13e3c50: func() bin.Object { return &ImportedContact{} }, + 0x16d9703b: func() bin.Object { return &ContactStatus{} }, 0xb74ba9d2: func() bin.Object { return &ContactsContactsNotModified{} }, 0xeae87e42: func() bin.Object { return &ContactsContacts{} }, 0x77d01c3b: func() bin.Object { return &ContactsImportedContacts{} }, @@ -2927,64 +2935,64 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0x1f2b0afd: func() bin.Object { return &UpdateNewMessage{} }, 0x4e90bfd6: func() bin.Object { return &UpdateMessageID{} }, 0xa20db0e5: func() bin.Object { return &UpdateDeleteMessages{} }, - 0x5c486927: func() bin.Object { return &UpdateUserTyping{} }, - 0x86cadb6c: func() bin.Object { return &UpdateChatUserTyping{} }, + 0xc01e857f: func() bin.Object { return &UpdateUserTyping{} }, + 0x83487af0: func() bin.Object { return &UpdateChatUserTyping{} }, 0x7761198: func() bin.Object { return &UpdateChatParticipants{} }, - 0x1bfbd823: func() bin.Object { return &UpdateUserStatus{} }, - 0xa7332b73: func() bin.Object { return &UpdateUserName{} }, - 0x95313b0c: func() bin.Object { return &UpdateUserPhoto{} }, + 0xe5bdf8de: func() bin.Object { return &UpdateUserStatus{} }, + 0xc3f202e0: func() bin.Object { return &UpdateUserName{} }, + 0xf227868c: func() bin.Object { return &UpdateUserPhoto{} }, 0x12bcbd9a: func() bin.Object { return &UpdateNewEncryptedMessage{} }, 0x1710f156: func() bin.Object { return &UpdateEncryptedChatTyping{} }, 0xb4a2e88d: func() bin.Object { return &UpdateEncryption{} }, 0x38fe25b7: func() bin.Object { return &UpdateEncryptedMessagesRead{} }, - 0xea4b0e5c: func() bin.Object { return &UpdateChatParticipantAdd{} }, - 0x6e5f8c22: func() bin.Object { return &UpdateChatParticipantDelete{} }, + 0x3dda5451: func() bin.Object { return &UpdateChatParticipantAdd{} }, + 0xe32f3d77: func() bin.Object { return &UpdateChatParticipantDelete{} }, 0x8e5e9873: func() bin.Object { return &UpdateDCOptions{} }, 0xbec268ef: func() bin.Object { return &UpdateNotifySettings{} }, 0xebe46819: func() bin.Object { return &UpdateServiceNotification{} }, 0xee3b272a: func() bin.Object { return &UpdatePrivacy{} }, - 0x12b9417b: func() bin.Object { return &UpdateUserPhone{} }, + 0x5492a13: func() bin.Object { return &UpdateUserPhone{} }, 0x9c974fdf: func() bin.Object { return &UpdateReadHistoryInbox{} }, 0x2f2f21bf: func() bin.Object { return &UpdateReadHistoryOutbox{} }, 0x7f891213: func() bin.Object { return &UpdateWebPage{} }, 0x68c13933: func() bin.Object { return &UpdateReadMessagesContents{} }, - 0xeb0467fb: func() bin.Object { return &UpdateChannelTooLong{} }, - 0xb6d45656: func() bin.Object { return &UpdateChannel{} }, + 0x108d941f: func() bin.Object { return &UpdateChannelTooLong{} }, + 0x635b4c09: func() bin.Object { return &UpdateChannel{} }, 0x62ba04d9: func() bin.Object { return &UpdateNewChannelMessage{} }, - 0x330b5424: func() bin.Object { return &UpdateReadChannelInbox{} }, - 0xc37521c9: func() bin.Object { return &UpdateDeleteChannelMessages{} }, - 0x98a12b4b: func() bin.Object { return &UpdateChannelMessageViews{} }, - 0xb6901959: func() bin.Object { return &UpdateChatParticipantAdmin{} }, + 0x922e6e10: func() bin.Object { return &UpdateReadChannelInbox{} }, + 0xc32d5b12: func() bin.Object { return &UpdateDeleteChannelMessages{} }, + 0xf226ac08: func() bin.Object { return &UpdateChannelMessageViews{} }, + 0xd7ca61a2: func() bin.Object { return &UpdateChatParticipantAdmin{} }, 0x688a30aa: func() bin.Object { return &UpdateNewStickerSet{} }, 0xbb2d201: func() bin.Object { return &UpdateStickerSetsOrder{} }, 0x43ae3dec: func() bin.Object { return &UpdateStickerSets{} }, 0x9375341e: func() bin.Object { return &UpdateSavedGifs{} }, - 0x3f2038db: func() bin.Object { return &UpdateBotInlineQuery{} }, - 0xe48f964: func() bin.Object { return &UpdateBotInlineSend{} }, + 0x496f379c: func() bin.Object { return &UpdateBotInlineQuery{} }, + 0x12f12a07: func() bin.Object { return &UpdateBotInlineSend{} }, 0x1b3f4df7: func() bin.Object { return &UpdateEditChannelMessage{} }, - 0xe73547e1: func() bin.Object { return &UpdateBotCallbackQuery{} }, + 0xb9cfc48d: func() bin.Object { return &UpdateBotCallbackQuery{} }, 0xe40370a3: func() bin.Object { return &UpdateEditMessage{} }, - 0xf9d27a5a: func() bin.Object { return &UpdateInlineBotCallbackQuery{} }, - 0x25d6c9c7: func() bin.Object { return &UpdateReadChannelOutbox{} }, + 0x691e9052: func() bin.Object { return &UpdateInlineBotCallbackQuery{} }, + 0xb75f99a9: func() bin.Object { return &UpdateReadChannelOutbox{} }, 0xee2bb969: func() bin.Object { return &UpdateDraftMessage{} }, 0x571d2742: func() bin.Object { return &UpdateReadFeaturedStickers{} }, 0x9a422c20: func() bin.Object { return &UpdateRecentStickers{} }, 0xa229dd06: func() bin.Object { return &UpdateConfig{} }, 0x3354678f: func() bin.Object { return &UpdatePtsChanged{} }, - 0x40771900: func() bin.Object { return &UpdateChannelWebPage{} }, + 0x2f2ba99f: func() bin.Object { return &UpdateChannelWebPage{} }, 0x6e6fe51c: func() bin.Object { return &UpdateDialogPinned{} }, 0xfa0f3ca2: func() bin.Object { return &UpdatePinnedDialogs{} }, 0x8317c0c3: func() bin.Object { return &UpdateBotWebhookJSON{} }, 0x9b9240a6: func() bin.Object { return &UpdateBotWebhookJSONQuery{} }, - 0xe0cdc940: func() bin.Object { return &UpdateBotShippingQuery{} }, - 0x5d2f3aa9: func() bin.Object { return &UpdateBotPrecheckoutQuery{} }, + 0xb5aefd7d: func() bin.Object { return &UpdateBotShippingQuery{} }, + 0x8caa9a96: func() bin.Object { return &UpdateBotPrecheckoutQuery{} }, 0xab0f6b1e: func() bin.Object { return &UpdatePhoneCall{} }, 0x46560264: func() bin.Object { return &UpdateLangPackTooLong{} }, 0x56022f4d: func() bin.Object { return &UpdateLangPack{} }, 0xe511996d: func() bin.Object { return &UpdateFavedStickers{} }, - 0x89893b45: func() bin.Object { return &UpdateChannelReadMessagesContents{} }, + 0x44bdd535: func() bin.Object { return &UpdateChannelReadMessagesContents{} }, 0x7084a7be: func() bin.Object { return &UpdateContactsReset{} }, - 0x70db6837: func() bin.Object { return &UpdateChannelAvailableMessages{} }, + 0xb23fc698: func() bin.Object { return &UpdateChannelAvailableMessages{} }, 0xe16459c3: func() bin.Object { return &UpdateDialogUnreadMark{} }, 0xaca1657b: func() bin.Object { return &UpdateMessagePoll{} }, 0x54c01850: func() bin.Object { return &UpdateChatDefaultBannedRights{} }, @@ -2996,35 +3004,35 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0x8216fba3: func() bin.Object { return &UpdateTheme{} }, 0x871fb939: func() bin.Object { return &UpdateGeoLiveViewed{} }, 0x564fe691: func() bin.Object { return &UpdateLoginToken{} }, - 0x37f69f0b: func() bin.Object { return &UpdateMessagePollVote{} }, + 0x106395c9: func() bin.Object { return &UpdateMessagePollVote{} }, 0x26ffde7d: func() bin.Object { return &UpdateDialogFilter{} }, 0xa5d72105: func() bin.Object { return &UpdateDialogFilterOrder{} }, 0x3504914f: func() bin.Object { return &UpdateDialogFilters{} }, 0x2661bf09: func() bin.Object { return &UpdatePhoneCallSignalingData{} }, - 0x6e8a84df: func() bin.Object { return &UpdateChannelMessageForwards{} }, - 0x1cc7de54: func() bin.Object { return &UpdateReadChannelDiscussionInbox{} }, - 0x4638a26c: func() bin.Object { return &UpdateReadChannelDiscussionOutbox{} }, + 0xd29a27f4: func() bin.Object { return &UpdateChannelMessageForwards{} }, + 0xd6b19546: func() bin.Object { return &UpdateReadChannelDiscussionInbox{} }, + 0x695c9e7c: func() bin.Object { return &UpdateReadChannelDiscussionOutbox{} }, 0x246a4b22: func() bin.Object { return &UpdatePeerBlocked{} }, - 0x6b171718: func() bin.Object { return &UpdateChannelUserTyping{} }, + 0x8c88c923: func() bin.Object { return &UpdateChannelUserTyping{} }, 0xed85eab5: func() bin.Object { return &UpdatePinnedMessages{} }, - 0x8588878b: func() bin.Object { return &UpdatePinnedChannelMessages{} }, - 0x1330a196: func() bin.Object { return &UpdateChat{} }, + 0x5bb98608: func() bin.Object { return &UpdatePinnedChannelMessages{} }, + 0xf89a6a4e: func() bin.Object { return &UpdateChat{} }, 0xf2ebdb4e: func() bin.Object { return &UpdateGroupCallParticipants{} }, - 0xa45eb99b: func() bin.Object { return &UpdateGroupCall{} }, + 0x14b24500: func() bin.Object { return &UpdateGroupCall{} }, 0xbb9bb9a5: func() bin.Object { return &UpdatePeerHistoryTTL{} }, - 0xf3b3781f: func() bin.Object { return &UpdateChatParticipant{} }, - 0x7fecb1ec: func() bin.Object { return &UpdateChannelParticipant{} }, - 0x7f9488a: func() bin.Object { return &UpdateBotStopped{} }, + 0xd087663a: func() bin.Object { return &UpdateChatParticipant{} }, + 0x985d3abb: func() bin.Object { return &UpdateChannelParticipant{} }, + 0xc4870a49: func() bin.Object { return &UpdateBotStopped{} }, 0xb783982: func() bin.Object { return &UpdateGroupCallConnection{} }, - 0xcf7e0873: func() bin.Object { return &UpdateBotCommands{} }, + 0x4d712f2e: func() bin.Object { return &UpdateBotCommands{} }, 0xa56c2a3e: func() bin.Object { return &UpdatesState{} }, 0x5d75a138: func() bin.Object { return &UpdatesDifferenceEmpty{} }, 0xf49ca0: func() bin.Object { return &UpdatesDifference{} }, 0xa8fb1981: func() bin.Object { return &UpdatesDifferenceSlice{} }, 0x4afe8f6d: func() bin.Object { return &UpdatesDifferenceTooLong{} }, 0xe317af7e: func() bin.Object { return &UpdatesTooLong{} }, - 0xfaeff833: func() bin.Object { return &UpdateShortMessage{} }, - 0x1157b858: func() bin.Object { return &UpdateShortChatMessage{} }, + 0x313bc7f8: func() bin.Object { return &UpdateShortMessage{} }, + 0x4d6deea5: func() bin.Object { return &UpdateShortChatMessage{} }, 0x78d4dec1: func() bin.Object { return &UpdateShort{} }, 0x725b04c3: func() bin.Object { return &UpdatesCombined{} }, 0x74ae4240: func() bin.Object { return &Updates{} }, @@ -3041,9 +3049,9 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0xc45a6536: func() bin.Object { return &HelpNoAppUpdate{} }, 0x18cb9f78: func() bin.Object { return &HelpInviteText{} }, 0xab7ec0a0: func() bin.Object { return &EncryptedChatEmpty{} }, - 0x3bf703dc: func() bin.Object { return &EncryptedChatWaiting{} }, - 0x62718a82: func() bin.Object { return &EncryptedChatRequested{} }, - 0xfa56ce36: func() bin.Object { return &EncryptedChat{} }, + 0x66b25953: func() bin.Object { return &EncryptedChatWaiting{} }, + 0x48f1d94c: func() bin.Object { return &EncryptedChatRequested{} }, + 0x61f0d4c7: func() bin.Object { return &EncryptedChat{} }, 0x1e1c7c45: func() bin.Object { return &EncryptedChatDiscarded{} }, 0xf141b5e1: func() bin.Object { return &InputEncryptedChat{} }, 0xc21f497e: func() bin.Object { return &EncryptedFileEmpty{} }, @@ -3083,6 +3091,8 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0xd92c2285: func() bin.Object { return &SpeakingInGroupCallAction{} }, 0xdbda9246: func() bin.Object { return &SendMessageHistoryImportAction{} }, 0xb05ac6b1: func() bin.Object { return &SendMessageChooseStickerAction{} }, + 0x25972bcb: func() bin.Object { return &SendMessageEmojiInteraction{} }, + 0xb665902e: func() bin.Object { return &SendMessageEmojiInteractionSeen{} }, 0xb3134d9d: func() bin.Object { return &ContactsFound{} }, 0x4f96cb18: func() bin.Object { return &InputPrivacyKeyStatusTimestamp{} }, 0xbdfb0426: func() bin.Object { return &InputPrivacyKeyChatInvite{} }, @@ -3106,16 +3116,16 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0xba52007: func() bin.Object { return &InputPrivacyValueDisallowContacts{} }, 0xd66b66c9: func() bin.Object { return &InputPrivacyValueDisallowAll{} }, 0x90110467: func() bin.Object { return &InputPrivacyValueDisallowUsers{} }, - 0x4c81c1ba: func() bin.Object { return &InputPrivacyValueAllowChatParticipants{} }, - 0xd82363af: func() bin.Object { return &InputPrivacyValueDisallowChatParticipants{} }, + 0x840649cf: func() bin.Object { return &InputPrivacyValueAllowChatParticipants{} }, + 0xe94f0f86: func() bin.Object { return &InputPrivacyValueDisallowChatParticipants{} }, 0xfffe1bac: func() bin.Object { return &PrivacyValueAllowContacts{} }, 0x65427b82: func() bin.Object { return &PrivacyValueAllowAll{} }, - 0x4d5bbe0c: func() bin.Object { return &PrivacyValueAllowUsers{} }, + 0xb8905fb2: func() bin.Object { return &PrivacyValueAllowUsers{} }, 0xf888fa1a: func() bin.Object { return &PrivacyValueDisallowContacts{} }, 0x8b73e763: func() bin.Object { return &PrivacyValueDisallowAll{} }, - 0xc7f49b7: func() bin.Object { return &PrivacyValueDisallowUsers{} }, - 0x18be796b: func() bin.Object { return &PrivacyValueAllowChatParticipants{} }, - 0xacae0690: func() bin.Object { return &PrivacyValueDisallowChatParticipants{} }, + 0xe4621141: func() bin.Object { return &PrivacyValueDisallowUsers{} }, + 0x6b134e8e: func() bin.Object { return &PrivacyValueAllowChatParticipants{} }, + 0x41c87565: func() bin.Object { return &PrivacyValueDisallowChatParticipants{} }, 0x50a04e45: func() bin.Object { return &AccountPrivacyRules{} }, 0xb8d0afdf: func() bin.Object { return &AccountDaysTTL{} }, 0x6c37c15c: func() bin.Object { return &DocumentAttributeImageSize{} }, @@ -3126,10 +3136,10 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0x15590068: func() bin.Object { return &DocumentAttributeFilename{} }, 0x9801d2f7: func() bin.Object { return &DocumentAttributeHasStickers{} }, 0xf1749a22: func() bin.Object { return &MessagesStickersNotModified{} }, - 0xe4599bbd: func() bin.Object { return &MessagesStickers{} }, + 0x30a6ec7e: func() bin.Object { return &MessagesStickers{} }, 0x12b299d4: func() bin.Object { return &StickerPack{} }, 0xe86602c3: func() bin.Object { return &MessagesAllStickersNotModified{} }, - 0xedfd405f: func() bin.Object { return &MessagesAllStickers{} }, + 0xcdbbcebb: func() bin.Object { return &MessagesAllStickers{} }, 0x84d19185: func() bin.Object { return &MessagesAffectedMessages{} }, 0xeb1477e8: func() bin.Object { return &WebPageEmpty{} }, 0xc586da1c: func() bin.Object { return &WebPagePending{} }, @@ -3142,7 +3152,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0xc23727c9: func() bin.Object { return &AccountPasswordInputSettings{} }, 0x137948a5: func() bin.Object { return &AuthPasswordRecovery{} }, 0xa384b779: func() bin.Object { return &ReceivedNotifyMessage{} }, - 0x6e24fc9d: func() bin.Object { return &ChatInviteExported{} }, + 0xb18105e8: func() bin.Object { return &ChatInviteExported{} }, 0x5a686d7c: func() bin.Object { return &ChatInviteAlready{} }, 0xdfc2f58e: func() bin.Object { return &ChatInvite{} }, 0x61695cb0: func() bin.Object { return &ChatInvitePeek{} }, @@ -3151,10 +3161,11 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0x861cc8a0: func() bin.Object { return &InputStickerSetShortName{} }, 0x28703c8: func() bin.Object { return &InputStickerSetAnimatedEmoji{} }, 0xe67f520e: func() bin.Object { return &InputStickerSetDice{} }, + 0xcde3739: func() bin.Object { return &InputStickerSetAnimatedEmojiAnimations{} }, 0xd7df217a: func() bin.Object { return &StickerSet{} }, 0xb60a24a6: func() bin.Object { return &MessagesStickerSet{} }, 0xc27ac8c7: func() bin.Object { return &BotCommand{} }, - 0x98e81d3a: func() bin.Object { return &BotInfo{} }, + 0x1b74b335: func() bin.Object { return &BotInfo{} }, 0xa2fa4880: func() bin.Object { return &KeyboardButton{} }, 0x258aff05: func() bin.Object { return &KeyboardButtonURL{} }, 0x35bbdb6b: func() bin.Object { return &KeyboardButtonCallback{} }, @@ -3182,7 +3193,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0x28a20571: func() bin.Object { return &MessageEntityCode{} }, 0x73924be0: func() bin.Object { return &MessageEntityPre{} }, 0x76a6d327: func() bin.Object { return &MessageEntityTextURL{} }, - 0x352dca58: func() bin.Object { return &MessageEntityMentionName{} }, + 0xdc7b1140: func() bin.Object { return &MessageEntityMentionName{} }, 0x208e68c9: func() bin.Object { return &InputMessageEntityMentionName{} }, 0x9b69e34b: func() bin.Object { return &MessageEntityPhone{} }, 0x4c4e743f: func() bin.Object { return &MessageEntityCashtag{} }, @@ -3191,8 +3202,8 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0x20df5d0: func() bin.Object { return &MessageEntityBlockquote{} }, 0x761e6af4: func() bin.Object { return &MessageEntityBankCard{} }, 0xee8c1e86: func() bin.Object { return &InputChannelEmpty{} }, - 0xafeb712e: func() bin.Object { return &InputChannel{} }, - 0x2a286531: func() bin.Object { return &InputChannelFromMessage{} }, + 0xf35aec28: func() bin.Object { return &InputChannel{} }, + 0x5b934f9d: func() bin.Object { return &InputChannelFromMessage{} }, 0x7f077ad9: func() bin.Object { return &ContactsResolvedPeer{} }, 0xae30253: func() bin.Object { return &MessageRange{} }, 0x3e11affb: func() bin.Object { return &UpdatesChannelDifferenceEmpty{} }, @@ -3200,11 +3211,11 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0x2064674e: func() bin.Object { return &UpdatesChannelDifference{} }, 0x94d42ee7: func() bin.Object { return &ChannelMessagesFilterEmpty{} }, 0xcd77d957: func() bin.Object { return &ChannelMessagesFilter{} }, - 0x15ebac1d: func() bin.Object { return &ChannelParticipant{} }, - 0xa3289a6d: func() bin.Object { return &ChannelParticipantSelf{} }, - 0x447dca4b: func() bin.Object { return &ChannelParticipantCreator{} }, - 0xccbebbaf: func() bin.Object { return &ChannelParticipantAdmin{} }, - 0x50a1dfd6: func() bin.Object { return &ChannelParticipantBanned{} }, + 0xc00c07c0: func() bin.Object { return &ChannelParticipant{} }, + 0x28a8bc67: func() bin.Object { return &ChannelParticipantSelf{} }, + 0x2fe601d3: func() bin.Object { return &ChannelParticipantCreator{} }, + 0x34c3bb53: func() bin.Object { return &ChannelParticipantAdmin{} }, + 0x6df8014e: func() bin.Object { return &ChannelParticipantBanned{} }, 0x1b03f006: func() bin.Object { return &ChannelParticipantLeft{} }, 0xde3f3c79: func() bin.Object { return &ChannelParticipantsRecent{} }, 0xb4608969: func() bin.Object { return &ChannelParticipantsAdmins{} }, @@ -3219,7 +3230,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0xdfb80317: func() bin.Object { return &ChannelsChannelParticipant{} }, 0x780a0310: func() bin.Object { return &HelpTermsOfService{} }, 0xe8025ca2: func() bin.Object { return &MessagesSavedGifsNotModified{} }, - 0x2e0709a5: func() bin.Object { return &MessagesSavedGifs{} }, + 0x84a02a0d: func() bin.Object { return &MessagesSavedGifs{} }, 0x3380c786: func() bin.Object { return &InputBotInlineMessageMediaAuto{} }, 0x3dcd7a87: func() bin.Object { return &InputBotInlineMessageText{} }, 0x96929a85: func() bin.Object { return &InputBotInlineMessageMediaGeo{} }, @@ -3252,6 +3263,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0x36585ea4: func() bin.Object { return &MessagesBotCallbackAnswer{} }, 0x26b5dde6: func() bin.Object { return &MessagesMessageEditData{} }, 0x890c3d89: func() bin.Object { return &InputBotInlineMessageID{} }, + 0xb6d915d7: func() bin.Object { return &InputBotInlineMessageID64{} }, 0x3c20629f: func() bin.Object { return &InlineBotSwitchPM{} }, 0x3371c354: func() bin.Object { return &MessagesPeerDialogs{} }, 0xedcdc05b: func() bin.Object { return &TopPeer{} }, @@ -3270,9 +3282,9 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0x1b0c841a: func() bin.Object { return &DraftMessageEmpty{} }, 0xfd8e711f: func() bin.Object { return &DraftMessage{} }, 0xc6dc0c66: func() bin.Object { return &MessagesFeaturedStickersNotModified{} }, - 0xb6abc341: func() bin.Object { return &MessagesFeaturedStickers{} }, + 0x84c02310: func() bin.Object { return &MessagesFeaturedStickers{} }, 0xb17f890: func() bin.Object { return &MessagesRecentStickersNotModified{} }, - 0x22f3afb3: func() bin.Object { return &MessagesRecentStickers{} }, + 0x88d37c56: func() bin.Object { return &MessagesRecentStickers{} }, 0x4fcba9c8: func() bin.Object { return &MessagesArchivedStickers{} }, 0x38641628: func() bin.Object { return &MessagesStickerSetInstallResultSuccess{} }, 0x35e410a8: func() bin.Object { return &MessagesStickerSetInstallResultArchive{} }, @@ -3284,7 +3296,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0xbdf9653b: func() bin.Object { return &Game{} }, 0x32c3e77: func() bin.Object { return &InputGameID{} }, 0xc331e80a: func() bin.Object { return &InputGameShortName{} }, - 0x58fffcd0: func() bin.Object { return &HighScore{} }, + 0x73a379eb: func() bin.Object { return &HighScore{} }, 0x9a3bfd99: func() bin.Object { return &MessagesHighScores{} }, 0xdc3d824f: func() bin.Object { return &TextEmpty{} }, 0x744694e0: func() bin.Object { return &TextPlain{} }, @@ -3348,11 +3360,11 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0xc239d686: func() bin.Object { return &InputWebFileLocation{} }, 0x9f2221c9: func() bin.Object { return &InputWebFileGeoPointLocation{} }, 0x21e753bc: func() bin.Object { return &UploadWebFile{} }, - 0x8d0b2415: func() bin.Object { return &PaymentsPaymentForm{} }, + 0x1694761b: func() bin.Object { return &PaymentsPaymentForm{} }, 0xd1451883: func() bin.Object { return &PaymentsValidatedRequestedInfo{} }, 0x4e5f810d: func() bin.Object { return &PaymentsPaymentResult{} }, 0xd8411139: func() bin.Object { return &PaymentsPaymentVerificationNeeded{} }, - 0x10b555d0: func() bin.Object { return &PaymentsPaymentReceipt{} }, + 0x70c4fe03: func() bin.Object { return &PaymentsPaymentReceipt{} }, 0xfb8fe43c: func() bin.Object { return &PaymentsSavedInfo{} }, 0xc10eb2cf: func() bin.Object { return &InputPaymentCredentialsSaved{} }, 0x3417d728: func() bin.Object { return &InputPaymentCredentials{} }, @@ -3363,10 +3375,10 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0xffa0a496: func() bin.Object { return &InputStickerSetItem{} }, 0x1e36fded: func() bin.Object { return &InputPhoneCall{} }, 0x5366c915: func() bin.Object { return &PhoneCallEmpty{} }, - 0x1b8f4ad1: func() bin.Object { return &PhoneCallWaiting{} }, - 0x87eabb53: func() bin.Object { return &PhoneCallRequested{} }, - 0x997c454a: func() bin.Object { return &PhoneCallAccepted{} }, - 0x8742ae7f: func() bin.Object { return &PhoneCall{} }, + 0xc5226f17: func() bin.Object { return &PhoneCallWaiting{} }, + 0x14b0ed0c: func() bin.Object { return &PhoneCallRequested{} }, + 0x3660c311: func() bin.Object { return &PhoneCallAccepted{} }, + 0x967f7c67: func() bin.Object { return &PhoneCall{} }, 0x50ca4de1: func() bin.Object { return &PhoneCallDiscarded{} }, 0x9d4c17c0: func() bin.Object { return &PhoneConnection{} }, 0x635fe375: func() bin.Object { return &PhoneConnectionWebrtc{} }, @@ -3399,7 +3411,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0x5f5c95f1: func() bin.Object { return &ChannelAdminLogEventActionTogglePreHistoryHidden{} }, 0x2df5fc0a: func() bin.Object { return &ChannelAdminLogEventActionDefaultBannedRights{} }, 0x8f079643: func() bin.Object { return &ChannelAdminLogEventActionStopPoll{} }, - 0xa26f881b: func() bin.Object { return &ChannelAdminLogEventActionChangeLinkedChat{} }, + 0x50c7ac8: func() bin.Object { return &ChannelAdminLogEventActionChangeLinkedChat{} }, 0xe6b76ae: func() bin.Object { return &ChannelAdminLogEventActionChangeLocation{} }, 0x53909779: func() bin.Object { return &ChannelAdminLogEventActionToggleSlowMode{} }, 0x23209745: func() bin.Object { return &ChannelAdminLogEventActionStartGroupCall{} }, @@ -3413,21 +3425,20 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0xe90ebb59: func() bin.Object { return &ChannelAdminLogEventActionExportedInviteEdit{} }, 0x3e7f6847: func() bin.Object { return &ChannelAdminLogEventActionParticipantVolume{} }, 0x6e941a38: func() bin.Object { return &ChannelAdminLogEventActionChangeHistoryTTL{} }, - 0xfe69018d: func() bin.Object { return &ChannelAdminLogEventActionChangeTheme{} }, - 0x3b5a3e40: func() bin.Object { return &ChannelAdminLogEvent{} }, + 0x1fad68cd: func() bin.Object { return &ChannelAdminLogEvent{} }, 0xed8af74d: func() bin.Object { return &ChannelsAdminLogResults{} }, 0xea107ae4: func() bin.Object { return &ChannelAdminLogEventsFilter{} }, 0x5ce14175: func() bin.Object { return &PopularContact{} }, 0x9e8fa6d3: func() bin.Object { return &MessagesFavedStickersNotModified{} }, - 0xf37f2f16: func() bin.Object { return &MessagesFavedStickers{} }, + 0x2cb51097: func() bin.Object { return &MessagesFavedStickers{} }, 0x46e1d13d: func() bin.Object { return &RecentMeURLUnknown{} }, - 0x8dbc3336: func() bin.Object { return &RecentMeURLUser{} }, - 0xa01b22f9: func() bin.Object { return &RecentMeURLChat{} }, + 0xb92c09e2: func() bin.Object { return &RecentMeURLUser{} }, + 0xb2da71d2: func() bin.Object { return &RecentMeURLChat{} }, 0xeb49081d: func() bin.Object { return &RecentMeURLChatInvite{} }, 0xbc0a57dc: func() bin.Object { return &RecentMeURLStickerSet{} }, 0xe0310d7: func() bin.Object { return &HelpRecentMeURLs{} }, 0x1cc6e91f: func() bin.Object { return &InputSingleMedia{} }, - 0xcac943f2: func() bin.Object { return &WebAuthorization{} }, + 0xa6f8f452: func() bin.Object { return &WebAuthorization{} }, 0xed56c9fc: func() bin.Object { return &AccountWebAuthorizations{} }, 0xa676a322: func() bin.Object { return &InputMessageID{} }, 0xbad88395: func() bin.Object { return &InputMessageReplyTo{} }, @@ -3438,7 +3449,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0xe56dbf05: func() bin.Object { return &DialogPeer{} }, 0x514519e2: func() bin.Object { return &DialogPeerFolder{} }, 0xd54b65d: func() bin.Object { return &MessagesFoundStickerSetsNotModified{} }, - 0x5108d648: func() bin.Object { return &MessagesFoundStickerSets{} }, + 0x8af09dd2: func() bin.Object { return &MessagesFoundStickerSets{} }, 0x6242c773: func() bin.Object { return &FileHash{} }, 0x75588b3f: func() bin.Object { return &InputClientProxy{} }, 0xe3309f7f: func() bin.Object { return &HelpTermsOfServiceUpdateEmpty{} }, @@ -3517,7 +3528,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0x6ca9c2e9: func() bin.Object { return &PollAnswer{} }, 0x86e18161: func() bin.Object { return &Poll{} }, 0x3b6ddad2: func() bin.Object { return &PollAnswerVoters{} }, - 0xbadcc1a3: func() bin.Object { return &PollResults{} }, + 0xdcb82ea3: func() bin.Object { return &PollResults{} }, 0xf041e250: func() bin.Object { return &ChatOnlines{} }, 0x47a971e0: func() bin.Object { return &StatsURL{} }, 0x5fb224d5: func() bin.Object { return &ChatAdminRights{} }, @@ -3526,7 +3537,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0x72091c80: func() bin.Object { return &InputWallPaperSlug{} }, 0x967a462e: func() bin.Object { return &InputWallPaperNoFile{} }, 0x1c199183: func() bin.Object { return &AccountWallPapersNotModified{} }, - 0x702b65a9: func() bin.Object { return &AccountWallPapers{} }, + 0xcdc3858c: func() bin.Object { return &AccountWallPapers{} }, 0xdebebe83: func() bin.Object { return &CodeSettings{} }, 0x1dc1bca4: func() bin.Object { return &WallPaperSettings{} }, 0xe04232f3: func() bin.Object { return &AutoDownloadSettings{} }, @@ -3552,7 +3563,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0xf5890df1: func() bin.Object { return &InputThemeSlug{} }, 0xe802b8dc: func() bin.Object { return &Theme{} }, 0xf41eb622: func() bin.Object { return &AccountThemesNotModified{} }, - 0x7f676421: func() bin.Object { return &AccountThemes{} }, + 0x9a3d8c6d: func() bin.Object { return &AccountThemes{} }, 0x629f1980: func() bin.Object { return &AuthLoginToken{} }, 0x68e9916: func() bin.Object { return &AuthLoginTokenMigrateTo{} }, 0x390d5c5e: func() bin.Object { return &AuthLoginTokenSuccess{} }, @@ -3563,12 +3574,12 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0xb7b31ea8: func() bin.Object { return &BaseThemeNight{} }, 0x6d5f77ee: func() bin.Object { return &BaseThemeTinted{} }, 0x5b11125a: func() bin.Object { return &BaseThemeArctic{} }, - 0xff38f912: func() bin.Object { return &InputThemeSettings{} }, - 0x8db4e76c: func() bin.Object { return &ThemeSettings{} }, + 0x8fde504f: func() bin.Object { return &InputThemeSettings{} }, + 0xfa58b6d4: func() bin.Object { return &ThemeSettings{} }, 0x54b56617: func() bin.Object { return &WebPageAttributeTheme{} }, - 0xa28e5559: func() bin.Object { return &MessageUserVote{} }, - 0x36377430: func() bin.Object { return &MessageUserVoteInputOption{} }, - 0xe8fe0de: func() bin.Object { return &MessageUserVoteMultiple{} }, + 0x34d247b4: func() bin.Object { return &MessageUserVote{} }, + 0x3ca5b0ec: func() bin.Object { return &MessageUserVoteInputOption{} }, + 0x8a65e557: func() bin.Object { return &MessageUserVoteMultiple{} }, 0x823f649: func() bin.Object { return &MessagesVotesList{} }, 0xf568028a: func() bin.Object { return &BankCardOpenURL{} }, 0x3e24e573: func() bin.Object { return &PaymentsBankCardData{} }, @@ -3585,9 +3596,9 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0x98f6ac75: func() bin.Object { return &HelpPromoDataEmpty{} }, 0x8c39793f: func() bin.Object { return &HelpPromoData{} }, 0xde33b094: func() bin.Object { return &VideoSize{} }, - 0x18f3d0f7: func() bin.Object { return &StatsGroupTopPoster{} }, - 0x6014f412: func() bin.Object { return &StatsGroupTopAdmin{} }, - 0x31962a4c: func() bin.Object { return &StatsGroupTopInviter{} }, + 0x9d04af9b: func() bin.Object { return &StatsGroupTopPoster{} }, + 0xd7584c87: func() bin.Object { return &StatsGroupTopAdmin{} }, + 0x535f779d: func() bin.Object { return &StatsGroupTopInviter{} }, 0xef7ff916: func() bin.Object { return &StatsMegagroupStats{} }, 0xbea2f424: func() bin.Object { return &GlobalPrivacySettings{} }, 0x4203c5ef: func() bin.Object { return &HelpCountryCode{} }, @@ -3598,7 +3609,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0xb6c4f543: func() bin.Object { return &MessagesMessageViews{} }, 0xa6341782: func() bin.Object { return &MessagesDiscussionMessage{} }, 0xa6d57763: func() bin.Object { return &MessageReplyHeader{} }, - 0x4128faac: func() bin.Object { return &MessageReplies{} }, + 0x83d60fc2: func() bin.Object { return &MessageReplies{} }, 0xe8fd8014: func() bin.Object { return &PeerBlocked{} }, 0x8999f295: func() bin.Object { return &StatsMessageStats{} }, 0x7780bcb4: func() bin.Object { return &GroupCallDiscarded{} }, @@ -3615,12 +3626,12 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0x1662af0b: func() bin.Object { return &MessagesHistoryImport{} }, 0x5e0fb7b9: func() bin.Object { return &MessagesHistoryImportParsed{} }, 0xef8d3e6c: func() bin.Object { return &MessagesAffectedFoundMessages{} }, - 0x1e3e6680: func() bin.Object { return &ChatInviteImporter{} }, + 0xb5cd5f4: func() bin.Object { return &ChatInviteImporter{} }, 0xbdc62dcc: func() bin.Object { return &MessagesExportedChatInvites{} }, 0x1871be50: func() bin.Object { return &MessagesExportedChatInvite{} }, 0x222600ef: func() bin.Object { return &MessagesExportedChatInviteReplaced{} }, 0x81b6b00a: func() bin.Object { return &MessagesChatInviteImporters{} }, - 0xdfd2330f: func() bin.Object { return &ChatAdminWithInvites{} }, + 0xf2ecef23: func() bin.Object { return &ChatAdminWithInvites{} }, 0xb69b72d7: func() bin.Object { return &MessagesChatAdminsWithInvites{} }, 0xa24de717: func() bin.Object { return &MessagesCheckedHistoryImportPeer{} }, 0xafe5623f: func() bin.Object { return &PhoneJoinAsPeers{} }, @@ -3656,7 +3667,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0x5717da40: func() bin.Object { return &AuthLogOutRequest{} }, 0x9fab0d1a: func() bin.Object { return &AuthResetAuthorizationsRequest{} }, 0xe5bfffcd: func() bin.Object { return &AuthExportAuthorizationRequest{} }, - 0xe3ef9613: func() bin.Object { return &AuthImportAuthorizationRequest{} }, + 0xa57a7dad: func() bin.Object { return &AuthImportAuthorizationRequest{} }, 0xcdd42a05: func() bin.Object { return &AuthBindTempAuthKeyRequest{} }, 0x67a3ff2c: func() bin.Object { return &AuthImportBotAuthorizationRequest{} }, 0xd18b4d16: func() bin.Object { return &AuthCheckPasswordRequest{} }, @@ -3665,18 +3676,18 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0x3ef1a9bf: func() bin.Object { return &AuthResendCodeRequest{} }, 0x1f040578: func() bin.Object { return &AuthCancelCodeRequest{} }, 0x8e48a188: func() bin.Object { return &AuthDropTempAuthKeysRequest{} }, - 0xb1b41517: func() bin.Object { return &AuthExportLoginTokenRequest{} }, + 0xb7e085fe: func() bin.Object { return &AuthExportLoginTokenRequest{} }, 0x95ac5ce4: func() bin.Object { return &AuthImportLoginTokenRequest{} }, 0xe894ad4d: func() bin.Object { return &AuthAcceptLoginTokenRequest{} }, 0xd36bf79: func() bin.Object { return &AuthCheckRecoveryPasswordRequest{} }, - 0x68976c6f: func() bin.Object { return &AccountRegisterDeviceRequest{} }, - 0x3076c4bf: func() bin.Object { return &AccountUnregisterDeviceRequest{} }, + 0xec86017a: func() bin.Object { return &AccountRegisterDeviceRequest{} }, + 0x6a0d3206: func() bin.Object { return &AccountUnregisterDeviceRequest{} }, 0x84be5b93: func() bin.Object { return &AccountUpdateNotifySettingsRequest{} }, 0x12b3ad31: func() bin.Object { return &AccountGetNotifySettingsRequest{} }, 0xdb7e1747: func() bin.Object { return &AccountResetNotifySettingsRequest{} }, 0x78515775: func() bin.Object { return &AccountUpdateProfileRequest{} }, 0x6628562c: func() bin.Object { return &AccountUpdateStatusRequest{} }, - 0xaabb1763: func() bin.Object { return &AccountGetWallPapersRequest{} }, + 0x7967d36: func() bin.Object { return &AccountGetWallPapersRequest{} }, 0xc5ba3d86: func() bin.Object { return &AccountReportPeerRequest{} }, 0x2714d86c: func() bin.Object { return &AccountCheckUsernameRequest{} }, 0x3e0bdd7c: func() bin.Object { return &AccountUpdateUsernameRequest{} }, @@ -3703,8 +3714,8 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0x73665bc2: func() bin.Object { return &AccountGetSecureValueRequest{} }, 0x899fe31d: func() bin.Object { return &AccountSaveSecureValueRequest{} }, 0xb880bc4b: func() bin.Object { return &AccountDeleteSecureValueRequest{} }, - 0xb86ba8e1: func() bin.Object { return &AccountGetAuthorizationFormRequest{} }, - 0xe7027c94: func() bin.Object { return &AccountAcceptAuthorizationRequest{} }, + 0xa929597a: func() bin.Object { return &AccountGetAuthorizationFormRequest{} }, + 0xf3ed4c73: func() bin.Object { return &AccountAcceptAuthorizationRequest{} }, 0xa5a356f9: func() bin.Object { return &AccountSendVerifyPhoneCodeRequest{} }, 0x4dd3a7f6: func() bin.Object { return &AccountVerifyPhoneRequest{} }, 0x7011509f: func() bin.Object { return &AccountSendVerifyEmailCodeRequest{} }, @@ -3730,7 +3741,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0xf257106c: func() bin.Object { return &AccountSaveThemeRequest{} }, 0x7ae43737: func() bin.Object { return &AccountInstallThemeRequest{} }, 0x8d9d742b: func() bin.Object { return &AccountGetThemeRequest{} }, - 0x285946f8: func() bin.Object { return &AccountGetThemesRequest{} }, + 0x7206e458: func() bin.Object { return &AccountGetThemesRequest{} }, 0xb574b16b: func() bin.Object { return &AccountSetContentSettingsRequest{} }, 0x8b9b4dae: func() bin.Object { return &AccountGetContentSettingsRequest{} }, 0x65ad71dc: func() bin.Object { return &AccountGetMultiWallPapersRequest{} }, @@ -3743,9 +3754,9 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0xd91a548: func() bin.Object { return &UsersGetUsersRequest{} }, 0xca30a5b1: func() bin.Object { return &UsersGetFullUserRequest{} }, 0x90c894b5: func() bin.Object { return &UsersSetSecureValueErrorsRequest{} }, - 0x2caa4a42: func() bin.Object { return &ContactsGetContactIDsRequest{} }, + 0x7adc669d: func() bin.Object { return &ContactsGetContactIDsRequest{} }, 0xc4a353ee: func() bin.Object { return &ContactsGetStatusesRequest{} }, - 0xc023849f: func() bin.Object { return &ContactsGetContactsRequest{} }, + 0x5dd69e12: func() bin.Object { return &ContactsGetContactsRequest{} }, 0x2c800be5: func() bin.Object { return &ContactsImportContactsRequest{} }, 0x96a0e00: func() bin.Object { return &ContactsDeleteContactsRequest{} }, 0x1013fd9e: func() bin.Object { return &ContactsDeleteByPhonesRequest{} }, @@ -3754,7 +3765,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0xf57c350f: func() bin.Object { return &ContactsGetBlockedRequest{} }, 0x11f812d8: func() bin.Object { return &ContactsSearchRequest{} }, 0xf93ccba3: func() bin.Object { return &ContactsResolveUsernameRequest{} }, - 0xd4982db5: func() bin.Object { return &ContactsGetTopPeersRequest{} }, + 0x973478b6: func() bin.Object { return &ContactsGetTopPeersRequest{} }, 0x1ae373ac: func() bin.Object { return &ContactsResetTopPeerRatingRequest{} }, 0x879537f1: func() bin.Object { return &ContactsResetSavedRequest{} }, 0x82f1e39f: func() bin.Object { return &ContactsGetSavedRequest{} }, @@ -3764,9 +3775,9 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0xd348bc44: func() bin.Object { return &ContactsGetLocatedRequest{} }, 0x29a8962c: func() bin.Object { return &ContactsBlockFromRepliesRequest{} }, 0x63c66506: func() bin.Object { return &MessagesGetMessagesRequest{} }, - 0xa0ee3b73: func() bin.Object { return &MessagesGetDialogsRequest{} }, - 0xdcbb8260: func() bin.Object { return &MessagesGetHistoryRequest{} }, - 0xc352eec: func() bin.Object { return &MessagesSearchRequest{} }, + 0xa0f4cb4f: func() bin.Object { return &MessagesGetDialogsRequest{} }, + 0x4423e6c5: func() bin.Object { return &MessagesGetHistoryRequest{} }, + 0xa0fda762: func() bin.Object { return &MessagesSearchRequest{} }, 0xe306d3a: func() bin.Object { return &MessagesReadHistoryRequest{} }, 0x1c015b09: func() bin.Object { return &MessagesDeleteHistoryRequest{} }, 0xe58e95d2: func() bin.Object { return &MessagesDeleteMessagesRequest{} }, @@ -3778,12 +3789,12 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0xcf1592db: func() bin.Object { return &MessagesReportSpamRequest{} }, 0x3672e09c: func() bin.Object { return &MessagesGetPeerSettingsRequest{} }, 0x8953ab4e: func() bin.Object { return &MessagesReportRequest{} }, - 0x3c6aa187: func() bin.Object { return &MessagesGetChatsRequest{} }, - 0x3b831c66: func() bin.Object { return &MessagesGetFullChatRequest{} }, - 0xdc452855: func() bin.Object { return &MessagesEditChatTitleRequest{} }, - 0xca4c79d8: func() bin.Object { return &MessagesEditChatPhotoRequest{} }, - 0xf9a0aa09: func() bin.Object { return &MessagesAddChatUserRequest{} }, - 0xc534459a: func() bin.Object { return &MessagesDeleteChatUserRequest{} }, + 0x49e9528f: func() bin.Object { return &MessagesGetChatsRequest{} }, + 0xaeb00b34: func() bin.Object { return &MessagesGetFullChatRequest{} }, + 0x73783ffd: func() bin.Object { return &MessagesEditChatTitleRequest{} }, + 0x35ddd674: func() bin.Object { return &MessagesEditChatPhotoRequest{} }, + 0xf24753e3: func() bin.Object { return &MessagesAddChatUserRequest{} }, + 0xa2185cab: func() bin.Object { return &MessagesDeleteChatUserRequest{} }, 0x9cb126e: func() bin.Object { return &MessagesCreateChatRequest{} }, 0x26cf8950: func() bin.Object { return &MessagesGetDhConfigRequest{} }, 0xf64daf43: func() bin.Object { return &MessagesRequestEncryptionRequest{} }, @@ -3797,8 +3808,8 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0x55a5bb66: func() bin.Object { return &MessagesReceivedQueueRequest{} }, 0x4b0c8c0f: func() bin.Object { return &MessagesReportEncryptedSpamRequest{} }, 0x36a73f77: func() bin.Object { return &MessagesReadMessageContentsRequest{} }, - 0x43d4f2c: func() bin.Object { return &MessagesGetStickersRequest{} }, - 0x1c9618b1: func() bin.Object { return &MessagesGetAllStickersRequest{} }, + 0xd5a5d3a1: func() bin.Object { return &MessagesGetStickersRequest{} }, + 0xb8a0a1a8: func() bin.Object { return &MessagesGetAllStickersRequest{} }, 0x8b68b0cc: func() bin.Object { return &MessagesGetWebPagePreviewRequest{} }, 0x14b9bcd7: func() bin.Object { return &MessagesExportChatInviteRequest{} }, 0x3eadb1bb: func() bin.Object { return &MessagesCheckChatInviteRequest{} }, @@ -3808,12 +3819,12 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0xf96e55de: func() bin.Object { return &MessagesUninstallStickerSetRequest{} }, 0xe6df7378: func() bin.Object { return &MessagesStartBotRequest{} }, 0x5784d3e1: func() bin.Object { return &MessagesGetMessagesViewsRequest{} }, - 0xa9e69f2e: func() bin.Object { return &MessagesEditChatAdminRequest{} }, - 0x15a3b8e3: func() bin.Object { return &MessagesMigrateChatRequest{} }, + 0xa85bd1c2: func() bin.Object { return &MessagesEditChatAdminRequest{} }, + 0xa2875319: func() bin.Object { return &MessagesMigrateChatRequest{} }, 0x4bc6589a: func() bin.Object { return &MessagesSearchGlobalRequest{} }, 0x78337739: func() bin.Object { return &MessagesReorderStickerSetsRequest{} }, 0x338e2464: func() bin.Object { return &MessagesGetDocumentByHashRequest{} }, - 0x83bf3d52: func() bin.Object { return &MessagesGetSavedGifsRequest{} }, + 0x5cf09635: func() bin.Object { return &MessagesGetSavedGifsRequest{} }, 0x327a30cb: func() bin.Object { return &MessagesSaveGifRequest{} }, 0x514e999d: func() bin.Object { return &MessagesGetInlineBotResultsRequest{} }, 0xeb5ea206: func() bin.Object { return &MessagesSetInlineBotResultsRequest{} }, @@ -3826,20 +3837,20 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0xe470bcfd: func() bin.Object { return &MessagesGetPeerDialogsRequest{} }, 0xbc39e14b: func() bin.Object { return &MessagesSaveDraftRequest{} }, 0x6a3f8d65: func() bin.Object { return &MessagesGetAllDraftsRequest{} }, - 0x2dacca4f: func() bin.Object { return &MessagesGetFeaturedStickersRequest{} }, + 0x64780b14: func() bin.Object { return &MessagesGetFeaturedStickersRequest{} }, 0x5b118126: func() bin.Object { return &MessagesReadFeaturedStickersRequest{} }, - 0x5ea192c9: func() bin.Object { return &MessagesGetRecentStickersRequest{} }, + 0x9da9403b: func() bin.Object { return &MessagesGetRecentStickersRequest{} }, 0x392718f8: func() bin.Object { return &MessagesSaveRecentStickerRequest{} }, 0x8999602d: func() bin.Object { return &MessagesClearRecentStickersRequest{} }, 0x57f17692: func() bin.Object { return &MessagesGetArchivedStickersRequest{} }, - 0x65b8c79f: func() bin.Object { return &MessagesGetMaskStickersRequest{} }, + 0x640f82b8: func() bin.Object { return &MessagesGetMaskStickersRequest{} }, 0xcc5b67cc: func() bin.Object { return &MessagesGetAttachedStickersRequest{} }, 0x8ef8ecc0: func() bin.Object { return &MessagesSetGameScoreRequest{} }, 0x15ad9f64: func() bin.Object { return &MessagesSetInlineGameScoreRequest{} }, 0xe822649d: func() bin.Object { return &MessagesGetGameHighScoresRequest{} }, 0xf635e1b: func() bin.Object { return &MessagesGetInlineGameHighScoresRequest{} }, - 0xd0a48c4: func() bin.Object { return &MessagesGetCommonChatsRequest{} }, - 0xeba80ff0: func() bin.Object { return &MessagesGetAllChatsRequest{} }, + 0xe40ca104: func() bin.Object { return &MessagesGetCommonChatsRequest{} }, + 0x875f74be: func() bin.Object { return &MessagesGetAllChatsRequest{} }, 0x32ca8f91: func() bin.Object { return &MessagesGetWebPageRequest{} }, 0xa731e257: func() bin.Object { return &MessagesToggleDialogPinRequest{} }, 0x3b1adf37: func() bin.Object { return &MessagesReorderPinnedDialogsRequest{} }, @@ -3848,14 +3859,14 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0x9c2dd95: func() bin.Object { return &MessagesSetBotPrecheckoutResultsRequest{} }, 0x519bc2b1: func() bin.Object { return &MessagesUploadMediaRequest{} }, 0xc97df020: func() bin.Object { return &MessagesSendScreenshotNotificationRequest{} }, - 0x21ce0b0e: func() bin.Object { return &MessagesGetFavedStickersRequest{} }, + 0x4f1aaa9: func() bin.Object { return &MessagesGetFavedStickersRequest{} }, 0xb9ffc55b: func() bin.Object { return &MessagesFaveStickerRequest{} }, 0x46578472: func() bin.Object { return &MessagesGetUnreadMentionsRequest{} }, 0xf0189d3: func() bin.Object { return &MessagesReadMentionsRequest{} }, - 0xbbc45b09: func() bin.Object { return &MessagesGetRecentLocationsRequest{} }, + 0x702a40e0: func() bin.Object { return &MessagesGetRecentLocationsRequest{} }, 0xcc0110cb: func() bin.Object { return &MessagesSendMultiMediaRequest{} }, 0x5057c497: func() bin.Object { return &MessagesUploadEncryptedFileRequest{} }, - 0xc2b7d08b: func() bin.Object { return &MessagesSearchStickerSetsRequest{} }, + 0x35705b8a: func() bin.Object { return &MessagesSearchStickerSetsRequest{} }, 0x1cff7e08: func() bin.Object { return &MessagesGetSplitRangesRequest{} }, 0xc286d98f: func() bin.Object { return &MessagesMarkDialogUnreadRequest{} }, 0x22e24e22: func() bin.Object { return &MessagesGetDialogUnreadMarksRequest{} }, @@ -3875,7 +3886,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0x198fb446: func() bin.Object { return &MessagesRequestURLAuthRequest{} }, 0xb12c7125: func() bin.Object { return &MessagesAcceptURLAuthRequest{} }, 0x4facb138: func() bin.Object { return &MessagesHidePeerSettingsBarRequest{} }, - 0xe2c2685b: func() bin.Object { return &MessagesGetScheduledHistoryRequest{} }, + 0xf516760b: func() bin.Object { return &MessagesGetScheduledHistoryRequest{} }, 0xbdbb0464: func() bin.Object { return &MessagesGetScheduledMessagesRequest{} }, 0xbd38850a: func() bin.Object { return &MessagesSendScheduledMessagesRequest{} }, 0x59ae2b16: func() bin.Object { return &MessagesDeleteScheduledMessagesRequest{} }, @@ -3885,12 +3896,12 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0xa29cd42c: func() bin.Object { return &MessagesGetSuggestedDialogFiltersRequest{} }, 0x1ad4a04a: func() bin.Object { return &MessagesUpdateDialogFilterRequest{} }, 0xc563c1e4: func() bin.Object { return &MessagesUpdateDialogFiltersOrderRequest{} }, - 0x5fe7025b: func() bin.Object { return &MessagesGetOldFeaturedStickersRequest{} }, - 0x24b581ba: func() bin.Object { return &MessagesGetRepliesRequest{} }, + 0x7ed094a1: func() bin.Object { return &MessagesGetOldFeaturedStickersRequest{} }, + 0x22ddd30c: func() bin.Object { return &MessagesGetRepliesRequest{} }, 0x446972fd: func() bin.Object { return &MessagesGetDiscussionMessageRequest{} }, 0xf731a9f4: func() bin.Object { return &MessagesReadDiscussionRequest{} }, 0xf025bc8b: func() bin.Object { return &MessagesUnpinAllMessagesRequest{} }, - 0x83247d11: func() bin.Object { return &MessagesDeleteChatRequest{} }, + 0x5bd0ee50: func() bin.Object { return &MessagesDeleteChatRequest{} }, 0xf9cbe409: func() bin.Object { return &MessagesDeletePhoneCallHistoryRequest{} }, 0x43fe19f3: func() bin.Object { return &MessagesCheckHistoryImportRequest{} }, 0x34090c3b: func() bin.Object { return &MessagesInitHistoryImportRequest{} }, @@ -3906,6 +3917,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0xb80e5fe4: func() bin.Object { return &MessagesSetHistoryTTLRequest{} }, 0x5dc60f03: func() bin.Object { return &MessagesCheckHistoryImportPeerRequest{} }, 0xe63be13f: func() bin.Object { return &MessagesSetChatThemeRequest{} }, + 0x2c6f97b7: func() bin.Object { return &MessagesGetMessageReadParticipantsRequest{} }, 0xedd4882a: func() bin.Object { return &UpdatesGetStateRequest{} }, 0x25939651: func() bin.Object { return &UpdatesGetDifferenceRequest{} }, 0x3173d78: func() bin.Object { return &UpdatesGetChannelDifferenceRequest{} }, @@ -3948,7 +3960,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { 0xd10dd71b: func() bin.Object { return &ChannelsDeleteUserHistoryRequest{} }, 0xfe087810: func() bin.Object { return &ChannelsReportSpamRequest{} }, 0xad8c9a23: func() bin.Object { return &ChannelsGetMessagesRequest{} }, - 0x123e05e9: func() bin.Object { return &ChannelsGetParticipantsRequest{} }, + 0x77ced9d0: func() bin.Object { return &ChannelsGetParticipantsRequest{} }, 0xa0ab6cc6: func() bin.Object { return &ChannelsGetParticipantRequest{} }, 0xa7f6bbb: func() bin.Object { return &ChannelsGetChannelsRequest{} }, 0x8736a09: func() bin.Object { return &ChannelsGetFullChannelRequest{} }, diff --git a/tg/tl_secure_file_slices_gen.go b/tg/tl_secure_file_slices_gen.go index e76e26240b..15851f82f2 100644 --- a/tg/tl_secure_file_slices_gen.go +++ b/tg/tl_secure_file_slices_gen.go @@ -127,6 +127,24 @@ func (s SecureFileClassArray) AsSecureFile() (to SecureFileArray) { return to } +// FillNotEmptyMap fills only NotEmpty constructors to given map. +func (s SecureFileClassArray) FillNotEmptyMap(to map[int64]*SecureFile) { + for _, elem := range s { + value, ok := elem.AsNotEmpty() + if !ok { + continue + } + to[value.GetID()] = value + } +} + +// NotEmptyToMap collects only NotEmpty constructors to map. +func (s SecureFileClassArray) NotEmptyToMap() map[int64]*SecureFile { + r := make(map[int64]*SecureFile, len(s)) + s.FillNotEmptyMap(r) + return r +} + // AppendOnlyNotEmpty appends only NotEmpty constructors to // given slice. func (s SecureFileClassArray) AppendOnlyNotEmpty(to []*SecureFile) []*SecureFile { @@ -264,6 +282,20 @@ func (s *SecureFileArray) Pop() (v SecureFile, ok bool) { return v, true } +// SortByID sorts slice of SecureFile by ID. +func (s SecureFileArray) SortByID() SecureFileArray { + return s.Sort(func(a, b SecureFile) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of SecureFile by ID. +func (s SecureFileArray) SortStableByID() SecureFileArray { + return s.SortStable(func(a, b SecureFile) bool { + return a.GetID() < b.GetID() + }) +} + // SortByDate sorts slice of SecureFile by Date. func (s SecureFileArray) SortByDate() SecureFileArray { return s.Sort(func(a, b SecureFile) bool { @@ -277,3 +309,17 @@ func (s SecureFileArray) SortStableByDate() SecureFileArray { return a.GetDate() < b.GetDate() }) } + +// FillMap fills constructors to given map. +func (s SecureFileArray) FillMap(to map[int64]SecureFile) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s SecureFileArray) ToMap() map[int64]SecureFile { + r := make(map[int64]SecureFile, len(s)) + s.FillMap(r) + return r +} diff --git a/tg/tl_send_message_action_gen.go b/tg/tl_send_message_action_gen.go index 1722e0f1e1..8e7a9fad44 100644 --- a/tg/tl_send_message_action_gen.go +++ b/tg/tl_send_message_action_gen.go @@ -1839,6 +1839,316 @@ func (s *SendMessageChooseStickerAction) DecodeBare(b *bin.Buffer) error { return nil } +// SendMessageEmojiInteraction represents TL type `sendMessageEmojiInteraction#25972bcb`. +// +// See https://core.telegram.org/constructor/sendMessageEmojiInteraction for reference. +type SendMessageEmojiInteraction struct { + // Emoticon field of SendMessageEmojiInteraction. + Emoticon string + // MsgID field of SendMessageEmojiInteraction. + MsgID int + // Interaction field of SendMessageEmojiInteraction. + Interaction DataJSON +} + +// SendMessageEmojiInteractionTypeID is TL type id of SendMessageEmojiInteraction. +const SendMessageEmojiInteractionTypeID = 0x25972bcb + +// construct implements constructor of SendMessageActionClass. +func (s SendMessageEmojiInteraction) construct() SendMessageActionClass { return &s } + +// Ensuring interfaces in compile-time for SendMessageEmojiInteraction. +var ( + _ bin.Encoder = &SendMessageEmojiInteraction{} + _ bin.Decoder = &SendMessageEmojiInteraction{} + _ bin.BareEncoder = &SendMessageEmojiInteraction{} + _ bin.BareDecoder = &SendMessageEmojiInteraction{} + + _ SendMessageActionClass = &SendMessageEmojiInteraction{} +) + +func (s *SendMessageEmojiInteraction) Zero() bool { + if s == nil { + return true + } + if !(s.Emoticon == "") { + return false + } + if !(s.MsgID == 0) { + return false + } + if !(s.Interaction.Zero()) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *SendMessageEmojiInteraction) String() string { + if s == nil { + return "SendMessageEmojiInteraction(nil)" + } + type Alias SendMessageEmojiInteraction + return fmt.Sprintf("SendMessageEmojiInteraction%+v", Alias(*s)) +} + +// FillFrom fills SendMessageEmojiInteraction from given interface. +func (s *SendMessageEmojiInteraction) FillFrom(from interface { + GetEmoticon() (value string) + GetMsgID() (value int) + GetInteraction() (value DataJSON) +}) { + s.Emoticon = from.GetEmoticon() + s.MsgID = from.GetMsgID() + s.Interaction = from.GetInteraction() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*SendMessageEmojiInteraction) TypeID() uint32 { + return SendMessageEmojiInteractionTypeID +} + +// TypeName returns name of type in TL schema. +func (*SendMessageEmojiInteraction) TypeName() string { + return "sendMessageEmojiInteraction" +} + +// TypeInfo returns info about TL type. +func (s *SendMessageEmojiInteraction) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "sendMessageEmojiInteraction", + ID: SendMessageEmojiInteractionTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Emoticon", + SchemaName: "emoticon", + }, + { + Name: "MsgID", + SchemaName: "msg_id", + }, + { + Name: "Interaction", + SchemaName: "interaction", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (s *SendMessageEmojiInteraction) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode sendMessageEmojiInteraction#25972bcb as nil") + } + b.PutID(SendMessageEmojiInteractionTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *SendMessageEmojiInteraction) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode sendMessageEmojiInteraction#25972bcb as nil") + } + b.PutString(s.Emoticon) + b.PutInt(s.MsgID) + if err := s.Interaction.Encode(b); err != nil { + return fmt.Errorf("unable to encode sendMessageEmojiInteraction#25972bcb: field interaction: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (s *SendMessageEmojiInteraction) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode sendMessageEmojiInteraction#25972bcb to nil") + } + if err := b.ConsumeID(SendMessageEmojiInteractionTypeID); err != nil { + return fmt.Errorf("unable to decode sendMessageEmojiInteraction#25972bcb: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *SendMessageEmojiInteraction) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode sendMessageEmojiInteraction#25972bcb to nil") + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode sendMessageEmojiInteraction#25972bcb: field emoticon: %w", err) + } + s.Emoticon = value + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode sendMessageEmojiInteraction#25972bcb: field msg_id: %w", err) + } + s.MsgID = value + } + { + if err := s.Interaction.Decode(b); err != nil { + return fmt.Errorf("unable to decode sendMessageEmojiInteraction#25972bcb: field interaction: %w", err) + } + } + return nil +} + +// GetEmoticon returns value of Emoticon field. +func (s *SendMessageEmojiInteraction) GetEmoticon() (value string) { + return s.Emoticon +} + +// GetMsgID returns value of MsgID field. +func (s *SendMessageEmojiInteraction) GetMsgID() (value int) { + return s.MsgID +} + +// GetInteraction returns value of Interaction field. +func (s *SendMessageEmojiInteraction) GetInteraction() (value DataJSON) { + return s.Interaction +} + +// SendMessageEmojiInteractionSeen represents TL type `sendMessageEmojiInteractionSeen#b665902e`. +// +// See https://core.telegram.org/constructor/sendMessageEmojiInteractionSeen for reference. +type SendMessageEmojiInteractionSeen struct { + // Emoticon field of SendMessageEmojiInteractionSeen. + Emoticon string +} + +// SendMessageEmojiInteractionSeenTypeID is TL type id of SendMessageEmojiInteractionSeen. +const SendMessageEmojiInteractionSeenTypeID = 0xb665902e + +// construct implements constructor of SendMessageActionClass. +func (s SendMessageEmojiInteractionSeen) construct() SendMessageActionClass { return &s } + +// Ensuring interfaces in compile-time for SendMessageEmojiInteractionSeen. +var ( + _ bin.Encoder = &SendMessageEmojiInteractionSeen{} + _ bin.Decoder = &SendMessageEmojiInteractionSeen{} + _ bin.BareEncoder = &SendMessageEmojiInteractionSeen{} + _ bin.BareDecoder = &SendMessageEmojiInteractionSeen{} + + _ SendMessageActionClass = &SendMessageEmojiInteractionSeen{} +) + +func (s *SendMessageEmojiInteractionSeen) Zero() bool { + if s == nil { + return true + } + if !(s.Emoticon == "") { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *SendMessageEmojiInteractionSeen) String() string { + if s == nil { + return "SendMessageEmojiInteractionSeen(nil)" + } + type Alias SendMessageEmojiInteractionSeen + return fmt.Sprintf("SendMessageEmojiInteractionSeen%+v", Alias(*s)) +} + +// FillFrom fills SendMessageEmojiInteractionSeen from given interface. +func (s *SendMessageEmojiInteractionSeen) FillFrom(from interface { + GetEmoticon() (value string) +}) { + s.Emoticon = from.GetEmoticon() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*SendMessageEmojiInteractionSeen) TypeID() uint32 { + return SendMessageEmojiInteractionSeenTypeID +} + +// TypeName returns name of type in TL schema. +func (*SendMessageEmojiInteractionSeen) TypeName() string { + return "sendMessageEmojiInteractionSeen" +} + +// TypeInfo returns info about TL type. +func (s *SendMessageEmojiInteractionSeen) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "sendMessageEmojiInteractionSeen", + ID: SendMessageEmojiInteractionSeenTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Emoticon", + SchemaName: "emoticon", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (s *SendMessageEmojiInteractionSeen) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode sendMessageEmojiInteractionSeen#b665902e as nil") + } + b.PutID(SendMessageEmojiInteractionSeenTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *SendMessageEmojiInteractionSeen) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode sendMessageEmojiInteractionSeen#b665902e as nil") + } + b.PutString(s.Emoticon) + return nil +} + +// Decode implements bin.Decoder. +func (s *SendMessageEmojiInteractionSeen) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode sendMessageEmojiInteractionSeen#b665902e to nil") + } + if err := b.ConsumeID(SendMessageEmojiInteractionSeenTypeID); err != nil { + return fmt.Errorf("unable to decode sendMessageEmojiInteractionSeen#b665902e: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *SendMessageEmojiInteractionSeen) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode sendMessageEmojiInteractionSeen#b665902e to nil") + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode sendMessageEmojiInteractionSeen#b665902e: field emoticon: %w", err) + } + s.Emoticon = value + } + return nil +} + +// GetEmoticon returns value of Emoticon field. +func (s *SendMessageEmojiInteractionSeen) GetEmoticon() (value string) { + return s.Emoticon +} + // SendMessageActionClass represents SendMessageAction generic type. // // See https://core.telegram.org/type/SendMessageAction for reference. @@ -1865,6 +2175,8 @@ func (s *SendMessageChooseStickerAction) DecodeBare(b *bin.Buffer) error { // case *tg.SpeakingInGroupCallAction: // speakingInGroupCallAction#d92c2285 // case *tg.SendMessageHistoryImportAction: // sendMessageHistoryImportAction#dbda9246 // case *tg.SendMessageChooseStickerAction: // sendMessageChooseStickerAction#b05ac6b1 +// case *tg.SendMessageEmojiInteraction: // sendMessageEmojiInteraction#25972bcb +// case *tg.SendMessageEmojiInteractionSeen: // sendMessageEmojiInteractionSeen#b665902e // default: panic(v) // } type SendMessageActionClass interface { @@ -2005,6 +2317,20 @@ func DecodeSendMessageAction(buf *bin.Buffer) (SendMessageActionClass, error) { return nil, fmt.Errorf("unable to decode SendMessageActionClass: %w", err) } return &v, nil + case SendMessageEmojiInteractionTypeID: + // Decoding sendMessageEmojiInteraction#25972bcb. + v := SendMessageEmojiInteraction{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode SendMessageActionClass: %w", err) + } + return &v, nil + case SendMessageEmojiInteractionSeenTypeID: + // Decoding sendMessageEmojiInteractionSeen#b665902e. + v := SendMessageEmojiInteractionSeen{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode SendMessageActionClass: %w", err) + } + return &v, nil default: return nil, fmt.Errorf("unable to decode SendMessageActionClass: %w", bin.NewUnexpectedID(id)) } diff --git a/tg/tl_send_message_action_slices_gen.go b/tg/tl_send_message_action_slices_gen.go index 2fcb0f2709..a524715dec 100644 --- a/tg/tl_send_message_action_slices_gen.go +++ b/tg/tl_send_message_action_slices_gen.go @@ -192,6 +192,32 @@ func (s SendMessageActionClassArray) AsSendMessageHistoryImportAction() (to Send return to } +// AsSendMessageEmojiInteraction returns copy with only SendMessageEmojiInteraction constructors. +func (s SendMessageActionClassArray) AsSendMessageEmojiInteraction() (to SendMessageEmojiInteractionArray) { + for _, elem := range s { + value, ok := elem.(*SendMessageEmojiInteraction) + if !ok { + continue + } + to = append(to, *value) + } + + return to +} + +// AsSendMessageEmojiInteractionSeen returns copy with only SendMessageEmojiInteractionSeen constructors. +func (s SendMessageActionClassArray) AsSendMessageEmojiInteractionSeen() (to SendMessageEmojiInteractionSeenArray) { + for _, elem := range s { + value, ok := elem.(*SendMessageEmojiInteractionSeen) + if !ok { + continue + } + to = append(to, *value) + } + + return to +} + // SendMessageUploadVideoActionArray is adapter for slice of SendMessageUploadVideoAction. type SendMessageUploadVideoActionArray []SendMessageUploadVideoAction @@ -683,3 +709,167 @@ func (s *SendMessageHistoryImportActionArray) Pop() (v SendMessageHistoryImportA return v, true } + +// SendMessageEmojiInteractionArray is adapter for slice of SendMessageEmojiInteraction. +type SendMessageEmojiInteractionArray []SendMessageEmojiInteraction + +// Sort sorts slice of SendMessageEmojiInteraction. +func (s SendMessageEmojiInteractionArray) Sort(less func(a, b SendMessageEmojiInteraction) bool) SendMessageEmojiInteractionArray { + sort.Slice(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// SortStable sorts slice of SendMessageEmojiInteraction. +func (s SendMessageEmojiInteractionArray) SortStable(less func(a, b SendMessageEmojiInteraction) bool) SendMessageEmojiInteractionArray { + sort.SliceStable(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// Retain filters in-place slice of SendMessageEmojiInteraction. +func (s SendMessageEmojiInteractionArray) Retain(keep func(x SendMessageEmojiInteraction) bool) SendMessageEmojiInteractionArray { + n := 0 + for _, x := range s { + if keep(x) { + s[n] = x + n++ + } + } + s = s[:n] + + return s +} + +// First returns first element of slice (if exists). +func (s SendMessageEmojiInteractionArray) First() (v SendMessageEmojiInteraction, ok bool) { + if len(s) < 1 { + return + } + return s[0], true +} + +// Last returns last element of slice (if exists). +func (s SendMessageEmojiInteractionArray) Last() (v SendMessageEmojiInteraction, ok bool) { + if len(s) < 1 { + return + } + return s[len(s)-1], true +} + +// PopFirst returns first element of slice (if exists) and deletes it. +func (s *SendMessageEmojiInteractionArray) PopFirst() (v SendMessageEmojiInteraction, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[0] + + // Delete by index from SliceTricks. + copy(a[0:], a[1:]) + var zero SendMessageEmojiInteraction + a[len(a)-1] = zero + a = a[:len(a)-1] + *s = a + + return v, true +} + +// Pop returns last element of slice (if exists) and deletes it. +func (s *SendMessageEmojiInteractionArray) Pop() (v SendMessageEmojiInteraction, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[len(a)-1] + a = a[:len(a)-1] + *s = a + + return v, true +} + +// SendMessageEmojiInteractionSeenArray is adapter for slice of SendMessageEmojiInteractionSeen. +type SendMessageEmojiInteractionSeenArray []SendMessageEmojiInteractionSeen + +// Sort sorts slice of SendMessageEmojiInteractionSeen. +func (s SendMessageEmojiInteractionSeenArray) Sort(less func(a, b SendMessageEmojiInteractionSeen) bool) SendMessageEmojiInteractionSeenArray { + sort.Slice(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// SortStable sorts slice of SendMessageEmojiInteractionSeen. +func (s SendMessageEmojiInteractionSeenArray) SortStable(less func(a, b SendMessageEmojiInteractionSeen) bool) SendMessageEmojiInteractionSeenArray { + sort.SliceStable(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// Retain filters in-place slice of SendMessageEmojiInteractionSeen. +func (s SendMessageEmojiInteractionSeenArray) Retain(keep func(x SendMessageEmojiInteractionSeen) bool) SendMessageEmojiInteractionSeenArray { + n := 0 + for _, x := range s { + if keep(x) { + s[n] = x + n++ + } + } + s = s[:n] + + return s +} + +// First returns first element of slice (if exists). +func (s SendMessageEmojiInteractionSeenArray) First() (v SendMessageEmojiInteractionSeen, ok bool) { + if len(s) < 1 { + return + } + return s[0], true +} + +// Last returns last element of slice (if exists). +func (s SendMessageEmojiInteractionSeenArray) Last() (v SendMessageEmojiInteractionSeen, ok bool) { + if len(s) < 1 { + return + } + return s[len(s)-1], true +} + +// PopFirst returns first element of slice (if exists) and deletes it. +func (s *SendMessageEmojiInteractionSeenArray) PopFirst() (v SendMessageEmojiInteractionSeen, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[0] + + // Delete by index from SliceTricks. + copy(a[0:], a[1:]) + var zero SendMessageEmojiInteractionSeen + a[len(a)-1] = zero + a = a[:len(a)-1] + *s = a + + return v, true +} + +// Pop returns last element of slice (if exists) and deletes it. +func (s *SendMessageEmojiInteractionSeenArray) Pop() (v SendMessageEmojiInteractionSeen, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[len(a)-1] + a = a[:len(a)-1] + *s = a + + return v, true +} diff --git a/tg/tl_server_gen.go b/tg/tl_server_gen.go index ce6e1a4b13..70ca374a9d 100644 --- a/tg/tl_server_gen.go +++ b/tg/tl_server_gen.go @@ -575,7 +575,7 @@ func (s *ServerDispatcher) OnAccountUpdateStatus(f func(ctx context.Context, off s.handlers[AccountUpdateStatusRequestTypeID] = handler } -func (s *ServerDispatcher) OnAccountGetWallPapers(f func(ctx context.Context, hash int) (AccountWallPapersClass, error)) { +func (s *ServerDispatcher) OnAccountGetWallPapers(f func(ctx context.Context, hash int64) (AccountWallPapersClass, error)) { handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { var request AccountGetWallPapersRequest if err := request.Decode(b); err != nil { @@ -1834,7 +1834,7 @@ func (s *ServerDispatcher) OnUsersSetSecureValueErrors(f func(ctx context.Contex s.handlers[UsersSetSecureValueErrorsRequestTypeID] = handler } -func (s *ServerDispatcher) OnContactsGetContactIDs(f func(ctx context.Context, hash int) ([]int, error)) { +func (s *ServerDispatcher) OnContactsGetContactIDs(f func(ctx context.Context, hash int64) ([]int, error)) { handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { var request ContactsGetContactIDsRequest if err := request.Decode(b); err != nil { @@ -1868,7 +1868,7 @@ func (s *ServerDispatcher) OnContactsGetStatuses(f func(ctx context.Context) ([] s.handlers[ContactsGetStatusesRequestTypeID] = handler } -func (s *ServerDispatcher) OnContactsGetContacts(f func(ctx context.Context, hash int) (ContactsContactsClass, error)) { +func (s *ServerDispatcher) OnContactsGetContacts(f func(ctx context.Context, hash int64) (ContactsContactsClass, error)) { handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { var request ContactsGetContactsRequest if err := request.Decode(b); err != nil { @@ -2465,7 +2465,7 @@ func (s *ServerDispatcher) OnMessagesReport(f func(ctx context.Context, request s.handlers[MessagesReportRequestTypeID] = handler } -func (s *ServerDispatcher) OnMessagesGetChats(f func(ctx context.Context, id []int) (MessagesChatsClass, error)) { +func (s *ServerDispatcher) OnMessagesGetChats(f func(ctx context.Context, id []int64) (MessagesChatsClass, error)) { handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { var request MessagesGetChatsRequest if err := request.Decode(b); err != nil { @@ -2482,7 +2482,7 @@ func (s *ServerDispatcher) OnMessagesGetChats(f func(ctx context.Context, id []i s.handlers[MessagesGetChatsRequestTypeID] = handler } -func (s *ServerDispatcher) OnMessagesGetFullChat(f func(ctx context.Context, chatid int) (*MessagesChatFull, error)) { +func (s *ServerDispatcher) OnMessagesGetFullChat(f func(ctx context.Context, chatid int64) (*MessagesChatFull, error)) { handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { var request MessagesGetFullChatRequest if err := request.Decode(b); err != nil { @@ -2821,7 +2821,7 @@ func (s *ServerDispatcher) OnMessagesGetStickers(f func(ctx context.Context, req s.handlers[MessagesGetStickersRequestTypeID] = handler } -func (s *ServerDispatcher) OnMessagesGetAllStickers(f func(ctx context.Context, hash int) (MessagesAllStickersClass, error)) { +func (s *ServerDispatcher) OnMessagesGetAllStickers(f func(ctx context.Context, hash int64) (MessagesAllStickersClass, error)) { handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { var request MessagesGetAllStickersRequest if err := request.Decode(b); err != nil { @@ -3016,7 +3016,7 @@ func (s *ServerDispatcher) OnMessagesEditChatAdmin(f func(ctx context.Context, r s.handlers[MessagesEditChatAdminRequestTypeID] = handler } -func (s *ServerDispatcher) OnMessagesMigrateChat(f func(ctx context.Context, chatid int) (UpdatesClass, error)) { +func (s *ServerDispatcher) OnMessagesMigrateChat(f func(ctx context.Context, chatid int64) (UpdatesClass, error)) { handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { var request MessagesMigrateChatRequest if err := request.Decode(b); err != nil { @@ -3088,7 +3088,7 @@ func (s *ServerDispatcher) OnMessagesGetDocumentByHash(f func(ctx context.Contex s.handlers[MessagesGetDocumentByHashRequestTypeID] = handler } -func (s *ServerDispatcher) OnMessagesGetSavedGifs(f func(ctx context.Context, hash int) (MessagesSavedGifsClass, error)) { +func (s *ServerDispatcher) OnMessagesGetSavedGifs(f func(ctx context.Context, hash int64) (MessagesSavedGifsClass, error)) { handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { var request MessagesGetSavedGifsRequest if err := request.Decode(b); err != nil { @@ -3329,7 +3329,7 @@ func (s *ServerDispatcher) OnMessagesGetAllDrafts(f func(ctx context.Context) (U s.handlers[MessagesGetAllDraftsRequestTypeID] = handler } -func (s *ServerDispatcher) OnMessagesGetFeaturedStickers(f func(ctx context.Context, hash int) (MessagesFeaturedStickersClass, error)) { +func (s *ServerDispatcher) OnMessagesGetFeaturedStickers(f func(ctx context.Context, hash int64) (MessagesFeaturedStickersClass, error)) { handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { var request MessagesGetFeaturedStickersRequest if err := request.Decode(b); err != nil { @@ -3443,7 +3443,7 @@ func (s *ServerDispatcher) OnMessagesGetArchivedStickers(f func(ctx context.Cont s.handlers[MessagesGetArchivedStickersRequestTypeID] = handler } -func (s *ServerDispatcher) OnMessagesGetMaskStickers(f func(ctx context.Context, hash int) (MessagesAllStickersClass, error)) { +func (s *ServerDispatcher) OnMessagesGetMaskStickers(f func(ctx context.Context, hash int64) (MessagesAllStickersClass, error)) { handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { var request MessagesGetMaskStickersRequest if err := request.Decode(b); err != nil { @@ -3566,7 +3566,7 @@ func (s *ServerDispatcher) OnMessagesGetCommonChats(f func(ctx context.Context, s.handlers[MessagesGetCommonChatsRequestTypeID] = handler } -func (s *ServerDispatcher) OnMessagesGetAllChats(f func(ctx context.Context, exceptids []int) (MessagesChatsClass, error)) { +func (s *ServerDispatcher) OnMessagesGetAllChats(f func(ctx context.Context, exceptids []int64) (MessagesChatsClass, error)) { handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { var request MessagesGetAllChatsRequest if err := request.Decode(b); err != nil { @@ -3735,7 +3735,7 @@ func (s *ServerDispatcher) OnMessagesSendScreenshotNotification(f func(ctx conte s.handlers[MessagesSendScreenshotNotificationRequestTypeID] = handler } -func (s *ServerDispatcher) OnMessagesGetFavedStickers(f func(ctx context.Context, hash int) (MessagesFavedStickersClass, error)) { +func (s *ServerDispatcher) OnMessagesGetFavedStickers(f func(ctx context.Context, hash int64) (MessagesFavedStickersClass, error)) { handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { var request MessagesGetFavedStickersRequest if err := request.Decode(b); err != nil { @@ -4485,7 +4485,7 @@ func (s *ServerDispatcher) OnMessagesUnpinAllMessages(f func(ctx context.Context s.handlers[MessagesUnpinAllMessagesRequestTypeID] = handler } -func (s *ServerDispatcher) OnMessagesDeleteChat(f func(ctx context.Context, chatid int) (bool, error)) { +func (s *ServerDispatcher) OnMessagesDeleteChat(f func(ctx context.Context, chatid int64) (bool, error)) { handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { var request MessagesDeleteChatRequest if err := request.Decode(b); err != nil { @@ -4773,6 +4773,23 @@ func (s *ServerDispatcher) OnMessagesSetChatTheme(f func(ctx context.Context, re s.handlers[MessagesSetChatThemeRequestTypeID] = handler } +func (s *ServerDispatcher) OnMessagesGetMessageReadParticipants(f func(ctx context.Context, request *MessagesGetMessageReadParticipantsRequest) ([]int64, error)) { + handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { + var request MessagesGetMessageReadParticipantsRequest + if err := request.Decode(b); err != nil { + return nil, err + } + + response, err := f(ctx, &request) + if err != nil { + return nil, err + } + return &LongVector{Elems: response}, nil + } + + s.handlers[MessagesGetMessageReadParticipantsRequestTypeID] = handler +} + func (s *ServerDispatcher) OnUpdatesGetState(f func(ctx context.Context) (*UpdatesState, error)) { handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { var request UpdatesGetStateRequest diff --git a/tg/tl_stats_group_top_admin_gen.go b/tg/tl_stats_group_top_admin_gen.go index 5c0f93511f..c45b264a4d 100644 --- a/tg/tl_stats_group_top_admin_gen.go +++ b/tg/tl_stats_group_top_admin_gen.go @@ -29,13 +29,13 @@ var ( _ = tgerr.Error{} ) -// StatsGroupTopAdmin represents TL type `statsGroupTopAdmin#6014f412`. +// StatsGroupTopAdmin represents TL type `statsGroupTopAdmin#d7584c87`. // Information about an active admin in a supergroup // // See https://core.telegram.org/constructor/statsGroupTopAdmin for reference. type StatsGroupTopAdmin struct { // User ID - UserID int + UserID int64 // Number of deleted messages for statistics¹ period in consideration // // Links: @@ -54,7 +54,7 @@ type StatsGroupTopAdmin struct { } // StatsGroupTopAdminTypeID is TL type id of StatsGroupTopAdmin. -const StatsGroupTopAdminTypeID = 0x6014f412 +const StatsGroupTopAdminTypeID = 0xd7584c87 // Ensuring interfaces in compile-time for StatsGroupTopAdmin. var ( @@ -95,7 +95,7 @@ func (s *StatsGroupTopAdmin) String() string { // FillFrom fills StatsGroupTopAdmin from given interface. func (s *StatsGroupTopAdmin) FillFrom(from interface { - GetUserID() (value int) + GetUserID() (value int64) GetDeleted() (value int) GetKicked() (value int) GetBanned() (value int) @@ -152,7 +152,7 @@ func (s *StatsGroupTopAdmin) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (s *StatsGroupTopAdmin) Encode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode statsGroupTopAdmin#6014f412 as nil") + return fmt.Errorf("can't encode statsGroupTopAdmin#d7584c87 as nil") } b.PutID(StatsGroupTopAdminTypeID) return s.EncodeBare(b) @@ -161,9 +161,9 @@ func (s *StatsGroupTopAdmin) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (s *StatsGroupTopAdmin) EncodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode statsGroupTopAdmin#6014f412 as nil") + return fmt.Errorf("can't encode statsGroupTopAdmin#d7584c87 as nil") } - b.PutInt(s.UserID) + b.PutLong(s.UserID) b.PutInt(s.Deleted) b.PutInt(s.Kicked) b.PutInt(s.Banned) @@ -173,10 +173,10 @@ func (s *StatsGroupTopAdmin) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (s *StatsGroupTopAdmin) Decode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode statsGroupTopAdmin#6014f412 to nil") + return fmt.Errorf("can't decode statsGroupTopAdmin#d7584c87 to nil") } if err := b.ConsumeID(StatsGroupTopAdminTypeID); err != nil { - return fmt.Errorf("unable to decode statsGroupTopAdmin#6014f412: %w", err) + return fmt.Errorf("unable to decode statsGroupTopAdmin#d7584c87: %w", err) } return s.DecodeBare(b) } @@ -184,33 +184,33 @@ func (s *StatsGroupTopAdmin) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (s *StatsGroupTopAdmin) DecodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode statsGroupTopAdmin#6014f412 to nil") + return fmt.Errorf("can't decode statsGroupTopAdmin#d7584c87 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode statsGroupTopAdmin#6014f412: field user_id: %w", err) + return fmt.Errorf("unable to decode statsGroupTopAdmin#d7584c87: field user_id: %w", err) } s.UserID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode statsGroupTopAdmin#6014f412: field deleted: %w", err) + return fmt.Errorf("unable to decode statsGroupTopAdmin#d7584c87: field deleted: %w", err) } s.Deleted = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode statsGroupTopAdmin#6014f412: field kicked: %w", err) + return fmt.Errorf("unable to decode statsGroupTopAdmin#d7584c87: field kicked: %w", err) } s.Kicked = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode statsGroupTopAdmin#6014f412: field banned: %w", err) + return fmt.Errorf("unable to decode statsGroupTopAdmin#d7584c87: field banned: %w", err) } s.Banned = value } @@ -218,7 +218,7 @@ func (s *StatsGroupTopAdmin) DecodeBare(b *bin.Buffer) error { } // GetUserID returns value of UserID field. -func (s *StatsGroupTopAdmin) GetUserID() (value int) { +func (s *StatsGroupTopAdmin) GetUserID() (value int64) { return s.UserID } diff --git a/tg/tl_stats_group_top_inviter_gen.go b/tg/tl_stats_group_top_inviter_gen.go index be9975d9d8..b9a8cbb18e 100644 --- a/tg/tl_stats_group_top_inviter_gen.go +++ b/tg/tl_stats_group_top_inviter_gen.go @@ -29,13 +29,13 @@ var ( _ = tgerr.Error{} ) -// StatsGroupTopInviter represents TL type `statsGroupTopInviter#31962a4c`. +// StatsGroupTopInviter represents TL type `statsGroupTopInviter#535f779d`. // Information about an active supergroup inviter // // See https://core.telegram.org/constructor/statsGroupTopInviter for reference. type StatsGroupTopInviter struct { // User ID - UserID int + UserID int64 // Number of invitations for statistics¹ period in consideration // // Links: @@ -44,7 +44,7 @@ type StatsGroupTopInviter struct { } // StatsGroupTopInviterTypeID is TL type id of StatsGroupTopInviter. -const StatsGroupTopInviterTypeID = 0x31962a4c +const StatsGroupTopInviterTypeID = 0x535f779d // Ensuring interfaces in compile-time for StatsGroupTopInviter. var ( @@ -79,7 +79,7 @@ func (s *StatsGroupTopInviter) String() string { // FillFrom fills StatsGroupTopInviter from given interface. func (s *StatsGroupTopInviter) FillFrom(from interface { - GetUserID() (value int) + GetUserID() (value int64) GetInvitations() (value int) }) { s.UserID = from.GetUserID() @@ -124,7 +124,7 @@ func (s *StatsGroupTopInviter) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (s *StatsGroupTopInviter) Encode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode statsGroupTopInviter#31962a4c as nil") + return fmt.Errorf("can't encode statsGroupTopInviter#535f779d as nil") } b.PutID(StatsGroupTopInviterTypeID) return s.EncodeBare(b) @@ -133,9 +133,9 @@ func (s *StatsGroupTopInviter) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (s *StatsGroupTopInviter) EncodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode statsGroupTopInviter#31962a4c as nil") + return fmt.Errorf("can't encode statsGroupTopInviter#535f779d as nil") } - b.PutInt(s.UserID) + b.PutLong(s.UserID) b.PutInt(s.Invitations) return nil } @@ -143,10 +143,10 @@ func (s *StatsGroupTopInviter) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (s *StatsGroupTopInviter) Decode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode statsGroupTopInviter#31962a4c to nil") + return fmt.Errorf("can't decode statsGroupTopInviter#535f779d to nil") } if err := b.ConsumeID(StatsGroupTopInviterTypeID); err != nil { - return fmt.Errorf("unable to decode statsGroupTopInviter#31962a4c: %w", err) + return fmt.Errorf("unable to decode statsGroupTopInviter#535f779d: %w", err) } return s.DecodeBare(b) } @@ -154,19 +154,19 @@ func (s *StatsGroupTopInviter) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (s *StatsGroupTopInviter) DecodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode statsGroupTopInviter#31962a4c to nil") + return fmt.Errorf("can't decode statsGroupTopInviter#535f779d to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode statsGroupTopInviter#31962a4c: field user_id: %w", err) + return fmt.Errorf("unable to decode statsGroupTopInviter#535f779d: field user_id: %w", err) } s.UserID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode statsGroupTopInviter#31962a4c: field invitations: %w", err) + return fmt.Errorf("unable to decode statsGroupTopInviter#535f779d: field invitations: %w", err) } s.Invitations = value } @@ -174,7 +174,7 @@ func (s *StatsGroupTopInviter) DecodeBare(b *bin.Buffer) error { } // GetUserID returns value of UserID field. -func (s *StatsGroupTopInviter) GetUserID() (value int) { +func (s *StatsGroupTopInviter) GetUserID() (value int64) { return s.UserID } diff --git a/tg/tl_stats_group_top_poster_gen.go b/tg/tl_stats_group_top_poster_gen.go index 68369f6960..073ac795a7 100644 --- a/tg/tl_stats_group_top_poster_gen.go +++ b/tg/tl_stats_group_top_poster_gen.go @@ -29,13 +29,13 @@ var ( _ = tgerr.Error{} ) -// StatsGroupTopPoster represents TL type `statsGroupTopPoster#18f3d0f7`. +// StatsGroupTopPoster represents TL type `statsGroupTopPoster#9d04af9b`. // Information about an active user in a supergroup // // See https://core.telegram.org/constructor/statsGroupTopPoster for reference. type StatsGroupTopPoster struct { // User ID - UserID int + UserID int64 // Number of messages for statistics¹ period in consideration // // Links: @@ -46,7 +46,7 @@ type StatsGroupTopPoster struct { } // StatsGroupTopPosterTypeID is TL type id of StatsGroupTopPoster. -const StatsGroupTopPosterTypeID = 0x18f3d0f7 +const StatsGroupTopPosterTypeID = 0x9d04af9b // Ensuring interfaces in compile-time for StatsGroupTopPoster. var ( @@ -84,7 +84,7 @@ func (s *StatsGroupTopPoster) String() string { // FillFrom fills StatsGroupTopPoster from given interface. func (s *StatsGroupTopPoster) FillFrom(from interface { - GetUserID() (value int) + GetUserID() (value int64) GetMessages() (value int) GetAvgChars() (value int) }) { @@ -135,7 +135,7 @@ func (s *StatsGroupTopPoster) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (s *StatsGroupTopPoster) Encode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode statsGroupTopPoster#18f3d0f7 as nil") + return fmt.Errorf("can't encode statsGroupTopPoster#9d04af9b as nil") } b.PutID(StatsGroupTopPosterTypeID) return s.EncodeBare(b) @@ -144,9 +144,9 @@ func (s *StatsGroupTopPoster) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (s *StatsGroupTopPoster) EncodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode statsGroupTopPoster#18f3d0f7 as nil") + return fmt.Errorf("can't encode statsGroupTopPoster#9d04af9b as nil") } - b.PutInt(s.UserID) + b.PutLong(s.UserID) b.PutInt(s.Messages) b.PutInt(s.AvgChars) return nil @@ -155,10 +155,10 @@ func (s *StatsGroupTopPoster) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (s *StatsGroupTopPoster) Decode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode statsGroupTopPoster#18f3d0f7 to nil") + return fmt.Errorf("can't decode statsGroupTopPoster#9d04af9b to nil") } if err := b.ConsumeID(StatsGroupTopPosterTypeID); err != nil { - return fmt.Errorf("unable to decode statsGroupTopPoster#18f3d0f7: %w", err) + return fmt.Errorf("unable to decode statsGroupTopPoster#9d04af9b: %w", err) } return s.DecodeBare(b) } @@ -166,26 +166,26 @@ func (s *StatsGroupTopPoster) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (s *StatsGroupTopPoster) DecodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode statsGroupTopPoster#18f3d0f7 to nil") + return fmt.Errorf("can't decode statsGroupTopPoster#9d04af9b to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode statsGroupTopPoster#18f3d0f7: field user_id: %w", err) + return fmt.Errorf("unable to decode statsGroupTopPoster#9d04af9b: field user_id: %w", err) } s.UserID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode statsGroupTopPoster#18f3d0f7: field messages: %w", err) + return fmt.Errorf("unable to decode statsGroupTopPoster#9d04af9b: field messages: %w", err) } s.Messages = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode statsGroupTopPoster#18f3d0f7: field avg_chars: %w", err) + return fmt.Errorf("unable to decode statsGroupTopPoster#9d04af9b: field avg_chars: %w", err) } s.AvgChars = value } @@ -193,7 +193,7 @@ func (s *StatsGroupTopPoster) DecodeBare(b *bin.Buffer) error { } // GetUserID returns value of UserID field. -func (s *StatsGroupTopPoster) GetUserID() (value int) { +func (s *StatsGroupTopPoster) GetUserID() (value int64) { return s.UserID } diff --git a/tg/tl_theme_settings_gen.go b/tg/tl_theme_settings_gen.go index 6ab51ab8de..3d5a8a723f 100644 --- a/tg/tl_theme_settings_gen.go +++ b/tg/tl_theme_settings_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// ThemeSettings represents TL type `themeSettings#8db4e76c`. +// ThemeSettings represents TL type `themeSettings#fa58b6d4`. // Theme settings // // See https://core.telegram.org/constructor/themeSettings for reference. @@ -45,6 +45,10 @@ type ThemeSettings struct { BaseTheme BaseThemeClass // Accent color, RGB24 format AccentColor int + // OutboxAccentColor field of ThemeSettings. + // + // Use SetOutboxAccentColor and GetOutboxAccentColor helpers. + OutboxAccentColor int // MessageColors field of ThemeSettings. // // Use SetMessageColors and GetMessageColors helpers. @@ -56,7 +60,7 @@ type ThemeSettings struct { } // ThemeSettingsTypeID is TL type id of ThemeSettings. -const ThemeSettingsTypeID = 0x8db4e76c +const ThemeSettingsTypeID = 0xfa58b6d4 // Ensuring interfaces in compile-time for ThemeSettings. var ( @@ -82,6 +86,9 @@ func (t *ThemeSettings) Zero() bool { if !(t.AccentColor == 0) { return false } + if !(t.OutboxAccentColor == 0) { + return false + } if !(t.MessageColors == nil) { return false } @@ -106,12 +113,17 @@ func (t *ThemeSettings) FillFrom(from interface { GetMessageColorsAnimated() (value bool) GetBaseTheme() (value BaseThemeClass) GetAccentColor() (value int) + GetOutboxAccentColor() (value int, ok bool) GetMessageColors() (value []int, ok bool) GetWallpaper() (value WallPaperClass, ok bool) }) { t.MessageColorsAnimated = from.GetMessageColorsAnimated() t.BaseTheme = from.GetBaseTheme() t.AccentColor = from.GetAccentColor() + if val, ok := from.GetOutboxAccentColor(); ok { + t.OutboxAccentColor = val + } + if val, ok := from.GetMessageColors(); ok { t.MessageColors = val } @@ -158,6 +170,11 @@ func (t *ThemeSettings) TypeInfo() tdp.Type { Name: "AccentColor", SchemaName: "accent_color", }, + { + Name: "OutboxAccentColor", + SchemaName: "outbox_accent_color", + Null: !t.Flags.Has(3), + }, { Name: "MessageColors", SchemaName: "message_colors", @@ -175,7 +192,7 @@ func (t *ThemeSettings) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (t *ThemeSettings) Encode(b *bin.Buffer) error { if t == nil { - return fmt.Errorf("can't encode themeSettings#8db4e76c as nil") + return fmt.Errorf("can't encode themeSettings#fa58b6d4 as nil") } b.PutID(ThemeSettingsTypeID) return t.EncodeBare(b) @@ -184,11 +201,14 @@ func (t *ThemeSettings) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (t *ThemeSettings) EncodeBare(b *bin.Buffer) error { if t == nil { - return fmt.Errorf("can't encode themeSettings#8db4e76c as nil") + return fmt.Errorf("can't encode themeSettings#fa58b6d4 as nil") } if !(t.MessageColorsAnimated == false) { t.Flags.Set(2) } + if !(t.OutboxAccentColor == 0) { + t.Flags.Set(3) + } if !(t.MessageColors == nil) { t.Flags.Set(0) } @@ -196,15 +216,18 @@ func (t *ThemeSettings) EncodeBare(b *bin.Buffer) error { t.Flags.Set(1) } if err := t.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode themeSettings#8db4e76c: field flags: %w", err) + return fmt.Errorf("unable to encode themeSettings#fa58b6d4: field flags: %w", err) } if t.BaseTheme == nil { - return fmt.Errorf("unable to encode themeSettings#8db4e76c: field base_theme is nil") + return fmt.Errorf("unable to encode themeSettings#fa58b6d4: field base_theme is nil") } if err := t.BaseTheme.Encode(b); err != nil { - return fmt.Errorf("unable to encode themeSettings#8db4e76c: field base_theme: %w", err) + return fmt.Errorf("unable to encode themeSettings#fa58b6d4: field base_theme: %w", err) } b.PutInt(t.AccentColor) + if t.Flags.Has(3) { + b.PutInt(t.OutboxAccentColor) + } if t.Flags.Has(0) { b.PutVectorHeader(len(t.MessageColors)) for _, v := range t.MessageColors { @@ -213,10 +236,10 @@ func (t *ThemeSettings) EncodeBare(b *bin.Buffer) error { } if t.Flags.Has(1) { if t.Wallpaper == nil { - return fmt.Errorf("unable to encode themeSettings#8db4e76c: field wallpaper is nil") + return fmt.Errorf("unable to encode themeSettings#fa58b6d4: field wallpaper is nil") } if err := t.Wallpaper.Encode(b); err != nil { - return fmt.Errorf("unable to encode themeSettings#8db4e76c: field wallpaper: %w", err) + return fmt.Errorf("unable to encode themeSettings#fa58b6d4: field wallpaper: %w", err) } } return nil @@ -225,10 +248,10 @@ func (t *ThemeSettings) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (t *ThemeSettings) Decode(b *bin.Buffer) error { if t == nil { - return fmt.Errorf("can't decode themeSettings#8db4e76c to nil") + return fmt.Errorf("can't decode themeSettings#fa58b6d4 to nil") } if err := b.ConsumeID(ThemeSettingsTypeID); err != nil { - return fmt.Errorf("unable to decode themeSettings#8db4e76c: %w", err) + return fmt.Errorf("unable to decode themeSettings#fa58b6d4: %w", err) } return t.DecodeBare(b) } @@ -236,32 +259,39 @@ func (t *ThemeSettings) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (t *ThemeSettings) DecodeBare(b *bin.Buffer) error { if t == nil { - return fmt.Errorf("can't decode themeSettings#8db4e76c to nil") + return fmt.Errorf("can't decode themeSettings#fa58b6d4 to nil") } { if err := t.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode themeSettings#8db4e76c: field flags: %w", err) + return fmt.Errorf("unable to decode themeSettings#fa58b6d4: field flags: %w", err) } } t.MessageColorsAnimated = t.Flags.Has(2) { value, err := DecodeBaseTheme(b) if err != nil { - return fmt.Errorf("unable to decode themeSettings#8db4e76c: field base_theme: %w", err) + return fmt.Errorf("unable to decode themeSettings#fa58b6d4: field base_theme: %w", err) } t.BaseTheme = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode themeSettings#8db4e76c: field accent_color: %w", err) + return fmt.Errorf("unable to decode themeSettings#fa58b6d4: field accent_color: %w", err) } t.AccentColor = value } + if t.Flags.Has(3) { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode themeSettings#fa58b6d4: field outbox_accent_color: %w", err) + } + t.OutboxAccentColor = value + } if t.Flags.Has(0) { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode themeSettings#8db4e76c: field message_colors: %w", err) + return fmt.Errorf("unable to decode themeSettings#fa58b6d4: field message_colors: %w", err) } if headerLen > 0 { @@ -270,7 +300,7 @@ func (t *ThemeSettings) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode themeSettings#8db4e76c: field message_colors: %w", err) + return fmt.Errorf("unable to decode themeSettings#fa58b6d4: field message_colors: %w", err) } t.MessageColors = append(t.MessageColors, value) } @@ -278,7 +308,7 @@ func (t *ThemeSettings) DecodeBare(b *bin.Buffer) error { if t.Flags.Has(1) { value, err := DecodeWallPaper(b) if err != nil { - return fmt.Errorf("unable to decode themeSettings#8db4e76c: field wallpaper: %w", err) + return fmt.Errorf("unable to decode themeSettings#fa58b6d4: field wallpaper: %w", err) } t.Wallpaper = value } @@ -311,6 +341,21 @@ func (t *ThemeSettings) GetAccentColor() (value int) { return t.AccentColor } +// SetOutboxAccentColor sets value of OutboxAccentColor conditional field. +func (t *ThemeSettings) SetOutboxAccentColor(value int) { + t.Flags.Set(3) + t.OutboxAccentColor = value +} + +// GetOutboxAccentColor returns value of OutboxAccentColor conditional field and +// boolean which is true if field was set. +func (t *ThemeSettings) GetOutboxAccentColor() (value int, ok bool) { + if !t.Flags.Has(3) { + return value, false + } + return t.OutboxAccentColor, true +} + // SetMessageColors sets value of MessageColors conditional field. func (t *ThemeSettings) SetMessageColors(value []int) { t.Flags.Set(0) diff --git a/tg/tl_update_gen.go b/tg/tl_update_gen.go index bbf49e6274..de5000ca54 100644 --- a/tg/tl_update_gen.go +++ b/tg/tl_update_gen.go @@ -572,7 +572,7 @@ func (u *UpdateDeleteMessages) GetPtsCount() (value int) { return u.PtsCount } -// UpdateUserTyping represents TL type `updateUserTyping#5c486927`. +// UpdateUserTyping represents TL type `updateUserTyping#c01e857f`. // The user is preparing a message; typing, recording, uploading, etc. This update is // valid for 6 seconds. If no repeated update received after 6 seconds, it should be // considered that the user stopped doing whatever he's been doing. @@ -580,7 +580,7 @@ func (u *UpdateDeleteMessages) GetPtsCount() (value int) { // See https://core.telegram.org/constructor/updateUserTyping for reference. type UpdateUserTyping struct { // User id - UserID int + UserID int64 // Action typeParam added in Layer 17¹. // // Links: @@ -589,7 +589,7 @@ type UpdateUserTyping struct { } // UpdateUserTypingTypeID is TL type id of UpdateUserTyping. -const UpdateUserTypingTypeID = 0x5c486927 +const UpdateUserTypingTypeID = 0xc01e857f // construct implements constructor of UpdateClass. func (u UpdateUserTyping) construct() UpdateClass { return &u } @@ -629,7 +629,7 @@ func (u *UpdateUserTyping) String() string { // FillFrom fills UpdateUserTyping from given interface. func (u *UpdateUserTyping) FillFrom(from interface { - GetUserID() (value int) + GetUserID() (value int64) GetAction() (value SendMessageActionClass) }) { u.UserID = from.GetUserID() @@ -674,7 +674,7 @@ func (u *UpdateUserTyping) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateUserTyping) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateUserTyping#5c486927 as nil") + return fmt.Errorf("can't encode updateUserTyping#c01e857f as nil") } b.PutID(UpdateUserTypingTypeID) return u.EncodeBare(b) @@ -683,14 +683,14 @@ func (u *UpdateUserTyping) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateUserTyping) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateUserTyping#5c486927 as nil") + return fmt.Errorf("can't encode updateUserTyping#c01e857f as nil") } - b.PutInt(u.UserID) + b.PutLong(u.UserID) if u.Action == nil { - return fmt.Errorf("unable to encode updateUserTyping#5c486927: field action is nil") + return fmt.Errorf("unable to encode updateUserTyping#c01e857f: field action is nil") } if err := u.Action.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateUserTyping#5c486927: field action: %w", err) + return fmt.Errorf("unable to encode updateUserTyping#c01e857f: field action: %w", err) } return nil } @@ -698,10 +698,10 @@ func (u *UpdateUserTyping) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UpdateUserTyping) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateUserTyping#5c486927 to nil") + return fmt.Errorf("can't decode updateUserTyping#c01e857f to nil") } if err := b.ConsumeID(UpdateUserTypingTypeID); err != nil { - return fmt.Errorf("unable to decode updateUserTyping#5c486927: %w", err) + return fmt.Errorf("unable to decode updateUserTyping#c01e857f: %w", err) } return u.DecodeBare(b) } @@ -709,19 +709,19 @@ func (u *UpdateUserTyping) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateUserTyping) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateUserTyping#5c486927 to nil") + return fmt.Errorf("can't decode updateUserTyping#c01e857f to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateUserTyping#5c486927: field user_id: %w", err) + return fmt.Errorf("unable to decode updateUserTyping#c01e857f: field user_id: %w", err) } u.UserID = value } { value, err := DecodeSendMessageAction(b) if err != nil { - return fmt.Errorf("unable to decode updateUserTyping#5c486927: field action: %w", err) + return fmt.Errorf("unable to decode updateUserTyping#c01e857f: field action: %w", err) } u.Action = value } @@ -729,7 +729,7 @@ func (u *UpdateUserTyping) DecodeBare(b *bin.Buffer) error { } // GetUserID returns value of UserID field. -func (u *UpdateUserTyping) GetUserID() (value int) { +func (u *UpdateUserTyping) GetUserID() (value int64) { return u.UserID } @@ -738,7 +738,7 @@ func (u *UpdateUserTyping) GetAction() (value SendMessageActionClass) { return u.Action } -// UpdateChatUserTyping represents TL type `updateChatUserTyping#86cadb6c`. +// UpdateChatUserTyping represents TL type `updateChatUserTyping#83487af0`. // The user is preparing a message in a group; typing, recording, uploading, etc. This // update is valid for 6 seconds. If no repeated update received after 6 seconds, it // should be considered that the user stopped doing whatever he's been doing. @@ -746,7 +746,7 @@ func (u *UpdateUserTyping) GetAction() (value SendMessageActionClass) { // See https://core.telegram.org/constructor/updateChatUserTyping for reference. type UpdateChatUserTyping struct { // Group id - ChatID int + ChatID int64 // FromID field of UpdateChatUserTyping. FromID PeerClass // Type of actionParameter added in Layer 17¹. @@ -757,7 +757,7 @@ type UpdateChatUserTyping struct { } // UpdateChatUserTypingTypeID is TL type id of UpdateChatUserTyping. -const UpdateChatUserTypingTypeID = 0x86cadb6c +const UpdateChatUserTypingTypeID = 0x83487af0 // construct implements constructor of UpdateClass. func (u UpdateChatUserTyping) construct() UpdateClass { return &u } @@ -800,7 +800,7 @@ func (u *UpdateChatUserTyping) String() string { // FillFrom fills UpdateChatUserTyping from given interface. func (u *UpdateChatUserTyping) FillFrom(from interface { - GetChatID() (value int) + GetChatID() (value int64) GetFromID() (value PeerClass) GetAction() (value SendMessageActionClass) }) { @@ -851,7 +851,7 @@ func (u *UpdateChatUserTyping) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateChatUserTyping) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChatUserTyping#86cadb6c as nil") + return fmt.Errorf("can't encode updateChatUserTyping#83487af0 as nil") } b.PutID(UpdateChatUserTypingTypeID) return u.EncodeBare(b) @@ -860,20 +860,20 @@ func (u *UpdateChatUserTyping) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateChatUserTyping) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChatUserTyping#86cadb6c as nil") + return fmt.Errorf("can't encode updateChatUserTyping#83487af0 as nil") } - b.PutInt(u.ChatID) + b.PutLong(u.ChatID) if u.FromID == nil { - return fmt.Errorf("unable to encode updateChatUserTyping#86cadb6c: field from_id is nil") + return fmt.Errorf("unable to encode updateChatUserTyping#83487af0: field from_id is nil") } if err := u.FromID.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateChatUserTyping#86cadb6c: field from_id: %w", err) + return fmt.Errorf("unable to encode updateChatUserTyping#83487af0: field from_id: %w", err) } if u.Action == nil { - return fmt.Errorf("unable to encode updateChatUserTyping#86cadb6c: field action is nil") + return fmt.Errorf("unable to encode updateChatUserTyping#83487af0: field action is nil") } if err := u.Action.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateChatUserTyping#86cadb6c: field action: %w", err) + return fmt.Errorf("unable to encode updateChatUserTyping#83487af0: field action: %w", err) } return nil } @@ -881,10 +881,10 @@ func (u *UpdateChatUserTyping) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UpdateChatUserTyping) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChatUserTyping#86cadb6c to nil") + return fmt.Errorf("can't decode updateChatUserTyping#83487af0 to nil") } if err := b.ConsumeID(UpdateChatUserTypingTypeID); err != nil { - return fmt.Errorf("unable to decode updateChatUserTyping#86cadb6c: %w", err) + return fmt.Errorf("unable to decode updateChatUserTyping#83487af0: %w", err) } return u.DecodeBare(b) } @@ -892,26 +892,26 @@ func (u *UpdateChatUserTyping) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateChatUserTyping) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChatUserTyping#86cadb6c to nil") + return fmt.Errorf("can't decode updateChatUserTyping#83487af0 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateChatUserTyping#86cadb6c: field chat_id: %w", err) + return fmt.Errorf("unable to decode updateChatUserTyping#83487af0: field chat_id: %w", err) } u.ChatID = value } { value, err := DecodePeer(b) if err != nil { - return fmt.Errorf("unable to decode updateChatUserTyping#86cadb6c: field from_id: %w", err) + return fmt.Errorf("unable to decode updateChatUserTyping#83487af0: field from_id: %w", err) } u.FromID = value } { value, err := DecodeSendMessageAction(b) if err != nil { - return fmt.Errorf("unable to decode updateChatUserTyping#86cadb6c: field action: %w", err) + return fmt.Errorf("unable to decode updateChatUserTyping#83487af0: field action: %w", err) } u.Action = value } @@ -919,7 +919,7 @@ func (u *UpdateChatUserTyping) DecodeBare(b *bin.Buffer) error { } // GetChatID returns value of ChatID field. -func (u *UpdateChatUserTyping) GetChatID() (value int) { +func (u *UpdateChatUserTyping) GetChatID() (value int64) { return u.ChatID } @@ -1070,19 +1070,19 @@ func (u *UpdateChatParticipants) GetParticipants() (value ChatParticipantsClass) return u.Participants } -// UpdateUserStatus represents TL type `updateUserStatus#1bfbd823`. +// UpdateUserStatus represents TL type `updateUserStatus#e5bdf8de`. // Contact status update. // // See https://core.telegram.org/constructor/updateUserStatus for reference. type UpdateUserStatus struct { // User identifier - UserID int + UserID int64 // New status Status UserStatusClass } // UpdateUserStatusTypeID is TL type id of UpdateUserStatus. -const UpdateUserStatusTypeID = 0x1bfbd823 +const UpdateUserStatusTypeID = 0xe5bdf8de // construct implements constructor of UpdateClass. func (u UpdateUserStatus) construct() UpdateClass { return &u } @@ -1122,7 +1122,7 @@ func (u *UpdateUserStatus) String() string { // FillFrom fills UpdateUserStatus from given interface. func (u *UpdateUserStatus) FillFrom(from interface { - GetUserID() (value int) + GetUserID() (value int64) GetStatus() (value UserStatusClass) }) { u.UserID = from.GetUserID() @@ -1167,7 +1167,7 @@ func (u *UpdateUserStatus) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateUserStatus) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateUserStatus#1bfbd823 as nil") + return fmt.Errorf("can't encode updateUserStatus#e5bdf8de as nil") } b.PutID(UpdateUserStatusTypeID) return u.EncodeBare(b) @@ -1176,14 +1176,14 @@ func (u *UpdateUserStatus) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateUserStatus) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateUserStatus#1bfbd823 as nil") + return fmt.Errorf("can't encode updateUserStatus#e5bdf8de as nil") } - b.PutInt(u.UserID) + b.PutLong(u.UserID) if u.Status == nil { - return fmt.Errorf("unable to encode updateUserStatus#1bfbd823: field status is nil") + return fmt.Errorf("unable to encode updateUserStatus#e5bdf8de: field status is nil") } if err := u.Status.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateUserStatus#1bfbd823: field status: %w", err) + return fmt.Errorf("unable to encode updateUserStatus#e5bdf8de: field status: %w", err) } return nil } @@ -1191,10 +1191,10 @@ func (u *UpdateUserStatus) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UpdateUserStatus) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateUserStatus#1bfbd823 to nil") + return fmt.Errorf("can't decode updateUserStatus#e5bdf8de to nil") } if err := b.ConsumeID(UpdateUserStatusTypeID); err != nil { - return fmt.Errorf("unable to decode updateUserStatus#1bfbd823: %w", err) + return fmt.Errorf("unable to decode updateUserStatus#e5bdf8de: %w", err) } return u.DecodeBare(b) } @@ -1202,19 +1202,19 @@ func (u *UpdateUserStatus) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateUserStatus) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateUserStatus#1bfbd823 to nil") + return fmt.Errorf("can't decode updateUserStatus#e5bdf8de to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateUserStatus#1bfbd823: field user_id: %w", err) + return fmt.Errorf("unable to decode updateUserStatus#e5bdf8de: field user_id: %w", err) } u.UserID = value } { value, err := DecodeUserStatus(b) if err != nil { - return fmt.Errorf("unable to decode updateUserStatus#1bfbd823: field status: %w", err) + return fmt.Errorf("unable to decode updateUserStatus#e5bdf8de: field status: %w", err) } u.Status = value } @@ -1222,7 +1222,7 @@ func (u *UpdateUserStatus) DecodeBare(b *bin.Buffer) error { } // GetUserID returns value of UserID field. -func (u *UpdateUserStatus) GetUserID() (value int) { +func (u *UpdateUserStatus) GetUserID() (value int64) { return u.UserID } @@ -1231,13 +1231,13 @@ func (u *UpdateUserStatus) GetStatus() (value UserStatusClass) { return u.Status } -// UpdateUserName represents TL type `updateUserName#a7332b73`. +// UpdateUserName represents TL type `updateUserName#c3f202e0`. // Changes the user's first name, last name and username. // // See https://core.telegram.org/constructor/updateUserName for reference. type UpdateUserName struct { // User identifier - UserID int + UserID int64 // New first name. Corresponds to the new value of real_first_name field of the // userFull¹ constructor. // @@ -1258,7 +1258,7 @@ type UpdateUserName struct { } // UpdateUserNameTypeID is TL type id of UpdateUserName. -const UpdateUserNameTypeID = 0xa7332b73 +const UpdateUserNameTypeID = 0xc3f202e0 // construct implements constructor of UpdateClass. func (u UpdateUserName) construct() UpdateClass { return &u } @@ -1304,7 +1304,7 @@ func (u *UpdateUserName) String() string { // FillFrom fills UpdateUserName from given interface. func (u *UpdateUserName) FillFrom(from interface { - GetUserID() (value int) + GetUserID() (value int64) GetFirstName() (value string) GetLastName() (value string) GetUsername() (value string) @@ -1361,7 +1361,7 @@ func (u *UpdateUserName) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateUserName) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateUserName#a7332b73 as nil") + return fmt.Errorf("can't encode updateUserName#c3f202e0 as nil") } b.PutID(UpdateUserNameTypeID) return u.EncodeBare(b) @@ -1370,9 +1370,9 @@ func (u *UpdateUserName) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateUserName) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateUserName#a7332b73 as nil") + return fmt.Errorf("can't encode updateUserName#c3f202e0 as nil") } - b.PutInt(u.UserID) + b.PutLong(u.UserID) b.PutString(u.FirstName) b.PutString(u.LastName) b.PutString(u.Username) @@ -1382,10 +1382,10 @@ func (u *UpdateUserName) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UpdateUserName) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateUserName#a7332b73 to nil") + return fmt.Errorf("can't decode updateUserName#c3f202e0 to nil") } if err := b.ConsumeID(UpdateUserNameTypeID); err != nil { - return fmt.Errorf("unable to decode updateUserName#a7332b73: %w", err) + return fmt.Errorf("unable to decode updateUserName#c3f202e0: %w", err) } return u.DecodeBare(b) } @@ -1393,33 +1393,33 @@ func (u *UpdateUserName) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateUserName) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateUserName#a7332b73 to nil") + return fmt.Errorf("can't decode updateUserName#c3f202e0 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateUserName#a7332b73: field user_id: %w", err) + return fmt.Errorf("unable to decode updateUserName#c3f202e0: field user_id: %w", err) } u.UserID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode updateUserName#a7332b73: field first_name: %w", err) + return fmt.Errorf("unable to decode updateUserName#c3f202e0: field first_name: %w", err) } u.FirstName = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode updateUserName#a7332b73: field last_name: %w", err) + return fmt.Errorf("unable to decode updateUserName#c3f202e0: field last_name: %w", err) } u.LastName = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode updateUserName#a7332b73: field username: %w", err) + return fmt.Errorf("unable to decode updateUserName#c3f202e0: field username: %w", err) } u.Username = value } @@ -1427,7 +1427,7 @@ func (u *UpdateUserName) DecodeBare(b *bin.Buffer) error { } // GetUserID returns value of UserID field. -func (u *UpdateUserName) GetUserID() (value int) { +func (u *UpdateUserName) GetUserID() (value int64) { return u.UserID } @@ -1446,13 +1446,13 @@ func (u *UpdateUserName) GetUsername() (value string) { return u.Username } -// UpdateUserPhoto represents TL type `updateUserPhoto#95313b0c`. +// UpdateUserPhoto represents TL type `updateUserPhoto#f227868c`. // Change of contact's profile photo. // // See https://core.telegram.org/constructor/updateUserPhoto for reference. type UpdateUserPhoto struct { // User identifier - UserID int + UserID int64 // Date of photo update. Date int // New profile photo @@ -1465,7 +1465,7 @@ type UpdateUserPhoto struct { } // UpdateUserPhotoTypeID is TL type id of UpdateUserPhoto. -const UpdateUserPhotoTypeID = 0x95313b0c +const UpdateUserPhotoTypeID = 0xf227868c // construct implements constructor of UpdateClass. func (u UpdateUserPhoto) construct() UpdateClass { return &u } @@ -1511,7 +1511,7 @@ func (u *UpdateUserPhoto) String() string { // FillFrom fills UpdateUserPhoto from given interface. func (u *UpdateUserPhoto) FillFrom(from interface { - GetUserID() (value int) + GetUserID() (value int64) GetDate() (value int) GetPhoto() (value UserProfilePhotoClass) GetPrevious() (value bool) @@ -1568,7 +1568,7 @@ func (u *UpdateUserPhoto) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateUserPhoto) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateUserPhoto#95313b0c as nil") + return fmt.Errorf("can't encode updateUserPhoto#f227868c as nil") } b.PutID(UpdateUserPhotoTypeID) return u.EncodeBare(b) @@ -1577,15 +1577,15 @@ func (u *UpdateUserPhoto) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateUserPhoto) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateUserPhoto#95313b0c as nil") + return fmt.Errorf("can't encode updateUserPhoto#f227868c as nil") } - b.PutInt(u.UserID) + b.PutLong(u.UserID) b.PutInt(u.Date) if u.Photo == nil { - return fmt.Errorf("unable to encode updateUserPhoto#95313b0c: field photo is nil") + return fmt.Errorf("unable to encode updateUserPhoto#f227868c: field photo is nil") } if err := u.Photo.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateUserPhoto#95313b0c: field photo: %w", err) + return fmt.Errorf("unable to encode updateUserPhoto#f227868c: field photo: %w", err) } b.PutBool(u.Previous) return nil @@ -1594,10 +1594,10 @@ func (u *UpdateUserPhoto) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UpdateUserPhoto) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateUserPhoto#95313b0c to nil") + return fmt.Errorf("can't decode updateUserPhoto#f227868c to nil") } if err := b.ConsumeID(UpdateUserPhotoTypeID); err != nil { - return fmt.Errorf("unable to decode updateUserPhoto#95313b0c: %w", err) + return fmt.Errorf("unable to decode updateUserPhoto#f227868c: %w", err) } return u.DecodeBare(b) } @@ -1605,33 +1605,33 @@ func (u *UpdateUserPhoto) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateUserPhoto) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateUserPhoto#95313b0c to nil") + return fmt.Errorf("can't decode updateUserPhoto#f227868c to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateUserPhoto#95313b0c: field user_id: %w", err) + return fmt.Errorf("unable to decode updateUserPhoto#f227868c: field user_id: %w", err) } u.UserID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateUserPhoto#95313b0c: field date: %w", err) + return fmt.Errorf("unable to decode updateUserPhoto#f227868c: field date: %w", err) } u.Date = value } { value, err := DecodeUserProfilePhoto(b) if err != nil { - return fmt.Errorf("unable to decode updateUserPhoto#95313b0c: field photo: %w", err) + return fmt.Errorf("unable to decode updateUserPhoto#f227868c: field photo: %w", err) } u.Photo = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode updateUserPhoto#95313b0c: field previous: %w", err) + return fmt.Errorf("unable to decode updateUserPhoto#f227868c: field previous: %w", err) } u.Previous = value } @@ -1639,7 +1639,7 @@ func (u *UpdateUserPhoto) DecodeBare(b *bin.Buffer) error { } // GetUserID returns value of UserID field. -func (u *UpdateUserPhoto) GetUserID() (value int) { +func (u *UpdateUserPhoto) GetUserID() (value int64) { return u.UserID } @@ -2294,17 +2294,17 @@ func (u *UpdateEncryptedMessagesRead) GetDate() (value int) { return u.Date } -// UpdateChatParticipantAdd represents TL type `updateChatParticipantAdd#ea4b0e5c`. +// UpdateChatParticipantAdd represents TL type `updateChatParticipantAdd#3dda5451`. // New group member. // // See https://core.telegram.org/constructor/updateChatParticipantAdd for reference. type UpdateChatParticipantAdd struct { // Group ID - ChatID int + ChatID int64 // ID of the new member - UserID int + UserID int64 // ID of the user, who added member to the group - InviterID int + InviterID int64 // When was the participant added Date int // Chat version number @@ -2312,7 +2312,7 @@ type UpdateChatParticipantAdd struct { } // UpdateChatParticipantAddTypeID is TL type id of UpdateChatParticipantAdd. -const UpdateChatParticipantAddTypeID = 0xea4b0e5c +const UpdateChatParticipantAddTypeID = 0x3dda5451 // construct implements constructor of UpdateClass. func (u UpdateChatParticipantAdd) construct() UpdateClass { return &u } @@ -2361,9 +2361,9 @@ func (u *UpdateChatParticipantAdd) String() string { // FillFrom fills UpdateChatParticipantAdd from given interface. func (u *UpdateChatParticipantAdd) FillFrom(from interface { - GetChatID() (value int) - GetUserID() (value int) - GetInviterID() (value int) + GetChatID() (value int64) + GetUserID() (value int64) + GetInviterID() (value int64) GetDate() (value int) GetVersion() (value int) }) { @@ -2424,7 +2424,7 @@ func (u *UpdateChatParticipantAdd) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateChatParticipantAdd) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChatParticipantAdd#ea4b0e5c as nil") + return fmt.Errorf("can't encode updateChatParticipantAdd#3dda5451 as nil") } b.PutID(UpdateChatParticipantAddTypeID) return u.EncodeBare(b) @@ -2433,11 +2433,11 @@ func (u *UpdateChatParticipantAdd) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateChatParticipantAdd) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChatParticipantAdd#ea4b0e5c as nil") + return fmt.Errorf("can't encode updateChatParticipantAdd#3dda5451 as nil") } - b.PutInt(u.ChatID) - b.PutInt(u.UserID) - b.PutInt(u.InviterID) + b.PutLong(u.ChatID) + b.PutLong(u.UserID) + b.PutLong(u.InviterID) b.PutInt(u.Date) b.PutInt(u.Version) return nil @@ -2446,10 +2446,10 @@ func (u *UpdateChatParticipantAdd) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UpdateChatParticipantAdd) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChatParticipantAdd#ea4b0e5c to nil") + return fmt.Errorf("can't decode updateChatParticipantAdd#3dda5451 to nil") } if err := b.ConsumeID(UpdateChatParticipantAddTypeID); err != nil { - return fmt.Errorf("unable to decode updateChatParticipantAdd#ea4b0e5c: %w", err) + return fmt.Errorf("unable to decode updateChatParticipantAdd#3dda5451: %w", err) } return u.DecodeBare(b) } @@ -2457,40 +2457,40 @@ func (u *UpdateChatParticipantAdd) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateChatParticipantAdd) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChatParticipantAdd#ea4b0e5c to nil") + return fmt.Errorf("can't decode updateChatParticipantAdd#3dda5451 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateChatParticipantAdd#ea4b0e5c: field chat_id: %w", err) + return fmt.Errorf("unable to decode updateChatParticipantAdd#3dda5451: field chat_id: %w", err) } u.ChatID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateChatParticipantAdd#ea4b0e5c: field user_id: %w", err) + return fmt.Errorf("unable to decode updateChatParticipantAdd#3dda5451: field user_id: %w", err) } u.UserID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateChatParticipantAdd#ea4b0e5c: field inviter_id: %w", err) + return fmt.Errorf("unable to decode updateChatParticipantAdd#3dda5451: field inviter_id: %w", err) } u.InviterID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateChatParticipantAdd#ea4b0e5c: field date: %w", err) + return fmt.Errorf("unable to decode updateChatParticipantAdd#3dda5451: field date: %w", err) } u.Date = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateChatParticipantAdd#ea4b0e5c: field version: %w", err) + return fmt.Errorf("unable to decode updateChatParticipantAdd#3dda5451: field version: %w", err) } u.Version = value } @@ -2498,17 +2498,17 @@ func (u *UpdateChatParticipantAdd) DecodeBare(b *bin.Buffer) error { } // GetChatID returns value of ChatID field. -func (u *UpdateChatParticipantAdd) GetChatID() (value int) { +func (u *UpdateChatParticipantAdd) GetChatID() (value int64) { return u.ChatID } // GetUserID returns value of UserID field. -func (u *UpdateChatParticipantAdd) GetUserID() (value int) { +func (u *UpdateChatParticipantAdd) GetUserID() (value int64) { return u.UserID } // GetInviterID returns value of InviterID field. -func (u *UpdateChatParticipantAdd) GetInviterID() (value int) { +func (u *UpdateChatParticipantAdd) GetInviterID() (value int64) { return u.InviterID } @@ -2522,21 +2522,21 @@ func (u *UpdateChatParticipantAdd) GetVersion() (value int) { return u.Version } -// UpdateChatParticipantDelete represents TL type `updateChatParticipantDelete#6e5f8c22`. +// UpdateChatParticipantDelete represents TL type `updateChatParticipantDelete#e32f3d77`. // A member has left the group. // // See https://core.telegram.org/constructor/updateChatParticipantDelete for reference. type UpdateChatParticipantDelete struct { // Group ID - ChatID int + ChatID int64 // ID of the user - UserID int + UserID int64 // Used in basic groups to reorder updates and make sure that all of them was received. Version int } // UpdateChatParticipantDeleteTypeID is TL type id of UpdateChatParticipantDelete. -const UpdateChatParticipantDeleteTypeID = 0x6e5f8c22 +const UpdateChatParticipantDeleteTypeID = 0xe32f3d77 // construct implements constructor of UpdateClass. func (u UpdateChatParticipantDelete) construct() UpdateClass { return &u } @@ -2579,8 +2579,8 @@ func (u *UpdateChatParticipantDelete) String() string { // FillFrom fills UpdateChatParticipantDelete from given interface. func (u *UpdateChatParticipantDelete) FillFrom(from interface { - GetChatID() (value int) - GetUserID() (value int) + GetChatID() (value int64) + GetUserID() (value int64) GetVersion() (value int) }) { u.ChatID = from.GetChatID() @@ -2630,7 +2630,7 @@ func (u *UpdateChatParticipantDelete) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateChatParticipantDelete) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChatParticipantDelete#6e5f8c22 as nil") + return fmt.Errorf("can't encode updateChatParticipantDelete#e32f3d77 as nil") } b.PutID(UpdateChatParticipantDeleteTypeID) return u.EncodeBare(b) @@ -2639,10 +2639,10 @@ func (u *UpdateChatParticipantDelete) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateChatParticipantDelete) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChatParticipantDelete#6e5f8c22 as nil") + return fmt.Errorf("can't encode updateChatParticipantDelete#e32f3d77 as nil") } - b.PutInt(u.ChatID) - b.PutInt(u.UserID) + b.PutLong(u.ChatID) + b.PutLong(u.UserID) b.PutInt(u.Version) return nil } @@ -2650,10 +2650,10 @@ func (u *UpdateChatParticipantDelete) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UpdateChatParticipantDelete) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChatParticipantDelete#6e5f8c22 to nil") + return fmt.Errorf("can't decode updateChatParticipantDelete#e32f3d77 to nil") } if err := b.ConsumeID(UpdateChatParticipantDeleteTypeID); err != nil { - return fmt.Errorf("unable to decode updateChatParticipantDelete#6e5f8c22: %w", err) + return fmt.Errorf("unable to decode updateChatParticipantDelete#e32f3d77: %w", err) } return u.DecodeBare(b) } @@ -2661,26 +2661,26 @@ func (u *UpdateChatParticipantDelete) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateChatParticipantDelete) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChatParticipantDelete#6e5f8c22 to nil") + return fmt.Errorf("can't decode updateChatParticipantDelete#e32f3d77 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateChatParticipantDelete#6e5f8c22: field chat_id: %w", err) + return fmt.Errorf("unable to decode updateChatParticipantDelete#e32f3d77: field chat_id: %w", err) } u.ChatID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateChatParticipantDelete#6e5f8c22: field user_id: %w", err) + return fmt.Errorf("unable to decode updateChatParticipantDelete#e32f3d77: field user_id: %w", err) } u.UserID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateChatParticipantDelete#6e5f8c22: field version: %w", err) + return fmt.Errorf("unable to decode updateChatParticipantDelete#e32f3d77: field version: %w", err) } u.Version = value } @@ -2688,12 +2688,12 @@ func (u *UpdateChatParticipantDelete) DecodeBare(b *bin.Buffer) error { } // GetChatID returns value of ChatID field. -func (u *UpdateChatParticipantDelete) GetChatID() (value int) { +func (u *UpdateChatParticipantDelete) GetChatID() (value int64) { return u.ChatID } // GetUserID returns value of UserID field. -func (u *UpdateChatParticipantDelete) GetUserID() (value int) { +func (u *UpdateChatParticipantDelete) GetUserID() (value int64) { return u.UserID } @@ -3534,19 +3534,19 @@ func (u *UpdatePrivacy) MapRules() (value PrivacyRuleClassArray) { return PrivacyRuleClassArray(u.Rules) } -// UpdateUserPhone represents TL type `updateUserPhone#12b9417b`. +// UpdateUserPhone represents TL type `updateUserPhone#5492a13`. // A user's phone number was changed // // See https://core.telegram.org/constructor/updateUserPhone for reference. type UpdateUserPhone struct { // User ID - UserID int + UserID int64 // New phone number Phone string } // UpdateUserPhoneTypeID is TL type id of UpdateUserPhone. -const UpdateUserPhoneTypeID = 0x12b9417b +const UpdateUserPhoneTypeID = 0x5492a13 // construct implements constructor of UpdateClass. func (u UpdateUserPhone) construct() UpdateClass { return &u } @@ -3586,7 +3586,7 @@ func (u *UpdateUserPhone) String() string { // FillFrom fills UpdateUserPhone from given interface. func (u *UpdateUserPhone) FillFrom(from interface { - GetUserID() (value int) + GetUserID() (value int64) GetPhone() (value string) }) { u.UserID = from.GetUserID() @@ -3631,7 +3631,7 @@ func (u *UpdateUserPhone) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateUserPhone) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateUserPhone#12b9417b as nil") + return fmt.Errorf("can't encode updateUserPhone#5492a13 as nil") } b.PutID(UpdateUserPhoneTypeID) return u.EncodeBare(b) @@ -3640,9 +3640,9 @@ func (u *UpdateUserPhone) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateUserPhone) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateUserPhone#12b9417b as nil") + return fmt.Errorf("can't encode updateUserPhone#5492a13 as nil") } - b.PutInt(u.UserID) + b.PutLong(u.UserID) b.PutString(u.Phone) return nil } @@ -3650,10 +3650,10 @@ func (u *UpdateUserPhone) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UpdateUserPhone) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateUserPhone#12b9417b to nil") + return fmt.Errorf("can't decode updateUserPhone#5492a13 to nil") } if err := b.ConsumeID(UpdateUserPhoneTypeID); err != nil { - return fmt.Errorf("unable to decode updateUserPhone#12b9417b: %w", err) + return fmt.Errorf("unable to decode updateUserPhone#5492a13: %w", err) } return u.DecodeBare(b) } @@ -3661,19 +3661,19 @@ func (u *UpdateUserPhone) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateUserPhone) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateUserPhone#12b9417b to nil") + return fmt.Errorf("can't decode updateUserPhone#5492a13 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateUserPhone#12b9417b: field user_id: %w", err) + return fmt.Errorf("unable to decode updateUserPhone#5492a13: field user_id: %w", err) } u.UserID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode updateUserPhone#12b9417b: field phone: %w", err) + return fmt.Errorf("unable to decode updateUserPhone#5492a13: field phone: %w", err) } u.Phone = value } @@ -3681,7 +3681,7 @@ func (u *UpdateUserPhone) DecodeBare(b *bin.Buffer) error { } // GetUserID returns value of UserID field. -func (u *UpdateUserPhone) GetUserID() (value int) { +func (u *UpdateUserPhone) GetUserID() (value int64) { return u.UserID } @@ -4604,7 +4604,7 @@ func (u *UpdateReadMessagesContents) GetPtsCount() (value int) { return u.PtsCount } -// UpdateChannelTooLong represents TL type `updateChannelTooLong#eb0467fb`. +// UpdateChannelTooLong represents TL type `updateChannelTooLong#108d941f`. // There are new updates in the specified channel, the client must fetch them. // If the difference is too long or if the channel isn't currently in the states, start // fetching from the specified pts. @@ -4617,7 +4617,7 @@ type UpdateChannelTooLong struct { // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields // The channel - ChannelID int + ChannelID int64 // The PTS¹. // // Links: @@ -4628,7 +4628,7 @@ type UpdateChannelTooLong struct { } // UpdateChannelTooLongTypeID is TL type id of UpdateChannelTooLong. -const UpdateChannelTooLongTypeID = 0xeb0467fb +const UpdateChannelTooLongTypeID = 0x108d941f // construct implements constructor of UpdateClass. func (u UpdateChannelTooLong) construct() UpdateClass { return &u } @@ -4671,7 +4671,7 @@ func (u *UpdateChannelTooLong) String() string { // FillFrom fills UpdateChannelTooLong from given interface. func (u *UpdateChannelTooLong) FillFrom(from interface { - GetChannelID() (value int) + GetChannelID() (value int64) GetPts() (value int, ok bool) }) { u.ChannelID = from.GetChannelID() @@ -4720,7 +4720,7 @@ func (u *UpdateChannelTooLong) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateChannelTooLong) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChannelTooLong#eb0467fb as nil") + return fmt.Errorf("can't encode updateChannelTooLong#108d941f as nil") } b.PutID(UpdateChannelTooLongTypeID) return u.EncodeBare(b) @@ -4729,15 +4729,15 @@ func (u *UpdateChannelTooLong) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateChannelTooLong) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChannelTooLong#eb0467fb as nil") + return fmt.Errorf("can't encode updateChannelTooLong#108d941f as nil") } if !(u.Pts == 0) { u.Flags.Set(0) } if err := u.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateChannelTooLong#eb0467fb: field flags: %w", err) + return fmt.Errorf("unable to encode updateChannelTooLong#108d941f: field flags: %w", err) } - b.PutInt(u.ChannelID) + b.PutLong(u.ChannelID) if u.Flags.Has(0) { b.PutInt(u.Pts) } @@ -4747,10 +4747,10 @@ func (u *UpdateChannelTooLong) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UpdateChannelTooLong) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChannelTooLong#eb0467fb to nil") + return fmt.Errorf("can't decode updateChannelTooLong#108d941f to nil") } if err := b.ConsumeID(UpdateChannelTooLongTypeID); err != nil { - return fmt.Errorf("unable to decode updateChannelTooLong#eb0467fb: %w", err) + return fmt.Errorf("unable to decode updateChannelTooLong#108d941f: %w", err) } return u.DecodeBare(b) } @@ -4758,24 +4758,24 @@ func (u *UpdateChannelTooLong) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateChannelTooLong) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChannelTooLong#eb0467fb to nil") + return fmt.Errorf("can't decode updateChannelTooLong#108d941f to nil") } { if err := u.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode updateChannelTooLong#eb0467fb: field flags: %w", err) + return fmt.Errorf("unable to decode updateChannelTooLong#108d941f: field flags: %w", err) } } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateChannelTooLong#eb0467fb: field channel_id: %w", err) + return fmt.Errorf("unable to decode updateChannelTooLong#108d941f: field channel_id: %w", err) } u.ChannelID = value } if u.Flags.Has(0) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateChannelTooLong#eb0467fb: field pts: %w", err) + return fmt.Errorf("unable to decode updateChannelTooLong#108d941f: field pts: %w", err) } u.Pts = value } @@ -4783,7 +4783,7 @@ func (u *UpdateChannelTooLong) DecodeBare(b *bin.Buffer) error { } // GetChannelID returns value of ChannelID field. -func (u *UpdateChannelTooLong) GetChannelID() (value int) { +func (u *UpdateChannelTooLong) GetChannelID() (value int64) { return u.ChannelID } @@ -4802,17 +4802,17 @@ func (u *UpdateChannelTooLong) GetPts() (value int, ok bool) { return u.Pts, true } -// UpdateChannel represents TL type `updateChannel#b6d45656`. +// UpdateChannel represents TL type `updateChannel#635b4c09`. // A new channel is available // // See https://core.telegram.org/constructor/updateChannel for reference. type UpdateChannel struct { // Channel ID - ChannelID int + ChannelID int64 } // UpdateChannelTypeID is TL type id of UpdateChannel. -const UpdateChannelTypeID = 0xb6d45656 +const UpdateChannelTypeID = 0x635b4c09 // construct implements constructor of UpdateClass. func (u UpdateChannel) construct() UpdateClass { return &u } @@ -4849,7 +4849,7 @@ func (u *UpdateChannel) String() string { // FillFrom fills UpdateChannel from given interface. func (u *UpdateChannel) FillFrom(from interface { - GetChannelID() (value int) + GetChannelID() (value int64) }) { u.ChannelID = from.GetChannelID() } @@ -4888,7 +4888,7 @@ func (u *UpdateChannel) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateChannel) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChannel#b6d45656 as nil") + return fmt.Errorf("can't encode updateChannel#635b4c09 as nil") } b.PutID(UpdateChannelTypeID) return u.EncodeBare(b) @@ -4897,19 +4897,19 @@ func (u *UpdateChannel) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateChannel) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChannel#b6d45656 as nil") + return fmt.Errorf("can't encode updateChannel#635b4c09 as nil") } - b.PutInt(u.ChannelID) + b.PutLong(u.ChannelID) return nil } // Decode implements bin.Decoder. func (u *UpdateChannel) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChannel#b6d45656 to nil") + return fmt.Errorf("can't decode updateChannel#635b4c09 to nil") } if err := b.ConsumeID(UpdateChannelTypeID); err != nil { - return fmt.Errorf("unable to decode updateChannel#b6d45656: %w", err) + return fmt.Errorf("unable to decode updateChannel#635b4c09: %w", err) } return u.DecodeBare(b) } @@ -4917,12 +4917,12 @@ func (u *UpdateChannel) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateChannel) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChannel#b6d45656 to nil") + return fmt.Errorf("can't decode updateChannel#635b4c09 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateChannel#b6d45656: field channel_id: %w", err) + return fmt.Errorf("unable to decode updateChannel#635b4c09: field channel_id: %w", err) } u.ChannelID = value } @@ -4930,7 +4930,7 @@ func (u *UpdateChannel) DecodeBare(b *bin.Buffer) error { } // GetChannelID returns value of ChannelID field. -func (u *UpdateChannel) GetChannelID() (value int) { +func (u *UpdateChannel) GetChannelID() (value int64) { return u.ChannelID } @@ -5128,7 +5128,7 @@ func (u *UpdateNewChannelMessage) GetPtsCount() (value int) { return u.PtsCount } -// UpdateReadChannelInbox represents TL type `updateReadChannelInbox#330b5424`. +// UpdateReadChannelInbox represents TL type `updateReadChannelInbox#922e6e10`. // Incoming messages in a channel/supergroup¹ were read // // Links: @@ -5149,7 +5149,7 @@ type UpdateReadChannelInbox struct { // Use SetFolderID and GetFolderID helpers. FolderID int // Channel/supergroup ID - ChannelID int + ChannelID int64 // Position up to which all incoming messages are read. MaxID int // Count of messages weren't read yet @@ -5162,7 +5162,7 @@ type UpdateReadChannelInbox struct { } // UpdateReadChannelInboxTypeID is TL type id of UpdateReadChannelInbox. -const UpdateReadChannelInboxTypeID = 0x330b5424 +const UpdateReadChannelInboxTypeID = 0x922e6e10 // construct implements constructor of UpdateClass. func (u UpdateReadChannelInbox) construct() UpdateClass { return &u } @@ -5215,7 +5215,7 @@ func (u *UpdateReadChannelInbox) String() string { // FillFrom fills UpdateReadChannelInbox from given interface. func (u *UpdateReadChannelInbox) FillFrom(from interface { GetFolderID() (value int, ok bool) - GetChannelID() (value int) + GetChannelID() (value int64) GetMaxID() (value int) GetStillUnreadCount() (value int) GetPts() (value int) @@ -5281,7 +5281,7 @@ func (u *UpdateReadChannelInbox) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateReadChannelInbox) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateReadChannelInbox#330b5424 as nil") + return fmt.Errorf("can't encode updateReadChannelInbox#922e6e10 as nil") } b.PutID(UpdateReadChannelInboxTypeID) return u.EncodeBare(b) @@ -5290,18 +5290,18 @@ func (u *UpdateReadChannelInbox) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateReadChannelInbox) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateReadChannelInbox#330b5424 as nil") + return fmt.Errorf("can't encode updateReadChannelInbox#922e6e10 as nil") } if !(u.FolderID == 0) { u.Flags.Set(0) } if err := u.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateReadChannelInbox#330b5424: field flags: %w", err) + return fmt.Errorf("unable to encode updateReadChannelInbox#922e6e10: field flags: %w", err) } if u.Flags.Has(0) { b.PutInt(u.FolderID) } - b.PutInt(u.ChannelID) + b.PutLong(u.ChannelID) b.PutInt(u.MaxID) b.PutInt(u.StillUnreadCount) b.PutInt(u.Pts) @@ -5311,10 +5311,10 @@ func (u *UpdateReadChannelInbox) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UpdateReadChannelInbox) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateReadChannelInbox#330b5424 to nil") + return fmt.Errorf("can't decode updateReadChannelInbox#922e6e10 to nil") } if err := b.ConsumeID(UpdateReadChannelInboxTypeID); err != nil { - return fmt.Errorf("unable to decode updateReadChannelInbox#330b5424: %w", err) + return fmt.Errorf("unable to decode updateReadChannelInbox#922e6e10: %w", err) } return u.DecodeBare(b) } @@ -5322,45 +5322,45 @@ func (u *UpdateReadChannelInbox) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateReadChannelInbox) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateReadChannelInbox#330b5424 to nil") + return fmt.Errorf("can't decode updateReadChannelInbox#922e6e10 to nil") } { if err := u.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode updateReadChannelInbox#330b5424: field flags: %w", err) + return fmt.Errorf("unable to decode updateReadChannelInbox#922e6e10: field flags: %w", err) } } if u.Flags.Has(0) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateReadChannelInbox#330b5424: field folder_id: %w", err) + return fmt.Errorf("unable to decode updateReadChannelInbox#922e6e10: field folder_id: %w", err) } u.FolderID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateReadChannelInbox#330b5424: field channel_id: %w", err) + return fmt.Errorf("unable to decode updateReadChannelInbox#922e6e10: field channel_id: %w", err) } u.ChannelID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateReadChannelInbox#330b5424: field max_id: %w", err) + return fmt.Errorf("unable to decode updateReadChannelInbox#922e6e10: field max_id: %w", err) } u.MaxID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateReadChannelInbox#330b5424: field still_unread_count: %w", err) + return fmt.Errorf("unable to decode updateReadChannelInbox#922e6e10: field still_unread_count: %w", err) } u.StillUnreadCount = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateReadChannelInbox#330b5424: field pts: %w", err) + return fmt.Errorf("unable to decode updateReadChannelInbox#922e6e10: field pts: %w", err) } u.Pts = value } @@ -5383,7 +5383,7 @@ func (u *UpdateReadChannelInbox) GetFolderID() (value int, ok bool) { } // GetChannelID returns value of ChannelID field. -func (u *UpdateReadChannelInbox) GetChannelID() (value int) { +func (u *UpdateReadChannelInbox) GetChannelID() (value int64) { return u.ChannelID } @@ -5402,7 +5402,7 @@ func (u *UpdateReadChannelInbox) GetPts() (value int) { return u.Pts } -// UpdateDeleteChannelMessages represents TL type `updateDeleteChannelMessages#c37521c9`. +// UpdateDeleteChannelMessages represents TL type `updateDeleteChannelMessages#c32d5b12`. // Some messages in a supergroup/channel¹ were deleted // // Links: @@ -5411,7 +5411,7 @@ func (u *UpdateReadChannelInbox) GetPts() (value int) { // See https://core.telegram.org/constructor/updateDeleteChannelMessages for reference. type UpdateDeleteChannelMessages struct { // Channel ID - ChannelID int + ChannelID int64 // IDs of messages that were deleted Messages []int // Event count after generation¹ @@ -5427,7 +5427,7 @@ type UpdateDeleteChannelMessages struct { } // UpdateDeleteChannelMessagesTypeID is TL type id of UpdateDeleteChannelMessages. -const UpdateDeleteChannelMessagesTypeID = 0xc37521c9 +const UpdateDeleteChannelMessagesTypeID = 0xc32d5b12 // construct implements constructor of UpdateClass. func (u UpdateDeleteChannelMessages) construct() UpdateClass { return &u } @@ -5473,7 +5473,7 @@ func (u *UpdateDeleteChannelMessages) String() string { // FillFrom fills UpdateDeleteChannelMessages from given interface. func (u *UpdateDeleteChannelMessages) FillFrom(from interface { - GetChannelID() (value int) + GetChannelID() (value int64) GetMessages() (value []int) GetPts() (value int) GetPtsCount() (value int) @@ -5530,7 +5530,7 @@ func (u *UpdateDeleteChannelMessages) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateDeleteChannelMessages) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateDeleteChannelMessages#c37521c9 as nil") + return fmt.Errorf("can't encode updateDeleteChannelMessages#c32d5b12 as nil") } b.PutID(UpdateDeleteChannelMessagesTypeID) return u.EncodeBare(b) @@ -5539,9 +5539,9 @@ func (u *UpdateDeleteChannelMessages) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateDeleteChannelMessages) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateDeleteChannelMessages#c37521c9 as nil") + return fmt.Errorf("can't encode updateDeleteChannelMessages#c32d5b12 as nil") } - b.PutInt(u.ChannelID) + b.PutLong(u.ChannelID) b.PutVectorHeader(len(u.Messages)) for _, v := range u.Messages { b.PutInt(v) @@ -5554,10 +5554,10 @@ func (u *UpdateDeleteChannelMessages) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UpdateDeleteChannelMessages) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateDeleteChannelMessages#c37521c9 to nil") + return fmt.Errorf("can't decode updateDeleteChannelMessages#c32d5b12 to nil") } if err := b.ConsumeID(UpdateDeleteChannelMessagesTypeID); err != nil { - return fmt.Errorf("unable to decode updateDeleteChannelMessages#c37521c9: %w", err) + return fmt.Errorf("unable to decode updateDeleteChannelMessages#c32d5b12: %w", err) } return u.DecodeBare(b) } @@ -5565,19 +5565,19 @@ func (u *UpdateDeleteChannelMessages) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateDeleteChannelMessages) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateDeleteChannelMessages#c37521c9 to nil") + return fmt.Errorf("can't decode updateDeleteChannelMessages#c32d5b12 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateDeleteChannelMessages#c37521c9: field channel_id: %w", err) + return fmt.Errorf("unable to decode updateDeleteChannelMessages#c32d5b12: field channel_id: %w", err) } u.ChannelID = value } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode updateDeleteChannelMessages#c37521c9: field messages: %w", err) + return fmt.Errorf("unable to decode updateDeleteChannelMessages#c32d5b12: field messages: %w", err) } if headerLen > 0 { @@ -5586,7 +5586,7 @@ func (u *UpdateDeleteChannelMessages) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateDeleteChannelMessages#c37521c9: field messages: %w", err) + return fmt.Errorf("unable to decode updateDeleteChannelMessages#c32d5b12: field messages: %w", err) } u.Messages = append(u.Messages, value) } @@ -5594,14 +5594,14 @@ func (u *UpdateDeleteChannelMessages) DecodeBare(b *bin.Buffer) error { { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateDeleteChannelMessages#c37521c9: field pts: %w", err) + return fmt.Errorf("unable to decode updateDeleteChannelMessages#c32d5b12: field pts: %w", err) } u.Pts = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateDeleteChannelMessages#c37521c9: field pts_count: %w", err) + return fmt.Errorf("unable to decode updateDeleteChannelMessages#c32d5b12: field pts_count: %w", err) } u.PtsCount = value } @@ -5609,7 +5609,7 @@ func (u *UpdateDeleteChannelMessages) DecodeBare(b *bin.Buffer) error { } // GetChannelID returns value of ChannelID field. -func (u *UpdateDeleteChannelMessages) GetChannelID() (value int) { +func (u *UpdateDeleteChannelMessages) GetChannelID() (value int64) { return u.ChannelID } @@ -5628,13 +5628,13 @@ func (u *UpdateDeleteChannelMessages) GetPtsCount() (value int) { return u.PtsCount } -// UpdateChannelMessageViews represents TL type `updateChannelMessageViews#98a12b4b`. +// UpdateChannelMessageViews represents TL type `updateChannelMessageViews#f226ac08`. // The view counter of a message in a channel has changed // // See https://core.telegram.org/constructor/updateChannelMessageViews for reference. type UpdateChannelMessageViews struct { // Channel ID - ChannelID int + ChannelID int64 // ID of the message ID int // New view counter @@ -5642,7 +5642,7 @@ type UpdateChannelMessageViews struct { } // UpdateChannelMessageViewsTypeID is TL type id of UpdateChannelMessageViews. -const UpdateChannelMessageViewsTypeID = 0x98a12b4b +const UpdateChannelMessageViewsTypeID = 0xf226ac08 // construct implements constructor of UpdateClass. func (u UpdateChannelMessageViews) construct() UpdateClass { return &u } @@ -5685,7 +5685,7 @@ func (u *UpdateChannelMessageViews) String() string { // FillFrom fills UpdateChannelMessageViews from given interface. func (u *UpdateChannelMessageViews) FillFrom(from interface { - GetChannelID() (value int) + GetChannelID() (value int64) GetID() (value int) GetViews() (value int) }) { @@ -5736,7 +5736,7 @@ func (u *UpdateChannelMessageViews) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateChannelMessageViews) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChannelMessageViews#98a12b4b as nil") + return fmt.Errorf("can't encode updateChannelMessageViews#f226ac08 as nil") } b.PutID(UpdateChannelMessageViewsTypeID) return u.EncodeBare(b) @@ -5745,9 +5745,9 @@ func (u *UpdateChannelMessageViews) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateChannelMessageViews) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChannelMessageViews#98a12b4b as nil") + return fmt.Errorf("can't encode updateChannelMessageViews#f226ac08 as nil") } - b.PutInt(u.ChannelID) + b.PutLong(u.ChannelID) b.PutInt(u.ID) b.PutInt(u.Views) return nil @@ -5756,10 +5756,10 @@ func (u *UpdateChannelMessageViews) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UpdateChannelMessageViews) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChannelMessageViews#98a12b4b to nil") + return fmt.Errorf("can't decode updateChannelMessageViews#f226ac08 to nil") } if err := b.ConsumeID(UpdateChannelMessageViewsTypeID); err != nil { - return fmt.Errorf("unable to decode updateChannelMessageViews#98a12b4b: %w", err) + return fmt.Errorf("unable to decode updateChannelMessageViews#f226ac08: %w", err) } return u.DecodeBare(b) } @@ -5767,26 +5767,26 @@ func (u *UpdateChannelMessageViews) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateChannelMessageViews) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChannelMessageViews#98a12b4b to nil") + return fmt.Errorf("can't decode updateChannelMessageViews#f226ac08 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateChannelMessageViews#98a12b4b: field channel_id: %w", err) + return fmt.Errorf("unable to decode updateChannelMessageViews#f226ac08: field channel_id: %w", err) } u.ChannelID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateChannelMessageViews#98a12b4b: field id: %w", err) + return fmt.Errorf("unable to decode updateChannelMessageViews#f226ac08: field id: %w", err) } u.ID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateChannelMessageViews#98a12b4b: field views: %w", err) + return fmt.Errorf("unable to decode updateChannelMessageViews#f226ac08: field views: %w", err) } u.Views = value } @@ -5794,7 +5794,7 @@ func (u *UpdateChannelMessageViews) DecodeBare(b *bin.Buffer) error { } // GetChannelID returns value of ChannelID field. -func (u *UpdateChannelMessageViews) GetChannelID() (value int) { +func (u *UpdateChannelMessageViews) GetChannelID() (value int64) { return u.ChannelID } @@ -5808,7 +5808,7 @@ func (u *UpdateChannelMessageViews) GetViews() (value int) { return u.Views } -// UpdateChatParticipantAdmin represents TL type `updateChatParticipantAdmin#b6901959`. +// UpdateChatParticipantAdmin represents TL type `updateChatParticipantAdmin#d7ca61a2`. // Admin permissions of a user in a legacy group¹ were changed // // Links: @@ -5817,9 +5817,9 @@ func (u *UpdateChannelMessageViews) GetViews() (value int) { // See https://core.telegram.org/constructor/updateChatParticipantAdmin for reference. type UpdateChatParticipantAdmin struct { // Chat ID - ChatID int + ChatID int64 // ID of the (de)admined user - UserID int + UserID int64 // Whether the user was rendered admin IsAdmin bool // Used in basic groups to reorder updates and make sure that all of them was received. @@ -5827,7 +5827,7 @@ type UpdateChatParticipantAdmin struct { } // UpdateChatParticipantAdminTypeID is TL type id of UpdateChatParticipantAdmin. -const UpdateChatParticipantAdminTypeID = 0xb6901959 +const UpdateChatParticipantAdminTypeID = 0xd7ca61a2 // construct implements constructor of UpdateClass. func (u UpdateChatParticipantAdmin) construct() UpdateClass { return &u } @@ -5873,8 +5873,8 @@ func (u *UpdateChatParticipantAdmin) String() string { // FillFrom fills UpdateChatParticipantAdmin from given interface. func (u *UpdateChatParticipantAdmin) FillFrom(from interface { - GetChatID() (value int) - GetUserID() (value int) + GetChatID() (value int64) + GetUserID() (value int64) GetIsAdmin() (value bool) GetVersion() (value int) }) { @@ -5930,7 +5930,7 @@ func (u *UpdateChatParticipantAdmin) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateChatParticipantAdmin) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChatParticipantAdmin#b6901959 as nil") + return fmt.Errorf("can't encode updateChatParticipantAdmin#d7ca61a2 as nil") } b.PutID(UpdateChatParticipantAdminTypeID) return u.EncodeBare(b) @@ -5939,10 +5939,10 @@ func (u *UpdateChatParticipantAdmin) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateChatParticipantAdmin) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChatParticipantAdmin#b6901959 as nil") + return fmt.Errorf("can't encode updateChatParticipantAdmin#d7ca61a2 as nil") } - b.PutInt(u.ChatID) - b.PutInt(u.UserID) + b.PutLong(u.ChatID) + b.PutLong(u.UserID) b.PutBool(u.IsAdmin) b.PutInt(u.Version) return nil @@ -5951,10 +5951,10 @@ func (u *UpdateChatParticipantAdmin) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UpdateChatParticipantAdmin) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChatParticipantAdmin#b6901959 to nil") + return fmt.Errorf("can't decode updateChatParticipantAdmin#d7ca61a2 to nil") } if err := b.ConsumeID(UpdateChatParticipantAdminTypeID); err != nil { - return fmt.Errorf("unable to decode updateChatParticipantAdmin#b6901959: %w", err) + return fmt.Errorf("unable to decode updateChatParticipantAdmin#d7ca61a2: %w", err) } return u.DecodeBare(b) } @@ -5962,33 +5962,33 @@ func (u *UpdateChatParticipantAdmin) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateChatParticipantAdmin) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChatParticipantAdmin#b6901959 to nil") + return fmt.Errorf("can't decode updateChatParticipantAdmin#d7ca61a2 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateChatParticipantAdmin#b6901959: field chat_id: %w", err) + return fmt.Errorf("unable to decode updateChatParticipantAdmin#d7ca61a2: field chat_id: %w", err) } u.ChatID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateChatParticipantAdmin#b6901959: field user_id: %w", err) + return fmt.Errorf("unable to decode updateChatParticipantAdmin#d7ca61a2: field user_id: %w", err) } u.UserID = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode updateChatParticipantAdmin#b6901959: field is_admin: %w", err) + return fmt.Errorf("unable to decode updateChatParticipantAdmin#d7ca61a2: field is_admin: %w", err) } u.IsAdmin = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateChatParticipantAdmin#b6901959: field version: %w", err) + return fmt.Errorf("unable to decode updateChatParticipantAdmin#d7ca61a2: field version: %w", err) } u.Version = value } @@ -5996,12 +5996,12 @@ func (u *UpdateChatParticipantAdmin) DecodeBare(b *bin.Buffer) error { } // GetChatID returns value of ChatID field. -func (u *UpdateChatParticipantAdmin) GetChatID() (value int) { +func (u *UpdateChatParticipantAdmin) GetChatID() (value int64) { return u.ChatID } // GetUserID returns value of UserID field. -func (u *UpdateChatParticipantAdmin) GetUserID() (value int) { +func (u *UpdateChatParticipantAdmin) GetUserID() (value int64) { return u.UserID } @@ -6552,7 +6552,7 @@ func (u *UpdateSavedGifs) DecodeBare(b *bin.Buffer) error { return nil } -// UpdateBotInlineQuery represents TL type `updateBotInlineQuery#3f2038db`. +// UpdateBotInlineQuery represents TL type `updateBotInlineQuery#496f379c`. // An incoming inline query // // See https://core.telegram.org/constructor/updateBotInlineQuery for reference. @@ -6565,7 +6565,7 @@ type UpdateBotInlineQuery struct { // Query ID QueryID int64 // User that sent the query - UserID int + UserID int64 // Text of query Query string // Attached geolocation @@ -6581,7 +6581,7 @@ type UpdateBotInlineQuery struct { } // UpdateBotInlineQueryTypeID is TL type id of UpdateBotInlineQuery. -const UpdateBotInlineQueryTypeID = 0x3f2038db +const UpdateBotInlineQueryTypeID = 0x496f379c // construct implements constructor of UpdateClass. func (u UpdateBotInlineQuery) construct() UpdateClass { return &u } @@ -6637,7 +6637,7 @@ func (u *UpdateBotInlineQuery) String() string { // FillFrom fills UpdateBotInlineQuery from given interface. func (u *UpdateBotInlineQuery) FillFrom(from interface { GetQueryID() (value int64) - GetUserID() (value int) + GetUserID() (value int64) GetQuery() (value string) GetGeo() (value GeoPointClass, ok bool) GetPeerType() (value InlineQueryPeerTypeClass, ok bool) @@ -6713,7 +6713,7 @@ func (u *UpdateBotInlineQuery) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateBotInlineQuery) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateBotInlineQuery#3f2038db as nil") + return fmt.Errorf("can't encode updateBotInlineQuery#496f379c as nil") } b.PutID(UpdateBotInlineQueryTypeID) return u.EncodeBare(b) @@ -6722,7 +6722,7 @@ func (u *UpdateBotInlineQuery) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateBotInlineQuery) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateBotInlineQuery#3f2038db as nil") + return fmt.Errorf("can't encode updateBotInlineQuery#496f379c as nil") } if !(u.Geo == nil) { u.Flags.Set(0) @@ -6731,25 +6731,25 @@ func (u *UpdateBotInlineQuery) EncodeBare(b *bin.Buffer) error { u.Flags.Set(1) } if err := u.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateBotInlineQuery#3f2038db: field flags: %w", err) + return fmt.Errorf("unable to encode updateBotInlineQuery#496f379c: field flags: %w", err) } b.PutLong(u.QueryID) - b.PutInt(u.UserID) + b.PutLong(u.UserID) b.PutString(u.Query) if u.Flags.Has(0) { if u.Geo == nil { - return fmt.Errorf("unable to encode updateBotInlineQuery#3f2038db: field geo is nil") + return fmt.Errorf("unable to encode updateBotInlineQuery#496f379c: field geo is nil") } if err := u.Geo.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateBotInlineQuery#3f2038db: field geo: %w", err) + return fmt.Errorf("unable to encode updateBotInlineQuery#496f379c: field geo: %w", err) } } if u.Flags.Has(1) { if u.PeerType == nil { - return fmt.Errorf("unable to encode updateBotInlineQuery#3f2038db: field peer_type is nil") + return fmt.Errorf("unable to encode updateBotInlineQuery#496f379c: field peer_type is nil") } if err := u.PeerType.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateBotInlineQuery#3f2038db: field peer_type: %w", err) + return fmt.Errorf("unable to encode updateBotInlineQuery#496f379c: field peer_type: %w", err) } } b.PutString(u.Offset) @@ -6759,10 +6759,10 @@ func (u *UpdateBotInlineQuery) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UpdateBotInlineQuery) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateBotInlineQuery#3f2038db to nil") + return fmt.Errorf("can't decode updateBotInlineQuery#496f379c to nil") } if err := b.ConsumeID(UpdateBotInlineQueryTypeID); err != nil { - return fmt.Errorf("unable to decode updateBotInlineQuery#3f2038db: %w", err) + return fmt.Errorf("unable to decode updateBotInlineQuery#496f379c: %w", err) } return u.DecodeBare(b) } @@ -6770,52 +6770,52 @@ func (u *UpdateBotInlineQuery) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateBotInlineQuery) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateBotInlineQuery#3f2038db to nil") + return fmt.Errorf("can't decode updateBotInlineQuery#496f379c to nil") } { if err := u.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode updateBotInlineQuery#3f2038db: field flags: %w", err) + return fmt.Errorf("unable to decode updateBotInlineQuery#496f379c: field flags: %w", err) } } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateBotInlineQuery#3f2038db: field query_id: %w", err) + return fmt.Errorf("unable to decode updateBotInlineQuery#496f379c: field query_id: %w", err) } u.QueryID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateBotInlineQuery#3f2038db: field user_id: %w", err) + return fmt.Errorf("unable to decode updateBotInlineQuery#496f379c: field user_id: %w", err) } u.UserID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode updateBotInlineQuery#3f2038db: field query: %w", err) + return fmt.Errorf("unable to decode updateBotInlineQuery#496f379c: field query: %w", err) } u.Query = value } if u.Flags.Has(0) { value, err := DecodeGeoPoint(b) if err != nil { - return fmt.Errorf("unable to decode updateBotInlineQuery#3f2038db: field geo: %w", err) + return fmt.Errorf("unable to decode updateBotInlineQuery#496f379c: field geo: %w", err) } u.Geo = value } if u.Flags.Has(1) { value, err := DecodeInlineQueryPeerType(b) if err != nil { - return fmt.Errorf("unable to decode updateBotInlineQuery#3f2038db: field peer_type: %w", err) + return fmt.Errorf("unable to decode updateBotInlineQuery#496f379c: field peer_type: %w", err) } u.PeerType = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode updateBotInlineQuery#3f2038db: field offset: %w", err) + return fmt.Errorf("unable to decode updateBotInlineQuery#496f379c: field offset: %w", err) } u.Offset = value } @@ -6828,7 +6828,7 @@ func (u *UpdateBotInlineQuery) GetQueryID() (value int64) { } // GetUserID returns value of UserID field. -func (u *UpdateBotInlineQuery) GetUserID() (value int) { +func (u *UpdateBotInlineQuery) GetUserID() (value int64) { return u.UserID } @@ -6872,7 +6872,7 @@ func (u *UpdateBotInlineQuery) GetOffset() (value string) { return u.Offset } -// UpdateBotInlineSend represents TL type `updateBotInlineSend#e48f964`. +// UpdateBotInlineSend represents TL type `updateBotInlineSend#12f12a07`. // The result of an inline query that was chosen by a user and sent to their chat partner // Please see our documentation on the feedback collecting¹ for details on how to // enable these updates for your bot. @@ -6888,7 +6888,7 @@ type UpdateBotInlineSend struct { // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields // The user that chose the result - UserID int + UserID int64 // The query that was used to obtain the result Query string // Optional. Sender location, only for bots that require user location @@ -6902,11 +6902,11 @@ type UpdateBotInlineSend struct { // edit the message. // // Use SetMsgID and GetMsgID helpers. - MsgID InputBotInlineMessageID + MsgID InputBotInlineMessageIDClass } // UpdateBotInlineSendTypeID is TL type id of UpdateBotInlineSend. -const UpdateBotInlineSendTypeID = 0xe48f964 +const UpdateBotInlineSendTypeID = 0x12f12a07 // construct implements constructor of UpdateClass. func (u UpdateBotInlineSend) construct() UpdateClass { return &u } @@ -6940,7 +6940,7 @@ func (u *UpdateBotInlineSend) Zero() bool { if !(u.ID == "") { return false } - if !(u.MsgID.Zero()) { + if !(u.MsgID == nil) { return false } @@ -6958,11 +6958,11 @@ func (u *UpdateBotInlineSend) String() string { // FillFrom fills UpdateBotInlineSend from given interface. func (u *UpdateBotInlineSend) FillFrom(from interface { - GetUserID() (value int) + GetUserID() (value int64) GetQuery() (value string) GetGeo() (value GeoPointClass, ok bool) GetID() (value string) - GetMsgID() (value InputBotInlineMessageID, ok bool) + GetMsgID() (value InputBotInlineMessageIDClass, ok bool) }) { u.UserID = from.GetUserID() u.Query = from.GetQuery() @@ -7029,7 +7029,7 @@ func (u *UpdateBotInlineSend) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateBotInlineSend) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateBotInlineSend#e48f964 as nil") + return fmt.Errorf("can't encode updateBotInlineSend#12f12a07 as nil") } b.PutID(UpdateBotInlineSendTypeID) return u.EncodeBare(b) @@ -7038,31 +7038,34 @@ func (u *UpdateBotInlineSend) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateBotInlineSend) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateBotInlineSend#e48f964 as nil") + return fmt.Errorf("can't encode updateBotInlineSend#12f12a07 as nil") } if !(u.Geo == nil) { u.Flags.Set(0) } - if !(u.MsgID.Zero()) { + if !(u.MsgID == nil) { u.Flags.Set(1) } if err := u.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateBotInlineSend#e48f964: field flags: %w", err) + return fmt.Errorf("unable to encode updateBotInlineSend#12f12a07: field flags: %w", err) } - b.PutInt(u.UserID) + b.PutLong(u.UserID) b.PutString(u.Query) if u.Flags.Has(0) { if u.Geo == nil { - return fmt.Errorf("unable to encode updateBotInlineSend#e48f964: field geo is nil") + return fmt.Errorf("unable to encode updateBotInlineSend#12f12a07: field geo is nil") } if err := u.Geo.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateBotInlineSend#e48f964: field geo: %w", err) + return fmt.Errorf("unable to encode updateBotInlineSend#12f12a07: field geo: %w", err) } } b.PutString(u.ID) if u.Flags.Has(1) { + if u.MsgID == nil { + return fmt.Errorf("unable to encode updateBotInlineSend#12f12a07: field msg_id is nil") + } if err := u.MsgID.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateBotInlineSend#e48f964: field msg_id: %w", err) + return fmt.Errorf("unable to encode updateBotInlineSend#12f12a07: field msg_id: %w", err) } } return nil @@ -7071,10 +7074,10 @@ func (u *UpdateBotInlineSend) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UpdateBotInlineSend) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateBotInlineSend#e48f964 to nil") + return fmt.Errorf("can't decode updateBotInlineSend#12f12a07 to nil") } if err := b.ConsumeID(UpdateBotInlineSendTypeID); err != nil { - return fmt.Errorf("unable to decode updateBotInlineSend#e48f964: %w", err) + return fmt.Errorf("unable to decode updateBotInlineSend#12f12a07: %w", err) } return u.DecodeBare(b) } @@ -7082,51 +7085,53 @@ func (u *UpdateBotInlineSend) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateBotInlineSend) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateBotInlineSend#e48f964 to nil") + return fmt.Errorf("can't decode updateBotInlineSend#12f12a07 to nil") } { if err := u.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode updateBotInlineSend#e48f964: field flags: %w", err) + return fmt.Errorf("unable to decode updateBotInlineSend#12f12a07: field flags: %w", err) } } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateBotInlineSend#e48f964: field user_id: %w", err) + return fmt.Errorf("unable to decode updateBotInlineSend#12f12a07: field user_id: %w", err) } u.UserID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode updateBotInlineSend#e48f964: field query: %w", err) + return fmt.Errorf("unable to decode updateBotInlineSend#12f12a07: field query: %w", err) } u.Query = value } if u.Flags.Has(0) { value, err := DecodeGeoPoint(b) if err != nil { - return fmt.Errorf("unable to decode updateBotInlineSend#e48f964: field geo: %w", err) + return fmt.Errorf("unable to decode updateBotInlineSend#12f12a07: field geo: %w", err) } u.Geo = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode updateBotInlineSend#e48f964: field id: %w", err) + return fmt.Errorf("unable to decode updateBotInlineSend#12f12a07: field id: %w", err) } u.ID = value } if u.Flags.Has(1) { - if err := u.MsgID.Decode(b); err != nil { - return fmt.Errorf("unable to decode updateBotInlineSend#e48f964: field msg_id: %w", err) + value, err := DecodeInputBotInlineMessageID(b) + if err != nil { + return fmt.Errorf("unable to decode updateBotInlineSend#12f12a07: field msg_id: %w", err) } + u.MsgID = value } return nil } // GetUserID returns value of UserID field. -func (u *UpdateBotInlineSend) GetUserID() (value int) { +func (u *UpdateBotInlineSend) GetUserID() (value int64) { return u.UserID } @@ -7156,14 +7161,14 @@ func (u *UpdateBotInlineSend) GetID() (value string) { } // SetMsgID sets value of MsgID conditional field. -func (u *UpdateBotInlineSend) SetMsgID(value InputBotInlineMessageID) { +func (u *UpdateBotInlineSend) SetMsgID(value InputBotInlineMessageIDClass) { u.Flags.Set(1) u.MsgID = value } // GetMsgID returns value of MsgID conditional field and // boolean which is true if field was set. -func (u *UpdateBotInlineSend) GetMsgID() (value InputBotInlineMessageID, ok bool) { +func (u *UpdateBotInlineSend) GetMsgID() (value InputBotInlineMessageIDClass, ok bool) { if !u.Flags.Has(1) { return value, false } @@ -7364,7 +7369,7 @@ func (u *UpdateEditChannelMessage) GetPtsCount() (value int) { return u.PtsCount } -// UpdateBotCallbackQuery represents TL type `updateBotCallbackQuery#e73547e1`. +// UpdateBotCallbackQuery represents TL type `updateBotCallbackQuery#b9cfc48d`. // A callback button was pressed, and the button data was sent to the bot that created // the button // @@ -7378,7 +7383,7 @@ type UpdateBotCallbackQuery struct { // Query ID QueryID int64 // ID of the user that pressed the button - UserID int + UserID int64 // Chat where the inline keyboard was sent Peer PeerClass // Message ID @@ -7397,7 +7402,7 @@ type UpdateBotCallbackQuery struct { } // UpdateBotCallbackQueryTypeID is TL type id of UpdateBotCallbackQuery. -const UpdateBotCallbackQueryTypeID = 0xe73547e1 +const UpdateBotCallbackQueryTypeID = 0xb9cfc48d // construct implements constructor of UpdateClass. func (u UpdateBotCallbackQuery) construct() UpdateClass { return &u } @@ -7456,7 +7461,7 @@ func (u *UpdateBotCallbackQuery) String() string { // FillFrom fills UpdateBotCallbackQuery from given interface. func (u *UpdateBotCallbackQuery) FillFrom(from interface { GetQueryID() (value int64) - GetUserID() (value int) + GetUserID() (value int64) GetPeer() (value PeerClass) GetMsgID() (value int) GetChatInstance() (value int64) @@ -7538,7 +7543,7 @@ func (u *UpdateBotCallbackQuery) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateBotCallbackQuery) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateBotCallbackQuery#e73547e1 as nil") + return fmt.Errorf("can't encode updateBotCallbackQuery#b9cfc48d as nil") } b.PutID(UpdateBotCallbackQueryTypeID) return u.EncodeBare(b) @@ -7547,7 +7552,7 @@ func (u *UpdateBotCallbackQuery) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateBotCallbackQuery) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateBotCallbackQuery#e73547e1 as nil") + return fmt.Errorf("can't encode updateBotCallbackQuery#b9cfc48d as nil") } if !(u.Data == nil) { u.Flags.Set(0) @@ -7556,15 +7561,15 @@ func (u *UpdateBotCallbackQuery) EncodeBare(b *bin.Buffer) error { u.Flags.Set(1) } if err := u.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateBotCallbackQuery#e73547e1: field flags: %w", err) + return fmt.Errorf("unable to encode updateBotCallbackQuery#b9cfc48d: field flags: %w", err) } b.PutLong(u.QueryID) - b.PutInt(u.UserID) + b.PutLong(u.UserID) if u.Peer == nil { - return fmt.Errorf("unable to encode updateBotCallbackQuery#e73547e1: field peer is nil") + return fmt.Errorf("unable to encode updateBotCallbackQuery#b9cfc48d: field peer is nil") } if err := u.Peer.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateBotCallbackQuery#e73547e1: field peer: %w", err) + return fmt.Errorf("unable to encode updateBotCallbackQuery#b9cfc48d: field peer: %w", err) } b.PutInt(u.MsgID) b.PutLong(u.ChatInstance) @@ -7580,10 +7585,10 @@ func (u *UpdateBotCallbackQuery) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UpdateBotCallbackQuery) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateBotCallbackQuery#e73547e1 to nil") + return fmt.Errorf("can't decode updateBotCallbackQuery#b9cfc48d to nil") } if err := b.ConsumeID(UpdateBotCallbackQueryTypeID); err != nil { - return fmt.Errorf("unable to decode updateBotCallbackQuery#e73547e1: %w", err) + return fmt.Errorf("unable to decode updateBotCallbackQuery#b9cfc48d: %w", err) } return u.DecodeBare(b) } @@ -7591,59 +7596,59 @@ func (u *UpdateBotCallbackQuery) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateBotCallbackQuery) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateBotCallbackQuery#e73547e1 to nil") + return fmt.Errorf("can't decode updateBotCallbackQuery#b9cfc48d to nil") } { if err := u.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode updateBotCallbackQuery#e73547e1: field flags: %w", err) + return fmt.Errorf("unable to decode updateBotCallbackQuery#b9cfc48d: field flags: %w", err) } } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateBotCallbackQuery#e73547e1: field query_id: %w", err) + return fmt.Errorf("unable to decode updateBotCallbackQuery#b9cfc48d: field query_id: %w", err) } u.QueryID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateBotCallbackQuery#e73547e1: field user_id: %w", err) + return fmt.Errorf("unable to decode updateBotCallbackQuery#b9cfc48d: field user_id: %w", err) } u.UserID = value } { value, err := DecodePeer(b) if err != nil { - return fmt.Errorf("unable to decode updateBotCallbackQuery#e73547e1: field peer: %w", err) + return fmt.Errorf("unable to decode updateBotCallbackQuery#b9cfc48d: field peer: %w", err) } u.Peer = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateBotCallbackQuery#e73547e1: field msg_id: %w", err) + return fmt.Errorf("unable to decode updateBotCallbackQuery#b9cfc48d: field msg_id: %w", err) } u.MsgID = value } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateBotCallbackQuery#e73547e1: field chat_instance: %w", err) + return fmt.Errorf("unable to decode updateBotCallbackQuery#b9cfc48d: field chat_instance: %w", err) } u.ChatInstance = value } if u.Flags.Has(0) { value, err := b.Bytes() if err != nil { - return fmt.Errorf("unable to decode updateBotCallbackQuery#e73547e1: field data: %w", err) + return fmt.Errorf("unable to decode updateBotCallbackQuery#b9cfc48d: field data: %w", err) } u.Data = value } if u.Flags.Has(1) { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode updateBotCallbackQuery#e73547e1: field game_short_name: %w", err) + return fmt.Errorf("unable to decode updateBotCallbackQuery#b9cfc48d: field game_short_name: %w", err) } u.GameShortName = value } @@ -7656,7 +7661,7 @@ func (u *UpdateBotCallbackQuery) GetQueryID() (value int64) { } // GetUserID returns value of UserID field. -func (u *UpdateBotCallbackQuery) GetUserID() (value int) { +func (u *UpdateBotCallbackQuery) GetUserID() (value int64) { return u.UserID } @@ -7896,7 +7901,7 @@ func (u *UpdateEditMessage) GetPtsCount() (value int) { return u.PtsCount } -// UpdateInlineBotCallbackQuery represents TL type `updateInlineBotCallbackQuery#f9d27a5a`. +// UpdateInlineBotCallbackQuery represents TL type `updateInlineBotCallbackQuery#691e9052`. // This notification is received by bots when a button is pressed // // See https://core.telegram.org/constructor/updateInlineBotCallbackQuery for reference. @@ -7909,9 +7914,9 @@ type UpdateInlineBotCallbackQuery struct { // Query ID QueryID int64 // ID of the user that pressed the button - UserID int + UserID int64 // ID of the inline message with the button - MsgID InputBotInlineMessageID + MsgID InputBotInlineMessageIDClass // Global identifier, uniquely corresponding to the chat to which the message with the // callback button was sent. Useful for high scores in games. ChatInstance int64 @@ -7927,7 +7932,7 @@ type UpdateInlineBotCallbackQuery struct { } // UpdateInlineBotCallbackQueryTypeID is TL type id of UpdateInlineBotCallbackQuery. -const UpdateInlineBotCallbackQueryTypeID = 0xf9d27a5a +const UpdateInlineBotCallbackQueryTypeID = 0x691e9052 // construct implements constructor of UpdateClass. func (u UpdateInlineBotCallbackQuery) construct() UpdateClass { return &u } @@ -7955,7 +7960,7 @@ func (u *UpdateInlineBotCallbackQuery) Zero() bool { if !(u.UserID == 0) { return false } - if !(u.MsgID.Zero()) { + if !(u.MsgID == nil) { return false } if !(u.ChatInstance == 0) { @@ -7983,8 +7988,8 @@ func (u *UpdateInlineBotCallbackQuery) String() string { // FillFrom fills UpdateInlineBotCallbackQuery from given interface. func (u *UpdateInlineBotCallbackQuery) FillFrom(from interface { GetQueryID() (value int64) - GetUserID() (value int) - GetMsgID() (value InputBotInlineMessageID) + GetUserID() (value int64) + GetMsgID() (value InputBotInlineMessageIDClass) GetChatInstance() (value int64) GetData() (value []byte, ok bool) GetGameShortName() (value string, ok bool) @@ -8059,7 +8064,7 @@ func (u *UpdateInlineBotCallbackQuery) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateInlineBotCallbackQuery) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateInlineBotCallbackQuery#f9d27a5a as nil") + return fmt.Errorf("can't encode updateInlineBotCallbackQuery#691e9052 as nil") } b.PutID(UpdateInlineBotCallbackQueryTypeID) return u.EncodeBare(b) @@ -8068,7 +8073,7 @@ func (u *UpdateInlineBotCallbackQuery) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateInlineBotCallbackQuery) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateInlineBotCallbackQuery#f9d27a5a as nil") + return fmt.Errorf("can't encode updateInlineBotCallbackQuery#691e9052 as nil") } if !(u.Data == nil) { u.Flags.Set(0) @@ -8077,12 +8082,15 @@ func (u *UpdateInlineBotCallbackQuery) EncodeBare(b *bin.Buffer) error { u.Flags.Set(1) } if err := u.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateInlineBotCallbackQuery#f9d27a5a: field flags: %w", err) + return fmt.Errorf("unable to encode updateInlineBotCallbackQuery#691e9052: field flags: %w", err) } b.PutLong(u.QueryID) - b.PutInt(u.UserID) + b.PutLong(u.UserID) + if u.MsgID == nil { + return fmt.Errorf("unable to encode updateInlineBotCallbackQuery#691e9052: field msg_id is nil") + } if err := u.MsgID.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateInlineBotCallbackQuery#f9d27a5a: field msg_id: %w", err) + return fmt.Errorf("unable to encode updateInlineBotCallbackQuery#691e9052: field msg_id: %w", err) } b.PutLong(u.ChatInstance) if u.Flags.Has(0) { @@ -8097,10 +8105,10 @@ func (u *UpdateInlineBotCallbackQuery) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UpdateInlineBotCallbackQuery) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateInlineBotCallbackQuery#f9d27a5a to nil") + return fmt.Errorf("can't decode updateInlineBotCallbackQuery#691e9052 to nil") } if err := b.ConsumeID(UpdateInlineBotCallbackQueryTypeID); err != nil { - return fmt.Errorf("unable to decode updateInlineBotCallbackQuery#f9d27a5a: %w", err) + return fmt.Errorf("unable to decode updateInlineBotCallbackQuery#691e9052: %w", err) } return u.DecodeBare(b) } @@ -8108,50 +8116,52 @@ func (u *UpdateInlineBotCallbackQuery) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateInlineBotCallbackQuery) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateInlineBotCallbackQuery#f9d27a5a to nil") + return fmt.Errorf("can't decode updateInlineBotCallbackQuery#691e9052 to nil") } { if err := u.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode updateInlineBotCallbackQuery#f9d27a5a: field flags: %w", err) + return fmt.Errorf("unable to decode updateInlineBotCallbackQuery#691e9052: field flags: %w", err) } } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateInlineBotCallbackQuery#f9d27a5a: field query_id: %w", err) + return fmt.Errorf("unable to decode updateInlineBotCallbackQuery#691e9052: field query_id: %w", err) } u.QueryID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateInlineBotCallbackQuery#f9d27a5a: field user_id: %w", err) + return fmt.Errorf("unable to decode updateInlineBotCallbackQuery#691e9052: field user_id: %w", err) } u.UserID = value } { - if err := u.MsgID.Decode(b); err != nil { - return fmt.Errorf("unable to decode updateInlineBotCallbackQuery#f9d27a5a: field msg_id: %w", err) + value, err := DecodeInputBotInlineMessageID(b) + if err != nil { + return fmt.Errorf("unable to decode updateInlineBotCallbackQuery#691e9052: field msg_id: %w", err) } + u.MsgID = value } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateInlineBotCallbackQuery#f9d27a5a: field chat_instance: %w", err) + return fmt.Errorf("unable to decode updateInlineBotCallbackQuery#691e9052: field chat_instance: %w", err) } u.ChatInstance = value } if u.Flags.Has(0) { value, err := b.Bytes() if err != nil { - return fmt.Errorf("unable to decode updateInlineBotCallbackQuery#f9d27a5a: field data: %w", err) + return fmt.Errorf("unable to decode updateInlineBotCallbackQuery#691e9052: field data: %w", err) } u.Data = value } if u.Flags.Has(1) { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode updateInlineBotCallbackQuery#f9d27a5a: field game_short_name: %w", err) + return fmt.Errorf("unable to decode updateInlineBotCallbackQuery#691e9052: field game_short_name: %w", err) } u.GameShortName = value } @@ -8164,12 +8174,12 @@ func (u *UpdateInlineBotCallbackQuery) GetQueryID() (value int64) { } // GetUserID returns value of UserID field. -func (u *UpdateInlineBotCallbackQuery) GetUserID() (value int) { +func (u *UpdateInlineBotCallbackQuery) GetUserID() (value int64) { return u.UserID } // GetMsgID returns value of MsgID field. -func (u *UpdateInlineBotCallbackQuery) GetMsgID() (value InputBotInlineMessageID) { +func (u *UpdateInlineBotCallbackQuery) GetMsgID() (value InputBotInlineMessageIDClass) { return u.MsgID } @@ -8208,7 +8218,7 @@ func (u *UpdateInlineBotCallbackQuery) GetGameShortName() (value string, ok bool return u.GameShortName, true } -// UpdateReadChannelOutbox represents TL type `updateReadChannelOutbox#25d6c9c7`. +// UpdateReadChannelOutbox represents TL type `updateReadChannelOutbox#b75f99a9`. // Outgoing messages in a channel/supergroup¹ were read // // Links: @@ -8217,13 +8227,13 @@ func (u *UpdateInlineBotCallbackQuery) GetGameShortName() (value string, ok bool // See https://core.telegram.org/constructor/updateReadChannelOutbox for reference. type UpdateReadChannelOutbox struct { // Channel/supergroup ID - ChannelID int + ChannelID int64 // Position up to which all outgoing messages are read. MaxID int } // UpdateReadChannelOutboxTypeID is TL type id of UpdateReadChannelOutbox. -const UpdateReadChannelOutboxTypeID = 0x25d6c9c7 +const UpdateReadChannelOutboxTypeID = 0xb75f99a9 // construct implements constructor of UpdateClass. func (u UpdateReadChannelOutbox) construct() UpdateClass { return &u } @@ -8263,7 +8273,7 @@ func (u *UpdateReadChannelOutbox) String() string { // FillFrom fills UpdateReadChannelOutbox from given interface. func (u *UpdateReadChannelOutbox) FillFrom(from interface { - GetChannelID() (value int) + GetChannelID() (value int64) GetMaxID() (value int) }) { u.ChannelID = from.GetChannelID() @@ -8308,7 +8318,7 @@ func (u *UpdateReadChannelOutbox) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateReadChannelOutbox) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateReadChannelOutbox#25d6c9c7 as nil") + return fmt.Errorf("can't encode updateReadChannelOutbox#b75f99a9 as nil") } b.PutID(UpdateReadChannelOutboxTypeID) return u.EncodeBare(b) @@ -8317,9 +8327,9 @@ func (u *UpdateReadChannelOutbox) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateReadChannelOutbox) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateReadChannelOutbox#25d6c9c7 as nil") + return fmt.Errorf("can't encode updateReadChannelOutbox#b75f99a9 as nil") } - b.PutInt(u.ChannelID) + b.PutLong(u.ChannelID) b.PutInt(u.MaxID) return nil } @@ -8327,10 +8337,10 @@ func (u *UpdateReadChannelOutbox) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UpdateReadChannelOutbox) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateReadChannelOutbox#25d6c9c7 to nil") + return fmt.Errorf("can't decode updateReadChannelOutbox#b75f99a9 to nil") } if err := b.ConsumeID(UpdateReadChannelOutboxTypeID); err != nil { - return fmt.Errorf("unable to decode updateReadChannelOutbox#25d6c9c7: %w", err) + return fmt.Errorf("unable to decode updateReadChannelOutbox#b75f99a9: %w", err) } return u.DecodeBare(b) } @@ -8338,19 +8348,19 @@ func (u *UpdateReadChannelOutbox) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateReadChannelOutbox) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateReadChannelOutbox#25d6c9c7 to nil") + return fmt.Errorf("can't decode updateReadChannelOutbox#b75f99a9 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateReadChannelOutbox#25d6c9c7: field channel_id: %w", err) + return fmt.Errorf("unable to decode updateReadChannelOutbox#b75f99a9: field channel_id: %w", err) } u.ChannelID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateReadChannelOutbox#25d6c9c7: field max_id: %w", err) + return fmt.Errorf("unable to decode updateReadChannelOutbox#b75f99a9: field max_id: %w", err) } u.MaxID = value } @@ -8358,7 +8368,7 @@ func (u *UpdateReadChannelOutbox) DecodeBare(b *bin.Buffer) error { } // GetChannelID returns value of ChannelID field. -func (u *UpdateReadChannelOutbox) GetChannelID() (value int) { +func (u *UpdateReadChannelOutbox) GetChannelID() (value int64) { return u.ChannelID } @@ -8953,7 +8963,7 @@ func (u *UpdatePtsChanged) DecodeBare(b *bin.Buffer) error { return nil } -// UpdateChannelWebPage represents TL type `updateChannelWebPage#40771900`. +// UpdateChannelWebPage represents TL type `updateChannelWebPage#2f2ba99f`. // A webpage preview of a link in a channel/supergroup¹ message was generated // // Links: @@ -8965,7 +8975,7 @@ type UpdateChannelWebPage struct { // // Links: // 1) https://core.telegram.org/api/channel - ChannelID int + ChannelID int64 // Generated webpage preview Webpage WebPageClass // Event count after generation¹ @@ -8981,7 +8991,7 @@ type UpdateChannelWebPage struct { } // UpdateChannelWebPageTypeID is TL type id of UpdateChannelWebPage. -const UpdateChannelWebPageTypeID = 0x40771900 +const UpdateChannelWebPageTypeID = 0x2f2ba99f // construct implements constructor of UpdateClass. func (u UpdateChannelWebPage) construct() UpdateClass { return &u } @@ -9027,7 +9037,7 @@ func (u *UpdateChannelWebPage) String() string { // FillFrom fills UpdateChannelWebPage from given interface. func (u *UpdateChannelWebPage) FillFrom(from interface { - GetChannelID() (value int) + GetChannelID() (value int64) GetWebpage() (value WebPageClass) GetPts() (value int) GetPtsCount() (value int) @@ -9084,7 +9094,7 @@ func (u *UpdateChannelWebPage) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateChannelWebPage) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChannelWebPage#40771900 as nil") + return fmt.Errorf("can't encode updateChannelWebPage#2f2ba99f as nil") } b.PutID(UpdateChannelWebPageTypeID) return u.EncodeBare(b) @@ -9093,14 +9103,14 @@ func (u *UpdateChannelWebPage) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateChannelWebPage) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChannelWebPage#40771900 as nil") + return fmt.Errorf("can't encode updateChannelWebPage#2f2ba99f as nil") } - b.PutInt(u.ChannelID) + b.PutLong(u.ChannelID) if u.Webpage == nil { - return fmt.Errorf("unable to encode updateChannelWebPage#40771900: field webpage is nil") + return fmt.Errorf("unable to encode updateChannelWebPage#2f2ba99f: field webpage is nil") } if err := u.Webpage.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateChannelWebPage#40771900: field webpage: %w", err) + return fmt.Errorf("unable to encode updateChannelWebPage#2f2ba99f: field webpage: %w", err) } b.PutInt(u.Pts) b.PutInt(u.PtsCount) @@ -9110,10 +9120,10 @@ func (u *UpdateChannelWebPage) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UpdateChannelWebPage) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChannelWebPage#40771900 to nil") + return fmt.Errorf("can't decode updateChannelWebPage#2f2ba99f to nil") } if err := b.ConsumeID(UpdateChannelWebPageTypeID); err != nil { - return fmt.Errorf("unable to decode updateChannelWebPage#40771900: %w", err) + return fmt.Errorf("unable to decode updateChannelWebPage#2f2ba99f: %w", err) } return u.DecodeBare(b) } @@ -9121,33 +9131,33 @@ func (u *UpdateChannelWebPage) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateChannelWebPage) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChannelWebPage#40771900 to nil") + return fmt.Errorf("can't decode updateChannelWebPage#2f2ba99f to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateChannelWebPage#40771900: field channel_id: %w", err) + return fmt.Errorf("unable to decode updateChannelWebPage#2f2ba99f: field channel_id: %w", err) } u.ChannelID = value } { value, err := DecodeWebPage(b) if err != nil { - return fmt.Errorf("unable to decode updateChannelWebPage#40771900: field webpage: %w", err) + return fmt.Errorf("unable to decode updateChannelWebPage#2f2ba99f: field webpage: %w", err) } u.Webpage = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateChannelWebPage#40771900: field pts: %w", err) + return fmt.Errorf("unable to decode updateChannelWebPage#2f2ba99f: field pts: %w", err) } u.Pts = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateChannelWebPage#40771900: field pts_count: %w", err) + return fmt.Errorf("unable to decode updateChannelWebPage#2f2ba99f: field pts_count: %w", err) } u.PtsCount = value } @@ -9155,7 +9165,7 @@ func (u *UpdateChannelWebPage) DecodeBare(b *bin.Buffer) error { } // GetChannelID returns value of ChannelID field. -func (u *UpdateChannelWebPage) GetChannelID() (value int) { +func (u *UpdateChannelWebPage) GetChannelID() (value int64) { return u.ChannelID } @@ -9962,7 +9972,7 @@ func (u *UpdateBotWebhookJSONQuery) GetTimeout() (value int) { return u.Timeout } -// UpdateBotShippingQuery represents TL type `updateBotShippingQuery#e0cdc940`. +// UpdateBotShippingQuery represents TL type `updateBotShippingQuery#b5aefd7d`. // This object contains information about an incoming shipping query. // // See https://core.telegram.org/constructor/updateBotShippingQuery for reference. @@ -9970,7 +9980,7 @@ type UpdateBotShippingQuery struct { // Unique query identifier QueryID int64 // User who sent the query - UserID int + UserID int64 // Bot specified invoice payload Payload []byte // User specified shipping address @@ -9978,7 +9988,7 @@ type UpdateBotShippingQuery struct { } // UpdateBotShippingQueryTypeID is TL type id of UpdateBotShippingQuery. -const UpdateBotShippingQueryTypeID = 0xe0cdc940 +const UpdateBotShippingQueryTypeID = 0xb5aefd7d // construct implements constructor of UpdateClass. func (u UpdateBotShippingQuery) construct() UpdateClass { return &u } @@ -10025,7 +10035,7 @@ func (u *UpdateBotShippingQuery) String() string { // FillFrom fills UpdateBotShippingQuery from given interface. func (u *UpdateBotShippingQuery) FillFrom(from interface { GetQueryID() (value int64) - GetUserID() (value int) + GetUserID() (value int64) GetPayload() (value []byte) GetShippingAddress() (value PostAddress) }) { @@ -10081,7 +10091,7 @@ func (u *UpdateBotShippingQuery) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateBotShippingQuery) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateBotShippingQuery#e0cdc940 as nil") + return fmt.Errorf("can't encode updateBotShippingQuery#b5aefd7d as nil") } b.PutID(UpdateBotShippingQueryTypeID) return u.EncodeBare(b) @@ -10090,13 +10100,13 @@ func (u *UpdateBotShippingQuery) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateBotShippingQuery) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateBotShippingQuery#e0cdc940 as nil") + return fmt.Errorf("can't encode updateBotShippingQuery#b5aefd7d as nil") } b.PutLong(u.QueryID) - b.PutInt(u.UserID) + b.PutLong(u.UserID) b.PutBytes(u.Payload) if err := u.ShippingAddress.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateBotShippingQuery#e0cdc940: field shipping_address: %w", err) + return fmt.Errorf("unable to encode updateBotShippingQuery#b5aefd7d: field shipping_address: %w", err) } return nil } @@ -10104,10 +10114,10 @@ func (u *UpdateBotShippingQuery) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UpdateBotShippingQuery) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateBotShippingQuery#e0cdc940 to nil") + return fmt.Errorf("can't decode updateBotShippingQuery#b5aefd7d to nil") } if err := b.ConsumeID(UpdateBotShippingQueryTypeID); err != nil { - return fmt.Errorf("unable to decode updateBotShippingQuery#e0cdc940: %w", err) + return fmt.Errorf("unable to decode updateBotShippingQuery#b5aefd7d: %w", err) } return u.DecodeBare(b) } @@ -10115,32 +10125,32 @@ func (u *UpdateBotShippingQuery) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateBotShippingQuery) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateBotShippingQuery#e0cdc940 to nil") + return fmt.Errorf("can't decode updateBotShippingQuery#b5aefd7d to nil") } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateBotShippingQuery#e0cdc940: field query_id: %w", err) + return fmt.Errorf("unable to decode updateBotShippingQuery#b5aefd7d: field query_id: %w", err) } u.QueryID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateBotShippingQuery#e0cdc940: field user_id: %w", err) + return fmt.Errorf("unable to decode updateBotShippingQuery#b5aefd7d: field user_id: %w", err) } u.UserID = value } { value, err := b.Bytes() if err != nil { - return fmt.Errorf("unable to decode updateBotShippingQuery#e0cdc940: field payload: %w", err) + return fmt.Errorf("unable to decode updateBotShippingQuery#b5aefd7d: field payload: %w", err) } u.Payload = value } { if err := u.ShippingAddress.Decode(b); err != nil { - return fmt.Errorf("unable to decode updateBotShippingQuery#e0cdc940: field shipping_address: %w", err) + return fmt.Errorf("unable to decode updateBotShippingQuery#b5aefd7d: field shipping_address: %w", err) } } return nil @@ -10152,7 +10162,7 @@ func (u *UpdateBotShippingQuery) GetQueryID() (value int64) { } // GetUserID returns value of UserID field. -func (u *UpdateBotShippingQuery) GetUserID() (value int) { +func (u *UpdateBotShippingQuery) GetUserID() (value int64) { return u.UserID } @@ -10166,7 +10176,7 @@ func (u *UpdateBotShippingQuery) GetShippingAddress() (value PostAddress) { return u.ShippingAddress } -// UpdateBotPrecheckoutQuery represents TL type `updateBotPrecheckoutQuery#5d2f3aa9`. +// UpdateBotPrecheckoutQuery represents TL type `updateBotPrecheckoutQuery#8caa9a96`. // This object contains information about an incoming pre-checkout query. // // See https://core.telegram.org/constructor/updateBotPrecheckoutQuery for reference. @@ -10179,7 +10189,7 @@ type UpdateBotPrecheckoutQuery struct { // Unique query identifier QueryID int64 // User who sent the query - UserID int + UserID int64 // Bot specified invoice payload Payload []byte // Order info provided by the user @@ -10206,7 +10216,7 @@ type UpdateBotPrecheckoutQuery struct { } // UpdateBotPrecheckoutQueryTypeID is TL type id of UpdateBotPrecheckoutQuery. -const UpdateBotPrecheckoutQueryTypeID = 0x5d2f3aa9 +const UpdateBotPrecheckoutQueryTypeID = 0x8caa9a96 // construct implements constructor of UpdateClass. func (u UpdateBotPrecheckoutQuery) construct() UpdateClass { return &u } @@ -10265,7 +10275,7 @@ func (u *UpdateBotPrecheckoutQuery) String() string { // FillFrom fills UpdateBotPrecheckoutQuery from given interface. func (u *UpdateBotPrecheckoutQuery) FillFrom(from interface { GetQueryID() (value int64) - GetUserID() (value int) + GetUserID() (value int64) GetPayload() (value []byte) GetInfo() (value PaymentRequestedInfo, ok bool) GetShippingOptionID() (value string, ok bool) @@ -10347,7 +10357,7 @@ func (u *UpdateBotPrecheckoutQuery) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateBotPrecheckoutQuery) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateBotPrecheckoutQuery#5d2f3aa9 as nil") + return fmt.Errorf("can't encode updateBotPrecheckoutQuery#8caa9a96 as nil") } b.PutID(UpdateBotPrecheckoutQueryTypeID) return u.EncodeBare(b) @@ -10356,7 +10366,7 @@ func (u *UpdateBotPrecheckoutQuery) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateBotPrecheckoutQuery) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateBotPrecheckoutQuery#5d2f3aa9 as nil") + return fmt.Errorf("can't encode updateBotPrecheckoutQuery#8caa9a96 as nil") } if !(u.Info.Zero()) { u.Flags.Set(0) @@ -10365,14 +10375,14 @@ func (u *UpdateBotPrecheckoutQuery) EncodeBare(b *bin.Buffer) error { u.Flags.Set(1) } if err := u.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateBotPrecheckoutQuery#5d2f3aa9: field flags: %w", err) + return fmt.Errorf("unable to encode updateBotPrecheckoutQuery#8caa9a96: field flags: %w", err) } b.PutLong(u.QueryID) - b.PutInt(u.UserID) + b.PutLong(u.UserID) b.PutBytes(u.Payload) if u.Flags.Has(0) { if err := u.Info.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateBotPrecheckoutQuery#5d2f3aa9: field info: %w", err) + return fmt.Errorf("unable to encode updateBotPrecheckoutQuery#8caa9a96: field info: %w", err) } } if u.Flags.Has(1) { @@ -10386,10 +10396,10 @@ func (u *UpdateBotPrecheckoutQuery) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UpdateBotPrecheckoutQuery) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateBotPrecheckoutQuery#5d2f3aa9 to nil") + return fmt.Errorf("can't decode updateBotPrecheckoutQuery#8caa9a96 to nil") } if err := b.ConsumeID(UpdateBotPrecheckoutQueryTypeID); err != nil { - return fmt.Errorf("unable to decode updateBotPrecheckoutQuery#5d2f3aa9: %w", err) + return fmt.Errorf("unable to decode updateBotPrecheckoutQuery#8caa9a96: %w", err) } return u.DecodeBare(b) } @@ -10397,57 +10407,57 @@ func (u *UpdateBotPrecheckoutQuery) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateBotPrecheckoutQuery) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateBotPrecheckoutQuery#5d2f3aa9 to nil") + return fmt.Errorf("can't decode updateBotPrecheckoutQuery#8caa9a96 to nil") } { if err := u.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode updateBotPrecheckoutQuery#5d2f3aa9: field flags: %w", err) + return fmt.Errorf("unable to decode updateBotPrecheckoutQuery#8caa9a96: field flags: %w", err) } } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateBotPrecheckoutQuery#5d2f3aa9: field query_id: %w", err) + return fmt.Errorf("unable to decode updateBotPrecheckoutQuery#8caa9a96: field query_id: %w", err) } u.QueryID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateBotPrecheckoutQuery#5d2f3aa9: field user_id: %w", err) + return fmt.Errorf("unable to decode updateBotPrecheckoutQuery#8caa9a96: field user_id: %w", err) } u.UserID = value } { value, err := b.Bytes() if err != nil { - return fmt.Errorf("unable to decode updateBotPrecheckoutQuery#5d2f3aa9: field payload: %w", err) + return fmt.Errorf("unable to decode updateBotPrecheckoutQuery#8caa9a96: field payload: %w", err) } u.Payload = value } if u.Flags.Has(0) { if err := u.Info.Decode(b); err != nil { - return fmt.Errorf("unable to decode updateBotPrecheckoutQuery#5d2f3aa9: field info: %w", err) + return fmt.Errorf("unable to decode updateBotPrecheckoutQuery#8caa9a96: field info: %w", err) } } if u.Flags.Has(1) { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode updateBotPrecheckoutQuery#5d2f3aa9: field shipping_option_id: %w", err) + return fmt.Errorf("unable to decode updateBotPrecheckoutQuery#8caa9a96: field shipping_option_id: %w", err) } u.ShippingOptionID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode updateBotPrecheckoutQuery#5d2f3aa9: field currency: %w", err) + return fmt.Errorf("unable to decode updateBotPrecheckoutQuery#8caa9a96: field currency: %w", err) } u.Currency = value } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateBotPrecheckoutQuery#5d2f3aa9: field total_amount: %w", err) + return fmt.Errorf("unable to decode updateBotPrecheckoutQuery#8caa9a96: field total_amount: %w", err) } u.TotalAmount = value } @@ -10460,7 +10470,7 @@ func (u *UpdateBotPrecheckoutQuery) GetQueryID() (value int64) { } // GetUserID returns value of UserID field. -func (u *UpdateBotPrecheckoutQuery) GetUserID() (value int) { +func (u *UpdateBotPrecheckoutQuery) GetUserID() (value int64) { return u.UserID } @@ -11020,7 +11030,7 @@ func (u *UpdateFavedStickers) DecodeBare(b *bin.Buffer) error { return nil } -// UpdateChannelReadMessagesContents represents TL type `updateChannelReadMessagesContents#89893b45`. +// UpdateChannelReadMessagesContents represents TL type `updateChannelReadMessagesContents#44bdd535`. // The specified channel/supergroup¹ messages were read // // Links: @@ -11032,13 +11042,13 @@ type UpdateChannelReadMessagesContents struct { // // Links: // 1) https://core.telegram.org/api/channel - ChannelID int + ChannelID int64 // IDs of messages that were read Messages []int } // UpdateChannelReadMessagesContentsTypeID is TL type id of UpdateChannelReadMessagesContents. -const UpdateChannelReadMessagesContentsTypeID = 0x89893b45 +const UpdateChannelReadMessagesContentsTypeID = 0x44bdd535 // construct implements constructor of UpdateClass. func (u UpdateChannelReadMessagesContents) construct() UpdateClass { return &u } @@ -11078,7 +11088,7 @@ func (u *UpdateChannelReadMessagesContents) String() string { // FillFrom fills UpdateChannelReadMessagesContents from given interface. func (u *UpdateChannelReadMessagesContents) FillFrom(from interface { - GetChannelID() (value int) + GetChannelID() (value int64) GetMessages() (value []int) }) { u.ChannelID = from.GetChannelID() @@ -11123,7 +11133,7 @@ func (u *UpdateChannelReadMessagesContents) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateChannelReadMessagesContents) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChannelReadMessagesContents#89893b45 as nil") + return fmt.Errorf("can't encode updateChannelReadMessagesContents#44bdd535 as nil") } b.PutID(UpdateChannelReadMessagesContentsTypeID) return u.EncodeBare(b) @@ -11132,9 +11142,9 @@ func (u *UpdateChannelReadMessagesContents) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateChannelReadMessagesContents) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChannelReadMessagesContents#89893b45 as nil") + return fmt.Errorf("can't encode updateChannelReadMessagesContents#44bdd535 as nil") } - b.PutInt(u.ChannelID) + b.PutLong(u.ChannelID) b.PutVectorHeader(len(u.Messages)) for _, v := range u.Messages { b.PutInt(v) @@ -11145,10 +11155,10 @@ func (u *UpdateChannelReadMessagesContents) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UpdateChannelReadMessagesContents) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChannelReadMessagesContents#89893b45 to nil") + return fmt.Errorf("can't decode updateChannelReadMessagesContents#44bdd535 to nil") } if err := b.ConsumeID(UpdateChannelReadMessagesContentsTypeID); err != nil { - return fmt.Errorf("unable to decode updateChannelReadMessagesContents#89893b45: %w", err) + return fmt.Errorf("unable to decode updateChannelReadMessagesContents#44bdd535: %w", err) } return u.DecodeBare(b) } @@ -11156,19 +11166,19 @@ func (u *UpdateChannelReadMessagesContents) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateChannelReadMessagesContents) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChannelReadMessagesContents#89893b45 to nil") + return fmt.Errorf("can't decode updateChannelReadMessagesContents#44bdd535 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateChannelReadMessagesContents#89893b45: field channel_id: %w", err) + return fmt.Errorf("unable to decode updateChannelReadMessagesContents#44bdd535: field channel_id: %w", err) } u.ChannelID = value } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode updateChannelReadMessagesContents#89893b45: field messages: %w", err) + return fmt.Errorf("unable to decode updateChannelReadMessagesContents#44bdd535: field messages: %w", err) } if headerLen > 0 { @@ -11177,7 +11187,7 @@ func (u *UpdateChannelReadMessagesContents) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateChannelReadMessagesContents#89893b45: field messages: %w", err) + return fmt.Errorf("unable to decode updateChannelReadMessagesContents#44bdd535: field messages: %w", err) } u.Messages = append(u.Messages, value) } @@ -11186,7 +11196,7 @@ func (u *UpdateChannelReadMessagesContents) DecodeBare(b *bin.Buffer) error { } // GetChannelID returns value of ChannelID field. -func (u *UpdateChannelReadMessagesContents) GetChannelID() (value int) { +func (u *UpdateChannelReadMessagesContents) GetChannelID() (value int64) { return u.ChannelID } @@ -11297,7 +11307,7 @@ func (u *UpdateContactsReset) DecodeBare(b *bin.Buffer) error { return nil } -// UpdateChannelAvailableMessages represents TL type `updateChannelAvailableMessages#70db6837`. +// UpdateChannelAvailableMessages represents TL type `updateChannelAvailableMessages#b23fc698`. // The history of a channel/supergroup¹ was hidden. // // Links: @@ -11306,13 +11316,13 @@ func (u *UpdateContactsReset) DecodeBare(b *bin.Buffer) error { // See https://core.telegram.org/constructor/updateChannelAvailableMessages for reference. type UpdateChannelAvailableMessages struct { // Channel/supergroup ID - ChannelID int + ChannelID int64 // Identifier of a maximum unavailable message in a channel due to hidden history. AvailableMinID int } // UpdateChannelAvailableMessagesTypeID is TL type id of UpdateChannelAvailableMessages. -const UpdateChannelAvailableMessagesTypeID = 0x70db6837 +const UpdateChannelAvailableMessagesTypeID = 0xb23fc698 // construct implements constructor of UpdateClass. func (u UpdateChannelAvailableMessages) construct() UpdateClass { return &u } @@ -11352,7 +11362,7 @@ func (u *UpdateChannelAvailableMessages) String() string { // FillFrom fills UpdateChannelAvailableMessages from given interface. func (u *UpdateChannelAvailableMessages) FillFrom(from interface { - GetChannelID() (value int) + GetChannelID() (value int64) GetAvailableMinID() (value int) }) { u.ChannelID = from.GetChannelID() @@ -11397,7 +11407,7 @@ func (u *UpdateChannelAvailableMessages) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateChannelAvailableMessages) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChannelAvailableMessages#70db6837 as nil") + return fmt.Errorf("can't encode updateChannelAvailableMessages#b23fc698 as nil") } b.PutID(UpdateChannelAvailableMessagesTypeID) return u.EncodeBare(b) @@ -11406,9 +11416,9 @@ func (u *UpdateChannelAvailableMessages) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateChannelAvailableMessages) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChannelAvailableMessages#70db6837 as nil") + return fmt.Errorf("can't encode updateChannelAvailableMessages#b23fc698 as nil") } - b.PutInt(u.ChannelID) + b.PutLong(u.ChannelID) b.PutInt(u.AvailableMinID) return nil } @@ -11416,10 +11426,10 @@ func (u *UpdateChannelAvailableMessages) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UpdateChannelAvailableMessages) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChannelAvailableMessages#70db6837 to nil") + return fmt.Errorf("can't decode updateChannelAvailableMessages#b23fc698 to nil") } if err := b.ConsumeID(UpdateChannelAvailableMessagesTypeID); err != nil { - return fmt.Errorf("unable to decode updateChannelAvailableMessages#70db6837: %w", err) + return fmt.Errorf("unable to decode updateChannelAvailableMessages#b23fc698: %w", err) } return u.DecodeBare(b) } @@ -11427,19 +11437,19 @@ func (u *UpdateChannelAvailableMessages) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateChannelAvailableMessages) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChannelAvailableMessages#70db6837 to nil") + return fmt.Errorf("can't decode updateChannelAvailableMessages#b23fc698 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateChannelAvailableMessages#70db6837: field channel_id: %w", err) + return fmt.Errorf("unable to decode updateChannelAvailableMessages#b23fc698: field channel_id: %w", err) } u.ChannelID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateChannelAvailableMessages#70db6837: field available_min_id: %w", err) + return fmt.Errorf("unable to decode updateChannelAvailableMessages#b23fc698: field available_min_id: %w", err) } u.AvailableMinID = value } @@ -11447,7 +11457,7 @@ func (u *UpdateChannelAvailableMessages) DecodeBare(b *bin.Buffer) error { } // GetChannelID returns value of ChannelID field. -func (u *UpdateChannelAvailableMessages) GetChannelID() (value int) { +func (u *UpdateChannelAvailableMessages) GetChannelID() (value int64) { return u.ChannelID } @@ -13278,7 +13288,7 @@ func (u *UpdateLoginToken) DecodeBare(b *bin.Buffer) error { return nil } -// UpdateMessagePollVote represents TL type `updateMessagePollVote#37f69f0b`. +// UpdateMessagePollVote represents TL type `updateMessagePollVote#106395c9`. // A specific user has voted in a poll // // See https://core.telegram.org/constructor/updateMessagePollVote for reference. @@ -13286,7 +13296,7 @@ type UpdateMessagePollVote struct { // Poll ID PollID int64 // User ID - UserID int + UserID int64 // Chosen option(s) Options [][]byte // Qts field of UpdateMessagePollVote. @@ -13294,7 +13304,7 @@ type UpdateMessagePollVote struct { } // UpdateMessagePollVoteTypeID is TL type id of UpdateMessagePollVote. -const UpdateMessagePollVoteTypeID = 0x37f69f0b +const UpdateMessagePollVoteTypeID = 0x106395c9 // construct implements constructor of UpdateClass. func (u UpdateMessagePollVote) construct() UpdateClass { return &u } @@ -13341,7 +13351,7 @@ func (u *UpdateMessagePollVote) String() string { // FillFrom fills UpdateMessagePollVote from given interface. func (u *UpdateMessagePollVote) FillFrom(from interface { GetPollID() (value int64) - GetUserID() (value int) + GetUserID() (value int64) GetOptions() (value [][]byte) GetQts() (value int) }) { @@ -13397,7 +13407,7 @@ func (u *UpdateMessagePollVote) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateMessagePollVote) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateMessagePollVote#37f69f0b as nil") + return fmt.Errorf("can't encode updateMessagePollVote#106395c9 as nil") } b.PutID(UpdateMessagePollVoteTypeID) return u.EncodeBare(b) @@ -13406,10 +13416,10 @@ func (u *UpdateMessagePollVote) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateMessagePollVote) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateMessagePollVote#37f69f0b as nil") + return fmt.Errorf("can't encode updateMessagePollVote#106395c9 as nil") } b.PutLong(u.PollID) - b.PutInt(u.UserID) + b.PutLong(u.UserID) b.PutVectorHeader(len(u.Options)) for _, v := range u.Options { b.PutBytes(v) @@ -13421,10 +13431,10 @@ func (u *UpdateMessagePollVote) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UpdateMessagePollVote) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateMessagePollVote#37f69f0b to nil") + return fmt.Errorf("can't decode updateMessagePollVote#106395c9 to nil") } if err := b.ConsumeID(UpdateMessagePollVoteTypeID); err != nil { - return fmt.Errorf("unable to decode updateMessagePollVote#37f69f0b: %w", err) + return fmt.Errorf("unable to decode updateMessagePollVote#106395c9: %w", err) } return u.DecodeBare(b) } @@ -13432,26 +13442,26 @@ func (u *UpdateMessagePollVote) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateMessagePollVote) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateMessagePollVote#37f69f0b to nil") + return fmt.Errorf("can't decode updateMessagePollVote#106395c9 to nil") } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateMessagePollVote#37f69f0b: field poll_id: %w", err) + return fmt.Errorf("unable to decode updateMessagePollVote#106395c9: field poll_id: %w", err) } u.PollID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateMessagePollVote#37f69f0b: field user_id: %w", err) + return fmt.Errorf("unable to decode updateMessagePollVote#106395c9: field user_id: %w", err) } u.UserID = value } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode updateMessagePollVote#37f69f0b: field options: %w", err) + return fmt.Errorf("unable to decode updateMessagePollVote#106395c9: field options: %w", err) } if headerLen > 0 { @@ -13460,7 +13470,7 @@ func (u *UpdateMessagePollVote) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := b.Bytes() if err != nil { - return fmt.Errorf("unable to decode updateMessagePollVote#37f69f0b: field options: %w", err) + return fmt.Errorf("unable to decode updateMessagePollVote#106395c9: field options: %w", err) } u.Options = append(u.Options, value) } @@ -13468,7 +13478,7 @@ func (u *UpdateMessagePollVote) DecodeBare(b *bin.Buffer) error { { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateMessagePollVote#37f69f0b: field qts: %w", err) + return fmt.Errorf("unable to decode updateMessagePollVote#106395c9: field qts: %w", err) } u.Qts = value } @@ -13481,7 +13491,7 @@ func (u *UpdateMessagePollVote) GetPollID() (value int64) { } // GetUserID returns value of UserID field. -func (u *UpdateMessagePollVote) GetUserID() (value int) { +func (u *UpdateMessagePollVote) GetUserID() (value int64) { return u.UserID } @@ -14109,13 +14119,13 @@ func (u *UpdatePhoneCallSignalingData) GetData() (value []byte) { return u.Data } -// UpdateChannelMessageForwards represents TL type `updateChannelMessageForwards#6e8a84df`. +// UpdateChannelMessageForwards represents TL type `updateChannelMessageForwards#d29a27f4`. // The forward counter of a message in a channel has changed // // See https://core.telegram.org/constructor/updateChannelMessageForwards for reference. type UpdateChannelMessageForwards struct { // Channel ID - ChannelID int + ChannelID int64 // ID of the message ID int // New forward counter @@ -14123,7 +14133,7 @@ type UpdateChannelMessageForwards struct { } // UpdateChannelMessageForwardsTypeID is TL type id of UpdateChannelMessageForwards. -const UpdateChannelMessageForwardsTypeID = 0x6e8a84df +const UpdateChannelMessageForwardsTypeID = 0xd29a27f4 // construct implements constructor of UpdateClass. func (u UpdateChannelMessageForwards) construct() UpdateClass { return &u } @@ -14166,7 +14176,7 @@ func (u *UpdateChannelMessageForwards) String() string { // FillFrom fills UpdateChannelMessageForwards from given interface. func (u *UpdateChannelMessageForwards) FillFrom(from interface { - GetChannelID() (value int) + GetChannelID() (value int64) GetID() (value int) GetForwards() (value int) }) { @@ -14217,7 +14227,7 @@ func (u *UpdateChannelMessageForwards) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateChannelMessageForwards) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChannelMessageForwards#6e8a84df as nil") + return fmt.Errorf("can't encode updateChannelMessageForwards#d29a27f4 as nil") } b.PutID(UpdateChannelMessageForwardsTypeID) return u.EncodeBare(b) @@ -14226,9 +14236,9 @@ func (u *UpdateChannelMessageForwards) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateChannelMessageForwards) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChannelMessageForwards#6e8a84df as nil") + return fmt.Errorf("can't encode updateChannelMessageForwards#d29a27f4 as nil") } - b.PutInt(u.ChannelID) + b.PutLong(u.ChannelID) b.PutInt(u.ID) b.PutInt(u.Forwards) return nil @@ -14237,10 +14247,10 @@ func (u *UpdateChannelMessageForwards) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UpdateChannelMessageForwards) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChannelMessageForwards#6e8a84df to nil") + return fmt.Errorf("can't decode updateChannelMessageForwards#d29a27f4 to nil") } if err := b.ConsumeID(UpdateChannelMessageForwardsTypeID); err != nil { - return fmt.Errorf("unable to decode updateChannelMessageForwards#6e8a84df: %w", err) + return fmt.Errorf("unable to decode updateChannelMessageForwards#d29a27f4: %w", err) } return u.DecodeBare(b) } @@ -14248,26 +14258,26 @@ func (u *UpdateChannelMessageForwards) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateChannelMessageForwards) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChannelMessageForwards#6e8a84df to nil") + return fmt.Errorf("can't decode updateChannelMessageForwards#d29a27f4 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateChannelMessageForwards#6e8a84df: field channel_id: %w", err) + return fmt.Errorf("unable to decode updateChannelMessageForwards#d29a27f4: field channel_id: %w", err) } u.ChannelID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateChannelMessageForwards#6e8a84df: field id: %w", err) + return fmt.Errorf("unable to decode updateChannelMessageForwards#d29a27f4: field id: %w", err) } u.ID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateChannelMessageForwards#6e8a84df: field forwards: %w", err) + return fmt.Errorf("unable to decode updateChannelMessageForwards#d29a27f4: field forwards: %w", err) } u.Forwards = value } @@ -14275,7 +14285,7 @@ func (u *UpdateChannelMessageForwards) DecodeBare(b *bin.Buffer) error { } // GetChannelID returns value of ChannelID field. -func (u *UpdateChannelMessageForwards) GetChannelID() (value int) { +func (u *UpdateChannelMessageForwards) GetChannelID() (value int64) { return u.ChannelID } @@ -14289,7 +14299,7 @@ func (u *UpdateChannelMessageForwards) GetForwards() (value int) { return u.Forwards } -// UpdateReadChannelDiscussionInbox represents TL type `updateReadChannelDiscussionInbox#1cc7de54`. +// UpdateReadChannelDiscussionInbox represents TL type `updateReadChannelDiscussionInbox#d6b19546`. // Incoming comments in a discussion thread¹ were marked as read // // Links: @@ -14306,7 +14316,7 @@ type UpdateReadChannelDiscussionInbox struct { // // Links: // 1) https://core.telegram.org/api/channel - ChannelID int + ChannelID int64 // ID of the group message that started the thread¹ (message in linked discussion group) // // Links: @@ -14325,7 +14335,7 @@ type UpdateReadChannelDiscussionInbox struct { // 2) https://core.telegram.org/api/threads // // Use SetBroadcastID and GetBroadcastID helpers. - BroadcastID int + BroadcastID int64 // If set, contains the ID of the channel post that started the the comment thread¹ // // Links: @@ -14336,7 +14346,7 @@ type UpdateReadChannelDiscussionInbox struct { } // UpdateReadChannelDiscussionInboxTypeID is TL type id of UpdateReadChannelDiscussionInbox. -const UpdateReadChannelDiscussionInboxTypeID = 0x1cc7de54 +const UpdateReadChannelDiscussionInboxTypeID = 0xd6b19546 // construct implements constructor of UpdateClass. func (u UpdateReadChannelDiscussionInbox) construct() UpdateClass { return &u } @@ -14388,10 +14398,10 @@ func (u *UpdateReadChannelDiscussionInbox) String() string { // FillFrom fills UpdateReadChannelDiscussionInbox from given interface. func (u *UpdateReadChannelDiscussionInbox) FillFrom(from interface { - GetChannelID() (value int) + GetChannelID() (value int64) GetTopMsgID() (value int) GetReadMaxID() (value int) - GetBroadcastID() (value int, ok bool) + GetBroadcastID() (value int64, ok bool) GetBroadcastPost() (value int, ok bool) }) { u.ChannelID = from.GetChannelID() @@ -14459,7 +14469,7 @@ func (u *UpdateReadChannelDiscussionInbox) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateReadChannelDiscussionInbox) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateReadChannelDiscussionInbox#1cc7de54 as nil") + return fmt.Errorf("can't encode updateReadChannelDiscussionInbox#d6b19546 as nil") } b.PutID(UpdateReadChannelDiscussionInboxTypeID) return u.EncodeBare(b) @@ -14468,7 +14478,7 @@ func (u *UpdateReadChannelDiscussionInbox) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateReadChannelDiscussionInbox) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateReadChannelDiscussionInbox#1cc7de54 as nil") + return fmt.Errorf("can't encode updateReadChannelDiscussionInbox#d6b19546 as nil") } if !(u.BroadcastID == 0) { u.Flags.Set(0) @@ -14477,13 +14487,13 @@ func (u *UpdateReadChannelDiscussionInbox) EncodeBare(b *bin.Buffer) error { u.Flags.Set(0) } if err := u.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateReadChannelDiscussionInbox#1cc7de54: field flags: %w", err) + return fmt.Errorf("unable to encode updateReadChannelDiscussionInbox#d6b19546: field flags: %w", err) } - b.PutInt(u.ChannelID) + b.PutLong(u.ChannelID) b.PutInt(u.TopMsgID) b.PutInt(u.ReadMaxID) if u.Flags.Has(0) { - b.PutInt(u.BroadcastID) + b.PutLong(u.BroadcastID) } if u.Flags.Has(0) { b.PutInt(u.BroadcastPost) @@ -14494,10 +14504,10 @@ func (u *UpdateReadChannelDiscussionInbox) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UpdateReadChannelDiscussionInbox) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateReadChannelDiscussionInbox#1cc7de54 to nil") + return fmt.Errorf("can't decode updateReadChannelDiscussionInbox#d6b19546 to nil") } if err := b.ConsumeID(UpdateReadChannelDiscussionInboxTypeID); err != nil { - return fmt.Errorf("unable to decode updateReadChannelDiscussionInbox#1cc7de54: %w", err) + return fmt.Errorf("unable to decode updateReadChannelDiscussionInbox#d6b19546: %w", err) } return u.DecodeBare(b) } @@ -14505,45 +14515,45 @@ func (u *UpdateReadChannelDiscussionInbox) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateReadChannelDiscussionInbox) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateReadChannelDiscussionInbox#1cc7de54 to nil") + return fmt.Errorf("can't decode updateReadChannelDiscussionInbox#d6b19546 to nil") } { if err := u.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode updateReadChannelDiscussionInbox#1cc7de54: field flags: %w", err) + return fmt.Errorf("unable to decode updateReadChannelDiscussionInbox#d6b19546: field flags: %w", err) } } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateReadChannelDiscussionInbox#1cc7de54: field channel_id: %w", err) + return fmt.Errorf("unable to decode updateReadChannelDiscussionInbox#d6b19546: field channel_id: %w", err) } u.ChannelID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateReadChannelDiscussionInbox#1cc7de54: field top_msg_id: %w", err) + return fmt.Errorf("unable to decode updateReadChannelDiscussionInbox#d6b19546: field top_msg_id: %w", err) } u.TopMsgID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateReadChannelDiscussionInbox#1cc7de54: field read_max_id: %w", err) + return fmt.Errorf("unable to decode updateReadChannelDiscussionInbox#d6b19546: field read_max_id: %w", err) } u.ReadMaxID = value } if u.Flags.Has(0) { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateReadChannelDiscussionInbox#1cc7de54: field broadcast_id: %w", err) + return fmt.Errorf("unable to decode updateReadChannelDiscussionInbox#d6b19546: field broadcast_id: %w", err) } u.BroadcastID = value } if u.Flags.Has(0) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateReadChannelDiscussionInbox#1cc7de54: field broadcast_post: %w", err) + return fmt.Errorf("unable to decode updateReadChannelDiscussionInbox#d6b19546: field broadcast_post: %w", err) } u.BroadcastPost = value } @@ -14551,7 +14561,7 @@ func (u *UpdateReadChannelDiscussionInbox) DecodeBare(b *bin.Buffer) error { } // GetChannelID returns value of ChannelID field. -func (u *UpdateReadChannelDiscussionInbox) GetChannelID() (value int) { +func (u *UpdateReadChannelDiscussionInbox) GetChannelID() (value int64) { return u.ChannelID } @@ -14566,14 +14576,14 @@ func (u *UpdateReadChannelDiscussionInbox) GetReadMaxID() (value int) { } // SetBroadcastID sets value of BroadcastID conditional field. -func (u *UpdateReadChannelDiscussionInbox) SetBroadcastID(value int) { +func (u *UpdateReadChannelDiscussionInbox) SetBroadcastID(value int64) { u.Flags.Set(0) u.BroadcastID = value } // GetBroadcastID returns value of BroadcastID conditional field and // boolean which is true if field was set. -func (u *UpdateReadChannelDiscussionInbox) GetBroadcastID() (value int, ok bool) { +func (u *UpdateReadChannelDiscussionInbox) GetBroadcastID() (value int64, ok bool) { if !u.Flags.Has(0) { return value, false } @@ -14595,7 +14605,7 @@ func (u *UpdateReadChannelDiscussionInbox) GetBroadcastPost() (value int, ok boo return u.BroadcastPost, true } -// UpdateReadChannelDiscussionOutbox represents TL type `updateReadChannelDiscussionOutbox#4638a26c`. +// UpdateReadChannelDiscussionOutbox represents TL type `updateReadChannelDiscussionOutbox#695c9e7c`. // Outgoing comments in a discussion thread¹ were marked as read // // Links: @@ -14607,7 +14617,7 @@ type UpdateReadChannelDiscussionOutbox struct { // // Links: // 1) https://core.telegram.org/api/channel - ChannelID int + ChannelID int64 // ID of the group message that started the thread¹ // // Links: @@ -14621,7 +14631,7 @@ type UpdateReadChannelDiscussionOutbox struct { } // UpdateReadChannelDiscussionOutboxTypeID is TL type id of UpdateReadChannelDiscussionOutbox. -const UpdateReadChannelDiscussionOutboxTypeID = 0x4638a26c +const UpdateReadChannelDiscussionOutboxTypeID = 0x695c9e7c // construct implements constructor of UpdateClass. func (u UpdateReadChannelDiscussionOutbox) construct() UpdateClass { return &u } @@ -14664,7 +14674,7 @@ func (u *UpdateReadChannelDiscussionOutbox) String() string { // FillFrom fills UpdateReadChannelDiscussionOutbox from given interface. func (u *UpdateReadChannelDiscussionOutbox) FillFrom(from interface { - GetChannelID() (value int) + GetChannelID() (value int64) GetTopMsgID() (value int) GetReadMaxID() (value int) }) { @@ -14715,7 +14725,7 @@ func (u *UpdateReadChannelDiscussionOutbox) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateReadChannelDiscussionOutbox) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateReadChannelDiscussionOutbox#4638a26c as nil") + return fmt.Errorf("can't encode updateReadChannelDiscussionOutbox#695c9e7c as nil") } b.PutID(UpdateReadChannelDiscussionOutboxTypeID) return u.EncodeBare(b) @@ -14724,9 +14734,9 @@ func (u *UpdateReadChannelDiscussionOutbox) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateReadChannelDiscussionOutbox) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateReadChannelDiscussionOutbox#4638a26c as nil") + return fmt.Errorf("can't encode updateReadChannelDiscussionOutbox#695c9e7c as nil") } - b.PutInt(u.ChannelID) + b.PutLong(u.ChannelID) b.PutInt(u.TopMsgID) b.PutInt(u.ReadMaxID) return nil @@ -14735,10 +14745,10 @@ func (u *UpdateReadChannelDiscussionOutbox) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UpdateReadChannelDiscussionOutbox) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateReadChannelDiscussionOutbox#4638a26c to nil") + return fmt.Errorf("can't decode updateReadChannelDiscussionOutbox#695c9e7c to nil") } if err := b.ConsumeID(UpdateReadChannelDiscussionOutboxTypeID); err != nil { - return fmt.Errorf("unable to decode updateReadChannelDiscussionOutbox#4638a26c: %w", err) + return fmt.Errorf("unable to decode updateReadChannelDiscussionOutbox#695c9e7c: %w", err) } return u.DecodeBare(b) } @@ -14746,26 +14756,26 @@ func (u *UpdateReadChannelDiscussionOutbox) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateReadChannelDiscussionOutbox) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateReadChannelDiscussionOutbox#4638a26c to nil") + return fmt.Errorf("can't decode updateReadChannelDiscussionOutbox#695c9e7c to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateReadChannelDiscussionOutbox#4638a26c: field channel_id: %w", err) + return fmt.Errorf("unable to decode updateReadChannelDiscussionOutbox#695c9e7c: field channel_id: %w", err) } u.ChannelID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateReadChannelDiscussionOutbox#4638a26c: field top_msg_id: %w", err) + return fmt.Errorf("unable to decode updateReadChannelDiscussionOutbox#695c9e7c: field top_msg_id: %w", err) } u.TopMsgID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateReadChannelDiscussionOutbox#4638a26c: field read_max_id: %w", err) + return fmt.Errorf("unable to decode updateReadChannelDiscussionOutbox#695c9e7c: field read_max_id: %w", err) } u.ReadMaxID = value } @@ -14773,7 +14783,7 @@ func (u *UpdateReadChannelDiscussionOutbox) DecodeBare(b *bin.Buffer) error { } // GetChannelID returns value of ChannelID field. -func (u *UpdateReadChannelDiscussionOutbox) GetChannelID() (value int) { +func (u *UpdateReadChannelDiscussionOutbox) GetChannelID() (value int64) { return u.ChannelID } @@ -14948,7 +14958,7 @@ func (u *UpdatePeerBlocked) GetBlocked() (value bool) { return u.Blocked } -// UpdateChannelUserTyping represents TL type `updateChannelUserTyping#6b171718`. +// UpdateChannelUserTyping represents TL type `updateChannelUserTyping#8c88c923`. // A user is typing in a supergroup, channel¹ or message thread² // // Links: @@ -14963,7 +14973,7 @@ type UpdateChannelUserTyping struct { // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields // Channel ID - ChannelID int + ChannelID int64 // Thread ID¹ // // Links: @@ -14978,7 +14988,7 @@ type UpdateChannelUserTyping struct { } // UpdateChannelUserTypingTypeID is TL type id of UpdateChannelUserTyping. -const UpdateChannelUserTypingTypeID = 0x6b171718 +const UpdateChannelUserTypingTypeID = 0x8c88c923 // construct implements constructor of UpdateClass. func (u UpdateChannelUserTyping) construct() UpdateClass { return &u } @@ -15027,7 +15037,7 @@ func (u *UpdateChannelUserTyping) String() string { // FillFrom fills UpdateChannelUserTyping from given interface. func (u *UpdateChannelUserTyping) FillFrom(from interface { - GetChannelID() (value int) + GetChannelID() (value int64) GetTopMsgID() (value int, ok bool) GetFromID() (value PeerClass) GetAction() (value SendMessageActionClass) @@ -15088,7 +15098,7 @@ func (u *UpdateChannelUserTyping) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateChannelUserTyping) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChannelUserTyping#6b171718 as nil") + return fmt.Errorf("can't encode updateChannelUserTyping#8c88c923 as nil") } b.PutID(UpdateChannelUserTypingTypeID) return u.EncodeBare(b) @@ -15097,29 +15107,29 @@ func (u *UpdateChannelUserTyping) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateChannelUserTyping) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChannelUserTyping#6b171718 as nil") + return fmt.Errorf("can't encode updateChannelUserTyping#8c88c923 as nil") } if !(u.TopMsgID == 0) { u.Flags.Set(0) } if err := u.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateChannelUserTyping#6b171718: field flags: %w", err) + return fmt.Errorf("unable to encode updateChannelUserTyping#8c88c923: field flags: %w", err) } - b.PutInt(u.ChannelID) + b.PutLong(u.ChannelID) if u.Flags.Has(0) { b.PutInt(u.TopMsgID) } if u.FromID == nil { - return fmt.Errorf("unable to encode updateChannelUserTyping#6b171718: field from_id is nil") + return fmt.Errorf("unable to encode updateChannelUserTyping#8c88c923: field from_id is nil") } if err := u.FromID.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateChannelUserTyping#6b171718: field from_id: %w", err) + return fmt.Errorf("unable to encode updateChannelUserTyping#8c88c923: field from_id: %w", err) } if u.Action == nil { - return fmt.Errorf("unable to encode updateChannelUserTyping#6b171718: field action is nil") + return fmt.Errorf("unable to encode updateChannelUserTyping#8c88c923: field action is nil") } if err := u.Action.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateChannelUserTyping#6b171718: field action: %w", err) + return fmt.Errorf("unable to encode updateChannelUserTyping#8c88c923: field action: %w", err) } return nil } @@ -15127,10 +15137,10 @@ func (u *UpdateChannelUserTyping) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UpdateChannelUserTyping) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChannelUserTyping#6b171718 to nil") + return fmt.Errorf("can't decode updateChannelUserTyping#8c88c923 to nil") } if err := b.ConsumeID(UpdateChannelUserTypingTypeID); err != nil { - return fmt.Errorf("unable to decode updateChannelUserTyping#6b171718: %w", err) + return fmt.Errorf("unable to decode updateChannelUserTyping#8c88c923: %w", err) } return u.DecodeBare(b) } @@ -15138,38 +15148,38 @@ func (u *UpdateChannelUserTyping) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateChannelUserTyping) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChannelUserTyping#6b171718 to nil") + return fmt.Errorf("can't decode updateChannelUserTyping#8c88c923 to nil") } { if err := u.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode updateChannelUserTyping#6b171718: field flags: %w", err) + return fmt.Errorf("unable to decode updateChannelUserTyping#8c88c923: field flags: %w", err) } } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateChannelUserTyping#6b171718: field channel_id: %w", err) + return fmt.Errorf("unable to decode updateChannelUserTyping#8c88c923: field channel_id: %w", err) } u.ChannelID = value } if u.Flags.Has(0) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateChannelUserTyping#6b171718: field top_msg_id: %w", err) + return fmt.Errorf("unable to decode updateChannelUserTyping#8c88c923: field top_msg_id: %w", err) } u.TopMsgID = value } { value, err := DecodePeer(b) if err != nil { - return fmt.Errorf("unable to decode updateChannelUserTyping#6b171718: field from_id: %w", err) + return fmt.Errorf("unable to decode updateChannelUserTyping#8c88c923: field from_id: %w", err) } u.FromID = value } { value, err := DecodeSendMessageAction(b) if err != nil { - return fmt.Errorf("unable to decode updateChannelUserTyping#6b171718: field action: %w", err) + return fmt.Errorf("unable to decode updateChannelUserTyping#8c88c923: field action: %w", err) } u.Action = value } @@ -15177,7 +15187,7 @@ func (u *UpdateChannelUserTyping) DecodeBare(b *bin.Buffer) error { } // GetChannelID returns value of ChannelID field. -func (u *UpdateChannelUserTyping) GetChannelID() (value int) { +func (u *UpdateChannelUserTyping) GetChannelID() (value int64) { return u.ChannelID } @@ -15482,7 +15492,7 @@ func (u *UpdatePinnedMessages) GetPtsCount() (value int) { return u.PtsCount } -// UpdatePinnedChannelMessages represents TL type `updatePinnedChannelMessages#8588878b`. +// UpdatePinnedChannelMessages represents TL type `updatePinnedChannelMessages#5bb98608`. // Messages were pinned/unpinned in a channel/supergroup¹ // // Links: @@ -15498,7 +15508,7 @@ type UpdatePinnedChannelMessages struct { // Whether the messages were pinned or unpinned Pinned bool // Channel ID - ChannelID int + ChannelID int64 // Messages Messages []int // Event count after generation¹ @@ -15514,7 +15524,7 @@ type UpdatePinnedChannelMessages struct { } // UpdatePinnedChannelMessagesTypeID is TL type id of UpdatePinnedChannelMessages. -const UpdatePinnedChannelMessagesTypeID = 0x8588878b +const UpdatePinnedChannelMessagesTypeID = 0x5bb98608 // construct implements constructor of UpdateClass. func (u UpdatePinnedChannelMessages) construct() UpdateClass { return &u } @@ -15567,7 +15577,7 @@ func (u *UpdatePinnedChannelMessages) String() string { // FillFrom fills UpdatePinnedChannelMessages from given interface. func (u *UpdatePinnedChannelMessages) FillFrom(from interface { GetPinned() (value bool) - GetChannelID() (value int) + GetChannelID() (value int64) GetMessages() (value []int) GetPts() (value int) GetPtsCount() (value int) @@ -15630,7 +15640,7 @@ func (u *UpdatePinnedChannelMessages) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdatePinnedChannelMessages) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updatePinnedChannelMessages#8588878b as nil") + return fmt.Errorf("can't encode updatePinnedChannelMessages#5bb98608 as nil") } b.PutID(UpdatePinnedChannelMessagesTypeID) return u.EncodeBare(b) @@ -15639,15 +15649,15 @@ func (u *UpdatePinnedChannelMessages) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdatePinnedChannelMessages) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updatePinnedChannelMessages#8588878b as nil") + return fmt.Errorf("can't encode updatePinnedChannelMessages#5bb98608 as nil") } if !(u.Pinned == false) { u.Flags.Set(0) } if err := u.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode updatePinnedChannelMessages#8588878b: field flags: %w", err) + return fmt.Errorf("unable to encode updatePinnedChannelMessages#5bb98608: field flags: %w", err) } - b.PutInt(u.ChannelID) + b.PutLong(u.ChannelID) b.PutVectorHeader(len(u.Messages)) for _, v := range u.Messages { b.PutInt(v) @@ -15660,10 +15670,10 @@ func (u *UpdatePinnedChannelMessages) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UpdatePinnedChannelMessages) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updatePinnedChannelMessages#8588878b to nil") + return fmt.Errorf("can't decode updatePinnedChannelMessages#5bb98608 to nil") } if err := b.ConsumeID(UpdatePinnedChannelMessagesTypeID); err != nil { - return fmt.Errorf("unable to decode updatePinnedChannelMessages#8588878b: %w", err) + return fmt.Errorf("unable to decode updatePinnedChannelMessages#5bb98608: %w", err) } return u.DecodeBare(b) } @@ -15671,25 +15681,25 @@ func (u *UpdatePinnedChannelMessages) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdatePinnedChannelMessages) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updatePinnedChannelMessages#8588878b to nil") + return fmt.Errorf("can't decode updatePinnedChannelMessages#5bb98608 to nil") } { if err := u.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode updatePinnedChannelMessages#8588878b: field flags: %w", err) + return fmt.Errorf("unable to decode updatePinnedChannelMessages#5bb98608: field flags: %w", err) } } u.Pinned = u.Flags.Has(0) { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updatePinnedChannelMessages#8588878b: field channel_id: %w", err) + return fmt.Errorf("unable to decode updatePinnedChannelMessages#5bb98608: field channel_id: %w", err) } u.ChannelID = value } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode updatePinnedChannelMessages#8588878b: field messages: %w", err) + return fmt.Errorf("unable to decode updatePinnedChannelMessages#5bb98608: field messages: %w", err) } if headerLen > 0 { @@ -15698,7 +15708,7 @@ func (u *UpdatePinnedChannelMessages) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updatePinnedChannelMessages#8588878b: field messages: %w", err) + return fmt.Errorf("unable to decode updatePinnedChannelMessages#5bb98608: field messages: %w", err) } u.Messages = append(u.Messages, value) } @@ -15706,14 +15716,14 @@ func (u *UpdatePinnedChannelMessages) DecodeBare(b *bin.Buffer) error { { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updatePinnedChannelMessages#8588878b: field pts: %w", err) + return fmt.Errorf("unable to decode updatePinnedChannelMessages#5bb98608: field pts: %w", err) } u.Pts = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updatePinnedChannelMessages#8588878b: field pts_count: %w", err) + return fmt.Errorf("unable to decode updatePinnedChannelMessages#5bb98608: field pts_count: %w", err) } u.PtsCount = value } @@ -15737,7 +15747,7 @@ func (u *UpdatePinnedChannelMessages) GetPinned() (value bool) { } // GetChannelID returns value of ChannelID field. -func (u *UpdatePinnedChannelMessages) GetChannelID() (value int) { +func (u *UpdatePinnedChannelMessages) GetChannelID() (value int64) { return u.ChannelID } @@ -15756,16 +15766,16 @@ func (u *UpdatePinnedChannelMessages) GetPtsCount() (value int) { return u.PtsCount } -// UpdateChat represents TL type `updateChat#1330a196`. +// UpdateChat represents TL type `updateChat#f89a6a4e`. // // See https://core.telegram.org/constructor/updateChat for reference. type UpdateChat struct { // ChatID field of UpdateChat. - ChatID int + ChatID int64 } // UpdateChatTypeID is TL type id of UpdateChat. -const UpdateChatTypeID = 0x1330a196 +const UpdateChatTypeID = 0xf89a6a4e // construct implements constructor of UpdateClass. func (u UpdateChat) construct() UpdateClass { return &u } @@ -15802,7 +15812,7 @@ func (u *UpdateChat) String() string { // FillFrom fills UpdateChat from given interface. func (u *UpdateChat) FillFrom(from interface { - GetChatID() (value int) + GetChatID() (value int64) }) { u.ChatID = from.GetChatID() } @@ -15841,7 +15851,7 @@ func (u *UpdateChat) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateChat) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChat#1330a196 as nil") + return fmt.Errorf("can't encode updateChat#f89a6a4e as nil") } b.PutID(UpdateChatTypeID) return u.EncodeBare(b) @@ -15850,19 +15860,19 @@ func (u *UpdateChat) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateChat) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChat#1330a196 as nil") + return fmt.Errorf("can't encode updateChat#f89a6a4e as nil") } - b.PutInt(u.ChatID) + b.PutLong(u.ChatID) return nil } // Decode implements bin.Decoder. func (u *UpdateChat) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChat#1330a196 to nil") + return fmt.Errorf("can't decode updateChat#f89a6a4e to nil") } if err := b.ConsumeID(UpdateChatTypeID); err != nil { - return fmt.Errorf("unable to decode updateChat#1330a196: %w", err) + return fmt.Errorf("unable to decode updateChat#f89a6a4e: %w", err) } return u.DecodeBare(b) } @@ -15870,12 +15880,12 @@ func (u *UpdateChat) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateChat) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChat#1330a196 to nil") + return fmt.Errorf("can't decode updateChat#f89a6a4e to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateChat#1330a196: field chat_id: %w", err) + return fmt.Errorf("unable to decode updateChat#f89a6a4e: field chat_id: %w", err) } u.ChatID = value } @@ -15883,7 +15893,7 @@ func (u *UpdateChat) DecodeBare(b *bin.Buffer) error { } // GetChatID returns value of ChatID field. -func (u *UpdateChat) GetChatID() (value int) { +func (u *UpdateChat) GetChatID() (value int64) { return u.ChatID } @@ -16081,18 +16091,18 @@ func (u *UpdateGroupCallParticipants) GetVersion() (value int) { return u.Version } -// UpdateGroupCall represents TL type `updateGroupCall#a45eb99b`. +// UpdateGroupCall represents TL type `updateGroupCall#14b24500`. // // See https://core.telegram.org/constructor/updateGroupCall for reference. type UpdateGroupCall struct { // ChatID field of UpdateGroupCall. - ChatID int + ChatID int64 // Call field of UpdateGroupCall. Call GroupCallClass } // UpdateGroupCallTypeID is TL type id of UpdateGroupCall. -const UpdateGroupCallTypeID = 0xa45eb99b +const UpdateGroupCallTypeID = 0x14b24500 // construct implements constructor of UpdateClass. func (u UpdateGroupCall) construct() UpdateClass { return &u } @@ -16132,7 +16142,7 @@ func (u *UpdateGroupCall) String() string { // FillFrom fills UpdateGroupCall from given interface. func (u *UpdateGroupCall) FillFrom(from interface { - GetChatID() (value int) + GetChatID() (value int64) GetCall() (value GroupCallClass) }) { u.ChatID = from.GetChatID() @@ -16177,7 +16187,7 @@ func (u *UpdateGroupCall) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateGroupCall) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateGroupCall#a45eb99b as nil") + return fmt.Errorf("can't encode updateGroupCall#14b24500 as nil") } b.PutID(UpdateGroupCallTypeID) return u.EncodeBare(b) @@ -16186,14 +16196,14 @@ func (u *UpdateGroupCall) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateGroupCall) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateGroupCall#a45eb99b as nil") + return fmt.Errorf("can't encode updateGroupCall#14b24500 as nil") } - b.PutInt(u.ChatID) + b.PutLong(u.ChatID) if u.Call == nil { - return fmt.Errorf("unable to encode updateGroupCall#a45eb99b: field call is nil") + return fmt.Errorf("unable to encode updateGroupCall#14b24500: field call is nil") } if err := u.Call.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateGroupCall#a45eb99b: field call: %w", err) + return fmt.Errorf("unable to encode updateGroupCall#14b24500: field call: %w", err) } return nil } @@ -16201,10 +16211,10 @@ func (u *UpdateGroupCall) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UpdateGroupCall) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateGroupCall#a45eb99b to nil") + return fmt.Errorf("can't decode updateGroupCall#14b24500 to nil") } if err := b.ConsumeID(UpdateGroupCallTypeID); err != nil { - return fmt.Errorf("unable to decode updateGroupCall#a45eb99b: %w", err) + return fmt.Errorf("unable to decode updateGroupCall#14b24500: %w", err) } return u.DecodeBare(b) } @@ -16212,19 +16222,19 @@ func (u *UpdateGroupCall) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateGroupCall) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateGroupCall#a45eb99b to nil") + return fmt.Errorf("can't decode updateGroupCall#14b24500 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateGroupCall#a45eb99b: field chat_id: %w", err) + return fmt.Errorf("unable to decode updateGroupCall#14b24500: field chat_id: %w", err) } u.ChatID = value } { value, err := DecodeGroupCall(b) if err != nil { - return fmt.Errorf("unable to decode updateGroupCall#a45eb99b: field call: %w", err) + return fmt.Errorf("unable to decode updateGroupCall#14b24500: field call: %w", err) } u.Call = value } @@ -16232,7 +16242,7 @@ func (u *UpdateGroupCall) DecodeBare(b *bin.Buffer) error { } // GetChatID returns value of ChatID field. -func (u *UpdateGroupCall) GetChatID() (value int) { +func (u *UpdateGroupCall) GetChatID() (value int64) { return u.ChatID } @@ -16435,20 +16445,20 @@ func (u *UpdatePeerHistoryTTL) GetTTLPeriod() (value int, ok bool) { return u.TTLPeriod, true } -// UpdateChatParticipant represents TL type `updateChatParticipant#f3b3781f`. +// UpdateChatParticipant represents TL type `updateChatParticipant#d087663a`. // // See https://core.telegram.org/constructor/updateChatParticipant for reference. type UpdateChatParticipant struct { // Flags field of UpdateChatParticipant. Flags bin.Fields // ChatID field of UpdateChatParticipant. - ChatID int + ChatID int64 // Date field of UpdateChatParticipant. Date int // ActorID field of UpdateChatParticipant. - ActorID int + ActorID int64 // UserID field of UpdateChatParticipant. - UserID int + UserID int64 // PrevParticipant field of UpdateChatParticipant. // // Use SetPrevParticipant and GetPrevParticipant helpers. @@ -16466,7 +16476,7 @@ type UpdateChatParticipant struct { } // UpdateChatParticipantTypeID is TL type id of UpdateChatParticipant. -const UpdateChatParticipantTypeID = 0xf3b3781f +const UpdateChatParticipantTypeID = 0xd087663a // construct implements constructor of UpdateClass. func (u UpdateChatParticipant) construct() UpdateClass { return &u } @@ -16527,10 +16537,10 @@ func (u *UpdateChatParticipant) String() string { // FillFrom fills UpdateChatParticipant from given interface. func (u *UpdateChatParticipant) FillFrom(from interface { - GetChatID() (value int) + GetChatID() (value int64) GetDate() (value int) - GetActorID() (value int) - GetUserID() (value int) + GetActorID() (value int64) + GetUserID() (value int64) GetPrevParticipant() (value ChatParticipantClass, ok bool) GetNewParticipant() (value ChatParticipantClass, ok bool) GetInvite() (value ChatInviteExported, ok bool) @@ -16620,7 +16630,7 @@ func (u *UpdateChatParticipant) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateChatParticipant) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChatParticipant#f3b3781f as nil") + return fmt.Errorf("can't encode updateChatParticipant#d087663a as nil") } b.PutID(UpdateChatParticipantTypeID) return u.EncodeBare(b) @@ -16629,7 +16639,7 @@ func (u *UpdateChatParticipant) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateChatParticipant) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChatParticipant#f3b3781f as nil") + return fmt.Errorf("can't encode updateChatParticipant#d087663a as nil") } if !(u.PrevParticipant == nil) { u.Flags.Set(0) @@ -16641,31 +16651,31 @@ func (u *UpdateChatParticipant) EncodeBare(b *bin.Buffer) error { u.Flags.Set(2) } if err := u.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateChatParticipant#f3b3781f: field flags: %w", err) + return fmt.Errorf("unable to encode updateChatParticipant#d087663a: field flags: %w", err) } - b.PutInt(u.ChatID) + b.PutLong(u.ChatID) b.PutInt(u.Date) - b.PutInt(u.ActorID) - b.PutInt(u.UserID) + b.PutLong(u.ActorID) + b.PutLong(u.UserID) if u.Flags.Has(0) { if u.PrevParticipant == nil { - return fmt.Errorf("unable to encode updateChatParticipant#f3b3781f: field prev_participant is nil") + return fmt.Errorf("unable to encode updateChatParticipant#d087663a: field prev_participant is nil") } if err := u.PrevParticipant.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateChatParticipant#f3b3781f: field prev_participant: %w", err) + return fmt.Errorf("unable to encode updateChatParticipant#d087663a: field prev_participant: %w", err) } } if u.Flags.Has(1) { if u.NewParticipant == nil { - return fmt.Errorf("unable to encode updateChatParticipant#f3b3781f: field new_participant is nil") + return fmt.Errorf("unable to encode updateChatParticipant#d087663a: field new_participant is nil") } if err := u.NewParticipant.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateChatParticipant#f3b3781f: field new_participant: %w", err) + return fmt.Errorf("unable to encode updateChatParticipant#d087663a: field new_participant: %w", err) } } if u.Flags.Has(2) { if err := u.Invite.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateChatParticipant#f3b3781f: field invite: %w", err) + return fmt.Errorf("unable to encode updateChatParticipant#d087663a: field invite: %w", err) } } b.PutInt(u.Qts) @@ -16675,10 +16685,10 @@ func (u *UpdateChatParticipant) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UpdateChatParticipant) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChatParticipant#f3b3781f to nil") + return fmt.Errorf("can't decode updateChatParticipant#d087663a to nil") } if err := b.ConsumeID(UpdateChatParticipantTypeID); err != nil { - return fmt.Errorf("unable to decode updateChatParticipant#f3b3781f: %w", err) + return fmt.Errorf("unable to decode updateChatParticipant#d087663a: %w", err) } return u.DecodeBare(b) } @@ -16686,64 +16696,64 @@ func (u *UpdateChatParticipant) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateChatParticipant) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChatParticipant#f3b3781f to nil") + return fmt.Errorf("can't decode updateChatParticipant#d087663a to nil") } { if err := u.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode updateChatParticipant#f3b3781f: field flags: %w", err) + return fmt.Errorf("unable to decode updateChatParticipant#d087663a: field flags: %w", err) } } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateChatParticipant#f3b3781f: field chat_id: %w", err) + return fmt.Errorf("unable to decode updateChatParticipant#d087663a: field chat_id: %w", err) } u.ChatID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateChatParticipant#f3b3781f: field date: %w", err) + return fmt.Errorf("unable to decode updateChatParticipant#d087663a: field date: %w", err) } u.Date = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateChatParticipant#f3b3781f: field actor_id: %w", err) + return fmt.Errorf("unable to decode updateChatParticipant#d087663a: field actor_id: %w", err) } u.ActorID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateChatParticipant#f3b3781f: field user_id: %w", err) + return fmt.Errorf("unable to decode updateChatParticipant#d087663a: field user_id: %w", err) } u.UserID = value } if u.Flags.Has(0) { value, err := DecodeChatParticipant(b) if err != nil { - return fmt.Errorf("unable to decode updateChatParticipant#f3b3781f: field prev_participant: %w", err) + return fmt.Errorf("unable to decode updateChatParticipant#d087663a: field prev_participant: %w", err) } u.PrevParticipant = value } if u.Flags.Has(1) { value, err := DecodeChatParticipant(b) if err != nil { - return fmt.Errorf("unable to decode updateChatParticipant#f3b3781f: field new_participant: %w", err) + return fmt.Errorf("unable to decode updateChatParticipant#d087663a: field new_participant: %w", err) } u.NewParticipant = value } if u.Flags.Has(2) { if err := u.Invite.Decode(b); err != nil { - return fmt.Errorf("unable to decode updateChatParticipant#f3b3781f: field invite: %w", err) + return fmt.Errorf("unable to decode updateChatParticipant#d087663a: field invite: %w", err) } } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateChatParticipant#f3b3781f: field qts: %w", err) + return fmt.Errorf("unable to decode updateChatParticipant#d087663a: field qts: %w", err) } u.Qts = value } @@ -16751,7 +16761,7 @@ func (u *UpdateChatParticipant) DecodeBare(b *bin.Buffer) error { } // GetChatID returns value of ChatID field. -func (u *UpdateChatParticipant) GetChatID() (value int) { +func (u *UpdateChatParticipant) GetChatID() (value int64) { return u.ChatID } @@ -16761,12 +16771,12 @@ func (u *UpdateChatParticipant) GetDate() (value int) { } // GetActorID returns value of ActorID field. -func (u *UpdateChatParticipant) GetActorID() (value int) { +func (u *UpdateChatParticipant) GetActorID() (value int64) { return u.ActorID } // GetUserID returns value of UserID field. -func (u *UpdateChatParticipant) GetUserID() (value int) { +func (u *UpdateChatParticipant) GetUserID() (value int64) { return u.UserID } @@ -16820,7 +16830,7 @@ func (u *UpdateChatParticipant) GetQts() (value int) { return u.Qts } -// UpdateChannelParticipant represents TL type `updateChannelParticipant#7fecb1ec`. +// UpdateChannelParticipant represents TL type `updateChannelParticipant#985d3abb`. // A participant has left, joined, was banned or admined in a channel or supergroup¹. // // Links: @@ -16834,13 +16844,13 @@ type UpdateChannelParticipant struct { // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields // Channel ID - ChannelID int + ChannelID int64 // Date of the event Date int // ActorID field of UpdateChannelParticipant. - ActorID int + ActorID int64 // User in question - UserID int + UserID int64 // Previous participant status // // Use SetPrevParticipant and GetPrevParticipant helpers. @@ -16861,7 +16871,7 @@ type UpdateChannelParticipant struct { } // UpdateChannelParticipantTypeID is TL type id of UpdateChannelParticipant. -const UpdateChannelParticipantTypeID = 0x7fecb1ec +const UpdateChannelParticipantTypeID = 0x985d3abb // construct implements constructor of UpdateClass. func (u UpdateChannelParticipant) construct() UpdateClass { return &u } @@ -16922,10 +16932,10 @@ func (u *UpdateChannelParticipant) String() string { // FillFrom fills UpdateChannelParticipant from given interface. func (u *UpdateChannelParticipant) FillFrom(from interface { - GetChannelID() (value int) + GetChannelID() (value int64) GetDate() (value int) - GetActorID() (value int) - GetUserID() (value int) + GetActorID() (value int64) + GetUserID() (value int64) GetPrevParticipant() (value ChannelParticipantClass, ok bool) GetNewParticipant() (value ChannelParticipantClass, ok bool) GetInvite() (value ChatInviteExported, ok bool) @@ -17015,7 +17025,7 @@ func (u *UpdateChannelParticipant) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateChannelParticipant) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChannelParticipant#7fecb1ec as nil") + return fmt.Errorf("can't encode updateChannelParticipant#985d3abb as nil") } b.PutID(UpdateChannelParticipantTypeID) return u.EncodeBare(b) @@ -17024,7 +17034,7 @@ func (u *UpdateChannelParticipant) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateChannelParticipant) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateChannelParticipant#7fecb1ec as nil") + return fmt.Errorf("can't encode updateChannelParticipant#985d3abb as nil") } if !(u.PrevParticipant == nil) { u.Flags.Set(0) @@ -17036,31 +17046,31 @@ func (u *UpdateChannelParticipant) EncodeBare(b *bin.Buffer) error { u.Flags.Set(2) } if err := u.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateChannelParticipant#7fecb1ec: field flags: %w", err) + return fmt.Errorf("unable to encode updateChannelParticipant#985d3abb: field flags: %w", err) } - b.PutInt(u.ChannelID) + b.PutLong(u.ChannelID) b.PutInt(u.Date) - b.PutInt(u.ActorID) - b.PutInt(u.UserID) + b.PutLong(u.ActorID) + b.PutLong(u.UserID) if u.Flags.Has(0) { if u.PrevParticipant == nil { - return fmt.Errorf("unable to encode updateChannelParticipant#7fecb1ec: field prev_participant is nil") + return fmt.Errorf("unable to encode updateChannelParticipant#985d3abb: field prev_participant is nil") } if err := u.PrevParticipant.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateChannelParticipant#7fecb1ec: field prev_participant: %w", err) + return fmt.Errorf("unable to encode updateChannelParticipant#985d3abb: field prev_participant: %w", err) } } if u.Flags.Has(1) { if u.NewParticipant == nil { - return fmt.Errorf("unable to encode updateChannelParticipant#7fecb1ec: field new_participant is nil") + return fmt.Errorf("unable to encode updateChannelParticipant#985d3abb: field new_participant is nil") } if err := u.NewParticipant.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateChannelParticipant#7fecb1ec: field new_participant: %w", err) + return fmt.Errorf("unable to encode updateChannelParticipant#985d3abb: field new_participant: %w", err) } } if u.Flags.Has(2) { if err := u.Invite.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateChannelParticipant#7fecb1ec: field invite: %w", err) + return fmt.Errorf("unable to encode updateChannelParticipant#985d3abb: field invite: %w", err) } } b.PutInt(u.Qts) @@ -17070,10 +17080,10 @@ func (u *UpdateChannelParticipant) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UpdateChannelParticipant) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChannelParticipant#7fecb1ec to nil") + return fmt.Errorf("can't decode updateChannelParticipant#985d3abb to nil") } if err := b.ConsumeID(UpdateChannelParticipantTypeID); err != nil { - return fmt.Errorf("unable to decode updateChannelParticipant#7fecb1ec: %w", err) + return fmt.Errorf("unable to decode updateChannelParticipant#985d3abb: %w", err) } return u.DecodeBare(b) } @@ -17081,64 +17091,64 @@ func (u *UpdateChannelParticipant) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateChannelParticipant) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateChannelParticipant#7fecb1ec to nil") + return fmt.Errorf("can't decode updateChannelParticipant#985d3abb to nil") } { if err := u.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode updateChannelParticipant#7fecb1ec: field flags: %w", err) + return fmt.Errorf("unable to decode updateChannelParticipant#985d3abb: field flags: %w", err) } } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateChannelParticipant#7fecb1ec: field channel_id: %w", err) + return fmt.Errorf("unable to decode updateChannelParticipant#985d3abb: field channel_id: %w", err) } u.ChannelID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateChannelParticipant#7fecb1ec: field date: %w", err) + return fmt.Errorf("unable to decode updateChannelParticipant#985d3abb: field date: %w", err) } u.Date = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateChannelParticipant#7fecb1ec: field actor_id: %w", err) + return fmt.Errorf("unable to decode updateChannelParticipant#985d3abb: field actor_id: %w", err) } u.ActorID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateChannelParticipant#7fecb1ec: field user_id: %w", err) + return fmt.Errorf("unable to decode updateChannelParticipant#985d3abb: field user_id: %w", err) } u.UserID = value } if u.Flags.Has(0) { value, err := DecodeChannelParticipant(b) if err != nil { - return fmt.Errorf("unable to decode updateChannelParticipant#7fecb1ec: field prev_participant: %w", err) + return fmt.Errorf("unable to decode updateChannelParticipant#985d3abb: field prev_participant: %w", err) } u.PrevParticipant = value } if u.Flags.Has(1) { value, err := DecodeChannelParticipant(b) if err != nil { - return fmt.Errorf("unable to decode updateChannelParticipant#7fecb1ec: field new_participant: %w", err) + return fmt.Errorf("unable to decode updateChannelParticipant#985d3abb: field new_participant: %w", err) } u.NewParticipant = value } if u.Flags.Has(2) { if err := u.Invite.Decode(b); err != nil { - return fmt.Errorf("unable to decode updateChannelParticipant#7fecb1ec: field invite: %w", err) + return fmt.Errorf("unable to decode updateChannelParticipant#985d3abb: field invite: %w", err) } } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateChannelParticipant#7fecb1ec: field qts: %w", err) + return fmt.Errorf("unable to decode updateChannelParticipant#985d3abb: field qts: %w", err) } u.Qts = value } @@ -17146,7 +17156,7 @@ func (u *UpdateChannelParticipant) DecodeBare(b *bin.Buffer) error { } // GetChannelID returns value of ChannelID field. -func (u *UpdateChannelParticipant) GetChannelID() (value int) { +func (u *UpdateChannelParticipant) GetChannelID() (value int64) { return u.ChannelID } @@ -17156,12 +17166,12 @@ func (u *UpdateChannelParticipant) GetDate() (value int) { } // GetActorID returns value of ActorID field. -func (u *UpdateChannelParticipant) GetActorID() (value int) { +func (u *UpdateChannelParticipant) GetActorID() (value int64) { return u.ActorID } // GetUserID returns value of UserID field. -func (u *UpdateChannelParticipant) GetUserID() (value int) { +func (u *UpdateChannelParticipant) GetUserID() (value int64) { return u.UserID } @@ -17215,12 +17225,12 @@ func (u *UpdateChannelParticipant) GetQts() (value int) { return u.Qts } -// UpdateBotStopped represents TL type `updateBotStopped#7f9488a`. +// UpdateBotStopped represents TL type `updateBotStopped#c4870a49`. // // See https://core.telegram.org/constructor/updateBotStopped for reference. type UpdateBotStopped struct { // UserID field of UpdateBotStopped. - UserID int + UserID int64 // Date field of UpdateBotStopped. Date int // Stopped field of UpdateBotStopped. @@ -17230,7 +17240,7 @@ type UpdateBotStopped struct { } // UpdateBotStoppedTypeID is TL type id of UpdateBotStopped. -const UpdateBotStoppedTypeID = 0x7f9488a +const UpdateBotStoppedTypeID = 0xc4870a49 // construct implements constructor of UpdateClass. func (u UpdateBotStopped) construct() UpdateClass { return &u } @@ -17276,7 +17286,7 @@ func (u *UpdateBotStopped) String() string { // FillFrom fills UpdateBotStopped from given interface. func (u *UpdateBotStopped) FillFrom(from interface { - GetUserID() (value int) + GetUserID() (value int64) GetDate() (value int) GetStopped() (value bool) GetQts() (value int) @@ -17333,7 +17343,7 @@ func (u *UpdateBotStopped) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateBotStopped) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateBotStopped#7f9488a as nil") + return fmt.Errorf("can't encode updateBotStopped#c4870a49 as nil") } b.PutID(UpdateBotStoppedTypeID) return u.EncodeBare(b) @@ -17342,9 +17352,9 @@ func (u *UpdateBotStopped) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateBotStopped) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateBotStopped#7f9488a as nil") + return fmt.Errorf("can't encode updateBotStopped#c4870a49 as nil") } - b.PutInt(u.UserID) + b.PutLong(u.UserID) b.PutInt(u.Date) b.PutBool(u.Stopped) b.PutInt(u.Qts) @@ -17354,10 +17364,10 @@ func (u *UpdateBotStopped) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UpdateBotStopped) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateBotStopped#7f9488a to nil") + return fmt.Errorf("can't decode updateBotStopped#c4870a49 to nil") } if err := b.ConsumeID(UpdateBotStoppedTypeID); err != nil { - return fmt.Errorf("unable to decode updateBotStopped#7f9488a: %w", err) + return fmt.Errorf("unable to decode updateBotStopped#c4870a49: %w", err) } return u.DecodeBare(b) } @@ -17365,33 +17375,33 @@ func (u *UpdateBotStopped) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateBotStopped) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateBotStopped#7f9488a to nil") + return fmt.Errorf("can't decode updateBotStopped#c4870a49 to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateBotStopped#7f9488a: field user_id: %w", err) + return fmt.Errorf("unable to decode updateBotStopped#c4870a49: field user_id: %w", err) } u.UserID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateBotStopped#7f9488a: field date: %w", err) + return fmt.Errorf("unable to decode updateBotStopped#c4870a49: field date: %w", err) } u.Date = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode updateBotStopped#7f9488a: field stopped: %w", err) + return fmt.Errorf("unable to decode updateBotStopped#c4870a49: field stopped: %w", err) } u.Stopped = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateBotStopped#7f9488a: field qts: %w", err) + return fmt.Errorf("unable to decode updateBotStopped#c4870a49: field qts: %w", err) } u.Qts = value } @@ -17399,7 +17409,7 @@ func (u *UpdateBotStopped) DecodeBare(b *bin.Buffer) error { } // GetUserID returns value of UserID field. -func (u *UpdateBotStopped) GetUserID() (value int) { +func (u *UpdateBotStopped) GetUserID() (value int64) { return u.UserID } @@ -17594,20 +17604,20 @@ func (u *UpdateGroupCallConnection) GetParams() (value DataJSON) { return u.Params } -// UpdateBotCommands represents TL type `updateBotCommands#cf7e0873`. +// UpdateBotCommands represents TL type `updateBotCommands#4d712f2e`. // // See https://core.telegram.org/constructor/updateBotCommands for reference. type UpdateBotCommands struct { // Peer field of UpdateBotCommands. Peer PeerClass // BotID field of UpdateBotCommands. - BotID int + BotID int64 // Commands field of UpdateBotCommands. Commands []BotCommand } // UpdateBotCommandsTypeID is TL type id of UpdateBotCommands. -const UpdateBotCommandsTypeID = 0xcf7e0873 +const UpdateBotCommandsTypeID = 0x4d712f2e // construct implements constructor of UpdateClass. func (u UpdateBotCommands) construct() UpdateClass { return &u } @@ -17651,7 +17661,7 @@ func (u *UpdateBotCommands) String() string { // FillFrom fills UpdateBotCommands from given interface. func (u *UpdateBotCommands) FillFrom(from interface { GetPeer() (value PeerClass) - GetBotID() (value int) + GetBotID() (value int64) GetCommands() (value []BotCommand) }) { u.Peer = from.GetPeer() @@ -17701,7 +17711,7 @@ func (u *UpdateBotCommands) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateBotCommands) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateBotCommands#cf7e0873 as nil") + return fmt.Errorf("can't encode updateBotCommands#4d712f2e as nil") } b.PutID(UpdateBotCommandsTypeID) return u.EncodeBare(b) @@ -17710,19 +17720,19 @@ func (u *UpdateBotCommands) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateBotCommands) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateBotCommands#cf7e0873 as nil") + return fmt.Errorf("can't encode updateBotCommands#4d712f2e as nil") } if u.Peer == nil { - return fmt.Errorf("unable to encode updateBotCommands#cf7e0873: field peer is nil") + return fmt.Errorf("unable to encode updateBotCommands#4d712f2e: field peer is nil") } if err := u.Peer.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateBotCommands#cf7e0873: field peer: %w", err) + return fmt.Errorf("unable to encode updateBotCommands#4d712f2e: field peer: %w", err) } - b.PutInt(u.BotID) + b.PutLong(u.BotID) b.PutVectorHeader(len(u.Commands)) for idx, v := range u.Commands { if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateBotCommands#cf7e0873: field commands element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode updateBotCommands#4d712f2e: field commands element with index %d: %w", idx, err) } } return nil @@ -17731,10 +17741,10 @@ func (u *UpdateBotCommands) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UpdateBotCommands) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateBotCommands#cf7e0873 to nil") + return fmt.Errorf("can't decode updateBotCommands#4d712f2e to nil") } if err := b.ConsumeID(UpdateBotCommandsTypeID); err != nil { - return fmt.Errorf("unable to decode updateBotCommands#cf7e0873: %w", err) + return fmt.Errorf("unable to decode updateBotCommands#4d712f2e: %w", err) } return u.DecodeBare(b) } @@ -17742,26 +17752,26 @@ func (u *UpdateBotCommands) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateBotCommands) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateBotCommands#cf7e0873 to nil") + return fmt.Errorf("can't decode updateBotCommands#4d712f2e to nil") } { value, err := DecodePeer(b) if err != nil { - return fmt.Errorf("unable to decode updateBotCommands#cf7e0873: field peer: %w", err) + return fmt.Errorf("unable to decode updateBotCommands#4d712f2e: field peer: %w", err) } u.Peer = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateBotCommands#cf7e0873: field bot_id: %w", err) + return fmt.Errorf("unable to decode updateBotCommands#4d712f2e: field bot_id: %w", err) } u.BotID = value } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode updateBotCommands#cf7e0873: field commands: %w", err) + return fmt.Errorf("unable to decode updateBotCommands#4d712f2e: field commands: %w", err) } if headerLen > 0 { @@ -17770,7 +17780,7 @@ func (u *UpdateBotCommands) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { var value BotCommand if err := value.Decode(b); err != nil { - return fmt.Errorf("unable to decode updateBotCommands#cf7e0873: field commands: %w", err) + return fmt.Errorf("unable to decode updateBotCommands#4d712f2e: field commands: %w", err) } u.Commands = append(u.Commands, value) } @@ -17784,7 +17794,7 @@ func (u *UpdateBotCommands) GetPeer() (value PeerClass) { } // GetBotID returns value of BotID field. -func (u *UpdateBotCommands) GetBotID() (value int) { +func (u *UpdateBotCommands) GetBotID() (value int64) { return u.BotID } @@ -17806,64 +17816,64 @@ func (u *UpdateBotCommands) GetCommands() (value []BotCommand) { // case *tg.UpdateNewMessage: // updateNewMessage#1f2b0afd // case *tg.UpdateMessageID: // updateMessageID#4e90bfd6 // case *tg.UpdateDeleteMessages: // updateDeleteMessages#a20db0e5 -// case *tg.UpdateUserTyping: // updateUserTyping#5c486927 -// case *tg.UpdateChatUserTyping: // updateChatUserTyping#86cadb6c +// case *tg.UpdateUserTyping: // updateUserTyping#c01e857f +// case *tg.UpdateChatUserTyping: // updateChatUserTyping#83487af0 // case *tg.UpdateChatParticipants: // updateChatParticipants#7761198 -// case *tg.UpdateUserStatus: // updateUserStatus#1bfbd823 -// case *tg.UpdateUserName: // updateUserName#a7332b73 -// case *tg.UpdateUserPhoto: // updateUserPhoto#95313b0c +// case *tg.UpdateUserStatus: // updateUserStatus#e5bdf8de +// case *tg.UpdateUserName: // updateUserName#c3f202e0 +// case *tg.UpdateUserPhoto: // updateUserPhoto#f227868c // case *tg.UpdateNewEncryptedMessage: // updateNewEncryptedMessage#12bcbd9a // case *tg.UpdateEncryptedChatTyping: // updateEncryptedChatTyping#1710f156 // case *tg.UpdateEncryption: // updateEncryption#b4a2e88d // case *tg.UpdateEncryptedMessagesRead: // updateEncryptedMessagesRead#38fe25b7 -// case *tg.UpdateChatParticipantAdd: // updateChatParticipantAdd#ea4b0e5c -// case *tg.UpdateChatParticipantDelete: // updateChatParticipantDelete#6e5f8c22 +// case *tg.UpdateChatParticipantAdd: // updateChatParticipantAdd#3dda5451 +// case *tg.UpdateChatParticipantDelete: // updateChatParticipantDelete#e32f3d77 // case *tg.UpdateDCOptions: // updateDcOptions#8e5e9873 // case *tg.UpdateNotifySettings: // updateNotifySettings#bec268ef // case *tg.UpdateServiceNotification: // updateServiceNotification#ebe46819 // case *tg.UpdatePrivacy: // updatePrivacy#ee3b272a -// case *tg.UpdateUserPhone: // updateUserPhone#12b9417b +// case *tg.UpdateUserPhone: // updateUserPhone#5492a13 // case *tg.UpdateReadHistoryInbox: // updateReadHistoryInbox#9c974fdf // case *tg.UpdateReadHistoryOutbox: // updateReadHistoryOutbox#2f2f21bf // case *tg.UpdateWebPage: // updateWebPage#7f891213 // case *tg.UpdateReadMessagesContents: // updateReadMessagesContents#68c13933 -// case *tg.UpdateChannelTooLong: // updateChannelTooLong#eb0467fb -// case *tg.UpdateChannel: // updateChannel#b6d45656 +// case *tg.UpdateChannelTooLong: // updateChannelTooLong#108d941f +// case *tg.UpdateChannel: // updateChannel#635b4c09 // case *tg.UpdateNewChannelMessage: // updateNewChannelMessage#62ba04d9 -// case *tg.UpdateReadChannelInbox: // updateReadChannelInbox#330b5424 -// case *tg.UpdateDeleteChannelMessages: // updateDeleteChannelMessages#c37521c9 -// case *tg.UpdateChannelMessageViews: // updateChannelMessageViews#98a12b4b -// case *tg.UpdateChatParticipantAdmin: // updateChatParticipantAdmin#b6901959 +// case *tg.UpdateReadChannelInbox: // updateReadChannelInbox#922e6e10 +// case *tg.UpdateDeleteChannelMessages: // updateDeleteChannelMessages#c32d5b12 +// case *tg.UpdateChannelMessageViews: // updateChannelMessageViews#f226ac08 +// case *tg.UpdateChatParticipantAdmin: // updateChatParticipantAdmin#d7ca61a2 // case *tg.UpdateNewStickerSet: // updateNewStickerSet#688a30aa // case *tg.UpdateStickerSetsOrder: // updateStickerSetsOrder#bb2d201 // case *tg.UpdateStickerSets: // updateStickerSets#43ae3dec // case *tg.UpdateSavedGifs: // updateSavedGifs#9375341e -// case *tg.UpdateBotInlineQuery: // updateBotInlineQuery#3f2038db -// case *tg.UpdateBotInlineSend: // updateBotInlineSend#e48f964 +// case *tg.UpdateBotInlineQuery: // updateBotInlineQuery#496f379c +// case *tg.UpdateBotInlineSend: // updateBotInlineSend#12f12a07 // case *tg.UpdateEditChannelMessage: // updateEditChannelMessage#1b3f4df7 -// case *tg.UpdateBotCallbackQuery: // updateBotCallbackQuery#e73547e1 +// case *tg.UpdateBotCallbackQuery: // updateBotCallbackQuery#b9cfc48d // case *tg.UpdateEditMessage: // updateEditMessage#e40370a3 -// case *tg.UpdateInlineBotCallbackQuery: // updateInlineBotCallbackQuery#f9d27a5a -// case *tg.UpdateReadChannelOutbox: // updateReadChannelOutbox#25d6c9c7 +// case *tg.UpdateInlineBotCallbackQuery: // updateInlineBotCallbackQuery#691e9052 +// case *tg.UpdateReadChannelOutbox: // updateReadChannelOutbox#b75f99a9 // case *tg.UpdateDraftMessage: // updateDraftMessage#ee2bb969 // case *tg.UpdateReadFeaturedStickers: // updateReadFeaturedStickers#571d2742 // case *tg.UpdateRecentStickers: // updateRecentStickers#9a422c20 // case *tg.UpdateConfig: // updateConfig#a229dd06 // case *tg.UpdatePtsChanged: // updatePtsChanged#3354678f -// case *tg.UpdateChannelWebPage: // updateChannelWebPage#40771900 +// case *tg.UpdateChannelWebPage: // updateChannelWebPage#2f2ba99f // case *tg.UpdateDialogPinned: // updateDialogPinned#6e6fe51c // case *tg.UpdatePinnedDialogs: // updatePinnedDialogs#fa0f3ca2 // case *tg.UpdateBotWebhookJSON: // updateBotWebhookJSON#8317c0c3 // case *tg.UpdateBotWebhookJSONQuery: // updateBotWebhookJSONQuery#9b9240a6 -// case *tg.UpdateBotShippingQuery: // updateBotShippingQuery#e0cdc940 -// case *tg.UpdateBotPrecheckoutQuery: // updateBotPrecheckoutQuery#5d2f3aa9 +// case *tg.UpdateBotShippingQuery: // updateBotShippingQuery#b5aefd7d +// case *tg.UpdateBotPrecheckoutQuery: // updateBotPrecheckoutQuery#8caa9a96 // case *tg.UpdatePhoneCall: // updatePhoneCall#ab0f6b1e // case *tg.UpdateLangPackTooLong: // updateLangPackTooLong#46560264 // case *tg.UpdateLangPack: // updateLangPack#56022f4d // case *tg.UpdateFavedStickers: // updateFavedStickers#e511996d -// case *tg.UpdateChannelReadMessagesContents: // updateChannelReadMessagesContents#89893b45 +// case *tg.UpdateChannelReadMessagesContents: // updateChannelReadMessagesContents#44bdd535 // case *tg.UpdateContactsReset: // updateContactsReset#7084a7be -// case *tg.UpdateChannelAvailableMessages: // updateChannelAvailableMessages#70db6837 +// case *tg.UpdateChannelAvailableMessages: // updateChannelAvailableMessages#b23fc698 // case *tg.UpdateDialogUnreadMark: // updateDialogUnreadMark#e16459c3 // case *tg.UpdateMessagePoll: // updateMessagePoll#aca1657b // case *tg.UpdateChatDefaultBannedRights: // updateChatDefaultBannedRights#54c01850 @@ -17875,27 +17885,27 @@ func (u *UpdateBotCommands) GetCommands() (value []BotCommand) { // case *tg.UpdateTheme: // updateTheme#8216fba3 // case *tg.UpdateGeoLiveViewed: // updateGeoLiveViewed#871fb939 // case *tg.UpdateLoginToken: // updateLoginToken#564fe691 -// case *tg.UpdateMessagePollVote: // updateMessagePollVote#37f69f0b +// case *tg.UpdateMessagePollVote: // updateMessagePollVote#106395c9 // case *tg.UpdateDialogFilter: // updateDialogFilter#26ffde7d // case *tg.UpdateDialogFilterOrder: // updateDialogFilterOrder#a5d72105 // case *tg.UpdateDialogFilters: // updateDialogFilters#3504914f // case *tg.UpdatePhoneCallSignalingData: // updatePhoneCallSignalingData#2661bf09 -// case *tg.UpdateChannelMessageForwards: // updateChannelMessageForwards#6e8a84df -// case *tg.UpdateReadChannelDiscussionInbox: // updateReadChannelDiscussionInbox#1cc7de54 -// case *tg.UpdateReadChannelDiscussionOutbox: // updateReadChannelDiscussionOutbox#4638a26c +// case *tg.UpdateChannelMessageForwards: // updateChannelMessageForwards#d29a27f4 +// case *tg.UpdateReadChannelDiscussionInbox: // updateReadChannelDiscussionInbox#d6b19546 +// case *tg.UpdateReadChannelDiscussionOutbox: // updateReadChannelDiscussionOutbox#695c9e7c // case *tg.UpdatePeerBlocked: // updatePeerBlocked#246a4b22 -// case *tg.UpdateChannelUserTyping: // updateChannelUserTyping#6b171718 +// case *tg.UpdateChannelUserTyping: // updateChannelUserTyping#8c88c923 // case *tg.UpdatePinnedMessages: // updatePinnedMessages#ed85eab5 -// case *tg.UpdatePinnedChannelMessages: // updatePinnedChannelMessages#8588878b -// case *tg.UpdateChat: // updateChat#1330a196 +// case *tg.UpdatePinnedChannelMessages: // updatePinnedChannelMessages#5bb98608 +// case *tg.UpdateChat: // updateChat#f89a6a4e // case *tg.UpdateGroupCallParticipants: // updateGroupCallParticipants#f2ebdb4e -// case *tg.UpdateGroupCall: // updateGroupCall#a45eb99b +// case *tg.UpdateGroupCall: // updateGroupCall#14b24500 // case *tg.UpdatePeerHistoryTTL: // updatePeerHistoryTTL#bb9bb9a5 -// case *tg.UpdateChatParticipant: // updateChatParticipant#f3b3781f -// case *tg.UpdateChannelParticipant: // updateChannelParticipant#7fecb1ec -// case *tg.UpdateBotStopped: // updateBotStopped#7f9488a +// case *tg.UpdateChatParticipant: // updateChatParticipant#d087663a +// case *tg.UpdateChannelParticipant: // updateChannelParticipant#985d3abb +// case *tg.UpdateBotStopped: // updateBotStopped#c4870a49 // case *tg.UpdateGroupCallConnection: // updateGroupCallConnection#b783982 -// case *tg.UpdateBotCommands: // updateBotCommands#cf7e0873 +// case *tg.UpdateBotCommands: // updateBotCommands#4d712f2e // default: panic(v) // } type UpdateClass interface { @@ -17946,14 +17956,14 @@ func DecodeUpdate(buf *bin.Buffer) (UpdateClass, error) { } return &v, nil case UpdateUserTypingTypeID: - // Decoding updateUserTyping#5c486927. + // Decoding updateUserTyping#c01e857f. v := UpdateUserTyping{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } return &v, nil case UpdateChatUserTypingTypeID: - // Decoding updateChatUserTyping#86cadb6c. + // Decoding updateChatUserTyping#83487af0. v := UpdateChatUserTyping{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) @@ -17967,21 +17977,21 @@ func DecodeUpdate(buf *bin.Buffer) (UpdateClass, error) { } return &v, nil case UpdateUserStatusTypeID: - // Decoding updateUserStatus#1bfbd823. + // Decoding updateUserStatus#e5bdf8de. v := UpdateUserStatus{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } return &v, nil case UpdateUserNameTypeID: - // Decoding updateUserName#a7332b73. + // Decoding updateUserName#c3f202e0. v := UpdateUserName{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } return &v, nil case UpdateUserPhotoTypeID: - // Decoding updateUserPhoto#95313b0c. + // Decoding updateUserPhoto#f227868c. v := UpdateUserPhoto{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) @@ -18016,14 +18026,14 @@ func DecodeUpdate(buf *bin.Buffer) (UpdateClass, error) { } return &v, nil case UpdateChatParticipantAddTypeID: - // Decoding updateChatParticipantAdd#ea4b0e5c. + // Decoding updateChatParticipantAdd#3dda5451. v := UpdateChatParticipantAdd{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } return &v, nil case UpdateChatParticipantDeleteTypeID: - // Decoding updateChatParticipantDelete#6e5f8c22. + // Decoding updateChatParticipantDelete#e32f3d77. v := UpdateChatParticipantDelete{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) @@ -18058,7 +18068,7 @@ func DecodeUpdate(buf *bin.Buffer) (UpdateClass, error) { } return &v, nil case UpdateUserPhoneTypeID: - // Decoding updateUserPhone#12b9417b. + // Decoding updateUserPhone#5492a13. v := UpdateUserPhone{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) @@ -18093,14 +18103,14 @@ func DecodeUpdate(buf *bin.Buffer) (UpdateClass, error) { } return &v, nil case UpdateChannelTooLongTypeID: - // Decoding updateChannelTooLong#eb0467fb. + // Decoding updateChannelTooLong#108d941f. v := UpdateChannelTooLong{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } return &v, nil case UpdateChannelTypeID: - // Decoding updateChannel#b6d45656. + // Decoding updateChannel#635b4c09. v := UpdateChannel{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) @@ -18114,28 +18124,28 @@ func DecodeUpdate(buf *bin.Buffer) (UpdateClass, error) { } return &v, nil case UpdateReadChannelInboxTypeID: - // Decoding updateReadChannelInbox#330b5424. + // Decoding updateReadChannelInbox#922e6e10. v := UpdateReadChannelInbox{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } return &v, nil case UpdateDeleteChannelMessagesTypeID: - // Decoding updateDeleteChannelMessages#c37521c9. + // Decoding updateDeleteChannelMessages#c32d5b12. v := UpdateDeleteChannelMessages{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } return &v, nil case UpdateChannelMessageViewsTypeID: - // Decoding updateChannelMessageViews#98a12b4b. + // Decoding updateChannelMessageViews#f226ac08. v := UpdateChannelMessageViews{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } return &v, nil case UpdateChatParticipantAdminTypeID: - // Decoding updateChatParticipantAdmin#b6901959. + // Decoding updateChatParticipantAdmin#d7ca61a2. v := UpdateChatParticipantAdmin{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) @@ -18170,14 +18180,14 @@ func DecodeUpdate(buf *bin.Buffer) (UpdateClass, error) { } return &v, nil case UpdateBotInlineQueryTypeID: - // Decoding updateBotInlineQuery#3f2038db. + // Decoding updateBotInlineQuery#496f379c. v := UpdateBotInlineQuery{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } return &v, nil case UpdateBotInlineSendTypeID: - // Decoding updateBotInlineSend#e48f964. + // Decoding updateBotInlineSend#12f12a07. v := UpdateBotInlineSend{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) @@ -18191,7 +18201,7 @@ func DecodeUpdate(buf *bin.Buffer) (UpdateClass, error) { } return &v, nil case UpdateBotCallbackQueryTypeID: - // Decoding updateBotCallbackQuery#e73547e1. + // Decoding updateBotCallbackQuery#b9cfc48d. v := UpdateBotCallbackQuery{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) @@ -18205,14 +18215,14 @@ func DecodeUpdate(buf *bin.Buffer) (UpdateClass, error) { } return &v, nil case UpdateInlineBotCallbackQueryTypeID: - // Decoding updateInlineBotCallbackQuery#f9d27a5a. + // Decoding updateInlineBotCallbackQuery#691e9052. v := UpdateInlineBotCallbackQuery{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } return &v, nil case UpdateReadChannelOutboxTypeID: - // Decoding updateReadChannelOutbox#25d6c9c7. + // Decoding updateReadChannelOutbox#b75f99a9. v := UpdateReadChannelOutbox{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) @@ -18254,7 +18264,7 @@ func DecodeUpdate(buf *bin.Buffer) (UpdateClass, error) { } return &v, nil case UpdateChannelWebPageTypeID: - // Decoding updateChannelWebPage#40771900. + // Decoding updateChannelWebPage#2f2ba99f. v := UpdateChannelWebPage{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) @@ -18289,14 +18299,14 @@ func DecodeUpdate(buf *bin.Buffer) (UpdateClass, error) { } return &v, nil case UpdateBotShippingQueryTypeID: - // Decoding updateBotShippingQuery#e0cdc940. + // Decoding updateBotShippingQuery#b5aefd7d. v := UpdateBotShippingQuery{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } return &v, nil case UpdateBotPrecheckoutQueryTypeID: - // Decoding updateBotPrecheckoutQuery#5d2f3aa9. + // Decoding updateBotPrecheckoutQuery#8caa9a96. v := UpdateBotPrecheckoutQuery{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) @@ -18331,7 +18341,7 @@ func DecodeUpdate(buf *bin.Buffer) (UpdateClass, error) { } return &v, nil case UpdateChannelReadMessagesContentsTypeID: - // Decoding updateChannelReadMessagesContents#89893b45. + // Decoding updateChannelReadMessagesContents#44bdd535. v := UpdateChannelReadMessagesContents{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) @@ -18345,7 +18355,7 @@ func DecodeUpdate(buf *bin.Buffer) (UpdateClass, error) { } return &v, nil case UpdateChannelAvailableMessagesTypeID: - // Decoding updateChannelAvailableMessages#70db6837. + // Decoding updateChannelAvailableMessages#b23fc698. v := UpdateChannelAvailableMessages{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) @@ -18429,7 +18439,7 @@ func DecodeUpdate(buf *bin.Buffer) (UpdateClass, error) { } return &v, nil case UpdateMessagePollVoteTypeID: - // Decoding updateMessagePollVote#37f69f0b. + // Decoding updateMessagePollVote#106395c9. v := UpdateMessagePollVote{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) @@ -18464,21 +18474,21 @@ func DecodeUpdate(buf *bin.Buffer) (UpdateClass, error) { } return &v, nil case UpdateChannelMessageForwardsTypeID: - // Decoding updateChannelMessageForwards#6e8a84df. + // Decoding updateChannelMessageForwards#d29a27f4. v := UpdateChannelMessageForwards{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } return &v, nil case UpdateReadChannelDiscussionInboxTypeID: - // Decoding updateReadChannelDiscussionInbox#1cc7de54. + // Decoding updateReadChannelDiscussionInbox#d6b19546. v := UpdateReadChannelDiscussionInbox{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } return &v, nil case UpdateReadChannelDiscussionOutboxTypeID: - // Decoding updateReadChannelDiscussionOutbox#4638a26c. + // Decoding updateReadChannelDiscussionOutbox#695c9e7c. v := UpdateReadChannelDiscussionOutbox{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) @@ -18492,7 +18502,7 @@ func DecodeUpdate(buf *bin.Buffer) (UpdateClass, error) { } return &v, nil case UpdateChannelUserTypingTypeID: - // Decoding updateChannelUserTyping#6b171718. + // Decoding updateChannelUserTyping#8c88c923. v := UpdateChannelUserTyping{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) @@ -18506,14 +18516,14 @@ func DecodeUpdate(buf *bin.Buffer) (UpdateClass, error) { } return &v, nil case UpdatePinnedChannelMessagesTypeID: - // Decoding updatePinnedChannelMessages#8588878b. + // Decoding updatePinnedChannelMessages#5bb98608. v := UpdatePinnedChannelMessages{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } return &v, nil case UpdateChatTypeID: - // Decoding updateChat#1330a196. + // Decoding updateChat#f89a6a4e. v := UpdateChat{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) @@ -18527,7 +18537,7 @@ func DecodeUpdate(buf *bin.Buffer) (UpdateClass, error) { } return &v, nil case UpdateGroupCallTypeID: - // Decoding updateGroupCall#a45eb99b. + // Decoding updateGroupCall#14b24500. v := UpdateGroupCall{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) @@ -18541,21 +18551,21 @@ func DecodeUpdate(buf *bin.Buffer) (UpdateClass, error) { } return &v, nil case UpdateChatParticipantTypeID: - // Decoding updateChatParticipant#f3b3781f. + // Decoding updateChatParticipant#d087663a. v := UpdateChatParticipant{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } return &v, nil case UpdateChannelParticipantTypeID: - // Decoding updateChannelParticipant#7fecb1ec. + // Decoding updateChannelParticipant#985d3abb. v := UpdateChannelParticipant{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } return &v, nil case UpdateBotStoppedTypeID: - // Decoding updateBotStopped#7f9488a. + // Decoding updateBotStopped#c4870a49. v := UpdateBotStopped{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) @@ -18569,7 +18579,7 @@ func DecodeUpdate(buf *bin.Buffer) (UpdateClass, error) { } return &v, nil case UpdateBotCommandsTypeID: - // Decoding updateBotCommands#cf7e0873. + // Decoding updateBotCommands#4d712f2e. v := UpdateBotCommands{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) diff --git a/tg/tl_updates_gen.go b/tg/tl_updates_gen.go index 97eddb5861..381513b461 100644 --- a/tg/tl_updates_gen.go +++ b/tg/tl_updates_gen.go @@ -134,7 +134,7 @@ func (u *UpdatesTooLong) DecodeBare(b *bin.Buffer) error { return nil } -// UpdateShortMessage represents TL type `updateShortMessage#faeff833`. +// UpdateShortMessage represents TL type `updateShortMessage#313bc7f8`. // Info about a message sent to (received from) another user // // See https://core.telegram.org/constructor/updateShortMessage for reference. @@ -155,7 +155,7 @@ type UpdateShortMessage struct { // The message ID ID int // The ID of the sender (if outgoing will be the ID of the destination) of the message - UserID int + UserID int64 // The message Message string // PTS¹ @@ -180,7 +180,7 @@ type UpdateShortMessage struct { // Info about the inline bot used to generate this message // // Use SetViaBotID and GetViaBotID helpers. - ViaBotID int + ViaBotID int64 // Reply and thread¹ information // // Links: @@ -202,7 +202,7 @@ type UpdateShortMessage struct { } // UpdateShortMessageTypeID is TL type id of UpdateShortMessage. -const UpdateShortMessageTypeID = 0xfaeff833 +const UpdateShortMessageTypeID = 0x313bc7f8 // construct implements constructor of UpdatesClass. func (u UpdateShortMessage) construct() UpdatesClass { return &u } @@ -289,13 +289,13 @@ func (u *UpdateShortMessage) FillFrom(from interface { GetMediaUnread() (value bool) GetSilent() (value bool) GetID() (value int) - GetUserID() (value int) + GetUserID() (value int64) GetMessage() (value string) GetPts() (value int) GetPtsCount() (value int) GetDate() (value int) GetFwdFrom() (value MessageFwdHeader, ok bool) - GetViaBotID() (value int, ok bool) + GetViaBotID() (value int64, ok bool) GetReplyTo() (value MessageReplyHeader, ok bool) GetEntities() (value []MessageEntityClass, ok bool) GetTTLPeriod() (value int, ok bool) @@ -431,7 +431,7 @@ func (u *UpdateShortMessage) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateShortMessage) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateShortMessage#faeff833 as nil") + return fmt.Errorf("can't encode updateShortMessage#313bc7f8 as nil") } b.PutID(UpdateShortMessageTypeID) return u.EncodeBare(b) @@ -440,7 +440,7 @@ func (u *UpdateShortMessage) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateShortMessage) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateShortMessage#faeff833 as nil") + return fmt.Errorf("can't encode updateShortMessage#313bc7f8 as nil") } if !(u.Out == false) { u.Flags.Set(1) @@ -470,35 +470,35 @@ func (u *UpdateShortMessage) EncodeBare(b *bin.Buffer) error { u.Flags.Set(25) } if err := u.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateShortMessage#faeff833: field flags: %w", err) + return fmt.Errorf("unable to encode updateShortMessage#313bc7f8: field flags: %w", err) } b.PutInt(u.ID) - b.PutInt(u.UserID) + b.PutLong(u.UserID) b.PutString(u.Message) b.PutInt(u.Pts) b.PutInt(u.PtsCount) b.PutInt(u.Date) if u.Flags.Has(2) { if err := u.FwdFrom.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateShortMessage#faeff833: field fwd_from: %w", err) + return fmt.Errorf("unable to encode updateShortMessage#313bc7f8: field fwd_from: %w", err) } } if u.Flags.Has(11) { - b.PutInt(u.ViaBotID) + b.PutLong(u.ViaBotID) } if u.Flags.Has(3) { if err := u.ReplyTo.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateShortMessage#faeff833: field reply_to: %w", err) + return fmt.Errorf("unable to encode updateShortMessage#313bc7f8: field reply_to: %w", err) } } if u.Flags.Has(7) { b.PutVectorHeader(len(u.Entities)) for idx, v := range u.Entities { if v == nil { - return fmt.Errorf("unable to encode updateShortMessage#faeff833: field entities element with index %d is nil", idx) + return fmt.Errorf("unable to encode updateShortMessage#313bc7f8: field entities element with index %d is nil", idx) } if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateShortMessage#faeff833: field entities element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode updateShortMessage#313bc7f8: field entities element with index %d: %w", idx, err) } } } @@ -511,10 +511,10 @@ func (u *UpdateShortMessage) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UpdateShortMessage) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateShortMessage#faeff833 to nil") + return fmt.Errorf("can't decode updateShortMessage#313bc7f8 to nil") } if err := b.ConsumeID(UpdateShortMessageTypeID); err != nil { - return fmt.Errorf("unable to decode updateShortMessage#faeff833: %w", err) + return fmt.Errorf("unable to decode updateShortMessage#313bc7f8: %w", err) } return u.DecodeBare(b) } @@ -522,11 +522,11 @@ func (u *UpdateShortMessage) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateShortMessage) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateShortMessage#faeff833 to nil") + return fmt.Errorf("can't decode updateShortMessage#313bc7f8 to nil") } { if err := u.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode updateShortMessage#faeff833: field flags: %w", err) + return fmt.Errorf("unable to decode updateShortMessage#313bc7f8: field flags: %w", err) } } u.Out = u.Flags.Has(1) @@ -536,66 +536,66 @@ func (u *UpdateShortMessage) DecodeBare(b *bin.Buffer) error { { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateShortMessage#faeff833: field id: %w", err) + return fmt.Errorf("unable to decode updateShortMessage#313bc7f8: field id: %w", err) } u.ID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateShortMessage#faeff833: field user_id: %w", err) + return fmt.Errorf("unable to decode updateShortMessage#313bc7f8: field user_id: %w", err) } u.UserID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode updateShortMessage#faeff833: field message: %w", err) + return fmt.Errorf("unable to decode updateShortMessage#313bc7f8: field message: %w", err) } u.Message = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateShortMessage#faeff833: field pts: %w", err) + return fmt.Errorf("unable to decode updateShortMessage#313bc7f8: field pts: %w", err) } u.Pts = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateShortMessage#faeff833: field pts_count: %w", err) + return fmt.Errorf("unable to decode updateShortMessage#313bc7f8: field pts_count: %w", err) } u.PtsCount = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateShortMessage#faeff833: field date: %w", err) + return fmt.Errorf("unable to decode updateShortMessage#313bc7f8: field date: %w", err) } u.Date = value } if u.Flags.Has(2) { if err := u.FwdFrom.Decode(b); err != nil { - return fmt.Errorf("unable to decode updateShortMessage#faeff833: field fwd_from: %w", err) + return fmt.Errorf("unable to decode updateShortMessage#313bc7f8: field fwd_from: %w", err) } } if u.Flags.Has(11) { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateShortMessage#faeff833: field via_bot_id: %w", err) + return fmt.Errorf("unable to decode updateShortMessage#313bc7f8: field via_bot_id: %w", err) } u.ViaBotID = value } if u.Flags.Has(3) { if err := u.ReplyTo.Decode(b); err != nil { - return fmt.Errorf("unable to decode updateShortMessage#faeff833: field reply_to: %w", err) + return fmt.Errorf("unable to decode updateShortMessage#313bc7f8: field reply_to: %w", err) } } if u.Flags.Has(7) { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode updateShortMessage#faeff833: field entities: %w", err) + return fmt.Errorf("unable to decode updateShortMessage#313bc7f8: field entities: %w", err) } if headerLen > 0 { @@ -604,7 +604,7 @@ func (u *UpdateShortMessage) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := DecodeMessageEntity(b) if err != nil { - return fmt.Errorf("unable to decode updateShortMessage#faeff833: field entities: %w", err) + return fmt.Errorf("unable to decode updateShortMessage#313bc7f8: field entities: %w", err) } u.Entities = append(u.Entities, value) } @@ -612,7 +612,7 @@ func (u *UpdateShortMessage) DecodeBare(b *bin.Buffer) error { if u.Flags.Has(25) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateShortMessage#faeff833: field ttl_period: %w", err) + return fmt.Errorf("unable to decode updateShortMessage#313bc7f8: field ttl_period: %w", err) } u.TTLPeriod = value } @@ -689,7 +689,7 @@ func (u *UpdateShortMessage) GetID() (value int) { } // GetUserID returns value of UserID field. -func (u *UpdateShortMessage) GetUserID() (value int) { +func (u *UpdateShortMessage) GetUserID() (value int64) { return u.UserID } @@ -729,14 +729,14 @@ func (u *UpdateShortMessage) GetFwdFrom() (value MessageFwdHeader, ok bool) { } // SetViaBotID sets value of ViaBotID conditional field. -func (u *UpdateShortMessage) SetViaBotID(value int) { +func (u *UpdateShortMessage) SetViaBotID(value int64) { u.Flags.Set(11) u.ViaBotID = value } // GetViaBotID returns value of ViaBotID conditional field and // boolean which is true if field was set. -func (u *UpdateShortMessage) GetViaBotID() (value int, ok bool) { +func (u *UpdateShortMessage) GetViaBotID() (value int64, ok bool) { if !u.Flags.Has(11) { return value, false } @@ -796,7 +796,7 @@ func (u *UpdateShortMessage) MapEntities() (value MessageEntityClassArray, ok bo return MessageEntityClassArray(u.Entities), true } -// UpdateShortChatMessage represents TL type `updateShortChatMessage#1157b858`. +// UpdateShortChatMessage represents TL type `updateShortChatMessage#4d6deea5`. // Shortened constructor containing info on one new incoming text message from a chat // // See https://core.telegram.org/constructor/updateShortChatMessage for reference. @@ -817,9 +817,9 @@ type UpdateShortChatMessage struct { // ID of the message ID int // ID of the sender of the message - FromID int + FromID int64 // ID of the chat where the message was sent - ChatID int + ChatID int64 // Message Message string // PTS¹ @@ -844,7 +844,7 @@ type UpdateShortChatMessage struct { // Info about the inline bot used to generate this message // // Use SetViaBotID and GetViaBotID helpers. - ViaBotID int + ViaBotID int64 // Reply (thread) information // // Use SetReplyTo and GetReplyTo helpers. @@ -863,7 +863,7 @@ type UpdateShortChatMessage struct { } // UpdateShortChatMessageTypeID is TL type id of UpdateShortChatMessage. -const UpdateShortChatMessageTypeID = 0x1157b858 +const UpdateShortChatMessageTypeID = 0x4d6deea5 // construct implements constructor of UpdatesClass. func (u UpdateShortChatMessage) construct() UpdatesClass { return &u } @@ -953,14 +953,14 @@ func (u *UpdateShortChatMessage) FillFrom(from interface { GetMediaUnread() (value bool) GetSilent() (value bool) GetID() (value int) - GetFromID() (value int) - GetChatID() (value int) + GetFromID() (value int64) + GetChatID() (value int64) GetMessage() (value string) GetPts() (value int) GetPtsCount() (value int) GetDate() (value int) GetFwdFrom() (value MessageFwdHeader, ok bool) - GetViaBotID() (value int, ok bool) + GetViaBotID() (value int64, ok bool) GetReplyTo() (value MessageReplyHeader, ok bool) GetEntities() (value []MessageEntityClass, ok bool) GetTTLPeriod() (value int, ok bool) @@ -1101,7 +1101,7 @@ func (u *UpdateShortChatMessage) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateShortChatMessage) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateShortChatMessage#1157b858 as nil") + return fmt.Errorf("can't encode updateShortChatMessage#4d6deea5 as nil") } b.PutID(UpdateShortChatMessageTypeID) return u.EncodeBare(b) @@ -1110,7 +1110,7 @@ func (u *UpdateShortChatMessage) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateShortChatMessage) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateShortChatMessage#1157b858 as nil") + return fmt.Errorf("can't encode updateShortChatMessage#4d6deea5 as nil") } if !(u.Out == false) { u.Flags.Set(1) @@ -1140,36 +1140,36 @@ func (u *UpdateShortChatMessage) EncodeBare(b *bin.Buffer) error { u.Flags.Set(25) } if err := u.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateShortChatMessage#1157b858: field flags: %w", err) + return fmt.Errorf("unable to encode updateShortChatMessage#4d6deea5: field flags: %w", err) } b.PutInt(u.ID) - b.PutInt(u.FromID) - b.PutInt(u.ChatID) + b.PutLong(u.FromID) + b.PutLong(u.ChatID) b.PutString(u.Message) b.PutInt(u.Pts) b.PutInt(u.PtsCount) b.PutInt(u.Date) if u.Flags.Has(2) { if err := u.FwdFrom.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateShortChatMessage#1157b858: field fwd_from: %w", err) + return fmt.Errorf("unable to encode updateShortChatMessage#4d6deea5: field fwd_from: %w", err) } } if u.Flags.Has(11) { - b.PutInt(u.ViaBotID) + b.PutLong(u.ViaBotID) } if u.Flags.Has(3) { if err := u.ReplyTo.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateShortChatMessage#1157b858: field reply_to: %w", err) + return fmt.Errorf("unable to encode updateShortChatMessage#4d6deea5: field reply_to: %w", err) } } if u.Flags.Has(7) { b.PutVectorHeader(len(u.Entities)) for idx, v := range u.Entities { if v == nil { - return fmt.Errorf("unable to encode updateShortChatMessage#1157b858: field entities element with index %d is nil", idx) + return fmt.Errorf("unable to encode updateShortChatMessage#4d6deea5: field entities element with index %d is nil", idx) } if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode updateShortChatMessage#1157b858: field entities element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode updateShortChatMessage#4d6deea5: field entities element with index %d: %w", idx, err) } } } @@ -1182,10 +1182,10 @@ func (u *UpdateShortChatMessage) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UpdateShortChatMessage) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateShortChatMessage#1157b858 to nil") + return fmt.Errorf("can't decode updateShortChatMessage#4d6deea5 to nil") } if err := b.ConsumeID(UpdateShortChatMessageTypeID); err != nil { - return fmt.Errorf("unable to decode updateShortChatMessage#1157b858: %w", err) + return fmt.Errorf("unable to decode updateShortChatMessage#4d6deea5: %w", err) } return u.DecodeBare(b) } @@ -1193,11 +1193,11 @@ func (u *UpdateShortChatMessage) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateShortChatMessage) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateShortChatMessage#1157b858 to nil") + return fmt.Errorf("can't decode updateShortChatMessage#4d6deea5 to nil") } { if err := u.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode updateShortChatMessage#1157b858: field flags: %w", err) + return fmt.Errorf("unable to decode updateShortChatMessage#4d6deea5: field flags: %w", err) } } u.Out = u.Flags.Has(1) @@ -1207,73 +1207,73 @@ func (u *UpdateShortChatMessage) DecodeBare(b *bin.Buffer) error { { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateShortChatMessage#1157b858: field id: %w", err) + return fmt.Errorf("unable to decode updateShortChatMessage#4d6deea5: field id: %w", err) } u.ID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateShortChatMessage#1157b858: field from_id: %w", err) + return fmt.Errorf("unable to decode updateShortChatMessage#4d6deea5: field from_id: %w", err) } u.FromID = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateShortChatMessage#1157b858: field chat_id: %w", err) + return fmt.Errorf("unable to decode updateShortChatMessage#4d6deea5: field chat_id: %w", err) } u.ChatID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode updateShortChatMessage#1157b858: field message: %w", err) + return fmt.Errorf("unable to decode updateShortChatMessage#4d6deea5: field message: %w", err) } u.Message = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateShortChatMessage#1157b858: field pts: %w", err) + return fmt.Errorf("unable to decode updateShortChatMessage#4d6deea5: field pts: %w", err) } u.Pts = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateShortChatMessage#1157b858: field pts_count: %w", err) + return fmt.Errorf("unable to decode updateShortChatMessage#4d6deea5: field pts_count: %w", err) } u.PtsCount = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateShortChatMessage#1157b858: field date: %w", err) + return fmt.Errorf("unable to decode updateShortChatMessage#4d6deea5: field date: %w", err) } u.Date = value } if u.Flags.Has(2) { if err := u.FwdFrom.Decode(b); err != nil { - return fmt.Errorf("unable to decode updateShortChatMessage#1157b858: field fwd_from: %w", err) + return fmt.Errorf("unable to decode updateShortChatMessage#4d6deea5: field fwd_from: %w", err) } } if u.Flags.Has(11) { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode updateShortChatMessage#1157b858: field via_bot_id: %w", err) + return fmt.Errorf("unable to decode updateShortChatMessage#4d6deea5: field via_bot_id: %w", err) } u.ViaBotID = value } if u.Flags.Has(3) { if err := u.ReplyTo.Decode(b); err != nil { - return fmt.Errorf("unable to decode updateShortChatMessage#1157b858: field reply_to: %w", err) + return fmt.Errorf("unable to decode updateShortChatMessage#4d6deea5: field reply_to: %w", err) } } if u.Flags.Has(7) { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode updateShortChatMessage#1157b858: field entities: %w", err) + return fmt.Errorf("unable to decode updateShortChatMessage#4d6deea5: field entities: %w", err) } if headerLen > 0 { @@ -1282,7 +1282,7 @@ func (u *UpdateShortChatMessage) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := DecodeMessageEntity(b) if err != nil { - return fmt.Errorf("unable to decode updateShortChatMessage#1157b858: field entities: %w", err) + return fmt.Errorf("unable to decode updateShortChatMessage#4d6deea5: field entities: %w", err) } u.Entities = append(u.Entities, value) } @@ -1290,7 +1290,7 @@ func (u *UpdateShortChatMessage) DecodeBare(b *bin.Buffer) error { if u.Flags.Has(25) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode updateShortChatMessage#1157b858: field ttl_period: %w", err) + return fmt.Errorf("unable to decode updateShortChatMessage#4d6deea5: field ttl_period: %w", err) } u.TTLPeriod = value } @@ -1367,12 +1367,12 @@ func (u *UpdateShortChatMessage) GetID() (value int) { } // GetFromID returns value of FromID field. -func (u *UpdateShortChatMessage) GetFromID() (value int) { +func (u *UpdateShortChatMessage) GetFromID() (value int64) { return u.FromID } // GetChatID returns value of ChatID field. -func (u *UpdateShortChatMessage) GetChatID() (value int) { +func (u *UpdateShortChatMessage) GetChatID() (value int64) { return u.ChatID } @@ -1412,14 +1412,14 @@ func (u *UpdateShortChatMessage) GetFwdFrom() (value MessageFwdHeader, ok bool) } // SetViaBotID sets value of ViaBotID conditional field. -func (u *UpdateShortChatMessage) SetViaBotID(value int) { +func (u *UpdateShortChatMessage) SetViaBotID(value int64) { u.Flags.Set(11) u.ViaBotID = value } // GetViaBotID returns value of ViaBotID conditional field and // boolean which is true if field was set. -func (u *UpdateShortChatMessage) GetViaBotID() (value int, ok bool) { +func (u *UpdateShortChatMessage) GetViaBotID() (value int64, ok bool) { if !u.Flags.Has(11) { return value, false } @@ -2699,8 +2699,8 @@ func (u *UpdateShortSentMessage) MapEntities() (value MessageEntityClassArray, o // } // switch v := g.(type) { // case *tg.UpdatesTooLong: // updatesTooLong#e317af7e -// case *tg.UpdateShortMessage: // updateShortMessage#faeff833 -// case *tg.UpdateShortChatMessage: // updateShortChatMessage#1157b858 +// case *tg.UpdateShortMessage: // updateShortMessage#313bc7f8 +// case *tg.UpdateShortChatMessage: // updateShortChatMessage#4d6deea5 // case *tg.UpdateShort: // updateShort#78d4dec1 // case *tg.UpdatesCombined: // updatesCombined#725b04c3 // case *tg.Updates: // updates#74ae4240 @@ -2741,14 +2741,14 @@ func DecodeUpdates(buf *bin.Buffer) (UpdatesClass, error) { } return &v, nil case UpdateShortMessageTypeID: - // Decoding updateShortMessage#faeff833. + // Decoding updateShortMessage#313bc7f8. v := UpdateShortMessage{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdatesClass: %w", err) } return &v, nil case UpdateShortChatMessageTypeID: - // Decoding updateShortChatMessage#1157b858. + // Decoding updateShortChatMessage#4d6deea5. v := UpdateShortChatMessage{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdatesClass: %w", err) diff --git a/tg/tl_user_gen.go b/tg/tl_user_gen.go index 1dec4259f5..dd60f61680 100644 --- a/tg/tl_user_gen.go +++ b/tg/tl_user_gen.go @@ -29,17 +29,17 @@ var ( _ = tgerr.Error{} ) -// UserEmpty represents TL type `userEmpty#200250ba`. +// UserEmpty represents TL type `userEmpty#d3bc4b7a`. // Empty constructor, non-existent user. // // See https://core.telegram.org/constructor/userEmpty for reference. type UserEmpty struct { // User identifier or 0 - ID int + ID int64 } // UserEmptyTypeID is TL type id of UserEmpty. -const UserEmptyTypeID = 0x200250ba +const UserEmptyTypeID = 0xd3bc4b7a // construct implements constructor of UserClass. func (u UserEmpty) construct() UserClass { return &u } @@ -76,7 +76,7 @@ func (u *UserEmpty) String() string { // FillFrom fills UserEmpty from given interface. func (u *UserEmpty) FillFrom(from interface { - GetID() (value int) + GetID() (value int64) }) { u.ID = from.GetID() } @@ -115,7 +115,7 @@ func (u *UserEmpty) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UserEmpty) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode userEmpty#200250ba as nil") + return fmt.Errorf("can't encode userEmpty#d3bc4b7a as nil") } b.PutID(UserEmptyTypeID) return u.EncodeBare(b) @@ -124,19 +124,19 @@ func (u *UserEmpty) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UserEmpty) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode userEmpty#200250ba as nil") + return fmt.Errorf("can't encode userEmpty#d3bc4b7a as nil") } - b.PutInt(u.ID) + b.PutLong(u.ID) return nil } // Decode implements bin.Decoder. func (u *UserEmpty) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode userEmpty#200250ba to nil") + return fmt.Errorf("can't decode userEmpty#d3bc4b7a to nil") } if err := b.ConsumeID(UserEmptyTypeID); err != nil { - return fmt.Errorf("unable to decode userEmpty#200250ba: %w", err) + return fmt.Errorf("unable to decode userEmpty#d3bc4b7a: %w", err) } return u.DecodeBare(b) } @@ -144,12 +144,12 @@ func (u *UserEmpty) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UserEmpty) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode userEmpty#200250ba to nil") + return fmt.Errorf("can't decode userEmpty#d3bc4b7a to nil") } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode userEmpty#200250ba: field id: %w", err) + return fmt.Errorf("unable to decode userEmpty#d3bc4b7a: field id: %w", err) } u.ID = value } @@ -157,11 +157,11 @@ func (u *UserEmpty) DecodeBare(b *bin.Buffer) error { } // GetID returns value of ID field. -func (u *UserEmpty) GetID() (value int) { +func (u *UserEmpty) GetID() (value int64) { return u.ID } -// User represents TL type `user#938458c1`. +// User represents TL type `user#3ff6ecb0`. // Indicates info about a certain user // // See https://core.telegram.org/constructor/user for reference. @@ -205,7 +205,7 @@ type User struct { // Fake field of User. Fake bool // ID of the user - ID int + ID int64 // Access hash of the user // // Use SetAccessHash and GetAccessHash helpers. @@ -256,7 +256,7 @@ type User struct { } // UserTypeID is TL type id of User. -const UserTypeID = 0x938458c1 +const UserTypeID = 0x3ff6ecb0 // construct implements constructor of UserClass. func (u User) construct() UserClass { return &u } @@ -389,7 +389,7 @@ func (u *User) FillFrom(from interface { GetScam() (value bool) GetApplyMinPhoto() (value bool) GetFake() (value bool) - GetID() (value int) + GetID() (value int64) GetAccessHash() (value int64, ok bool) GetFirstName() (value string, ok bool) GetLastName() (value string, ok bool) @@ -628,7 +628,7 @@ func (u *User) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *User) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode user#938458c1 as nil") + return fmt.Errorf("can't encode user#3ff6ecb0 as nil") } b.PutID(UserTypeID) return u.EncodeBare(b) @@ -637,7 +637,7 @@ func (u *User) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *User) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode user#938458c1 as nil") + return fmt.Errorf("can't encode user#3ff6ecb0 as nil") } if !(u.Self == false) { u.Flags.Set(10) @@ -718,9 +718,9 @@ func (u *User) EncodeBare(b *bin.Buffer) error { u.Flags.Set(22) } if err := u.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode user#938458c1: field flags: %w", err) + return fmt.Errorf("unable to encode user#3ff6ecb0: field flags: %w", err) } - b.PutInt(u.ID) + b.PutLong(u.ID) if u.Flags.Has(0) { b.PutLong(u.AccessHash) } @@ -738,18 +738,18 @@ func (u *User) EncodeBare(b *bin.Buffer) error { } if u.Flags.Has(5) { if u.Photo == nil { - return fmt.Errorf("unable to encode user#938458c1: field photo is nil") + return fmt.Errorf("unable to encode user#3ff6ecb0: field photo is nil") } if err := u.Photo.Encode(b); err != nil { - return fmt.Errorf("unable to encode user#938458c1: field photo: %w", err) + return fmt.Errorf("unable to encode user#3ff6ecb0: field photo: %w", err) } } if u.Flags.Has(6) { if u.Status == nil { - return fmt.Errorf("unable to encode user#938458c1: field status is nil") + return fmt.Errorf("unable to encode user#3ff6ecb0: field status is nil") } if err := u.Status.Encode(b); err != nil { - return fmt.Errorf("unable to encode user#938458c1: field status: %w", err) + return fmt.Errorf("unable to encode user#3ff6ecb0: field status: %w", err) } } if u.Flags.Has(14) { @@ -759,7 +759,7 @@ func (u *User) EncodeBare(b *bin.Buffer) error { b.PutVectorHeader(len(u.RestrictionReason)) for idx, v := range u.RestrictionReason { if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode user#938458c1: field restriction_reason element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode user#3ff6ecb0: field restriction_reason element with index %d: %w", idx, err) } } } @@ -775,10 +775,10 @@ func (u *User) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *User) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode user#938458c1 to nil") + return fmt.Errorf("can't decode user#3ff6ecb0 to nil") } if err := b.ConsumeID(UserTypeID); err != nil { - return fmt.Errorf("unable to decode user#938458c1: %w", err) + return fmt.Errorf("unable to decode user#3ff6ecb0: %w", err) } return u.DecodeBare(b) } @@ -786,11 +786,11 @@ func (u *User) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *User) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode user#938458c1 to nil") + return fmt.Errorf("can't decode user#3ff6ecb0 to nil") } { if err := u.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode user#938458c1: field flags: %w", err) + return fmt.Errorf("unable to decode user#3ff6ecb0: field flags: %w", err) } } u.Self = u.Flags.Has(10) @@ -809,72 +809,72 @@ func (u *User) DecodeBare(b *bin.Buffer) error { u.ApplyMinPhoto = u.Flags.Has(25) u.Fake = u.Flags.Has(26) { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode user#938458c1: field id: %w", err) + return fmt.Errorf("unable to decode user#3ff6ecb0: field id: %w", err) } u.ID = value } if u.Flags.Has(0) { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode user#938458c1: field access_hash: %w", err) + return fmt.Errorf("unable to decode user#3ff6ecb0: field access_hash: %w", err) } u.AccessHash = value } if u.Flags.Has(1) { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode user#938458c1: field first_name: %w", err) + return fmt.Errorf("unable to decode user#3ff6ecb0: field first_name: %w", err) } u.FirstName = value } if u.Flags.Has(2) { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode user#938458c1: field last_name: %w", err) + return fmt.Errorf("unable to decode user#3ff6ecb0: field last_name: %w", err) } u.LastName = value } if u.Flags.Has(3) { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode user#938458c1: field username: %w", err) + return fmt.Errorf("unable to decode user#3ff6ecb0: field username: %w", err) } u.Username = value } if u.Flags.Has(4) { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode user#938458c1: field phone: %w", err) + return fmt.Errorf("unable to decode user#3ff6ecb0: field phone: %w", err) } u.Phone = value } if u.Flags.Has(5) { value, err := DecodeUserProfilePhoto(b) if err != nil { - return fmt.Errorf("unable to decode user#938458c1: field photo: %w", err) + return fmt.Errorf("unable to decode user#3ff6ecb0: field photo: %w", err) } u.Photo = value } if u.Flags.Has(6) { value, err := DecodeUserStatus(b) if err != nil { - return fmt.Errorf("unable to decode user#938458c1: field status: %w", err) + return fmt.Errorf("unable to decode user#3ff6ecb0: field status: %w", err) } u.Status = value } if u.Flags.Has(14) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode user#938458c1: field bot_info_version: %w", err) + return fmt.Errorf("unable to decode user#3ff6ecb0: field bot_info_version: %w", err) } u.BotInfoVersion = value } if u.Flags.Has(18) { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode user#938458c1: field restriction_reason: %w", err) + return fmt.Errorf("unable to decode user#3ff6ecb0: field restriction_reason: %w", err) } if headerLen > 0 { @@ -883,7 +883,7 @@ func (u *User) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { var value RestrictionReason if err := value.Decode(b); err != nil { - return fmt.Errorf("unable to decode user#938458c1: field restriction_reason: %w", err) + return fmt.Errorf("unable to decode user#3ff6ecb0: field restriction_reason: %w", err) } u.RestrictionReason = append(u.RestrictionReason, value) } @@ -891,14 +891,14 @@ func (u *User) DecodeBare(b *bin.Buffer) error { if u.Flags.Has(19) { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode user#938458c1: field bot_inline_placeholder: %w", err) + return fmt.Errorf("unable to decode user#3ff6ecb0: field bot_inline_placeholder: %w", err) } u.BotInlinePlaceholder = value } if u.Flags.Has(22) { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode user#938458c1: field lang_code: %w", err) + return fmt.Errorf("unable to decode user#3ff6ecb0: field lang_code: %w", err) } u.LangCode = value } @@ -1146,7 +1146,7 @@ func (u *User) GetFake() (value bool) { } // GetID returns value of ID field. -func (u *User) GetID() (value int) { +func (u *User) GetID() (value int64) { return u.ID } @@ -1325,8 +1325,8 @@ func (u *User) GetLangCode() (value string, ok bool) { // panic(err) // } // switch v := g.(type) { -// case *tg.UserEmpty: // userEmpty#200250ba -// case *tg.User: // user#938458c1 +// case *tg.UserEmpty: // userEmpty#d3bc4b7a +// case *tg.User: // user#3ff6ecb0 // default: panic(v) // } type UserClass interface { @@ -1348,7 +1348,7 @@ type UserClass interface { Zero() bool // User identifier or 0 - GetID() (value int) + GetID() (value int64) // AsNotEmpty tries to map UserClass to User. AsNotEmpty() (*User, bool) @@ -1394,14 +1394,14 @@ func DecodeUser(buf *bin.Buffer) (UserClass, error) { } switch id { case UserEmptyTypeID: - // Decoding userEmpty#200250ba. + // Decoding userEmpty#d3bc4b7a. v := UserEmpty{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UserClass: %w", err) } return &v, nil case UserTypeID: - // Decoding user#938458c1. + // Decoding user#3ff6ecb0. v := User{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UserClass: %w", err) diff --git a/tg/tl_user_slices_gen.go b/tg/tl_user_slices_gen.go index 500a446ffd..9596784e2d 100644 --- a/tg/tl_user_slices_gen.go +++ b/tg/tl_user_slices_gen.go @@ -129,7 +129,7 @@ func (s UserClassArray) SortStableByID() UserClassArray { } // FillUserEmptyMap fills only UserEmpty constructors to given map. -func (s UserClassArray) FillUserEmptyMap(to map[int]*UserEmpty) { +func (s UserClassArray) FillUserEmptyMap(to map[int64]*UserEmpty) { for _, elem := range s { value, ok := elem.(*UserEmpty) if !ok { @@ -140,8 +140,8 @@ func (s UserClassArray) FillUserEmptyMap(to map[int]*UserEmpty) { } // UserEmptyToMap collects only UserEmpty constructors to map. -func (s UserClassArray) UserEmptyToMap() map[int]*UserEmpty { - r := make(map[int]*UserEmpty, len(s)) +func (s UserClassArray) UserEmptyToMap() map[int64]*UserEmpty { + r := make(map[int64]*UserEmpty, len(s)) s.FillUserEmptyMap(r) return r } @@ -160,7 +160,7 @@ func (s UserClassArray) AsUserEmpty() (to UserEmptyArray) { } // FillUserMap fills only User constructors to given map. -func (s UserClassArray) FillUserMap(to map[int]*User) { +func (s UserClassArray) FillUserMap(to map[int64]*User) { for _, elem := range s { value, ok := elem.(*User) if !ok { @@ -171,8 +171,8 @@ func (s UserClassArray) FillUserMap(to map[int]*User) { } // UserToMap collects only User constructors to map. -func (s UserClassArray) UserToMap() map[int]*User { - r := make(map[int]*User, len(s)) +func (s UserClassArray) UserToMap() map[int64]*User { + r := make(map[int64]*User, len(s)) s.FillUserMap(r) return r } @@ -191,7 +191,7 @@ func (s UserClassArray) AsUser() (to UserArray) { } // FillNotEmptyMap fills only NotEmpty constructors to given map. -func (s UserClassArray) FillNotEmptyMap(to map[int]*User) { +func (s UserClassArray) FillNotEmptyMap(to map[int64]*User) { for _, elem := range s { value, ok := elem.AsNotEmpty() if !ok { @@ -202,8 +202,8 @@ func (s UserClassArray) FillNotEmptyMap(to map[int]*User) { } // NotEmptyToMap collects only NotEmpty constructors to map. -func (s UserClassArray) NotEmptyToMap() map[int]*User { - r := make(map[int]*User, len(s)) +func (s UserClassArray) NotEmptyToMap() map[int64]*User { + r := make(map[int64]*User, len(s)) s.FillNotEmptyMap(r) return r } @@ -360,15 +360,15 @@ func (s UserEmptyArray) SortStableByID() UserEmptyArray { } // FillMap fills constructors to given map. -func (s UserEmptyArray) FillMap(to map[int]UserEmpty) { +func (s UserEmptyArray) FillMap(to map[int64]UserEmpty) { for _, value := range s { to[value.GetID()] = value } } // ToMap collects constructors to map. -func (s UserEmptyArray) ToMap() map[int]UserEmpty { - r := make(map[int]UserEmpty, len(s)) +func (s UserEmptyArray) ToMap() map[int64]UserEmpty { + r := make(map[int64]UserEmpty, len(s)) s.FillMap(r) return r } @@ -470,15 +470,15 @@ func (s UserArray) SortStableByID() UserArray { } // FillMap fills constructors to given map. -func (s UserArray) FillMap(to map[int]User) { +func (s UserArray) FillMap(to map[int64]User) { for _, value := range s { to[value.GetID()] = value } } // ToMap collects constructors to map. -func (s UserArray) ToMap() map[int]User { - r := make(map[int]User, len(s)) +func (s UserArray) ToMap() map[int64]User { + r := make(map[int64]User, len(s)) s.FillMap(r) return r } diff --git a/tg/tl_wall_paper_slices_gen.go b/tg/tl_wall_paper_slices_gen.go index 0a654781ea..52eb095125 100644 --- a/tg/tl_wall_paper_slices_gen.go +++ b/tg/tl_wall_paper_slices_gen.go @@ -114,6 +114,38 @@ func (s *WallPaperClassArray) Pop() (v WallPaperClass, ok bool) { return v, true } +// SortByID sorts slice of WallPaperClass by ID. +func (s WallPaperClassArray) SortByID() WallPaperClassArray { + return s.Sort(func(a, b WallPaperClass) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of WallPaperClass by ID. +func (s WallPaperClassArray) SortStableByID() WallPaperClassArray { + return s.SortStable(func(a, b WallPaperClass) bool { + return a.GetID() < b.GetID() + }) +} + +// FillWallPaperMap fills only WallPaper constructors to given map. +func (s WallPaperClassArray) FillWallPaperMap(to map[int64]*WallPaper) { + for _, elem := range s { + value, ok := elem.(*WallPaper) + if !ok { + continue + } + to[value.GetID()] = value + } +} + +// WallPaperToMap collects only WallPaper constructors to map. +func (s WallPaperClassArray) WallPaperToMap() map[int64]*WallPaper { + r := make(map[int64]*WallPaper, len(s)) + s.FillWallPaperMap(r) + return r +} + // AsWallPaper returns copy with only WallPaper constructors. func (s WallPaperClassArray) AsWallPaper() (to WallPaperArray) { for _, elem := range s { @@ -127,6 +159,24 @@ func (s WallPaperClassArray) AsWallPaper() (to WallPaperArray) { return to } +// FillWallPaperNoFileMap fills only WallPaperNoFile constructors to given map. +func (s WallPaperClassArray) FillWallPaperNoFileMap(to map[int64]*WallPaperNoFile) { + for _, elem := range s { + value, ok := elem.(*WallPaperNoFile) + if !ok { + continue + } + to[value.GetID()] = value + } +} + +// WallPaperNoFileToMap collects only WallPaperNoFile constructors to map. +func (s WallPaperClassArray) WallPaperNoFileToMap() map[int64]*WallPaperNoFile { + r := make(map[int64]*WallPaperNoFile, len(s)) + s.FillWallPaperNoFileMap(r) + return r +} + // AsWallPaperNoFile returns copy with only WallPaperNoFile constructors. func (s WallPaperClassArray) AsWallPaperNoFile() (to WallPaperNoFileArray) { for _, elem := range s { @@ -222,6 +272,34 @@ func (s *WallPaperArray) Pop() (v WallPaper, ok bool) { return v, true } +// SortByID sorts slice of WallPaper by ID. +func (s WallPaperArray) SortByID() WallPaperArray { + return s.Sort(func(a, b WallPaper) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of WallPaper by ID. +func (s WallPaperArray) SortStableByID() WallPaperArray { + return s.SortStable(func(a, b WallPaper) bool { + return a.GetID() < b.GetID() + }) +} + +// FillMap fills constructors to given map. +func (s WallPaperArray) FillMap(to map[int64]WallPaper) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s WallPaperArray) ToMap() map[int64]WallPaper { + r := make(map[int64]WallPaper, len(s)) + s.FillMap(r) + return r +} + // WallPaperNoFileArray is adapter for slice of WallPaperNoFile. type WallPaperNoFileArray []WallPaperNoFile @@ -303,3 +381,31 @@ func (s *WallPaperNoFileArray) Pop() (v WallPaperNoFile, ok bool) { return v, true } + +// SortByID sorts slice of WallPaperNoFile by ID. +func (s WallPaperNoFileArray) SortByID() WallPaperNoFileArray { + return s.Sort(func(a, b WallPaperNoFile) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of WallPaperNoFile by ID. +func (s WallPaperNoFileArray) SortStableByID() WallPaperNoFileArray { + return s.SortStable(func(a, b WallPaperNoFile) bool { + return a.GetID() < b.GetID() + }) +} + +// FillMap fills constructors to given map. +func (s WallPaperNoFileArray) FillMap(to map[int64]WallPaperNoFile) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s WallPaperNoFileArray) ToMap() map[int64]WallPaperNoFile { + r := make(map[int64]WallPaperNoFile, len(s)) + s.FillMap(r) + return r +} diff --git a/tg/tl_web_authorization_gen.go b/tg/tl_web_authorization_gen.go index 5f836ca23f..5b1d616110 100644 --- a/tg/tl_web_authorization_gen.go +++ b/tg/tl_web_authorization_gen.go @@ -29,7 +29,7 @@ var ( _ = tgerr.Error{} ) -// WebAuthorization represents TL type `webAuthorization#cac943f2`. +// WebAuthorization represents TL type `webAuthorization#a6f8f452`. // Represents a bot logged in using the Telegram login widget¹ // // Links: @@ -40,7 +40,7 @@ type WebAuthorization struct { // Authorization hash Hash int64 // Bot ID - BotID int + BotID int64 // The domain name of the website on which the user has logged in. Domain string // Browser user-agent @@ -58,7 +58,7 @@ type WebAuthorization struct { } // WebAuthorizationTypeID is TL type id of WebAuthorization. -const WebAuthorizationTypeID = 0xcac943f2 +const WebAuthorizationTypeID = 0xa6f8f452 // Ensuring interfaces in compile-time for WebAuthorization. var ( @@ -115,7 +115,7 @@ func (w *WebAuthorization) String() string { // FillFrom fills WebAuthorization from given interface. func (w *WebAuthorization) FillFrom(from interface { GetHash() (value int64) - GetBotID() (value int) + GetBotID() (value int64) GetDomain() (value string) GetBrowser() (value string) GetPlatform() (value string) @@ -201,7 +201,7 @@ func (w *WebAuthorization) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (w *WebAuthorization) Encode(b *bin.Buffer) error { if w == nil { - return fmt.Errorf("can't encode webAuthorization#cac943f2 as nil") + return fmt.Errorf("can't encode webAuthorization#a6f8f452 as nil") } b.PutID(WebAuthorizationTypeID) return w.EncodeBare(b) @@ -210,10 +210,10 @@ func (w *WebAuthorization) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (w *WebAuthorization) EncodeBare(b *bin.Buffer) error { if w == nil { - return fmt.Errorf("can't encode webAuthorization#cac943f2 as nil") + return fmt.Errorf("can't encode webAuthorization#a6f8f452 as nil") } b.PutLong(w.Hash) - b.PutInt(w.BotID) + b.PutLong(w.BotID) b.PutString(w.Domain) b.PutString(w.Browser) b.PutString(w.Platform) @@ -227,10 +227,10 @@ func (w *WebAuthorization) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (w *WebAuthorization) Decode(b *bin.Buffer) error { if w == nil { - return fmt.Errorf("can't decode webAuthorization#cac943f2 to nil") + return fmt.Errorf("can't decode webAuthorization#a6f8f452 to nil") } if err := b.ConsumeID(WebAuthorizationTypeID); err != nil { - return fmt.Errorf("unable to decode webAuthorization#cac943f2: %w", err) + return fmt.Errorf("unable to decode webAuthorization#a6f8f452: %w", err) } return w.DecodeBare(b) } @@ -238,68 +238,68 @@ func (w *WebAuthorization) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (w *WebAuthorization) DecodeBare(b *bin.Buffer) error { if w == nil { - return fmt.Errorf("can't decode webAuthorization#cac943f2 to nil") + return fmt.Errorf("can't decode webAuthorization#a6f8f452 to nil") } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode webAuthorization#cac943f2: field hash: %w", err) + return fmt.Errorf("unable to decode webAuthorization#a6f8f452: field hash: %w", err) } w.Hash = value } { - value, err := b.Int() + value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode webAuthorization#cac943f2: field bot_id: %w", err) + return fmt.Errorf("unable to decode webAuthorization#a6f8f452: field bot_id: %w", err) } w.BotID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode webAuthorization#cac943f2: field domain: %w", err) + return fmt.Errorf("unable to decode webAuthorization#a6f8f452: field domain: %w", err) } w.Domain = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode webAuthorization#cac943f2: field browser: %w", err) + return fmt.Errorf("unable to decode webAuthorization#a6f8f452: field browser: %w", err) } w.Browser = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode webAuthorization#cac943f2: field platform: %w", err) + return fmt.Errorf("unable to decode webAuthorization#a6f8f452: field platform: %w", err) } w.Platform = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode webAuthorization#cac943f2: field date_created: %w", err) + return fmt.Errorf("unable to decode webAuthorization#a6f8f452: field date_created: %w", err) } w.DateCreated = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode webAuthorization#cac943f2: field date_active: %w", err) + return fmt.Errorf("unable to decode webAuthorization#a6f8f452: field date_active: %w", err) } w.DateActive = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode webAuthorization#cac943f2: field ip: %w", err) + return fmt.Errorf("unable to decode webAuthorization#a6f8f452: field ip: %w", err) } w.IP = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode webAuthorization#cac943f2: field region: %w", err) + return fmt.Errorf("unable to decode webAuthorization#a6f8f452: field region: %w", err) } w.Region = value } @@ -312,7 +312,7 @@ func (w *WebAuthorization) GetHash() (value int64) { } // GetBotID returns value of BotID field. -func (w *WebAuthorization) GetBotID() (value int) { +func (w *WebAuthorization) GetBotID() (value int64) { return w.BotID } diff --git a/tg/tl_web_page_slices_gen.go b/tg/tl_web_page_slices_gen.go index 43a8c4ec55..75a24d7b4a 100644 --- a/tg/tl_web_page_slices_gen.go +++ b/tg/tl_web_page_slices_gen.go @@ -166,6 +166,24 @@ func (s WebPageClassArray) AsWebPageNotModified() (to WebPageNotModifiedArray) { return to } +// FillModifiedMap fills only Modified constructors to given map. +func (s WebPageClassArray) FillModifiedMap(to map[int64]ModifiedWebPage) { + for _, elem := range s { + value, ok := elem.AsModified() + if !ok { + continue + } + to[value.GetID()] = value + } +} + +// ModifiedToMap collects only Modified constructors to map. +func (s WebPageClassArray) ModifiedToMap() map[int64]ModifiedWebPage { + r := make(map[int64]ModifiedWebPage, len(s)) + s.FillModifiedMap(r) + return r +} + // AppendOnlyModified appends only Modified constructors to // given slice. func (s WebPageClassArray) AppendOnlyModified(to []ModifiedWebPage) []ModifiedWebPage { @@ -303,6 +321,34 @@ func (s *WebPageEmptyArray) Pop() (v WebPageEmpty, ok bool) { return v, true } +// SortByID sorts slice of WebPageEmpty by ID. +func (s WebPageEmptyArray) SortByID() WebPageEmptyArray { + return s.Sort(func(a, b WebPageEmpty) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of WebPageEmpty by ID. +func (s WebPageEmptyArray) SortStableByID() WebPageEmptyArray { + return s.SortStable(func(a, b WebPageEmpty) bool { + return a.GetID() < b.GetID() + }) +} + +// FillMap fills constructors to given map. +func (s WebPageEmptyArray) FillMap(to map[int64]WebPageEmpty) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s WebPageEmptyArray) ToMap() map[int64]WebPageEmpty { + r := make(map[int64]WebPageEmpty, len(s)) + s.FillMap(r) + return r +} + // WebPagePendingArray is adapter for slice of WebPagePending. type WebPagePendingArray []WebPagePending @@ -385,6 +431,20 @@ func (s *WebPagePendingArray) Pop() (v WebPagePending, ok bool) { return v, true } +// SortByID sorts slice of WebPagePending by ID. +func (s WebPagePendingArray) SortByID() WebPagePendingArray { + return s.Sort(func(a, b WebPagePending) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of WebPagePending by ID. +func (s WebPagePendingArray) SortStableByID() WebPagePendingArray { + return s.SortStable(func(a, b WebPagePending) bool { + return a.GetID() < b.GetID() + }) +} + // SortByDate sorts slice of WebPagePending by Date. func (s WebPagePendingArray) SortByDate() WebPagePendingArray { return s.Sort(func(a, b WebPagePending) bool { @@ -399,6 +459,20 @@ func (s WebPagePendingArray) SortStableByDate() WebPagePendingArray { }) } +// FillMap fills constructors to given map. +func (s WebPagePendingArray) FillMap(to map[int64]WebPagePending) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s WebPagePendingArray) ToMap() map[int64]WebPagePending { + r := make(map[int64]WebPagePending, len(s)) + s.FillMap(r) + return r +} + // WebPageArray is adapter for slice of WebPage. type WebPageArray []WebPage @@ -481,6 +555,34 @@ func (s *WebPageArray) Pop() (v WebPage, ok bool) { return v, true } +// SortByID sorts slice of WebPage by ID. +func (s WebPageArray) SortByID() WebPageArray { + return s.Sort(func(a, b WebPage) bool { + return a.GetID() < b.GetID() + }) +} + +// SortStableByID sorts slice of WebPage by ID. +func (s WebPageArray) SortStableByID() WebPageArray { + return s.SortStable(func(a, b WebPage) bool { + return a.GetID() < b.GetID() + }) +} + +// FillMap fills constructors to given map. +func (s WebPageArray) FillMap(to map[int64]WebPage) { + for _, value := range s { + to[value.GetID()] = value + } +} + +// ToMap collects constructors to map. +func (s WebPageArray) ToMap() map[int64]WebPage { + r := make(map[int64]WebPage, len(s)) + s.FillMap(r) + return r +} + // WebPageNotModifiedArray is adapter for slice of WebPageNotModified. type WebPageNotModifiedArray []WebPageNotModified