gotd: update to layer 218

This commit is contained in:
Tulir Asokan
2025-12-03 14:22:16 +02:00
parent b38c3cc935
commit 66b84a7b44
2065 changed files with 53382 additions and 684259 deletions
-4
View File
@@ -17,10 +17,6 @@ download_e2e_schema:
go run ./cmd/dltl -f secret_api.tl -o _schema/encrypted.tl
.PHONY: download_e2e_schema
download_tdlib_schema:
go run ./cmd/dltl -f td_api.tl -o _schema/tdapi.tl
.PHONY: download_tdlib_schema
check_generated: generate
git diff --exit-code
.PHONY: check_generated
File diff suppressed because it is too large Load Diff
+325 -111
View File
@@ -1,8 +1,8 @@
// Code generated by ./cmd/dltl, DO NOT EDIT.
//
// Source: https://raw.githubusercontent.com/telegramdesktop/tdesktop/dev/Telegram/SourceFiles/mtproto/scheme/api.tl
// Layer: 204
// SHA256: 21a7c3d4b245cd896149abd28e114be32e2a27519682b72fd917a06630f5ef7d
// Layer: 218
// SHA256: 33b36383ad43d41e6b592791311ca0d65a06cf2d3ef9d607a6e187cddac7f14b
boolFalse#bc799737 = Bool;
@@ -36,7 +36,7 @@ inputUser#f21158c6 user_id:long access_hash:long = 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;
inputPhoneContact#6a1dc4be flags:# client_id:long phone:string first_name:string last_name:string note:flags.0?TextWithEntities = InputContact;
inputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;
@@ -80,6 +80,8 @@ inputMediaWebPage#c21b8849 flags:# force_large_media:flags.0?true force_small_me
inputMediaPaidMedia#c4103386 flags:# stars_amount:long extended_media:Vector<InputMedia> payload:flags.0?string = InputMedia;
inputMediaTodo#9fc55fde todo:TodoList = InputMedia;
inputChatPhotoEmpty#1ca48f57 = InputChatPhoto;
inputChatUploadedPhoto#bdcdaec0 flags:# file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double video_emoji_markup:flags.3?VideoSize = InputChatPhoto;
@@ -142,7 +144,7 @@ storage.fileWebp#1081464c = storage.FileType;
userEmpty#d3bc4b7a id:long = User;
user#20b1422 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true fake:flags.26?true bot_attach_menu:flags.27?true premium:flags.28?true attach_menu_enabled:flags.29?true flags2:# bot_can_edit:flags2.1?true close_friend:flags2.2?true stories_hidden:flags2.3?true stories_unavailable:flags2.4?true contact_require_premium:flags2.10?true bot_business:flags2.11?true bot_has_main_app:flags2.13?true id:long access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector<RestrictionReason> bot_inline_placeholder:flags.19?string lang_code:flags.22?string emoji_status:flags.30?EmojiStatus usernames:flags2.0?Vector<Username> stories_max_id:flags2.5?int color:flags2.8?PeerColor profile_color:flags2.9?PeerColor bot_active_users:flags2.12?int bot_verification_icon:flags2.14?long send_paid_messages_stars:flags2.15?long = User;
user#31774388 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true fake:flags.26?true bot_attach_menu:flags.27?true premium:flags.28?true attach_menu_enabled:flags.29?true flags2:# bot_can_edit:flags2.1?true close_friend:flags2.2?true stories_hidden:flags2.3?true stories_unavailable:flags2.4?true contact_require_premium:flags2.10?true bot_business:flags2.11?true bot_has_main_app:flags2.13?true bot_forum_view:flags2.16?true id:long access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector<RestrictionReason> bot_inline_placeholder:flags.19?string lang_code:flags.22?string emoji_status:flags.30?EmojiStatus usernames:flags2.0?Vector<Username> stories_max_id:flags2.5?RecentStory color:flags2.8?PeerColor profile_color:flags2.9?PeerColor bot_active_users:flags2.12?int bot_verification_icon:flags2.14?long send_paid_messages_stars:flags2.15?long = User;
userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;
@@ -166,13 +168,13 @@ chat#41cbf256 flags:# creator:flags.0?true left:flags.2?true deactivated:flags.5
chatForbidden#6592a1a7 id:long title:string = Chat;
channel#fe685355 flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true call_active:flags.23?true call_not_empty:flags.24?true fake:flags.25?true gigagroup:flags.26?true noforwards:flags.27?true join_to_send:flags.28?true join_request:flags.29?true forum:flags.30?true flags2:# stories_hidden:flags2.1?true stories_hidden_min:flags2.2?true stories_unavailable:flags2.3?true signature_profiles:flags2.12?true autotranslation:flags2.15?true broadcast_messages_allowed:flags2.16?true monoforum:flags2.17?true forum_tabs:flags2.19?true id:long access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int restriction_reason:flags.9?Vector<RestrictionReason> admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int usernames:flags2.0?Vector<Username> stories_max_id:flags2.4?int color:flags2.7?PeerColor profile_color:flags2.8?PeerColor emoji_status:flags2.9?EmojiStatus level:flags2.10?int subscription_until_date:flags2.11?int bot_verification_icon:flags2.13?long send_paid_messages_stars:flags2.14?long linked_monoforum_id:flags2.18?long = Chat;
channel#1c32b11c flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true call_active:flags.23?true call_not_empty:flags.24?true fake:flags.25?true gigagroup:flags.26?true noforwards:flags.27?true join_to_send:flags.28?true join_request:flags.29?true forum:flags.30?true flags2:# stories_hidden:flags2.1?true stories_hidden_min:flags2.2?true stories_unavailable:flags2.3?true signature_profiles:flags2.12?true autotranslation:flags2.15?true broadcast_messages_allowed:flags2.16?true monoforum:flags2.17?true forum_tabs:flags2.19?true id:long access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int restriction_reason:flags.9?Vector<RestrictionReason> admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int usernames:flags2.0?Vector<Username> stories_max_id:flags2.4?RecentStory color:flags2.7?PeerColor profile_color:flags2.8?PeerColor emoji_status:flags2.9?EmojiStatus level:flags2.10?int subscription_until_date:flags2.11?int bot_verification_icon:flags2.13?long send_paid_messages_stars:flags2.14?long linked_monoforum_id:flags2.18?long = 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#2633421b flags:# can_set_username:flags.7?true has_scheduled:flags.8?true translations_disabled:flags.19?true id:long about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:flags.13?ExportedChatInvite bot_info:flags.3?Vector<BotInfo> pinned_msg_id:flags.6?int folder_id:flags.11?int call:flags.12?InputGroupCall ttl_period:flags.14?int groupcall_default_join_as:flags.15?Peer theme_emoticon:flags.16?string requests_pending:flags.17?int recent_requesters:flags.17?Vector<long> available_reactions:flags.18?ChatReactions reactions_limit:flags.20?int = ChatFull;
channelFull#52d6806b flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true flags2:# can_delete_channel:flags2.0?true antispam:flags2.1?true participants_hidden:flags2.2?true translations_disabled:flags2.3?true stories_pinned_available:flags2.5?true view_forum_as_messages:flags2.6?true restricted_sponsored:flags2.11?true can_view_revenue:flags2.12?true paid_media_allowed:flags2.14?true can_view_stars_revenue:flags2.15?true paid_reactions_available:flags2.16?true stargifts_available:flags2.19?true paid_messages_available:flags2.20?true id:long about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?long migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?long location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector<string> groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string requests_pending:flags.28?int recent_requesters:flags.28?Vector<long> default_send_as:flags.29?Peer available_reactions:flags.30?ChatReactions reactions_limit:flags2.13?int stories:flags2.4?PeerStories wallpaper:flags2.7?WallPaper boosts_applied:flags2.8?int boosts_unrestrict:flags2.9?int emojiset:flags2.10?StickerSet bot_verification:flags2.17?BotVerification stargifts_count:flags2.18?int = ChatFull;
channelFull#e4e0b29d flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true flags2:# can_delete_channel:flags2.0?true antispam:flags2.1?true participants_hidden:flags2.2?true translations_disabled:flags2.3?true stories_pinned_available:flags2.5?true view_forum_as_messages:flags2.6?true restricted_sponsored:flags2.11?true can_view_revenue:flags2.12?true paid_media_allowed:flags2.14?true can_view_stars_revenue:flags2.15?true paid_reactions_available:flags2.16?true stargifts_available:flags2.19?true paid_messages_available:flags2.20?true id:long about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?long migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?long location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector<string> groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string requests_pending:flags.28?int recent_requesters:flags.28?Vector<long> default_send_as:flags.29?Peer available_reactions:flags.30?ChatReactions reactions_limit:flags2.13?int stories:flags2.4?PeerStories wallpaper:flags2.7?WallPaper boosts_applied:flags2.8?int boosts_unrestrict:flags2.9?int emojiset:flags2.10?StickerSet bot_verification:flags2.17?BotVerification stargifts_count:flags2.18?int send_paid_messages_stars:flags2.21?long main_tab:flags2.22?ProfileTab = ChatFull;
chatParticipant#c02d4007 user_id:long inviter_id:long date:int = ChatParticipant;
@@ -190,9 +192,9 @@ 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#eabcdd4d flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true noforwards:flags.26?true invert_media:flags.27?true flags2:# offline:flags2.1?true video_processing_pending:flags2.4?true id:int from_id:flags.8?Peer from_boosts_applied:flags.29?int peer_id:Peer saved_peer_id:flags.28?Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long via_business_bot_id:flags2.0?long reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long reactions:flags.20?MessageReactions restriction_reason:flags.22?Vector<RestrictionReason> ttl_period:flags.25?int quick_reply_shortcut_id:flags.30?int effect:flags2.2?long factcheck:flags2.3?FactCheck report_delivery_until_date:flags2.5?int paid_message_stars:flags2.6?long = Message;
message#b92f76cf flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true noforwards:flags.26?true invert_media:flags.27?true flags2:# offline:flags2.1?true video_processing_pending:flags2.4?true paid_suggested_post_stars:flags2.8?true paid_suggested_post_ton:flags2.9?true id:int from_id:flags.8?Peer from_boosts_applied:flags.29?int peer_id:Peer saved_peer_id:flags.28?Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long via_business_bot_id:flags2.0?long reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long reactions:flags.20?MessageReactions restriction_reason:flags.22?Vector<RestrictionReason> ttl_period:flags.25?int quick_reply_shortcut_id:flags.30?int effect:flags2.2?long factcheck:flags2.3?FactCheck report_delivery_until_date:flags2.5?int paid_message_stars:flags2.6?long suggested_post:flags2.7?SuggestedPost schedule_repeat_period:flags2.10?int = Message;
messageService#d3d28540 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true reactions_are_possible:flags.9?true silent:flags.13?true post:flags.14?true legacy:flags.19?true id:int from_id:flags.8?Peer peer_id:Peer reply_to:flags.3?MessageReplyHeader date:int action:MessageAction reactions:flags.20?MessageReactions ttl_period:flags.25?int = Message;
messageService#7a800e0a flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true reactions_are_possible:flags.9?true silent:flags.13?true post:flags.14?true legacy:flags.19?true id:int from_id:flags.8?Peer peer_id:Peer saved_peer_id:flags.28?Peer reply_to:flags.3?MessageReplyHeader date:int action:MessageAction reactions:flags.20?MessageReactions ttl_period:flags.25?int = Message;
messageMediaEmpty#3ded6320 = MessageMedia;
@@ -228,6 +230,10 @@ messageMediaGiveawayResults#ceaa3ea1 flags:# only_new_subscribers:flags.0?true r
messageMediaPaidMedia#a8852491 stars_amount:long extended_media:Vector<MessageExtendedMedia> = MessageMedia;
messageMediaToDo#8a53b014 flags:# todo:TodoList completions:flags.0?Vector<TodoCompletion> = MessageMedia;
messageMediaVideoStream#ca5cab89 flags:# rtmp_stream:flags.0?true call:InputGroupCall = MessageMedia;
messageActionEmpty#b6aef7b0 = MessageAction;
messageActionChatCreate#bd47cbad title:string users:Vector<long> = MessageAction;
@@ -284,7 +290,7 @@ messageActionSetMessagesTTL#3c134d7b flags:# period:int auto_setting_from:flags.
messageActionGroupCallScheduled#b3a07661 call:InputGroupCall schedule_date:int = MessageAction;
messageActionSetChatTheme#aa786345 emoticon:string = MessageAction;
messageActionSetChatTheme#b91bbd3a theme:ChatTheme = MessageAction;
messageActionChatJoinedByRequest#ebbca3cb = MessageAction;
@@ -292,9 +298,9 @@ messageActionWebViewDataSentMe#47dd8079 text:string data:string = MessageAction;
messageActionWebViewDataSent#b4c38cb5 text:string = MessageAction;
messageActionGiftPremium#6c6274fa flags:# currency:string amount:long months:int crypto_currency:flags.0?string crypto_amount:flags.0?long message:flags.1?TextWithEntities = MessageAction;
messageActionGiftPremium#48e91302 flags:# currency:string amount:long days:int crypto_currency:flags.0?string crypto_amount:flags.0?long message:flags.1?TextWithEntities = MessageAction;
messageActionTopicCreate#d999256 flags:# title:string icon_color:int icon_emoji_id:flags.0?long = MessageAction;
messageActionTopicCreate#d999256 flags:# title_missing:flags.1?true title:string icon_color:int icon_emoji_id:flags.0?long = MessageAction;
messageActionTopicEdit#c0944820 flags:# title:flags.0?string icon_emoji_id:flags.1?long closed:flags.2?Bool hidden:flags.3?Bool = MessageAction;
@@ -304,7 +310,7 @@ messageActionRequestedPeer#31518e9b button_id:int peers:Vector<Peer> = MessageAc
messageActionSetChatWallPaper#5060a3f4 flags:# same:flags.0?true for_both:flags.1?true wallpaper:WallPaper = MessageAction;
messageActionGiftCode#56d03994 flags:# via_giveaway:flags.0?true unclaimed:flags.5?true boost_peer:flags.1?Peer months:int slug:string currency:flags.2?string amount:flags.2?long crypto_currency:flags.3?string crypto_amount:flags.3?long message:flags.4?TextWithEntities = MessageAction;
messageActionGiftCode#31c48347 flags:# via_giveaway:flags.0?true unclaimed:flags.5?true boost_peer:flags.1?Peer days:int slug:string currency:flags.2?string amount:flags.2?long crypto_currency:flags.3?string crypto_amount:flags.3?long message:flags.4?TextWithEntities = MessageAction;
messageActionGiveawayLaunch#a80f51e4 flags:# stars:flags.0?long = MessageAction;
@@ -320,9 +326,9 @@ messageActionGiftStars#45d5b021 flags:# currency:string amount:long stars:long c
messageActionPrizeStars#b00c47a2 flags:# unclaimed:flags.0?true stars:long transaction_id:string boost_peer:Peer giveaway_msg_id:int = MessageAction;
messageActionStarGift#4717e8a4 flags:# name_hidden:flags.0?true saved:flags.2?true converted:flags.3?true upgraded:flags.5?true refunded:flags.9?true can_upgrade:flags.10?true gift:StarGift message:flags.1?TextWithEntities convert_stars:flags.4?long upgrade_msg_id:flags.5?int upgrade_stars:flags.8?long from_id:flags.11?Peer peer:flags.12?Peer saved_id:flags.12?long = MessageAction;
messageActionStarGift#db596550 flags:# name_hidden:flags.0?true saved:flags.2?true converted:flags.3?true upgraded:flags.5?true refunded:flags.9?true can_upgrade:flags.10?true prepaid_upgrade:flags.13?true upgrade_separate:flags.16?true auction_acquired:flags.17?true gift:StarGift message:flags.1?TextWithEntities convert_stars:flags.4?long upgrade_msg_id:flags.5?int upgrade_stars:flags.8?long from_id:flags.11?Peer peer:flags.12?Peer saved_id:flags.12?long prepaid_upgrade_hash:flags.14?string gift_msg_id:flags.15?int to_id:flags.18?Peer = MessageAction;
messageActionStarGiftUnique#2e3ae60e flags:# upgrade:flags.0?true transferred:flags.1?true saved:flags.2?true refunded:flags.5?true gift:StarGift can_export_at:flags.3?int transfer_stars:flags.4?long from_id:flags.6?Peer peer:flags.7?Peer saved_id:flags.7?long resale_stars:flags.8?long can_transfer_at:flags.9?int can_resell_at:flags.10?int = MessageAction;
messageActionStarGiftUnique#95728543 flags:# upgrade:flags.0?true transferred:flags.1?true saved:flags.2?true refunded:flags.5?true prepaid_upgrade:flags.11?true assigned:flags.13?true gift:StarGift can_export_at:flags.3?int transfer_stars:flags.4?long from_id:flags.6?Peer peer:flags.7?Peer saved_id:flags.7?long resale_amount:flags.8?StarsAmount can_transfer_at:flags.9?int can_resell_at:flags.10?int drop_original_details_stars:flags.12?long = MessageAction;
messageActionPaidMessagesRefunded#ac1f1fcd count:int stars:long = MessageAction;
@@ -330,6 +336,20 @@ messageActionPaidMessagesPrice#84b88578 flags:# broadcast_messages_allowed:flags
messageActionConferenceCall#2ffe2f7a flags:# missed:flags.0?true active:flags.1?true video:flags.4?true call_id:long duration:flags.2?int other_participants:flags.3?Vector<Peer> = MessageAction;
messageActionTodoCompletions#cc7c5c89 completed:Vector<int> incompleted:Vector<int> = MessageAction;
messageActionTodoAppendTasks#c7edbc83 list:Vector<TodoItem> = MessageAction;
messageActionSuggestedPostApproval#ee7a1596 flags:# rejected:flags.0?true balance_too_low:flags.1?true reject_comment:flags.2?string schedule_date:flags.3?int price:flags.4?StarsAmount = MessageAction;
messageActionSuggestedPostSuccess#95ddcf69 price:StarsAmount = MessageAction;
messageActionSuggestedPostRefund#69f916f8 flags:# payer_initiated:flags.0?true = MessageAction;
messageActionGiftTon#a8a3c699 flags:# currency:string amount:long crypto_currency:string crypto_amount:long transaction_id:flags.0?string = MessageAction;
messageActionSuggestBirthday#2c8f2a25 birthday:Birthday = MessageAction;
dialog#d58a08c6 flags:# pinned:flags.2?true unread_mark:flags.3?true view_forum_as_messages:flags.6?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?int ttl_period:flags.5?int = Dialog;
dialogFolder#71bd134c flags:# pinned:flags.2?true folder:Folder peer:Peer top_message:int unread_muted_peers_count:int unread_unmuted_peers_count:int unread_muted_messages_count:int unread_unmuted_messages_count:int = Dialog;
@@ -358,7 +378,7 @@ auth.sentCode#5e002502 flags:# type:auth.SentCodeType phone_code_hash:string nex
auth.sentCodeSuccess#2390fe44 authorization:auth.Authorization = auth.SentCode;
auth.sentCodePaymentRequired#d7cef980 store_product:string phone_code_hash:string = auth.SentCode;
auth.sentCodePaymentRequired#e0955a3c store_product:string phone_code_hash:string support_email_address:string support_email_subject:string currency:string amount:long = auth.SentCode;
auth.authorization#2ea2c0d4 flags:# setup_password_required:flags.1?true otherwise_relogin_days:flags.1?int tmp_sessions:flags.0?int future_auth_token:flags.2?bytes user:User = auth.Authorization;
@@ -406,7 +426,7 @@ inputReportReasonIllegalDrugs#a8eb2be = ReportReason;
inputReportReasonPersonalDetails#9ec7863d = ReportReason;
userFull#99e78045 flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true voice_messages_forbidden:flags.20?true translations_disabled:flags.23?true stories_pinned_available:flags.26?true blocked_my_stories_from:flags.27?true wallpaper_overridden:flags.28?true contact_require_premium:flags.29?true read_dates_private:flags.30?true flags2:# sponsored_enabled:flags2.7?true can_view_revenue:flags2.9?true bot_can_manage_emoji_status:flags2.10?true display_gifts_button:flags2.16?true id:long about:flags.1?string settings:PeerSettings personal_photo:flags.21?Photo profile_photo:flags.2?Photo fallback_photo:flags.22?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int theme_emoticon:flags.15?string private_forward_name:flags.16?string bot_group_admin_rights:flags.17?ChatAdminRights bot_broadcast_admin_rights:flags.18?ChatAdminRights wallpaper:flags.24?WallPaper stories:flags.25?PeerStories business_work_hours:flags2.0?BusinessWorkHours business_location:flags2.1?BusinessLocation business_greeting_message:flags2.2?BusinessGreetingMessage business_away_message:flags2.3?BusinessAwayMessage business_intro:flags2.4?BusinessIntro birthday:flags2.5?Birthday personal_channel_id:flags2.6?long personal_channel_message:flags2.6?int stargifts_count:flags2.8?int starref_program:flags2.11?StarRefProgram bot_verification:flags2.12?BotVerification send_paid_messages_stars:flags2.14?long disallowed_gifts:flags2.15?DisallowedGiftsSettings = UserFull;
userFull#a02bc13e flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true voice_messages_forbidden:flags.20?true translations_disabled:flags.23?true stories_pinned_available:flags.26?true blocked_my_stories_from:flags.27?true wallpaper_overridden:flags.28?true contact_require_premium:flags.29?true read_dates_private:flags.30?true flags2:# sponsored_enabled:flags2.7?true can_view_revenue:flags2.9?true bot_can_manage_emoji_status:flags2.10?true display_gifts_button:flags2.16?true id:long about:flags.1?string settings:PeerSettings personal_photo:flags.21?Photo profile_photo:flags.2?Photo fallback_photo:flags.22?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int theme:flags.15?ChatTheme private_forward_name:flags.16?string bot_group_admin_rights:flags.17?ChatAdminRights bot_broadcast_admin_rights:flags.18?ChatAdminRights wallpaper:flags.24?WallPaper stories:flags.25?PeerStories business_work_hours:flags2.0?BusinessWorkHours business_location:flags2.1?BusinessLocation business_greeting_message:flags2.2?BusinessGreetingMessage business_away_message:flags2.3?BusinessAwayMessage business_intro:flags2.4?BusinessIntro birthday:flags2.5?Birthday personal_channel_id:flags2.6?long personal_channel_message:flags2.6?int stargifts_count:flags2.8?int starref_program:flags2.11?StarRefProgram bot_verification:flags2.12?BotVerification send_paid_messages_stars:flags2.14?long disallowed_gifts:flags2.15?DisallowedGiftsSettings stars_rating:flags2.17?StarsRating stars_my_pending_rating:flags2.18?StarsRating stars_my_pending_rating_date:flags2.18?int main_tab:flags2.20?ProfileTab saved_music:flags2.21?Document note:flags2.22?TextWithEntities = UserFull;
contact#145ade0b user_id:long mutual:Bool = Contact;
@@ -430,9 +450,9 @@ messages.dialogsSlice#71e094f3 count:int dialogs:Vector<Dialog> messages:Vector<
messages.dialogsNotModified#f0e3e596 count:int = messages.Dialogs;
messages.messages#8c718e87 messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
messages.messages#1d73e7ea messages:Vector<Message> topics:Vector<ForumTopic> chats:Vector<Chat> users:Vector<User> = messages.Messages;
messages.messagesSlice#3a54685e flags:# inexact:flags.1?true count:int next_rate:flags.0?int offset_id_offset:flags.2?int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
messages.messagesSlice#5f206716 flags:# inexact:flags.1?true count:int next_rate:flags.0?int offset_id_offset:flags.2?int search_flood:flags.3?SearchPostsFlood messages:Vector<Message> topics:Vector<ForumTopic> chats:Vector<Chat> users:Vector<User> = messages.Messages;
messages.channelMessages#c776ba4e flags:# inexact:flags.1?true pts:int count:int offset_id_offset:flags.2?int messages:Vector<Message> topics:Vector<ForumTopic> chats:Vector<Chat> users:Vector<User> = messages.Messages;
@@ -486,7 +506,7 @@ updateMessageID#4e90bfd6 id:int random_id:long = Update;
updateDeleteMessages#a20db0e5 messages:Vector<int> pts:int pts_count:int = Update;
updateUserTyping#c01e857f user_id:long action:SendMessageAction = Update;
updateUserTyping#2a17bf5c flags:# user_id:long top_msg_id:flags.0?int action:SendMessageAction = Update;
updateChatUserTyping#83487af0 chat_id:long from_id:Peer action:SendMessageAction = Update;
@@ -520,7 +540,7 @@ updatePrivacy#ee3b272a key:PrivacyKey rules:Vector<PrivacyRule> = 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;
updateReadHistoryInbox#9e84bc99 flags:# folder_id:flags.0?int peer:Peer top_msg_id:flags.1?int max_id:int still_unread_count:int pts:int pts_count:int = Update;
updateReadHistoryOutbox#2f2f21bf peer:Peer max_id:int pts:int pts_count:int = Update;
@@ -652,7 +672,7 @@ updateChat#f89a6a4e chat_id:long = Update;
updateGroupCallParticipants#f2ebdb4e call:InputGroupCall participants:Vector<GroupCallParticipant> version:int = Update;
updateGroupCall#97d64341 flags:# chat_id:flags.0?long call:GroupCall = Update;
updateGroupCall#9d2216e0 flags:# live_story:flags.2?true peer:flags.1?Peer call:GroupCall = Update;
updatePeerHistoryTTL#bb9bb9a5 flags:# peer:Peer ttl_period:flags.0?int = Update;
@@ -694,10 +714,6 @@ updateMoveStickerSetToTop#86fccf85 flags:# masks:flags.0?true emojis:flags.1?tru
updateMessageExtendedMedia#d5a41724 peer:Peer msg_id:int extended_media:Vector<MessageExtendedMedia> = Update;
updateChannelPinnedTopic#192efbe3 flags:# pinned:flags.0?true channel_id:long topic_id:int = Update;
updateChannelPinnedTopics#fe198602 flags:# channel_id:long order:flags.0?Vector<int> = Update;
updateUser#20529438 user_id:long = Update;
updateAutoSaveSettings#ec05b097 = Update;
@@ -750,8 +766,6 @@ updateBotDeleteBusinessMessage#a02a982e connection_id:string peer:Peer messages:
updateNewStoryReaction#1824e40b story_id:int peer:Peer reaction:Reaction = Update;
updateBroadcastRevenueTransactions#dfd961f5 peer:Peer balances:BroadcastRevenueBalances = Update;
updateStarsBalance#4e80a379 balance:StarsAmount = Update;
updateBusinessBotCallbackQuery#1ea2fda7 flags:# query_id:long user_id:long connection_id:string message:Message reply_to_message:flags.2?Message chat_instance:long data:flags.0?bytes = Update;
@@ -770,6 +784,22 @@ updateReadMonoForumInbox#77b0e372 channel_id:long saved_peer_id:Peer read_max_id
updateReadMonoForumOutbox#a4a79376 channel_id:long saved_peer_id:Peer read_max_id:int = Update;
updateMonoForumNoPaidException#9f812b08 flags:# exception:flags.0?true channel_id:long saved_peer_id:Peer = Update;
updateGroupCallMessage#d8326f0d call:InputGroupCall message:GroupCallMessage = Update;
updateGroupCallEncryptedMessage#c957a766 call:InputGroupCall from_id:Peer encrypted_message:bytes = Update;
updatePinnedForumTopic#683b2c52 flags:# pinned:flags.0?true peer:Peer topic_id:int = Update;
updatePinnedForumTopics#def143d0 flags:# peer:Peer order:flags.0?Vector<int> = Update;
updateDeleteGroupCallMessages#3e85e92c call:InputGroupCall messages:Vector<int> = Update;
updateStarGiftAuctionState#48e246c2 gift_id:long state:StarGiftAuctionState = Update;
updateStarGiftAuctionUserState#dc58f31e gift_id:long user_state:StarGiftAuctionUserState = Update;
updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;
updates.differenceEmpty#5d75a138 date:int seq:int = updates.Difference;
@@ -908,6 +938,8 @@ sendMessageEmojiInteraction#25972bcb emoticon:string msg_id:int interaction:Data
sendMessageEmojiInteractionSeen#b665902e emoticon:string = SendMessageAction;
sendMessageTextDraftAction#376d975c random_id:long text:TextWithEntities = SendMessageAction;
contacts.found#b3134d9d my_results:Vector<Peer> results:Vector<Peer> chats:Vector<Chat> users:Vector<User> = contacts.Found;
inputPrivacyKeyStatusTimestamp#4f96cb18 = InputPrivacyKey;
@@ -936,6 +968,8 @@ inputPrivacyKeyStarGiftsAutoSave#e1732341 = InputPrivacyKey;
inputPrivacyKeyNoPaidMessages#bdc597b4 = InputPrivacyKey;
inputPrivacyKeySavedMusic#4dbe9226 = InputPrivacyKey;
privacyKeyStatusTimestamp#bc2eab30 = PrivacyKey;
privacyKeyChatInvite#500e6dfa = PrivacyKey;
@@ -962,6 +996,8 @@ privacyKeyStarGiftsAutoSave#2ca4fdf8 = PrivacyKey;
privacyKeyNoPaidMessages#17d348d2 = PrivacyKey;
privacyKeySavedMusic#ff7a571b = PrivacyKey;
inputPrivacyValueAllowContacts#d09e07b = InputPrivacyRule;
inputPrivacyValueAllowAll#184b35ce = InputPrivacyRule;
@@ -1096,6 +1132,8 @@ inputStickerSetEmojiDefaultTopicIcons#44c1f8e9 = InputStickerSet;
inputStickerSetEmojiChannelDefaultStatuses#49748553 = InputStickerSet;
inputStickerSetTonGifts#1cf671a0 = InputStickerSet;
stickerSet#2dd14edc flags:# archived:flags.1?true official:flags.2?true masks:flags.3?true emojis:flags.7?true text_color:flags.9?true channel_emoji_status:flags.10?true creator:flags.11?true installed_date:flags.0?int id:long access_hash:long title:string short_name:string thumbs:flags.4?Vector<PhotoSize> thumb_dc_id:flags.4?int thumb_version:flags.4?int thumb_document_id:flags.8?long count:int hash:int = StickerSet;
messages.stickerSet#6e153f16 set:StickerSet packs:Vector<StickerPack> keywords:Vector<StickerKeyword> documents:Vector<Document> = messages.StickerSet;
@@ -1376,7 +1414,7 @@ contacts.topPeersDisabled#b52c939d = contacts.TopPeers;
draftMessageEmpty#1b0c841a flags:# date:flags.0?int = DraftMessage;
draftMessage#2d65321f flags:# no_webpage:flags.1?true invert_media:flags.6?true reply_to:flags.4?InputReplyTo message:string entities:flags.3?Vector<MessageEntity> media:flags.5?InputMedia date:int effect:flags.7?long = DraftMessage;
draftMessage#96eaa5eb flags:# no_webpage:flags.1?true invert_media:flags.6?true reply_to:flags.4?InputReplyTo message:string entities:flags.3?Vector<MessageEntity> media:flags.5?InputMedia date:int effect:flags.7?long suggested_post:flags.8?SuggestedPost = DraftMessage;
messages.featuredStickersNotModified#c6dc0c66 count:int = messages.FeaturedStickers;
@@ -1930,7 +1968,7 @@ chatOnlines#f041e250 onlines:int = ChatOnlines;
statsURL#47a971e0 url:string = StatsURL;
chatAdminRights#5fb224d5 flags:# change_info:flags.0?true post_messages:flags.1?true edit_messages:flags.2?true delete_messages:flags.3?true ban_users:flags.4?true invite_users:flags.5?true pin_messages:flags.7?true add_admins:flags.9?true anonymous:flags.10?true manage_call:flags.11?true other:flags.12?true manage_topics:flags.13?true post_stories:flags.14?true edit_stories:flags.15?true delete_stories:flags.16?true = ChatAdminRights;
chatAdminRights#5fb224d5 flags:# change_info:flags.0?true post_messages:flags.1?true edit_messages:flags.2?true delete_messages:flags.3?true ban_users:flags.4?true invite_users:flags.5?true pin_messages:flags.7?true add_admins:flags.9?true anonymous:flags.10?true manage_call:flags.11?true other:flags.12?true manage_topics:flags.13?true post_stories:flags.14?true edit_stories:flags.15?true delete_stories:flags.16?true manage_direct_messages:flags.17?true = ChatAdminRights;
chatBannedRights#9f120418 flags:# view_messages:flags.0?true send_messages:flags.1?true send_media:flags.2?true send_stickers:flags.3?true send_gifs:flags.4?true send_games:flags.5?true send_inline:flags.6?true embed_links:flags.7?true send_polls:flags.8?true change_info:flags.10?true invite_users:flags.15?true pin_messages:flags.17?true manage_topics:flags.18?true send_photos:flags.19?true send_videos:flags.20?true send_roundvideos:flags.21?true send_audios:flags.22?true send_voices:flags.23?true send_docs:flags.24?true send_plain:flags.25?true until_date:int = ChatBannedRights;
@@ -2028,6 +2066,10 @@ webPageAttributeStickerSet#50cc03d3 flags:# emojis:flags.0?true text_color:flags
webPageAttributeUniqueStarGift#cf6f6db8 gift:StarGift = WebPageAttribute;
webPageAttributeStarGiftCollection#31cad303 icons:Vector<Document> = WebPageAttribute;
webPageAttributeStarGiftAuction#34986ab gift:StarGift end_date:int center_color:int edge_color:int text_color:int = WebPageAttribute;
messages.votesList#4899484e flags:# count:int votes:Vector<MessagePeerVote> chats:Vector<Chat> users:Vector<User> next_offset:flags.0?string = messages.VotesList;
bankCardOpenUrl#f568028a url:string name:string = BankCardOpenUrl;
@@ -2090,7 +2132,7 @@ messages.messageViews#b6c4f543 views:Vector<MessageViews> chats:Vector<Chat> use
messages.discussionMessage#a6341782 flags:# messages:Vector<Message> max_id:flags.0?int read_inbox_max_id:flags.1?int read_outbox_max_id:flags.2?int unread_count:int chats:Vector<Chat> users:Vector<User> = messages.DiscussionMessage;
messageReplyHeader#afbc09db flags:# reply_to_scheduled:flags.2?true forum_topic:flags.3?true quote:flags.9?true reply_to_msg_id:flags.4?int reply_to_peer_id:flags.0?Peer reply_from:flags.5?MessageFwdHeader reply_media:flags.8?MessageMedia reply_to_top_id:flags.1?int quote_text:flags.6?string quote_entities:flags.7?Vector<MessageEntity> quote_offset:flags.10?int = MessageReplyHeader;
messageReplyHeader#6917560b flags:# reply_to_scheduled:flags.2?true forum_topic:flags.3?true quote:flags.9?true reply_to_msg_id:flags.4?int reply_to_peer_id:flags.0?Peer reply_from:flags.5?MessageFwdHeader reply_media:flags.8?MessageMedia reply_to_top_id:flags.1?int quote_text:flags.6?string quote_entities:flags.7?Vector<MessageEntity> quote_offset:flags.10?int todo_item_id:flags.11?int = MessageReplyHeader;
messageReplyStoryHeader#e5af939 peer:Peer story_id:int = MessageReplyHeader;
@@ -2102,7 +2144,7 @@ stats.messageStats#7fe91c14 views_graph:StatsGraph reactions_by_emotion_graph:St
groupCallDiscarded#7780bcb4 id:long access_hash:long duration:int = GroupCall;
groupCall#553b0ba1 flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true join_date_asc:flags.6?true schedule_start_subscribed:flags.8?true can_start_video:flags.9?true record_video_active:flags.11?true rtmp_stream:flags.12?true listeners_hidden:flags.13?true conference:flags.14?true creator:flags.15?true id:long access_hash:long participants_count:int title:flags.3?string stream_dc_id:flags.4?int record_start_date:flags.5?int schedule_date:flags.7?int unmuted_video_count:flags.10?int unmuted_video_limit:int version:int invite_link:flags.16?string = GroupCall;
groupCall#efb2b617 flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true join_date_asc:flags.6?true schedule_start_subscribed:flags.8?true can_start_video:flags.9?true record_video_active:flags.11?true rtmp_stream:flags.12?true listeners_hidden:flags.13?true conference:flags.14?true creator:flags.15?true messages_enabled:flags.17?true can_change_messages_enabled:flags.18?true min:flags.19?true id:long access_hash:long participants_count:int title:flags.3?string stream_dc_id:flags.4?int record_start_date:flags.5?int schedule_date:flags.7?int unmuted_video_count:flags.10?int unmuted_video_limit:int version:int invite_link:flags.16?string send_paid_messages_stars:flags.20?long default_send_as:flags.21?Peer = GroupCall;
inputGroupCall#d8aa840f id:long access_hash:long = InputGroupCall;
@@ -2110,7 +2152,7 @@ inputGroupCallSlug#fe06823f slug:string = InputGroupCall;
inputGroupCallInviteMessage#8c10603f msg_id:int = InputGroupCall;
groupCallParticipant#eba636fe flags:# muted:flags.0?true left:flags.1?true can_self_unmute:flags.2?true just_joined:flags.4?true versioned:flags.5?true min:flags.8?true muted_by_you:flags.9?true volume_by_admin:flags.10?true self:flags.12?true video_joined:flags.15?true peer:Peer date:int active_date:flags.3?int source:int volume:flags.7?int about:flags.11?string raise_hand_rating:flags.13?long video:flags.6?GroupCallParticipantVideo presentation:flags.14?GroupCallParticipantVideo = GroupCallParticipant;
groupCallParticipant#2a3dc7ac flags:# muted:flags.0?true left:flags.1?true can_self_unmute:flags.2?true just_joined:flags.4?true versioned:flags.5?true min:flags.8?true muted_by_you:flags.9?true volume_by_admin:flags.10?true self:flags.12?true video_joined:flags.15?true peer:Peer date:int active_date:flags.3?int source:int volume:flags.7?int about:flags.11?string raise_hand_rating:flags.13?long video:flags.6?GroupCallParticipantVideo presentation:flags.14?GroupCallParticipantVideo paid_stars_total:flags.16?long = GroupCallParticipant;
phone.groupCall#9e727aad call:GroupCall participants:Vector<GroupCallParticipant> participants_next_offset:string chats:Vector<Chat> users:Vector<User> = phone.GroupCall;
@@ -2180,9 +2222,17 @@ account.resetPasswordRequestedWait#e9effc7d until_date:int = account.ResetPasswo
account.resetPasswordOk#e926d63e = account.ResetPasswordResult;
sponsoredMessage#4d93a990 flags:# recommended:flags.5?true can_report:flags.12?true random_id:bytes url:string title:string message:string entities:flags.1?Vector<MessageEntity> photo:flags.6?Photo media:flags.14?MessageMedia color:flags.13?PeerColor button_text:string sponsor_info:flags.7?string additional_info:flags.8?string = SponsoredMessage;
chatTheme#c3dffc04 emoticon:string = ChatTheme;
messages.sponsoredMessages#c9ee1d87 flags:# posts_between:flags.0?int messages:Vector<SponsoredMessage> chats:Vector<Chat> users:Vector<User> = messages.SponsoredMessages;
chatThemeUniqueGift#3458f9c8 gift:StarGift theme_settings:Vector<ThemeSettings> = ChatTheme;
account.chatThemesNotModified#e011e1c4 = account.ChatThemes;
account.chatThemes#be098173 flags:# hash:long themes:Vector<ChatTheme> chats:Vector<Chat> users:Vector<User> next_offset:flags.0?string = account.ChatThemes;
sponsoredMessage#7dbf8673 flags:# recommended:flags.5?true can_report:flags.12?true random_id:bytes url:string title:string message:string entities:flags.1?Vector<MessageEntity> photo:flags.6?Photo media:flags.14?MessageMedia color:flags.13?PeerColor button_text:string sponsor_info:flags.7?string additional_info:flags.8?string min_display_duration:flags.15?int max_display_duration:flags.15?int = SponsoredMessage;
messages.sponsoredMessages#ffda656d flags:# posts_between:flags.0?int start_delay:flags.1?int between_delay:flags.2?int messages:Vector<SponsoredMessage> chats:Vector<Chat> users:Vector<User> = messages.SponsoredMessages;
messages.sponsoredMessagesEmpty#1839490f = messages.SponsoredMessages;
@@ -2290,7 +2340,15 @@ inputInvoicePremiumGiftStars#dabab2ef flags:# user_id:InputUser months:int messa
inputInvoiceBusinessBotTransferStars#f4997e42 bot:InputUser stars:long = InputInvoice;
inputInvoiceStarGiftResale#63cbc38c slug:string to_id:InputPeer = InputInvoice;
inputInvoiceStarGiftResale#c39f5324 flags:# ton:flags.0?true slug:string to_id:InputPeer = InputInvoice;
inputInvoiceStarGiftPrepaidUpgrade#9a0b48b8 peer:InputPeer hash:string = InputInvoice;
inputInvoicePremiumAuthCode#3e77f614 purpose:InputStorePaymentPurpose = InputInvoice;
inputInvoiceStarGiftDropOriginalDetails#923d8d1 stargift:InputSavedStarGift = InputInvoice;
inputInvoiceStarGiftAuctionBid#1ecafa10 flags:# hide_name:flags.0?true update_bid:flags.2?true peer:flags.3?InputPeer gift_id:long bid_amount:long message:flags.1?TextWithEntities = InputInvoice;
payments.exportedInvoice#aed0cbd9 url:string = payments.ExportedInvoice;
@@ -2306,7 +2364,7 @@ inputStorePaymentPremiumGiftCode#fb790393 flags:# users:Vector<InputUser> boost_
inputStorePaymentPremiumGiveaway#160544ca flags:# only_new_subscribers:flags.0?true winners_are_visible:flags.3?true boost_peer:InputPeer additional_peers:flags.1?Vector<InputPeer> countries_iso2:flags.2?Vector<string> prize_description:flags.4?string random_id:long until_date:int currency:string amount:long = InputStorePaymentPurpose;
inputStorePaymentStarsTopup#dddd0f56 stars:long currency:string amount:long = InputStorePaymentPurpose;
inputStorePaymentStarsTopup#f9a2a6cb flags:# stars:long currency:string amount:long spend_purpose_peer:flags.0?InputPeer = InputStorePaymentPurpose;
inputStorePaymentStarsGift#1d741ef7 user_id:InputUser stars:long currency:string amount:long = InputStorePaymentPurpose;
@@ -2376,7 +2434,7 @@ username#b4073647 flags:# editable:flags.0?true active:flags.1?true username:str
forumTopicDeleted#23f109b id:int = ForumTopic;
forumTopic#71701da9 flags:# my:flags.1?true closed:flags.2?true pinned:flags.3?true short:flags.5?true hidden:flags.6?true id:int date:int title:string icon_color:int icon_emoji_id:flags.0?long top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int from_id:Peer notify_settings:PeerNotifySettings draft:flags.4?DraftMessage = ForumTopic;
forumTopic#cdff0eca flags:# my:flags.1?true closed:flags.2?true pinned:flags.3?true short:flags.5?true hidden:flags.6?true title_missing:flags.7?true id:int date:int peer:Peer title:string icon_color:int icon_emoji_id:flags.0?long top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int from_id:Peer notify_settings:PeerNotifySettings draft:flags.4?DraftMessage = ForumTopic;
messages.forumTopics#367617d3 flags:# order_by_create_date:flags.0?true count:int topics:Vector<ForumTopic> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> pts:int = messages.ForumTopics;
@@ -2458,9 +2516,9 @@ storyViews#8d595cd6 flags:# has_viewers:flags.1?true views_count:int forwards_co
storyItemDeleted#51e6ee4f id:int = StoryItem;
storyItemSkipped#ffadc913 flags:# close_friends:flags.8?true id:int date:int expire_date:int = StoryItem;
storyItemSkipped#ffadc913 flags:# close_friends:flags.8?true live:flags.9?true id:int date:int expire_date:int = StoryItem;
storyItem#79b26a24 flags:# pinned:flags.5?true public:flags.7?true close_friends:flags.8?true min:flags.9?true noforwards:flags.10?true edited:flags.11?true contacts:flags.12?true selected_contacts:flags.13?true out:flags.16?true id:int date:int from_id:flags.18?Peer fwd_from:flags.17?StoryFwdHeader expire_date:int caption:flags.0?string entities:flags.1?Vector<MessageEntity> media:MessageMedia media_areas:flags.14?Vector<MediaArea> privacy:flags.2?Vector<PrivacyRule> views:flags.3?StoryViews sent_reaction:flags.15?Reaction = StoryItem;
storyItem#edf164f1 flags:# pinned:flags.5?true public:flags.7?true close_friends:flags.8?true min:flags.9?true noforwards:flags.10?true edited:flags.11?true contacts:flags.12?true selected_contacts:flags.13?true out:flags.16?true id:int date:int from_id:flags.18?Peer fwd_from:flags.17?StoryFwdHeader expire_date:int caption:flags.0?string entities:flags.1?Vector<MessageEntity> media:MessageMedia media_areas:flags.14?Vector<MediaArea> privacy:flags.2?Vector<PrivacyRule> views:flags.3?StoryViews sent_reaction:flags.15?Reaction albums:flags.19?Vector<int> = StoryItem;
stories.allStoriesNotModified#1158fe3e flags:# state:string stealth_mode:StoriesStealthMode = stories.AllStories;
@@ -2478,7 +2536,7 @@ stories.storyViewsList#59d78fc5 flags:# count:int views_count:int forwards_count
stories.storyViews#de9eed1d views:Vector<StoryViews> users:Vector<User> = stories.StoryViews;
inputReplyToMessage#b07038b0 flags:# reply_to_msg_id:int top_msg_id:flags.0?int reply_to_peer_id:flags.1?InputPeer quote_text:flags.2?string quote_entities:flags.3?Vector<MessageEntity> quote_offset:flags.4?int monoforum_peer_id:flags.5?InputPeer = InputReplyTo;
inputReplyToMessage#869fbe10 flags:# reply_to_msg_id:int top_msg_id:flags.0?int reply_to_peer_id:flags.1?InputPeer quote_text:flags.2?string quote_entities:flags.3?Vector<MessageEntity> quote_offset:flags.4?int monoforum_peer_id:flags.5?InputPeer todo_item_id:flags.6?int = InputReplyTo;
inputReplyToStory#5881323a peer:InputPeer story_id:int = InputReplyTo;
@@ -2516,7 +2574,7 @@ messages.webPage#fd5e12bd webpage:WebPage chats:Vector<Chat> users:Vector<User>
premiumGiftCodeOption#257e962b flags:# users:int months:int store_product:flags.0?string store_quantity:flags.1?int currency:string amount:long = PremiumGiftCodeOption;
payments.checkedGiftCode#284a1096 flags:# via_giveaway:flags.2?true from_id:flags.4?Peer giveaway_msg_id:flags.3?int to_id:flags.0?long date:int months:int used_date:flags.1?int chats:Vector<Chat> users:Vector<User> = payments.CheckedGiftCode;
payments.checkedGiftCode#eb983f8f flags:# via_giveaway:flags.2?true from_id:flags.4?Peer giveaway_msg_id:flags.3?int to_id:flags.0?long date:int days:int used_date:flags.1?int chats:Vector<Chat> users:Vector<User> = payments.CheckedGiftCode;
payments.giveawayInfo#4367daa0 flags:# participating:flags.0?true preparing_results:flags.3?true start_date:int joined_too_early_date:flags.1?int admin_disallowed_chat_id:flags.2?long disallowed_country:flags.4?string = payments.GiveawayInfo;
@@ -2552,6 +2610,10 @@ stats.publicForwards#93037e20 flags:# count:int forwards:Vector<PublicForward> n
peerColor#b54b5acf flags:# color:flags.0?int background_emoji_id:flags.1?long = PeerColor;
peerColorCollectible#b9c0639a flags:# collectible_id:long gift_emoji_id:long background_emoji_id:long accent_color:int colors:Vector<int> dark_accent_color:flags.0?int dark_colors:flags.1?Vector<int> = PeerColor;
inputPeerColorCollectible#b8ea86a9 collectible_id:long = PeerColor;
help.peerColorSet#26219a58 colors:Vector<int> = help.PeerColorSet;
help.peerColorProfileSet#767d61eb palette_colors:Vector<int> bg_colors:Vector<int> story_colors:Vector<int> = help.PeerColorSet;
@@ -2572,7 +2634,7 @@ stories.storyReactionsList#aa5f789c flags:# count:int reactions:Vector<StoryReac
savedDialog#bd87cb6c flags:# pinned:flags.2?true peer:Peer top_message:int = SavedDialog;
monoForumDialog#64407ea7 flags:# unread_mark:flags.3?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_reactions_count:int draft:flags.1?DraftMessage = SavedDialog;
monoForumDialog#64407ea7 flags:# unread_mark:flags.3?true nopaid_messages_exception:flags.4?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_reactions_count:int draft:flags.1?DraftMessage = SavedDialog;
messages.savedDialogs#f83ae221 dialogs:Vector<SavedDialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.SavedDialogs;
@@ -2690,26 +2752,12 @@ channels.sponsoredMessageReportResultAdsHidden#3e3bcf2f = channels.SponsoredMess
channels.sponsoredMessageReportResultReported#ad798849 = channels.SponsoredMessageReportResult;
stats.broadcastRevenueStats#5407e297 top_hours_graph:StatsGraph revenue_graph:StatsGraph balances:BroadcastRevenueBalances usd_rate:double = stats.BroadcastRevenueStats;
stats.broadcastRevenueWithdrawalUrl#ec659737 url:string = stats.BroadcastRevenueWithdrawalUrl;
broadcastRevenueTransactionProceeds#557e2cc4 amount:long from_date:int to_date:int = BroadcastRevenueTransaction;
broadcastRevenueTransactionWithdrawal#5a590978 flags:# pending:flags.0?true failed:flags.2?true amount:long date:int provider:string transaction_date:flags.1?int transaction_url:flags.1?string = BroadcastRevenueTransaction;
broadcastRevenueTransactionRefund#42d30d2e amount:long date:int provider:string = BroadcastRevenueTransaction;
stats.broadcastRevenueTransactions#87158466 count:int transactions:Vector<BroadcastRevenueTransaction> = stats.BroadcastRevenueTransactions;
reactionNotificationsFromContacts#bac3a61a = ReactionNotificationsFrom;
reactionNotificationsFromAll#4b9e22a0 = ReactionNotificationsFrom;
reactionsNotifySettings#56e34970 flags:# messages_notify_from:flags.0?ReactionNotificationsFrom stories_notify_from:flags.1?ReactionNotificationsFrom sound:NotificationSound show_previews:Bool = ReactionsNotifySettings;
broadcastRevenueBalances#c3ff71e7 flags:# withdrawal_enabled:flags.0?true current_balance:long available_balance:long overall_revenue:long = BroadcastRevenueBalances;
availableEffect#93c3e27e flags:# premium_required:flags.2?true id:long emoticon:string static_icon_id:flags.0?long effect_sticker_id:long effect_animation_id:flags.1?long = AvailableEffect;
messages.availableEffectsNotModified#d1ed9a5b = messages.AvailableEffects;
@@ -2736,7 +2784,7 @@ starsTransactionPeerAPI#f9677aad = StarsTransactionPeer;
starsTopupOption#bd915c0 flags:# extended:flags.1?true stars:long store_product:flags.0?string currency:string amount:long = StarsTopupOption;
starsTransaction#a39fd94a flags:# refund:flags.3?true pending:flags.4?true failed:flags.6?true gift:flags.10?true reaction:flags.11?true stargift_upgrade:flags.18?true business_transfer:flags.21?true stargift_resale:flags.22?true id:string stars:StarsAmount date:int peer:StarsTransactionPeer title:flags.0?string description:flags.1?string photo:flags.2?WebDocument transaction_date:flags.5?int transaction_url:flags.5?string bot_payload:flags.7?bytes msg_id:flags.8?int extended_media:flags.9?Vector<MessageMedia> subscription_period:flags.12?int giveaway_post_id:flags.13?int stargift:flags.14?StarGift floodskip_number:flags.15?int starref_commission_permille:flags.16?int starref_peer:flags.17?Peer starref_amount:flags.17?StarsAmount paid_messages:flags.19?int premium_gift_months:flags.20?int = StarsTransaction;
starsTransaction#13659eb0 flags:# refund:flags.3?true pending:flags.4?true failed:flags.6?true gift:flags.10?true reaction:flags.11?true stargift_upgrade:flags.18?true business_transfer:flags.21?true stargift_resale:flags.22?true posts_search:flags.24?true stargift_prepaid_upgrade:flags.25?true stargift_drop_original_details:flags.26?true phonegroup_message:flags.27?true stargift_auction_bid:flags.28?true id:string amount:StarsAmount date:int peer:StarsTransactionPeer title:flags.0?string description:flags.1?string photo:flags.2?WebDocument transaction_date:flags.5?int transaction_url:flags.5?string bot_payload:flags.7?bytes msg_id:flags.8?int extended_media:flags.9?Vector<MessageMedia> subscription_period:flags.12?int giveaway_post_id:flags.13?int stargift:flags.14?StarGift floodskip_number:flags.15?int starref_commission_permille:flags.16?int starref_peer:flags.17?Peer starref_amount:flags.17?StarsAmount paid_messages:flags.19?int premium_gift_months:flags.20?int ads_proceeds_from_date:flags.23?int ads_proceeds_to_date:flags.23?int = StarsTransaction;
payments.starsStatus#6c9ce8ed flags:# balance:StarsAmount subscriptions:flags.1?Vector<StarsSubscription> subscriptions_next_offset:flags.2?string subscriptions_missing_balance:flags.4?long history:flags.3?Vector<StarsTransaction> next_offset:flags.0?string chats:Vector<Chat> users:Vector<User> = payments.StarsStatus;
@@ -2748,7 +2796,7 @@ geoPointAddress#de4c5d93 flags:# country_iso2:string state:flags.0?string city:f
starsRevenueStatus#febe5491 flags:# withdrawal_enabled:flags.0?true current_balance:StarsAmount available_balance:StarsAmount overall_revenue:StarsAmount next_withdrawal_at:flags.1?int = StarsRevenueStatus;
payments.starsRevenueStats#c92bb73b revenue_graph:StatsGraph status:StarsRevenueStatus usd_rate:double = payments.StarsRevenueStats;
payments.starsRevenueStats#6c207376 flags:# top_hours_graph:flags.0?StatsGraph revenue_graph:StatsGraph status:StarsRevenueStatus usd_rate:double = payments.StarsRevenueStats;
payments.starsRevenueWithdrawalUrl#1dab80b7 url:string = payments.StarsRevenueWithdrawalUrl;
@@ -2774,13 +2822,13 @@ starsGiveawayOption#94ce852a flags:# extended:flags.0?true default:flags.1?true
starsGiveawayWinnersOption#54236209 flags:# default:flags.0?true users:int per_user_stars:long = StarsGiveawayWinnersOption;
starGift#c62aca28 flags:# limited:flags.0?true sold_out:flags.1?true birthday:flags.2?true id:long sticker:Document stars:long availability_remains:flags.0?int availability_total:flags.0?int availability_resale:flags.4?long convert_stars:long first_sale_date:flags.1?int last_sale_date:flags.1?int upgrade_stars:flags.3?long resell_min_stars:flags.4?long title:flags.5?string = StarGift;
starGift#1b9a4d7f flags:# limited:flags.0?true sold_out:flags.1?true birthday:flags.2?true require_premium:flags.7?true limited_per_user:flags.8?true peer_color_available:flags.10?true auction:flags.11?true id:long sticker:Document stars:long availability_remains:flags.0?int availability_total:flags.0?int availability_resale:flags.4?long convert_stars:long first_sale_date:flags.1?int last_sale_date:flags.1?int upgrade_stars:flags.3?long resell_min_stars:flags.4?long title:flags.5?string released_by:flags.6?Peer per_user_total:flags.8?int per_user_remains:flags.8?int locked_until_date:flags.9?int auction_slug:flags.11?string gifts_per_round:flags.11?int = StarGift;
starGiftUnique#6411db89 flags:# id:long title:string slug:string num:int owner_id:flags.0?Peer owner_name:flags.1?string owner_address:flags.2?string attributes:Vector<StarGiftAttribute> availability_issued:int availability_total:int gift_address:flags.3?string resell_stars:flags.4?long = StarGift;
starGiftUnique#b0bf741b flags:# require_premium:flags.6?true resale_ton_only:flags.7?true theme_available:flags.9?true id:long gift_id:long title:string slug:string num:int owner_id:flags.0?Peer owner_name:flags.1?string owner_address:flags.2?string attributes:Vector<StarGiftAttribute> availability_issued:int availability_total:int gift_address:flags.3?string resell_amount:flags.4?Vector<StarsAmount> released_by:flags.5?Peer value_amount:flags.8?long value_currency:flags.8?string theme_peer:flags.10?Peer peer_color:flags.11?PeerColor host_id:flags.12?Peer = StarGift;
payments.starGiftsNotModified#a388a368 = payments.StarGifts;
payments.starGifts#901689ea hash:int gifts:Vector<StarGift> = payments.StarGifts;
payments.starGifts#2ed82995 hash:int gifts:Vector<StarGift> chats:Vector<Chat> users:Vector<User> = payments.StarGifts;
messageReportOption#7903e3d9 text:string option:bytes = MessageReportOption;
@@ -2806,6 +2854,8 @@ payments.suggestedStarRefBots#b4d5d859 flags:# count:int suggested_bots:Vector<S
starsAmount#bbb6b4a3 amount:long nanos:int = StarsAmount;
starsTonAmount#74aee3e0 amount:long = StarsAmount;
messages.foundStickersNotModified#6010c534 flags:# next_offset:flags.0?int = messages.FoundStickers;
messages.foundStickers#82c9e290 flags:# next_offset:flags.0?int hash:long stickers:Vector<Document> = messages.FoundStickers;
@@ -2822,17 +2872,17 @@ starGiftAttributeBackdrop#d93d859c name:string backdrop_id:int center_color:int
starGiftAttributeOriginalDetails#e0bff26c flags:# sender_id:flags.0?Peer recipient_id:Peer date:int message:flags.1?TextWithEntities = StarGiftAttribute;
payments.starGiftUpgradePreview#167bd90b sample_attributes:Vector<StarGiftAttribute> = payments.StarGiftUpgradePreview;
payments.starGiftUpgradePreview#3de1dfed sample_attributes:Vector<StarGiftAttribute> prices:Vector<StarGiftUpgradePrice> next_prices:Vector<StarGiftUpgradePrice> = payments.StarGiftUpgradePreview;
users.users#62d706b8 users:Vector<User> = users.Users;
users.usersSlice#315a4974 count:int users:Vector<User> = users.Users;
payments.uniqueStarGift#caa2f60b gift:StarGift users:Vector<User> = payments.UniqueStarGift;
payments.uniqueStarGift#416c56e8 gift:StarGift chats:Vector<Chat> users:Vector<User> = payments.UniqueStarGift;
messages.webPagePreview#b53e8b21 media:MessageMedia users:Vector<User> = messages.WebPagePreview;
messages.webPagePreview#8c9a88ac media:MessageMedia chats:Vector<Chat> users:Vector<User> = messages.WebPagePreview;
savedStarGift#dfda0499 flags:# name_hidden:flags.0?true unsaved:flags.5?true refunded:flags.9?true can_upgrade:flags.10?true pinned_to_top:flags.12?true from_id:flags.1?Peer date:int gift:StarGift message:flags.2?TextWithEntities msg_id:flags.3?int saved_id:flags.11?long convert_stars:flags.4?long upgrade_stars:flags.6?long can_export_at:flags.7?int transfer_stars:flags.8?long can_transfer_at:flags.13?int can_resell_at:flags.14?int = SavedStarGift;
savedStarGift#8983a452 flags:# name_hidden:flags.0?true unsaved:flags.5?true refunded:flags.9?true can_upgrade:flags.10?true pinned_to_top:flags.12?true upgrade_separate:flags.17?true from_id:flags.1?Peer date:int gift:StarGift message:flags.2?TextWithEntities msg_id:flags.3?int saved_id:flags.11?long convert_stars:flags.4?long upgrade_stars:flags.6?long can_export_at:flags.7?int transfer_stars:flags.8?long can_transfer_at:flags.13?int can_resell_at:flags.14?int collection_id:flags.15?Vector<int> prepaid_upgrade_hash:flags.16?string drop_original_details_stars:flags.18?long = SavedStarGift;
payments.savedStarGifts#95f389b1 flags:# count:int chat_notifications_enabled:flags.1?Bool gifts:Vector<SavedStarGift> next_offset:flags.0?string chats:Vector<Chat> users:Vector<User> = payments.SavedStarGifts;
@@ -2860,7 +2910,7 @@ requirementToContactPaidMessages#b4f67e93 stars_amount:long = RequirementToConta
businessBotRights#a0624cf7 flags:# reply:flags.0?true read_messages:flags.1?true delete_sent_messages:flags.2?true delete_received_messages:flags.3?true edit_name:flags.4?true edit_bio:flags.5?true edit_profile_photo:flags.6?true edit_username:flags.7?true view_gifts:flags.8?true sell_gifts:flags.9?true change_gift_settings:flags.10?true transfer_and_upgrade_gifts:flags.11?true transfer_stars:flags.12?true manage_stories:flags.13?true = BusinessBotRights;
disallowedGiftsSettings#71f276c4 flags:# disallow_unlimited_stargifts:flags.0?true disallow_limited_stargifts:flags.1?true disallow_unique_stargifts:flags.2?true disallow_premium_gifts:flags.3?true = DisallowedGiftsSettings;
disallowedGiftsSettings#71f276c4 flags:# disallow_unlimited_stargifts:flags.0?true disallow_limited_stargifts:flags.1?true disallow_unique_stargifts:flags.2?true disallow_premium_gifts:flags.3?true disallow_stargifts_from_channels:flags.4?true = DisallowedGiftsSettings;
sponsoredPeer#c69708d3 flags:# random_id:bytes peer:Peer sponsor_info:flags.0?string additional_info:flags.1?string = SponsoredPeer;
@@ -2882,6 +2932,102 @@ stories.canSendStoryCount#c387c04e count_remains:int = stories.CanSendStoryCount
pendingSuggestion#e7e82e12 suggestion:string title:TextWithEntities description:TextWithEntities url:string = PendingSuggestion;
todoItem#cba9a52f id:int title:TextWithEntities = TodoItem;
todoList#49b92a26 flags:# others_can_append:flags.0?true others_can_complete:flags.1?true title:TextWithEntities list:Vector<TodoItem> = TodoList;
todoCompletion#221bb5e4 id:int completed_by:Peer date:int = TodoCompletion;
suggestedPost#e8e37e5 flags:# accepted:flags.1?true rejected:flags.2?true price:flags.3?StarsAmount schedule_date:flags.0?int = SuggestedPost;
starsRating#1b0e4f07 flags:# level:int current_level_stars:long stars:long next_level_stars:flags.0?long = StarsRating;
starGiftCollection#9d6b13b0 flags:# collection_id:int title:string icon:flags.0?Document gifts_count:int hash:long = StarGiftCollection;
payments.starGiftCollectionsNotModified#a0ba4f17 = payments.StarGiftCollections;
payments.starGiftCollections#8a2932f3 collections:Vector<StarGiftCollection> = payments.StarGiftCollections;
storyAlbum#9325705a flags:# album_id:int title:string icon_photo:flags.0?Photo icon_video:flags.1?Document = StoryAlbum;
stories.albumsNotModified#564edaeb = stories.Albums;
stories.albums#c3987a3a hash:long albums:Vector<StoryAlbum> = stories.Albums;
searchPostsFlood#3e0b5b6a flags:# query_is_free:flags.0?true total_daily:int remains:int wait_till:flags.1?int stars_amount:long = SearchPostsFlood;
payments.uniqueStarGiftValueInfo#512fe446 flags:# last_sale_on_fragment:flags.1?true value_is_average:flags.6?true currency:string value:long initial_sale_date:int initial_sale_stars:long initial_sale_price:long last_sale_date:flags.0?int last_sale_price:flags.0?long floor_price:flags.2?long average_price:flags.3?long listed_count:flags.4?int fragment_listed_count:flags.5?int fragment_listed_url:flags.5?string = payments.UniqueStarGiftValueInfo;
profileTabPosts#b98cd696 = ProfileTab;
profileTabGifts#4d4bd46a = ProfileTab;
profileTabMedia#72c64955 = ProfileTab;
profileTabFiles#ab339c00 = ProfileTab;
profileTabMusic#9f27d26e = ProfileTab;
profileTabVoice#e477092e = ProfileTab;
profileTabLinks#d3656499 = ProfileTab;
profileTabGifs#a2c0f695 = ProfileTab;
users.savedMusicNotModified#e3878aa4 count:int = users.SavedMusic;
users.savedMusic#34a2f297 count:int documents:Vector<Document> = users.SavedMusic;
account.savedMusicIdsNotModified#4fc81d6e = account.SavedMusicIds;
account.savedMusicIds#998d6636 ids:Vector<long> = account.SavedMusicIds;
payments.checkCanSendGiftResultOk#374fa7ad = payments.CheckCanSendGiftResult;
payments.checkCanSendGiftResultFail#d5e58274 reason:TextWithEntities = payments.CheckCanSendGiftResult;
inputChatThemeEmpty#83268483 = InputChatTheme;
inputChatTheme#c93de95c emoticon:string = InputChatTheme;
inputChatThemeUniqueGift#87e5dfe4 slug:string = InputChatTheme;
starGiftUpgradePrice#99ea331d date:int upgrade_stars:long = StarGiftUpgradePrice;
groupCallMessage#1a8afc7e flags:# from_admin:flags.1?true id:int from_id:Peer date:int message:TextWithEntities paid_message_stars:flags.0?long = GroupCallMessage;
groupCallDonor#ee430c85 flags:# top:flags.0?true my:flags.1?true anonymous:flags.2?true peer_id:flags.3?Peer stars:long = GroupCallDonor;
phone.groupCallStars#9d1dbd26 total_stars:long top_donors:Vector<GroupCallDonor> chats:Vector<Chat> users:Vector<User> = phone.GroupCallStars;
recentStory#711d692d flags:# live:flags.0?true max_id:flags.1?int = RecentStory;
auctionBidLevel#310240cc pos:int amount:long date:int = AuctionBidLevel;
starGiftAuctionStateNotModified#fe333952 = StarGiftAuctionState;
starGiftAuctionState#5db04f4b version:int start_date:int end_date:int min_bid_amount:long bid_levels:Vector<AuctionBidLevel> top_bidders:Vector<long> next_round_at:int gifts_left:int current_round:int total_rounds:int = StarGiftAuctionState;
starGiftAuctionStateFinished#7d967c3a start_date:int end_date:int average_price:long = StarGiftAuctionState;
starGiftAuctionUserState#2eeed1c4 flags:# returned:flags.1?true bid_amount:flags.0?long bid_date:flags.0?int min_bid_amount:flags.0?long bid_peer:flags.0?Peer acquired_count:int = StarGiftAuctionUserState;
payments.starGiftAuctionState#e98e474 gift:StarGift state:StarGiftAuctionState user_state:StarGiftAuctionUserState timeout:int users:Vector<User> = payments.StarGiftAuctionState;
starGiftAuctionAcquiredGift#ab60e20b flags:# name_hidden:flags.0?true peer:Peer date:int bid_amount:long round:int pos:int message:flags.1?TextWithEntities = StarGiftAuctionAcquiredGift;
payments.starGiftAuctionAcquiredGifts#7d5bd1f0 gifts:Vector<StarGiftAuctionAcquiredGift> users:Vector<User> chats:Vector<Chat> = payments.StarGiftAuctionAcquiredGifts;
starGiftActiveAuctionState#d31bc45d gift:StarGift state:StarGiftAuctionState user_state:StarGiftAuctionUserState = StarGiftActiveAuctionState;
payments.starGiftActiveAuctionsNotModified#db33dad0 = payments.StarGiftActiveAuctions;
payments.starGiftActiveAuctions#97f187d8 auctions:Vector<StarGiftActiveAuctionState> users:Vector<User> = payments.StarGiftActiveAuctions;
inputStarGiftAuction#2e16c98 gift_id:long = InputStarGiftAuction;
inputStarGiftAuctionSlug#7ab58308 slug:string = InputStarGiftAuction;
---functions---
@@ -2953,6 +3099,8 @@ auth.resetLoginEmail#7e960193 phone_number:string phone_code_hash:string = auth.
auth.reportMissingCode#cb9deff6 phone_number:string phone_code_hash:string mnc:string = Bool;
auth.checkPaidAuth#56e59f9c phone_number:string phone_code_hash:string form_id:long = auth.SentCode;
account.registerDevice#ec86017a flags:# no_muted:flags.0?true token_type:int token:string app_sandbox:Bool secret:bytes other_uids:Vector<long> = Bool;
account.unregisterDevice#6a0d3206 token_type:int token:string other_uids:Vector<long> = Bool;
@@ -3129,7 +3277,7 @@ account.deleteAutoSaveExceptions#53bc0020 = Bool;
account.invalidateSignInCodes#ca8ae8ba codes:Vector<string> = Bool;
account.updateColor#7cefa15d flags:# for_profile:flags.1?true color:flags.2?int background_emoji_id:flags.0?long = Bool;
account.updateColor#684d214e flags:# for_profile:flags.1?true color:flags.2?PeerColor = Bool;
account.getDefaultBackgroundEmojis#a60ab9ce hash:long = EmojiList;
@@ -3179,9 +3327,17 @@ account.setReactionsNotifySettings#316ce548 settings:ReactionsNotifySettings = R
account.getCollectibleEmojiStatuses#2e7b4543 hash:long = account.EmojiStatuses;
account.addNoPaidMessagesException#6f688aa7 flags:# refund_charged:flags.0?true user_id:InputUser = Bool;
account.getPaidMessagesRevenue#19ba4a67 flags:# parent_peer:flags.0?InputPeer user_id:InputUser = account.PaidMessagesRevenue;
account.getPaidMessagesRevenue#f1266f38 user_id:InputUser = account.PaidMessagesRevenue;
account.toggleNoPaidMessagesException#fe2eda76 flags:# refund_charged:flags.0?true require_payment:flags.2?true parent_peer:flags.1?InputPeer user_id:InputUser = Bool;
account.setMainProfileTab#5dee78b0 tab:ProfileTab = Bool;
account.saveMusic#b26732a9 flags:# unsave:flags.0?true id:InputDocument after_id:flags.1?InputDocument = Bool;
account.getSavedMusicIds#e09d5faf hash:long = account.SavedMusicIds;
account.getUniqueGiftChatThemes#e42ce9c9 offset:string limit:int hash:long = account.ChatThemes;
users.getUsers#d91a548 id:Vector<InputUser> = Vector<User>;
@@ -3191,6 +3347,12 @@ users.setSecureValueErrors#90c894b5 id:InputUser errors:Vector<SecureValueError>
users.getRequirementsToContact#d89a83a3 id:Vector<InputUser> = Vector<RequirementToContact>;
users.getSavedMusic#788d7fe3 id:InputUser offset:int limit:int hash:long = users.SavedMusic;
users.getSavedMusicByID#7573a4e9 id:InputUser documents:Vector<InputDocument> = users.SavedMusic;
users.suggestBirthday#fc533372 id:InputUser birthday:Birthday = Updates;
contacts.getContactIDs#7adc669d hash:long = Vector<int>;
contacts.getStatuses#c4a353ee = Vector<ContactStatus>;
@@ -3223,7 +3385,7 @@ contacts.getSaved#82f1e39f = Vector<SavedContact>;
contacts.toggleTopPeers#8514bdda enabled:Bool = Bool;
contacts.addContact#e8f463d0 flags:# add_phone_privacy_exception:flags.0?true id:InputUser first_name:string last_name:string phone:string = Updates;
contacts.addContact#d9ba2e54 flags:# add_phone_privacy_exception:flags.0?true id:InputUser first_name:string last_name:string phone:string note:flags.1?TextWithEntities = Updates;
contacts.acceptContact#f831a20f id:InputUser = Updates;
@@ -3245,6 +3407,8 @@ contacts.getBirthdays#daeda864 = contacts.ContactBirthdays;
contacts.getSponsoredPeers#b6c8c393 q:string = contacts.SponsoredPeers;
contacts.updateContactNote#139f63fb id:InputUser note:TextWithEntities = Bool;
messages.getMessages#63c66506 id:Vector<InputMessage> = messages.Messages;
messages.getDialogs#a0f4cb4f flags:# exclude_pinned:flags.0?true folder_id:flags.1?int offset_date:int offset_id:int offset_peer:InputPeer limit:int hash:long = messages.Dialogs;
@@ -3263,11 +3427,11 @@ messages.receivedMessages#5a954c0 max_id:int = Vector<ReceivedNotifyMessage>;
messages.setTyping#58943ee2 flags:# peer:InputPeer top_msg_id:flags.0?int action:SendMessageAction = Bool;
messages.sendMessage#fbf2340a flags:# no_webpage:flags.1?true silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true invert_media:flags.16?true allow_paid_floodskip:flags.19?true peer:InputPeer reply_to:flags.0?InputReplyTo message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long allow_paid_stars:flags.21?long = Updates;
messages.sendMessage#545cd15a flags:# no_webpage:flags.1?true silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true invert_media:flags.16?true allow_paid_floodskip:flags.19?true peer:InputPeer reply_to:flags.0?InputReplyTo message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int schedule_repeat_period:flags.24?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long allow_paid_stars:flags.21?long suggested_post:flags.22?SuggestedPost = Updates;
messages.sendMedia#a550cd78 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true invert_media:flags.16?true allow_paid_floodskip:flags.19?true peer:InputPeer reply_to:flags.0?InputReplyTo media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long allow_paid_stars:flags.21?long = Updates;
messages.sendMedia#330e77f flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true invert_media:flags.16?true allow_paid_floodskip:flags.19?true peer:InputPeer reply_to:flags.0?InputReplyTo media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int schedule_repeat_period:flags.24?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long allow_paid_stars:flags.21?long suggested_post:flags.22?SuggestedPost = Updates;
messages.forwardMessages#38f0188c flags:# silent:flags.5?true background:flags.6?true with_my_score:flags.8?true drop_author:flags.11?true drop_media_captions:flags.12?true noforwards:flags.14?true allow_paid_floodskip:flags.19?true from_peer:InputPeer id:Vector<int> random_id:Vector<long> to_peer:InputPeer top_msg_id:flags.9?int reply_to:flags.22?InputReplyTo schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut video_timestamp:flags.20?int allow_paid_stars:flags.21?long = Updates;
messages.forwardMessages#41d41ade flags:# silent:flags.5?true background:flags.6?true with_my_score:flags.8?true drop_author:flags.11?true drop_media_captions:flags.12?true noforwards:flags.14?true allow_paid_floodskip:flags.19?true from_peer:InputPeer id:Vector<int> random_id:Vector<long> to_peer:InputPeer top_msg_id:flags.9?int reply_to:flags.22?InputReplyTo schedule_date:flags.10?int schedule_repeat_period:flags.24?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut video_timestamp:flags.20?int allow_paid_stars:flags.21?long suggested_post:flags.23?SuggestedPost = Updates;
messages.reportSpam#cf1592db peer:InputPeer = Bool;
@@ -3357,7 +3521,7 @@ messages.sendInlineBotResult#c0cf7646 flags:# silent:flags.5?true background:fla
messages.getMessageEditData#fda68d36 peer:InputPeer id:int = messages.MessageEditData;
messages.editMessage#dfd14005 flags:# no_webpage:flags.1?true invert_media:flags.16?true peer:InputPeer id:int message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.15?int quick_reply_shortcut_id:flags.17?int = Updates;
messages.editMessage#51e842e1 flags:# no_webpage:flags.1?true invert_media:flags.16?true peer:InputPeer id:int message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.15?int schedule_repeat_period:flags.18?int quick_reply_shortcut_id:flags.17?int = Updates;
messages.editInlineBotMessage#83557dba flags:# no_webpage:flags.1?true invert_media:flags.16?true id:InputBotInlineMessageID message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> = Bool;
@@ -3367,7 +3531,7 @@ messages.setBotCallbackAnswer#d58f130a flags:# alert:flags.1?true query_id:long
messages.getPeerDialogs#e470bcfd peers:Vector<InputDialogPeer> = messages.PeerDialogs;
messages.saveDraft#d372c5ce flags:# no_webpage:flags.1?true invert_media:flags.6?true reply_to:flags.4?InputReplyTo peer:InputPeer message:string entities:flags.3?Vector<MessageEntity> media:flags.5?InputMedia effect:flags.7?long = Bool;
messages.saveDraft#54ae308e flags:# no_webpage:flags.1?true invert_media:flags.6?true reply_to:flags.4?InputReplyTo peer:InputPeer message:string entities:flags.3?Vector<MessageEntity> media:flags.5?InputMedia effect:flags.7?long suggested_post:flags.8?SuggestedPost = Bool;
messages.getAllDrafts#6a3f8d65 = Updates;
@@ -3525,7 +3689,7 @@ messages.setHistoryTTL#b80e5fe4 peer:InputPeer period:int = Updates;
messages.checkHistoryImportPeer#5dc60f03 peer:InputPeer = messages.CheckedHistoryImportPeer;
messages.setChatTheme#e63be13f peer:InputPeer emoticon:string = Updates;
messages.setChatTheme#81202c9 peer:InputPeer theme:InputChatTheme = Updates;
messages.getMessageReadParticipants#31c1c44f peer:InputPeer msg_id:int = Vector<ReadParticipantDate>;
@@ -3685,7 +3849,7 @@ messages.clickSponsoredMessage#8235057e flags:# media:flags.0?true fullscreen:fl
messages.reportSponsoredMessage#12cbf0c4 random_id:bytes option:bytes = channels.SponsoredMessageReportResult;
messages.getSponsoredMessages#9bd2f439 peer:InputPeer = messages.SponsoredMessages;
messages.getSponsoredMessages#3d6ce850 flags:# peer:InputPeer msg_id:flags.0?int = messages.SponsoredMessages;
messages.savePreparedInlineMessage#f21f7f2f flags:# result:InputBotInlineResult user_id:InputUser peer_types:flags.0?Vector<InlineQueryPeerType> = messages.BotPreparedInlineMessage;
@@ -3699,6 +3863,26 @@ messages.getSavedDialogsByID#6f6f9c96 flags:# parent_peer:flags.1?InputPeer ids:
messages.readSavedHistory#ba4a3b5b parent_peer:InputPeer peer:InputPeer max_id:int = Bool;
messages.toggleTodoCompleted#d3e03124 peer:InputPeer msg_id:int completed:Vector<int> incompleted:Vector<int> = Updates;
messages.appendTodoList#21a61057 peer:InputPeer msg_id:int list:Vector<TodoItem> = Updates;
messages.toggleSuggestedPostApproval#8107455c flags:# reject:flags.1?true peer:InputPeer msg_id:int schedule_date:flags.0?int reject_comment:flags.2?string = Updates;
messages.getForumTopics#3ba47bff flags:# peer:InputPeer q:flags.0?string offset_date:int offset_id:int offset_topic:int limit:int = messages.ForumTopics;
messages.getForumTopicsByID#af0a4a08 peer:InputPeer topics:Vector<int> = messages.ForumTopics;
messages.editForumTopic#cecc1134 flags:# peer:InputPeer topic_id:int title:flags.0?string icon_emoji_id:flags.1?long closed:flags.2?Bool hidden:flags.3?Bool = Updates;
messages.updatePinnedForumTopic#175df251 peer:InputPeer topic_id:int pinned:Bool = Updates;
messages.reorderPinnedForumTopics#e7841f0 flags:# force:flags.0?true peer:InputPeer order:Vector<int> = Updates;
messages.createForumTopic#2f98c3d5 flags:# title_missing:flags.4?true peer:InputPeer title:string icon_color:flags.0?int icon_emoji_id:flags.3?long random_id:long send_as:flags.2?InputPeer = Updates;
messages.deleteTopicHistory#d2816f10 peer:InputPeer top_msg_id:int = messages.AffectedHistory;
updates.getState#edd4882a = updates.State;
updates.getDifference#19c2f763 flags:# pts:int pts_limit:flags.1?int pts_total_limit:flags.0?int date:int qts:int qts_limit:flags.2?int = updates.Difference;
@@ -3851,7 +4035,7 @@ channels.getInactiveChannels#11e831ee = messages.InactiveChats;
channels.convertToGigagroup#b290c69 channel:InputChannel = Updates;
channels.getSendAs#e785a43f flags:# for_paid_reactions:flags.0?true peer:InputPeer = channels.SendAsPeers;
channels.getSendAs#e785a43f flags:# for_paid_reactions:flags.0?true for_live_stories:flags.1?true peer:InputPeer = channels.SendAsPeers;
channels.deleteParticipantHistory#367544db channel:InputChannel participant:InputPeer = messages.AffectedHistory;
@@ -3867,20 +4051,6 @@ channels.deactivateAllUsernames#a245dd3 channel:InputChannel = Bool;
channels.toggleForum#3ff75734 channel:InputChannel enabled:Bool tabs:Bool = Updates;
channels.createForumTopic#f40c0224 flags:# channel:InputChannel title:string icon_color:flags.0?int icon_emoji_id:flags.3?long random_id:long send_as:flags.2?InputPeer = Updates;
channels.getForumTopics#de560d1 flags:# channel:InputChannel q:flags.0?string offset_date:int offset_id:int offset_topic:int limit:int = messages.ForumTopics;
channels.getForumTopicsByID#b0831eb9 channel:InputChannel topics:Vector<int> = messages.ForumTopics;
channels.editForumTopic#f4dfa185 flags:# channel:InputChannel topic_id:int title:flags.0?string icon_emoji_id:flags.1?long closed:flags.2?Bool hidden:flags.3?Bool = Updates;
channels.updatePinnedForumTopic#6c2d9026 channel:InputChannel topic_id:int pinned:Bool = Updates;
channels.deleteTopicHistory#34435f2d channel:InputChannel top_msg_id:int = messages.AffectedHistory;
channels.reorderPinnedForumTopics#2950a18f flags:# force:flags.0?true channel:InputChannel order:Vector<int> = Updates;
channels.toggleAntiSpam#68f3e4eb channel:InputChannel enabled:Bool = Updates;
channels.reportAntiSpamFalsePositive#a850a693 channel:InputChannel msg_id:int = Bool;
@@ -3901,7 +4071,7 @@ channels.setEmojiStickers#3cd930b7 channel:InputChannel stickerset:InputStickerS
channels.restrictSponsoredMessages#9ae91519 channel:InputChannel restricted:Bool = Updates;
channels.searchPosts#d19f987b hashtag:string offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages;
channels.searchPosts#f2c4f24d flags:# hashtag:flags.0?string query:flags.1?string offset_rate:int offset_peer:InputPeer offset_id:int limit:int allow_paid_stars:flags.2?long = messages.Messages;
channels.updatePaidMessagesPrice#4b12327b flags:# broadcast_messages_allowed:flags.0?true channel:InputChannel send_paid_messages_stars:long = Updates;
@@ -3909,6 +4079,10 @@ channels.toggleAutotranslation#167fc0a1 channel:InputChannel enabled:Bool = Upda
channels.getMessageAuthor#ece2a0e6 channel:InputChannel id:int = User;
channels.checkSearchPostsFlood#22567115 flags:# query:flags.0?string = SearchPostsFlood;
channels.setMainProfileTab#3583fcb1 channel:InputChannel tab:ProfileTab = Bool;
bots.sendCustomRequest#aa2769ed custom_method:string params:DataJSON = DataJSON;
bots.answerWebhookJSONQuery#e6213f4d query_id:long data:DataJSON = Bool;
@@ -4001,21 +4175,21 @@ payments.launchPrepaidGiveaway#5ff58f20 peer:InputPeer giveaway_id:long purpose:
payments.getStarsTopupOptions#c00ec7d3 = Vector<StarsTopupOption>;
payments.getStarsStatus#104fcfa7 peer:InputPeer = payments.StarsStatus;
payments.getStarsStatus#4ea9b3bf flags:# ton:flags.0?true peer:InputPeer = payments.StarsStatus;
payments.getStarsTransactions#69da4557 flags:# inbound:flags.0?true outbound:flags.1?true ascending:flags.2?true subscription_id:flags.3?string peer:InputPeer offset:string limit:int = payments.StarsStatus;
payments.getStarsTransactions#69da4557 flags:# inbound:flags.0?true outbound:flags.1?true ascending:flags.2?true ton:flags.4?true subscription_id:flags.3?string peer:InputPeer offset:string limit:int = payments.StarsStatus;
payments.sendStarsForm#7998c914 form_id:long invoice:InputInvoice = payments.PaymentResult;
payments.refundStarsCharge#25ae8f4a user_id:InputUser charge_id:string = Updates;
payments.getStarsRevenueStats#d91ffad6 flags:# dark:flags.0?true peer:InputPeer = payments.StarsRevenueStats;
payments.getStarsRevenueStats#d91ffad6 flags:# dark:flags.0?true ton:flags.1?true peer:InputPeer = payments.StarsRevenueStats;
payments.getStarsRevenueWithdrawalUrl#13bbe8b3 peer:InputPeer stars:long password:InputCheckPasswordSRP = payments.StarsRevenueWithdrawalUrl;
payments.getStarsRevenueWithdrawalUrl#2433dc92 flags:# ton:flags.0?true peer:InputPeer amount:flags.1?long password:InputCheckPasswordSRP = payments.StarsRevenueWithdrawalUrl;
payments.getStarsRevenueAdsAccountUrl#d1d7efc5 peer:InputPeer = payments.StarsRevenueAdsAccountUrl;
payments.getStarsTransactionsByID#27842d2e peer:InputPeer id:Vector<InputStarsTransaction> = payments.StarsStatus;
payments.getStarsTransactionsByID#2dca16b8 flags:# ton:flags.0?true peer:InputPeer id:Vector<InputStarsTransaction> = payments.StarsStatus;
payments.getStarsGiftOptions#d3c96bc8 flags:# user_id:flags.0?InputUser = Vector<StarsGiftOption>;
@@ -4053,7 +4227,7 @@ payments.transferStarGift#7f18176a stargift:InputSavedStarGift to_id:InputPeer =
payments.getUniqueStarGift#a1974d72 slug:string = payments.UniqueStarGift;
payments.getSavedStarGifts#23830de9 flags:# exclude_unsaved:flags.0?true exclude_saved:flags.1?true exclude_unlimited:flags.2?true exclude_limited:flags.3?true exclude_unique:flags.4?true sort_by_value:flags.5?true peer:InputPeer offset:string limit:int = payments.SavedStarGifts;
payments.getSavedStarGifts#a319e569 flags:# exclude_unsaved:flags.0?true exclude_saved:flags.1?true exclude_unlimited:flags.2?true exclude_unique:flags.4?true sort_by_value:flags.5?true exclude_upgradable:flags.7?true exclude_unupgradable:flags.8?true peer_color_available:flags.9?true exclude_hosted:flags.10?true peer:InputPeer collection_id:flags.6?int offset:string limit:int = payments.SavedStarGifts;
payments.getSavedStarGift#b455a106 stargift:Vector<InputSavedStarGift> = payments.SavedStarGifts;
@@ -4067,7 +4241,27 @@ payments.canPurchaseStore#4fdc5ea7 purpose:InputStorePaymentPurpose = Bool;
payments.getResaleStarGifts#7a5fa236 flags:# sort_by_price:flags.1?true sort_by_num:flags.2?true attributes_hash:flags.0?long gift_id:long attributes:flags.3?Vector<StarGiftAttributeId> offset:string limit:int = payments.ResaleStarGifts;
payments.updateStarGiftPrice#3baea4e1 stargift:InputSavedStarGift resell_stars:long = Updates;
payments.updateStarGiftPrice#edbe6ccb stargift:InputSavedStarGift resell_amount:StarsAmount = Updates;
payments.createStarGiftCollection#1f4a0e87 peer:InputPeer title:string stargift:Vector<InputSavedStarGift> = StarGiftCollection;
payments.updateStarGiftCollection#4fddbee7 flags:# peer:InputPeer collection_id:int title:flags.0?string delete_stargift:flags.1?Vector<InputSavedStarGift> add_stargift:flags.2?Vector<InputSavedStarGift> order:flags.3?Vector<InputSavedStarGift> = StarGiftCollection;
payments.reorderStarGiftCollections#c32af4cc peer:InputPeer order:Vector<int> = Bool;
payments.deleteStarGiftCollection#ad5648e8 peer:InputPeer collection_id:int = Bool;
payments.getStarGiftCollections#981b91dd peer:InputPeer hash:long = payments.StarGiftCollections;
payments.getUniqueStarGiftValueInfo#4365af6b slug:string = payments.UniqueStarGiftValueInfo;
payments.checkCanSendGift#c0c4edc9 gift_id:long = payments.CheckCanSendGiftResult;
payments.getStarGiftAuctionState#5c9ff4d6 auction:InputStarGiftAuction version:int = payments.StarGiftAuctionState;
payments.getStarGiftAuctionAcquiredGifts#6ba2cbec gift_id:long = payments.StarGiftAuctionAcquiredGifts;
payments.getStarGiftActiveAuctions#a5d0514d hash:long = payments.StarGiftActiveAuctions;
stickers.createStickerSet#9021ab67 flags:# masks:flags.0?true emojis:flags.5?true text_color:flags.6?true user_id:InputUser title:string short_name:string thumb:flags.2?InputDocument stickers:Vector<InputStickerSetItem> software:flags.3?string = messages.StickerSet;
@@ -4119,7 +4313,7 @@ phone.inviteToGroupCall#7b393160 call:InputGroupCall users:Vector<InputUser> = U
phone.discardGroupCall#7a777135 call:InputGroupCall = Updates;
phone.toggleGroupCallSettings#74bbb43d flags:# reset_invite_hash:flags.1?true call:InputGroupCall join_muted:flags.0?Bool = Updates;
phone.toggleGroupCallSettings#974392f2 flags:# reset_invite_hash:flags.1?true call:InputGroupCall join_muted:flags.0?Bool messages_enabled:flags.2?Bool send_paid_messages_stars:flags.3?long = Updates;
phone.getGroupCall#41845db call:InputGroupCall limit:int = phone.GroupCall;
@@ -4149,7 +4343,7 @@ phone.leaveGroupCallPresentation#1c50d144 call:InputGroupCall = Updates;
phone.getGroupCallStreamChannels#1ab21940 call:InputGroupCall = phone.GroupCallStreamChannels;
phone.getGroupCallStreamRtmpUrl#deb3abbf peer:InputPeer revoke:Bool = phone.GroupCallStreamRtmpUrl;
phone.getGroupCallStreamRtmpUrl#5af4c73a flags:# live_story:flags.0?true peer:InputPeer revoke:Bool = phone.GroupCallStreamRtmpUrl;
phone.saveCallLog#41248786 peer:InputPhoneCall file:InputFile = Bool;
@@ -4165,6 +4359,18 @@ phone.declineConferenceCallInvite#3c479971 msg_id:int = Updates;
phone.getGroupCallChainBlocks#ee9f88a6 call:InputGroupCall sub_chain_id:int offset:int limit:int = Updates;
phone.sendGroupCallMessage#b1d11410 flags:# call:InputGroupCall random_id:long message:TextWithEntities allow_paid_stars:flags.0?long send_as:flags.1?InputPeer = Updates;
phone.sendGroupCallEncryptedMessage#e5afa56d call:InputGroupCall encrypted_message:bytes = Bool;
phone.deleteGroupCallMessages#f64f54f7 flags:# report_spam:flags.0?true call:InputGroupCall messages:Vector<int> = Updates;
phone.deleteGroupCallParticipantMessages#1dbfeca0 flags:# report_spam:flags.0?true call:InputGroupCall participant:InputPeer = Updates;
phone.getGroupCallStars#6f636302 call:InputGroupCall = phone.GroupCallStars;
phone.saveDefaultSendAs#4167add1 call:InputGroupCall send_as:InputPeer = Bool;
langpack.getLangPack#f2f2330a lang_pack:string lang_code:string = LangPackDifference;
langpack.getStrings#efea3803 lang_pack:string lang_code:string keys:Vector<string> = Vector<LangPackString>;
@@ -4191,12 +4397,6 @@ stats.getStoryStats#374fef40 flags:# dark:flags.0?true peer:InputPeer id:int = s
stats.getStoryPublicForwards#a6437ef6 peer:InputPeer id:int offset:string limit:int = stats.PublicForwards;
stats.getBroadcastRevenueStats#f788ee19 flags:# dark:flags.0?true peer:InputPeer = stats.BroadcastRevenueStats;
stats.getBroadcastRevenueWithdrawalUrl#9df4faad peer:InputPeer password:InputCheckPasswordSRP = stats.BroadcastRevenueWithdrawalUrl;
stats.getBroadcastRevenueTransactions#70990b6d peer:InputPeer offset:int limit:int = stats.BroadcastRevenueTransactions;
chatlists.exportChatlistInvite#8472478e chatlist:InputChatlist title:string peers:Vector<InputPeer> = chatlists.ExportedChatlistInvite;
chatlists.deleteExportedInvite#719c5c5e chatlist:InputChatlist slug:string = Bool;
@@ -4221,7 +4421,7 @@ chatlists.leaveChatlist#74fae13a chatlist:InputChatlist peers:Vector<InputPeer>
stories.canSendStory#30eb63f0 peer:InputPeer = stories.CanSendStoryCount;
stories.sendStory#e4e6694b flags:# pinned:flags.2?true noforwards:flags.4?true fwd_modified:flags.7?true peer:InputPeer media:InputMedia media_areas:flags.5?Vector<MediaArea> caption:flags.0?string entities:flags.1?Vector<MessageEntity> privacy_rules:Vector<InputPrivacyRule> random_id:long period:flags.3?int fwd_from_id:flags.6?InputPeer fwd_from_story:flags.6?int = Updates;
stories.sendStory#737fc2ec flags:# pinned:flags.2?true noforwards:flags.4?true fwd_modified:flags.7?true peer:InputPeer media:InputMedia media_areas:flags.5?Vector<MediaArea> caption:flags.0?string entities:flags.1?Vector<MessageEntity> privacy_rules:Vector<InputPrivacyRule> random_id:long period:flags.3?int fwd_from_id:flags.6?InputPeer fwd_from_story:flags.6?int albums:flags.8?Vector<int> = Updates;
stories.editStory#b583ba46 flags:# peer:InputPeer id:int media:flags.0?InputMedia media_areas:flags.3?Vector<MediaArea> caption:flags.1?string entities:flags.1?Vector<MessageEntity> privacy_rules:flags.2?Vector<InputPrivacyRule> = Updates;
@@ -4259,7 +4459,7 @@ stories.getPeerStories#2c4ada50 peer:InputPeer = stories.PeerStories;
stories.getAllReadPeerStories#9b5ae7f9 = Updates;
stories.getPeerMaxIDs#535983c3 id:Vector<InputPeer> = Vector<int>;
stories.getPeerMaxIDs#78499170 id:Vector<InputPeer> = Vector<RecentStory>;
stories.getChatsToSend#a56a8b60 = messages.Chats;
@@ -4271,6 +4471,20 @@ stories.togglePinnedToTop#b297e9b peer:InputPeer id:Vector<int> = Bool;
stories.searchPosts#d1810907 flags:# hashtag:flags.0?string area:flags.1?MediaArea peer:flags.2?InputPeer offset:string limit:int = stories.FoundStories;
stories.createAlbum#a36396e5 peer:InputPeer title:string stories:Vector<int> = StoryAlbum;
stories.updateAlbum#5e5259b6 flags:# peer:InputPeer album_id:int title:flags.0?string delete_stories:flags.1?Vector<int> add_stories:flags.2?Vector<int> order:flags.3?Vector<int> = StoryAlbum;
stories.reorderAlbums#8535fbd9 peer:InputPeer order:Vector<int> = Bool;
stories.deleteAlbum#8d3456d0 peer:InputPeer album_id:int = Bool;
stories.getAlbums#25b3eac7 peer:InputPeer hash:long = stories.Albums;
stories.getAlbumStories#ac806d61 peer:InputPeer album_id:int offset:int limit:int = stories.Stories;
stories.startLive#d069ccde flags:# pinned:flags.2?true noforwards:flags.4?true rtmp_stream:flags.5?true peer:InputPeer caption:flags.0?string entities:flags.1?Vector<MessageEntity> privacy_rules:Vector<InputPrivacyRule> random_id:long messages_enabled:flags.6?Bool send_paid_messages_stars:flags.7?long = Updates;
premium.getBoostsList#60f67660 flags:# gifts:flags.0?true peer:InputPeer offset:string limit:int = premium.BoostsList;
premium.getMyBoosts#be77b4a = premium.MyBoosts;
@@ -4297,4 +4511,4 @@ smsjobs.finishJob#4f1ebf24 flags:# job_id:string error:flags.0?string = Bool;
fragment.getCollectibleInfo#be1e85ba collectible:InputCollectible = fragment.CollectibleInfo;
// LAYER 204
// LAYER 218
+285 -111
View File
@@ -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: 204
// SHA256: e39e4ec7b5e23a972775fa0a92cadfe44aaed3e8522735b085939a10c10f81ec
// Layer: 217
// SHA256: 1ed022fa4fa0b92427239e620cc59e925cf85d9c9e6bfedf36119f3aff613193
int#a8509bda ? = Int;
@@ -76,7 +76,7 @@ inputUser#f21158c6 user_id:long access_hash:long = 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;
inputPhoneContact#6a1dc4be flags:# client_id:long phone:string first_name:string last_name:string note:flags.0?TextWithEntities = InputContact;
inputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;
@@ -120,6 +120,8 @@ inputMediaWebPage#c21b8849 flags:# force_large_media:flags.0?true force_small_me
inputMediaPaidMedia#c4103386 flags:# stars_amount:long extended_media:Vector<InputMedia> payload:flags.0?string = InputMedia;
inputMediaTodo#9fc55fde todo:TodoList = InputMedia;
inputChatPhotoEmpty#1ca48f57 = InputChatPhoto;
inputChatUploadedPhoto#bdcdaec0 flags:# file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double video_emoji_markup:flags.3?VideoSize = InputChatPhoto;
@@ -182,7 +184,7 @@ storage.fileWebp#1081464c = storage.FileType;
userEmpty#d3bc4b7a id:long = User;
user#20b1422 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true fake:flags.26?true bot_attach_menu:flags.27?true premium:flags.28?true attach_menu_enabled:flags.29?true flags2:# bot_can_edit:flags2.1?true close_friend:flags2.2?true stories_hidden:flags2.3?true stories_unavailable:flags2.4?true contact_require_premium:flags2.10?true bot_business:flags2.11?true bot_has_main_app:flags2.13?true id:long access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector<RestrictionReason> bot_inline_placeholder:flags.19?string lang_code:flags.22?string emoji_status:flags.30?EmojiStatus usernames:flags2.0?Vector<Username> stories_max_id:flags2.5?int color:flags2.8?PeerColor profile_color:flags2.9?PeerColor bot_active_users:flags2.12?int bot_verification_icon:flags2.14?long send_paid_messages_stars:flags2.15?long = User;
user#31774388 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true fake:flags.26?true bot_attach_menu:flags.27?true premium:flags.28?true attach_menu_enabled:flags.29?true flags2:# bot_can_edit:flags2.1?true close_friend:flags2.2?true stories_hidden:flags2.3?true stories_unavailable:flags2.4?true contact_require_premium:flags2.10?true bot_business:flags2.11?true bot_has_main_app:flags2.13?true bot_forum_view:flags2.16?true id:long access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector<RestrictionReason> bot_inline_placeholder:flags.19?string lang_code:flags.22?string emoji_status:flags.30?EmojiStatus usernames:flags2.0?Vector<Username> stories_max_id:flags2.5?RecentStory color:flags2.8?PeerColor profile_color:flags2.9?PeerColor bot_active_users:flags2.12?int bot_verification_icon:flags2.14?long send_paid_messages_stars:flags2.15?long = User;
userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;
@@ -206,13 +208,13 @@ chat#41cbf256 flags:# creator:flags.0?true left:flags.2?true deactivated:flags.5
chatForbidden#6592a1a7 id:long title:string = Chat;
channel#fe685355 flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true call_active:flags.23?true call_not_empty:flags.24?true fake:flags.25?true gigagroup:flags.26?true noforwards:flags.27?true join_to_send:flags.28?true join_request:flags.29?true forum:flags.30?true flags2:# stories_hidden:flags2.1?true stories_hidden_min:flags2.2?true stories_unavailable:flags2.3?true signature_profiles:flags2.12?true autotranslation:flags2.15?true broadcast_messages_allowed:flags2.16?true monoforum:flags2.17?true forum_tabs:flags2.19?true id:long access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int restriction_reason:flags.9?Vector<RestrictionReason> admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int usernames:flags2.0?Vector<Username> stories_max_id:flags2.4?int color:flags2.7?PeerColor profile_color:flags2.8?PeerColor emoji_status:flags2.9?EmojiStatus level:flags2.10?int subscription_until_date:flags2.11?int bot_verification_icon:flags2.13?long send_paid_messages_stars:flags2.14?long linked_monoforum_id:flags2.18?long = Chat;
channel#1c32b11c flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true call_active:flags.23?true call_not_empty:flags.24?true fake:flags.25?true gigagroup:flags.26?true noforwards:flags.27?true join_to_send:flags.28?true join_request:flags.29?true forum:flags.30?true flags2:# stories_hidden:flags2.1?true stories_hidden_min:flags2.2?true stories_unavailable:flags2.3?true signature_profiles:flags2.12?true autotranslation:flags2.15?true broadcast_messages_allowed:flags2.16?true monoforum:flags2.17?true forum_tabs:flags2.19?true id:long access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int restriction_reason:flags.9?Vector<RestrictionReason> admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int usernames:flags2.0?Vector<Username> stories_max_id:flags2.4?RecentStory color:flags2.7?PeerColor profile_color:flags2.8?PeerColor emoji_status:flags2.9?EmojiStatus level:flags2.10?int subscription_until_date:flags2.11?int bot_verification_icon:flags2.13?long send_paid_messages_stars:flags2.14?long linked_monoforum_id:flags2.18?long = 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#2633421b flags:# can_set_username:flags.7?true has_scheduled:flags.8?true translations_disabled:flags.19?true id:long about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:flags.13?ExportedChatInvite bot_info:flags.3?Vector<BotInfo> pinned_msg_id:flags.6?int folder_id:flags.11?int call:flags.12?InputGroupCall ttl_period:flags.14?int groupcall_default_join_as:flags.15?Peer theme_emoticon:flags.16?string requests_pending:flags.17?int recent_requesters:flags.17?Vector<long> available_reactions:flags.18?ChatReactions reactions_limit:flags.20?int = ChatFull;
channelFull#52d6806b flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true flags2:# can_delete_channel:flags2.0?true antispam:flags2.1?true participants_hidden:flags2.2?true translations_disabled:flags2.3?true stories_pinned_available:flags2.5?true view_forum_as_messages:flags2.6?true restricted_sponsored:flags2.11?true can_view_revenue:flags2.12?true paid_media_allowed:flags2.14?true can_view_stars_revenue:flags2.15?true paid_reactions_available:flags2.16?true stargifts_available:flags2.19?true paid_messages_available:flags2.20?true id:long about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?long migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?long location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector<string> groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string requests_pending:flags.28?int recent_requesters:flags.28?Vector<long> default_send_as:flags.29?Peer available_reactions:flags.30?ChatReactions reactions_limit:flags2.13?int stories:flags2.4?PeerStories wallpaper:flags2.7?WallPaper boosts_applied:flags2.8?int boosts_unrestrict:flags2.9?int emojiset:flags2.10?StickerSet bot_verification:flags2.17?BotVerification stargifts_count:flags2.18?int = ChatFull;
channelFull#e4e0b29d flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true flags2:# can_delete_channel:flags2.0?true antispam:flags2.1?true participants_hidden:flags2.2?true translations_disabled:flags2.3?true stories_pinned_available:flags2.5?true view_forum_as_messages:flags2.6?true restricted_sponsored:flags2.11?true can_view_revenue:flags2.12?true paid_media_allowed:flags2.14?true can_view_stars_revenue:flags2.15?true paid_reactions_available:flags2.16?true stargifts_available:flags2.19?true paid_messages_available:flags2.20?true id:long about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?long migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?long location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector<string> groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string requests_pending:flags.28?int recent_requesters:flags.28?Vector<long> default_send_as:flags.29?Peer available_reactions:flags.30?ChatReactions reactions_limit:flags2.13?int stories:flags2.4?PeerStories wallpaper:flags2.7?WallPaper boosts_applied:flags2.8?int boosts_unrestrict:flags2.9?int emojiset:flags2.10?StickerSet bot_verification:flags2.17?BotVerification stargifts_count:flags2.18?int send_paid_messages_stars:flags2.21?long main_tab:flags2.22?ProfileTab = ChatFull;
chatParticipant#c02d4007 user_id:long inviter_id:long date:int = ChatParticipant;
@@ -230,9 +232,9 @@ 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#eabcdd4d flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true noforwards:flags.26?true invert_media:flags.27?true flags2:# offline:flags2.1?true video_processing_pending:flags2.4?true id:int from_id:flags.8?Peer from_boosts_applied:flags.29?int peer_id:Peer saved_peer_id:flags.28?Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long via_business_bot_id:flags2.0?long reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long reactions:flags.20?MessageReactions restriction_reason:flags.22?Vector<RestrictionReason> ttl_period:flags.25?int quick_reply_shortcut_id:flags.30?int effect:flags2.2?long factcheck:flags2.3?FactCheck report_delivery_until_date:flags2.5?int paid_message_stars:flags2.6?long = Message;
message#b92f76cf flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true noforwards:flags.26?true invert_media:flags.27?true flags2:# offline:flags2.1?true video_processing_pending:flags2.4?true paid_suggested_post_stars:flags2.8?true paid_suggested_post_ton:flags2.9?true id:int from_id:flags.8?Peer from_boosts_applied:flags.29?int peer_id:Peer saved_peer_id:flags.28?Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long via_business_bot_id:flags2.0?long reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long reactions:flags.20?MessageReactions restriction_reason:flags.22?Vector<RestrictionReason> ttl_period:flags.25?int quick_reply_shortcut_id:flags.30?int effect:flags2.2?long factcheck:flags2.3?FactCheck report_delivery_until_date:flags2.5?int paid_message_stars:flags2.6?long suggested_post:flags2.7?SuggestedPost schedule_repeat_period:flags2.10?int = Message;
messageService#d3d28540 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true reactions_are_possible:flags.9?true silent:flags.13?true post:flags.14?true legacy:flags.19?true id:int from_id:flags.8?Peer peer_id:Peer reply_to:flags.3?MessageReplyHeader date:int action:MessageAction reactions:flags.20?MessageReactions ttl_period:flags.25?int = Message;
messageService#7a800e0a flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true reactions_are_possible:flags.9?true silent:flags.13?true post:flags.14?true legacy:flags.19?true id:int from_id:flags.8?Peer peer_id:Peer saved_peer_id:flags.28?Peer reply_to:flags.3?MessageReplyHeader date:int action:MessageAction reactions:flags.20?MessageReactions ttl_period:flags.25?int = Message;
messageMediaEmpty#3ded6320 = MessageMedia;
@@ -268,6 +270,10 @@ messageMediaGiveawayResults#ceaa3ea1 flags:# only_new_subscribers:flags.0?true r
messageMediaPaidMedia#a8852491 stars_amount:long extended_media:Vector<MessageExtendedMedia> = MessageMedia;
messageMediaToDo#8a53b014 flags:# todo:TodoList completions:flags.0?Vector<TodoCompletion> = MessageMedia;
messageMediaVideoStream#ca5cab89 flags:# rtmp_stream:flags.0?true call:InputGroupCall = MessageMedia;
messageActionEmpty#b6aef7b0 = MessageAction;
messageActionChatCreate#bd47cbad title:string users:Vector<long> = MessageAction;
@@ -324,7 +330,7 @@ messageActionSetMessagesTTL#3c134d7b flags:# period:int auto_setting_from:flags.
messageActionGroupCallScheduled#b3a07661 call:InputGroupCall schedule_date:int = MessageAction;
messageActionSetChatTheme#aa786345 emoticon:string = MessageAction;
messageActionSetChatTheme#b91bbd3a theme:ChatTheme = MessageAction;
messageActionChatJoinedByRequest#ebbca3cb = MessageAction;
@@ -332,9 +338,9 @@ messageActionWebViewDataSentMe#47dd8079 text:string data:string = MessageAction;
messageActionWebViewDataSent#b4c38cb5 text:string = MessageAction;
messageActionGiftPremium#6c6274fa flags:# currency:string amount:long months:int crypto_currency:flags.0?string crypto_amount:flags.0?long message:flags.1?TextWithEntities = MessageAction;
messageActionGiftPremium#48e91302 flags:# currency:string amount:long days:int crypto_currency:flags.0?string crypto_amount:flags.0?long message:flags.1?TextWithEntities = MessageAction;
messageActionTopicCreate#d999256 flags:# title:string icon_color:int icon_emoji_id:flags.0?long = MessageAction;
messageActionTopicCreate#d999256 flags:# title_missing:flags.1?true title:string icon_color:int icon_emoji_id:flags.0?long = MessageAction;
messageActionTopicEdit#c0944820 flags:# title:flags.0?string icon_emoji_id:flags.1?long closed:flags.2?Bool hidden:flags.3?Bool = MessageAction;
@@ -344,7 +350,7 @@ messageActionRequestedPeer#31518e9b button_id:int peers:Vector<Peer> = MessageAc
messageActionSetChatWallPaper#5060a3f4 flags:# same:flags.0?true for_both:flags.1?true wallpaper:WallPaper = MessageAction;
messageActionGiftCode#56d03994 flags:# via_giveaway:flags.0?true unclaimed:flags.5?true boost_peer:flags.1?Peer months:int slug:string currency:flags.2?string amount:flags.2?long crypto_currency:flags.3?string crypto_amount:flags.3?long message:flags.4?TextWithEntities = MessageAction;
messageActionGiftCode#31c48347 flags:# via_giveaway:flags.0?true unclaimed:flags.5?true boost_peer:flags.1?Peer days:int slug:string currency:flags.2?string amount:flags.2?long crypto_currency:flags.3?string crypto_amount:flags.3?long message:flags.4?TextWithEntities = MessageAction;
messageActionGiveawayLaunch#a80f51e4 flags:# stars:flags.0?long = MessageAction;
@@ -360,9 +366,9 @@ messageActionGiftStars#45d5b021 flags:# currency:string amount:long stars:long c
messageActionPrizeStars#b00c47a2 flags:# unclaimed:flags.0?true stars:long transaction_id:string boost_peer:Peer giveaway_msg_id:int = MessageAction;
messageActionStarGift#4717e8a4 flags:# name_hidden:flags.0?true saved:flags.2?true converted:flags.3?true upgraded:flags.5?true refunded:flags.9?true can_upgrade:flags.10?true gift:StarGift message:flags.1?TextWithEntities convert_stars:flags.4?long upgrade_msg_id:flags.5?int upgrade_stars:flags.8?long from_id:flags.11?Peer peer:flags.12?Peer saved_id:flags.12?long = MessageAction;
messageActionStarGift#f24de7fa flags:# name_hidden:flags.0?true saved:flags.2?true converted:flags.3?true upgraded:flags.5?true refunded:flags.9?true can_upgrade:flags.10?true prepaid_upgrade:flags.13?true upgrade_separate:flags.16?true gift:StarGift message:flags.1?TextWithEntities convert_stars:flags.4?long upgrade_msg_id:flags.5?int upgrade_stars:flags.8?long from_id:flags.11?Peer peer:flags.12?Peer saved_id:flags.12?long prepaid_upgrade_hash:flags.14?string gift_msg_id:flags.15?int = MessageAction;
messageActionStarGiftUnique#2e3ae60e flags:# upgrade:flags.0?true transferred:flags.1?true saved:flags.2?true refunded:flags.5?true gift:StarGift can_export_at:flags.3?int transfer_stars:flags.4?long from_id:flags.6?Peer peer:flags.7?Peer saved_id:flags.7?long resale_stars:flags.8?long can_transfer_at:flags.9?int can_resell_at:flags.10?int = MessageAction;
messageActionStarGiftUnique#95728543 flags:# upgrade:flags.0?true transferred:flags.1?true saved:flags.2?true refunded:flags.5?true prepaid_upgrade:flags.11?true assigned:flags.13?true gift:StarGift can_export_at:flags.3?int transfer_stars:flags.4?long from_id:flags.6?Peer peer:flags.7?Peer saved_id:flags.7?long resale_amount:flags.8?StarsAmount can_transfer_at:flags.9?int can_resell_at:flags.10?int drop_original_details_stars:flags.12?long = MessageAction;
messageActionPaidMessagesRefunded#ac1f1fcd count:int stars:long = MessageAction;
@@ -370,6 +376,20 @@ messageActionPaidMessagesPrice#84b88578 flags:# broadcast_messages_allowed:flags
messageActionConferenceCall#2ffe2f7a flags:# missed:flags.0?true active:flags.1?true video:flags.4?true call_id:long duration:flags.2?int other_participants:flags.3?Vector<Peer> = MessageAction;
messageActionTodoCompletions#cc7c5c89 completed:Vector<int> incompleted:Vector<int> = MessageAction;
messageActionTodoAppendTasks#c7edbc83 list:Vector<TodoItem> = MessageAction;
messageActionSuggestedPostApproval#ee7a1596 flags:# rejected:flags.0?true balance_too_low:flags.1?true reject_comment:flags.2?string schedule_date:flags.3?int price:flags.4?StarsAmount = MessageAction;
messageActionSuggestedPostSuccess#95ddcf69 price:StarsAmount = MessageAction;
messageActionSuggestedPostRefund#69f916f8 flags:# payer_initiated:flags.0?true = MessageAction;
messageActionGiftTon#a8a3c699 flags:# currency:string amount:long crypto_currency:string crypto_amount:long transaction_id:flags.0?string = MessageAction;
messageActionSuggestBirthday#2c8f2a25 birthday:Birthday = MessageAction;
dialog#d58a08c6 flags:# pinned:flags.2?true unread_mark:flags.3?true view_forum_as_messages:flags.6?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?int ttl_period:flags.5?int = Dialog;
dialogFolder#71bd134c flags:# pinned:flags.2?true folder:Folder peer:Peer top_message:int unread_muted_peers_count:int unread_unmuted_peers_count:int unread_muted_messages_count:int unread_unmuted_messages_count:int = Dialog;
@@ -398,7 +418,7 @@ auth.sentCode#5e002502 flags:# type:auth.SentCodeType phone_code_hash:string nex
auth.sentCodeSuccess#2390fe44 authorization:auth.Authorization = auth.SentCode;
auth.sentCodePaymentRequired#d7cef980 store_product:string phone_code_hash:string = auth.SentCode;
auth.sentCodePaymentRequired#e0955a3c store_product:string phone_code_hash:string support_email_address:string support_email_subject:string currency:string amount:long = auth.SentCode;
auth.authorization#2ea2c0d4 flags:# setup_password_required:flags.1?true otherwise_relogin_days:flags.1?int tmp_sessions:flags.0?int future_auth_token:flags.2?bytes user:User = auth.Authorization;
@@ -446,7 +466,7 @@ inputReportReasonIllegalDrugs#a8eb2be = ReportReason;
inputReportReasonPersonalDetails#9ec7863d = ReportReason;
userFull#99e78045 flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true voice_messages_forbidden:flags.20?true translations_disabled:flags.23?true stories_pinned_available:flags.26?true blocked_my_stories_from:flags.27?true wallpaper_overridden:flags.28?true contact_require_premium:flags.29?true read_dates_private:flags.30?true flags2:# sponsored_enabled:flags2.7?true can_view_revenue:flags2.9?true bot_can_manage_emoji_status:flags2.10?true display_gifts_button:flags2.16?true id:long about:flags.1?string settings:PeerSettings personal_photo:flags.21?Photo profile_photo:flags.2?Photo fallback_photo:flags.22?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int theme_emoticon:flags.15?string private_forward_name:flags.16?string bot_group_admin_rights:flags.17?ChatAdminRights bot_broadcast_admin_rights:flags.18?ChatAdminRights wallpaper:flags.24?WallPaper stories:flags.25?PeerStories business_work_hours:flags2.0?BusinessWorkHours business_location:flags2.1?BusinessLocation business_greeting_message:flags2.2?BusinessGreetingMessage business_away_message:flags2.3?BusinessAwayMessage business_intro:flags2.4?BusinessIntro birthday:flags2.5?Birthday personal_channel_id:flags2.6?long personal_channel_message:flags2.6?int stargifts_count:flags2.8?int starref_program:flags2.11?StarRefProgram bot_verification:flags2.12?BotVerification send_paid_messages_stars:flags2.14?long disallowed_gifts:flags2.15?DisallowedGiftsSettings = UserFull;
userFull#a02bc13e flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true voice_messages_forbidden:flags.20?true translations_disabled:flags.23?true stories_pinned_available:flags.26?true blocked_my_stories_from:flags.27?true wallpaper_overridden:flags.28?true contact_require_premium:flags.29?true read_dates_private:flags.30?true flags2:# sponsored_enabled:flags2.7?true can_view_revenue:flags2.9?true bot_can_manage_emoji_status:flags2.10?true display_gifts_button:flags2.16?true id:long about:flags.1?string settings:PeerSettings personal_photo:flags.21?Photo profile_photo:flags.2?Photo fallback_photo:flags.22?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int theme:flags.15?ChatTheme private_forward_name:flags.16?string bot_group_admin_rights:flags.17?ChatAdminRights bot_broadcast_admin_rights:flags.18?ChatAdminRights wallpaper:flags.24?WallPaper stories:flags.25?PeerStories business_work_hours:flags2.0?BusinessWorkHours business_location:flags2.1?BusinessLocation business_greeting_message:flags2.2?BusinessGreetingMessage business_away_message:flags2.3?BusinessAwayMessage business_intro:flags2.4?BusinessIntro birthday:flags2.5?Birthday personal_channel_id:flags2.6?long personal_channel_message:flags2.6?int stargifts_count:flags2.8?int starref_program:flags2.11?StarRefProgram bot_verification:flags2.12?BotVerification send_paid_messages_stars:flags2.14?long disallowed_gifts:flags2.15?DisallowedGiftsSettings stars_rating:flags2.17?StarsRating stars_my_pending_rating:flags2.18?StarsRating stars_my_pending_rating_date:flags2.18?int main_tab:flags2.20?ProfileTab saved_music:flags2.21?Document note:flags2.22?TextWithEntities = UserFull;
contact#145ade0b user_id:long mutual:Bool = Contact;
@@ -470,9 +490,9 @@ messages.dialogsSlice#71e094f3 count:int dialogs:Vector<Dialog> messages:Vector<
messages.dialogsNotModified#f0e3e596 count:int = messages.Dialogs;
messages.messages#8c718e87 messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
messages.messages#1d73e7ea messages:Vector<Message> topics:Vector<ForumTopic> chats:Vector<Chat> users:Vector<User> = messages.Messages;
messages.messagesSlice#3a54685e flags:# inexact:flags.1?true count:int next_rate:flags.0?int offset_id_offset:flags.2?int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
messages.messagesSlice#5f206716 flags:# inexact:flags.1?true count:int next_rate:flags.0?int offset_id_offset:flags.2?int search_flood:flags.3?SearchPostsFlood messages:Vector<Message> topics:Vector<ForumTopic> chats:Vector<Chat> users:Vector<User> = messages.Messages;
messages.channelMessages#c776ba4e flags:# inexact:flags.1?true pts:int count:int offset_id_offset:flags.2?int messages:Vector<Message> topics:Vector<ForumTopic> chats:Vector<Chat> users:Vector<User> = messages.Messages;
@@ -526,7 +546,7 @@ updateMessageID#4e90bfd6 id:int random_id:long = Update;
updateDeleteMessages#a20db0e5 messages:Vector<int> pts:int pts_count:int = Update;
updateUserTyping#c01e857f user_id:long action:SendMessageAction = Update;
updateUserTyping#2a17bf5c flags:# user_id:long top_msg_id:flags.0?int action:SendMessageAction = Update;
updateChatUserTyping#83487af0 chat_id:long from_id:Peer action:SendMessageAction = Update;
@@ -560,7 +580,7 @@ updatePrivacy#ee3b272a key:PrivacyKey rules:Vector<PrivacyRule> = 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;
updateReadHistoryInbox#9e84bc99 flags:# folder_id:flags.0?int peer:Peer top_msg_id:flags.1?int max_id:int still_unread_count:int pts:int pts_count:int = Update;
updateReadHistoryOutbox#2f2f21bf peer:Peer max_id:int pts:int pts_count:int = Update;
@@ -692,7 +712,7 @@ updateChat#f89a6a4e chat_id:long = Update;
updateGroupCallParticipants#f2ebdb4e call:InputGroupCall participants:Vector<GroupCallParticipant> version:int = Update;
updateGroupCall#97d64341 flags:# chat_id:flags.0?long call:GroupCall = Update;
updateGroupCall#9d2216e0 flags:# live_story:flags.2?true peer:flags.1?Peer call:GroupCall = Update;
updatePeerHistoryTTL#bb9bb9a5 flags:# peer:Peer ttl_period:flags.0?int = Update;
@@ -734,10 +754,6 @@ updateMoveStickerSetToTop#86fccf85 flags:# masks:flags.0?true emojis:flags.1?tru
updateMessageExtendedMedia#d5a41724 peer:Peer msg_id:int extended_media:Vector<MessageExtendedMedia> = Update;
updateChannelPinnedTopic#192efbe3 flags:# pinned:flags.0?true channel_id:long topic_id:int = Update;
updateChannelPinnedTopics#fe198602 flags:# channel_id:long order:flags.0?Vector<int> = Update;
updateUser#20529438 user_id:long = Update;
updateAutoSaveSettings#ec05b097 = Update;
@@ -790,8 +806,6 @@ updateBotDeleteBusinessMessage#a02a982e connection_id:string peer:Peer messages:
updateNewStoryReaction#1824e40b story_id:int peer:Peer reaction:Reaction = Update;
updateBroadcastRevenueTransactions#dfd961f5 peer:Peer balances:BroadcastRevenueBalances = Update;
updateStarsBalance#4e80a379 balance:StarsAmount = Update;
updateBusinessBotCallbackQuery#1ea2fda7 flags:# query_id:long user_id:long connection_id:string message:Message reply_to_message:flags.2?Message chat_instance:long data:flags.0?bytes = Update;
@@ -810,6 +824,18 @@ updateReadMonoForumInbox#77b0e372 channel_id:long saved_peer_id:Peer read_max_id
updateReadMonoForumOutbox#a4a79376 channel_id:long saved_peer_id:Peer read_max_id:int = Update;
updateMonoForumNoPaidException#9f812b08 flags:# exception:flags.0?true channel_id:long saved_peer_id:Peer = Update;
updateGroupCallMessage#d8326f0d call:InputGroupCall message:GroupCallMessage = Update;
updateGroupCallEncryptedMessage#c957a766 call:InputGroupCall from_id:Peer encrypted_message:bytes = Update;
updatePinnedForumTopic#683b2c52 flags:# pinned:flags.0?true peer:Peer topic_id:int = Update;
updatePinnedForumTopics#def143d0 flags:# peer:Peer order:flags.0?Vector<int> = Update;
updateDeleteGroupCallMessages#3e85e92c call:InputGroupCall messages:Vector<int> = Update;
updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;
updates.differenceEmpty#5d75a138 date:int seq:int = updates.Difference;
@@ -948,6 +974,8 @@ sendMessageEmojiInteraction#25972bcb emoticon:string msg_id:int interaction:Data
sendMessageEmojiInteractionSeen#b665902e emoticon:string = SendMessageAction;
sendMessageTextDraftAction#376d975c random_id:long text:TextWithEntities = SendMessageAction;
contacts.found#b3134d9d my_results:Vector<Peer> results:Vector<Peer> chats:Vector<Chat> users:Vector<User> = contacts.Found;
inputPrivacyKeyStatusTimestamp#4f96cb18 = InputPrivacyKey;
@@ -976,6 +1004,8 @@ inputPrivacyKeyStarGiftsAutoSave#e1732341 = InputPrivacyKey;
inputPrivacyKeyNoPaidMessages#bdc597b4 = InputPrivacyKey;
inputPrivacyKeySavedMusic#4dbe9226 = InputPrivacyKey;
privacyKeyStatusTimestamp#bc2eab30 = PrivacyKey;
privacyKeyChatInvite#500e6dfa = PrivacyKey;
@@ -1002,6 +1032,8 @@ privacyKeyStarGiftsAutoSave#2ca4fdf8 = PrivacyKey;
privacyKeyNoPaidMessages#17d348d2 = PrivacyKey;
privacyKeySavedMusic#ff7a571b = PrivacyKey;
inputPrivacyValueAllowContacts#d09e07b = InputPrivacyRule;
inputPrivacyValueAllowAll#184b35ce = InputPrivacyRule;
@@ -1136,6 +1168,8 @@ inputStickerSetEmojiDefaultTopicIcons#44c1f8e9 = InputStickerSet;
inputStickerSetEmojiChannelDefaultStatuses#49748553 = InputStickerSet;
inputStickerSetTonGifts#1cf671a0 = InputStickerSet;
stickerSet#2dd14edc flags:# archived:flags.1?true official:flags.2?true masks:flags.3?true emojis:flags.7?true text_color:flags.9?true channel_emoji_status:flags.10?true creator:flags.11?true installed_date:flags.0?int id:long access_hash:long title:string short_name:string thumbs:flags.4?Vector<PhotoSize> thumb_dc_id:flags.4?int thumb_version:flags.4?int thumb_document_id:flags.8?long count:int hash:int = StickerSet;
messages.stickerSet#6e153f16 set:StickerSet packs:Vector<StickerPack> keywords:Vector<StickerKeyword> documents:Vector<Document> = messages.StickerSet;
@@ -1416,7 +1450,7 @@ contacts.topPeersDisabled#b52c939d = contacts.TopPeers;
draftMessageEmpty#1b0c841a flags:# date:flags.0?int = DraftMessage;
draftMessage#2d65321f flags:# no_webpage:flags.1?true invert_media:flags.6?true reply_to:flags.4?InputReplyTo message:string entities:flags.3?Vector<MessageEntity> media:flags.5?InputMedia date:int effect:flags.7?long = DraftMessage;
draftMessage#96eaa5eb flags:# no_webpage:flags.1?true invert_media:flags.6?true reply_to:flags.4?InputReplyTo message:string entities:flags.3?Vector<MessageEntity> media:flags.5?InputMedia date:int effect:flags.7?long suggested_post:flags.8?SuggestedPost = DraftMessage;
messages.featuredStickersNotModified#c6dc0c66 count:int = messages.FeaturedStickers;
@@ -1970,7 +2004,7 @@ chatOnlines#f041e250 onlines:int = ChatOnlines;
statsURL#47a971e0 url:string = StatsURL;
chatAdminRights#5fb224d5 flags:# change_info:flags.0?true post_messages:flags.1?true edit_messages:flags.2?true delete_messages:flags.3?true ban_users:flags.4?true invite_users:flags.5?true pin_messages:flags.7?true add_admins:flags.9?true anonymous:flags.10?true manage_call:flags.11?true other:flags.12?true manage_topics:flags.13?true post_stories:flags.14?true edit_stories:flags.15?true delete_stories:flags.16?true = ChatAdminRights;
chatAdminRights#5fb224d5 flags:# change_info:flags.0?true post_messages:flags.1?true edit_messages:flags.2?true delete_messages:flags.3?true ban_users:flags.4?true invite_users:flags.5?true pin_messages:flags.7?true add_admins:flags.9?true anonymous:flags.10?true manage_call:flags.11?true other:flags.12?true manage_topics:flags.13?true post_stories:flags.14?true edit_stories:flags.15?true delete_stories:flags.16?true manage_direct_messages:flags.17?true = ChatAdminRights;
chatBannedRights#9f120418 flags:# view_messages:flags.0?true send_messages:flags.1?true send_media:flags.2?true send_stickers:flags.3?true send_gifs:flags.4?true send_games:flags.5?true send_inline:flags.6?true embed_links:flags.7?true send_polls:flags.8?true change_info:flags.10?true invite_users:flags.15?true pin_messages:flags.17?true manage_topics:flags.18?true send_photos:flags.19?true send_videos:flags.20?true send_roundvideos:flags.21?true send_audios:flags.22?true send_voices:flags.23?true send_docs:flags.24?true send_plain:flags.25?true until_date:int = ChatBannedRights;
@@ -2068,6 +2102,8 @@ webPageAttributeStickerSet#50cc03d3 flags:# emojis:flags.0?true text_color:flags
webPageAttributeUniqueStarGift#cf6f6db8 gift:StarGift = WebPageAttribute;
webPageAttributeStarGiftCollection#31cad303 icons:Vector<Document> = WebPageAttribute;
messages.votesList#4899484e flags:# count:int votes:Vector<MessagePeerVote> chats:Vector<Chat> users:Vector<User> next_offset:flags.0?string = messages.VotesList;
bankCardOpenUrl#f568028a url:string name:string = BankCardOpenUrl;
@@ -2130,7 +2166,7 @@ messages.messageViews#b6c4f543 views:Vector<MessageViews> chats:Vector<Chat> use
messages.discussionMessage#a6341782 flags:# messages:Vector<Message> max_id:flags.0?int read_inbox_max_id:flags.1?int read_outbox_max_id:flags.2?int unread_count:int chats:Vector<Chat> users:Vector<User> = messages.DiscussionMessage;
messageReplyHeader#afbc09db flags:# reply_to_scheduled:flags.2?true forum_topic:flags.3?true quote:flags.9?true reply_to_msg_id:flags.4?int reply_to_peer_id:flags.0?Peer reply_from:flags.5?MessageFwdHeader reply_media:flags.8?MessageMedia reply_to_top_id:flags.1?int quote_text:flags.6?string quote_entities:flags.7?Vector<MessageEntity> quote_offset:flags.10?int = MessageReplyHeader;
messageReplyHeader#6917560b flags:# reply_to_scheduled:flags.2?true forum_topic:flags.3?true quote:flags.9?true reply_to_msg_id:flags.4?int reply_to_peer_id:flags.0?Peer reply_from:flags.5?MessageFwdHeader reply_media:flags.8?MessageMedia reply_to_top_id:flags.1?int quote_text:flags.6?string quote_entities:flags.7?Vector<MessageEntity> quote_offset:flags.10?int todo_item_id:flags.11?int = MessageReplyHeader;
messageReplyStoryHeader#e5af939 peer:Peer story_id:int = MessageReplyHeader;
@@ -2142,7 +2178,7 @@ stats.messageStats#7fe91c14 views_graph:StatsGraph reactions_by_emotion_graph:St
groupCallDiscarded#7780bcb4 id:long access_hash:long duration:int = GroupCall;
groupCall#553b0ba1 flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true join_date_asc:flags.6?true schedule_start_subscribed:flags.8?true can_start_video:flags.9?true record_video_active:flags.11?true rtmp_stream:flags.12?true listeners_hidden:flags.13?true conference:flags.14?true creator:flags.15?true id:long access_hash:long participants_count:int title:flags.3?string stream_dc_id:flags.4?int record_start_date:flags.5?int schedule_date:flags.7?int unmuted_video_count:flags.10?int unmuted_video_limit:int version:int invite_link:flags.16?string = GroupCall;
groupCall#efb2b617 flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true join_date_asc:flags.6?true schedule_start_subscribed:flags.8?true can_start_video:flags.9?true record_video_active:flags.11?true rtmp_stream:flags.12?true listeners_hidden:flags.13?true conference:flags.14?true creator:flags.15?true messages_enabled:flags.17?true can_change_messages_enabled:flags.18?true min:flags.19?true id:long access_hash:long participants_count:int title:flags.3?string stream_dc_id:flags.4?int record_start_date:flags.5?int schedule_date:flags.7?int unmuted_video_count:flags.10?int unmuted_video_limit:int version:int invite_link:flags.16?string send_paid_messages_stars:flags.20?long default_send_as:flags.21?Peer = GroupCall;
inputGroupCall#d8aa840f id:long access_hash:long = InputGroupCall;
@@ -2150,7 +2186,7 @@ inputGroupCallSlug#fe06823f slug:string = InputGroupCall;
inputGroupCallInviteMessage#8c10603f msg_id:int = InputGroupCall;
groupCallParticipant#eba636fe flags:# muted:flags.0?true left:flags.1?true can_self_unmute:flags.2?true just_joined:flags.4?true versioned:flags.5?true min:flags.8?true muted_by_you:flags.9?true volume_by_admin:flags.10?true self:flags.12?true video_joined:flags.15?true peer:Peer date:int active_date:flags.3?int source:int volume:flags.7?int about:flags.11?string raise_hand_rating:flags.13?long video:flags.6?GroupCallParticipantVideo presentation:flags.14?GroupCallParticipantVideo = GroupCallParticipant;
groupCallParticipant#2a3dc7ac flags:# muted:flags.0?true left:flags.1?true can_self_unmute:flags.2?true just_joined:flags.4?true versioned:flags.5?true min:flags.8?true muted_by_you:flags.9?true volume_by_admin:flags.10?true self:flags.12?true video_joined:flags.15?true peer:Peer date:int active_date:flags.3?int source:int volume:flags.7?int about:flags.11?string raise_hand_rating:flags.13?long video:flags.6?GroupCallParticipantVideo presentation:flags.14?GroupCallParticipantVideo paid_stars_total:flags.16?long = GroupCallParticipant;
phone.groupCall#9e727aad call:GroupCall participants:Vector<GroupCallParticipant> participants_next_offset:string chats:Vector<Chat> users:Vector<User> = phone.GroupCall;
@@ -2220,9 +2256,17 @@ account.resetPasswordRequestedWait#e9effc7d until_date:int = account.ResetPasswo
account.resetPasswordOk#e926d63e = account.ResetPasswordResult;
sponsoredMessage#4d93a990 flags:# recommended:flags.5?true can_report:flags.12?true random_id:bytes url:string title:string message:string entities:flags.1?Vector<MessageEntity> photo:flags.6?Photo media:flags.14?MessageMedia color:flags.13?PeerColor button_text:string sponsor_info:flags.7?string additional_info:flags.8?string = SponsoredMessage;
chatTheme#c3dffc04 emoticon:string = ChatTheme;
messages.sponsoredMessages#c9ee1d87 flags:# posts_between:flags.0?int messages:Vector<SponsoredMessage> chats:Vector<Chat> users:Vector<User> = messages.SponsoredMessages;
chatThemeUniqueGift#3458f9c8 gift:StarGift theme_settings:Vector<ThemeSettings> = ChatTheme;
account.chatThemesNotModified#e011e1c4 = account.ChatThemes;
account.chatThemes#be098173 flags:# hash:long themes:Vector<ChatTheme> chats:Vector<Chat> users:Vector<User> next_offset:flags.0?string = account.ChatThemes;
sponsoredMessage#7dbf8673 flags:# recommended:flags.5?true can_report:flags.12?true random_id:bytes url:string title:string message:string entities:flags.1?Vector<MessageEntity> photo:flags.6?Photo media:flags.14?MessageMedia color:flags.13?PeerColor button_text:string sponsor_info:flags.7?string additional_info:flags.8?string min_display_duration:flags.15?int max_display_duration:flags.15?int = SponsoredMessage;
messages.sponsoredMessages#ffda656d flags:# posts_between:flags.0?int start_delay:flags.1?int between_delay:flags.2?int messages:Vector<SponsoredMessage> chats:Vector<Chat> users:Vector<User> = messages.SponsoredMessages;
messages.sponsoredMessagesEmpty#1839490f = messages.SponsoredMessages;
@@ -2330,7 +2374,13 @@ inputInvoicePremiumGiftStars#dabab2ef flags:# user_id:InputUser months:int messa
inputInvoiceBusinessBotTransferStars#f4997e42 bot:InputUser stars:long = InputInvoice;
inputInvoiceStarGiftResale#63cbc38c slug:string to_id:InputPeer = InputInvoice;
inputInvoiceStarGiftResale#c39f5324 flags:# ton:flags.0?true slug:string to_id:InputPeer = InputInvoice;
inputInvoiceStarGiftPrepaidUpgrade#9a0b48b8 peer:InputPeer hash:string = InputInvoice;
inputInvoicePremiumAuthCode#3e77f614 purpose:InputStorePaymentPurpose = InputInvoice;
inputInvoiceStarGiftDropOriginalDetails#923d8d1 stargift:InputSavedStarGift = InputInvoice;
payments.exportedInvoice#aed0cbd9 url:string = payments.ExportedInvoice;
@@ -2346,7 +2396,7 @@ inputStorePaymentPremiumGiftCode#fb790393 flags:# users:Vector<InputUser> boost_
inputStorePaymentPremiumGiveaway#160544ca flags:# only_new_subscribers:flags.0?true winners_are_visible:flags.3?true boost_peer:InputPeer additional_peers:flags.1?Vector<InputPeer> countries_iso2:flags.2?Vector<string> prize_description:flags.4?string random_id:long until_date:int currency:string amount:long = InputStorePaymentPurpose;
inputStorePaymentStarsTopup#dddd0f56 stars:long currency:string amount:long = InputStorePaymentPurpose;
inputStorePaymentStarsTopup#f9a2a6cb flags:# stars:long currency:string amount:long spend_purpose_peer:flags.0?InputPeer = InputStorePaymentPurpose;
inputStorePaymentStarsGift#1d741ef7 user_id:InputUser stars:long currency:string amount:long = InputStorePaymentPurpose;
@@ -2416,7 +2466,7 @@ username#b4073647 flags:# editable:flags.0?true active:flags.1?true username:str
forumTopicDeleted#23f109b id:int = ForumTopic;
forumTopic#71701da9 flags:# my:flags.1?true closed:flags.2?true pinned:flags.3?true short:flags.5?true hidden:flags.6?true id:int date:int title:string icon_color:int icon_emoji_id:flags.0?long top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int from_id:Peer notify_settings:PeerNotifySettings draft:flags.4?DraftMessage = ForumTopic;
forumTopic#cdff0eca flags:# my:flags.1?true closed:flags.2?true pinned:flags.3?true short:flags.5?true hidden:flags.6?true title_missing:flags.7?true id:int date:int peer:Peer title:string icon_color:int icon_emoji_id:flags.0?long top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int from_id:Peer notify_settings:PeerNotifySettings draft:flags.4?DraftMessage = ForumTopic;
messages.forumTopics#367617d3 flags:# order_by_create_date:flags.0?true count:int topics:Vector<ForumTopic> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> pts:int = messages.ForumTopics;
@@ -2498,9 +2548,9 @@ storyViews#8d595cd6 flags:# has_viewers:flags.1?true views_count:int forwards_co
storyItemDeleted#51e6ee4f id:int = StoryItem;
storyItemSkipped#ffadc913 flags:# close_friends:flags.8?true id:int date:int expire_date:int = StoryItem;
storyItemSkipped#ffadc913 flags:# close_friends:flags.8?true live:flags.9?true id:int date:int expire_date:int = StoryItem;
storyItem#79b26a24 flags:# pinned:flags.5?true public:flags.7?true close_friends:flags.8?true min:flags.9?true noforwards:flags.10?true edited:flags.11?true contacts:flags.12?true selected_contacts:flags.13?true out:flags.16?true id:int date:int from_id:flags.18?Peer fwd_from:flags.17?StoryFwdHeader expire_date:int caption:flags.0?string entities:flags.1?Vector<MessageEntity> media:MessageMedia media_areas:flags.14?Vector<MediaArea> privacy:flags.2?Vector<PrivacyRule> views:flags.3?StoryViews sent_reaction:flags.15?Reaction = StoryItem;
storyItem#edf164f1 flags:# pinned:flags.5?true public:flags.7?true close_friends:flags.8?true min:flags.9?true noforwards:flags.10?true edited:flags.11?true contacts:flags.12?true selected_contacts:flags.13?true out:flags.16?true id:int date:int from_id:flags.18?Peer fwd_from:flags.17?StoryFwdHeader expire_date:int caption:flags.0?string entities:flags.1?Vector<MessageEntity> media:MessageMedia media_areas:flags.14?Vector<MediaArea> privacy:flags.2?Vector<PrivacyRule> views:flags.3?StoryViews sent_reaction:flags.15?Reaction albums:flags.19?Vector<int> = StoryItem;
stories.allStoriesNotModified#1158fe3e flags:# state:string stealth_mode:StoriesStealthMode = stories.AllStories;
@@ -2518,7 +2568,7 @@ stories.storyViewsList#59d78fc5 flags:# count:int views_count:int forwards_count
stories.storyViews#de9eed1d views:Vector<StoryViews> users:Vector<User> = stories.StoryViews;
inputReplyToMessage#b07038b0 flags:# reply_to_msg_id:int top_msg_id:flags.0?int reply_to_peer_id:flags.1?InputPeer quote_text:flags.2?string quote_entities:flags.3?Vector<MessageEntity> quote_offset:flags.4?int monoforum_peer_id:flags.5?InputPeer = InputReplyTo;
inputReplyToMessage#869fbe10 flags:# reply_to_msg_id:int top_msg_id:flags.0?int reply_to_peer_id:flags.1?InputPeer quote_text:flags.2?string quote_entities:flags.3?Vector<MessageEntity> quote_offset:flags.4?int monoforum_peer_id:flags.5?InputPeer todo_item_id:flags.6?int = InputReplyTo;
inputReplyToStory#5881323a peer:InputPeer story_id:int = InputReplyTo;
@@ -2556,7 +2606,7 @@ messages.webPage#fd5e12bd webpage:WebPage chats:Vector<Chat> users:Vector<User>
premiumGiftCodeOption#257e962b flags:# users:int months:int store_product:flags.0?string store_quantity:flags.1?int currency:string amount:long = PremiumGiftCodeOption;
payments.checkedGiftCode#284a1096 flags:# via_giveaway:flags.2?true from_id:flags.4?Peer giveaway_msg_id:flags.3?int to_id:flags.0?long date:int months:int used_date:flags.1?int chats:Vector<Chat> users:Vector<User> = payments.CheckedGiftCode;
payments.checkedGiftCode#eb983f8f flags:# via_giveaway:flags.2?true from_id:flags.4?Peer giveaway_msg_id:flags.3?int to_id:flags.0?long date:int days:int used_date:flags.1?int chats:Vector<Chat> users:Vector<User> = payments.CheckedGiftCode;
payments.giveawayInfo#4367daa0 flags:# participating:flags.0?true preparing_results:flags.3?true start_date:int joined_too_early_date:flags.1?int admin_disallowed_chat_id:flags.2?long disallowed_country:flags.4?string = payments.GiveawayInfo;
@@ -2592,6 +2642,10 @@ stats.publicForwards#93037e20 flags:# count:int forwards:Vector<PublicForward> n
peerColor#b54b5acf flags:# color:flags.0?int background_emoji_id:flags.1?long = PeerColor;
peerColorCollectible#b9c0639a flags:# collectible_id:long gift_emoji_id:long background_emoji_id:long accent_color:int colors:Vector<int> dark_accent_color:flags.0?int dark_colors:flags.1?Vector<int> = PeerColor;
inputPeerColorCollectible#b8ea86a9 collectible_id:long = PeerColor;
help.peerColorSet#26219a58 colors:Vector<int> = help.PeerColorSet;
help.peerColorProfileSet#767d61eb palette_colors:Vector<int> bg_colors:Vector<int> story_colors:Vector<int> = help.PeerColorSet;
@@ -2612,7 +2666,7 @@ stories.storyReactionsList#aa5f789c flags:# count:int reactions:Vector<StoryReac
savedDialog#bd87cb6c flags:# pinned:flags.2?true peer:Peer top_message:int = SavedDialog;
monoForumDialog#64407ea7 flags:# unread_mark:flags.3?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_reactions_count:int draft:flags.1?DraftMessage = SavedDialog;
monoForumDialog#64407ea7 flags:# unread_mark:flags.3?true nopaid_messages_exception:flags.4?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_reactions_count:int draft:flags.1?DraftMessage = SavedDialog;
messages.savedDialogs#f83ae221 dialogs:Vector<SavedDialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.SavedDialogs;
@@ -2730,26 +2784,12 @@ channels.sponsoredMessageReportResultAdsHidden#3e3bcf2f = channels.SponsoredMess
channels.sponsoredMessageReportResultReported#ad798849 = channels.SponsoredMessageReportResult;
stats.broadcastRevenueStats#5407e297 top_hours_graph:StatsGraph revenue_graph:StatsGraph balances:BroadcastRevenueBalances usd_rate:double = stats.BroadcastRevenueStats;
stats.broadcastRevenueWithdrawalUrl#ec659737 url:string = stats.BroadcastRevenueWithdrawalUrl;
broadcastRevenueTransactionProceeds#557e2cc4 amount:long from_date:int to_date:int = BroadcastRevenueTransaction;
broadcastRevenueTransactionWithdrawal#5a590978 flags:# pending:flags.0?true failed:flags.2?true amount:long date:int provider:string transaction_date:flags.1?int transaction_url:flags.1?string = BroadcastRevenueTransaction;
broadcastRevenueTransactionRefund#42d30d2e amount:long date:int provider:string = BroadcastRevenueTransaction;
stats.broadcastRevenueTransactions#87158466 count:int transactions:Vector<BroadcastRevenueTransaction> = stats.BroadcastRevenueTransactions;
reactionNotificationsFromContacts#bac3a61a = ReactionNotificationsFrom;
reactionNotificationsFromAll#4b9e22a0 = ReactionNotificationsFrom;
reactionsNotifySettings#56e34970 flags:# messages_notify_from:flags.0?ReactionNotificationsFrom stories_notify_from:flags.1?ReactionNotificationsFrom sound:NotificationSound show_previews:Bool = ReactionsNotifySettings;
broadcastRevenueBalances#c3ff71e7 flags:# withdrawal_enabled:flags.0?true current_balance:long available_balance:long overall_revenue:long = BroadcastRevenueBalances;
availableEffect#93c3e27e flags:# premium_required:flags.2?true id:long emoticon:string static_icon_id:flags.0?long effect_sticker_id:long effect_animation_id:flags.1?long = AvailableEffect;
messages.availableEffectsNotModified#d1ed9a5b = messages.AvailableEffects;
@@ -2776,7 +2816,7 @@ starsTransactionPeerAPI#f9677aad = StarsTransactionPeer;
starsTopupOption#bd915c0 flags:# extended:flags.1?true stars:long store_product:flags.0?string currency:string amount:long = StarsTopupOption;
starsTransaction#a39fd94a flags:# refund:flags.3?true pending:flags.4?true failed:flags.6?true gift:flags.10?true reaction:flags.11?true stargift_upgrade:flags.18?true business_transfer:flags.21?true stargift_resale:flags.22?true id:string stars:StarsAmount date:int peer:StarsTransactionPeer title:flags.0?string description:flags.1?string photo:flags.2?WebDocument transaction_date:flags.5?int transaction_url:flags.5?string bot_payload:flags.7?bytes msg_id:flags.8?int extended_media:flags.9?Vector<MessageMedia> subscription_period:flags.12?int giveaway_post_id:flags.13?int stargift:flags.14?StarGift floodskip_number:flags.15?int starref_commission_permille:flags.16?int starref_peer:flags.17?Peer starref_amount:flags.17?StarsAmount paid_messages:flags.19?int premium_gift_months:flags.20?int = StarsTransaction;
starsTransaction#13659eb0 flags:# refund:flags.3?true pending:flags.4?true failed:flags.6?true gift:flags.10?true reaction:flags.11?true stargift_upgrade:flags.18?true business_transfer:flags.21?true stargift_resale:flags.22?true posts_search:flags.24?true stargift_prepaid_upgrade:flags.25?true stargift_drop_original_details:flags.26?true phonegroup_message:flags.27?true id:string amount:StarsAmount date:int peer:StarsTransactionPeer title:flags.0?string description:flags.1?string photo:flags.2?WebDocument transaction_date:flags.5?int transaction_url:flags.5?string bot_payload:flags.7?bytes msg_id:flags.8?int extended_media:flags.9?Vector<MessageMedia> subscription_period:flags.12?int giveaway_post_id:flags.13?int stargift:flags.14?StarGift floodskip_number:flags.15?int starref_commission_permille:flags.16?int starref_peer:flags.17?Peer starref_amount:flags.17?StarsAmount paid_messages:flags.19?int premium_gift_months:flags.20?int ads_proceeds_from_date:flags.23?int ads_proceeds_to_date:flags.23?int = StarsTransaction;
payments.starsStatus#6c9ce8ed flags:# balance:StarsAmount subscriptions:flags.1?Vector<StarsSubscription> subscriptions_next_offset:flags.2?string subscriptions_missing_balance:flags.4?long history:flags.3?Vector<StarsTransaction> next_offset:flags.0?string chats:Vector<Chat> users:Vector<User> = payments.StarsStatus;
@@ -2788,7 +2828,7 @@ geoPointAddress#de4c5d93 flags:# country_iso2:string state:flags.0?string city:f
starsRevenueStatus#febe5491 flags:# withdrawal_enabled:flags.0?true current_balance:StarsAmount available_balance:StarsAmount overall_revenue:StarsAmount next_withdrawal_at:flags.1?int = StarsRevenueStatus;
payments.starsRevenueStats#c92bb73b revenue_graph:StatsGraph status:StarsRevenueStatus usd_rate:double = payments.StarsRevenueStats;
payments.starsRevenueStats#6c207376 flags:# top_hours_graph:flags.0?StatsGraph revenue_graph:StatsGraph status:StarsRevenueStatus usd_rate:double = payments.StarsRevenueStats;
payments.starsRevenueWithdrawalUrl#1dab80b7 url:string = payments.StarsRevenueWithdrawalUrl;
@@ -2814,13 +2854,13 @@ starsGiveawayOption#94ce852a flags:# extended:flags.0?true default:flags.1?true
starsGiveawayWinnersOption#54236209 flags:# default:flags.0?true users:int per_user_stars:long = StarsGiveawayWinnersOption;
starGift#c62aca28 flags:# limited:flags.0?true sold_out:flags.1?true birthday:flags.2?true id:long sticker:Document stars:long availability_remains:flags.0?int availability_total:flags.0?int availability_resale:flags.4?long convert_stars:long first_sale_date:flags.1?int last_sale_date:flags.1?int upgrade_stars:flags.3?long resell_min_stars:flags.4?long title:flags.5?string = StarGift;
starGift#80ac53c3 flags:# limited:flags.0?true sold_out:flags.1?true birthday:flags.2?true require_premium:flags.7?true limited_per_user:flags.8?true peer_color_available:flags.10?true id:long sticker:Document stars:long availability_remains:flags.0?int availability_total:flags.0?int availability_resale:flags.4?long convert_stars:long first_sale_date:flags.1?int last_sale_date:flags.1?int upgrade_stars:flags.3?long resell_min_stars:flags.4?long title:flags.5?string released_by:flags.6?Peer per_user_total:flags.8?int per_user_remains:flags.8?int locked_until_date:flags.9?int = StarGift;
starGiftUnique#6411db89 flags:# id:long title:string slug:string num:int owner_id:flags.0?Peer owner_name:flags.1?string owner_address:flags.2?string attributes:Vector<StarGiftAttribute> availability_issued:int availability_total:int gift_address:flags.3?string resell_stars:flags.4?long = StarGift;
starGiftUnique#b0bf741b flags:# require_premium:flags.6?true resale_ton_only:flags.7?true theme_available:flags.9?true id:long gift_id:long title:string slug:string num:int owner_id:flags.0?Peer owner_name:flags.1?string owner_address:flags.2?string attributes:Vector<StarGiftAttribute> availability_issued:int availability_total:int gift_address:flags.3?string resell_amount:flags.4?Vector<StarsAmount> released_by:flags.5?Peer value_amount:flags.8?long value_currency:flags.8?string theme_peer:flags.10?Peer peer_color:flags.11?PeerColor host_id:flags.12?Peer = StarGift;
payments.starGiftsNotModified#a388a368 = payments.StarGifts;
payments.starGifts#901689ea hash:int gifts:Vector<StarGift> = payments.StarGifts;
payments.starGifts#2ed82995 hash:int gifts:Vector<StarGift> chats:Vector<Chat> users:Vector<User> = payments.StarGifts;
messageReportOption#7903e3d9 text:string option:bytes = MessageReportOption;
@@ -2846,6 +2886,8 @@ payments.suggestedStarRefBots#b4d5d859 flags:# count:int suggested_bots:Vector<S
starsAmount#bbb6b4a3 amount:long nanos:int = StarsAmount;
starsTonAmount#74aee3e0 amount:long = StarsAmount;
messages.foundStickersNotModified#6010c534 flags:# next_offset:flags.0?int = messages.FoundStickers;
messages.foundStickers#82c9e290 flags:# next_offset:flags.0?int hash:long stickers:Vector<Document> = messages.FoundStickers;
@@ -2862,17 +2904,17 @@ starGiftAttributeBackdrop#d93d859c name:string backdrop_id:int center_color:int
starGiftAttributeOriginalDetails#e0bff26c flags:# sender_id:flags.0?Peer recipient_id:Peer date:int message:flags.1?TextWithEntities = StarGiftAttribute;
payments.starGiftUpgradePreview#167bd90b sample_attributes:Vector<StarGiftAttribute> = payments.StarGiftUpgradePreview;
payments.starGiftUpgradePreview#3de1dfed sample_attributes:Vector<StarGiftAttribute> prices:Vector<StarGiftUpgradePrice> next_prices:Vector<StarGiftUpgradePrice> = payments.StarGiftUpgradePreview;
users.users#62d706b8 users:Vector<User> = users.Users;
users.usersSlice#315a4974 count:int users:Vector<User> = users.Users;
payments.uniqueStarGift#caa2f60b gift:StarGift users:Vector<User> = payments.UniqueStarGift;
payments.uniqueStarGift#416c56e8 gift:StarGift chats:Vector<Chat> users:Vector<User> = payments.UniqueStarGift;
messages.webPagePreview#b53e8b21 media:MessageMedia users:Vector<User> = messages.WebPagePreview;
messages.webPagePreview#8c9a88ac media:MessageMedia chats:Vector<Chat> users:Vector<User> = messages.WebPagePreview;
savedStarGift#dfda0499 flags:# name_hidden:flags.0?true unsaved:flags.5?true refunded:flags.9?true can_upgrade:flags.10?true pinned_to_top:flags.12?true from_id:flags.1?Peer date:int gift:StarGift message:flags.2?TextWithEntities msg_id:flags.3?int saved_id:flags.11?long convert_stars:flags.4?long upgrade_stars:flags.6?long can_export_at:flags.7?int transfer_stars:flags.8?long can_transfer_at:flags.13?int can_resell_at:flags.14?int = SavedStarGift;
savedStarGift#8983a452 flags:# name_hidden:flags.0?true unsaved:flags.5?true refunded:flags.9?true can_upgrade:flags.10?true pinned_to_top:flags.12?true upgrade_separate:flags.17?true from_id:flags.1?Peer date:int gift:StarGift message:flags.2?TextWithEntities msg_id:flags.3?int saved_id:flags.11?long convert_stars:flags.4?long upgrade_stars:flags.6?long can_export_at:flags.7?int transfer_stars:flags.8?long can_transfer_at:flags.13?int can_resell_at:flags.14?int collection_id:flags.15?Vector<int> prepaid_upgrade_hash:flags.16?string drop_original_details_stars:flags.18?long = SavedStarGift;
payments.savedStarGifts#95f389b1 flags:# count:int chat_notifications_enabled:flags.1?Bool gifts:Vector<SavedStarGift> next_offset:flags.0?string chats:Vector<Chat> users:Vector<User> = payments.SavedStarGifts;
@@ -2900,7 +2942,7 @@ requirementToContactPaidMessages#b4f67e93 stars_amount:long = RequirementToConta
businessBotRights#a0624cf7 flags:# reply:flags.0?true read_messages:flags.1?true delete_sent_messages:flags.2?true delete_received_messages:flags.3?true edit_name:flags.4?true edit_bio:flags.5?true edit_profile_photo:flags.6?true edit_username:flags.7?true view_gifts:flags.8?true sell_gifts:flags.9?true change_gift_settings:flags.10?true transfer_and_upgrade_gifts:flags.11?true transfer_stars:flags.12?true manage_stories:flags.13?true = BusinessBotRights;
disallowedGiftsSettings#71f276c4 flags:# disallow_unlimited_stargifts:flags.0?true disallow_limited_stargifts:flags.1?true disallow_unique_stargifts:flags.2?true disallow_premium_gifts:flags.3?true = DisallowedGiftsSettings;
disallowedGiftsSettings#71f276c4 flags:# disallow_unlimited_stargifts:flags.0?true disallow_limited_stargifts:flags.1?true disallow_unique_stargifts:flags.2?true disallow_premium_gifts:flags.3?true disallow_stargifts_from_channels:flags.4?true = DisallowedGiftsSettings;
sponsoredPeer#c69708d3 flags:# random_id:bytes peer:Peer sponsor_info:flags.0?string additional_info:flags.1?string = SponsoredPeer;
@@ -2922,6 +2964,76 @@ stories.canSendStoryCount#c387c04e count_remains:int = stories.CanSendStoryCount
pendingSuggestion#e7e82e12 suggestion:string title:TextWithEntities description:TextWithEntities url:string = PendingSuggestion;
todoItem#cba9a52f id:int title:TextWithEntities = TodoItem;
todoList#49b92a26 flags:# others_can_append:flags.0?true others_can_complete:flags.1?true title:TextWithEntities list:Vector<TodoItem> = TodoList;
todoCompletion#221bb5e4 id:int completed_by:Peer date:int = TodoCompletion;
suggestedPost#e8e37e5 flags:# accepted:flags.1?true rejected:flags.2?true price:flags.3?StarsAmount schedule_date:flags.0?int = SuggestedPost;
starsRating#1b0e4f07 flags:# level:int current_level_stars:long stars:long next_level_stars:flags.0?long = StarsRating;
starGiftCollection#9d6b13b0 flags:# collection_id:int title:string icon:flags.0?Document gifts_count:int hash:long = StarGiftCollection;
payments.starGiftCollectionsNotModified#a0ba4f17 = payments.StarGiftCollections;
payments.starGiftCollections#8a2932f3 collections:Vector<StarGiftCollection> = payments.StarGiftCollections;
storyAlbum#9325705a flags:# album_id:int title:string icon_photo:flags.0?Photo icon_video:flags.1?Document = StoryAlbum;
stories.albumsNotModified#564edaeb = stories.Albums;
stories.albums#c3987a3a hash:long albums:Vector<StoryAlbum> = stories.Albums;
searchPostsFlood#3e0b5b6a flags:# query_is_free:flags.0?true total_daily:int remains:int wait_till:flags.1?int stars_amount:long = SearchPostsFlood;
payments.uniqueStarGiftValueInfo#512fe446 flags:# last_sale_on_fragment:flags.1?true value_is_average:flags.6?true currency:string value:long initial_sale_date:int initial_sale_stars:long initial_sale_price:long last_sale_date:flags.0?int last_sale_price:flags.0?long floor_price:flags.2?long average_price:flags.3?long listed_count:flags.4?int fragment_listed_count:flags.5?int fragment_listed_url:flags.5?string = payments.UniqueStarGiftValueInfo;
profileTabPosts#b98cd696 = ProfileTab;
profileTabGifts#4d4bd46a = ProfileTab;
profileTabMedia#72c64955 = ProfileTab;
profileTabFiles#ab339c00 = ProfileTab;
profileTabMusic#9f27d26e = ProfileTab;
profileTabVoice#e477092e = ProfileTab;
profileTabLinks#d3656499 = ProfileTab;
profileTabGifs#a2c0f695 = ProfileTab;
users.savedMusicNotModified#e3878aa4 count:int = users.SavedMusic;
users.savedMusic#34a2f297 count:int documents:Vector<Document> = users.SavedMusic;
account.savedMusicIdsNotModified#4fc81d6e = account.SavedMusicIds;
account.savedMusicIds#998d6636 ids:Vector<long> = account.SavedMusicIds;
payments.checkCanSendGiftResultOk#374fa7ad = payments.CheckCanSendGiftResult;
payments.checkCanSendGiftResultFail#d5e58274 reason:TextWithEntities = payments.CheckCanSendGiftResult;
inputChatThemeEmpty#83268483 = InputChatTheme;
inputChatTheme#c93de95c emoticon:string = InputChatTheme;
inputChatThemeUniqueGift#87e5dfe4 slug:string = InputChatTheme;
starGiftUpgradePrice#99ea331d date:int upgrade_stars:long = StarGiftUpgradePrice;
groupCallMessage#1a8afc7e flags:# from_admin:flags.1?true id:int from_id:Peer date:int message:TextWithEntities paid_message_stars:flags.0?long = GroupCallMessage;
groupCallDonor#ee430c85 flags:# top:flags.0?true my:flags.1?true anonymous:flags.2?true peer_id:flags.3?Peer stars:long = GroupCallDonor;
phone.groupCallStars#9d1dbd26 total_stars:long top_donors:Vector<GroupCallDonor> chats:Vector<Chat> users:Vector<User> = phone.GroupCallStars;
recentStory#711d692d flags:# live:flags.0?true max_id:flags.1?int = RecentStory;
---functions---
@@ -2993,6 +3105,8 @@ auth.resetLoginEmail#7e960193 phone_number:string phone_code_hash:string = auth.
auth.reportMissingCode#cb9deff6 phone_number:string phone_code_hash:string mnc:string = Bool;
auth.checkPaidAuth#56e59f9c phone_number:string phone_code_hash:string form_id:long = auth.SentCode;
account.registerDevice#ec86017a flags:# no_muted:flags.0?true token_type:int token:string app_sandbox:Bool secret:bytes other_uids:Vector<long> = Bool;
account.unregisterDevice#6a0d3206 token_type:int token:string other_uids:Vector<long> = Bool;
@@ -3169,7 +3283,7 @@ account.deleteAutoSaveExceptions#53bc0020 = Bool;
account.invalidateSignInCodes#ca8ae8ba codes:Vector<string> = Bool;
account.updateColor#7cefa15d flags:# for_profile:flags.1?true color:flags.2?int background_emoji_id:flags.0?long = Bool;
account.updateColor#684d214e flags:# for_profile:flags.1?true color:flags.2?PeerColor = Bool;
account.getDefaultBackgroundEmojis#a60ab9ce hash:long = EmojiList;
@@ -3219,9 +3333,17 @@ account.setReactionsNotifySettings#316ce548 settings:ReactionsNotifySettings = R
account.getCollectibleEmojiStatuses#2e7b4543 hash:long = account.EmojiStatuses;
account.addNoPaidMessagesException#6f688aa7 flags:# refund_charged:flags.0?true user_id:InputUser = Bool;
account.getPaidMessagesRevenue#19ba4a67 flags:# parent_peer:flags.0?InputPeer user_id:InputUser = account.PaidMessagesRevenue;
account.getPaidMessagesRevenue#f1266f38 user_id:InputUser = account.PaidMessagesRevenue;
account.toggleNoPaidMessagesException#fe2eda76 flags:# refund_charged:flags.0?true require_payment:flags.2?true parent_peer:flags.1?InputPeer user_id:InputUser = Bool;
account.setMainProfileTab#5dee78b0 tab:ProfileTab = Bool;
account.saveMusic#b26732a9 flags:# unsave:flags.0?true id:InputDocument after_id:flags.1?InputDocument = Bool;
account.getSavedMusicIds#e09d5faf hash:long = account.SavedMusicIds;
account.getUniqueGiftChatThemes#e42ce9c9 offset:string limit:int hash:long = account.ChatThemes;
users.getUsers#d91a548 id:Vector<InputUser> = Vector<User>;
@@ -3231,6 +3353,12 @@ users.setSecureValueErrors#90c894b5 id:InputUser errors:Vector<SecureValueError>
users.getRequirementsToContact#d89a83a3 id:Vector<InputUser> = Vector<RequirementToContact>;
users.getSavedMusic#788d7fe3 id:InputUser offset:int limit:int hash:long = users.SavedMusic;
users.getSavedMusicByID#7573a4e9 id:InputUser documents:Vector<InputDocument> = users.SavedMusic;
users.suggestBirthday#fc533372 id:InputUser birthday:Birthday = Updates;
contacts.getContactIDs#7adc669d hash:long = Vector<int>;
contacts.getStatuses#c4a353ee = Vector<ContactStatus>;
@@ -3263,7 +3391,7 @@ contacts.getSaved#82f1e39f = Vector<SavedContact>;
contacts.toggleTopPeers#8514bdda enabled:Bool = Bool;
contacts.addContact#e8f463d0 flags:# add_phone_privacy_exception:flags.0?true id:InputUser first_name:string last_name:string phone:string = Updates;
contacts.addContact#d9ba2e54 flags:# add_phone_privacy_exception:flags.0?true id:InputUser first_name:string last_name:string phone:string note:flags.1?TextWithEntities = Updates;
contacts.acceptContact#f831a20f id:InputUser = Updates;
@@ -3285,6 +3413,8 @@ contacts.getBirthdays#daeda864 = contacts.ContactBirthdays;
contacts.getSponsoredPeers#b6c8c393 q:string = contacts.SponsoredPeers;
contacts.updateContactNote#139f63fb id:InputUser note:TextWithEntities = Bool;
messages.getMessages#63c66506 id:Vector<InputMessage> = messages.Messages;
messages.getDialogs#a0f4cb4f flags:# exclude_pinned:flags.0?true folder_id:flags.1?int offset_date:int offset_id:int offset_peer:InputPeer limit:int hash:long = messages.Dialogs;
@@ -3303,11 +3433,11 @@ messages.receivedMessages#5a954c0 max_id:int = Vector<ReceivedNotifyMessage>;
messages.setTyping#58943ee2 flags:# peer:InputPeer top_msg_id:flags.0?int action:SendMessageAction = Bool;
messages.sendMessage#fbf2340a flags:# no_webpage:flags.1?true silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true invert_media:flags.16?true allow_paid_floodskip:flags.19?true peer:InputPeer reply_to:flags.0?InputReplyTo message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long allow_paid_stars:flags.21?long = Updates;
messages.sendMessage#545cd15a flags:# no_webpage:flags.1?true silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true invert_media:flags.16?true allow_paid_floodskip:flags.19?true peer:InputPeer reply_to:flags.0?InputReplyTo message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int schedule_repeat_period:flags.24?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long allow_paid_stars:flags.21?long suggested_post:flags.22?SuggestedPost = Updates;
messages.sendMedia#a550cd78 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true invert_media:flags.16?true allow_paid_floodskip:flags.19?true peer:InputPeer reply_to:flags.0?InputReplyTo media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long allow_paid_stars:flags.21?long = Updates;
messages.sendMedia#330e77f flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true invert_media:flags.16?true allow_paid_floodskip:flags.19?true peer:InputPeer reply_to:flags.0?InputReplyTo media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int schedule_repeat_period:flags.24?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long allow_paid_stars:flags.21?long suggested_post:flags.22?SuggestedPost = Updates;
messages.forwardMessages#38f0188c flags:# silent:flags.5?true background:flags.6?true with_my_score:flags.8?true drop_author:flags.11?true drop_media_captions:flags.12?true noforwards:flags.14?true allow_paid_floodskip:flags.19?true from_peer:InputPeer id:Vector<int> random_id:Vector<long> to_peer:InputPeer top_msg_id:flags.9?int reply_to:flags.22?InputReplyTo schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut video_timestamp:flags.20?int allow_paid_stars:flags.21?long = Updates;
messages.forwardMessages#41d41ade flags:# silent:flags.5?true background:flags.6?true with_my_score:flags.8?true drop_author:flags.11?true drop_media_captions:flags.12?true noforwards:flags.14?true allow_paid_floodskip:flags.19?true from_peer:InputPeer id:Vector<int> random_id:Vector<long> to_peer:InputPeer top_msg_id:flags.9?int reply_to:flags.22?InputReplyTo schedule_date:flags.10?int schedule_repeat_period:flags.24?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut video_timestamp:flags.20?int allow_paid_stars:flags.21?long suggested_post:flags.23?SuggestedPost = Updates;
messages.reportSpam#cf1592db peer:InputPeer = Bool;
@@ -3397,7 +3527,7 @@ messages.sendInlineBotResult#c0cf7646 flags:# silent:flags.5?true background:fla
messages.getMessageEditData#fda68d36 peer:InputPeer id:int = messages.MessageEditData;
messages.editMessage#dfd14005 flags:# no_webpage:flags.1?true invert_media:flags.16?true peer:InputPeer id:int message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.15?int quick_reply_shortcut_id:flags.17?int = Updates;
messages.editMessage#51e842e1 flags:# no_webpage:flags.1?true invert_media:flags.16?true peer:InputPeer id:int message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.15?int schedule_repeat_period:flags.18?int quick_reply_shortcut_id:flags.17?int = Updates;
messages.editInlineBotMessage#83557dba flags:# no_webpage:flags.1?true invert_media:flags.16?true id:InputBotInlineMessageID message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> = Bool;
@@ -3407,7 +3537,7 @@ messages.setBotCallbackAnswer#d58f130a flags:# alert:flags.1?true query_id:long
messages.getPeerDialogs#e470bcfd peers:Vector<InputDialogPeer> = messages.PeerDialogs;
messages.saveDraft#d372c5ce flags:# no_webpage:flags.1?true invert_media:flags.6?true reply_to:flags.4?InputReplyTo peer:InputPeer message:string entities:flags.3?Vector<MessageEntity> media:flags.5?InputMedia effect:flags.7?long = Bool;
messages.saveDraft#54ae308e flags:# no_webpage:flags.1?true invert_media:flags.6?true reply_to:flags.4?InputReplyTo peer:InputPeer message:string entities:flags.3?Vector<MessageEntity> media:flags.5?InputMedia effect:flags.7?long suggested_post:flags.8?SuggestedPost = Bool;
messages.getAllDrafts#6a3f8d65 = Updates;
@@ -3565,7 +3695,7 @@ messages.setHistoryTTL#b80e5fe4 peer:InputPeer period:int = Updates;
messages.checkHistoryImportPeer#5dc60f03 peer:InputPeer = messages.CheckedHistoryImportPeer;
messages.setChatTheme#e63be13f peer:InputPeer emoticon:string = Updates;
messages.setChatTheme#81202c9 peer:InputPeer theme:InputChatTheme = Updates;
messages.getMessageReadParticipants#31c1c44f peer:InputPeer msg_id:int = Vector<ReadParticipantDate>;
@@ -3725,7 +3855,7 @@ messages.clickSponsoredMessage#8235057e flags:# media:flags.0?true fullscreen:fl
messages.reportSponsoredMessage#12cbf0c4 random_id:bytes option:bytes = channels.SponsoredMessageReportResult;
messages.getSponsoredMessages#9bd2f439 peer:InputPeer = messages.SponsoredMessages;
messages.getSponsoredMessages#3d6ce850 flags:# peer:InputPeer msg_id:flags.0?int = messages.SponsoredMessages;
messages.savePreparedInlineMessage#f21f7f2f flags:# result:InputBotInlineResult user_id:InputUser peer_types:flags.0?Vector<InlineQueryPeerType> = messages.BotPreparedInlineMessage;
@@ -3739,6 +3869,26 @@ messages.getSavedDialogsByID#6f6f9c96 flags:# parent_peer:flags.1?InputPeer ids:
messages.readSavedHistory#ba4a3b5b parent_peer:InputPeer peer:InputPeer max_id:int = Bool;
messages.toggleTodoCompleted#d3e03124 peer:InputPeer msg_id:int completed:Vector<int> incompleted:Vector<int> = Updates;
messages.appendTodoList#21a61057 peer:InputPeer msg_id:int list:Vector<TodoItem> = Updates;
messages.toggleSuggestedPostApproval#8107455c flags:# reject:flags.1?true peer:InputPeer msg_id:int schedule_date:flags.0?int reject_comment:flags.2?string = Updates;
messages.getForumTopics#3ba47bff flags:# peer:InputPeer q:flags.0?string offset_date:int offset_id:int offset_topic:int limit:int = messages.ForumTopics;
messages.getForumTopicsByID#af0a4a08 peer:InputPeer topics:Vector<int> = messages.ForumTopics;
messages.editForumTopic#cecc1134 flags:# peer:InputPeer topic_id:int title:flags.0?string icon_emoji_id:flags.1?long closed:flags.2?Bool hidden:flags.3?Bool = Updates;
messages.updatePinnedForumTopic#175df251 peer:InputPeer topic_id:int pinned:Bool = Updates;
messages.reorderPinnedForumTopics#e7841f0 flags:# force:flags.0?true peer:InputPeer order:Vector<int> = Updates;
messages.createForumTopic#2f98c3d5 flags:# title_missing:flags.4?true peer:InputPeer title:string icon_color:flags.0?int icon_emoji_id:flags.3?long random_id:long send_as:flags.2?InputPeer = Updates;
messages.deleteTopicHistory#d2816f10 peer:InputPeer top_msg_id:int = messages.AffectedHistory;
updates.getState#edd4882a = updates.State;
updates.getDifference#19c2f763 flags:# pts:int pts_limit:flags.1?int pts_total_limit:flags.0?int date:int qts:int qts_limit:flags.2?int = updates.Difference;
@@ -3891,7 +4041,7 @@ channels.getInactiveChannels#11e831ee = messages.InactiveChats;
channels.convertToGigagroup#b290c69 channel:InputChannel = Updates;
channels.getSendAs#e785a43f flags:# for_paid_reactions:flags.0?true peer:InputPeer = channels.SendAsPeers;
channels.getSendAs#e785a43f flags:# for_paid_reactions:flags.0?true for_live_stories:flags.1?true peer:InputPeer = channels.SendAsPeers;
channels.deleteParticipantHistory#367544db channel:InputChannel participant:InputPeer = messages.AffectedHistory;
@@ -3907,20 +4057,6 @@ channels.deactivateAllUsernames#a245dd3 channel:InputChannel = Bool;
channels.toggleForum#3ff75734 channel:InputChannel enabled:Bool tabs:Bool = Updates;
channels.createForumTopic#f40c0224 flags:# channel:InputChannel title:string icon_color:flags.0?int icon_emoji_id:flags.3?long random_id:long send_as:flags.2?InputPeer = Updates;
channels.getForumTopics#de560d1 flags:# channel:InputChannel q:flags.0?string offset_date:int offset_id:int offset_topic:int limit:int = messages.ForumTopics;
channels.getForumTopicsByID#b0831eb9 channel:InputChannel topics:Vector<int> = messages.ForumTopics;
channels.editForumTopic#f4dfa185 flags:# channel:InputChannel topic_id:int title:flags.0?string icon_emoji_id:flags.1?long closed:flags.2?Bool hidden:flags.3?Bool = Updates;
channels.updatePinnedForumTopic#6c2d9026 channel:InputChannel topic_id:int pinned:Bool = Updates;
channels.deleteTopicHistory#34435f2d channel:InputChannel top_msg_id:int = messages.AffectedHistory;
channels.reorderPinnedForumTopics#2950a18f flags:# force:flags.0?true channel:InputChannel order:Vector<int> = Updates;
channels.toggleAntiSpam#68f3e4eb channel:InputChannel enabled:Bool = Updates;
channels.reportAntiSpamFalsePositive#a850a693 channel:InputChannel msg_id:int = Bool;
@@ -3941,7 +4077,7 @@ channels.setEmojiStickers#3cd930b7 channel:InputChannel stickerset:InputStickerS
channels.restrictSponsoredMessages#9ae91519 channel:InputChannel restricted:Bool = Updates;
channels.searchPosts#d19f987b hashtag:string offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages;
channels.searchPosts#f2c4f24d flags:# hashtag:flags.0?string query:flags.1?string offset_rate:int offset_peer:InputPeer offset_id:int limit:int allow_paid_stars:flags.2?long = messages.Messages;
channels.updatePaidMessagesPrice#4b12327b flags:# broadcast_messages_allowed:flags.0?true channel:InputChannel send_paid_messages_stars:long = Updates;
@@ -3949,6 +4085,10 @@ channels.toggleAutotranslation#167fc0a1 channel:InputChannel enabled:Bool = Upda
channels.getMessageAuthor#ece2a0e6 channel:InputChannel id:int = User;
channels.checkSearchPostsFlood#22567115 flags:# query:flags.0?string = SearchPostsFlood;
channels.setMainProfileTab#3583fcb1 channel:InputChannel tab:ProfileTab = Bool;
bots.sendCustomRequest#aa2769ed custom_method:string params:DataJSON = DataJSON;
bots.answerWebhookJSONQuery#e6213f4d query_id:long data:DataJSON = Bool;
@@ -4041,21 +4181,21 @@ payments.launchPrepaidGiveaway#5ff58f20 peer:InputPeer giveaway_id:long purpose:
payments.getStarsTopupOptions#c00ec7d3 = Vector<StarsTopupOption>;
payments.getStarsStatus#104fcfa7 peer:InputPeer = payments.StarsStatus;
payments.getStarsStatus#4ea9b3bf flags:# ton:flags.0?true peer:InputPeer = payments.StarsStatus;
payments.getStarsTransactions#69da4557 flags:# inbound:flags.0?true outbound:flags.1?true ascending:flags.2?true subscription_id:flags.3?string peer:InputPeer offset:string limit:int = payments.StarsStatus;
payments.getStarsTransactions#69da4557 flags:# inbound:flags.0?true outbound:flags.1?true ascending:flags.2?true ton:flags.4?true subscription_id:flags.3?string peer:InputPeer offset:string limit:int = payments.StarsStatus;
payments.sendStarsForm#7998c914 form_id:long invoice:InputInvoice = payments.PaymentResult;
payments.refundStarsCharge#25ae8f4a user_id:InputUser charge_id:string = Updates;
payments.getStarsRevenueStats#d91ffad6 flags:# dark:flags.0?true peer:InputPeer = payments.StarsRevenueStats;
payments.getStarsRevenueStats#d91ffad6 flags:# dark:flags.0?true ton:flags.1?true peer:InputPeer = payments.StarsRevenueStats;
payments.getStarsRevenueWithdrawalUrl#13bbe8b3 peer:InputPeer stars:long password:InputCheckPasswordSRP = payments.StarsRevenueWithdrawalUrl;
payments.getStarsRevenueWithdrawalUrl#2433dc92 flags:# ton:flags.0?true peer:InputPeer amount:flags.1?long password:InputCheckPasswordSRP = payments.StarsRevenueWithdrawalUrl;
payments.getStarsRevenueAdsAccountUrl#d1d7efc5 peer:InputPeer = payments.StarsRevenueAdsAccountUrl;
payments.getStarsTransactionsByID#27842d2e peer:InputPeer id:Vector<InputStarsTransaction> = payments.StarsStatus;
payments.getStarsTransactionsByID#2dca16b8 flags:# ton:flags.0?true peer:InputPeer id:Vector<InputStarsTransaction> = payments.StarsStatus;
payments.getStarsGiftOptions#d3c96bc8 flags:# user_id:flags.0?InputUser = Vector<StarsGiftOption>;
@@ -4093,7 +4233,7 @@ payments.transferStarGift#7f18176a stargift:InputSavedStarGift to_id:InputPeer =
payments.getUniqueStarGift#a1974d72 slug:string = payments.UniqueStarGift;
payments.getSavedStarGifts#23830de9 flags:# exclude_unsaved:flags.0?true exclude_saved:flags.1?true exclude_unlimited:flags.2?true exclude_limited:flags.3?true exclude_unique:flags.4?true sort_by_value:flags.5?true peer:InputPeer offset:string limit:int = payments.SavedStarGifts;
payments.getSavedStarGifts#a319e569 flags:# exclude_unsaved:flags.0?true exclude_saved:flags.1?true exclude_unlimited:flags.2?true exclude_unique:flags.4?true sort_by_value:flags.5?true exclude_upgradable:flags.7?true exclude_unupgradable:flags.8?true peer_color_available:flags.9?true exclude_hosted:flags.10?true peer:InputPeer collection_id:flags.6?int offset:string limit:int = payments.SavedStarGifts;
payments.getSavedStarGift#b455a106 stargift:Vector<InputSavedStarGift> = payments.SavedStarGifts;
@@ -4107,7 +4247,21 @@ payments.canPurchaseStore#4fdc5ea7 purpose:InputStorePaymentPurpose = Bool;
payments.getResaleStarGifts#7a5fa236 flags:# sort_by_price:flags.1?true sort_by_num:flags.2?true attributes_hash:flags.0?long gift_id:long attributes:flags.3?Vector<StarGiftAttributeId> offset:string limit:int = payments.ResaleStarGifts;
payments.updateStarGiftPrice#3baea4e1 stargift:InputSavedStarGift resell_stars:long = Updates;
payments.updateStarGiftPrice#edbe6ccb stargift:InputSavedStarGift resell_amount:StarsAmount = Updates;
payments.createStarGiftCollection#1f4a0e87 peer:InputPeer title:string stargift:Vector<InputSavedStarGift> = StarGiftCollection;
payments.updateStarGiftCollection#4fddbee7 flags:# peer:InputPeer collection_id:int title:flags.0?string delete_stargift:flags.1?Vector<InputSavedStarGift> add_stargift:flags.2?Vector<InputSavedStarGift> order:flags.3?Vector<InputSavedStarGift> = StarGiftCollection;
payments.reorderStarGiftCollections#c32af4cc peer:InputPeer order:Vector<int> = Bool;
payments.deleteStarGiftCollection#ad5648e8 peer:InputPeer collection_id:int = Bool;
payments.getStarGiftCollections#981b91dd peer:InputPeer hash:long = payments.StarGiftCollections;
payments.getUniqueStarGiftValueInfo#4365af6b slug:string = payments.UniqueStarGiftValueInfo;
payments.checkCanSendGift#c0c4edc9 gift_id:long = payments.CheckCanSendGiftResult;
stickers.createStickerSet#9021ab67 flags:# masks:flags.0?true emojis:flags.5?true text_color:flags.6?true user_id:InputUser title:string short_name:string thumb:flags.2?InputDocument stickers:Vector<InputStickerSetItem> software:flags.3?string = messages.StickerSet;
@@ -4159,7 +4313,7 @@ phone.inviteToGroupCall#7b393160 call:InputGroupCall users:Vector<InputUser> = U
phone.discardGroupCall#7a777135 call:InputGroupCall = Updates;
phone.toggleGroupCallSettings#74bbb43d flags:# reset_invite_hash:flags.1?true call:InputGroupCall join_muted:flags.0?Bool = Updates;
phone.toggleGroupCallSettings#974392f2 flags:# reset_invite_hash:flags.1?true call:InputGroupCall join_muted:flags.0?Bool messages_enabled:flags.2?Bool send_paid_messages_stars:flags.3?long = Updates;
phone.getGroupCall#41845db call:InputGroupCall limit:int = phone.GroupCall;
@@ -4189,7 +4343,7 @@ phone.leaveGroupCallPresentation#1c50d144 call:InputGroupCall = Updates;
phone.getGroupCallStreamChannels#1ab21940 call:InputGroupCall = phone.GroupCallStreamChannels;
phone.getGroupCallStreamRtmpUrl#deb3abbf peer:InputPeer revoke:Bool = phone.GroupCallStreamRtmpUrl;
phone.getGroupCallStreamRtmpUrl#5af4c73a flags:# live_story:flags.0?true peer:InputPeer revoke:Bool = phone.GroupCallStreamRtmpUrl;
phone.saveCallLog#41248786 peer:InputPhoneCall file:InputFile = Bool;
@@ -4205,6 +4359,18 @@ phone.declineConferenceCallInvite#3c479971 msg_id:int = Updates;
phone.getGroupCallChainBlocks#ee9f88a6 call:InputGroupCall sub_chain_id:int offset:int limit:int = Updates;
phone.sendGroupCallMessage#b1d11410 flags:# call:InputGroupCall random_id:long message:TextWithEntities allow_paid_stars:flags.0?long send_as:flags.1?InputPeer = Updates;
phone.sendGroupCallEncryptedMessage#e5afa56d call:InputGroupCall encrypted_message:bytes = Bool;
phone.deleteGroupCallMessages#f64f54f7 flags:# report_spam:flags.0?true call:InputGroupCall messages:Vector<int> = Updates;
phone.deleteGroupCallParticipantMessages#1dbfeca0 flags:# report_spam:flags.0?true call:InputGroupCall participant:InputPeer = Updates;
phone.getGroupCallStars#6f636302 call:InputGroupCall = phone.GroupCallStars;
phone.saveDefaultSendAs#4167add1 call:InputGroupCall send_as:InputPeer = Bool;
langpack.getLangPack#f2f2330a lang_pack:string lang_code:string = LangPackDifference;
langpack.getStrings#efea3803 lang_pack:string lang_code:string keys:Vector<string> = Vector<LangPackString>;
@@ -4231,12 +4397,6 @@ stats.getStoryStats#374fef40 flags:# dark:flags.0?true peer:InputPeer id:int = s
stats.getStoryPublicForwards#a6437ef6 peer:InputPeer id:int offset:string limit:int = stats.PublicForwards;
stats.getBroadcastRevenueStats#f788ee19 flags:# dark:flags.0?true peer:InputPeer = stats.BroadcastRevenueStats;
stats.getBroadcastRevenueWithdrawalUrl#9df4faad peer:InputPeer password:InputCheckPasswordSRP = stats.BroadcastRevenueWithdrawalUrl;
stats.getBroadcastRevenueTransactions#70990b6d peer:InputPeer offset:int limit:int = stats.BroadcastRevenueTransactions;
chatlists.exportChatlistInvite#8472478e chatlist:InputChatlist title:string peers:Vector<InputPeer> = chatlists.ExportedChatlistInvite;
chatlists.deleteExportedInvite#719c5c5e chatlist:InputChatlist slug:string = Bool;
@@ -4261,7 +4421,7 @@ chatlists.leaveChatlist#74fae13a chatlist:InputChatlist peers:Vector<InputPeer>
stories.canSendStory#30eb63f0 peer:InputPeer = stories.CanSendStoryCount;
stories.sendStory#e4e6694b flags:# pinned:flags.2?true noforwards:flags.4?true fwd_modified:flags.7?true peer:InputPeer media:InputMedia media_areas:flags.5?Vector<MediaArea> caption:flags.0?string entities:flags.1?Vector<MessageEntity> privacy_rules:Vector<InputPrivacyRule> random_id:long period:flags.3?int fwd_from_id:flags.6?InputPeer fwd_from_story:flags.6?int = Updates;
stories.sendStory#737fc2ec flags:# pinned:flags.2?true noforwards:flags.4?true fwd_modified:flags.7?true peer:InputPeer media:InputMedia media_areas:flags.5?Vector<MediaArea> caption:flags.0?string entities:flags.1?Vector<MessageEntity> privacy_rules:Vector<InputPrivacyRule> random_id:long period:flags.3?int fwd_from_id:flags.6?InputPeer fwd_from_story:flags.6?int albums:flags.8?Vector<int> = Updates;
stories.editStory#b583ba46 flags:# peer:InputPeer id:int media:flags.0?InputMedia media_areas:flags.3?Vector<MediaArea> caption:flags.1?string entities:flags.1?Vector<MessageEntity> privacy_rules:flags.2?Vector<InputPrivacyRule> = Updates;
@@ -4299,7 +4459,7 @@ stories.getPeerStories#2c4ada50 peer:InputPeer = stories.PeerStories;
stories.getAllReadPeerStories#9b5ae7f9 = Updates;
stories.getPeerMaxIDs#535983c3 id:Vector<InputPeer> = Vector<int>;
stories.getPeerMaxIDs#78499170 id:Vector<InputPeer> = Vector<RecentStory>;
stories.getChatsToSend#a56a8b60 = messages.Chats;
@@ -4311,6 +4471,20 @@ stories.togglePinnedToTop#b297e9b peer:InputPeer id:Vector<int> = Bool;
stories.searchPosts#d1810907 flags:# hashtag:flags.0?string area:flags.1?MediaArea peer:flags.2?InputPeer offset:string limit:int = stories.FoundStories;
stories.createAlbum#a36396e5 peer:InputPeer title:string stories:Vector<int> = StoryAlbum;
stories.updateAlbum#5e5259b6 flags:# peer:InputPeer album_id:int title:flags.0?string delete_stories:flags.1?Vector<int> add_stories:flags.2?Vector<int> order:flags.3?Vector<int> = StoryAlbum;
stories.reorderAlbums#8535fbd9 peer:InputPeer order:Vector<int> = Bool;
stories.deleteAlbum#8d3456d0 peer:InputPeer album_id:int = Bool;
stories.getAlbums#25b3eac7 peer:InputPeer hash:long = stories.Albums;
stories.getAlbumStories#ac806d61 peer:InputPeer album_id:int offset:int limit:int = stories.Stories;
stories.startLive#d069ccde flags:# pinned:flags.2?true noforwards:flags.4?true rtmp_stream:flags.5?true peer:InputPeer caption:flags.0?string entities:flags.1?Vector<MessageEntity> privacy_rules:Vector<InputPrivacyRule> random_id:long messages_enabled:flags.6?Bool send_paid_messages_stars:flags.7?long = Updates;
premium.getBoostsList#60f67660 flags:# gifts:flags.0?true peer:InputPeer offset:string limit:int = premium.BoostsList;
premium.getMyBoosts#be77b4a = premium.MyBoosts;
@@ -4337,4 +4511,4 @@ smsjobs.finishJob#4f1ebf24 flags:# job_id:string error:flags.0?string = Bool;
fragment.getCollectibleInfo#be1e85ba collectible:InputCollectible = fragment.CollectibleInfo;
// LAYER 204
// LAYER 217
+325 -111
View File
@@ -2,8 +2,8 @@
//
// Source: https://raw.githubusercontent.com/telegramdesktop/tdesktop/dev/Telegram/SourceFiles/mtproto/scheme/api.tl
// Merge: _schema/legacy.tl
// Layer: 204
// SHA256: 21a7c3d4b245cd896149abd28e114be32e2a27519682b72fd917a06630f5ef7d
// Layer: 218
// SHA256: 33b36383ad43d41e6b592791311ca0d65a06cf2d3ef9d607a6e187cddac7f14b
boolFalse#bc799737 = Bool;
@@ -37,7 +37,7 @@ inputUser#f21158c6 user_id:long access_hash:long = 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;
inputPhoneContact#6a1dc4be flags:# client_id:long phone:string first_name:string last_name:string note:flags.0?TextWithEntities = InputContact;
inputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;
@@ -81,6 +81,8 @@ inputMediaWebPage#c21b8849 flags:# force_large_media:flags.0?true force_small_me
inputMediaPaidMedia#c4103386 flags:# stars_amount:long extended_media:Vector<InputMedia> payload:flags.0?string = InputMedia;
inputMediaTodo#9fc55fde todo:TodoList = InputMedia;
inputChatPhotoEmpty#1ca48f57 = InputChatPhoto;
inputChatUploadedPhoto#bdcdaec0 flags:# file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double video_emoji_markup:flags.3?VideoSize = InputChatPhoto;
@@ -143,7 +145,7 @@ storage.fileWebp#1081464c = storage.FileType;
userEmpty#d3bc4b7a id:long = User;
user#20b1422 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true fake:flags.26?true bot_attach_menu:flags.27?true premium:flags.28?true attach_menu_enabled:flags.29?true flags2:# bot_can_edit:flags2.1?true close_friend:flags2.2?true stories_hidden:flags2.3?true stories_unavailable:flags2.4?true contact_require_premium:flags2.10?true bot_business:flags2.11?true bot_has_main_app:flags2.13?true id:long access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector<RestrictionReason> bot_inline_placeholder:flags.19?string lang_code:flags.22?string emoji_status:flags.30?EmojiStatus usernames:flags2.0?Vector<Username> stories_max_id:flags2.5?int color:flags2.8?PeerColor profile_color:flags2.9?PeerColor bot_active_users:flags2.12?int bot_verification_icon:flags2.14?long send_paid_messages_stars:flags2.15?long = User;
user#31774388 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true fake:flags.26?true bot_attach_menu:flags.27?true premium:flags.28?true attach_menu_enabled:flags.29?true flags2:# bot_can_edit:flags2.1?true close_friend:flags2.2?true stories_hidden:flags2.3?true stories_unavailable:flags2.4?true contact_require_premium:flags2.10?true bot_business:flags2.11?true bot_has_main_app:flags2.13?true bot_forum_view:flags2.16?true id:long access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector<RestrictionReason> bot_inline_placeholder:flags.19?string lang_code:flags.22?string emoji_status:flags.30?EmojiStatus usernames:flags2.0?Vector<Username> stories_max_id:flags2.5?RecentStory color:flags2.8?PeerColor profile_color:flags2.9?PeerColor bot_active_users:flags2.12?int bot_verification_icon:flags2.14?long send_paid_messages_stars:flags2.15?long = User;
userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;
@@ -167,13 +169,13 @@ chat#41cbf256 flags:# creator:flags.0?true left:flags.2?true deactivated:flags.5
chatForbidden#6592a1a7 id:long title:string = Chat;
channel#fe685355 flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true call_active:flags.23?true call_not_empty:flags.24?true fake:flags.25?true gigagroup:flags.26?true noforwards:flags.27?true join_to_send:flags.28?true join_request:flags.29?true forum:flags.30?true flags2:# stories_hidden:flags2.1?true stories_hidden_min:flags2.2?true stories_unavailable:flags2.3?true signature_profiles:flags2.12?true autotranslation:flags2.15?true broadcast_messages_allowed:flags2.16?true monoforum:flags2.17?true forum_tabs:flags2.19?true id:long access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int restriction_reason:flags.9?Vector<RestrictionReason> admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int usernames:flags2.0?Vector<Username> stories_max_id:flags2.4?int color:flags2.7?PeerColor profile_color:flags2.8?PeerColor emoji_status:flags2.9?EmojiStatus level:flags2.10?int subscription_until_date:flags2.11?int bot_verification_icon:flags2.13?long send_paid_messages_stars:flags2.14?long linked_monoforum_id:flags2.18?long = Chat;
channel#1c32b11c flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true call_active:flags.23?true call_not_empty:flags.24?true fake:flags.25?true gigagroup:flags.26?true noforwards:flags.27?true join_to_send:flags.28?true join_request:flags.29?true forum:flags.30?true flags2:# stories_hidden:flags2.1?true stories_hidden_min:flags2.2?true stories_unavailable:flags2.3?true signature_profiles:flags2.12?true autotranslation:flags2.15?true broadcast_messages_allowed:flags2.16?true monoforum:flags2.17?true forum_tabs:flags2.19?true id:long access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int restriction_reason:flags.9?Vector<RestrictionReason> admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int usernames:flags2.0?Vector<Username> stories_max_id:flags2.4?RecentStory color:flags2.7?PeerColor profile_color:flags2.8?PeerColor emoji_status:flags2.9?EmojiStatus level:flags2.10?int subscription_until_date:flags2.11?int bot_verification_icon:flags2.13?long send_paid_messages_stars:flags2.14?long linked_monoforum_id:flags2.18?long = 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#2633421b flags:# can_set_username:flags.7?true has_scheduled:flags.8?true translations_disabled:flags.19?true id:long about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:flags.13?ExportedChatInvite bot_info:flags.3?Vector<BotInfo> pinned_msg_id:flags.6?int folder_id:flags.11?int call:flags.12?InputGroupCall ttl_period:flags.14?int groupcall_default_join_as:flags.15?Peer theme_emoticon:flags.16?string requests_pending:flags.17?int recent_requesters:flags.17?Vector<long> available_reactions:flags.18?ChatReactions reactions_limit:flags.20?int = ChatFull;
channelFull#52d6806b flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true flags2:# can_delete_channel:flags2.0?true antispam:flags2.1?true participants_hidden:flags2.2?true translations_disabled:flags2.3?true stories_pinned_available:flags2.5?true view_forum_as_messages:flags2.6?true restricted_sponsored:flags2.11?true can_view_revenue:flags2.12?true paid_media_allowed:flags2.14?true can_view_stars_revenue:flags2.15?true paid_reactions_available:flags2.16?true stargifts_available:flags2.19?true paid_messages_available:flags2.20?true id:long about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?long migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?long location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector<string> groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string requests_pending:flags.28?int recent_requesters:flags.28?Vector<long> default_send_as:flags.29?Peer available_reactions:flags.30?ChatReactions reactions_limit:flags2.13?int stories:flags2.4?PeerStories wallpaper:flags2.7?WallPaper boosts_applied:flags2.8?int boosts_unrestrict:flags2.9?int emojiset:flags2.10?StickerSet bot_verification:flags2.17?BotVerification stargifts_count:flags2.18?int = ChatFull;
channelFull#e4e0b29d flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true flags2:# can_delete_channel:flags2.0?true antispam:flags2.1?true participants_hidden:flags2.2?true translations_disabled:flags2.3?true stories_pinned_available:flags2.5?true view_forum_as_messages:flags2.6?true restricted_sponsored:flags2.11?true can_view_revenue:flags2.12?true paid_media_allowed:flags2.14?true can_view_stars_revenue:flags2.15?true paid_reactions_available:flags2.16?true stargifts_available:flags2.19?true paid_messages_available:flags2.20?true id:long about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?long migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?long location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector<string> groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string requests_pending:flags.28?int recent_requesters:flags.28?Vector<long> default_send_as:flags.29?Peer available_reactions:flags.30?ChatReactions reactions_limit:flags2.13?int stories:flags2.4?PeerStories wallpaper:flags2.7?WallPaper boosts_applied:flags2.8?int boosts_unrestrict:flags2.9?int emojiset:flags2.10?StickerSet bot_verification:flags2.17?BotVerification stargifts_count:flags2.18?int send_paid_messages_stars:flags2.21?long main_tab:flags2.22?ProfileTab = ChatFull;
chatParticipant#c02d4007 user_id:long inviter_id:long date:int = ChatParticipant;
@@ -191,9 +193,9 @@ 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#eabcdd4d flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true noforwards:flags.26?true invert_media:flags.27?true flags2:# offline:flags2.1?true video_processing_pending:flags2.4?true id:int from_id:flags.8?Peer from_boosts_applied:flags.29?int peer_id:Peer saved_peer_id:flags.28?Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long via_business_bot_id:flags2.0?long reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long reactions:flags.20?MessageReactions restriction_reason:flags.22?Vector<RestrictionReason> ttl_period:flags.25?int quick_reply_shortcut_id:flags.30?int effect:flags2.2?long factcheck:flags2.3?FactCheck report_delivery_until_date:flags2.5?int paid_message_stars:flags2.6?long = Message;
message#b92f76cf flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true noforwards:flags.26?true invert_media:flags.27?true flags2:# offline:flags2.1?true video_processing_pending:flags2.4?true paid_suggested_post_stars:flags2.8?true paid_suggested_post_ton:flags2.9?true id:int from_id:flags.8?Peer from_boosts_applied:flags.29?int peer_id:Peer saved_peer_id:flags.28?Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long via_business_bot_id:flags2.0?long reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long reactions:flags.20?MessageReactions restriction_reason:flags.22?Vector<RestrictionReason> ttl_period:flags.25?int quick_reply_shortcut_id:flags.30?int effect:flags2.2?long factcheck:flags2.3?FactCheck report_delivery_until_date:flags2.5?int paid_message_stars:flags2.6?long suggested_post:flags2.7?SuggestedPost schedule_repeat_period:flags2.10?int = Message;
messageService#d3d28540 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true reactions_are_possible:flags.9?true silent:flags.13?true post:flags.14?true legacy:flags.19?true id:int from_id:flags.8?Peer peer_id:Peer reply_to:flags.3?MessageReplyHeader date:int action:MessageAction reactions:flags.20?MessageReactions ttl_period:flags.25?int = Message;
messageService#7a800e0a flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true reactions_are_possible:flags.9?true silent:flags.13?true post:flags.14?true legacy:flags.19?true id:int from_id:flags.8?Peer peer_id:Peer saved_peer_id:flags.28?Peer reply_to:flags.3?MessageReplyHeader date:int action:MessageAction reactions:flags.20?MessageReactions ttl_period:flags.25?int = Message;
messageMediaEmpty#3ded6320 = MessageMedia;
@@ -229,6 +231,10 @@ messageMediaGiveawayResults#ceaa3ea1 flags:# only_new_subscribers:flags.0?true r
messageMediaPaidMedia#a8852491 stars_amount:long extended_media:Vector<MessageExtendedMedia> = MessageMedia;
messageMediaToDo#8a53b014 flags:# todo:TodoList completions:flags.0?Vector<TodoCompletion> = MessageMedia;
messageMediaVideoStream#ca5cab89 flags:# rtmp_stream:flags.0?true call:InputGroupCall = MessageMedia;
messageActionEmpty#b6aef7b0 = MessageAction;
messageActionChatCreate#bd47cbad title:string users:Vector<long> = MessageAction;
@@ -285,7 +291,7 @@ messageActionSetMessagesTTL#3c134d7b flags:# period:int auto_setting_from:flags.
messageActionGroupCallScheduled#b3a07661 call:InputGroupCall schedule_date:int = MessageAction;
messageActionSetChatTheme#aa786345 emoticon:string = MessageAction;
messageActionSetChatTheme#b91bbd3a theme:ChatTheme = MessageAction;
messageActionChatJoinedByRequest#ebbca3cb = MessageAction;
@@ -293,9 +299,9 @@ messageActionWebViewDataSentMe#47dd8079 text:string data:string = MessageAction;
messageActionWebViewDataSent#b4c38cb5 text:string = MessageAction;
messageActionGiftPremium#6c6274fa flags:# currency:string amount:long months:int crypto_currency:flags.0?string crypto_amount:flags.0?long message:flags.1?TextWithEntities = MessageAction;
messageActionGiftPremium#48e91302 flags:# currency:string amount:long days:int crypto_currency:flags.0?string crypto_amount:flags.0?long message:flags.1?TextWithEntities = MessageAction;
messageActionTopicCreate#d999256 flags:# title:string icon_color:int icon_emoji_id:flags.0?long = MessageAction;
messageActionTopicCreate#d999256 flags:# title_missing:flags.1?true title:string icon_color:int icon_emoji_id:flags.0?long = MessageAction;
messageActionTopicEdit#c0944820 flags:# title:flags.0?string icon_emoji_id:flags.1?long closed:flags.2?Bool hidden:flags.3?Bool = MessageAction;
@@ -305,7 +311,7 @@ messageActionRequestedPeer#31518e9b button_id:int peers:Vector<Peer> = MessageAc
messageActionSetChatWallPaper#5060a3f4 flags:# same:flags.0?true for_both:flags.1?true wallpaper:WallPaper = MessageAction;
messageActionGiftCode#56d03994 flags:# via_giveaway:flags.0?true unclaimed:flags.5?true boost_peer:flags.1?Peer months:int slug:string currency:flags.2?string amount:flags.2?long crypto_currency:flags.3?string crypto_amount:flags.3?long message:flags.4?TextWithEntities = MessageAction;
messageActionGiftCode#31c48347 flags:# via_giveaway:flags.0?true unclaimed:flags.5?true boost_peer:flags.1?Peer days:int slug:string currency:flags.2?string amount:flags.2?long crypto_currency:flags.3?string crypto_amount:flags.3?long message:flags.4?TextWithEntities = MessageAction;
messageActionGiveawayLaunch#a80f51e4 flags:# stars:flags.0?long = MessageAction;
@@ -321,9 +327,9 @@ messageActionGiftStars#45d5b021 flags:# currency:string amount:long stars:long c
messageActionPrizeStars#b00c47a2 flags:# unclaimed:flags.0?true stars:long transaction_id:string boost_peer:Peer giveaway_msg_id:int = MessageAction;
messageActionStarGift#4717e8a4 flags:# name_hidden:flags.0?true saved:flags.2?true converted:flags.3?true upgraded:flags.5?true refunded:flags.9?true can_upgrade:flags.10?true gift:StarGift message:flags.1?TextWithEntities convert_stars:flags.4?long upgrade_msg_id:flags.5?int upgrade_stars:flags.8?long from_id:flags.11?Peer peer:flags.12?Peer saved_id:flags.12?long = MessageAction;
messageActionStarGift#db596550 flags:# name_hidden:flags.0?true saved:flags.2?true converted:flags.3?true upgraded:flags.5?true refunded:flags.9?true can_upgrade:flags.10?true prepaid_upgrade:flags.13?true upgrade_separate:flags.16?true auction_acquired:flags.17?true gift:StarGift message:flags.1?TextWithEntities convert_stars:flags.4?long upgrade_msg_id:flags.5?int upgrade_stars:flags.8?long from_id:flags.11?Peer peer:flags.12?Peer saved_id:flags.12?long prepaid_upgrade_hash:flags.14?string gift_msg_id:flags.15?int to_id:flags.18?Peer = MessageAction;
messageActionStarGiftUnique#2e3ae60e flags:# upgrade:flags.0?true transferred:flags.1?true saved:flags.2?true refunded:flags.5?true gift:StarGift can_export_at:flags.3?int transfer_stars:flags.4?long from_id:flags.6?Peer peer:flags.7?Peer saved_id:flags.7?long resale_stars:flags.8?long can_transfer_at:flags.9?int can_resell_at:flags.10?int = MessageAction;
messageActionStarGiftUnique#95728543 flags:# upgrade:flags.0?true transferred:flags.1?true saved:flags.2?true refunded:flags.5?true prepaid_upgrade:flags.11?true assigned:flags.13?true gift:StarGift can_export_at:flags.3?int transfer_stars:flags.4?long from_id:flags.6?Peer peer:flags.7?Peer saved_id:flags.7?long resale_amount:flags.8?StarsAmount can_transfer_at:flags.9?int can_resell_at:flags.10?int drop_original_details_stars:flags.12?long = MessageAction;
messageActionPaidMessagesRefunded#ac1f1fcd count:int stars:long = MessageAction;
@@ -331,6 +337,20 @@ messageActionPaidMessagesPrice#84b88578 flags:# broadcast_messages_allowed:flags
messageActionConferenceCall#2ffe2f7a flags:# missed:flags.0?true active:flags.1?true video:flags.4?true call_id:long duration:flags.2?int other_participants:flags.3?Vector<Peer> = MessageAction;
messageActionTodoCompletions#cc7c5c89 completed:Vector<int> incompleted:Vector<int> = MessageAction;
messageActionTodoAppendTasks#c7edbc83 list:Vector<TodoItem> = MessageAction;
messageActionSuggestedPostApproval#ee7a1596 flags:# rejected:flags.0?true balance_too_low:flags.1?true reject_comment:flags.2?string schedule_date:flags.3?int price:flags.4?StarsAmount = MessageAction;
messageActionSuggestedPostSuccess#95ddcf69 price:StarsAmount = MessageAction;
messageActionSuggestedPostRefund#69f916f8 flags:# payer_initiated:flags.0?true = MessageAction;
messageActionGiftTon#a8a3c699 flags:# currency:string amount:long crypto_currency:string crypto_amount:long transaction_id:flags.0?string = MessageAction;
messageActionSuggestBirthday#2c8f2a25 birthday:Birthday = MessageAction;
dialog#d58a08c6 flags:# pinned:flags.2?true unread_mark:flags.3?true view_forum_as_messages:flags.6?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?int ttl_period:flags.5?int = Dialog;
dialogFolder#71bd134c flags:# pinned:flags.2?true folder:Folder peer:Peer top_message:int unread_muted_peers_count:int unread_unmuted_peers_count:int unread_muted_messages_count:int unread_unmuted_messages_count:int = Dialog;
@@ -359,7 +379,7 @@ auth.sentCode#5e002502 flags:# type:auth.SentCodeType phone_code_hash:string nex
auth.sentCodeSuccess#2390fe44 authorization:auth.Authorization = auth.SentCode;
auth.sentCodePaymentRequired#d7cef980 store_product:string phone_code_hash:string = auth.SentCode;
auth.sentCodePaymentRequired#e0955a3c store_product:string phone_code_hash:string support_email_address:string support_email_subject:string currency:string amount:long = auth.SentCode;
auth.authorization#2ea2c0d4 flags:# setup_password_required:flags.1?true otherwise_relogin_days:flags.1?int tmp_sessions:flags.0?int future_auth_token:flags.2?bytes user:User = auth.Authorization;
@@ -407,7 +427,7 @@ inputReportReasonIllegalDrugs#a8eb2be = ReportReason;
inputReportReasonPersonalDetails#9ec7863d = ReportReason;
userFull#99e78045 flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true voice_messages_forbidden:flags.20?true translations_disabled:flags.23?true stories_pinned_available:flags.26?true blocked_my_stories_from:flags.27?true wallpaper_overridden:flags.28?true contact_require_premium:flags.29?true read_dates_private:flags.30?true flags2:# sponsored_enabled:flags2.7?true can_view_revenue:flags2.9?true bot_can_manage_emoji_status:flags2.10?true display_gifts_button:flags2.16?true id:long about:flags.1?string settings:PeerSettings personal_photo:flags.21?Photo profile_photo:flags.2?Photo fallback_photo:flags.22?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int theme_emoticon:flags.15?string private_forward_name:flags.16?string bot_group_admin_rights:flags.17?ChatAdminRights bot_broadcast_admin_rights:flags.18?ChatAdminRights wallpaper:flags.24?WallPaper stories:flags.25?PeerStories business_work_hours:flags2.0?BusinessWorkHours business_location:flags2.1?BusinessLocation business_greeting_message:flags2.2?BusinessGreetingMessage business_away_message:flags2.3?BusinessAwayMessage business_intro:flags2.4?BusinessIntro birthday:flags2.5?Birthday personal_channel_id:flags2.6?long personal_channel_message:flags2.6?int stargifts_count:flags2.8?int starref_program:flags2.11?StarRefProgram bot_verification:flags2.12?BotVerification send_paid_messages_stars:flags2.14?long disallowed_gifts:flags2.15?DisallowedGiftsSettings = UserFull;
userFull#a02bc13e flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true voice_messages_forbidden:flags.20?true translations_disabled:flags.23?true stories_pinned_available:flags.26?true blocked_my_stories_from:flags.27?true wallpaper_overridden:flags.28?true contact_require_premium:flags.29?true read_dates_private:flags.30?true flags2:# sponsored_enabled:flags2.7?true can_view_revenue:flags2.9?true bot_can_manage_emoji_status:flags2.10?true display_gifts_button:flags2.16?true id:long about:flags.1?string settings:PeerSettings personal_photo:flags.21?Photo profile_photo:flags.2?Photo fallback_photo:flags.22?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int theme:flags.15?ChatTheme private_forward_name:flags.16?string bot_group_admin_rights:flags.17?ChatAdminRights bot_broadcast_admin_rights:flags.18?ChatAdminRights wallpaper:flags.24?WallPaper stories:flags.25?PeerStories business_work_hours:flags2.0?BusinessWorkHours business_location:flags2.1?BusinessLocation business_greeting_message:flags2.2?BusinessGreetingMessage business_away_message:flags2.3?BusinessAwayMessage business_intro:flags2.4?BusinessIntro birthday:flags2.5?Birthday personal_channel_id:flags2.6?long personal_channel_message:flags2.6?int stargifts_count:flags2.8?int starref_program:flags2.11?StarRefProgram bot_verification:flags2.12?BotVerification send_paid_messages_stars:flags2.14?long disallowed_gifts:flags2.15?DisallowedGiftsSettings stars_rating:flags2.17?StarsRating stars_my_pending_rating:flags2.18?StarsRating stars_my_pending_rating_date:flags2.18?int main_tab:flags2.20?ProfileTab saved_music:flags2.21?Document note:flags2.22?TextWithEntities = UserFull;
contact#145ade0b user_id:long mutual:Bool = Contact;
@@ -431,9 +451,9 @@ messages.dialogsSlice#71e094f3 count:int dialogs:Vector<Dialog> messages:Vector<
messages.dialogsNotModified#f0e3e596 count:int = messages.Dialogs;
messages.messages#8c718e87 messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
messages.messages#1d73e7ea messages:Vector<Message> topics:Vector<ForumTopic> chats:Vector<Chat> users:Vector<User> = messages.Messages;
messages.messagesSlice#3a54685e flags:# inexact:flags.1?true count:int next_rate:flags.0?int offset_id_offset:flags.2?int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
messages.messagesSlice#5f206716 flags:# inexact:flags.1?true count:int next_rate:flags.0?int offset_id_offset:flags.2?int search_flood:flags.3?SearchPostsFlood messages:Vector<Message> topics:Vector<ForumTopic> chats:Vector<Chat> users:Vector<User> = messages.Messages;
messages.channelMessages#c776ba4e flags:# inexact:flags.1?true pts:int count:int offset_id_offset:flags.2?int messages:Vector<Message> topics:Vector<ForumTopic> chats:Vector<Chat> users:Vector<User> = messages.Messages;
@@ -487,7 +507,7 @@ updateMessageID#4e90bfd6 id:int random_id:long = Update;
updateDeleteMessages#a20db0e5 messages:Vector<int> pts:int pts_count:int = Update;
updateUserTyping#c01e857f user_id:long action:SendMessageAction = Update;
updateUserTyping#2a17bf5c flags:# user_id:long top_msg_id:flags.0?int action:SendMessageAction = Update;
updateChatUserTyping#83487af0 chat_id:long from_id:Peer action:SendMessageAction = Update;
@@ -521,7 +541,7 @@ updatePrivacy#ee3b272a key:PrivacyKey rules:Vector<PrivacyRule> = 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;
updateReadHistoryInbox#9e84bc99 flags:# folder_id:flags.0?int peer:Peer top_msg_id:flags.1?int max_id:int still_unread_count:int pts:int pts_count:int = Update;
updateReadHistoryOutbox#2f2f21bf peer:Peer max_id:int pts:int pts_count:int = Update;
@@ -653,7 +673,7 @@ updateChat#f89a6a4e chat_id:long = Update;
updateGroupCallParticipants#f2ebdb4e call:InputGroupCall participants:Vector<GroupCallParticipant> version:int = Update;
updateGroupCall#97d64341 flags:# chat_id:flags.0?long call:GroupCall = Update;
updateGroupCall#9d2216e0 flags:# live_story:flags.2?true peer:flags.1?Peer call:GroupCall = Update;
updatePeerHistoryTTL#bb9bb9a5 flags:# peer:Peer ttl_period:flags.0?int = Update;
@@ -695,10 +715,6 @@ updateMoveStickerSetToTop#86fccf85 flags:# masks:flags.0?true emojis:flags.1?tru
updateMessageExtendedMedia#d5a41724 peer:Peer msg_id:int extended_media:Vector<MessageExtendedMedia> = Update;
updateChannelPinnedTopic#192efbe3 flags:# pinned:flags.0?true channel_id:long topic_id:int = Update;
updateChannelPinnedTopics#fe198602 flags:# channel_id:long order:flags.0?Vector<int> = Update;
updateUser#20529438 user_id:long = Update;
updateAutoSaveSettings#ec05b097 = Update;
@@ -751,8 +767,6 @@ updateBotDeleteBusinessMessage#a02a982e connection_id:string peer:Peer messages:
updateNewStoryReaction#1824e40b story_id:int peer:Peer reaction:Reaction = Update;
updateBroadcastRevenueTransactions#dfd961f5 peer:Peer balances:BroadcastRevenueBalances = Update;
updateStarsBalance#4e80a379 balance:StarsAmount = Update;
updateBusinessBotCallbackQuery#1ea2fda7 flags:# query_id:long user_id:long connection_id:string message:Message reply_to_message:flags.2?Message chat_instance:long data:flags.0?bytes = Update;
@@ -771,6 +785,22 @@ updateReadMonoForumInbox#77b0e372 channel_id:long saved_peer_id:Peer read_max_id
updateReadMonoForumOutbox#a4a79376 channel_id:long saved_peer_id:Peer read_max_id:int = Update;
updateMonoForumNoPaidException#9f812b08 flags:# exception:flags.0?true channel_id:long saved_peer_id:Peer = Update;
updateGroupCallMessage#d8326f0d call:InputGroupCall message:GroupCallMessage = Update;
updateGroupCallEncryptedMessage#c957a766 call:InputGroupCall from_id:Peer encrypted_message:bytes = Update;
updatePinnedForumTopic#683b2c52 flags:# pinned:flags.0?true peer:Peer topic_id:int = Update;
updatePinnedForumTopics#def143d0 flags:# peer:Peer order:flags.0?Vector<int> = Update;
updateDeleteGroupCallMessages#3e85e92c call:InputGroupCall messages:Vector<int> = Update;
updateStarGiftAuctionState#48e246c2 gift_id:long state:StarGiftAuctionState = Update;
updateStarGiftAuctionUserState#dc58f31e gift_id:long user_state:StarGiftAuctionUserState = Update;
updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;
updates.differenceEmpty#5d75a138 date:int seq:int = updates.Difference;
@@ -909,6 +939,8 @@ sendMessageEmojiInteraction#25972bcb emoticon:string msg_id:int interaction:Data
sendMessageEmojiInteractionSeen#b665902e emoticon:string = SendMessageAction;
sendMessageTextDraftAction#376d975c random_id:long text:TextWithEntities = SendMessageAction;
contacts.found#b3134d9d my_results:Vector<Peer> results:Vector<Peer> chats:Vector<Chat> users:Vector<User> = contacts.Found;
inputPrivacyKeyStatusTimestamp#4f96cb18 = InputPrivacyKey;
@@ -937,6 +969,8 @@ inputPrivacyKeyStarGiftsAutoSave#e1732341 = InputPrivacyKey;
inputPrivacyKeyNoPaidMessages#bdc597b4 = InputPrivacyKey;
inputPrivacyKeySavedMusic#4dbe9226 = InputPrivacyKey;
privacyKeyStatusTimestamp#bc2eab30 = PrivacyKey;
privacyKeyChatInvite#500e6dfa = PrivacyKey;
@@ -963,6 +997,8 @@ privacyKeyStarGiftsAutoSave#2ca4fdf8 = PrivacyKey;
privacyKeyNoPaidMessages#17d348d2 = PrivacyKey;
privacyKeySavedMusic#ff7a571b = PrivacyKey;
inputPrivacyValueAllowContacts#d09e07b = InputPrivacyRule;
inputPrivacyValueAllowAll#184b35ce = InputPrivacyRule;
@@ -1097,6 +1133,8 @@ inputStickerSetEmojiDefaultTopicIcons#44c1f8e9 = InputStickerSet;
inputStickerSetEmojiChannelDefaultStatuses#49748553 = InputStickerSet;
inputStickerSetTonGifts#1cf671a0 = InputStickerSet;
stickerSet#2dd14edc flags:# archived:flags.1?true official:flags.2?true masks:flags.3?true emojis:flags.7?true text_color:flags.9?true channel_emoji_status:flags.10?true creator:flags.11?true installed_date:flags.0?int id:long access_hash:long title:string short_name:string thumbs:flags.4?Vector<PhotoSize> thumb_dc_id:flags.4?int thumb_version:flags.4?int thumb_document_id:flags.8?long count:int hash:int = StickerSet;
messages.stickerSet#6e153f16 set:StickerSet packs:Vector<StickerPack> keywords:Vector<StickerKeyword> documents:Vector<Document> = messages.StickerSet;
@@ -1377,7 +1415,7 @@ contacts.topPeersDisabled#b52c939d = contacts.TopPeers;
draftMessageEmpty#1b0c841a flags:# date:flags.0?int = DraftMessage;
draftMessage#2d65321f flags:# no_webpage:flags.1?true invert_media:flags.6?true reply_to:flags.4?InputReplyTo message:string entities:flags.3?Vector<MessageEntity> media:flags.5?InputMedia date:int effect:flags.7?long = DraftMessage;
draftMessage#96eaa5eb flags:# no_webpage:flags.1?true invert_media:flags.6?true reply_to:flags.4?InputReplyTo message:string entities:flags.3?Vector<MessageEntity> media:flags.5?InputMedia date:int effect:flags.7?long suggested_post:flags.8?SuggestedPost = DraftMessage;
messages.featuredStickersNotModified#c6dc0c66 count:int = messages.FeaturedStickers;
@@ -1931,7 +1969,7 @@ chatOnlines#f041e250 onlines:int = ChatOnlines;
statsURL#47a971e0 url:string = StatsURL;
chatAdminRights#5fb224d5 flags:# change_info:flags.0?true post_messages:flags.1?true edit_messages:flags.2?true delete_messages:flags.3?true ban_users:flags.4?true invite_users:flags.5?true pin_messages:flags.7?true add_admins:flags.9?true anonymous:flags.10?true manage_call:flags.11?true other:flags.12?true manage_topics:flags.13?true post_stories:flags.14?true edit_stories:flags.15?true delete_stories:flags.16?true = ChatAdminRights;
chatAdminRights#5fb224d5 flags:# change_info:flags.0?true post_messages:flags.1?true edit_messages:flags.2?true delete_messages:flags.3?true ban_users:flags.4?true invite_users:flags.5?true pin_messages:flags.7?true add_admins:flags.9?true anonymous:flags.10?true manage_call:flags.11?true other:flags.12?true manage_topics:flags.13?true post_stories:flags.14?true edit_stories:flags.15?true delete_stories:flags.16?true manage_direct_messages:flags.17?true = ChatAdminRights;
chatBannedRights#9f120418 flags:# view_messages:flags.0?true send_messages:flags.1?true send_media:flags.2?true send_stickers:flags.3?true send_gifs:flags.4?true send_games:flags.5?true send_inline:flags.6?true embed_links:flags.7?true send_polls:flags.8?true change_info:flags.10?true invite_users:flags.15?true pin_messages:flags.17?true manage_topics:flags.18?true send_photos:flags.19?true send_videos:flags.20?true send_roundvideos:flags.21?true send_audios:flags.22?true send_voices:flags.23?true send_docs:flags.24?true send_plain:flags.25?true until_date:int = ChatBannedRights;
@@ -2029,6 +2067,10 @@ webPageAttributeStickerSet#50cc03d3 flags:# emojis:flags.0?true text_color:flags
webPageAttributeUniqueStarGift#cf6f6db8 gift:StarGift = WebPageAttribute;
webPageAttributeStarGiftCollection#31cad303 icons:Vector<Document> = WebPageAttribute;
webPageAttributeStarGiftAuction#34986ab gift:StarGift end_date:int center_color:int edge_color:int text_color:int = WebPageAttribute;
messages.votesList#4899484e flags:# count:int votes:Vector<MessagePeerVote> chats:Vector<Chat> users:Vector<User> next_offset:flags.0?string = messages.VotesList;
bankCardOpenUrl#f568028a url:string name:string = BankCardOpenUrl;
@@ -2091,7 +2133,7 @@ messages.messageViews#b6c4f543 views:Vector<MessageViews> chats:Vector<Chat> use
messages.discussionMessage#a6341782 flags:# messages:Vector<Message> max_id:flags.0?int read_inbox_max_id:flags.1?int read_outbox_max_id:flags.2?int unread_count:int chats:Vector<Chat> users:Vector<User> = messages.DiscussionMessage;
messageReplyHeader#afbc09db flags:# reply_to_scheduled:flags.2?true forum_topic:flags.3?true quote:flags.9?true reply_to_msg_id:flags.4?int reply_to_peer_id:flags.0?Peer reply_from:flags.5?MessageFwdHeader reply_media:flags.8?MessageMedia reply_to_top_id:flags.1?int quote_text:flags.6?string quote_entities:flags.7?Vector<MessageEntity> quote_offset:flags.10?int = MessageReplyHeader;
messageReplyHeader#6917560b flags:# reply_to_scheduled:flags.2?true forum_topic:flags.3?true quote:flags.9?true reply_to_msg_id:flags.4?int reply_to_peer_id:flags.0?Peer reply_from:flags.5?MessageFwdHeader reply_media:flags.8?MessageMedia reply_to_top_id:flags.1?int quote_text:flags.6?string quote_entities:flags.7?Vector<MessageEntity> quote_offset:flags.10?int todo_item_id:flags.11?int = MessageReplyHeader;
messageReplyStoryHeader#e5af939 peer:Peer story_id:int = MessageReplyHeader;
@@ -2103,7 +2145,7 @@ stats.messageStats#7fe91c14 views_graph:StatsGraph reactions_by_emotion_graph:St
groupCallDiscarded#7780bcb4 id:long access_hash:long duration:int = GroupCall;
groupCall#553b0ba1 flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true join_date_asc:flags.6?true schedule_start_subscribed:flags.8?true can_start_video:flags.9?true record_video_active:flags.11?true rtmp_stream:flags.12?true listeners_hidden:flags.13?true conference:flags.14?true creator:flags.15?true id:long access_hash:long participants_count:int title:flags.3?string stream_dc_id:flags.4?int record_start_date:flags.5?int schedule_date:flags.7?int unmuted_video_count:flags.10?int unmuted_video_limit:int version:int invite_link:flags.16?string = GroupCall;
groupCall#efb2b617 flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true join_date_asc:flags.6?true schedule_start_subscribed:flags.8?true can_start_video:flags.9?true record_video_active:flags.11?true rtmp_stream:flags.12?true listeners_hidden:flags.13?true conference:flags.14?true creator:flags.15?true messages_enabled:flags.17?true can_change_messages_enabled:flags.18?true min:flags.19?true id:long access_hash:long participants_count:int title:flags.3?string stream_dc_id:flags.4?int record_start_date:flags.5?int schedule_date:flags.7?int unmuted_video_count:flags.10?int unmuted_video_limit:int version:int invite_link:flags.16?string send_paid_messages_stars:flags.20?long default_send_as:flags.21?Peer = GroupCall;
inputGroupCall#d8aa840f id:long access_hash:long = InputGroupCall;
@@ -2111,7 +2153,7 @@ inputGroupCallSlug#fe06823f slug:string = InputGroupCall;
inputGroupCallInviteMessage#8c10603f msg_id:int = InputGroupCall;
groupCallParticipant#eba636fe flags:# muted:flags.0?true left:flags.1?true can_self_unmute:flags.2?true just_joined:flags.4?true versioned:flags.5?true min:flags.8?true muted_by_you:flags.9?true volume_by_admin:flags.10?true self:flags.12?true video_joined:flags.15?true peer:Peer date:int active_date:flags.3?int source:int volume:flags.7?int about:flags.11?string raise_hand_rating:flags.13?long video:flags.6?GroupCallParticipantVideo presentation:flags.14?GroupCallParticipantVideo = GroupCallParticipant;
groupCallParticipant#2a3dc7ac flags:# muted:flags.0?true left:flags.1?true can_self_unmute:flags.2?true just_joined:flags.4?true versioned:flags.5?true min:flags.8?true muted_by_you:flags.9?true volume_by_admin:flags.10?true self:flags.12?true video_joined:flags.15?true peer:Peer date:int active_date:flags.3?int source:int volume:flags.7?int about:flags.11?string raise_hand_rating:flags.13?long video:flags.6?GroupCallParticipantVideo presentation:flags.14?GroupCallParticipantVideo paid_stars_total:flags.16?long = GroupCallParticipant;
phone.groupCall#9e727aad call:GroupCall participants:Vector<GroupCallParticipant> participants_next_offset:string chats:Vector<Chat> users:Vector<User> = phone.GroupCall;
@@ -2181,9 +2223,17 @@ account.resetPasswordRequestedWait#e9effc7d until_date:int = account.ResetPasswo
account.resetPasswordOk#e926d63e = account.ResetPasswordResult;
sponsoredMessage#4d93a990 flags:# recommended:flags.5?true can_report:flags.12?true random_id:bytes url:string title:string message:string entities:flags.1?Vector<MessageEntity> photo:flags.6?Photo media:flags.14?MessageMedia color:flags.13?PeerColor button_text:string sponsor_info:flags.7?string additional_info:flags.8?string = SponsoredMessage;
chatTheme#c3dffc04 emoticon:string = ChatTheme;
messages.sponsoredMessages#c9ee1d87 flags:# posts_between:flags.0?int messages:Vector<SponsoredMessage> chats:Vector<Chat> users:Vector<User> = messages.SponsoredMessages;
chatThemeUniqueGift#3458f9c8 gift:StarGift theme_settings:Vector<ThemeSettings> = ChatTheme;
account.chatThemesNotModified#e011e1c4 = account.ChatThemes;
account.chatThemes#be098173 flags:# hash:long themes:Vector<ChatTheme> chats:Vector<Chat> users:Vector<User> next_offset:flags.0?string = account.ChatThemes;
sponsoredMessage#7dbf8673 flags:# recommended:flags.5?true can_report:flags.12?true random_id:bytes url:string title:string message:string entities:flags.1?Vector<MessageEntity> photo:flags.6?Photo media:flags.14?MessageMedia color:flags.13?PeerColor button_text:string sponsor_info:flags.7?string additional_info:flags.8?string min_display_duration:flags.15?int max_display_duration:flags.15?int = SponsoredMessage;
messages.sponsoredMessages#ffda656d flags:# posts_between:flags.0?int start_delay:flags.1?int between_delay:flags.2?int messages:Vector<SponsoredMessage> chats:Vector<Chat> users:Vector<User> = messages.SponsoredMessages;
messages.sponsoredMessagesEmpty#1839490f = messages.SponsoredMessages;
@@ -2291,7 +2341,15 @@ inputInvoicePremiumGiftStars#dabab2ef flags:# user_id:InputUser months:int messa
inputInvoiceBusinessBotTransferStars#f4997e42 bot:InputUser stars:long = InputInvoice;
inputInvoiceStarGiftResale#63cbc38c slug:string to_id:InputPeer = InputInvoice;
inputInvoiceStarGiftResale#c39f5324 flags:# ton:flags.0?true slug:string to_id:InputPeer = InputInvoice;
inputInvoiceStarGiftPrepaidUpgrade#9a0b48b8 peer:InputPeer hash:string = InputInvoice;
inputInvoicePremiumAuthCode#3e77f614 purpose:InputStorePaymentPurpose = InputInvoice;
inputInvoiceStarGiftDropOriginalDetails#923d8d1 stargift:InputSavedStarGift = InputInvoice;
inputInvoiceStarGiftAuctionBid#1ecafa10 flags:# hide_name:flags.0?true update_bid:flags.2?true peer:flags.3?InputPeer gift_id:long bid_amount:long message:flags.1?TextWithEntities = InputInvoice;
payments.exportedInvoice#aed0cbd9 url:string = payments.ExportedInvoice;
@@ -2307,7 +2365,7 @@ inputStorePaymentPremiumGiftCode#fb790393 flags:# users:Vector<InputUser> boost_
inputStorePaymentPremiumGiveaway#160544ca flags:# only_new_subscribers:flags.0?true winners_are_visible:flags.3?true boost_peer:InputPeer additional_peers:flags.1?Vector<InputPeer> countries_iso2:flags.2?Vector<string> prize_description:flags.4?string random_id:long until_date:int currency:string amount:long = InputStorePaymentPurpose;
inputStorePaymentStarsTopup#dddd0f56 stars:long currency:string amount:long = InputStorePaymentPurpose;
inputStorePaymentStarsTopup#f9a2a6cb flags:# stars:long currency:string amount:long spend_purpose_peer:flags.0?InputPeer = InputStorePaymentPurpose;
inputStorePaymentStarsGift#1d741ef7 user_id:InputUser stars:long currency:string amount:long = InputStorePaymentPurpose;
@@ -2377,7 +2435,7 @@ username#b4073647 flags:# editable:flags.0?true active:flags.1?true username:str
forumTopicDeleted#23f109b id:int = ForumTopic;
forumTopic#71701da9 flags:# my:flags.1?true closed:flags.2?true pinned:flags.3?true short:flags.5?true hidden:flags.6?true id:int date:int title:string icon_color:int icon_emoji_id:flags.0?long top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int from_id:Peer notify_settings:PeerNotifySettings draft:flags.4?DraftMessage = ForumTopic;
forumTopic#cdff0eca flags:# my:flags.1?true closed:flags.2?true pinned:flags.3?true short:flags.5?true hidden:flags.6?true title_missing:flags.7?true id:int date:int peer:Peer title:string icon_color:int icon_emoji_id:flags.0?long top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int from_id:Peer notify_settings:PeerNotifySettings draft:flags.4?DraftMessage = ForumTopic;
messages.forumTopics#367617d3 flags:# order_by_create_date:flags.0?true count:int topics:Vector<ForumTopic> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> pts:int = messages.ForumTopics;
@@ -2459,9 +2517,9 @@ storyViews#8d595cd6 flags:# has_viewers:flags.1?true views_count:int forwards_co
storyItemDeleted#51e6ee4f id:int = StoryItem;
storyItemSkipped#ffadc913 flags:# close_friends:flags.8?true id:int date:int expire_date:int = StoryItem;
storyItemSkipped#ffadc913 flags:# close_friends:flags.8?true live:flags.9?true id:int date:int expire_date:int = StoryItem;
storyItem#79b26a24 flags:# pinned:flags.5?true public:flags.7?true close_friends:flags.8?true min:flags.9?true noforwards:flags.10?true edited:flags.11?true contacts:flags.12?true selected_contacts:flags.13?true out:flags.16?true id:int date:int from_id:flags.18?Peer fwd_from:flags.17?StoryFwdHeader expire_date:int caption:flags.0?string entities:flags.1?Vector<MessageEntity> media:MessageMedia media_areas:flags.14?Vector<MediaArea> privacy:flags.2?Vector<PrivacyRule> views:flags.3?StoryViews sent_reaction:flags.15?Reaction = StoryItem;
storyItem#edf164f1 flags:# pinned:flags.5?true public:flags.7?true close_friends:flags.8?true min:flags.9?true noforwards:flags.10?true edited:flags.11?true contacts:flags.12?true selected_contacts:flags.13?true out:flags.16?true id:int date:int from_id:flags.18?Peer fwd_from:flags.17?StoryFwdHeader expire_date:int caption:flags.0?string entities:flags.1?Vector<MessageEntity> media:MessageMedia media_areas:flags.14?Vector<MediaArea> privacy:flags.2?Vector<PrivacyRule> views:flags.3?StoryViews sent_reaction:flags.15?Reaction albums:flags.19?Vector<int> = StoryItem;
stories.allStoriesNotModified#1158fe3e flags:# state:string stealth_mode:StoriesStealthMode = stories.AllStories;
@@ -2479,7 +2537,7 @@ stories.storyViewsList#59d78fc5 flags:# count:int views_count:int forwards_count
stories.storyViews#de9eed1d views:Vector<StoryViews> users:Vector<User> = stories.StoryViews;
inputReplyToMessage#b07038b0 flags:# reply_to_msg_id:int top_msg_id:flags.0?int reply_to_peer_id:flags.1?InputPeer quote_text:flags.2?string quote_entities:flags.3?Vector<MessageEntity> quote_offset:flags.4?int monoforum_peer_id:flags.5?InputPeer = InputReplyTo;
inputReplyToMessage#869fbe10 flags:# reply_to_msg_id:int top_msg_id:flags.0?int reply_to_peer_id:flags.1?InputPeer quote_text:flags.2?string quote_entities:flags.3?Vector<MessageEntity> quote_offset:flags.4?int monoforum_peer_id:flags.5?InputPeer todo_item_id:flags.6?int = InputReplyTo;
inputReplyToStory#5881323a peer:InputPeer story_id:int = InputReplyTo;
@@ -2517,7 +2575,7 @@ messages.webPage#fd5e12bd webpage:WebPage chats:Vector<Chat> users:Vector<User>
premiumGiftCodeOption#257e962b flags:# users:int months:int store_product:flags.0?string store_quantity:flags.1?int currency:string amount:long = PremiumGiftCodeOption;
payments.checkedGiftCode#284a1096 flags:# via_giveaway:flags.2?true from_id:flags.4?Peer giveaway_msg_id:flags.3?int to_id:flags.0?long date:int months:int used_date:flags.1?int chats:Vector<Chat> users:Vector<User> = payments.CheckedGiftCode;
payments.checkedGiftCode#eb983f8f flags:# via_giveaway:flags.2?true from_id:flags.4?Peer giveaway_msg_id:flags.3?int to_id:flags.0?long date:int days:int used_date:flags.1?int chats:Vector<Chat> users:Vector<User> = payments.CheckedGiftCode;
payments.giveawayInfo#4367daa0 flags:# participating:flags.0?true preparing_results:flags.3?true start_date:int joined_too_early_date:flags.1?int admin_disallowed_chat_id:flags.2?long disallowed_country:flags.4?string = payments.GiveawayInfo;
@@ -2553,6 +2611,10 @@ stats.publicForwards#93037e20 flags:# count:int forwards:Vector<PublicForward> n
peerColor#b54b5acf flags:# color:flags.0?int background_emoji_id:flags.1?long = PeerColor;
peerColorCollectible#b9c0639a flags:# collectible_id:long gift_emoji_id:long background_emoji_id:long accent_color:int colors:Vector<int> dark_accent_color:flags.0?int dark_colors:flags.1?Vector<int> = PeerColor;
inputPeerColorCollectible#b8ea86a9 collectible_id:long = PeerColor;
help.peerColorSet#26219a58 colors:Vector<int> = help.PeerColorSet;
help.peerColorProfileSet#767d61eb palette_colors:Vector<int> bg_colors:Vector<int> story_colors:Vector<int> = help.PeerColorSet;
@@ -2573,7 +2635,7 @@ stories.storyReactionsList#aa5f789c flags:# count:int reactions:Vector<StoryReac
savedDialog#bd87cb6c flags:# pinned:flags.2?true peer:Peer top_message:int = SavedDialog;
monoForumDialog#64407ea7 flags:# unread_mark:flags.3?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_reactions_count:int draft:flags.1?DraftMessage = SavedDialog;
monoForumDialog#64407ea7 flags:# unread_mark:flags.3?true nopaid_messages_exception:flags.4?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_reactions_count:int draft:flags.1?DraftMessage = SavedDialog;
messages.savedDialogs#f83ae221 dialogs:Vector<SavedDialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.SavedDialogs;
@@ -2691,26 +2753,12 @@ channels.sponsoredMessageReportResultAdsHidden#3e3bcf2f = channels.SponsoredMess
channels.sponsoredMessageReportResultReported#ad798849 = channels.SponsoredMessageReportResult;
stats.broadcastRevenueStats#5407e297 top_hours_graph:StatsGraph revenue_graph:StatsGraph balances:BroadcastRevenueBalances usd_rate:double = stats.BroadcastRevenueStats;
stats.broadcastRevenueWithdrawalUrl#ec659737 url:string = stats.BroadcastRevenueWithdrawalUrl;
broadcastRevenueTransactionProceeds#557e2cc4 amount:long from_date:int to_date:int = BroadcastRevenueTransaction;
broadcastRevenueTransactionWithdrawal#5a590978 flags:# pending:flags.0?true failed:flags.2?true amount:long date:int provider:string transaction_date:flags.1?int transaction_url:flags.1?string = BroadcastRevenueTransaction;
broadcastRevenueTransactionRefund#42d30d2e amount:long date:int provider:string = BroadcastRevenueTransaction;
stats.broadcastRevenueTransactions#87158466 count:int transactions:Vector<BroadcastRevenueTransaction> = stats.BroadcastRevenueTransactions;
reactionNotificationsFromContacts#bac3a61a = ReactionNotificationsFrom;
reactionNotificationsFromAll#4b9e22a0 = ReactionNotificationsFrom;
reactionsNotifySettings#56e34970 flags:# messages_notify_from:flags.0?ReactionNotificationsFrom stories_notify_from:flags.1?ReactionNotificationsFrom sound:NotificationSound show_previews:Bool = ReactionsNotifySettings;
broadcastRevenueBalances#c3ff71e7 flags:# withdrawal_enabled:flags.0?true current_balance:long available_balance:long overall_revenue:long = BroadcastRevenueBalances;
availableEffect#93c3e27e flags:# premium_required:flags.2?true id:long emoticon:string static_icon_id:flags.0?long effect_sticker_id:long effect_animation_id:flags.1?long = AvailableEffect;
messages.availableEffectsNotModified#d1ed9a5b = messages.AvailableEffects;
@@ -2737,7 +2785,7 @@ starsTransactionPeerAPI#f9677aad = StarsTransactionPeer;
starsTopupOption#bd915c0 flags:# extended:flags.1?true stars:long store_product:flags.0?string currency:string amount:long = StarsTopupOption;
starsTransaction#a39fd94a flags:# refund:flags.3?true pending:flags.4?true failed:flags.6?true gift:flags.10?true reaction:flags.11?true stargift_upgrade:flags.18?true business_transfer:flags.21?true stargift_resale:flags.22?true id:string stars:StarsAmount date:int peer:StarsTransactionPeer title:flags.0?string description:flags.1?string photo:flags.2?WebDocument transaction_date:flags.5?int transaction_url:flags.5?string bot_payload:flags.7?bytes msg_id:flags.8?int extended_media:flags.9?Vector<MessageMedia> subscription_period:flags.12?int giveaway_post_id:flags.13?int stargift:flags.14?StarGift floodskip_number:flags.15?int starref_commission_permille:flags.16?int starref_peer:flags.17?Peer starref_amount:flags.17?StarsAmount paid_messages:flags.19?int premium_gift_months:flags.20?int = StarsTransaction;
starsTransaction#13659eb0 flags:# refund:flags.3?true pending:flags.4?true failed:flags.6?true gift:flags.10?true reaction:flags.11?true stargift_upgrade:flags.18?true business_transfer:flags.21?true stargift_resale:flags.22?true posts_search:flags.24?true stargift_prepaid_upgrade:flags.25?true stargift_drop_original_details:flags.26?true phonegroup_message:flags.27?true stargift_auction_bid:flags.28?true id:string amount:StarsAmount date:int peer:StarsTransactionPeer title:flags.0?string description:flags.1?string photo:flags.2?WebDocument transaction_date:flags.5?int transaction_url:flags.5?string bot_payload:flags.7?bytes msg_id:flags.8?int extended_media:flags.9?Vector<MessageMedia> subscription_period:flags.12?int giveaway_post_id:flags.13?int stargift:flags.14?StarGift floodskip_number:flags.15?int starref_commission_permille:flags.16?int starref_peer:flags.17?Peer starref_amount:flags.17?StarsAmount paid_messages:flags.19?int premium_gift_months:flags.20?int ads_proceeds_from_date:flags.23?int ads_proceeds_to_date:flags.23?int = StarsTransaction;
payments.starsStatus#6c9ce8ed flags:# balance:StarsAmount subscriptions:flags.1?Vector<StarsSubscription> subscriptions_next_offset:flags.2?string subscriptions_missing_balance:flags.4?long history:flags.3?Vector<StarsTransaction> next_offset:flags.0?string chats:Vector<Chat> users:Vector<User> = payments.StarsStatus;
@@ -2749,7 +2797,7 @@ geoPointAddress#de4c5d93 flags:# country_iso2:string state:flags.0?string city:f
starsRevenueStatus#febe5491 flags:# withdrawal_enabled:flags.0?true current_balance:StarsAmount available_balance:StarsAmount overall_revenue:StarsAmount next_withdrawal_at:flags.1?int = StarsRevenueStatus;
payments.starsRevenueStats#c92bb73b revenue_graph:StatsGraph status:StarsRevenueStatus usd_rate:double = payments.StarsRevenueStats;
payments.starsRevenueStats#6c207376 flags:# top_hours_graph:flags.0?StatsGraph revenue_graph:StatsGraph status:StarsRevenueStatus usd_rate:double = payments.StarsRevenueStats;
payments.starsRevenueWithdrawalUrl#1dab80b7 url:string = payments.StarsRevenueWithdrawalUrl;
@@ -2775,13 +2823,13 @@ starsGiveawayOption#94ce852a flags:# extended:flags.0?true default:flags.1?true
starsGiveawayWinnersOption#54236209 flags:# default:flags.0?true users:int per_user_stars:long = StarsGiveawayWinnersOption;
starGift#c62aca28 flags:# limited:flags.0?true sold_out:flags.1?true birthday:flags.2?true id:long sticker:Document stars:long availability_remains:flags.0?int availability_total:flags.0?int availability_resale:flags.4?long convert_stars:long first_sale_date:flags.1?int last_sale_date:flags.1?int upgrade_stars:flags.3?long resell_min_stars:flags.4?long title:flags.5?string = StarGift;
starGift#1b9a4d7f flags:# limited:flags.0?true sold_out:flags.1?true birthday:flags.2?true require_premium:flags.7?true limited_per_user:flags.8?true peer_color_available:flags.10?true auction:flags.11?true id:long sticker:Document stars:long availability_remains:flags.0?int availability_total:flags.0?int availability_resale:flags.4?long convert_stars:long first_sale_date:flags.1?int last_sale_date:flags.1?int upgrade_stars:flags.3?long resell_min_stars:flags.4?long title:flags.5?string released_by:flags.6?Peer per_user_total:flags.8?int per_user_remains:flags.8?int locked_until_date:flags.9?int auction_slug:flags.11?string gifts_per_round:flags.11?int = StarGift;
starGiftUnique#6411db89 flags:# id:long title:string slug:string num:int owner_id:flags.0?Peer owner_name:flags.1?string owner_address:flags.2?string attributes:Vector<StarGiftAttribute> availability_issued:int availability_total:int gift_address:flags.3?string resell_stars:flags.4?long = StarGift;
starGiftUnique#b0bf741b flags:# require_premium:flags.6?true resale_ton_only:flags.7?true theme_available:flags.9?true id:long gift_id:long title:string slug:string num:int owner_id:flags.0?Peer owner_name:flags.1?string owner_address:flags.2?string attributes:Vector<StarGiftAttribute> availability_issued:int availability_total:int gift_address:flags.3?string resell_amount:flags.4?Vector<StarsAmount> released_by:flags.5?Peer value_amount:flags.8?long value_currency:flags.8?string theme_peer:flags.10?Peer peer_color:flags.11?PeerColor host_id:flags.12?Peer = StarGift;
payments.starGiftsNotModified#a388a368 = payments.StarGifts;
payments.starGifts#901689ea hash:int gifts:Vector<StarGift> = payments.StarGifts;
payments.starGifts#2ed82995 hash:int gifts:Vector<StarGift> chats:Vector<Chat> users:Vector<User> = payments.StarGifts;
messageReportOption#7903e3d9 text:string option:bytes = MessageReportOption;
@@ -2807,6 +2855,8 @@ payments.suggestedStarRefBots#b4d5d859 flags:# count:int suggested_bots:Vector<S
starsAmount#bbb6b4a3 amount:long nanos:int = StarsAmount;
starsTonAmount#74aee3e0 amount:long = StarsAmount;
messages.foundStickersNotModified#6010c534 flags:# next_offset:flags.0?int = messages.FoundStickers;
messages.foundStickers#82c9e290 flags:# next_offset:flags.0?int hash:long stickers:Vector<Document> = messages.FoundStickers;
@@ -2823,17 +2873,17 @@ starGiftAttributeBackdrop#d93d859c name:string backdrop_id:int center_color:int
starGiftAttributeOriginalDetails#e0bff26c flags:# sender_id:flags.0?Peer recipient_id:Peer date:int message:flags.1?TextWithEntities = StarGiftAttribute;
payments.starGiftUpgradePreview#167bd90b sample_attributes:Vector<StarGiftAttribute> = payments.StarGiftUpgradePreview;
payments.starGiftUpgradePreview#3de1dfed sample_attributes:Vector<StarGiftAttribute> prices:Vector<StarGiftUpgradePrice> next_prices:Vector<StarGiftUpgradePrice> = payments.StarGiftUpgradePreview;
users.users#62d706b8 users:Vector<User> = users.Users;
users.usersSlice#315a4974 count:int users:Vector<User> = users.Users;
payments.uniqueStarGift#caa2f60b gift:StarGift users:Vector<User> = payments.UniqueStarGift;
payments.uniqueStarGift#416c56e8 gift:StarGift chats:Vector<Chat> users:Vector<User> = payments.UniqueStarGift;
messages.webPagePreview#b53e8b21 media:MessageMedia users:Vector<User> = messages.WebPagePreview;
messages.webPagePreview#8c9a88ac media:MessageMedia chats:Vector<Chat> users:Vector<User> = messages.WebPagePreview;
savedStarGift#dfda0499 flags:# name_hidden:flags.0?true unsaved:flags.5?true refunded:flags.9?true can_upgrade:flags.10?true pinned_to_top:flags.12?true from_id:flags.1?Peer date:int gift:StarGift message:flags.2?TextWithEntities msg_id:flags.3?int saved_id:flags.11?long convert_stars:flags.4?long upgrade_stars:flags.6?long can_export_at:flags.7?int transfer_stars:flags.8?long can_transfer_at:flags.13?int can_resell_at:flags.14?int = SavedStarGift;
savedStarGift#8983a452 flags:# name_hidden:flags.0?true unsaved:flags.5?true refunded:flags.9?true can_upgrade:flags.10?true pinned_to_top:flags.12?true upgrade_separate:flags.17?true from_id:flags.1?Peer date:int gift:StarGift message:flags.2?TextWithEntities msg_id:flags.3?int saved_id:flags.11?long convert_stars:flags.4?long upgrade_stars:flags.6?long can_export_at:flags.7?int transfer_stars:flags.8?long can_transfer_at:flags.13?int can_resell_at:flags.14?int collection_id:flags.15?Vector<int> prepaid_upgrade_hash:flags.16?string drop_original_details_stars:flags.18?long = SavedStarGift;
payments.savedStarGifts#95f389b1 flags:# count:int chat_notifications_enabled:flags.1?Bool gifts:Vector<SavedStarGift> next_offset:flags.0?string chats:Vector<Chat> users:Vector<User> = payments.SavedStarGifts;
@@ -2861,7 +2911,7 @@ requirementToContactPaidMessages#b4f67e93 stars_amount:long = RequirementToConta
businessBotRights#a0624cf7 flags:# reply:flags.0?true read_messages:flags.1?true delete_sent_messages:flags.2?true delete_received_messages:flags.3?true edit_name:flags.4?true edit_bio:flags.5?true edit_profile_photo:flags.6?true edit_username:flags.7?true view_gifts:flags.8?true sell_gifts:flags.9?true change_gift_settings:flags.10?true transfer_and_upgrade_gifts:flags.11?true transfer_stars:flags.12?true manage_stories:flags.13?true = BusinessBotRights;
disallowedGiftsSettings#71f276c4 flags:# disallow_unlimited_stargifts:flags.0?true disallow_limited_stargifts:flags.1?true disallow_unique_stargifts:flags.2?true disallow_premium_gifts:flags.3?true = DisallowedGiftsSettings;
disallowedGiftsSettings#71f276c4 flags:# disallow_unlimited_stargifts:flags.0?true disallow_limited_stargifts:flags.1?true disallow_unique_stargifts:flags.2?true disallow_premium_gifts:flags.3?true disallow_stargifts_from_channels:flags.4?true = DisallowedGiftsSettings;
sponsoredPeer#c69708d3 flags:# random_id:bytes peer:Peer sponsor_info:flags.0?string additional_info:flags.1?string = SponsoredPeer;
@@ -2883,6 +2933,102 @@ stories.canSendStoryCount#c387c04e count_remains:int = stories.CanSendStoryCount
pendingSuggestion#e7e82e12 suggestion:string title:TextWithEntities description:TextWithEntities url:string = PendingSuggestion;
todoItem#cba9a52f id:int title:TextWithEntities = TodoItem;
todoList#49b92a26 flags:# others_can_append:flags.0?true others_can_complete:flags.1?true title:TextWithEntities list:Vector<TodoItem> = TodoList;
todoCompletion#221bb5e4 id:int completed_by:Peer date:int = TodoCompletion;
suggestedPost#e8e37e5 flags:# accepted:flags.1?true rejected:flags.2?true price:flags.3?StarsAmount schedule_date:flags.0?int = SuggestedPost;
starsRating#1b0e4f07 flags:# level:int current_level_stars:long stars:long next_level_stars:flags.0?long = StarsRating;
starGiftCollection#9d6b13b0 flags:# collection_id:int title:string icon:flags.0?Document gifts_count:int hash:long = StarGiftCollection;
payments.starGiftCollectionsNotModified#a0ba4f17 = payments.StarGiftCollections;
payments.starGiftCollections#8a2932f3 collections:Vector<StarGiftCollection> = payments.StarGiftCollections;
storyAlbum#9325705a flags:# album_id:int title:string icon_photo:flags.0?Photo icon_video:flags.1?Document = StoryAlbum;
stories.albumsNotModified#564edaeb = stories.Albums;
stories.albums#c3987a3a hash:long albums:Vector<StoryAlbum> = stories.Albums;
searchPostsFlood#3e0b5b6a flags:# query_is_free:flags.0?true total_daily:int remains:int wait_till:flags.1?int stars_amount:long = SearchPostsFlood;
payments.uniqueStarGiftValueInfo#512fe446 flags:# last_sale_on_fragment:flags.1?true value_is_average:flags.6?true currency:string value:long initial_sale_date:int initial_sale_stars:long initial_sale_price:long last_sale_date:flags.0?int last_sale_price:flags.0?long floor_price:flags.2?long average_price:flags.3?long listed_count:flags.4?int fragment_listed_count:flags.5?int fragment_listed_url:flags.5?string = payments.UniqueStarGiftValueInfo;
profileTabPosts#b98cd696 = ProfileTab;
profileTabGifts#4d4bd46a = ProfileTab;
profileTabMedia#72c64955 = ProfileTab;
profileTabFiles#ab339c00 = ProfileTab;
profileTabMusic#9f27d26e = ProfileTab;
profileTabVoice#e477092e = ProfileTab;
profileTabLinks#d3656499 = ProfileTab;
profileTabGifs#a2c0f695 = ProfileTab;
users.savedMusicNotModified#e3878aa4 count:int = users.SavedMusic;
users.savedMusic#34a2f297 count:int documents:Vector<Document> = users.SavedMusic;
account.savedMusicIdsNotModified#4fc81d6e = account.SavedMusicIds;
account.savedMusicIds#998d6636 ids:Vector<long> = account.SavedMusicIds;
payments.checkCanSendGiftResultOk#374fa7ad = payments.CheckCanSendGiftResult;
payments.checkCanSendGiftResultFail#d5e58274 reason:TextWithEntities = payments.CheckCanSendGiftResult;
inputChatThemeEmpty#83268483 = InputChatTheme;
inputChatTheme#c93de95c emoticon:string = InputChatTheme;
inputChatThemeUniqueGift#87e5dfe4 slug:string = InputChatTheme;
starGiftUpgradePrice#99ea331d date:int upgrade_stars:long = StarGiftUpgradePrice;
groupCallMessage#1a8afc7e flags:# from_admin:flags.1?true id:int from_id:Peer date:int message:TextWithEntities paid_message_stars:flags.0?long = GroupCallMessage;
groupCallDonor#ee430c85 flags:# top:flags.0?true my:flags.1?true anonymous:flags.2?true peer_id:flags.3?Peer stars:long = GroupCallDonor;
phone.groupCallStars#9d1dbd26 total_stars:long top_donors:Vector<GroupCallDonor> chats:Vector<Chat> users:Vector<User> = phone.GroupCallStars;
recentStory#711d692d flags:# live:flags.0?true max_id:flags.1?int = RecentStory;
auctionBidLevel#310240cc pos:int amount:long date:int = AuctionBidLevel;
starGiftAuctionStateNotModified#fe333952 = StarGiftAuctionState;
starGiftAuctionState#5db04f4b version:int start_date:int end_date:int min_bid_amount:long bid_levels:Vector<AuctionBidLevel> top_bidders:Vector<long> next_round_at:int gifts_left:int current_round:int total_rounds:int = StarGiftAuctionState;
starGiftAuctionStateFinished#7d967c3a start_date:int end_date:int average_price:long = StarGiftAuctionState;
starGiftAuctionUserState#2eeed1c4 flags:# returned:flags.1?true bid_amount:flags.0?long bid_date:flags.0?int min_bid_amount:flags.0?long bid_peer:flags.0?Peer acquired_count:int = StarGiftAuctionUserState;
payments.starGiftAuctionState#e98e474 gift:StarGift state:StarGiftAuctionState user_state:StarGiftAuctionUserState timeout:int users:Vector<User> = payments.StarGiftAuctionState;
starGiftAuctionAcquiredGift#ab60e20b flags:# name_hidden:flags.0?true peer:Peer date:int bid_amount:long round:int pos:int message:flags.1?TextWithEntities = StarGiftAuctionAcquiredGift;
payments.starGiftAuctionAcquiredGifts#7d5bd1f0 gifts:Vector<StarGiftAuctionAcquiredGift> users:Vector<User> chats:Vector<Chat> = payments.StarGiftAuctionAcquiredGifts;
starGiftActiveAuctionState#d31bc45d gift:StarGift state:StarGiftAuctionState user_state:StarGiftAuctionUserState = StarGiftActiveAuctionState;
payments.starGiftActiveAuctionsNotModified#db33dad0 = payments.StarGiftActiveAuctions;
payments.starGiftActiveAuctions#97f187d8 auctions:Vector<StarGiftActiveAuctionState> users:Vector<User> = payments.StarGiftActiveAuctions;
inputStarGiftAuction#2e16c98 gift_id:long = InputStarGiftAuction;
inputStarGiftAuctionSlug#7ab58308 slug:string = InputStarGiftAuction;
---functions---
@@ -2954,6 +3100,8 @@ auth.resetLoginEmail#7e960193 phone_number:string phone_code_hash:string = auth.
auth.reportMissingCode#cb9deff6 phone_number:string phone_code_hash:string mnc:string = Bool;
auth.checkPaidAuth#56e59f9c phone_number:string phone_code_hash:string form_id:long = auth.SentCode;
account.registerDevice#ec86017a flags:# no_muted:flags.0?true token_type:int token:string app_sandbox:Bool secret:bytes other_uids:Vector<long> = Bool;
account.unregisterDevice#6a0d3206 token_type:int token:string other_uids:Vector<long> = Bool;
@@ -3130,7 +3278,7 @@ account.deleteAutoSaveExceptions#53bc0020 = Bool;
account.invalidateSignInCodes#ca8ae8ba codes:Vector<string> = Bool;
account.updateColor#7cefa15d flags:# for_profile:flags.1?true color:flags.2?int background_emoji_id:flags.0?long = Bool;
account.updateColor#684d214e flags:# for_profile:flags.1?true color:flags.2?PeerColor = Bool;
account.getDefaultBackgroundEmojis#a60ab9ce hash:long = EmojiList;
@@ -3180,9 +3328,17 @@ account.setReactionsNotifySettings#316ce548 settings:ReactionsNotifySettings = R
account.getCollectibleEmojiStatuses#2e7b4543 hash:long = account.EmojiStatuses;
account.addNoPaidMessagesException#6f688aa7 flags:# refund_charged:flags.0?true user_id:InputUser = Bool;
account.getPaidMessagesRevenue#19ba4a67 flags:# parent_peer:flags.0?InputPeer user_id:InputUser = account.PaidMessagesRevenue;
account.getPaidMessagesRevenue#f1266f38 user_id:InputUser = account.PaidMessagesRevenue;
account.toggleNoPaidMessagesException#fe2eda76 flags:# refund_charged:flags.0?true require_payment:flags.2?true parent_peer:flags.1?InputPeer user_id:InputUser = Bool;
account.setMainProfileTab#5dee78b0 tab:ProfileTab = Bool;
account.saveMusic#b26732a9 flags:# unsave:flags.0?true id:InputDocument after_id:flags.1?InputDocument = Bool;
account.getSavedMusicIds#e09d5faf hash:long = account.SavedMusicIds;
account.getUniqueGiftChatThemes#e42ce9c9 offset:string limit:int hash:long = account.ChatThemes;
users.getUsers#d91a548 id:Vector<InputUser> = Vector<User>;
@@ -3192,6 +3348,12 @@ users.setSecureValueErrors#90c894b5 id:InputUser errors:Vector<SecureValueError>
users.getRequirementsToContact#d89a83a3 id:Vector<InputUser> = Vector<RequirementToContact>;
users.getSavedMusic#788d7fe3 id:InputUser offset:int limit:int hash:long = users.SavedMusic;
users.getSavedMusicByID#7573a4e9 id:InputUser documents:Vector<InputDocument> = users.SavedMusic;
users.suggestBirthday#fc533372 id:InputUser birthday:Birthday = Updates;
contacts.getContactIDs#7adc669d hash:long = Vector<int>;
contacts.getStatuses#c4a353ee = Vector<ContactStatus>;
@@ -3224,7 +3386,7 @@ contacts.getSaved#82f1e39f = Vector<SavedContact>;
contacts.toggleTopPeers#8514bdda enabled:Bool = Bool;
contacts.addContact#e8f463d0 flags:# add_phone_privacy_exception:flags.0?true id:InputUser first_name:string last_name:string phone:string = Updates;
contacts.addContact#d9ba2e54 flags:# add_phone_privacy_exception:flags.0?true id:InputUser first_name:string last_name:string phone:string note:flags.1?TextWithEntities = Updates;
contacts.acceptContact#f831a20f id:InputUser = Updates;
@@ -3246,6 +3408,8 @@ contacts.getBirthdays#daeda864 = contacts.ContactBirthdays;
contacts.getSponsoredPeers#b6c8c393 q:string = contacts.SponsoredPeers;
contacts.updateContactNote#139f63fb id:InputUser note:TextWithEntities = Bool;
messages.getMessages#63c66506 id:Vector<InputMessage> = messages.Messages;
messages.getDialogs#a0f4cb4f flags:# exclude_pinned:flags.0?true folder_id:flags.1?int offset_date:int offset_id:int offset_peer:InputPeer limit:int hash:long = messages.Dialogs;
@@ -3264,11 +3428,11 @@ messages.receivedMessages#5a954c0 max_id:int = Vector<ReceivedNotifyMessage>;
messages.setTyping#58943ee2 flags:# peer:InputPeer top_msg_id:flags.0?int action:SendMessageAction = Bool;
messages.sendMessage#fbf2340a flags:# no_webpage:flags.1?true silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true invert_media:flags.16?true allow_paid_floodskip:flags.19?true peer:InputPeer reply_to:flags.0?InputReplyTo message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long allow_paid_stars:flags.21?long = Updates;
messages.sendMessage#545cd15a flags:# no_webpage:flags.1?true silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true invert_media:flags.16?true allow_paid_floodskip:flags.19?true peer:InputPeer reply_to:flags.0?InputReplyTo message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int schedule_repeat_period:flags.24?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long allow_paid_stars:flags.21?long suggested_post:flags.22?SuggestedPost = Updates;
messages.sendMedia#a550cd78 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true invert_media:flags.16?true allow_paid_floodskip:flags.19?true peer:InputPeer reply_to:flags.0?InputReplyTo media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long allow_paid_stars:flags.21?long = Updates;
messages.sendMedia#330e77f flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true invert_media:flags.16?true allow_paid_floodskip:flags.19?true peer:InputPeer reply_to:flags.0?InputReplyTo media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int schedule_repeat_period:flags.24?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long allow_paid_stars:flags.21?long suggested_post:flags.22?SuggestedPost = Updates;
messages.forwardMessages#38f0188c flags:# silent:flags.5?true background:flags.6?true with_my_score:flags.8?true drop_author:flags.11?true drop_media_captions:flags.12?true noforwards:flags.14?true allow_paid_floodskip:flags.19?true from_peer:InputPeer id:Vector<int> random_id:Vector<long> to_peer:InputPeer top_msg_id:flags.9?int reply_to:flags.22?InputReplyTo schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut video_timestamp:flags.20?int allow_paid_stars:flags.21?long = Updates;
messages.forwardMessages#41d41ade flags:# silent:flags.5?true background:flags.6?true with_my_score:flags.8?true drop_author:flags.11?true drop_media_captions:flags.12?true noforwards:flags.14?true allow_paid_floodskip:flags.19?true from_peer:InputPeer id:Vector<int> random_id:Vector<long> to_peer:InputPeer top_msg_id:flags.9?int reply_to:flags.22?InputReplyTo schedule_date:flags.10?int schedule_repeat_period:flags.24?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut video_timestamp:flags.20?int allow_paid_stars:flags.21?long suggested_post:flags.23?SuggestedPost = Updates;
messages.reportSpam#cf1592db peer:InputPeer = Bool;
@@ -3358,7 +3522,7 @@ messages.sendInlineBotResult#c0cf7646 flags:# silent:flags.5?true background:fla
messages.getMessageEditData#fda68d36 peer:InputPeer id:int = messages.MessageEditData;
messages.editMessage#dfd14005 flags:# no_webpage:flags.1?true invert_media:flags.16?true peer:InputPeer id:int message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.15?int quick_reply_shortcut_id:flags.17?int = Updates;
messages.editMessage#51e842e1 flags:# no_webpage:flags.1?true invert_media:flags.16?true peer:InputPeer id:int message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.15?int schedule_repeat_period:flags.18?int quick_reply_shortcut_id:flags.17?int = Updates;
messages.editInlineBotMessage#83557dba flags:# no_webpage:flags.1?true invert_media:flags.16?true id:InputBotInlineMessageID message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> = Bool;
@@ -3368,7 +3532,7 @@ messages.setBotCallbackAnswer#d58f130a flags:# alert:flags.1?true query_id:long
messages.getPeerDialogs#e470bcfd peers:Vector<InputDialogPeer> = messages.PeerDialogs;
messages.saveDraft#d372c5ce flags:# no_webpage:flags.1?true invert_media:flags.6?true reply_to:flags.4?InputReplyTo peer:InputPeer message:string entities:flags.3?Vector<MessageEntity> media:flags.5?InputMedia effect:flags.7?long = Bool;
messages.saveDraft#54ae308e flags:# no_webpage:flags.1?true invert_media:flags.6?true reply_to:flags.4?InputReplyTo peer:InputPeer message:string entities:flags.3?Vector<MessageEntity> media:flags.5?InputMedia effect:flags.7?long suggested_post:flags.8?SuggestedPost = Bool;
messages.getAllDrafts#6a3f8d65 = Updates;
@@ -3526,7 +3690,7 @@ messages.setHistoryTTL#b80e5fe4 peer:InputPeer period:int = Updates;
messages.checkHistoryImportPeer#5dc60f03 peer:InputPeer = messages.CheckedHistoryImportPeer;
messages.setChatTheme#e63be13f peer:InputPeer emoticon:string = Updates;
messages.setChatTheme#81202c9 peer:InputPeer theme:InputChatTheme = Updates;
messages.getMessageReadParticipants#31c1c44f peer:InputPeer msg_id:int = Vector<ReadParticipantDate>;
@@ -3686,7 +3850,7 @@ messages.clickSponsoredMessage#8235057e flags:# media:flags.0?true fullscreen:fl
messages.reportSponsoredMessage#12cbf0c4 random_id:bytes option:bytes = channels.SponsoredMessageReportResult;
messages.getSponsoredMessages#9bd2f439 peer:InputPeer = messages.SponsoredMessages;
messages.getSponsoredMessages#3d6ce850 flags:# peer:InputPeer msg_id:flags.0?int = messages.SponsoredMessages;
messages.savePreparedInlineMessage#f21f7f2f flags:# result:InputBotInlineResult user_id:InputUser peer_types:flags.0?Vector<InlineQueryPeerType> = messages.BotPreparedInlineMessage;
@@ -3700,6 +3864,26 @@ messages.getSavedDialogsByID#6f6f9c96 flags:# parent_peer:flags.1?InputPeer ids:
messages.readSavedHistory#ba4a3b5b parent_peer:InputPeer peer:InputPeer max_id:int = Bool;
messages.toggleTodoCompleted#d3e03124 peer:InputPeer msg_id:int completed:Vector<int> incompleted:Vector<int> = Updates;
messages.appendTodoList#21a61057 peer:InputPeer msg_id:int list:Vector<TodoItem> = Updates;
messages.toggleSuggestedPostApproval#8107455c flags:# reject:flags.1?true peer:InputPeer msg_id:int schedule_date:flags.0?int reject_comment:flags.2?string = Updates;
messages.getForumTopics#3ba47bff flags:# peer:InputPeer q:flags.0?string offset_date:int offset_id:int offset_topic:int limit:int = messages.ForumTopics;
messages.getForumTopicsByID#af0a4a08 peer:InputPeer topics:Vector<int> = messages.ForumTopics;
messages.editForumTopic#cecc1134 flags:# peer:InputPeer topic_id:int title:flags.0?string icon_emoji_id:flags.1?long closed:flags.2?Bool hidden:flags.3?Bool = Updates;
messages.updatePinnedForumTopic#175df251 peer:InputPeer topic_id:int pinned:Bool = Updates;
messages.reorderPinnedForumTopics#e7841f0 flags:# force:flags.0?true peer:InputPeer order:Vector<int> = Updates;
messages.createForumTopic#2f98c3d5 flags:# title_missing:flags.4?true peer:InputPeer title:string icon_color:flags.0?int icon_emoji_id:flags.3?long random_id:long send_as:flags.2?InputPeer = Updates;
messages.deleteTopicHistory#d2816f10 peer:InputPeer top_msg_id:int = messages.AffectedHistory;
updates.getState#edd4882a = updates.State;
updates.getDifference#19c2f763 flags:# pts:int pts_limit:flags.1?int pts_total_limit:flags.0?int date:int qts:int qts_limit:flags.2?int = updates.Difference;
@@ -3852,7 +4036,7 @@ channels.getInactiveChannels#11e831ee = messages.InactiveChats;
channels.convertToGigagroup#b290c69 channel:InputChannel = Updates;
channels.getSendAs#e785a43f flags:# for_paid_reactions:flags.0?true peer:InputPeer = channels.SendAsPeers;
channels.getSendAs#e785a43f flags:# for_paid_reactions:flags.0?true for_live_stories:flags.1?true peer:InputPeer = channels.SendAsPeers;
channels.deleteParticipantHistory#367544db channel:InputChannel participant:InputPeer = messages.AffectedHistory;
@@ -3868,20 +4052,6 @@ channels.deactivateAllUsernames#a245dd3 channel:InputChannel = Bool;
channels.toggleForum#3ff75734 channel:InputChannel enabled:Bool tabs:Bool = Updates;
channels.createForumTopic#f40c0224 flags:# channel:InputChannel title:string icon_color:flags.0?int icon_emoji_id:flags.3?long random_id:long send_as:flags.2?InputPeer = Updates;
channels.getForumTopics#de560d1 flags:# channel:InputChannel q:flags.0?string offset_date:int offset_id:int offset_topic:int limit:int = messages.ForumTopics;
channels.getForumTopicsByID#b0831eb9 channel:InputChannel topics:Vector<int> = messages.ForumTopics;
channels.editForumTopic#f4dfa185 flags:# channel:InputChannel topic_id:int title:flags.0?string icon_emoji_id:flags.1?long closed:flags.2?Bool hidden:flags.3?Bool = Updates;
channels.updatePinnedForumTopic#6c2d9026 channel:InputChannel topic_id:int pinned:Bool = Updates;
channels.deleteTopicHistory#34435f2d channel:InputChannel top_msg_id:int = messages.AffectedHistory;
channels.reorderPinnedForumTopics#2950a18f flags:# force:flags.0?true channel:InputChannel order:Vector<int> = Updates;
channels.toggleAntiSpam#68f3e4eb channel:InputChannel enabled:Bool = Updates;
channels.reportAntiSpamFalsePositive#a850a693 channel:InputChannel msg_id:int = Bool;
@@ -3902,7 +4072,7 @@ channels.setEmojiStickers#3cd930b7 channel:InputChannel stickerset:InputStickerS
channels.restrictSponsoredMessages#9ae91519 channel:InputChannel restricted:Bool = Updates;
channels.searchPosts#d19f987b hashtag:string offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages;
channels.searchPosts#f2c4f24d flags:# hashtag:flags.0?string query:flags.1?string offset_rate:int offset_peer:InputPeer offset_id:int limit:int allow_paid_stars:flags.2?long = messages.Messages;
channels.updatePaidMessagesPrice#4b12327b flags:# broadcast_messages_allowed:flags.0?true channel:InputChannel send_paid_messages_stars:long = Updates;
@@ -3910,6 +4080,10 @@ channels.toggleAutotranslation#167fc0a1 channel:InputChannel enabled:Bool = Upda
channels.getMessageAuthor#ece2a0e6 channel:InputChannel id:int = User;
channels.checkSearchPostsFlood#22567115 flags:# query:flags.0?string = SearchPostsFlood;
channels.setMainProfileTab#3583fcb1 channel:InputChannel tab:ProfileTab = Bool;
bots.sendCustomRequest#aa2769ed custom_method:string params:DataJSON = DataJSON;
bots.answerWebhookJSONQuery#e6213f4d query_id:long data:DataJSON = Bool;
@@ -4002,21 +4176,21 @@ payments.launchPrepaidGiveaway#5ff58f20 peer:InputPeer giveaway_id:long purpose:
payments.getStarsTopupOptions#c00ec7d3 = Vector<StarsTopupOption>;
payments.getStarsStatus#104fcfa7 peer:InputPeer = payments.StarsStatus;
payments.getStarsStatus#4ea9b3bf flags:# ton:flags.0?true peer:InputPeer = payments.StarsStatus;
payments.getStarsTransactions#69da4557 flags:# inbound:flags.0?true outbound:flags.1?true ascending:flags.2?true subscription_id:flags.3?string peer:InputPeer offset:string limit:int = payments.StarsStatus;
payments.getStarsTransactions#69da4557 flags:# inbound:flags.0?true outbound:flags.1?true ascending:flags.2?true ton:flags.4?true subscription_id:flags.3?string peer:InputPeer offset:string limit:int = payments.StarsStatus;
payments.sendStarsForm#7998c914 form_id:long invoice:InputInvoice = payments.PaymentResult;
payments.refundStarsCharge#25ae8f4a user_id:InputUser charge_id:string = Updates;
payments.getStarsRevenueStats#d91ffad6 flags:# dark:flags.0?true peer:InputPeer = payments.StarsRevenueStats;
payments.getStarsRevenueStats#d91ffad6 flags:# dark:flags.0?true ton:flags.1?true peer:InputPeer = payments.StarsRevenueStats;
payments.getStarsRevenueWithdrawalUrl#13bbe8b3 peer:InputPeer stars:long password:InputCheckPasswordSRP = payments.StarsRevenueWithdrawalUrl;
payments.getStarsRevenueWithdrawalUrl#2433dc92 flags:# ton:flags.0?true peer:InputPeer amount:flags.1?long password:InputCheckPasswordSRP = payments.StarsRevenueWithdrawalUrl;
payments.getStarsRevenueAdsAccountUrl#d1d7efc5 peer:InputPeer = payments.StarsRevenueAdsAccountUrl;
payments.getStarsTransactionsByID#27842d2e peer:InputPeer id:Vector<InputStarsTransaction> = payments.StarsStatus;
payments.getStarsTransactionsByID#2dca16b8 flags:# ton:flags.0?true peer:InputPeer id:Vector<InputStarsTransaction> = payments.StarsStatus;
payments.getStarsGiftOptions#d3c96bc8 flags:# user_id:flags.0?InputUser = Vector<StarsGiftOption>;
@@ -4054,7 +4228,7 @@ payments.transferStarGift#7f18176a stargift:InputSavedStarGift to_id:InputPeer =
payments.getUniqueStarGift#a1974d72 slug:string = payments.UniqueStarGift;
payments.getSavedStarGifts#23830de9 flags:# exclude_unsaved:flags.0?true exclude_saved:flags.1?true exclude_unlimited:flags.2?true exclude_limited:flags.3?true exclude_unique:flags.4?true sort_by_value:flags.5?true peer:InputPeer offset:string limit:int = payments.SavedStarGifts;
payments.getSavedStarGifts#a319e569 flags:# exclude_unsaved:flags.0?true exclude_saved:flags.1?true exclude_unlimited:flags.2?true exclude_unique:flags.4?true sort_by_value:flags.5?true exclude_upgradable:flags.7?true exclude_unupgradable:flags.8?true peer_color_available:flags.9?true exclude_hosted:flags.10?true peer:InputPeer collection_id:flags.6?int offset:string limit:int = payments.SavedStarGifts;
payments.getSavedStarGift#b455a106 stargift:Vector<InputSavedStarGift> = payments.SavedStarGifts;
@@ -4068,7 +4242,27 @@ payments.canPurchaseStore#4fdc5ea7 purpose:InputStorePaymentPurpose = Bool;
payments.getResaleStarGifts#7a5fa236 flags:# sort_by_price:flags.1?true sort_by_num:flags.2?true attributes_hash:flags.0?long gift_id:long attributes:flags.3?Vector<StarGiftAttributeId> offset:string limit:int = payments.ResaleStarGifts;
payments.updateStarGiftPrice#3baea4e1 stargift:InputSavedStarGift resell_stars:long = Updates;
payments.updateStarGiftPrice#edbe6ccb stargift:InputSavedStarGift resell_amount:StarsAmount = Updates;
payments.createStarGiftCollection#1f4a0e87 peer:InputPeer title:string stargift:Vector<InputSavedStarGift> = StarGiftCollection;
payments.updateStarGiftCollection#4fddbee7 flags:# peer:InputPeer collection_id:int title:flags.0?string delete_stargift:flags.1?Vector<InputSavedStarGift> add_stargift:flags.2?Vector<InputSavedStarGift> order:flags.3?Vector<InputSavedStarGift> = StarGiftCollection;
payments.reorderStarGiftCollections#c32af4cc peer:InputPeer order:Vector<int> = Bool;
payments.deleteStarGiftCollection#ad5648e8 peer:InputPeer collection_id:int = Bool;
payments.getStarGiftCollections#981b91dd peer:InputPeer hash:long = payments.StarGiftCollections;
payments.getUniqueStarGiftValueInfo#4365af6b slug:string = payments.UniqueStarGiftValueInfo;
payments.checkCanSendGift#c0c4edc9 gift_id:long = payments.CheckCanSendGiftResult;
payments.getStarGiftAuctionState#5c9ff4d6 auction:InputStarGiftAuction version:int = payments.StarGiftAuctionState;
payments.getStarGiftAuctionAcquiredGifts#6ba2cbec gift_id:long = payments.StarGiftAuctionAcquiredGifts;
payments.getStarGiftActiveAuctions#a5d0514d hash:long = payments.StarGiftActiveAuctions;
stickers.createStickerSet#9021ab67 flags:# masks:flags.0?true emojis:flags.5?true text_color:flags.6?true user_id:InputUser title:string short_name:string thumb:flags.2?InputDocument stickers:Vector<InputStickerSetItem> software:flags.3?string = messages.StickerSet;
@@ -4120,7 +4314,7 @@ phone.inviteToGroupCall#7b393160 call:InputGroupCall users:Vector<InputUser> = U
phone.discardGroupCall#7a777135 call:InputGroupCall = Updates;
phone.toggleGroupCallSettings#74bbb43d flags:# reset_invite_hash:flags.1?true call:InputGroupCall join_muted:flags.0?Bool = Updates;
phone.toggleGroupCallSettings#974392f2 flags:# reset_invite_hash:flags.1?true call:InputGroupCall join_muted:flags.0?Bool messages_enabled:flags.2?Bool send_paid_messages_stars:flags.3?long = Updates;
phone.getGroupCall#41845db call:InputGroupCall limit:int = phone.GroupCall;
@@ -4150,7 +4344,7 @@ phone.leaveGroupCallPresentation#1c50d144 call:InputGroupCall = Updates;
phone.getGroupCallStreamChannels#1ab21940 call:InputGroupCall = phone.GroupCallStreamChannels;
phone.getGroupCallStreamRtmpUrl#deb3abbf peer:InputPeer revoke:Bool = phone.GroupCallStreamRtmpUrl;
phone.getGroupCallStreamRtmpUrl#5af4c73a flags:# live_story:flags.0?true peer:InputPeer revoke:Bool = phone.GroupCallStreamRtmpUrl;
phone.saveCallLog#41248786 peer:InputPhoneCall file:InputFile = Bool;
@@ -4166,6 +4360,18 @@ phone.declineConferenceCallInvite#3c479971 msg_id:int = Updates;
phone.getGroupCallChainBlocks#ee9f88a6 call:InputGroupCall sub_chain_id:int offset:int limit:int = Updates;
phone.sendGroupCallMessage#b1d11410 flags:# call:InputGroupCall random_id:long message:TextWithEntities allow_paid_stars:flags.0?long send_as:flags.1?InputPeer = Updates;
phone.sendGroupCallEncryptedMessage#e5afa56d call:InputGroupCall encrypted_message:bytes = Bool;
phone.deleteGroupCallMessages#f64f54f7 flags:# report_spam:flags.0?true call:InputGroupCall messages:Vector<int> = Updates;
phone.deleteGroupCallParticipantMessages#1dbfeca0 flags:# report_spam:flags.0?true call:InputGroupCall participant:InputPeer = Updates;
phone.getGroupCallStars#6f636302 call:InputGroupCall = phone.GroupCallStars;
phone.saveDefaultSendAs#4167add1 call:InputGroupCall send_as:InputPeer = Bool;
langpack.getLangPack#f2f2330a lang_pack:string lang_code:string = LangPackDifference;
langpack.getStrings#efea3803 lang_pack:string lang_code:string keys:Vector<string> = Vector<LangPackString>;
@@ -4192,12 +4398,6 @@ stats.getStoryStats#374fef40 flags:# dark:flags.0?true peer:InputPeer id:int = s
stats.getStoryPublicForwards#a6437ef6 peer:InputPeer id:int offset:string limit:int = stats.PublicForwards;
stats.getBroadcastRevenueStats#f788ee19 flags:# dark:flags.0?true peer:InputPeer = stats.BroadcastRevenueStats;
stats.getBroadcastRevenueWithdrawalUrl#9df4faad peer:InputPeer password:InputCheckPasswordSRP = stats.BroadcastRevenueWithdrawalUrl;
stats.getBroadcastRevenueTransactions#70990b6d peer:InputPeer offset:int limit:int = stats.BroadcastRevenueTransactions;
chatlists.exportChatlistInvite#8472478e chatlist:InputChatlist title:string peers:Vector<InputPeer> = chatlists.ExportedChatlistInvite;
chatlists.deleteExportedInvite#719c5c5e chatlist:InputChatlist slug:string = Bool;
@@ -4222,7 +4422,7 @@ chatlists.leaveChatlist#74fae13a chatlist:InputChatlist peers:Vector<InputPeer>
stories.canSendStory#30eb63f0 peer:InputPeer = stories.CanSendStoryCount;
stories.sendStory#e4e6694b flags:# pinned:flags.2?true noforwards:flags.4?true fwd_modified:flags.7?true peer:InputPeer media:InputMedia media_areas:flags.5?Vector<MediaArea> caption:flags.0?string entities:flags.1?Vector<MessageEntity> privacy_rules:Vector<InputPrivacyRule> random_id:long period:flags.3?int fwd_from_id:flags.6?InputPeer fwd_from_story:flags.6?int = Updates;
stories.sendStory#737fc2ec flags:# pinned:flags.2?true noforwards:flags.4?true fwd_modified:flags.7?true peer:InputPeer media:InputMedia media_areas:flags.5?Vector<MediaArea> caption:flags.0?string entities:flags.1?Vector<MessageEntity> privacy_rules:Vector<InputPrivacyRule> random_id:long period:flags.3?int fwd_from_id:flags.6?InputPeer fwd_from_story:flags.6?int albums:flags.8?Vector<int> = Updates;
stories.editStory#b583ba46 flags:# peer:InputPeer id:int media:flags.0?InputMedia media_areas:flags.3?Vector<MediaArea> caption:flags.1?string entities:flags.1?Vector<MessageEntity> privacy_rules:flags.2?Vector<InputPrivacyRule> = Updates;
@@ -4260,7 +4460,7 @@ stories.getPeerStories#2c4ada50 peer:InputPeer = stories.PeerStories;
stories.getAllReadPeerStories#9b5ae7f9 = Updates;
stories.getPeerMaxIDs#535983c3 id:Vector<InputPeer> = Vector<int>;
stories.getPeerMaxIDs#78499170 id:Vector<InputPeer> = Vector<RecentStory>;
stories.getChatsToSend#a56a8b60 = messages.Chats;
@@ -4272,6 +4472,20 @@ stories.togglePinnedToTop#b297e9b peer:InputPeer id:Vector<int> = Bool;
stories.searchPosts#d1810907 flags:# hashtag:flags.0?string area:flags.1?MediaArea peer:flags.2?InputPeer offset:string limit:int = stories.FoundStories;
stories.createAlbum#a36396e5 peer:InputPeer title:string stories:Vector<int> = StoryAlbum;
stories.updateAlbum#5e5259b6 flags:# peer:InputPeer album_id:int title:flags.0?string delete_stories:flags.1?Vector<int> add_stories:flags.2?Vector<int> order:flags.3?Vector<int> = StoryAlbum;
stories.reorderAlbums#8535fbd9 peer:InputPeer order:Vector<int> = Bool;
stories.deleteAlbum#8d3456d0 peer:InputPeer album_id:int = Bool;
stories.getAlbums#25b3eac7 peer:InputPeer hash:long = stories.Albums;
stories.getAlbumStories#ac806d61 peer:InputPeer album_id:int offset:int limit:int = stories.Stories;
stories.startLive#d069ccde flags:# pinned:flags.2?true noforwards:flags.4?true rtmp_stream:flags.5?true peer:InputPeer caption:flags.0?string entities:flags.1?Vector<MessageEntity> privacy_rules:Vector<InputPrivacyRule> random_id:long messages_enabled:flags.6?Bool send_paid_messages_stars:flags.7?long = Updates;
premium.getBoostsList#60f67660 flags:# gifts:flags.0?true peer:InputPeer offset:string limit:int = premium.BoostsList;
premium.getMyBoosts#be77b4a = premium.MyBoosts;
@@ -4330,4 +4544,4 @@ test.useError#ee75af01 = Error;
test.useConfigSimple#f9b7b23d = help.ConfigSimple;
// LAYER 204
// LAYER 218
@@ -26,8 +26,9 @@ const _PhotoSizeSourceType_name = "PhotoSizeSourceLegacyPhotoSizeSourceThumbnail
var _PhotoSizeSourceType_index = [...]uint16{0, 21, 45, 76, 105, 139, 164, 201, 236, 276, 317, 340}
func (i PhotoSizeSourceType) String() string {
if i < 0 || i >= PhotoSizeSourceType(len(_PhotoSizeSourceType_index)-1) {
idx := int(i) - 0
if i < 0 || idx >= len(_PhotoSizeSourceType_index)-1 {
return "PhotoSizeSourceType(" + strconv.FormatInt(int64(i), 10) + ")"
}
return _PhotoSizeSourceType_name[_PhotoSizeSourceType_index[i]:_PhotoSizeSourceType_index[i+1]]
return _PhotoSizeSourceType_name[_PhotoSizeSourceType_index[idx]:_PhotoSizeSourceType_index[idx+1]]
}
+3 -2
View File
@@ -34,8 +34,9 @@ const _Type_name = "ThumbnailProfilePhotoPhotoVoiceVideoDocumentEncryptedTempSti
var _Type_index = [...]uint8{0, 9, 21, 26, 31, 36, 44, 53, 57, 64, 69, 78, 96, 105, 114, 123, 129, 139, 153, 161}
func (i Type) String() string {
if i < 0 || i >= Type(len(_Type_index)-1) {
idx := int(i) - 0
if i < 0 || idx >= len(_Type_index)-1 {
return "Type(" + strconv.FormatInt(int64(i), 10) + ")"
}
return _Type_name[_Type_index[i]:_Type_index[i+1]]
return _Type_name[_Type_index[idx]:_Type_index[idx+1]]
}
-2
View File
@@ -4,8 +4,6 @@ package td
//go:generate go run go.mau.fi/mautrix-telegram/pkg/gotd/cmd/gotdgen --doc "https://core.telegram.org/" --clean --server --handlers --mapping --slices --package tg --target tg --schema _schema/telegram.tl
//go:generate go run go.mau.fi/mautrix-telegram/pkg/gotd/cmd/gotdgen --doc "https://core.telegram.org/" --clean --package e2e --target tg/e2e --schema _schema/encrypted.tl
//go:generate go run go.mau.fi/mautrix-telegram/pkg/gotd/cmd/gotdgen --clean --package tdapi --tdlib-json --target tdapi --schema _schema/tdapi.tl
//go:generate go run go.mau.fi/mautrix-telegram/pkg/gotd/cmd/gotdgen --clean --client=false --package tgtrace --target tgtrace --schema _schema/trace.tl
//go:generate go run go.mau.fi/mautrix-telegram/pkg/gotd/cmd/gotdgen --clean --package mt --target mt --client=false --schema _schema/mt.tl
-379
View File
@@ -1,379 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AccentColor represents TL type `accentColor#53312690`.
type AccentColor struct {
// Accent color identifier
ID int32
// Identifier of a built-in color to use in places, where only one color is needed; 0-6
BuiltInAccentColorID int32
// The list of 1-3 colors in RGB format, describing the accent color, as expected to be
// shown in light themes
LightThemeColors []int32
// The list of 1-3 colors in RGB format, describing the accent color, as expected to be
// shown in dark themes
DarkThemeColors []int32
// The minimum chat boost level required to use the color in a channel chat
MinChannelChatBoostLevel int32
}
// AccentColorTypeID is TL type id of AccentColor.
const AccentColorTypeID = 0x53312690
// Ensuring interfaces in compile-time for AccentColor.
var (
_ bin.Encoder = &AccentColor{}
_ bin.Decoder = &AccentColor{}
_ bin.BareEncoder = &AccentColor{}
_ bin.BareDecoder = &AccentColor{}
)
func (a *AccentColor) Zero() bool {
if a == nil {
return true
}
if !(a.ID == 0) {
return false
}
if !(a.BuiltInAccentColorID == 0) {
return false
}
if !(a.LightThemeColors == nil) {
return false
}
if !(a.DarkThemeColors == nil) {
return false
}
if !(a.MinChannelChatBoostLevel == 0) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AccentColor) String() string {
if a == nil {
return "AccentColor(nil)"
}
type Alias AccentColor
return fmt.Sprintf("AccentColor%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AccentColor) TypeID() uint32 {
return AccentColorTypeID
}
// TypeName returns name of type in TL schema.
func (*AccentColor) TypeName() string {
return "accentColor"
}
// TypeInfo returns info about TL type.
func (a *AccentColor) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "accentColor",
ID: AccentColorTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "ID",
SchemaName: "id",
},
{
Name: "BuiltInAccentColorID",
SchemaName: "built_in_accent_color_id",
},
{
Name: "LightThemeColors",
SchemaName: "light_theme_colors",
},
{
Name: "DarkThemeColors",
SchemaName: "dark_theme_colors",
},
{
Name: "MinChannelChatBoostLevel",
SchemaName: "min_channel_chat_boost_level",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AccentColor) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode accentColor#53312690 as nil")
}
b.PutID(AccentColorTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AccentColor) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode accentColor#53312690 as nil")
}
b.PutInt32(a.ID)
b.PutInt32(a.BuiltInAccentColorID)
b.PutInt(len(a.LightThemeColors))
for _, v := range a.LightThemeColors {
b.PutInt32(v)
}
b.PutInt(len(a.DarkThemeColors))
for _, v := range a.DarkThemeColors {
b.PutInt32(v)
}
b.PutInt32(a.MinChannelChatBoostLevel)
return nil
}
// Decode implements bin.Decoder.
func (a *AccentColor) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode accentColor#53312690 to nil")
}
if err := b.ConsumeID(AccentColorTypeID); err != nil {
return fmt.Errorf("unable to decode accentColor#53312690: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AccentColor) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode accentColor#53312690 to nil")
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode accentColor#53312690: field id: %w", err)
}
a.ID = value
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode accentColor#53312690: field built_in_accent_color_id: %w", err)
}
a.BuiltInAccentColorID = value
}
{
headerLen, err := b.Int()
if err != nil {
return fmt.Errorf("unable to decode accentColor#53312690: field light_theme_colors: %w", err)
}
if headerLen > 0 {
a.LightThemeColors = make([]int32, 0, headerLen%bin.PreallocateLimit)
}
for idx := 0; idx < headerLen; idx++ {
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode accentColor#53312690: field light_theme_colors: %w", err)
}
a.LightThemeColors = append(a.LightThemeColors, value)
}
}
{
headerLen, err := b.Int()
if err != nil {
return fmt.Errorf("unable to decode accentColor#53312690: field dark_theme_colors: %w", err)
}
if headerLen > 0 {
a.DarkThemeColors = make([]int32, 0, headerLen%bin.PreallocateLimit)
}
for idx := 0; idx < headerLen; idx++ {
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode accentColor#53312690: field dark_theme_colors: %w", err)
}
a.DarkThemeColors = append(a.DarkThemeColors, value)
}
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode accentColor#53312690: field min_channel_chat_boost_level: %w", err)
}
a.MinChannelChatBoostLevel = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AccentColor) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode accentColor#53312690 as nil")
}
b.ObjStart()
b.PutID("accentColor")
b.Comma()
b.FieldStart("id")
b.PutInt32(a.ID)
b.Comma()
b.FieldStart("built_in_accent_color_id")
b.PutInt32(a.BuiltInAccentColorID)
b.Comma()
b.FieldStart("light_theme_colors")
b.ArrStart()
for _, v := range a.LightThemeColors {
b.PutInt32(v)
b.Comma()
}
b.StripComma()
b.ArrEnd()
b.Comma()
b.FieldStart("dark_theme_colors")
b.ArrStart()
for _, v := range a.DarkThemeColors {
b.PutInt32(v)
b.Comma()
}
b.StripComma()
b.ArrEnd()
b.Comma()
b.FieldStart("min_channel_chat_boost_level")
b.PutInt32(a.MinChannelChatBoostLevel)
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AccentColor) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode accentColor#53312690 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("accentColor"); err != nil {
return fmt.Errorf("unable to decode accentColor#53312690: %w", err)
}
case "id":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode accentColor#53312690: field id: %w", err)
}
a.ID = value
case "built_in_accent_color_id":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode accentColor#53312690: field built_in_accent_color_id: %w", err)
}
a.BuiltInAccentColorID = value
case "light_theme_colors":
if err := b.Arr(func(b tdjson.Decoder) error {
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode accentColor#53312690: field light_theme_colors: %w", err)
}
a.LightThemeColors = append(a.LightThemeColors, value)
return nil
}); err != nil {
return fmt.Errorf("unable to decode accentColor#53312690: field light_theme_colors: %w", err)
}
case "dark_theme_colors":
if err := b.Arr(func(b tdjson.Decoder) error {
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode accentColor#53312690: field dark_theme_colors: %w", err)
}
a.DarkThemeColors = append(a.DarkThemeColors, value)
return nil
}); err != nil {
return fmt.Errorf("unable to decode accentColor#53312690: field dark_theme_colors: %w", err)
}
case "min_channel_chat_boost_level":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode accentColor#53312690: field min_channel_chat_boost_level: %w", err)
}
a.MinChannelChatBoostLevel = value
default:
return b.Skip()
}
return nil
})
}
// GetID returns value of ID field.
func (a *AccentColor) GetID() (value int32) {
if a == nil {
return
}
return a.ID
}
// GetBuiltInAccentColorID returns value of BuiltInAccentColorID field.
func (a *AccentColor) GetBuiltInAccentColorID() (value int32) {
if a == nil {
return
}
return a.BuiltInAccentColorID
}
// GetLightThemeColors returns value of LightThemeColors field.
func (a *AccentColor) GetLightThemeColors() (value []int32) {
if a == nil {
return
}
return a.LightThemeColors
}
// GetDarkThemeColors returns value of DarkThemeColors field.
func (a *AccentColor) GetDarkThemeColors() (value []int32) {
if a == nil {
return
}
return a.DarkThemeColors
}
// GetMinChannelChatBoostLevel returns value of MinChannelChatBoostLevel field.
func (a *AccentColor) GetMinChannelChatBoostLevel() (value int32) {
if a == nil {
return
}
return a.MinChannelChatBoostLevel
}
-237
View File
@@ -1,237 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AcceptCallRequest represents TL type `acceptCall#d97562d0`.
type AcceptCallRequest struct {
// Call identifier
CallID int32
// The call protocols supported by the application
Protocol CallProtocol
}
// AcceptCallRequestTypeID is TL type id of AcceptCallRequest.
const AcceptCallRequestTypeID = 0xd97562d0
// Ensuring interfaces in compile-time for AcceptCallRequest.
var (
_ bin.Encoder = &AcceptCallRequest{}
_ bin.Decoder = &AcceptCallRequest{}
_ bin.BareEncoder = &AcceptCallRequest{}
_ bin.BareDecoder = &AcceptCallRequest{}
)
func (a *AcceptCallRequest) Zero() bool {
if a == nil {
return true
}
if !(a.CallID == 0) {
return false
}
if !(a.Protocol.Zero()) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AcceptCallRequest) String() string {
if a == nil {
return "AcceptCallRequest(nil)"
}
type Alias AcceptCallRequest
return fmt.Sprintf("AcceptCallRequest%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AcceptCallRequest) TypeID() uint32 {
return AcceptCallRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*AcceptCallRequest) TypeName() string {
return "acceptCall"
}
// TypeInfo returns info about TL type.
func (a *AcceptCallRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "acceptCall",
ID: AcceptCallRequestTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "CallID",
SchemaName: "call_id",
},
{
Name: "Protocol",
SchemaName: "protocol",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AcceptCallRequest) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode acceptCall#d97562d0 as nil")
}
b.PutID(AcceptCallRequestTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AcceptCallRequest) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode acceptCall#d97562d0 as nil")
}
b.PutInt32(a.CallID)
if err := a.Protocol.Encode(b); err != nil {
return fmt.Errorf("unable to encode acceptCall#d97562d0: field protocol: %w", err)
}
return nil
}
// Decode implements bin.Decoder.
func (a *AcceptCallRequest) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode acceptCall#d97562d0 to nil")
}
if err := b.ConsumeID(AcceptCallRequestTypeID); err != nil {
return fmt.Errorf("unable to decode acceptCall#d97562d0: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AcceptCallRequest) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode acceptCall#d97562d0 to nil")
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode acceptCall#d97562d0: field call_id: %w", err)
}
a.CallID = value
}
{
if err := a.Protocol.Decode(b); err != nil {
return fmt.Errorf("unable to decode acceptCall#d97562d0: field protocol: %w", err)
}
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AcceptCallRequest) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode acceptCall#d97562d0 as nil")
}
b.ObjStart()
b.PutID("acceptCall")
b.Comma()
b.FieldStart("call_id")
b.PutInt32(a.CallID)
b.Comma()
b.FieldStart("protocol")
if err := a.Protocol.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode acceptCall#d97562d0: field protocol: %w", err)
}
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AcceptCallRequest) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode acceptCall#d97562d0 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("acceptCall"); err != nil {
return fmt.Errorf("unable to decode acceptCall#d97562d0: %w", err)
}
case "call_id":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode acceptCall#d97562d0: field call_id: %w", err)
}
a.CallID = value
case "protocol":
if err := a.Protocol.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode acceptCall#d97562d0: field protocol: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// GetCallID returns value of CallID field.
func (a *AcceptCallRequest) GetCallID() (value int32) {
if a == nil {
return
}
return a.CallID
}
// GetProtocol returns value of Protocol field.
func (a *AcceptCallRequest) GetProtocol() (value CallProtocol) {
if a == nil {
return
}
return a.Protocol
}
// AcceptCall invokes method acceptCall#d97562d0 returning error if any.
func (c *Client) AcceptCall(ctx context.Context, request *AcceptCallRequest) error {
var ok Ok
if err := c.rpc.Invoke(ctx, request, &ok); err != nil {
return err
}
return nil
}
-206
View File
@@ -1,206 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AcceptTermsOfServiceRequest represents TL type `acceptTermsOfService#7efe03e4`.
type AcceptTermsOfServiceRequest struct {
// Terms of service identifier
TermsOfServiceID string
}
// AcceptTermsOfServiceRequestTypeID is TL type id of AcceptTermsOfServiceRequest.
const AcceptTermsOfServiceRequestTypeID = 0x7efe03e4
// Ensuring interfaces in compile-time for AcceptTermsOfServiceRequest.
var (
_ bin.Encoder = &AcceptTermsOfServiceRequest{}
_ bin.Decoder = &AcceptTermsOfServiceRequest{}
_ bin.BareEncoder = &AcceptTermsOfServiceRequest{}
_ bin.BareDecoder = &AcceptTermsOfServiceRequest{}
)
func (a *AcceptTermsOfServiceRequest) Zero() bool {
if a == nil {
return true
}
if !(a.TermsOfServiceID == "") {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AcceptTermsOfServiceRequest) String() string {
if a == nil {
return "AcceptTermsOfServiceRequest(nil)"
}
type Alias AcceptTermsOfServiceRequest
return fmt.Sprintf("AcceptTermsOfServiceRequest%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AcceptTermsOfServiceRequest) TypeID() uint32 {
return AcceptTermsOfServiceRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*AcceptTermsOfServiceRequest) TypeName() string {
return "acceptTermsOfService"
}
// TypeInfo returns info about TL type.
func (a *AcceptTermsOfServiceRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "acceptTermsOfService",
ID: AcceptTermsOfServiceRequestTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "TermsOfServiceID",
SchemaName: "terms_of_service_id",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AcceptTermsOfServiceRequest) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode acceptTermsOfService#7efe03e4 as nil")
}
b.PutID(AcceptTermsOfServiceRequestTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AcceptTermsOfServiceRequest) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode acceptTermsOfService#7efe03e4 as nil")
}
b.PutString(a.TermsOfServiceID)
return nil
}
// Decode implements bin.Decoder.
func (a *AcceptTermsOfServiceRequest) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode acceptTermsOfService#7efe03e4 to nil")
}
if err := b.ConsumeID(AcceptTermsOfServiceRequestTypeID); err != nil {
return fmt.Errorf("unable to decode acceptTermsOfService#7efe03e4: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AcceptTermsOfServiceRequest) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode acceptTermsOfService#7efe03e4 to nil")
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode acceptTermsOfService#7efe03e4: field terms_of_service_id: %w", err)
}
a.TermsOfServiceID = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AcceptTermsOfServiceRequest) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode acceptTermsOfService#7efe03e4 as nil")
}
b.ObjStart()
b.PutID("acceptTermsOfService")
b.Comma()
b.FieldStart("terms_of_service_id")
b.PutString(a.TermsOfServiceID)
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AcceptTermsOfServiceRequest) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode acceptTermsOfService#7efe03e4 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("acceptTermsOfService"); err != nil {
return fmt.Errorf("unable to decode acceptTermsOfService#7efe03e4: %w", err)
}
case "terms_of_service_id":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode acceptTermsOfService#7efe03e4: field terms_of_service_id: %w", err)
}
a.TermsOfServiceID = value
default:
return b.Skip()
}
return nil
})
}
// GetTermsOfServiceID returns value of TermsOfServiceID field.
func (a *AcceptTermsOfServiceRequest) GetTermsOfServiceID() (value string) {
if a == nil {
return
}
return a.TermsOfServiceID
}
// AcceptTermsOfService invokes method acceptTermsOfService#7efe03e4 returning error if any.
func (c *Client) AcceptTermsOfService(ctx context.Context, termsofserviceid string) error {
var ok Ok
request := &AcceptTermsOfServiceRequest{
TermsOfServiceID: termsofserviceid,
}
if err := c.rpc.Invoke(ctx, request, &ok); err != nil {
return err
}
return nil
}
-295
View File
@@ -1,295 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AcceptedGiftTypes represents TL type `acceptedGiftTypes#6a4e6014`.
type AcceptedGiftTypes struct {
// True, if unlimited regular gifts are accepted
UnlimitedGifts bool
// True, if limited regular gifts are accepted
LimitedGifts bool
// True, if upgraded gifts and regular gifts that can be upgraded for free are accepted
UpgradedGifts bool
// True, if Telegram Premium subscription is accepted
PremiumSubscription bool
}
// AcceptedGiftTypesTypeID is TL type id of AcceptedGiftTypes.
const AcceptedGiftTypesTypeID = 0x6a4e6014
// Ensuring interfaces in compile-time for AcceptedGiftTypes.
var (
_ bin.Encoder = &AcceptedGiftTypes{}
_ bin.Decoder = &AcceptedGiftTypes{}
_ bin.BareEncoder = &AcceptedGiftTypes{}
_ bin.BareDecoder = &AcceptedGiftTypes{}
)
func (a *AcceptedGiftTypes) Zero() bool {
if a == nil {
return true
}
if !(a.UnlimitedGifts == false) {
return false
}
if !(a.LimitedGifts == false) {
return false
}
if !(a.UpgradedGifts == false) {
return false
}
if !(a.PremiumSubscription == false) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AcceptedGiftTypes) String() string {
if a == nil {
return "AcceptedGiftTypes(nil)"
}
type Alias AcceptedGiftTypes
return fmt.Sprintf("AcceptedGiftTypes%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AcceptedGiftTypes) TypeID() uint32 {
return AcceptedGiftTypesTypeID
}
// TypeName returns name of type in TL schema.
func (*AcceptedGiftTypes) TypeName() string {
return "acceptedGiftTypes"
}
// TypeInfo returns info about TL type.
func (a *AcceptedGiftTypes) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "acceptedGiftTypes",
ID: AcceptedGiftTypesTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "UnlimitedGifts",
SchemaName: "unlimited_gifts",
},
{
Name: "LimitedGifts",
SchemaName: "limited_gifts",
},
{
Name: "UpgradedGifts",
SchemaName: "upgraded_gifts",
},
{
Name: "PremiumSubscription",
SchemaName: "premium_subscription",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AcceptedGiftTypes) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode acceptedGiftTypes#6a4e6014 as nil")
}
b.PutID(AcceptedGiftTypesTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AcceptedGiftTypes) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode acceptedGiftTypes#6a4e6014 as nil")
}
b.PutBool(a.UnlimitedGifts)
b.PutBool(a.LimitedGifts)
b.PutBool(a.UpgradedGifts)
b.PutBool(a.PremiumSubscription)
return nil
}
// Decode implements bin.Decoder.
func (a *AcceptedGiftTypes) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode acceptedGiftTypes#6a4e6014 to nil")
}
if err := b.ConsumeID(AcceptedGiftTypesTypeID); err != nil {
return fmt.Errorf("unable to decode acceptedGiftTypes#6a4e6014: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AcceptedGiftTypes) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode acceptedGiftTypes#6a4e6014 to nil")
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode acceptedGiftTypes#6a4e6014: field unlimited_gifts: %w", err)
}
a.UnlimitedGifts = value
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode acceptedGiftTypes#6a4e6014: field limited_gifts: %w", err)
}
a.LimitedGifts = value
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode acceptedGiftTypes#6a4e6014: field upgraded_gifts: %w", err)
}
a.UpgradedGifts = value
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode acceptedGiftTypes#6a4e6014: field premium_subscription: %w", err)
}
a.PremiumSubscription = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AcceptedGiftTypes) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode acceptedGiftTypes#6a4e6014 as nil")
}
b.ObjStart()
b.PutID("acceptedGiftTypes")
b.Comma()
b.FieldStart("unlimited_gifts")
b.PutBool(a.UnlimitedGifts)
b.Comma()
b.FieldStart("limited_gifts")
b.PutBool(a.LimitedGifts)
b.Comma()
b.FieldStart("upgraded_gifts")
b.PutBool(a.UpgradedGifts)
b.Comma()
b.FieldStart("premium_subscription")
b.PutBool(a.PremiumSubscription)
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AcceptedGiftTypes) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode acceptedGiftTypes#6a4e6014 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("acceptedGiftTypes"); err != nil {
return fmt.Errorf("unable to decode acceptedGiftTypes#6a4e6014: %w", err)
}
case "unlimited_gifts":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode acceptedGiftTypes#6a4e6014: field unlimited_gifts: %w", err)
}
a.UnlimitedGifts = value
case "limited_gifts":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode acceptedGiftTypes#6a4e6014: field limited_gifts: %w", err)
}
a.LimitedGifts = value
case "upgraded_gifts":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode acceptedGiftTypes#6a4e6014: field upgraded_gifts: %w", err)
}
a.UpgradedGifts = value
case "premium_subscription":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode acceptedGiftTypes#6a4e6014: field premium_subscription: %w", err)
}
a.PremiumSubscription = value
default:
return b.Skip()
}
return nil
})
}
// GetUnlimitedGifts returns value of UnlimitedGifts field.
func (a *AcceptedGiftTypes) GetUnlimitedGifts() (value bool) {
if a == nil {
return
}
return a.UnlimitedGifts
}
// GetLimitedGifts returns value of LimitedGifts field.
func (a *AcceptedGiftTypes) GetLimitedGifts() (value bool) {
if a == nil {
return
}
return a.LimitedGifts
}
// GetUpgradedGifts returns value of UpgradedGifts field.
func (a *AcceptedGiftTypes) GetUpgradedGifts() (value bool) {
if a == nil {
return
}
return a.UpgradedGifts
}
// GetPremiumSubscription returns value of PremiumSubscription field.
func (a *AcceptedGiftTypes) GetPremiumSubscription() (value bool) {
if a == nil {
return
}
return a.PremiumSubscription
}
-330
View File
@@ -1,330 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AccountInfo represents TL type `accountInfo#6b7f1d67`.
type AccountInfo struct {
// Month when the user was registered in Telegram; 0-12; may be 0 if unknown
RegistrationMonth int32
// Year when the user was registered in Telegram; 0-9999; may be 0 if unknown
RegistrationYear int32
// A two-letter ISO 3166-1 alpha-2 country code based on the phone number of the user;
// may be empty if unknown
PhoneNumberCountryCode string
// Point in time (Unix timestamp) when the user changed name last time; 0 if unknown
LastNameChangeDate int32
// Point in time (Unix timestamp) when the user changed photo last time; 0 if unknown
LastPhotoChangeDate int32
}
// AccountInfoTypeID is TL type id of AccountInfo.
const AccountInfoTypeID = 0x6b7f1d67
// Ensuring interfaces in compile-time for AccountInfo.
var (
_ bin.Encoder = &AccountInfo{}
_ bin.Decoder = &AccountInfo{}
_ bin.BareEncoder = &AccountInfo{}
_ bin.BareDecoder = &AccountInfo{}
)
func (a *AccountInfo) Zero() bool {
if a == nil {
return true
}
if !(a.RegistrationMonth == 0) {
return false
}
if !(a.RegistrationYear == 0) {
return false
}
if !(a.PhoneNumberCountryCode == "") {
return false
}
if !(a.LastNameChangeDate == 0) {
return false
}
if !(a.LastPhotoChangeDate == 0) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AccountInfo) String() string {
if a == nil {
return "AccountInfo(nil)"
}
type Alias AccountInfo
return fmt.Sprintf("AccountInfo%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AccountInfo) TypeID() uint32 {
return AccountInfoTypeID
}
// TypeName returns name of type in TL schema.
func (*AccountInfo) TypeName() string {
return "accountInfo"
}
// TypeInfo returns info about TL type.
func (a *AccountInfo) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "accountInfo",
ID: AccountInfoTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "RegistrationMonth",
SchemaName: "registration_month",
},
{
Name: "RegistrationYear",
SchemaName: "registration_year",
},
{
Name: "PhoneNumberCountryCode",
SchemaName: "phone_number_country_code",
},
{
Name: "LastNameChangeDate",
SchemaName: "last_name_change_date",
},
{
Name: "LastPhotoChangeDate",
SchemaName: "last_photo_change_date",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AccountInfo) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode accountInfo#6b7f1d67 as nil")
}
b.PutID(AccountInfoTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AccountInfo) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode accountInfo#6b7f1d67 as nil")
}
b.PutInt32(a.RegistrationMonth)
b.PutInt32(a.RegistrationYear)
b.PutString(a.PhoneNumberCountryCode)
b.PutInt32(a.LastNameChangeDate)
b.PutInt32(a.LastPhotoChangeDate)
return nil
}
// Decode implements bin.Decoder.
func (a *AccountInfo) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode accountInfo#6b7f1d67 to nil")
}
if err := b.ConsumeID(AccountInfoTypeID); err != nil {
return fmt.Errorf("unable to decode accountInfo#6b7f1d67: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AccountInfo) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode accountInfo#6b7f1d67 to nil")
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode accountInfo#6b7f1d67: field registration_month: %w", err)
}
a.RegistrationMonth = value
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode accountInfo#6b7f1d67: field registration_year: %w", err)
}
a.RegistrationYear = value
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode accountInfo#6b7f1d67: field phone_number_country_code: %w", err)
}
a.PhoneNumberCountryCode = value
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode accountInfo#6b7f1d67: field last_name_change_date: %w", err)
}
a.LastNameChangeDate = value
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode accountInfo#6b7f1d67: field last_photo_change_date: %w", err)
}
a.LastPhotoChangeDate = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AccountInfo) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode accountInfo#6b7f1d67 as nil")
}
b.ObjStart()
b.PutID("accountInfo")
b.Comma()
b.FieldStart("registration_month")
b.PutInt32(a.RegistrationMonth)
b.Comma()
b.FieldStart("registration_year")
b.PutInt32(a.RegistrationYear)
b.Comma()
b.FieldStart("phone_number_country_code")
b.PutString(a.PhoneNumberCountryCode)
b.Comma()
b.FieldStart("last_name_change_date")
b.PutInt32(a.LastNameChangeDate)
b.Comma()
b.FieldStart("last_photo_change_date")
b.PutInt32(a.LastPhotoChangeDate)
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AccountInfo) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode accountInfo#6b7f1d67 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("accountInfo"); err != nil {
return fmt.Errorf("unable to decode accountInfo#6b7f1d67: %w", err)
}
case "registration_month":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode accountInfo#6b7f1d67: field registration_month: %w", err)
}
a.RegistrationMonth = value
case "registration_year":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode accountInfo#6b7f1d67: field registration_year: %w", err)
}
a.RegistrationYear = value
case "phone_number_country_code":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode accountInfo#6b7f1d67: field phone_number_country_code: %w", err)
}
a.PhoneNumberCountryCode = value
case "last_name_change_date":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode accountInfo#6b7f1d67: field last_name_change_date: %w", err)
}
a.LastNameChangeDate = value
case "last_photo_change_date":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode accountInfo#6b7f1d67: field last_photo_change_date: %w", err)
}
a.LastPhotoChangeDate = value
default:
return b.Skip()
}
return nil
})
}
// GetRegistrationMonth returns value of RegistrationMonth field.
func (a *AccountInfo) GetRegistrationMonth() (value int32) {
if a == nil {
return
}
return a.RegistrationMonth
}
// GetRegistrationYear returns value of RegistrationYear field.
func (a *AccountInfo) GetRegistrationYear() (value int32) {
if a == nil {
return
}
return a.RegistrationYear
}
// GetPhoneNumberCountryCode returns value of PhoneNumberCountryCode field.
func (a *AccountInfo) GetPhoneNumberCountryCode() (value string) {
if a == nil {
return
}
return a.PhoneNumberCountryCode
}
// GetLastNameChangeDate returns value of LastNameChangeDate field.
func (a *AccountInfo) GetLastNameChangeDate() (value int32) {
if a == nil {
return
}
return a.LastNameChangeDate
}
// GetLastPhotoChangeDate returns value of LastPhotoChangeDate field.
func (a *AccountInfo) GetLastPhotoChangeDate() (value int32) {
if a == nil {
return
}
return a.LastPhotoChangeDate
}
-194
View File
@@ -1,194 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AccountTTL represents TL type `accountTtl#4ef23284`.
type AccountTTL struct {
// Number of days of inactivity before the account will be flagged for deletion; 30-730
// days
Days int32
}
// AccountTTLTypeID is TL type id of AccountTTL.
const AccountTTLTypeID = 0x4ef23284
// Ensuring interfaces in compile-time for AccountTTL.
var (
_ bin.Encoder = &AccountTTL{}
_ bin.Decoder = &AccountTTL{}
_ bin.BareEncoder = &AccountTTL{}
_ bin.BareDecoder = &AccountTTL{}
)
func (a *AccountTTL) Zero() bool {
if a == nil {
return true
}
if !(a.Days == 0) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AccountTTL) String() string {
if a == nil {
return "AccountTTL(nil)"
}
type Alias AccountTTL
return fmt.Sprintf("AccountTTL%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AccountTTL) TypeID() uint32 {
return AccountTTLTypeID
}
// TypeName returns name of type in TL schema.
func (*AccountTTL) TypeName() string {
return "accountTtl"
}
// TypeInfo returns info about TL type.
func (a *AccountTTL) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "accountTtl",
ID: AccountTTLTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "Days",
SchemaName: "days",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AccountTTL) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode accountTtl#4ef23284 as nil")
}
b.PutID(AccountTTLTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AccountTTL) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode accountTtl#4ef23284 as nil")
}
b.PutInt32(a.Days)
return nil
}
// Decode implements bin.Decoder.
func (a *AccountTTL) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode accountTtl#4ef23284 to nil")
}
if err := b.ConsumeID(AccountTTLTypeID); err != nil {
return fmt.Errorf("unable to decode accountTtl#4ef23284: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AccountTTL) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode accountTtl#4ef23284 to nil")
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode accountTtl#4ef23284: field days: %w", err)
}
a.Days = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AccountTTL) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode accountTtl#4ef23284 as nil")
}
b.ObjStart()
b.PutID("accountTtl")
b.Comma()
b.FieldStart("days")
b.PutInt32(a.Days)
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AccountTTL) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode accountTtl#4ef23284 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("accountTtl"); err != nil {
return fmt.Errorf("unable to decode accountTtl#4ef23284: %w", err)
}
case "days":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode accountTtl#4ef23284: field days: %w", err)
}
a.Days = value
default:
return b.Skip()
}
return nil
})
}
// GetDays returns value of Days field.
func (a *AccountTTL) GetDays() (value int32) {
if a == nil {
return
}
return a.Days
}
-169
View File
@@ -1,169 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// ActivateStoryStealthModeRequest represents TL type `activateStoryStealthMode#c3db8491`.
type ActivateStoryStealthModeRequest struct {
}
// ActivateStoryStealthModeRequestTypeID is TL type id of ActivateStoryStealthModeRequest.
const ActivateStoryStealthModeRequestTypeID = 0xc3db8491
// Ensuring interfaces in compile-time for ActivateStoryStealthModeRequest.
var (
_ bin.Encoder = &ActivateStoryStealthModeRequest{}
_ bin.Decoder = &ActivateStoryStealthModeRequest{}
_ bin.BareEncoder = &ActivateStoryStealthModeRequest{}
_ bin.BareDecoder = &ActivateStoryStealthModeRequest{}
)
func (a *ActivateStoryStealthModeRequest) Zero() bool {
if a == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (a *ActivateStoryStealthModeRequest) String() string {
if a == nil {
return "ActivateStoryStealthModeRequest(nil)"
}
type Alias ActivateStoryStealthModeRequest
return fmt.Sprintf("ActivateStoryStealthModeRequest%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*ActivateStoryStealthModeRequest) TypeID() uint32 {
return ActivateStoryStealthModeRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*ActivateStoryStealthModeRequest) TypeName() string {
return "activateStoryStealthMode"
}
// TypeInfo returns info about TL type.
func (a *ActivateStoryStealthModeRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "activateStoryStealthMode",
ID: ActivateStoryStealthModeRequestTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (a *ActivateStoryStealthModeRequest) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode activateStoryStealthMode#c3db8491 as nil")
}
b.PutID(ActivateStoryStealthModeRequestTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *ActivateStoryStealthModeRequest) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode activateStoryStealthMode#c3db8491 as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (a *ActivateStoryStealthModeRequest) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode activateStoryStealthMode#c3db8491 to nil")
}
if err := b.ConsumeID(ActivateStoryStealthModeRequestTypeID); err != nil {
return fmt.Errorf("unable to decode activateStoryStealthMode#c3db8491: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *ActivateStoryStealthModeRequest) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode activateStoryStealthMode#c3db8491 to nil")
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *ActivateStoryStealthModeRequest) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode activateStoryStealthMode#c3db8491 as nil")
}
b.ObjStart()
b.PutID("activateStoryStealthMode")
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *ActivateStoryStealthModeRequest) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode activateStoryStealthMode#c3db8491 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("activateStoryStealthMode"); err != nil {
return fmt.Errorf("unable to decode activateStoryStealthMode#c3db8491: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// ActivateStoryStealthMode invokes method activateStoryStealthMode#c3db8491 returning error if any.
func (c *Client) ActivateStoryStealthMode(ctx context.Context) error {
var ok Ok
request := &ActivateStoryStealthModeRequest{}
if err := c.rpc.Invoke(ctx, request, &ok); err != nil {
return err
}
return nil
}
-282
View File
@@ -1,282 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AddBotMediaPreviewRequest represents TL type `addBotMediaPreview#504b852b`.
type AddBotMediaPreviewRequest struct {
// Identifier of the target bot. The bot must be owned and must have the main Web App
BotUserID int64
// A two-letter ISO 639-1 language code for which preview is added. If empty, then the
// preview will be shown to all users for whose languages there are no dedicated previews.
LanguageCode string
// Content of the added preview
Content InputStoryContentClass
}
// AddBotMediaPreviewRequestTypeID is TL type id of AddBotMediaPreviewRequest.
const AddBotMediaPreviewRequestTypeID = 0x504b852b
// Ensuring interfaces in compile-time for AddBotMediaPreviewRequest.
var (
_ bin.Encoder = &AddBotMediaPreviewRequest{}
_ bin.Decoder = &AddBotMediaPreviewRequest{}
_ bin.BareEncoder = &AddBotMediaPreviewRequest{}
_ bin.BareDecoder = &AddBotMediaPreviewRequest{}
)
func (a *AddBotMediaPreviewRequest) Zero() bool {
if a == nil {
return true
}
if !(a.BotUserID == 0) {
return false
}
if !(a.LanguageCode == "") {
return false
}
if !(a.Content == nil) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AddBotMediaPreviewRequest) String() string {
if a == nil {
return "AddBotMediaPreviewRequest(nil)"
}
type Alias AddBotMediaPreviewRequest
return fmt.Sprintf("AddBotMediaPreviewRequest%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AddBotMediaPreviewRequest) TypeID() uint32 {
return AddBotMediaPreviewRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*AddBotMediaPreviewRequest) TypeName() string {
return "addBotMediaPreview"
}
// TypeInfo returns info about TL type.
func (a *AddBotMediaPreviewRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "addBotMediaPreview",
ID: AddBotMediaPreviewRequestTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "BotUserID",
SchemaName: "bot_user_id",
},
{
Name: "LanguageCode",
SchemaName: "language_code",
},
{
Name: "Content",
SchemaName: "content",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AddBotMediaPreviewRequest) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addBotMediaPreview#504b852b as nil")
}
b.PutID(AddBotMediaPreviewRequestTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AddBotMediaPreviewRequest) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addBotMediaPreview#504b852b as nil")
}
b.PutInt53(a.BotUserID)
b.PutString(a.LanguageCode)
if a.Content == nil {
return fmt.Errorf("unable to encode addBotMediaPreview#504b852b: field content is nil")
}
if err := a.Content.Encode(b); err != nil {
return fmt.Errorf("unable to encode addBotMediaPreview#504b852b: field content: %w", err)
}
return nil
}
// Decode implements bin.Decoder.
func (a *AddBotMediaPreviewRequest) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addBotMediaPreview#504b852b to nil")
}
if err := b.ConsumeID(AddBotMediaPreviewRequestTypeID); err != nil {
return fmt.Errorf("unable to decode addBotMediaPreview#504b852b: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AddBotMediaPreviewRequest) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addBotMediaPreview#504b852b to nil")
}
{
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addBotMediaPreview#504b852b: field bot_user_id: %w", err)
}
a.BotUserID = value
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode addBotMediaPreview#504b852b: field language_code: %w", err)
}
a.LanguageCode = value
}
{
value, err := DecodeInputStoryContent(b)
if err != nil {
return fmt.Errorf("unable to decode addBotMediaPreview#504b852b: field content: %w", err)
}
a.Content = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AddBotMediaPreviewRequest) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode addBotMediaPreview#504b852b as nil")
}
b.ObjStart()
b.PutID("addBotMediaPreview")
b.Comma()
b.FieldStart("bot_user_id")
b.PutInt53(a.BotUserID)
b.Comma()
b.FieldStart("language_code")
b.PutString(a.LanguageCode)
b.Comma()
b.FieldStart("content")
if a.Content == nil {
return fmt.Errorf("unable to encode addBotMediaPreview#504b852b: field content is nil")
}
if err := a.Content.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode addBotMediaPreview#504b852b: field content: %w", err)
}
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AddBotMediaPreviewRequest) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode addBotMediaPreview#504b852b to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("addBotMediaPreview"); err != nil {
return fmt.Errorf("unable to decode addBotMediaPreview#504b852b: %w", err)
}
case "bot_user_id":
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addBotMediaPreview#504b852b: field bot_user_id: %w", err)
}
a.BotUserID = value
case "language_code":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode addBotMediaPreview#504b852b: field language_code: %w", err)
}
a.LanguageCode = value
case "content":
value, err := DecodeTDLibJSONInputStoryContent(b)
if err != nil {
return fmt.Errorf("unable to decode addBotMediaPreview#504b852b: field content: %w", err)
}
a.Content = value
default:
return b.Skip()
}
return nil
})
}
// GetBotUserID returns value of BotUserID field.
func (a *AddBotMediaPreviewRequest) GetBotUserID() (value int64) {
if a == nil {
return
}
return a.BotUserID
}
// GetLanguageCode returns value of LanguageCode field.
func (a *AddBotMediaPreviewRequest) GetLanguageCode() (value string) {
if a == nil {
return
}
return a.LanguageCode
}
// GetContent returns value of Content field.
func (a *AddBotMediaPreviewRequest) GetContent() (value InputStoryContentClass) {
if a == nil {
return
}
return a.Content
}
// AddBotMediaPreview invokes method addBotMediaPreview#504b852b returning error if any.
func (c *Client) AddBotMediaPreview(ctx context.Context, request *AddBotMediaPreviewRequest) (*BotMediaPreview, error) {
var result BotMediaPreview
if err := c.rpc.Invoke(ctx, request, &result); err != nil {
return nil, err
}
return &result, nil
}
-262
View File
@@ -1,262 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AddChatFolderByInviteLinkRequest represents TL type `addChatFolderByInviteLink#1ed19dae`.
type AddChatFolderByInviteLinkRequest struct {
// Invite link for the chat folder
InviteLink string
// Identifiers of the chats added to the chat folder. The chats are automatically joined
// if they aren't joined yet
ChatIDs []int64
}
// AddChatFolderByInviteLinkRequestTypeID is TL type id of AddChatFolderByInviteLinkRequest.
const AddChatFolderByInviteLinkRequestTypeID = 0x1ed19dae
// Ensuring interfaces in compile-time for AddChatFolderByInviteLinkRequest.
var (
_ bin.Encoder = &AddChatFolderByInviteLinkRequest{}
_ bin.Decoder = &AddChatFolderByInviteLinkRequest{}
_ bin.BareEncoder = &AddChatFolderByInviteLinkRequest{}
_ bin.BareDecoder = &AddChatFolderByInviteLinkRequest{}
)
func (a *AddChatFolderByInviteLinkRequest) Zero() bool {
if a == nil {
return true
}
if !(a.InviteLink == "") {
return false
}
if !(a.ChatIDs == nil) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AddChatFolderByInviteLinkRequest) String() string {
if a == nil {
return "AddChatFolderByInviteLinkRequest(nil)"
}
type Alias AddChatFolderByInviteLinkRequest
return fmt.Sprintf("AddChatFolderByInviteLinkRequest%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AddChatFolderByInviteLinkRequest) TypeID() uint32 {
return AddChatFolderByInviteLinkRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*AddChatFolderByInviteLinkRequest) TypeName() string {
return "addChatFolderByInviteLink"
}
// TypeInfo returns info about TL type.
func (a *AddChatFolderByInviteLinkRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "addChatFolderByInviteLink",
ID: AddChatFolderByInviteLinkRequestTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "InviteLink",
SchemaName: "invite_link",
},
{
Name: "ChatIDs",
SchemaName: "chat_ids",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AddChatFolderByInviteLinkRequest) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addChatFolderByInviteLink#1ed19dae as nil")
}
b.PutID(AddChatFolderByInviteLinkRequestTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AddChatFolderByInviteLinkRequest) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addChatFolderByInviteLink#1ed19dae as nil")
}
b.PutString(a.InviteLink)
b.PutInt(len(a.ChatIDs))
for _, v := range a.ChatIDs {
b.PutInt53(v)
}
return nil
}
// Decode implements bin.Decoder.
func (a *AddChatFolderByInviteLinkRequest) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addChatFolderByInviteLink#1ed19dae to nil")
}
if err := b.ConsumeID(AddChatFolderByInviteLinkRequestTypeID); err != nil {
return fmt.Errorf("unable to decode addChatFolderByInviteLink#1ed19dae: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AddChatFolderByInviteLinkRequest) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addChatFolderByInviteLink#1ed19dae to nil")
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode addChatFolderByInviteLink#1ed19dae: field invite_link: %w", err)
}
a.InviteLink = value
}
{
headerLen, err := b.Int()
if err != nil {
return fmt.Errorf("unable to decode addChatFolderByInviteLink#1ed19dae: field chat_ids: %w", err)
}
if headerLen > 0 {
a.ChatIDs = make([]int64, 0, headerLen%bin.PreallocateLimit)
}
for idx := 0; idx < headerLen; idx++ {
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addChatFolderByInviteLink#1ed19dae: field chat_ids: %w", err)
}
a.ChatIDs = append(a.ChatIDs, value)
}
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AddChatFolderByInviteLinkRequest) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode addChatFolderByInviteLink#1ed19dae as nil")
}
b.ObjStart()
b.PutID("addChatFolderByInviteLink")
b.Comma()
b.FieldStart("invite_link")
b.PutString(a.InviteLink)
b.Comma()
b.FieldStart("chat_ids")
b.ArrStart()
for _, v := range a.ChatIDs {
b.PutInt53(v)
b.Comma()
}
b.StripComma()
b.ArrEnd()
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AddChatFolderByInviteLinkRequest) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode addChatFolderByInviteLink#1ed19dae to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("addChatFolderByInviteLink"); err != nil {
return fmt.Errorf("unable to decode addChatFolderByInviteLink#1ed19dae: %w", err)
}
case "invite_link":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode addChatFolderByInviteLink#1ed19dae: field invite_link: %w", err)
}
a.InviteLink = value
case "chat_ids":
if err := b.Arr(func(b tdjson.Decoder) error {
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addChatFolderByInviteLink#1ed19dae: field chat_ids: %w", err)
}
a.ChatIDs = append(a.ChatIDs, value)
return nil
}); err != nil {
return fmt.Errorf("unable to decode addChatFolderByInviteLink#1ed19dae: field chat_ids: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// GetInviteLink returns value of InviteLink field.
func (a *AddChatFolderByInviteLinkRequest) GetInviteLink() (value string) {
if a == nil {
return
}
return a.InviteLink
}
// GetChatIDs returns value of ChatIDs field.
func (a *AddChatFolderByInviteLinkRequest) GetChatIDs() (value []int64) {
if a == nil {
return
}
return a.ChatIDs
}
// AddChatFolderByInviteLink invokes method addChatFolderByInviteLink#1ed19dae returning error if any.
func (c *Client) AddChatFolderByInviteLink(ctx context.Context, request *AddChatFolderByInviteLinkRequest) error {
var ok Ok
if err := c.rpc.Invoke(ctx, request, &ok); err != nil {
return err
}
return nil
}
-272
View File
@@ -1,272 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AddChatMemberRequest represents TL type `addChatMember#66875217`.
type AddChatMemberRequest struct {
// Chat identifier
ChatID int64
// Identifier of the user
UserID int64
// The number of earlier messages from the chat to be forwarded to the new member; up to
// 100. Ignored for supergroups and channels, or if the added user is a bot
ForwardLimit int32
}
// AddChatMemberRequestTypeID is TL type id of AddChatMemberRequest.
const AddChatMemberRequestTypeID = 0x66875217
// Ensuring interfaces in compile-time for AddChatMemberRequest.
var (
_ bin.Encoder = &AddChatMemberRequest{}
_ bin.Decoder = &AddChatMemberRequest{}
_ bin.BareEncoder = &AddChatMemberRequest{}
_ bin.BareDecoder = &AddChatMemberRequest{}
)
func (a *AddChatMemberRequest) Zero() bool {
if a == nil {
return true
}
if !(a.ChatID == 0) {
return false
}
if !(a.UserID == 0) {
return false
}
if !(a.ForwardLimit == 0) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AddChatMemberRequest) String() string {
if a == nil {
return "AddChatMemberRequest(nil)"
}
type Alias AddChatMemberRequest
return fmt.Sprintf("AddChatMemberRequest%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AddChatMemberRequest) TypeID() uint32 {
return AddChatMemberRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*AddChatMemberRequest) TypeName() string {
return "addChatMember"
}
// TypeInfo returns info about TL type.
func (a *AddChatMemberRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "addChatMember",
ID: AddChatMemberRequestTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "ChatID",
SchemaName: "chat_id",
},
{
Name: "UserID",
SchemaName: "user_id",
},
{
Name: "ForwardLimit",
SchemaName: "forward_limit",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AddChatMemberRequest) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addChatMember#66875217 as nil")
}
b.PutID(AddChatMemberRequestTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AddChatMemberRequest) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addChatMember#66875217 as nil")
}
b.PutInt53(a.ChatID)
b.PutInt53(a.UserID)
b.PutInt32(a.ForwardLimit)
return nil
}
// Decode implements bin.Decoder.
func (a *AddChatMemberRequest) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addChatMember#66875217 to nil")
}
if err := b.ConsumeID(AddChatMemberRequestTypeID); err != nil {
return fmt.Errorf("unable to decode addChatMember#66875217: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AddChatMemberRequest) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addChatMember#66875217 to nil")
}
{
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addChatMember#66875217: field chat_id: %w", err)
}
a.ChatID = value
}
{
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addChatMember#66875217: field user_id: %w", err)
}
a.UserID = value
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode addChatMember#66875217: field forward_limit: %w", err)
}
a.ForwardLimit = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AddChatMemberRequest) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode addChatMember#66875217 as nil")
}
b.ObjStart()
b.PutID("addChatMember")
b.Comma()
b.FieldStart("chat_id")
b.PutInt53(a.ChatID)
b.Comma()
b.FieldStart("user_id")
b.PutInt53(a.UserID)
b.Comma()
b.FieldStart("forward_limit")
b.PutInt32(a.ForwardLimit)
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AddChatMemberRequest) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode addChatMember#66875217 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("addChatMember"); err != nil {
return fmt.Errorf("unable to decode addChatMember#66875217: %w", err)
}
case "chat_id":
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addChatMember#66875217: field chat_id: %w", err)
}
a.ChatID = value
case "user_id":
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addChatMember#66875217: field user_id: %w", err)
}
a.UserID = value
case "forward_limit":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode addChatMember#66875217: field forward_limit: %w", err)
}
a.ForwardLimit = value
default:
return b.Skip()
}
return nil
})
}
// GetChatID returns value of ChatID field.
func (a *AddChatMemberRequest) GetChatID() (value int64) {
if a == nil {
return
}
return a.ChatID
}
// GetUserID returns value of UserID field.
func (a *AddChatMemberRequest) GetUserID() (value int64) {
if a == nil {
return
}
return a.UserID
}
// GetForwardLimit returns value of ForwardLimit field.
func (a *AddChatMemberRequest) GetForwardLimit() (value int32) {
if a == nil {
return
}
return a.ForwardLimit
}
// AddChatMember invokes method addChatMember#66875217 returning error if any.
func (c *Client) AddChatMember(ctx context.Context, request *AddChatMemberRequest) (*FailedToAddMembers, error) {
var result FailedToAddMembers
if err := c.rpc.Invoke(ctx, request, &result); err != nil {
return nil, err
}
return &result, nil
}
-262
View File
@@ -1,262 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AddChatMembersRequest represents TL type `addChatMembers#1a3232f`.
type AddChatMembersRequest struct {
// Chat identifier
ChatID int64
// Identifiers of the users to be added to the chat. The maximum number of added users is
// 20 for supergroups and 100 for channels
UserIDs []int64
}
// AddChatMembersRequestTypeID is TL type id of AddChatMembersRequest.
const AddChatMembersRequestTypeID = 0x1a3232f
// Ensuring interfaces in compile-time for AddChatMembersRequest.
var (
_ bin.Encoder = &AddChatMembersRequest{}
_ bin.Decoder = &AddChatMembersRequest{}
_ bin.BareEncoder = &AddChatMembersRequest{}
_ bin.BareDecoder = &AddChatMembersRequest{}
)
func (a *AddChatMembersRequest) Zero() bool {
if a == nil {
return true
}
if !(a.ChatID == 0) {
return false
}
if !(a.UserIDs == nil) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AddChatMembersRequest) String() string {
if a == nil {
return "AddChatMembersRequest(nil)"
}
type Alias AddChatMembersRequest
return fmt.Sprintf("AddChatMembersRequest%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AddChatMembersRequest) TypeID() uint32 {
return AddChatMembersRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*AddChatMembersRequest) TypeName() string {
return "addChatMembers"
}
// TypeInfo returns info about TL type.
func (a *AddChatMembersRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "addChatMembers",
ID: AddChatMembersRequestTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "ChatID",
SchemaName: "chat_id",
},
{
Name: "UserIDs",
SchemaName: "user_ids",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AddChatMembersRequest) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addChatMembers#1a3232f as nil")
}
b.PutID(AddChatMembersRequestTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AddChatMembersRequest) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addChatMembers#1a3232f as nil")
}
b.PutInt53(a.ChatID)
b.PutInt(len(a.UserIDs))
for _, v := range a.UserIDs {
b.PutInt53(v)
}
return nil
}
// Decode implements bin.Decoder.
func (a *AddChatMembersRequest) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addChatMembers#1a3232f to nil")
}
if err := b.ConsumeID(AddChatMembersRequestTypeID); err != nil {
return fmt.Errorf("unable to decode addChatMembers#1a3232f: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AddChatMembersRequest) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addChatMembers#1a3232f to nil")
}
{
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addChatMembers#1a3232f: field chat_id: %w", err)
}
a.ChatID = value
}
{
headerLen, err := b.Int()
if err != nil {
return fmt.Errorf("unable to decode addChatMembers#1a3232f: field user_ids: %w", err)
}
if headerLen > 0 {
a.UserIDs = make([]int64, 0, headerLen%bin.PreallocateLimit)
}
for idx := 0; idx < headerLen; idx++ {
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addChatMembers#1a3232f: field user_ids: %w", err)
}
a.UserIDs = append(a.UserIDs, value)
}
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AddChatMembersRequest) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode addChatMembers#1a3232f as nil")
}
b.ObjStart()
b.PutID("addChatMembers")
b.Comma()
b.FieldStart("chat_id")
b.PutInt53(a.ChatID)
b.Comma()
b.FieldStart("user_ids")
b.ArrStart()
for _, v := range a.UserIDs {
b.PutInt53(v)
b.Comma()
}
b.StripComma()
b.ArrEnd()
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AddChatMembersRequest) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode addChatMembers#1a3232f to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("addChatMembers"); err != nil {
return fmt.Errorf("unable to decode addChatMembers#1a3232f: %w", err)
}
case "chat_id":
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addChatMembers#1a3232f: field chat_id: %w", err)
}
a.ChatID = value
case "user_ids":
if err := b.Arr(func(b tdjson.Decoder) error {
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addChatMembers#1a3232f: field user_ids: %w", err)
}
a.UserIDs = append(a.UserIDs, value)
return nil
}); err != nil {
return fmt.Errorf("unable to decode addChatMembers#1a3232f: field user_ids: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// GetChatID returns value of ChatID field.
func (a *AddChatMembersRequest) GetChatID() (value int64) {
if a == nil {
return
}
return a.ChatID
}
// GetUserIDs returns value of UserIDs field.
func (a *AddChatMembersRequest) GetUserIDs() (value []int64) {
if a == nil {
return
}
return a.UserIDs
}
// AddChatMembers invokes method addChatMembers#1a3232f returning error if any.
func (c *Client) AddChatMembers(ctx context.Context, request *AddChatMembersRequest) (*FailedToAddMembers, error) {
var result FailedToAddMembers
if err := c.rpc.Invoke(ctx, request, &result); err != nil {
return nil, err
}
return &result, nil
}
-247
View File
@@ -1,247 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AddChatToListRequest represents TL type `addChatToList#fb334eb5`.
type AddChatToListRequest struct {
// Chat identifier
ChatID int64
// The chat list. Use getChatListsToAddChat to get suitable chat lists
ChatList ChatListClass
}
// AddChatToListRequestTypeID is TL type id of AddChatToListRequest.
const AddChatToListRequestTypeID = 0xfb334eb5
// Ensuring interfaces in compile-time for AddChatToListRequest.
var (
_ bin.Encoder = &AddChatToListRequest{}
_ bin.Decoder = &AddChatToListRequest{}
_ bin.BareEncoder = &AddChatToListRequest{}
_ bin.BareDecoder = &AddChatToListRequest{}
)
func (a *AddChatToListRequest) Zero() bool {
if a == nil {
return true
}
if !(a.ChatID == 0) {
return false
}
if !(a.ChatList == nil) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AddChatToListRequest) String() string {
if a == nil {
return "AddChatToListRequest(nil)"
}
type Alias AddChatToListRequest
return fmt.Sprintf("AddChatToListRequest%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AddChatToListRequest) TypeID() uint32 {
return AddChatToListRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*AddChatToListRequest) TypeName() string {
return "addChatToList"
}
// TypeInfo returns info about TL type.
func (a *AddChatToListRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "addChatToList",
ID: AddChatToListRequestTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "ChatID",
SchemaName: "chat_id",
},
{
Name: "ChatList",
SchemaName: "chat_list",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AddChatToListRequest) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addChatToList#fb334eb5 as nil")
}
b.PutID(AddChatToListRequestTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AddChatToListRequest) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addChatToList#fb334eb5 as nil")
}
b.PutInt53(a.ChatID)
if a.ChatList == nil {
return fmt.Errorf("unable to encode addChatToList#fb334eb5: field chat_list is nil")
}
if err := a.ChatList.Encode(b); err != nil {
return fmt.Errorf("unable to encode addChatToList#fb334eb5: field chat_list: %w", err)
}
return nil
}
// Decode implements bin.Decoder.
func (a *AddChatToListRequest) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addChatToList#fb334eb5 to nil")
}
if err := b.ConsumeID(AddChatToListRequestTypeID); err != nil {
return fmt.Errorf("unable to decode addChatToList#fb334eb5: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AddChatToListRequest) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addChatToList#fb334eb5 to nil")
}
{
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addChatToList#fb334eb5: field chat_id: %w", err)
}
a.ChatID = value
}
{
value, err := DecodeChatList(b)
if err != nil {
return fmt.Errorf("unable to decode addChatToList#fb334eb5: field chat_list: %w", err)
}
a.ChatList = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AddChatToListRequest) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode addChatToList#fb334eb5 as nil")
}
b.ObjStart()
b.PutID("addChatToList")
b.Comma()
b.FieldStart("chat_id")
b.PutInt53(a.ChatID)
b.Comma()
b.FieldStart("chat_list")
if a.ChatList == nil {
return fmt.Errorf("unable to encode addChatToList#fb334eb5: field chat_list is nil")
}
if err := a.ChatList.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode addChatToList#fb334eb5: field chat_list: %w", err)
}
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AddChatToListRequest) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode addChatToList#fb334eb5 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("addChatToList"); err != nil {
return fmt.Errorf("unable to decode addChatToList#fb334eb5: %w", err)
}
case "chat_id":
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addChatToList#fb334eb5: field chat_id: %w", err)
}
a.ChatID = value
case "chat_list":
value, err := DecodeTDLibJSONChatList(b)
if err != nil {
return fmt.Errorf("unable to decode addChatToList#fb334eb5: field chat_list: %w", err)
}
a.ChatList = value
default:
return b.Skip()
}
return nil
})
}
// GetChatID returns value of ChatID field.
func (a *AddChatToListRequest) GetChatID() (value int64) {
if a == nil {
return
}
return a.ChatID
}
// GetChatList returns value of ChatList field.
func (a *AddChatToListRequest) GetChatList() (value ChatListClass) {
if a == nil {
return
}
return a.ChatList
}
// AddChatToList invokes method addChatToList#fb334eb5 returning error if any.
func (c *Client) AddChatToList(ctx context.Context, request *AddChatToListRequest) error {
var ok Ok
if err := c.rpc.Invoke(ctx, request, &ok); err != nil {
return err
}
return nil
}
-239
View File
@@ -1,239 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AddContactRequest represents TL type `addContact#6f707140`.
type AddContactRequest struct {
// The contact to add or edit; phone number may be empty and needs to be specified only
// if known, vCard is ignored
Contact Contact
// Pass true to share the current user's phone number with the new contact. A
// corresponding rule to userPrivacySettingShowPhoneNumber will be added if needed.
SharePhoneNumber bool
}
// AddContactRequestTypeID is TL type id of AddContactRequest.
const AddContactRequestTypeID = 0x6f707140
// Ensuring interfaces in compile-time for AddContactRequest.
var (
_ bin.Encoder = &AddContactRequest{}
_ bin.Decoder = &AddContactRequest{}
_ bin.BareEncoder = &AddContactRequest{}
_ bin.BareDecoder = &AddContactRequest{}
)
func (a *AddContactRequest) Zero() bool {
if a == nil {
return true
}
if !(a.Contact.Zero()) {
return false
}
if !(a.SharePhoneNumber == false) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AddContactRequest) String() string {
if a == nil {
return "AddContactRequest(nil)"
}
type Alias AddContactRequest
return fmt.Sprintf("AddContactRequest%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AddContactRequest) TypeID() uint32 {
return AddContactRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*AddContactRequest) TypeName() string {
return "addContact"
}
// TypeInfo returns info about TL type.
func (a *AddContactRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "addContact",
ID: AddContactRequestTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "Contact",
SchemaName: "contact",
},
{
Name: "SharePhoneNumber",
SchemaName: "share_phone_number",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AddContactRequest) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addContact#6f707140 as nil")
}
b.PutID(AddContactRequestTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AddContactRequest) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addContact#6f707140 as nil")
}
if err := a.Contact.Encode(b); err != nil {
return fmt.Errorf("unable to encode addContact#6f707140: field contact: %w", err)
}
b.PutBool(a.SharePhoneNumber)
return nil
}
// Decode implements bin.Decoder.
func (a *AddContactRequest) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addContact#6f707140 to nil")
}
if err := b.ConsumeID(AddContactRequestTypeID); err != nil {
return fmt.Errorf("unable to decode addContact#6f707140: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AddContactRequest) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addContact#6f707140 to nil")
}
{
if err := a.Contact.Decode(b); err != nil {
return fmt.Errorf("unable to decode addContact#6f707140: field contact: %w", err)
}
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode addContact#6f707140: field share_phone_number: %w", err)
}
a.SharePhoneNumber = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AddContactRequest) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode addContact#6f707140 as nil")
}
b.ObjStart()
b.PutID("addContact")
b.Comma()
b.FieldStart("contact")
if err := a.Contact.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode addContact#6f707140: field contact: %w", err)
}
b.Comma()
b.FieldStart("share_phone_number")
b.PutBool(a.SharePhoneNumber)
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AddContactRequest) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode addContact#6f707140 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("addContact"); err != nil {
return fmt.Errorf("unable to decode addContact#6f707140: %w", err)
}
case "contact":
if err := a.Contact.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode addContact#6f707140: field contact: %w", err)
}
case "share_phone_number":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode addContact#6f707140: field share_phone_number: %w", err)
}
a.SharePhoneNumber = value
default:
return b.Skip()
}
return nil
})
}
// GetContact returns value of Contact field.
func (a *AddContactRequest) GetContact() (value Contact) {
if a == nil {
return
}
return a.Contact
}
// GetSharePhoneNumber returns value of SharePhoneNumber field.
func (a *AddContactRequest) GetSharePhoneNumber() (value bool) {
if a == nil {
return
}
return a.SharePhoneNumber
}
// AddContact invokes method addContact#6f707140 returning error if any.
func (c *Client) AddContact(ctx context.Context, request *AddContactRequest) error {
var ok Ok
if err := c.rpc.Invoke(ctx, request, &ok); err != nil {
return err
}
return nil
}
-206
View File
@@ -1,206 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AddCustomServerLanguagePackRequest represents TL type `addCustomServerLanguagePack#448de3`.
type AddCustomServerLanguagePackRequest struct {
// Identifier of a language pack to be added
LanguagePackID string
}
// AddCustomServerLanguagePackRequestTypeID is TL type id of AddCustomServerLanguagePackRequest.
const AddCustomServerLanguagePackRequestTypeID = 0x448de3
// Ensuring interfaces in compile-time for AddCustomServerLanguagePackRequest.
var (
_ bin.Encoder = &AddCustomServerLanguagePackRequest{}
_ bin.Decoder = &AddCustomServerLanguagePackRequest{}
_ bin.BareEncoder = &AddCustomServerLanguagePackRequest{}
_ bin.BareDecoder = &AddCustomServerLanguagePackRequest{}
)
func (a *AddCustomServerLanguagePackRequest) Zero() bool {
if a == nil {
return true
}
if !(a.LanguagePackID == "") {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AddCustomServerLanguagePackRequest) String() string {
if a == nil {
return "AddCustomServerLanguagePackRequest(nil)"
}
type Alias AddCustomServerLanguagePackRequest
return fmt.Sprintf("AddCustomServerLanguagePackRequest%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AddCustomServerLanguagePackRequest) TypeID() uint32 {
return AddCustomServerLanguagePackRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*AddCustomServerLanguagePackRequest) TypeName() string {
return "addCustomServerLanguagePack"
}
// TypeInfo returns info about TL type.
func (a *AddCustomServerLanguagePackRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "addCustomServerLanguagePack",
ID: AddCustomServerLanguagePackRequestTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "LanguagePackID",
SchemaName: "language_pack_id",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AddCustomServerLanguagePackRequest) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addCustomServerLanguagePack#448de3 as nil")
}
b.PutID(AddCustomServerLanguagePackRequestTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AddCustomServerLanguagePackRequest) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addCustomServerLanguagePack#448de3 as nil")
}
b.PutString(a.LanguagePackID)
return nil
}
// Decode implements bin.Decoder.
func (a *AddCustomServerLanguagePackRequest) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addCustomServerLanguagePack#448de3 to nil")
}
if err := b.ConsumeID(AddCustomServerLanguagePackRequestTypeID); err != nil {
return fmt.Errorf("unable to decode addCustomServerLanguagePack#448de3: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AddCustomServerLanguagePackRequest) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addCustomServerLanguagePack#448de3 to nil")
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode addCustomServerLanguagePack#448de3: field language_pack_id: %w", err)
}
a.LanguagePackID = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AddCustomServerLanguagePackRequest) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode addCustomServerLanguagePack#448de3 as nil")
}
b.ObjStart()
b.PutID("addCustomServerLanguagePack")
b.Comma()
b.FieldStart("language_pack_id")
b.PutString(a.LanguagePackID)
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AddCustomServerLanguagePackRequest) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode addCustomServerLanguagePack#448de3 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("addCustomServerLanguagePack"); err != nil {
return fmt.Errorf("unable to decode addCustomServerLanguagePack#448de3: %w", err)
}
case "language_pack_id":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode addCustomServerLanguagePack#448de3: field language_pack_id: %w", err)
}
a.LanguagePackID = value
default:
return b.Skip()
}
return nil
})
}
// GetLanguagePackID returns value of LanguagePackID field.
func (a *AddCustomServerLanguagePackRequest) GetLanguagePackID() (value string) {
if a == nil {
return
}
return a.LanguagePackID
}
// AddCustomServerLanguagePack invokes method addCustomServerLanguagePack#448de3 returning error if any.
func (c *Client) AddCustomServerLanguagePack(ctx context.Context, languagepackid string) error {
var ok Ok
request := &AddCustomServerLanguagePackRequest{
LanguagePackID: languagepackid,
}
if err := c.rpc.Invoke(ctx, request, &ok); err != nil {
return err
}
return nil
}
-216
View File
@@ -1,216 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AddFavoriteStickerRequest represents TL type `addFavoriteSticker#13578cdf`.
type AddFavoriteStickerRequest struct {
// Sticker file to add
Sticker InputFileClass
}
// AddFavoriteStickerRequestTypeID is TL type id of AddFavoriteStickerRequest.
const AddFavoriteStickerRequestTypeID = 0x13578cdf
// Ensuring interfaces in compile-time for AddFavoriteStickerRequest.
var (
_ bin.Encoder = &AddFavoriteStickerRequest{}
_ bin.Decoder = &AddFavoriteStickerRequest{}
_ bin.BareEncoder = &AddFavoriteStickerRequest{}
_ bin.BareDecoder = &AddFavoriteStickerRequest{}
)
func (a *AddFavoriteStickerRequest) Zero() bool {
if a == nil {
return true
}
if !(a.Sticker == nil) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AddFavoriteStickerRequest) String() string {
if a == nil {
return "AddFavoriteStickerRequest(nil)"
}
type Alias AddFavoriteStickerRequest
return fmt.Sprintf("AddFavoriteStickerRequest%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AddFavoriteStickerRequest) TypeID() uint32 {
return AddFavoriteStickerRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*AddFavoriteStickerRequest) TypeName() string {
return "addFavoriteSticker"
}
// TypeInfo returns info about TL type.
func (a *AddFavoriteStickerRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "addFavoriteSticker",
ID: AddFavoriteStickerRequestTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "Sticker",
SchemaName: "sticker",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AddFavoriteStickerRequest) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addFavoriteSticker#13578cdf as nil")
}
b.PutID(AddFavoriteStickerRequestTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AddFavoriteStickerRequest) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addFavoriteSticker#13578cdf as nil")
}
if a.Sticker == nil {
return fmt.Errorf("unable to encode addFavoriteSticker#13578cdf: field sticker is nil")
}
if err := a.Sticker.Encode(b); err != nil {
return fmt.Errorf("unable to encode addFavoriteSticker#13578cdf: field sticker: %w", err)
}
return nil
}
// Decode implements bin.Decoder.
func (a *AddFavoriteStickerRequest) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addFavoriteSticker#13578cdf to nil")
}
if err := b.ConsumeID(AddFavoriteStickerRequestTypeID); err != nil {
return fmt.Errorf("unable to decode addFavoriteSticker#13578cdf: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AddFavoriteStickerRequest) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addFavoriteSticker#13578cdf to nil")
}
{
value, err := DecodeInputFile(b)
if err != nil {
return fmt.Errorf("unable to decode addFavoriteSticker#13578cdf: field sticker: %w", err)
}
a.Sticker = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AddFavoriteStickerRequest) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode addFavoriteSticker#13578cdf as nil")
}
b.ObjStart()
b.PutID("addFavoriteSticker")
b.Comma()
b.FieldStart("sticker")
if a.Sticker == nil {
return fmt.Errorf("unable to encode addFavoriteSticker#13578cdf: field sticker is nil")
}
if err := a.Sticker.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode addFavoriteSticker#13578cdf: field sticker: %w", err)
}
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AddFavoriteStickerRequest) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode addFavoriteSticker#13578cdf to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("addFavoriteSticker"); err != nil {
return fmt.Errorf("unable to decode addFavoriteSticker#13578cdf: %w", err)
}
case "sticker":
value, err := DecodeTDLibJSONInputFile(b)
if err != nil {
return fmt.Errorf("unable to decode addFavoriteSticker#13578cdf: field sticker: %w", err)
}
a.Sticker = value
default:
return b.Skip()
}
return nil
})
}
// GetSticker returns value of Sticker field.
func (a *AddFavoriteStickerRequest) GetSticker() (value InputFileClass) {
if a == nil {
return
}
return a.Sticker
}
// AddFavoriteSticker invokes method addFavoriteSticker#13578cdf returning error if any.
func (c *Client) AddFavoriteSticker(ctx context.Context, sticker InputFileClass) error {
var ok Ok
request := &AddFavoriteStickerRequest{
Sticker: sticker,
}
if err := c.rpc.Invoke(ctx, request, &ok); err != nil {
return err
}
return nil
}
-307
View File
@@ -1,307 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AddFileToDownloadsRequest represents TL type `addFileToDownloads#33b583b7`.
type AddFileToDownloadsRequest struct {
// Identifier of the file to download
FileID int32
// Chat identifier of the message with the file
ChatID int64
// Message identifier
MessageID int64
// Priority of the download (1-32). The higher the priority, the earlier the file will be
// downloaded. If the priorities of two files are equal, then the last one for which
// downloadFile/addFileToDownloads was called will be downloaded first
Priority int32
}
// AddFileToDownloadsRequestTypeID is TL type id of AddFileToDownloadsRequest.
const AddFileToDownloadsRequestTypeID = 0x33b583b7
// Ensuring interfaces in compile-time for AddFileToDownloadsRequest.
var (
_ bin.Encoder = &AddFileToDownloadsRequest{}
_ bin.Decoder = &AddFileToDownloadsRequest{}
_ bin.BareEncoder = &AddFileToDownloadsRequest{}
_ bin.BareDecoder = &AddFileToDownloadsRequest{}
)
func (a *AddFileToDownloadsRequest) Zero() bool {
if a == nil {
return true
}
if !(a.FileID == 0) {
return false
}
if !(a.ChatID == 0) {
return false
}
if !(a.MessageID == 0) {
return false
}
if !(a.Priority == 0) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AddFileToDownloadsRequest) String() string {
if a == nil {
return "AddFileToDownloadsRequest(nil)"
}
type Alias AddFileToDownloadsRequest
return fmt.Sprintf("AddFileToDownloadsRequest%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AddFileToDownloadsRequest) TypeID() uint32 {
return AddFileToDownloadsRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*AddFileToDownloadsRequest) TypeName() string {
return "addFileToDownloads"
}
// TypeInfo returns info about TL type.
func (a *AddFileToDownloadsRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "addFileToDownloads",
ID: AddFileToDownloadsRequestTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "FileID",
SchemaName: "file_id",
},
{
Name: "ChatID",
SchemaName: "chat_id",
},
{
Name: "MessageID",
SchemaName: "message_id",
},
{
Name: "Priority",
SchemaName: "priority",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AddFileToDownloadsRequest) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addFileToDownloads#33b583b7 as nil")
}
b.PutID(AddFileToDownloadsRequestTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AddFileToDownloadsRequest) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addFileToDownloads#33b583b7 as nil")
}
b.PutInt32(a.FileID)
b.PutInt53(a.ChatID)
b.PutInt53(a.MessageID)
b.PutInt32(a.Priority)
return nil
}
// Decode implements bin.Decoder.
func (a *AddFileToDownloadsRequest) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addFileToDownloads#33b583b7 to nil")
}
if err := b.ConsumeID(AddFileToDownloadsRequestTypeID); err != nil {
return fmt.Errorf("unable to decode addFileToDownloads#33b583b7: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AddFileToDownloadsRequest) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addFileToDownloads#33b583b7 to nil")
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode addFileToDownloads#33b583b7: field file_id: %w", err)
}
a.FileID = value
}
{
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addFileToDownloads#33b583b7: field chat_id: %w", err)
}
a.ChatID = value
}
{
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addFileToDownloads#33b583b7: field message_id: %w", err)
}
a.MessageID = value
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode addFileToDownloads#33b583b7: field priority: %w", err)
}
a.Priority = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AddFileToDownloadsRequest) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode addFileToDownloads#33b583b7 as nil")
}
b.ObjStart()
b.PutID("addFileToDownloads")
b.Comma()
b.FieldStart("file_id")
b.PutInt32(a.FileID)
b.Comma()
b.FieldStart("chat_id")
b.PutInt53(a.ChatID)
b.Comma()
b.FieldStart("message_id")
b.PutInt53(a.MessageID)
b.Comma()
b.FieldStart("priority")
b.PutInt32(a.Priority)
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AddFileToDownloadsRequest) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode addFileToDownloads#33b583b7 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("addFileToDownloads"); err != nil {
return fmt.Errorf("unable to decode addFileToDownloads#33b583b7: %w", err)
}
case "file_id":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode addFileToDownloads#33b583b7: field file_id: %w", err)
}
a.FileID = value
case "chat_id":
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addFileToDownloads#33b583b7: field chat_id: %w", err)
}
a.ChatID = value
case "message_id":
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addFileToDownloads#33b583b7: field message_id: %w", err)
}
a.MessageID = value
case "priority":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode addFileToDownloads#33b583b7: field priority: %w", err)
}
a.Priority = value
default:
return b.Skip()
}
return nil
})
}
// GetFileID returns value of FileID field.
func (a *AddFileToDownloadsRequest) GetFileID() (value int32) {
if a == nil {
return
}
return a.FileID
}
// GetChatID returns value of ChatID field.
func (a *AddFileToDownloadsRequest) GetChatID() (value int64) {
if a == nil {
return
}
return a.ChatID
}
// GetMessageID returns value of MessageID field.
func (a *AddFileToDownloadsRequest) GetMessageID() (value int64) {
if a == nil {
return
}
return a.MessageID
}
// GetPriority returns value of Priority field.
func (a *AddFileToDownloadsRequest) GetPriority() (value int32) {
if a == nil {
return
}
return a.Priority
}
// AddFileToDownloads invokes method addFileToDownloads#33b583b7 returning error if any.
func (c *Client) AddFileToDownloads(ctx context.Context, request *AddFileToDownloadsRequest) (*File, error) {
var result File
if err := c.rpc.Invoke(ctx, request, &result); err != nil {
return nil, err
}
return &result, nil
}
-369
View File
@@ -1,369 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AddLocalMessageRequest represents TL type `addLocalMessage#f617b7a1`.
type AddLocalMessageRequest struct {
// Target chat; channel direct messages chats aren't supported
ChatID int64
// Identifier of the sender of the message
SenderID MessageSenderClass
// Information about the message or story to be replied; pass null if none
ReplyTo InputMessageReplyToClass
// Pass true to disable notification for the message
DisableNotification bool
// The content of the message to be added
InputMessageContent InputMessageContentClass
}
// AddLocalMessageRequestTypeID is TL type id of AddLocalMessageRequest.
const AddLocalMessageRequestTypeID = 0xf617b7a1
// Ensuring interfaces in compile-time for AddLocalMessageRequest.
var (
_ bin.Encoder = &AddLocalMessageRequest{}
_ bin.Decoder = &AddLocalMessageRequest{}
_ bin.BareEncoder = &AddLocalMessageRequest{}
_ bin.BareDecoder = &AddLocalMessageRequest{}
)
func (a *AddLocalMessageRequest) Zero() bool {
if a == nil {
return true
}
if !(a.ChatID == 0) {
return false
}
if !(a.SenderID == nil) {
return false
}
if !(a.ReplyTo == nil) {
return false
}
if !(a.DisableNotification == false) {
return false
}
if !(a.InputMessageContent == nil) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AddLocalMessageRequest) String() string {
if a == nil {
return "AddLocalMessageRequest(nil)"
}
type Alias AddLocalMessageRequest
return fmt.Sprintf("AddLocalMessageRequest%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AddLocalMessageRequest) TypeID() uint32 {
return AddLocalMessageRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*AddLocalMessageRequest) TypeName() string {
return "addLocalMessage"
}
// TypeInfo returns info about TL type.
func (a *AddLocalMessageRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "addLocalMessage",
ID: AddLocalMessageRequestTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "ChatID",
SchemaName: "chat_id",
},
{
Name: "SenderID",
SchemaName: "sender_id",
},
{
Name: "ReplyTo",
SchemaName: "reply_to",
},
{
Name: "DisableNotification",
SchemaName: "disable_notification",
},
{
Name: "InputMessageContent",
SchemaName: "input_message_content",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AddLocalMessageRequest) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addLocalMessage#f617b7a1 as nil")
}
b.PutID(AddLocalMessageRequestTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AddLocalMessageRequest) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addLocalMessage#f617b7a1 as nil")
}
b.PutInt53(a.ChatID)
if a.SenderID == nil {
return fmt.Errorf("unable to encode addLocalMessage#f617b7a1: field sender_id is nil")
}
if err := a.SenderID.Encode(b); err != nil {
return fmt.Errorf("unable to encode addLocalMessage#f617b7a1: field sender_id: %w", err)
}
if a.ReplyTo == nil {
return fmt.Errorf("unable to encode addLocalMessage#f617b7a1: field reply_to is nil")
}
if err := a.ReplyTo.Encode(b); err != nil {
return fmt.Errorf("unable to encode addLocalMessage#f617b7a1: field reply_to: %w", err)
}
b.PutBool(a.DisableNotification)
if a.InputMessageContent == nil {
return fmt.Errorf("unable to encode addLocalMessage#f617b7a1: field input_message_content is nil")
}
if err := a.InputMessageContent.Encode(b); err != nil {
return fmt.Errorf("unable to encode addLocalMessage#f617b7a1: field input_message_content: %w", err)
}
return nil
}
// Decode implements bin.Decoder.
func (a *AddLocalMessageRequest) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addLocalMessage#f617b7a1 to nil")
}
if err := b.ConsumeID(AddLocalMessageRequestTypeID); err != nil {
return fmt.Errorf("unable to decode addLocalMessage#f617b7a1: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AddLocalMessageRequest) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addLocalMessage#f617b7a1 to nil")
}
{
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addLocalMessage#f617b7a1: field chat_id: %w", err)
}
a.ChatID = value
}
{
value, err := DecodeMessageSender(b)
if err != nil {
return fmt.Errorf("unable to decode addLocalMessage#f617b7a1: field sender_id: %w", err)
}
a.SenderID = value
}
{
value, err := DecodeInputMessageReplyTo(b)
if err != nil {
return fmt.Errorf("unable to decode addLocalMessage#f617b7a1: field reply_to: %w", err)
}
a.ReplyTo = value
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode addLocalMessage#f617b7a1: field disable_notification: %w", err)
}
a.DisableNotification = value
}
{
value, err := DecodeInputMessageContent(b)
if err != nil {
return fmt.Errorf("unable to decode addLocalMessage#f617b7a1: field input_message_content: %w", err)
}
a.InputMessageContent = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AddLocalMessageRequest) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode addLocalMessage#f617b7a1 as nil")
}
b.ObjStart()
b.PutID("addLocalMessage")
b.Comma()
b.FieldStart("chat_id")
b.PutInt53(a.ChatID)
b.Comma()
b.FieldStart("sender_id")
if a.SenderID == nil {
return fmt.Errorf("unable to encode addLocalMessage#f617b7a1: field sender_id is nil")
}
if err := a.SenderID.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode addLocalMessage#f617b7a1: field sender_id: %w", err)
}
b.Comma()
b.FieldStart("reply_to")
if a.ReplyTo == nil {
return fmt.Errorf("unable to encode addLocalMessage#f617b7a1: field reply_to is nil")
}
if err := a.ReplyTo.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode addLocalMessage#f617b7a1: field reply_to: %w", err)
}
b.Comma()
b.FieldStart("disable_notification")
b.PutBool(a.DisableNotification)
b.Comma()
b.FieldStart("input_message_content")
if a.InputMessageContent == nil {
return fmt.Errorf("unable to encode addLocalMessage#f617b7a1: field input_message_content is nil")
}
if err := a.InputMessageContent.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode addLocalMessage#f617b7a1: field input_message_content: %w", err)
}
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AddLocalMessageRequest) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode addLocalMessage#f617b7a1 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("addLocalMessage"); err != nil {
return fmt.Errorf("unable to decode addLocalMessage#f617b7a1: %w", err)
}
case "chat_id":
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addLocalMessage#f617b7a1: field chat_id: %w", err)
}
a.ChatID = value
case "sender_id":
value, err := DecodeTDLibJSONMessageSender(b)
if err != nil {
return fmt.Errorf("unable to decode addLocalMessage#f617b7a1: field sender_id: %w", err)
}
a.SenderID = value
case "reply_to":
value, err := DecodeTDLibJSONInputMessageReplyTo(b)
if err != nil {
return fmt.Errorf("unable to decode addLocalMessage#f617b7a1: field reply_to: %w", err)
}
a.ReplyTo = value
case "disable_notification":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode addLocalMessage#f617b7a1: field disable_notification: %w", err)
}
a.DisableNotification = value
case "input_message_content":
value, err := DecodeTDLibJSONInputMessageContent(b)
if err != nil {
return fmt.Errorf("unable to decode addLocalMessage#f617b7a1: field input_message_content: %w", err)
}
a.InputMessageContent = value
default:
return b.Skip()
}
return nil
})
}
// GetChatID returns value of ChatID field.
func (a *AddLocalMessageRequest) GetChatID() (value int64) {
if a == nil {
return
}
return a.ChatID
}
// GetSenderID returns value of SenderID field.
func (a *AddLocalMessageRequest) GetSenderID() (value MessageSenderClass) {
if a == nil {
return
}
return a.SenderID
}
// GetReplyTo returns value of ReplyTo field.
func (a *AddLocalMessageRequest) GetReplyTo() (value InputMessageReplyToClass) {
if a == nil {
return
}
return a.ReplyTo
}
// GetDisableNotification returns value of DisableNotification field.
func (a *AddLocalMessageRequest) GetDisableNotification() (value bool) {
if a == nil {
return
}
return a.DisableNotification
}
// GetInputMessageContent returns value of InputMessageContent field.
func (a *AddLocalMessageRequest) GetInputMessageContent() (value InputMessageContentClass) {
if a == nil {
return
}
return a.InputMessageContent
}
// AddLocalMessage invokes method addLocalMessage#f617b7a1 returning error if any.
func (c *Client) AddLocalMessage(ctx context.Context, request *AddLocalMessageRequest) (*Message, error) {
var result Message
if err := c.rpc.Invoke(ctx, request, &result); err != nil {
return nil, err
}
return &result, nil
}
-237
View File
@@ -1,237 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AddLogMessageRequest represents TL type `addLogMessage#5f36cfec`.
type AddLogMessageRequest struct {
// The minimum verbosity level needed for the message to be logged; 0-1023
VerbosityLevel int32
// Text of a message to log
Text string
}
// AddLogMessageRequestTypeID is TL type id of AddLogMessageRequest.
const AddLogMessageRequestTypeID = 0x5f36cfec
// Ensuring interfaces in compile-time for AddLogMessageRequest.
var (
_ bin.Encoder = &AddLogMessageRequest{}
_ bin.Decoder = &AddLogMessageRequest{}
_ bin.BareEncoder = &AddLogMessageRequest{}
_ bin.BareDecoder = &AddLogMessageRequest{}
)
func (a *AddLogMessageRequest) Zero() bool {
if a == nil {
return true
}
if !(a.VerbosityLevel == 0) {
return false
}
if !(a.Text == "") {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AddLogMessageRequest) String() string {
if a == nil {
return "AddLogMessageRequest(nil)"
}
type Alias AddLogMessageRequest
return fmt.Sprintf("AddLogMessageRequest%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AddLogMessageRequest) TypeID() uint32 {
return AddLogMessageRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*AddLogMessageRequest) TypeName() string {
return "addLogMessage"
}
// TypeInfo returns info about TL type.
func (a *AddLogMessageRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "addLogMessage",
ID: AddLogMessageRequestTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "VerbosityLevel",
SchemaName: "verbosity_level",
},
{
Name: "Text",
SchemaName: "text",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AddLogMessageRequest) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addLogMessage#5f36cfec as nil")
}
b.PutID(AddLogMessageRequestTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AddLogMessageRequest) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addLogMessage#5f36cfec as nil")
}
b.PutInt32(a.VerbosityLevel)
b.PutString(a.Text)
return nil
}
// Decode implements bin.Decoder.
func (a *AddLogMessageRequest) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addLogMessage#5f36cfec to nil")
}
if err := b.ConsumeID(AddLogMessageRequestTypeID); err != nil {
return fmt.Errorf("unable to decode addLogMessage#5f36cfec: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AddLogMessageRequest) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addLogMessage#5f36cfec to nil")
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode addLogMessage#5f36cfec: field verbosity_level: %w", err)
}
a.VerbosityLevel = value
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode addLogMessage#5f36cfec: field text: %w", err)
}
a.Text = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AddLogMessageRequest) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode addLogMessage#5f36cfec as nil")
}
b.ObjStart()
b.PutID("addLogMessage")
b.Comma()
b.FieldStart("verbosity_level")
b.PutInt32(a.VerbosityLevel)
b.Comma()
b.FieldStart("text")
b.PutString(a.Text)
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AddLogMessageRequest) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode addLogMessage#5f36cfec to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("addLogMessage"); err != nil {
return fmt.Errorf("unable to decode addLogMessage#5f36cfec: %w", err)
}
case "verbosity_level":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode addLogMessage#5f36cfec: field verbosity_level: %w", err)
}
a.VerbosityLevel = value
case "text":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode addLogMessage#5f36cfec: field text: %w", err)
}
a.Text = value
default:
return b.Skip()
}
return nil
})
}
// GetVerbosityLevel returns value of VerbosityLevel field.
func (a *AddLogMessageRequest) GetVerbosityLevel() (value int32) {
if a == nil {
return
}
return a.VerbosityLevel
}
// GetText returns value of Text field.
func (a *AddLogMessageRequest) GetText() (value string) {
if a == nil {
return
}
return a.Text
}
// AddLogMessage invokes method addLogMessage#5f36cfec returning error if any.
func (c *Client) AddLogMessage(ctx context.Context, request *AddLogMessageRequest) error {
var ok Ok
if err := c.rpc.Invoke(ctx, request, &ok); err != nil {
return err
}
return nil
}
-351
View File
@@ -1,351 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AddMessageReactionRequest represents TL type `addMessageReaction#549855ed`.
type AddMessageReactionRequest struct {
// Identifier of the chat to which the message belongs
ChatID int64
// Identifier of the message
MessageID int64
// Type of the reaction to add. Use addPendingPaidMessageReaction instead to add the paid
// reaction
ReactionType ReactionTypeClass
// Pass true if the reaction is added with a big animation
IsBig bool
// Pass true if the reaction needs to be added to recent reactions; tags are never added
// to the list of recent reactions
UpdateRecentReactions bool
}
// AddMessageReactionRequestTypeID is TL type id of AddMessageReactionRequest.
const AddMessageReactionRequestTypeID = 0x549855ed
// Ensuring interfaces in compile-time for AddMessageReactionRequest.
var (
_ bin.Encoder = &AddMessageReactionRequest{}
_ bin.Decoder = &AddMessageReactionRequest{}
_ bin.BareEncoder = &AddMessageReactionRequest{}
_ bin.BareDecoder = &AddMessageReactionRequest{}
)
func (a *AddMessageReactionRequest) Zero() bool {
if a == nil {
return true
}
if !(a.ChatID == 0) {
return false
}
if !(a.MessageID == 0) {
return false
}
if !(a.ReactionType == nil) {
return false
}
if !(a.IsBig == false) {
return false
}
if !(a.UpdateRecentReactions == false) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AddMessageReactionRequest) String() string {
if a == nil {
return "AddMessageReactionRequest(nil)"
}
type Alias AddMessageReactionRequest
return fmt.Sprintf("AddMessageReactionRequest%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AddMessageReactionRequest) TypeID() uint32 {
return AddMessageReactionRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*AddMessageReactionRequest) TypeName() string {
return "addMessageReaction"
}
// TypeInfo returns info about TL type.
func (a *AddMessageReactionRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "addMessageReaction",
ID: AddMessageReactionRequestTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "ChatID",
SchemaName: "chat_id",
},
{
Name: "MessageID",
SchemaName: "message_id",
},
{
Name: "ReactionType",
SchemaName: "reaction_type",
},
{
Name: "IsBig",
SchemaName: "is_big",
},
{
Name: "UpdateRecentReactions",
SchemaName: "update_recent_reactions",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AddMessageReactionRequest) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addMessageReaction#549855ed as nil")
}
b.PutID(AddMessageReactionRequestTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AddMessageReactionRequest) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addMessageReaction#549855ed as nil")
}
b.PutInt53(a.ChatID)
b.PutInt53(a.MessageID)
if a.ReactionType == nil {
return fmt.Errorf("unable to encode addMessageReaction#549855ed: field reaction_type is nil")
}
if err := a.ReactionType.Encode(b); err != nil {
return fmt.Errorf("unable to encode addMessageReaction#549855ed: field reaction_type: %w", err)
}
b.PutBool(a.IsBig)
b.PutBool(a.UpdateRecentReactions)
return nil
}
// Decode implements bin.Decoder.
func (a *AddMessageReactionRequest) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addMessageReaction#549855ed to nil")
}
if err := b.ConsumeID(AddMessageReactionRequestTypeID); err != nil {
return fmt.Errorf("unable to decode addMessageReaction#549855ed: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AddMessageReactionRequest) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addMessageReaction#549855ed to nil")
}
{
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addMessageReaction#549855ed: field chat_id: %w", err)
}
a.ChatID = value
}
{
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addMessageReaction#549855ed: field message_id: %w", err)
}
a.MessageID = value
}
{
value, err := DecodeReactionType(b)
if err != nil {
return fmt.Errorf("unable to decode addMessageReaction#549855ed: field reaction_type: %w", err)
}
a.ReactionType = value
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode addMessageReaction#549855ed: field is_big: %w", err)
}
a.IsBig = value
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode addMessageReaction#549855ed: field update_recent_reactions: %w", err)
}
a.UpdateRecentReactions = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AddMessageReactionRequest) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode addMessageReaction#549855ed as nil")
}
b.ObjStart()
b.PutID("addMessageReaction")
b.Comma()
b.FieldStart("chat_id")
b.PutInt53(a.ChatID)
b.Comma()
b.FieldStart("message_id")
b.PutInt53(a.MessageID)
b.Comma()
b.FieldStart("reaction_type")
if a.ReactionType == nil {
return fmt.Errorf("unable to encode addMessageReaction#549855ed: field reaction_type is nil")
}
if err := a.ReactionType.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode addMessageReaction#549855ed: field reaction_type: %w", err)
}
b.Comma()
b.FieldStart("is_big")
b.PutBool(a.IsBig)
b.Comma()
b.FieldStart("update_recent_reactions")
b.PutBool(a.UpdateRecentReactions)
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AddMessageReactionRequest) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode addMessageReaction#549855ed to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("addMessageReaction"); err != nil {
return fmt.Errorf("unable to decode addMessageReaction#549855ed: %w", err)
}
case "chat_id":
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addMessageReaction#549855ed: field chat_id: %w", err)
}
a.ChatID = value
case "message_id":
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addMessageReaction#549855ed: field message_id: %w", err)
}
a.MessageID = value
case "reaction_type":
value, err := DecodeTDLibJSONReactionType(b)
if err != nil {
return fmt.Errorf("unable to decode addMessageReaction#549855ed: field reaction_type: %w", err)
}
a.ReactionType = value
case "is_big":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode addMessageReaction#549855ed: field is_big: %w", err)
}
a.IsBig = value
case "update_recent_reactions":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode addMessageReaction#549855ed: field update_recent_reactions: %w", err)
}
a.UpdateRecentReactions = value
default:
return b.Skip()
}
return nil
})
}
// GetChatID returns value of ChatID field.
func (a *AddMessageReactionRequest) GetChatID() (value int64) {
if a == nil {
return
}
return a.ChatID
}
// GetMessageID returns value of MessageID field.
func (a *AddMessageReactionRequest) GetMessageID() (value int64) {
if a == nil {
return
}
return a.MessageID
}
// GetReactionType returns value of ReactionType field.
func (a *AddMessageReactionRequest) GetReactionType() (value ReactionTypeClass) {
if a == nil {
return
}
return a.ReactionType
}
// GetIsBig returns value of IsBig field.
func (a *AddMessageReactionRequest) GetIsBig() (value bool) {
if a == nil {
return
}
return a.IsBig
}
// GetUpdateRecentReactions returns value of UpdateRecentReactions field.
func (a *AddMessageReactionRequest) GetUpdateRecentReactions() (value bool) {
if a == nil {
return
}
return a.UpdateRecentReactions
}
// AddMessageReaction invokes method addMessageReaction#549855ed returning error if any.
func (c *Client) AddMessageReaction(ctx context.Context, request *AddMessageReactionRequest) error {
var ok Ok
if err := c.rpc.Invoke(ctx, request, &ok); err != nil {
return err
}
return nil
}
-216
View File
@@ -1,216 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AddNetworkStatisticsRequest represents TL type `addNetworkStatistics#4b63b3d9`.
type AddNetworkStatisticsRequest struct {
// The network statistics entry with the data to be added to statistics
Entry NetworkStatisticsEntryClass
}
// AddNetworkStatisticsRequestTypeID is TL type id of AddNetworkStatisticsRequest.
const AddNetworkStatisticsRequestTypeID = 0x4b63b3d9
// Ensuring interfaces in compile-time for AddNetworkStatisticsRequest.
var (
_ bin.Encoder = &AddNetworkStatisticsRequest{}
_ bin.Decoder = &AddNetworkStatisticsRequest{}
_ bin.BareEncoder = &AddNetworkStatisticsRequest{}
_ bin.BareDecoder = &AddNetworkStatisticsRequest{}
)
func (a *AddNetworkStatisticsRequest) Zero() bool {
if a == nil {
return true
}
if !(a.Entry == nil) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AddNetworkStatisticsRequest) String() string {
if a == nil {
return "AddNetworkStatisticsRequest(nil)"
}
type Alias AddNetworkStatisticsRequest
return fmt.Sprintf("AddNetworkStatisticsRequest%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AddNetworkStatisticsRequest) TypeID() uint32 {
return AddNetworkStatisticsRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*AddNetworkStatisticsRequest) TypeName() string {
return "addNetworkStatistics"
}
// TypeInfo returns info about TL type.
func (a *AddNetworkStatisticsRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "addNetworkStatistics",
ID: AddNetworkStatisticsRequestTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "Entry",
SchemaName: "entry",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AddNetworkStatisticsRequest) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addNetworkStatistics#4b63b3d9 as nil")
}
b.PutID(AddNetworkStatisticsRequestTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AddNetworkStatisticsRequest) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addNetworkStatistics#4b63b3d9 as nil")
}
if a.Entry == nil {
return fmt.Errorf("unable to encode addNetworkStatistics#4b63b3d9: field entry is nil")
}
if err := a.Entry.Encode(b); err != nil {
return fmt.Errorf("unable to encode addNetworkStatistics#4b63b3d9: field entry: %w", err)
}
return nil
}
// Decode implements bin.Decoder.
func (a *AddNetworkStatisticsRequest) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addNetworkStatistics#4b63b3d9 to nil")
}
if err := b.ConsumeID(AddNetworkStatisticsRequestTypeID); err != nil {
return fmt.Errorf("unable to decode addNetworkStatistics#4b63b3d9: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AddNetworkStatisticsRequest) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addNetworkStatistics#4b63b3d9 to nil")
}
{
value, err := DecodeNetworkStatisticsEntry(b)
if err != nil {
return fmt.Errorf("unable to decode addNetworkStatistics#4b63b3d9: field entry: %w", err)
}
a.Entry = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AddNetworkStatisticsRequest) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode addNetworkStatistics#4b63b3d9 as nil")
}
b.ObjStart()
b.PutID("addNetworkStatistics")
b.Comma()
b.FieldStart("entry")
if a.Entry == nil {
return fmt.Errorf("unable to encode addNetworkStatistics#4b63b3d9: field entry is nil")
}
if err := a.Entry.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode addNetworkStatistics#4b63b3d9: field entry: %w", err)
}
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AddNetworkStatisticsRequest) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode addNetworkStatistics#4b63b3d9 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("addNetworkStatistics"); err != nil {
return fmt.Errorf("unable to decode addNetworkStatistics#4b63b3d9: %w", err)
}
case "entry":
value, err := DecodeTDLibJSONNetworkStatisticsEntry(b)
if err != nil {
return fmt.Errorf("unable to decode addNetworkStatistics#4b63b3d9: field entry: %w", err)
}
a.Entry = value
default:
return b.Skip()
}
return nil
})
}
// GetEntry returns value of Entry field.
func (a *AddNetworkStatisticsRequest) GetEntry() (value NetworkStatisticsEntryClass) {
if a == nil {
return
}
return a.Entry
}
// AddNetworkStatistics invokes method addNetworkStatistics#4b63b3d9 returning error if any.
func (c *Client) AddNetworkStatistics(ctx context.Context, entry NetworkStatisticsEntryClass) error {
var ok Ok
request := &AddNetworkStatisticsRequest{
Entry: entry,
}
if err := c.rpc.Invoke(ctx, request, &ok); err != nil {
return err
}
return nil
}
-317
View File
@@ -1,317 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AddPendingPaidMessageReactionRequest represents TL type `addPendingPaidMessageReaction#eb9bcdd3`.
type AddPendingPaidMessageReactionRequest struct {
// Identifier of the chat to which the message belongs
ChatID int64
// Identifier of the message
MessageID int64
// Number of Telegram Stars to be used for the reaction. The total number of pending paid
// reactions must not exceed getOption("paid_reaction_star_count_max")
StarCount int64
// Type of the paid reaction; pass null if the user didn't choose reaction type
// explicitly, for example, the reaction is set from the message bubble
Type PaidReactionTypeClass
}
// AddPendingPaidMessageReactionRequestTypeID is TL type id of AddPendingPaidMessageReactionRequest.
const AddPendingPaidMessageReactionRequestTypeID = 0xeb9bcdd3
// Ensuring interfaces in compile-time for AddPendingPaidMessageReactionRequest.
var (
_ bin.Encoder = &AddPendingPaidMessageReactionRequest{}
_ bin.Decoder = &AddPendingPaidMessageReactionRequest{}
_ bin.BareEncoder = &AddPendingPaidMessageReactionRequest{}
_ bin.BareDecoder = &AddPendingPaidMessageReactionRequest{}
)
func (a *AddPendingPaidMessageReactionRequest) Zero() bool {
if a == nil {
return true
}
if !(a.ChatID == 0) {
return false
}
if !(a.MessageID == 0) {
return false
}
if !(a.StarCount == 0) {
return false
}
if !(a.Type == nil) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AddPendingPaidMessageReactionRequest) String() string {
if a == nil {
return "AddPendingPaidMessageReactionRequest(nil)"
}
type Alias AddPendingPaidMessageReactionRequest
return fmt.Sprintf("AddPendingPaidMessageReactionRequest%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AddPendingPaidMessageReactionRequest) TypeID() uint32 {
return AddPendingPaidMessageReactionRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*AddPendingPaidMessageReactionRequest) TypeName() string {
return "addPendingPaidMessageReaction"
}
// TypeInfo returns info about TL type.
func (a *AddPendingPaidMessageReactionRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "addPendingPaidMessageReaction",
ID: AddPendingPaidMessageReactionRequestTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "ChatID",
SchemaName: "chat_id",
},
{
Name: "MessageID",
SchemaName: "message_id",
},
{
Name: "StarCount",
SchemaName: "star_count",
},
{
Name: "Type",
SchemaName: "type",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AddPendingPaidMessageReactionRequest) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addPendingPaidMessageReaction#eb9bcdd3 as nil")
}
b.PutID(AddPendingPaidMessageReactionRequestTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AddPendingPaidMessageReactionRequest) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addPendingPaidMessageReaction#eb9bcdd3 as nil")
}
b.PutInt53(a.ChatID)
b.PutInt53(a.MessageID)
b.PutInt53(a.StarCount)
if a.Type == nil {
return fmt.Errorf("unable to encode addPendingPaidMessageReaction#eb9bcdd3: field type is nil")
}
if err := a.Type.Encode(b); err != nil {
return fmt.Errorf("unable to encode addPendingPaidMessageReaction#eb9bcdd3: field type: %w", err)
}
return nil
}
// Decode implements bin.Decoder.
func (a *AddPendingPaidMessageReactionRequest) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addPendingPaidMessageReaction#eb9bcdd3 to nil")
}
if err := b.ConsumeID(AddPendingPaidMessageReactionRequestTypeID); err != nil {
return fmt.Errorf("unable to decode addPendingPaidMessageReaction#eb9bcdd3: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AddPendingPaidMessageReactionRequest) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addPendingPaidMessageReaction#eb9bcdd3 to nil")
}
{
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addPendingPaidMessageReaction#eb9bcdd3: field chat_id: %w", err)
}
a.ChatID = value
}
{
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addPendingPaidMessageReaction#eb9bcdd3: field message_id: %w", err)
}
a.MessageID = value
}
{
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addPendingPaidMessageReaction#eb9bcdd3: field star_count: %w", err)
}
a.StarCount = value
}
{
value, err := DecodePaidReactionType(b)
if err != nil {
return fmt.Errorf("unable to decode addPendingPaidMessageReaction#eb9bcdd3: field type: %w", err)
}
a.Type = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AddPendingPaidMessageReactionRequest) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode addPendingPaidMessageReaction#eb9bcdd3 as nil")
}
b.ObjStart()
b.PutID("addPendingPaidMessageReaction")
b.Comma()
b.FieldStart("chat_id")
b.PutInt53(a.ChatID)
b.Comma()
b.FieldStart("message_id")
b.PutInt53(a.MessageID)
b.Comma()
b.FieldStart("star_count")
b.PutInt53(a.StarCount)
b.Comma()
b.FieldStart("type")
if a.Type == nil {
return fmt.Errorf("unable to encode addPendingPaidMessageReaction#eb9bcdd3: field type is nil")
}
if err := a.Type.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode addPendingPaidMessageReaction#eb9bcdd3: field type: %w", err)
}
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AddPendingPaidMessageReactionRequest) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode addPendingPaidMessageReaction#eb9bcdd3 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("addPendingPaidMessageReaction"); err != nil {
return fmt.Errorf("unable to decode addPendingPaidMessageReaction#eb9bcdd3: %w", err)
}
case "chat_id":
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addPendingPaidMessageReaction#eb9bcdd3: field chat_id: %w", err)
}
a.ChatID = value
case "message_id":
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addPendingPaidMessageReaction#eb9bcdd3: field message_id: %w", err)
}
a.MessageID = value
case "star_count":
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addPendingPaidMessageReaction#eb9bcdd3: field star_count: %w", err)
}
a.StarCount = value
case "type":
value, err := DecodeTDLibJSONPaidReactionType(b)
if err != nil {
return fmt.Errorf("unable to decode addPendingPaidMessageReaction#eb9bcdd3: field type: %w", err)
}
a.Type = value
default:
return b.Skip()
}
return nil
})
}
// GetChatID returns value of ChatID field.
func (a *AddPendingPaidMessageReactionRequest) GetChatID() (value int64) {
if a == nil {
return
}
return a.ChatID
}
// GetMessageID returns value of MessageID field.
func (a *AddPendingPaidMessageReactionRequest) GetMessageID() (value int64) {
if a == nil {
return
}
return a.MessageID
}
// GetStarCount returns value of StarCount field.
func (a *AddPendingPaidMessageReactionRequest) GetStarCount() (value int64) {
if a == nil {
return
}
return a.StarCount
}
// GetType returns value of Type field.
func (a *AddPendingPaidMessageReactionRequest) GetType() (value PaidReactionTypeClass) {
if a == nil {
return
}
return a.Type
}
// AddPendingPaidMessageReaction invokes method addPendingPaidMessageReaction#eb9bcdd3 returning error if any.
func (c *Client) AddPendingPaidMessageReaction(ctx context.Context, request *AddPendingPaidMessageReactionRequest) error {
var ok Ok
if err := c.rpc.Invoke(ctx, request, &ok); err != nil {
return err
}
return nil
}
-315
View File
@@ -1,315 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AddProxyRequest represents TL type `addProxy#13c2bcd8`.
type AddProxyRequest struct {
// Proxy server domain or IP address
Server string
// Proxy server port
Port int32
// Pass true to immediately enable the proxy
Enable bool
// Proxy type
Type ProxyTypeClass
}
// AddProxyRequestTypeID is TL type id of AddProxyRequest.
const AddProxyRequestTypeID = 0x13c2bcd8
// Ensuring interfaces in compile-time for AddProxyRequest.
var (
_ bin.Encoder = &AddProxyRequest{}
_ bin.Decoder = &AddProxyRequest{}
_ bin.BareEncoder = &AddProxyRequest{}
_ bin.BareDecoder = &AddProxyRequest{}
)
func (a *AddProxyRequest) Zero() bool {
if a == nil {
return true
}
if !(a.Server == "") {
return false
}
if !(a.Port == 0) {
return false
}
if !(a.Enable == false) {
return false
}
if !(a.Type == nil) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AddProxyRequest) String() string {
if a == nil {
return "AddProxyRequest(nil)"
}
type Alias AddProxyRequest
return fmt.Sprintf("AddProxyRequest%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AddProxyRequest) TypeID() uint32 {
return AddProxyRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*AddProxyRequest) TypeName() string {
return "addProxy"
}
// TypeInfo returns info about TL type.
func (a *AddProxyRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "addProxy",
ID: AddProxyRequestTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "Server",
SchemaName: "server",
},
{
Name: "Port",
SchemaName: "port",
},
{
Name: "Enable",
SchemaName: "enable",
},
{
Name: "Type",
SchemaName: "type",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AddProxyRequest) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addProxy#13c2bcd8 as nil")
}
b.PutID(AddProxyRequestTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AddProxyRequest) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addProxy#13c2bcd8 as nil")
}
b.PutString(a.Server)
b.PutInt32(a.Port)
b.PutBool(a.Enable)
if a.Type == nil {
return fmt.Errorf("unable to encode addProxy#13c2bcd8: field type is nil")
}
if err := a.Type.Encode(b); err != nil {
return fmt.Errorf("unable to encode addProxy#13c2bcd8: field type: %w", err)
}
return nil
}
// Decode implements bin.Decoder.
func (a *AddProxyRequest) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addProxy#13c2bcd8 to nil")
}
if err := b.ConsumeID(AddProxyRequestTypeID); err != nil {
return fmt.Errorf("unable to decode addProxy#13c2bcd8: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AddProxyRequest) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addProxy#13c2bcd8 to nil")
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode addProxy#13c2bcd8: field server: %w", err)
}
a.Server = value
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode addProxy#13c2bcd8: field port: %w", err)
}
a.Port = value
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode addProxy#13c2bcd8: field enable: %w", err)
}
a.Enable = value
}
{
value, err := DecodeProxyType(b)
if err != nil {
return fmt.Errorf("unable to decode addProxy#13c2bcd8: field type: %w", err)
}
a.Type = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AddProxyRequest) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode addProxy#13c2bcd8 as nil")
}
b.ObjStart()
b.PutID("addProxy")
b.Comma()
b.FieldStart("server")
b.PutString(a.Server)
b.Comma()
b.FieldStart("port")
b.PutInt32(a.Port)
b.Comma()
b.FieldStart("enable")
b.PutBool(a.Enable)
b.Comma()
b.FieldStart("type")
if a.Type == nil {
return fmt.Errorf("unable to encode addProxy#13c2bcd8: field type is nil")
}
if err := a.Type.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode addProxy#13c2bcd8: field type: %w", err)
}
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AddProxyRequest) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode addProxy#13c2bcd8 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("addProxy"); err != nil {
return fmt.Errorf("unable to decode addProxy#13c2bcd8: %w", err)
}
case "server":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode addProxy#13c2bcd8: field server: %w", err)
}
a.Server = value
case "port":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode addProxy#13c2bcd8: field port: %w", err)
}
a.Port = value
case "enable":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode addProxy#13c2bcd8: field enable: %w", err)
}
a.Enable = value
case "type":
value, err := DecodeTDLibJSONProxyType(b)
if err != nil {
return fmt.Errorf("unable to decode addProxy#13c2bcd8: field type: %w", err)
}
a.Type = value
default:
return b.Skip()
}
return nil
})
}
// GetServer returns value of Server field.
func (a *AddProxyRequest) GetServer() (value string) {
if a == nil {
return
}
return a.Server
}
// GetPort returns value of Port field.
func (a *AddProxyRequest) GetPort() (value int32) {
if a == nil {
return
}
return a.Port
}
// GetEnable returns value of Enable field.
func (a *AddProxyRequest) GetEnable() (value bool) {
if a == nil {
return
}
return a.Enable
}
// GetType returns value of Type field.
func (a *AddProxyRequest) GetType() (value ProxyTypeClass) {
if a == nil {
return
}
return a.Type
}
// AddProxy invokes method addProxy#13c2bcd8 returning error if any.
func (c *Client) AddProxy(ctx context.Context, request *AddProxyRequest) (*Proxy, error) {
var result Proxy
if err := c.rpc.Invoke(ctx, request, &result); err != nil {
return nil, err
}
return &result, nil
}
@@ -1,341 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AddQuickReplyShortcutInlineQueryResultMessageRequest represents TL type `addQuickReplyShortcutInlineQueryResultMessage#87c02a04`.
type AddQuickReplyShortcutInlineQueryResultMessageRequest struct {
// Name of the target shortcut
ShortcutName string
// Identifier of a quick reply message in the same shortcut to be replied; pass 0 if none
ReplyToMessageID int64
// Identifier of the inline query
QueryID int64
// Identifier of the inline query result
ResultID string
// Pass true to hide the bot, via which the message is sent. Can be used only for bots
// getOption("animation_search_bot_username"), getOption("photo_search_bot_username"),
// and getOption("venue_search_bot_username")
HideViaBot bool
}
// AddQuickReplyShortcutInlineQueryResultMessageRequestTypeID is TL type id of AddQuickReplyShortcutInlineQueryResultMessageRequest.
const AddQuickReplyShortcutInlineQueryResultMessageRequestTypeID = 0x87c02a04
// Ensuring interfaces in compile-time for AddQuickReplyShortcutInlineQueryResultMessageRequest.
var (
_ bin.Encoder = &AddQuickReplyShortcutInlineQueryResultMessageRequest{}
_ bin.Decoder = &AddQuickReplyShortcutInlineQueryResultMessageRequest{}
_ bin.BareEncoder = &AddQuickReplyShortcutInlineQueryResultMessageRequest{}
_ bin.BareDecoder = &AddQuickReplyShortcutInlineQueryResultMessageRequest{}
)
func (a *AddQuickReplyShortcutInlineQueryResultMessageRequest) Zero() bool {
if a == nil {
return true
}
if !(a.ShortcutName == "") {
return false
}
if !(a.ReplyToMessageID == 0) {
return false
}
if !(a.QueryID == 0) {
return false
}
if !(a.ResultID == "") {
return false
}
if !(a.HideViaBot == false) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AddQuickReplyShortcutInlineQueryResultMessageRequest) String() string {
if a == nil {
return "AddQuickReplyShortcutInlineQueryResultMessageRequest(nil)"
}
type Alias AddQuickReplyShortcutInlineQueryResultMessageRequest
return fmt.Sprintf("AddQuickReplyShortcutInlineQueryResultMessageRequest%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AddQuickReplyShortcutInlineQueryResultMessageRequest) TypeID() uint32 {
return AddQuickReplyShortcutInlineQueryResultMessageRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*AddQuickReplyShortcutInlineQueryResultMessageRequest) TypeName() string {
return "addQuickReplyShortcutInlineQueryResultMessage"
}
// TypeInfo returns info about TL type.
func (a *AddQuickReplyShortcutInlineQueryResultMessageRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "addQuickReplyShortcutInlineQueryResultMessage",
ID: AddQuickReplyShortcutInlineQueryResultMessageRequestTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "ShortcutName",
SchemaName: "shortcut_name",
},
{
Name: "ReplyToMessageID",
SchemaName: "reply_to_message_id",
},
{
Name: "QueryID",
SchemaName: "query_id",
},
{
Name: "ResultID",
SchemaName: "result_id",
},
{
Name: "HideViaBot",
SchemaName: "hide_via_bot",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AddQuickReplyShortcutInlineQueryResultMessageRequest) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addQuickReplyShortcutInlineQueryResultMessage#87c02a04 as nil")
}
b.PutID(AddQuickReplyShortcutInlineQueryResultMessageRequestTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AddQuickReplyShortcutInlineQueryResultMessageRequest) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addQuickReplyShortcutInlineQueryResultMessage#87c02a04 as nil")
}
b.PutString(a.ShortcutName)
b.PutInt53(a.ReplyToMessageID)
b.PutLong(a.QueryID)
b.PutString(a.ResultID)
b.PutBool(a.HideViaBot)
return nil
}
// Decode implements bin.Decoder.
func (a *AddQuickReplyShortcutInlineQueryResultMessageRequest) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addQuickReplyShortcutInlineQueryResultMessage#87c02a04 to nil")
}
if err := b.ConsumeID(AddQuickReplyShortcutInlineQueryResultMessageRequestTypeID); err != nil {
return fmt.Errorf("unable to decode addQuickReplyShortcutInlineQueryResultMessage#87c02a04: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AddQuickReplyShortcutInlineQueryResultMessageRequest) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addQuickReplyShortcutInlineQueryResultMessage#87c02a04 to nil")
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode addQuickReplyShortcutInlineQueryResultMessage#87c02a04: field shortcut_name: %w", err)
}
a.ShortcutName = value
}
{
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addQuickReplyShortcutInlineQueryResultMessage#87c02a04: field reply_to_message_id: %w", err)
}
a.ReplyToMessageID = value
}
{
value, err := b.Long()
if err != nil {
return fmt.Errorf("unable to decode addQuickReplyShortcutInlineQueryResultMessage#87c02a04: field query_id: %w", err)
}
a.QueryID = value
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode addQuickReplyShortcutInlineQueryResultMessage#87c02a04: field result_id: %w", err)
}
a.ResultID = value
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode addQuickReplyShortcutInlineQueryResultMessage#87c02a04: field hide_via_bot: %w", err)
}
a.HideViaBot = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AddQuickReplyShortcutInlineQueryResultMessageRequest) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode addQuickReplyShortcutInlineQueryResultMessage#87c02a04 as nil")
}
b.ObjStart()
b.PutID("addQuickReplyShortcutInlineQueryResultMessage")
b.Comma()
b.FieldStart("shortcut_name")
b.PutString(a.ShortcutName)
b.Comma()
b.FieldStart("reply_to_message_id")
b.PutInt53(a.ReplyToMessageID)
b.Comma()
b.FieldStart("query_id")
b.PutLong(a.QueryID)
b.Comma()
b.FieldStart("result_id")
b.PutString(a.ResultID)
b.Comma()
b.FieldStart("hide_via_bot")
b.PutBool(a.HideViaBot)
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AddQuickReplyShortcutInlineQueryResultMessageRequest) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode addQuickReplyShortcutInlineQueryResultMessage#87c02a04 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("addQuickReplyShortcutInlineQueryResultMessage"); err != nil {
return fmt.Errorf("unable to decode addQuickReplyShortcutInlineQueryResultMessage#87c02a04: %w", err)
}
case "shortcut_name":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode addQuickReplyShortcutInlineQueryResultMessage#87c02a04: field shortcut_name: %w", err)
}
a.ShortcutName = value
case "reply_to_message_id":
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addQuickReplyShortcutInlineQueryResultMessage#87c02a04: field reply_to_message_id: %w", err)
}
a.ReplyToMessageID = value
case "query_id":
value, err := b.Long()
if err != nil {
return fmt.Errorf("unable to decode addQuickReplyShortcutInlineQueryResultMessage#87c02a04: field query_id: %w", err)
}
a.QueryID = value
case "result_id":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode addQuickReplyShortcutInlineQueryResultMessage#87c02a04: field result_id: %w", err)
}
a.ResultID = value
case "hide_via_bot":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode addQuickReplyShortcutInlineQueryResultMessage#87c02a04: field hide_via_bot: %w", err)
}
a.HideViaBot = value
default:
return b.Skip()
}
return nil
})
}
// GetShortcutName returns value of ShortcutName field.
func (a *AddQuickReplyShortcutInlineQueryResultMessageRequest) GetShortcutName() (value string) {
if a == nil {
return
}
return a.ShortcutName
}
// GetReplyToMessageID returns value of ReplyToMessageID field.
func (a *AddQuickReplyShortcutInlineQueryResultMessageRequest) GetReplyToMessageID() (value int64) {
if a == nil {
return
}
return a.ReplyToMessageID
}
// GetQueryID returns value of QueryID field.
func (a *AddQuickReplyShortcutInlineQueryResultMessageRequest) GetQueryID() (value int64) {
if a == nil {
return
}
return a.QueryID
}
// GetResultID returns value of ResultID field.
func (a *AddQuickReplyShortcutInlineQueryResultMessageRequest) GetResultID() (value string) {
if a == nil {
return
}
return a.ResultID
}
// GetHideViaBot returns value of HideViaBot field.
func (a *AddQuickReplyShortcutInlineQueryResultMessageRequest) GetHideViaBot() (value bool) {
if a == nil {
return
}
return a.HideViaBot
}
// AddQuickReplyShortcutInlineQueryResultMessage invokes method addQuickReplyShortcutInlineQueryResultMessage#87c02a04 returning error if any.
func (c *Client) AddQuickReplyShortcutInlineQueryResultMessage(ctx context.Context, request *AddQuickReplyShortcutInlineQueryResultMessageRequest) (*QuickReplyMessage, error) {
var result QuickReplyMessage
if err := c.rpc.Invoke(ctx, request, &result); err != nil {
return nil, err
}
return &result, nil
}
@@ -1,306 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AddQuickReplyShortcutMessageAlbumRequest represents TL type `addQuickReplyShortcutMessageAlbum#9647a3fd`.
type AddQuickReplyShortcutMessageAlbumRequest struct {
// Name of the target shortcut
ShortcutName string
// Identifier of a quick reply message in the same shortcut to be replied; pass 0 if none
ReplyToMessageID int64
// Contents of messages to be sent. At most 10 messages can be added to an album. All
// messages must have the same value of show_caption_above_media
InputMessageContents []InputMessageContentClass
}
// AddQuickReplyShortcutMessageAlbumRequestTypeID is TL type id of AddQuickReplyShortcutMessageAlbumRequest.
const AddQuickReplyShortcutMessageAlbumRequestTypeID = 0x9647a3fd
// Ensuring interfaces in compile-time for AddQuickReplyShortcutMessageAlbumRequest.
var (
_ bin.Encoder = &AddQuickReplyShortcutMessageAlbumRequest{}
_ bin.Decoder = &AddQuickReplyShortcutMessageAlbumRequest{}
_ bin.BareEncoder = &AddQuickReplyShortcutMessageAlbumRequest{}
_ bin.BareDecoder = &AddQuickReplyShortcutMessageAlbumRequest{}
)
func (a *AddQuickReplyShortcutMessageAlbumRequest) Zero() bool {
if a == nil {
return true
}
if !(a.ShortcutName == "") {
return false
}
if !(a.ReplyToMessageID == 0) {
return false
}
if !(a.InputMessageContents == nil) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AddQuickReplyShortcutMessageAlbumRequest) String() string {
if a == nil {
return "AddQuickReplyShortcutMessageAlbumRequest(nil)"
}
type Alias AddQuickReplyShortcutMessageAlbumRequest
return fmt.Sprintf("AddQuickReplyShortcutMessageAlbumRequest%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AddQuickReplyShortcutMessageAlbumRequest) TypeID() uint32 {
return AddQuickReplyShortcutMessageAlbumRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*AddQuickReplyShortcutMessageAlbumRequest) TypeName() string {
return "addQuickReplyShortcutMessageAlbum"
}
// TypeInfo returns info about TL type.
func (a *AddQuickReplyShortcutMessageAlbumRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "addQuickReplyShortcutMessageAlbum",
ID: AddQuickReplyShortcutMessageAlbumRequestTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "ShortcutName",
SchemaName: "shortcut_name",
},
{
Name: "ReplyToMessageID",
SchemaName: "reply_to_message_id",
},
{
Name: "InputMessageContents",
SchemaName: "input_message_contents",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AddQuickReplyShortcutMessageAlbumRequest) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addQuickReplyShortcutMessageAlbum#9647a3fd as nil")
}
b.PutID(AddQuickReplyShortcutMessageAlbumRequestTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AddQuickReplyShortcutMessageAlbumRequest) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addQuickReplyShortcutMessageAlbum#9647a3fd as nil")
}
b.PutString(a.ShortcutName)
b.PutInt53(a.ReplyToMessageID)
b.PutInt(len(a.InputMessageContents))
for idx, v := range a.InputMessageContents {
if v == nil {
return fmt.Errorf("unable to encode addQuickReplyShortcutMessageAlbum#9647a3fd: field input_message_contents element with index %d is nil", idx)
}
if err := v.EncodeBare(b); err != nil {
return fmt.Errorf("unable to encode bare addQuickReplyShortcutMessageAlbum#9647a3fd: field input_message_contents element with index %d: %w", idx, err)
}
}
return nil
}
// Decode implements bin.Decoder.
func (a *AddQuickReplyShortcutMessageAlbumRequest) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addQuickReplyShortcutMessageAlbum#9647a3fd to nil")
}
if err := b.ConsumeID(AddQuickReplyShortcutMessageAlbumRequestTypeID); err != nil {
return fmt.Errorf("unable to decode addQuickReplyShortcutMessageAlbum#9647a3fd: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AddQuickReplyShortcutMessageAlbumRequest) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addQuickReplyShortcutMessageAlbum#9647a3fd to nil")
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode addQuickReplyShortcutMessageAlbum#9647a3fd: field shortcut_name: %w", err)
}
a.ShortcutName = value
}
{
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addQuickReplyShortcutMessageAlbum#9647a3fd: field reply_to_message_id: %w", err)
}
a.ReplyToMessageID = value
}
{
headerLen, err := b.Int()
if err != nil {
return fmt.Errorf("unable to decode addQuickReplyShortcutMessageAlbum#9647a3fd: field input_message_contents: %w", err)
}
if headerLen > 0 {
a.InputMessageContents = make([]InputMessageContentClass, 0, headerLen%bin.PreallocateLimit)
}
for idx := 0; idx < headerLen; idx++ {
value, err := DecodeInputMessageContent(b)
if err != nil {
return fmt.Errorf("unable to decode addQuickReplyShortcutMessageAlbum#9647a3fd: field input_message_contents: %w", err)
}
a.InputMessageContents = append(a.InputMessageContents, value)
}
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AddQuickReplyShortcutMessageAlbumRequest) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode addQuickReplyShortcutMessageAlbum#9647a3fd as nil")
}
b.ObjStart()
b.PutID("addQuickReplyShortcutMessageAlbum")
b.Comma()
b.FieldStart("shortcut_name")
b.PutString(a.ShortcutName)
b.Comma()
b.FieldStart("reply_to_message_id")
b.PutInt53(a.ReplyToMessageID)
b.Comma()
b.FieldStart("input_message_contents")
b.ArrStart()
for idx, v := range a.InputMessageContents {
if v == nil {
return fmt.Errorf("unable to encode addQuickReplyShortcutMessageAlbum#9647a3fd: field input_message_contents element with index %d is nil", idx)
}
if err := v.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode addQuickReplyShortcutMessageAlbum#9647a3fd: field input_message_contents element with index %d: %w", idx, err)
}
b.Comma()
}
b.StripComma()
b.ArrEnd()
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AddQuickReplyShortcutMessageAlbumRequest) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode addQuickReplyShortcutMessageAlbum#9647a3fd to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("addQuickReplyShortcutMessageAlbum"); err != nil {
return fmt.Errorf("unable to decode addQuickReplyShortcutMessageAlbum#9647a3fd: %w", err)
}
case "shortcut_name":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode addQuickReplyShortcutMessageAlbum#9647a3fd: field shortcut_name: %w", err)
}
a.ShortcutName = value
case "reply_to_message_id":
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addQuickReplyShortcutMessageAlbum#9647a3fd: field reply_to_message_id: %w", err)
}
a.ReplyToMessageID = value
case "input_message_contents":
if err := b.Arr(func(b tdjson.Decoder) error {
value, err := DecodeTDLibJSONInputMessageContent(b)
if err != nil {
return fmt.Errorf("unable to decode addQuickReplyShortcutMessageAlbum#9647a3fd: field input_message_contents: %w", err)
}
a.InputMessageContents = append(a.InputMessageContents, value)
return nil
}); err != nil {
return fmt.Errorf("unable to decode addQuickReplyShortcutMessageAlbum#9647a3fd: field input_message_contents: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// GetShortcutName returns value of ShortcutName field.
func (a *AddQuickReplyShortcutMessageAlbumRequest) GetShortcutName() (value string) {
if a == nil {
return
}
return a.ShortcutName
}
// GetReplyToMessageID returns value of ReplyToMessageID field.
func (a *AddQuickReplyShortcutMessageAlbumRequest) GetReplyToMessageID() (value int64) {
if a == nil {
return
}
return a.ReplyToMessageID
}
// GetInputMessageContents returns value of InputMessageContents field.
func (a *AddQuickReplyShortcutMessageAlbumRequest) GetInputMessageContents() (value []InputMessageContentClass) {
if a == nil {
return
}
return a.InputMessageContents
}
// AddQuickReplyShortcutMessageAlbum invokes method addQuickReplyShortcutMessageAlbum#9647a3fd returning error if any.
func (c *Client) AddQuickReplyShortcutMessageAlbum(ctx context.Context, request *AddQuickReplyShortcutMessageAlbumRequest) (*QuickReplyMessages, error) {
var result QuickReplyMessages
if err := c.rpc.Invoke(ctx, request, &result); err != nil {
return nil, err
}
return &result, nil
}
-282
View File
@@ -1,282 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AddQuickReplyShortcutMessageRequest represents TL type `addQuickReplyShortcutMessage#3f188b2a`.
type AddQuickReplyShortcutMessageRequest struct {
// Name of the target shortcut
ShortcutName string
// Identifier of a quick reply message in the same shortcut to be replied; pass 0 if none
ReplyToMessageID int64
// The content of the message to be added; inputMessagePoll, inputMessageForwarded and
// inputMessageLocation with live_period aren't supported
InputMessageContent InputMessageContentClass
}
// AddQuickReplyShortcutMessageRequestTypeID is TL type id of AddQuickReplyShortcutMessageRequest.
const AddQuickReplyShortcutMessageRequestTypeID = 0x3f188b2a
// Ensuring interfaces in compile-time for AddQuickReplyShortcutMessageRequest.
var (
_ bin.Encoder = &AddQuickReplyShortcutMessageRequest{}
_ bin.Decoder = &AddQuickReplyShortcutMessageRequest{}
_ bin.BareEncoder = &AddQuickReplyShortcutMessageRequest{}
_ bin.BareDecoder = &AddQuickReplyShortcutMessageRequest{}
)
func (a *AddQuickReplyShortcutMessageRequest) Zero() bool {
if a == nil {
return true
}
if !(a.ShortcutName == "") {
return false
}
if !(a.ReplyToMessageID == 0) {
return false
}
if !(a.InputMessageContent == nil) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AddQuickReplyShortcutMessageRequest) String() string {
if a == nil {
return "AddQuickReplyShortcutMessageRequest(nil)"
}
type Alias AddQuickReplyShortcutMessageRequest
return fmt.Sprintf("AddQuickReplyShortcutMessageRequest%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AddQuickReplyShortcutMessageRequest) TypeID() uint32 {
return AddQuickReplyShortcutMessageRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*AddQuickReplyShortcutMessageRequest) TypeName() string {
return "addQuickReplyShortcutMessage"
}
// TypeInfo returns info about TL type.
func (a *AddQuickReplyShortcutMessageRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "addQuickReplyShortcutMessage",
ID: AddQuickReplyShortcutMessageRequestTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "ShortcutName",
SchemaName: "shortcut_name",
},
{
Name: "ReplyToMessageID",
SchemaName: "reply_to_message_id",
},
{
Name: "InputMessageContent",
SchemaName: "input_message_content",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AddQuickReplyShortcutMessageRequest) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addQuickReplyShortcutMessage#3f188b2a as nil")
}
b.PutID(AddQuickReplyShortcutMessageRequestTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AddQuickReplyShortcutMessageRequest) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addQuickReplyShortcutMessage#3f188b2a as nil")
}
b.PutString(a.ShortcutName)
b.PutInt53(a.ReplyToMessageID)
if a.InputMessageContent == nil {
return fmt.Errorf("unable to encode addQuickReplyShortcutMessage#3f188b2a: field input_message_content is nil")
}
if err := a.InputMessageContent.Encode(b); err != nil {
return fmt.Errorf("unable to encode addQuickReplyShortcutMessage#3f188b2a: field input_message_content: %w", err)
}
return nil
}
// Decode implements bin.Decoder.
func (a *AddQuickReplyShortcutMessageRequest) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addQuickReplyShortcutMessage#3f188b2a to nil")
}
if err := b.ConsumeID(AddQuickReplyShortcutMessageRequestTypeID); err != nil {
return fmt.Errorf("unable to decode addQuickReplyShortcutMessage#3f188b2a: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AddQuickReplyShortcutMessageRequest) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addQuickReplyShortcutMessage#3f188b2a to nil")
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode addQuickReplyShortcutMessage#3f188b2a: field shortcut_name: %w", err)
}
a.ShortcutName = value
}
{
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addQuickReplyShortcutMessage#3f188b2a: field reply_to_message_id: %w", err)
}
a.ReplyToMessageID = value
}
{
value, err := DecodeInputMessageContent(b)
if err != nil {
return fmt.Errorf("unable to decode addQuickReplyShortcutMessage#3f188b2a: field input_message_content: %w", err)
}
a.InputMessageContent = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AddQuickReplyShortcutMessageRequest) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode addQuickReplyShortcutMessage#3f188b2a as nil")
}
b.ObjStart()
b.PutID("addQuickReplyShortcutMessage")
b.Comma()
b.FieldStart("shortcut_name")
b.PutString(a.ShortcutName)
b.Comma()
b.FieldStart("reply_to_message_id")
b.PutInt53(a.ReplyToMessageID)
b.Comma()
b.FieldStart("input_message_content")
if a.InputMessageContent == nil {
return fmt.Errorf("unable to encode addQuickReplyShortcutMessage#3f188b2a: field input_message_content is nil")
}
if err := a.InputMessageContent.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode addQuickReplyShortcutMessage#3f188b2a: field input_message_content: %w", err)
}
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AddQuickReplyShortcutMessageRequest) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode addQuickReplyShortcutMessage#3f188b2a to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("addQuickReplyShortcutMessage"); err != nil {
return fmt.Errorf("unable to decode addQuickReplyShortcutMessage#3f188b2a: %w", err)
}
case "shortcut_name":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode addQuickReplyShortcutMessage#3f188b2a: field shortcut_name: %w", err)
}
a.ShortcutName = value
case "reply_to_message_id":
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addQuickReplyShortcutMessage#3f188b2a: field reply_to_message_id: %w", err)
}
a.ReplyToMessageID = value
case "input_message_content":
value, err := DecodeTDLibJSONInputMessageContent(b)
if err != nil {
return fmt.Errorf("unable to decode addQuickReplyShortcutMessage#3f188b2a: field input_message_content: %w", err)
}
a.InputMessageContent = value
default:
return b.Skip()
}
return nil
})
}
// GetShortcutName returns value of ShortcutName field.
func (a *AddQuickReplyShortcutMessageRequest) GetShortcutName() (value string) {
if a == nil {
return
}
return a.ShortcutName
}
// GetReplyToMessageID returns value of ReplyToMessageID field.
func (a *AddQuickReplyShortcutMessageRequest) GetReplyToMessageID() (value int64) {
if a == nil {
return
}
return a.ReplyToMessageID
}
// GetInputMessageContent returns value of InputMessageContent field.
func (a *AddQuickReplyShortcutMessageRequest) GetInputMessageContent() (value InputMessageContentClass) {
if a == nil {
return
}
return a.InputMessageContent
}
// AddQuickReplyShortcutMessage invokes method addQuickReplyShortcutMessage#3f188b2a returning error if any.
func (c *Client) AddQuickReplyShortcutMessage(ctx context.Context, request *AddQuickReplyShortcutMessageRequest) (*QuickReplyMessage, error) {
var result QuickReplyMessage
if err := c.rpc.Invoke(ctx, request, &result); err != nil {
return nil, err
}
return &result, nil
}
-248
View File
@@ -1,248 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AddRecentStickerRequest represents TL type `addRecentSticker#a7e5d89e`.
type AddRecentStickerRequest struct {
// Pass true to add the sticker to the list of stickers recently attached to photo or
// video files; pass false to add the sticker to the list of recently sent stickers
IsAttached bool
// Sticker file to add
Sticker InputFileClass
}
// AddRecentStickerRequestTypeID is TL type id of AddRecentStickerRequest.
const AddRecentStickerRequestTypeID = 0xa7e5d89e
// Ensuring interfaces in compile-time for AddRecentStickerRequest.
var (
_ bin.Encoder = &AddRecentStickerRequest{}
_ bin.Decoder = &AddRecentStickerRequest{}
_ bin.BareEncoder = &AddRecentStickerRequest{}
_ bin.BareDecoder = &AddRecentStickerRequest{}
)
func (a *AddRecentStickerRequest) Zero() bool {
if a == nil {
return true
}
if !(a.IsAttached == false) {
return false
}
if !(a.Sticker == nil) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AddRecentStickerRequest) String() string {
if a == nil {
return "AddRecentStickerRequest(nil)"
}
type Alias AddRecentStickerRequest
return fmt.Sprintf("AddRecentStickerRequest%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AddRecentStickerRequest) TypeID() uint32 {
return AddRecentStickerRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*AddRecentStickerRequest) TypeName() string {
return "addRecentSticker"
}
// TypeInfo returns info about TL type.
func (a *AddRecentStickerRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "addRecentSticker",
ID: AddRecentStickerRequestTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "IsAttached",
SchemaName: "is_attached",
},
{
Name: "Sticker",
SchemaName: "sticker",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AddRecentStickerRequest) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addRecentSticker#a7e5d89e as nil")
}
b.PutID(AddRecentStickerRequestTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AddRecentStickerRequest) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addRecentSticker#a7e5d89e as nil")
}
b.PutBool(a.IsAttached)
if a.Sticker == nil {
return fmt.Errorf("unable to encode addRecentSticker#a7e5d89e: field sticker is nil")
}
if err := a.Sticker.Encode(b); err != nil {
return fmt.Errorf("unable to encode addRecentSticker#a7e5d89e: field sticker: %w", err)
}
return nil
}
// Decode implements bin.Decoder.
func (a *AddRecentStickerRequest) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addRecentSticker#a7e5d89e to nil")
}
if err := b.ConsumeID(AddRecentStickerRequestTypeID); err != nil {
return fmt.Errorf("unable to decode addRecentSticker#a7e5d89e: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AddRecentStickerRequest) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addRecentSticker#a7e5d89e to nil")
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode addRecentSticker#a7e5d89e: field is_attached: %w", err)
}
a.IsAttached = value
}
{
value, err := DecodeInputFile(b)
if err != nil {
return fmt.Errorf("unable to decode addRecentSticker#a7e5d89e: field sticker: %w", err)
}
a.Sticker = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AddRecentStickerRequest) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode addRecentSticker#a7e5d89e as nil")
}
b.ObjStart()
b.PutID("addRecentSticker")
b.Comma()
b.FieldStart("is_attached")
b.PutBool(a.IsAttached)
b.Comma()
b.FieldStart("sticker")
if a.Sticker == nil {
return fmt.Errorf("unable to encode addRecentSticker#a7e5d89e: field sticker is nil")
}
if err := a.Sticker.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode addRecentSticker#a7e5d89e: field sticker: %w", err)
}
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AddRecentStickerRequest) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode addRecentSticker#a7e5d89e to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("addRecentSticker"); err != nil {
return fmt.Errorf("unable to decode addRecentSticker#a7e5d89e: %w", err)
}
case "is_attached":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode addRecentSticker#a7e5d89e: field is_attached: %w", err)
}
a.IsAttached = value
case "sticker":
value, err := DecodeTDLibJSONInputFile(b)
if err != nil {
return fmt.Errorf("unable to decode addRecentSticker#a7e5d89e: field sticker: %w", err)
}
a.Sticker = value
default:
return b.Skip()
}
return nil
})
}
// GetIsAttached returns value of IsAttached field.
func (a *AddRecentStickerRequest) GetIsAttached() (value bool) {
if a == nil {
return
}
return a.IsAttached
}
// GetSticker returns value of Sticker field.
func (a *AddRecentStickerRequest) GetSticker() (value InputFileClass) {
if a == nil {
return
}
return a.Sticker
}
// AddRecentSticker invokes method addRecentSticker#a7e5d89e returning error if any.
func (c *Client) AddRecentSticker(ctx context.Context, request *AddRecentStickerRequest) (*Stickers, error) {
var result Stickers
if err := c.rpc.Invoke(ctx, request, &result); err != nil {
return nil, err
}
return &result, nil
}
-206
View File
@@ -1,206 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AddRecentlyFoundChatRequest represents TL type `addRecentlyFoundChat#97e8198d`.
type AddRecentlyFoundChatRequest struct {
// Identifier of the chat to add
ChatID int64
}
// AddRecentlyFoundChatRequestTypeID is TL type id of AddRecentlyFoundChatRequest.
const AddRecentlyFoundChatRequestTypeID = 0x97e8198d
// Ensuring interfaces in compile-time for AddRecentlyFoundChatRequest.
var (
_ bin.Encoder = &AddRecentlyFoundChatRequest{}
_ bin.Decoder = &AddRecentlyFoundChatRequest{}
_ bin.BareEncoder = &AddRecentlyFoundChatRequest{}
_ bin.BareDecoder = &AddRecentlyFoundChatRequest{}
)
func (a *AddRecentlyFoundChatRequest) Zero() bool {
if a == nil {
return true
}
if !(a.ChatID == 0) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AddRecentlyFoundChatRequest) String() string {
if a == nil {
return "AddRecentlyFoundChatRequest(nil)"
}
type Alias AddRecentlyFoundChatRequest
return fmt.Sprintf("AddRecentlyFoundChatRequest%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AddRecentlyFoundChatRequest) TypeID() uint32 {
return AddRecentlyFoundChatRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*AddRecentlyFoundChatRequest) TypeName() string {
return "addRecentlyFoundChat"
}
// TypeInfo returns info about TL type.
func (a *AddRecentlyFoundChatRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "addRecentlyFoundChat",
ID: AddRecentlyFoundChatRequestTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "ChatID",
SchemaName: "chat_id",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AddRecentlyFoundChatRequest) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addRecentlyFoundChat#97e8198d as nil")
}
b.PutID(AddRecentlyFoundChatRequestTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AddRecentlyFoundChatRequest) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addRecentlyFoundChat#97e8198d as nil")
}
b.PutInt53(a.ChatID)
return nil
}
// Decode implements bin.Decoder.
func (a *AddRecentlyFoundChatRequest) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addRecentlyFoundChat#97e8198d to nil")
}
if err := b.ConsumeID(AddRecentlyFoundChatRequestTypeID); err != nil {
return fmt.Errorf("unable to decode addRecentlyFoundChat#97e8198d: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AddRecentlyFoundChatRequest) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addRecentlyFoundChat#97e8198d to nil")
}
{
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addRecentlyFoundChat#97e8198d: field chat_id: %w", err)
}
a.ChatID = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AddRecentlyFoundChatRequest) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode addRecentlyFoundChat#97e8198d as nil")
}
b.ObjStart()
b.PutID("addRecentlyFoundChat")
b.Comma()
b.FieldStart("chat_id")
b.PutInt53(a.ChatID)
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AddRecentlyFoundChatRequest) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode addRecentlyFoundChat#97e8198d to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("addRecentlyFoundChat"); err != nil {
return fmt.Errorf("unable to decode addRecentlyFoundChat#97e8198d: %w", err)
}
case "chat_id":
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addRecentlyFoundChat#97e8198d: field chat_id: %w", err)
}
a.ChatID = value
default:
return b.Skip()
}
return nil
})
}
// GetChatID returns value of ChatID field.
func (a *AddRecentlyFoundChatRequest) GetChatID() (value int64) {
if a == nil {
return
}
return a.ChatID
}
// AddRecentlyFoundChat invokes method addRecentlyFoundChat#97e8198d returning error if any.
func (c *Client) AddRecentlyFoundChat(ctx context.Context, chatid int64) error {
var ok Ok
request := &AddRecentlyFoundChatRequest{
ChatID: chatid,
}
if err := c.rpc.Invoke(ctx, request, &ok); err != nil {
return err
}
return nil
}
-217
View File
@@ -1,217 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AddSavedAnimationRequest represents TL type `addSavedAnimation#a44bf860`.
type AddSavedAnimationRequest struct {
// The animation file to be added. Only animations known to the server (i.e.,
// successfully sent via a message) can be added to the list
Animation InputFileClass
}
// AddSavedAnimationRequestTypeID is TL type id of AddSavedAnimationRequest.
const AddSavedAnimationRequestTypeID = 0xa44bf860
// Ensuring interfaces in compile-time for AddSavedAnimationRequest.
var (
_ bin.Encoder = &AddSavedAnimationRequest{}
_ bin.Decoder = &AddSavedAnimationRequest{}
_ bin.BareEncoder = &AddSavedAnimationRequest{}
_ bin.BareDecoder = &AddSavedAnimationRequest{}
)
func (a *AddSavedAnimationRequest) Zero() bool {
if a == nil {
return true
}
if !(a.Animation == nil) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AddSavedAnimationRequest) String() string {
if a == nil {
return "AddSavedAnimationRequest(nil)"
}
type Alias AddSavedAnimationRequest
return fmt.Sprintf("AddSavedAnimationRequest%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AddSavedAnimationRequest) TypeID() uint32 {
return AddSavedAnimationRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*AddSavedAnimationRequest) TypeName() string {
return "addSavedAnimation"
}
// TypeInfo returns info about TL type.
func (a *AddSavedAnimationRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "addSavedAnimation",
ID: AddSavedAnimationRequestTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "Animation",
SchemaName: "animation",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AddSavedAnimationRequest) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addSavedAnimation#a44bf860 as nil")
}
b.PutID(AddSavedAnimationRequestTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AddSavedAnimationRequest) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addSavedAnimation#a44bf860 as nil")
}
if a.Animation == nil {
return fmt.Errorf("unable to encode addSavedAnimation#a44bf860: field animation is nil")
}
if err := a.Animation.Encode(b); err != nil {
return fmt.Errorf("unable to encode addSavedAnimation#a44bf860: field animation: %w", err)
}
return nil
}
// Decode implements bin.Decoder.
func (a *AddSavedAnimationRequest) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addSavedAnimation#a44bf860 to nil")
}
if err := b.ConsumeID(AddSavedAnimationRequestTypeID); err != nil {
return fmt.Errorf("unable to decode addSavedAnimation#a44bf860: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AddSavedAnimationRequest) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addSavedAnimation#a44bf860 to nil")
}
{
value, err := DecodeInputFile(b)
if err != nil {
return fmt.Errorf("unable to decode addSavedAnimation#a44bf860: field animation: %w", err)
}
a.Animation = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AddSavedAnimationRequest) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode addSavedAnimation#a44bf860 as nil")
}
b.ObjStart()
b.PutID("addSavedAnimation")
b.Comma()
b.FieldStart("animation")
if a.Animation == nil {
return fmt.Errorf("unable to encode addSavedAnimation#a44bf860: field animation is nil")
}
if err := a.Animation.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode addSavedAnimation#a44bf860: field animation: %w", err)
}
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AddSavedAnimationRequest) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode addSavedAnimation#a44bf860 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("addSavedAnimation"); err != nil {
return fmt.Errorf("unable to decode addSavedAnimation#a44bf860: %w", err)
}
case "animation":
value, err := DecodeTDLibJSONInputFile(b)
if err != nil {
return fmt.Errorf("unable to decode addSavedAnimation#a44bf860: field animation: %w", err)
}
a.Animation = value
default:
return b.Skip()
}
return nil
})
}
// GetAnimation returns value of Animation field.
func (a *AddSavedAnimationRequest) GetAnimation() (value InputFileClass) {
if a == nil {
return
}
return a.Animation
}
// AddSavedAnimation invokes method addSavedAnimation#a44bf860 returning error if any.
func (c *Client) AddSavedAnimation(ctx context.Context, animation InputFileClass) error {
var ok Ok
request := &AddSavedAnimationRequest{
Animation: animation,
}
if err := c.rpc.Invoke(ctx, request, &ok); err != nil {
return err
}
return nil
}
-216
View File
@@ -1,216 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AddSavedNotificationSoundRequest represents TL type `addSavedNotificationSound#3e3984ef`.
type AddSavedNotificationSoundRequest struct {
// Notification sound file to add
Sound InputFileClass
}
// AddSavedNotificationSoundRequestTypeID is TL type id of AddSavedNotificationSoundRequest.
const AddSavedNotificationSoundRequestTypeID = 0x3e3984ef
// Ensuring interfaces in compile-time for AddSavedNotificationSoundRequest.
var (
_ bin.Encoder = &AddSavedNotificationSoundRequest{}
_ bin.Decoder = &AddSavedNotificationSoundRequest{}
_ bin.BareEncoder = &AddSavedNotificationSoundRequest{}
_ bin.BareDecoder = &AddSavedNotificationSoundRequest{}
)
func (a *AddSavedNotificationSoundRequest) Zero() bool {
if a == nil {
return true
}
if !(a.Sound == nil) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AddSavedNotificationSoundRequest) String() string {
if a == nil {
return "AddSavedNotificationSoundRequest(nil)"
}
type Alias AddSavedNotificationSoundRequest
return fmt.Sprintf("AddSavedNotificationSoundRequest%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AddSavedNotificationSoundRequest) TypeID() uint32 {
return AddSavedNotificationSoundRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*AddSavedNotificationSoundRequest) TypeName() string {
return "addSavedNotificationSound"
}
// TypeInfo returns info about TL type.
func (a *AddSavedNotificationSoundRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "addSavedNotificationSound",
ID: AddSavedNotificationSoundRequestTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "Sound",
SchemaName: "sound",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AddSavedNotificationSoundRequest) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addSavedNotificationSound#3e3984ef as nil")
}
b.PutID(AddSavedNotificationSoundRequestTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AddSavedNotificationSoundRequest) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addSavedNotificationSound#3e3984ef as nil")
}
if a.Sound == nil {
return fmt.Errorf("unable to encode addSavedNotificationSound#3e3984ef: field sound is nil")
}
if err := a.Sound.Encode(b); err != nil {
return fmt.Errorf("unable to encode addSavedNotificationSound#3e3984ef: field sound: %w", err)
}
return nil
}
// Decode implements bin.Decoder.
func (a *AddSavedNotificationSoundRequest) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addSavedNotificationSound#3e3984ef to nil")
}
if err := b.ConsumeID(AddSavedNotificationSoundRequestTypeID); err != nil {
return fmt.Errorf("unable to decode addSavedNotificationSound#3e3984ef: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AddSavedNotificationSoundRequest) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addSavedNotificationSound#3e3984ef to nil")
}
{
value, err := DecodeInputFile(b)
if err != nil {
return fmt.Errorf("unable to decode addSavedNotificationSound#3e3984ef: field sound: %w", err)
}
a.Sound = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AddSavedNotificationSoundRequest) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode addSavedNotificationSound#3e3984ef as nil")
}
b.ObjStart()
b.PutID("addSavedNotificationSound")
b.Comma()
b.FieldStart("sound")
if a.Sound == nil {
return fmt.Errorf("unable to encode addSavedNotificationSound#3e3984ef: field sound is nil")
}
if err := a.Sound.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode addSavedNotificationSound#3e3984ef: field sound: %w", err)
}
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AddSavedNotificationSoundRequest) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode addSavedNotificationSound#3e3984ef to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("addSavedNotificationSound"); err != nil {
return fmt.Errorf("unable to decode addSavedNotificationSound#3e3984ef: %w", err)
}
case "sound":
value, err := DecodeTDLibJSONInputFile(b)
if err != nil {
return fmt.Errorf("unable to decode addSavedNotificationSound#3e3984ef: field sound: %w", err)
}
a.Sound = value
default:
return b.Skip()
}
return nil
})
}
// GetSound returns value of Sound field.
func (a *AddSavedNotificationSoundRequest) GetSound() (value InputFileClass) {
if a == nil {
return
}
return a.Sound
}
// AddSavedNotificationSound invokes method addSavedNotificationSound#3e3984ef returning error if any.
func (c *Client) AddSavedNotificationSound(ctx context.Context, sound InputFileClass) (*NotificationSound, error) {
var result NotificationSound
request := &AddSavedNotificationSoundRequest{
Sound: sound,
}
if err := c.rpc.Invoke(ctx, request, &result); err != nil {
return nil, err
}
return &result, nil
}
-272
View File
@@ -1,272 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AddStickerToSetRequest represents TL type `addStickerToSet#56dc1e3b`.
type AddStickerToSetRequest struct {
// Sticker set owner; ignored for regular users
UserID int64
// Sticker set name. The sticker set must be owned by the current user, and contain less
// than 200 stickers for custom emoji sticker sets and less than 120 otherwise
Name string
// Sticker to add to the set
Sticker InputSticker
}
// AddStickerToSetRequestTypeID is TL type id of AddStickerToSetRequest.
const AddStickerToSetRequestTypeID = 0x56dc1e3b
// Ensuring interfaces in compile-time for AddStickerToSetRequest.
var (
_ bin.Encoder = &AddStickerToSetRequest{}
_ bin.Decoder = &AddStickerToSetRequest{}
_ bin.BareEncoder = &AddStickerToSetRequest{}
_ bin.BareDecoder = &AddStickerToSetRequest{}
)
func (a *AddStickerToSetRequest) Zero() bool {
if a == nil {
return true
}
if !(a.UserID == 0) {
return false
}
if !(a.Name == "") {
return false
}
if !(a.Sticker.Zero()) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AddStickerToSetRequest) String() string {
if a == nil {
return "AddStickerToSetRequest(nil)"
}
type Alias AddStickerToSetRequest
return fmt.Sprintf("AddStickerToSetRequest%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AddStickerToSetRequest) TypeID() uint32 {
return AddStickerToSetRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*AddStickerToSetRequest) TypeName() string {
return "addStickerToSet"
}
// TypeInfo returns info about TL type.
func (a *AddStickerToSetRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "addStickerToSet",
ID: AddStickerToSetRequestTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "UserID",
SchemaName: "user_id",
},
{
Name: "Name",
SchemaName: "name",
},
{
Name: "Sticker",
SchemaName: "sticker",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AddStickerToSetRequest) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addStickerToSet#56dc1e3b as nil")
}
b.PutID(AddStickerToSetRequestTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AddStickerToSetRequest) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addStickerToSet#56dc1e3b as nil")
}
b.PutInt53(a.UserID)
b.PutString(a.Name)
if err := a.Sticker.Encode(b); err != nil {
return fmt.Errorf("unable to encode addStickerToSet#56dc1e3b: field sticker: %w", err)
}
return nil
}
// Decode implements bin.Decoder.
func (a *AddStickerToSetRequest) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addStickerToSet#56dc1e3b to nil")
}
if err := b.ConsumeID(AddStickerToSetRequestTypeID); err != nil {
return fmt.Errorf("unable to decode addStickerToSet#56dc1e3b: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AddStickerToSetRequest) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addStickerToSet#56dc1e3b to nil")
}
{
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addStickerToSet#56dc1e3b: field user_id: %w", err)
}
a.UserID = value
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode addStickerToSet#56dc1e3b: field name: %w", err)
}
a.Name = value
}
{
if err := a.Sticker.Decode(b); err != nil {
return fmt.Errorf("unable to decode addStickerToSet#56dc1e3b: field sticker: %w", err)
}
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AddStickerToSetRequest) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode addStickerToSet#56dc1e3b as nil")
}
b.ObjStart()
b.PutID("addStickerToSet")
b.Comma()
b.FieldStart("user_id")
b.PutInt53(a.UserID)
b.Comma()
b.FieldStart("name")
b.PutString(a.Name)
b.Comma()
b.FieldStart("sticker")
if err := a.Sticker.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode addStickerToSet#56dc1e3b: field sticker: %w", err)
}
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AddStickerToSetRequest) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode addStickerToSet#56dc1e3b to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("addStickerToSet"); err != nil {
return fmt.Errorf("unable to decode addStickerToSet#56dc1e3b: %w", err)
}
case "user_id":
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode addStickerToSet#56dc1e3b: field user_id: %w", err)
}
a.UserID = value
case "name":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode addStickerToSet#56dc1e3b: field name: %w", err)
}
a.Name = value
case "sticker":
if err := a.Sticker.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode addStickerToSet#56dc1e3b: field sticker: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// GetUserID returns value of UserID field.
func (a *AddStickerToSetRequest) GetUserID() (value int64) {
if a == nil {
return
}
return a.UserID
}
// GetName returns value of Name field.
func (a *AddStickerToSetRequest) GetName() (value string) {
if a == nil {
return
}
return a.Name
}
// GetSticker returns value of Sticker field.
func (a *AddStickerToSetRequest) GetSticker() (value InputSticker) {
if a == nil {
return
}
return a.Sticker
}
// AddStickerToSet invokes method addStickerToSet#56dc1e3b returning error if any.
func (c *Client) AddStickerToSet(ctx context.Context, request *AddStickerToSetRequest) error {
var ok Ok
if err := c.rpc.Invoke(ctx, request, &ok); err != nil {
return err
}
return nil
}
-315
View File
@@ -1,315 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AddedReaction represents TL type `addedReaction#4b04819d`.
type AddedReaction struct {
// Type of the reaction
Type ReactionTypeClass
// Identifier of the chat member, applied the reaction
SenderID MessageSenderClass
// True, if the reaction was added by the current user
IsOutgoing bool
// Point in time (Unix timestamp) when the reaction was added
Date int32
}
// AddedReactionTypeID is TL type id of AddedReaction.
const AddedReactionTypeID = 0x4b04819d
// Ensuring interfaces in compile-time for AddedReaction.
var (
_ bin.Encoder = &AddedReaction{}
_ bin.Decoder = &AddedReaction{}
_ bin.BareEncoder = &AddedReaction{}
_ bin.BareDecoder = &AddedReaction{}
)
func (a *AddedReaction) Zero() bool {
if a == nil {
return true
}
if !(a.Type == nil) {
return false
}
if !(a.SenderID == nil) {
return false
}
if !(a.IsOutgoing == false) {
return false
}
if !(a.Date == 0) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AddedReaction) String() string {
if a == nil {
return "AddedReaction(nil)"
}
type Alias AddedReaction
return fmt.Sprintf("AddedReaction%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AddedReaction) TypeID() uint32 {
return AddedReactionTypeID
}
// TypeName returns name of type in TL schema.
func (*AddedReaction) TypeName() string {
return "addedReaction"
}
// TypeInfo returns info about TL type.
func (a *AddedReaction) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "addedReaction",
ID: AddedReactionTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "Type",
SchemaName: "type",
},
{
Name: "SenderID",
SchemaName: "sender_id",
},
{
Name: "IsOutgoing",
SchemaName: "is_outgoing",
},
{
Name: "Date",
SchemaName: "date",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AddedReaction) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addedReaction#4b04819d as nil")
}
b.PutID(AddedReactionTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AddedReaction) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addedReaction#4b04819d as nil")
}
if a.Type == nil {
return fmt.Errorf("unable to encode addedReaction#4b04819d: field type is nil")
}
if err := a.Type.Encode(b); err != nil {
return fmt.Errorf("unable to encode addedReaction#4b04819d: field type: %w", err)
}
if a.SenderID == nil {
return fmt.Errorf("unable to encode addedReaction#4b04819d: field sender_id is nil")
}
if err := a.SenderID.Encode(b); err != nil {
return fmt.Errorf("unable to encode addedReaction#4b04819d: field sender_id: %w", err)
}
b.PutBool(a.IsOutgoing)
b.PutInt32(a.Date)
return nil
}
// Decode implements bin.Decoder.
func (a *AddedReaction) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addedReaction#4b04819d to nil")
}
if err := b.ConsumeID(AddedReactionTypeID); err != nil {
return fmt.Errorf("unable to decode addedReaction#4b04819d: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AddedReaction) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addedReaction#4b04819d to nil")
}
{
value, err := DecodeReactionType(b)
if err != nil {
return fmt.Errorf("unable to decode addedReaction#4b04819d: field type: %w", err)
}
a.Type = value
}
{
value, err := DecodeMessageSender(b)
if err != nil {
return fmt.Errorf("unable to decode addedReaction#4b04819d: field sender_id: %w", err)
}
a.SenderID = value
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode addedReaction#4b04819d: field is_outgoing: %w", err)
}
a.IsOutgoing = value
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode addedReaction#4b04819d: field date: %w", err)
}
a.Date = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AddedReaction) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode addedReaction#4b04819d as nil")
}
b.ObjStart()
b.PutID("addedReaction")
b.Comma()
b.FieldStart("type")
if a.Type == nil {
return fmt.Errorf("unable to encode addedReaction#4b04819d: field type is nil")
}
if err := a.Type.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode addedReaction#4b04819d: field type: %w", err)
}
b.Comma()
b.FieldStart("sender_id")
if a.SenderID == nil {
return fmt.Errorf("unable to encode addedReaction#4b04819d: field sender_id is nil")
}
if err := a.SenderID.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode addedReaction#4b04819d: field sender_id: %w", err)
}
b.Comma()
b.FieldStart("is_outgoing")
b.PutBool(a.IsOutgoing)
b.Comma()
b.FieldStart("date")
b.PutInt32(a.Date)
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AddedReaction) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode addedReaction#4b04819d to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("addedReaction"); err != nil {
return fmt.Errorf("unable to decode addedReaction#4b04819d: %w", err)
}
case "type":
value, err := DecodeTDLibJSONReactionType(b)
if err != nil {
return fmt.Errorf("unable to decode addedReaction#4b04819d: field type: %w", err)
}
a.Type = value
case "sender_id":
value, err := DecodeTDLibJSONMessageSender(b)
if err != nil {
return fmt.Errorf("unable to decode addedReaction#4b04819d: field sender_id: %w", err)
}
a.SenderID = value
case "is_outgoing":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode addedReaction#4b04819d: field is_outgoing: %w", err)
}
a.IsOutgoing = value
case "date":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode addedReaction#4b04819d: field date: %w", err)
}
a.Date = value
default:
return b.Skip()
}
return nil
})
}
// GetType returns value of Type field.
func (a *AddedReaction) GetType() (value ReactionTypeClass) {
if a == nil {
return
}
return a.Type
}
// GetSenderID returns value of SenderID field.
func (a *AddedReaction) GetSenderID() (value MessageSenderClass) {
if a == nil {
return
}
return a.SenderID
}
// GetIsOutgoing returns value of IsOutgoing field.
func (a *AddedReaction) GetIsOutgoing() (value bool) {
if a == nil {
return
}
return a.IsOutgoing
}
// GetDate returns value of Date field.
func (a *AddedReaction) GetDate() (value int32) {
if a == nil {
return
}
return a.Date
}
-289
View File
@@ -1,289 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AddedReactions represents TL type `addedReactions#77bf7590`.
type AddedReactions struct {
// The total number of found reactions
TotalCount int32
// The list of added reactions
Reactions []AddedReaction
// The offset for the next request. If empty, then there are no more results
NextOffset string
}
// AddedReactionsTypeID is TL type id of AddedReactions.
const AddedReactionsTypeID = 0x77bf7590
// Ensuring interfaces in compile-time for AddedReactions.
var (
_ bin.Encoder = &AddedReactions{}
_ bin.Decoder = &AddedReactions{}
_ bin.BareEncoder = &AddedReactions{}
_ bin.BareDecoder = &AddedReactions{}
)
func (a *AddedReactions) Zero() bool {
if a == nil {
return true
}
if !(a.TotalCount == 0) {
return false
}
if !(a.Reactions == nil) {
return false
}
if !(a.NextOffset == "") {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AddedReactions) String() string {
if a == nil {
return "AddedReactions(nil)"
}
type Alias AddedReactions
return fmt.Sprintf("AddedReactions%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AddedReactions) TypeID() uint32 {
return AddedReactionsTypeID
}
// TypeName returns name of type in TL schema.
func (*AddedReactions) TypeName() string {
return "addedReactions"
}
// TypeInfo returns info about TL type.
func (a *AddedReactions) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "addedReactions",
ID: AddedReactionsTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "TotalCount",
SchemaName: "total_count",
},
{
Name: "Reactions",
SchemaName: "reactions",
},
{
Name: "NextOffset",
SchemaName: "next_offset",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AddedReactions) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addedReactions#77bf7590 as nil")
}
b.PutID(AddedReactionsTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AddedReactions) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode addedReactions#77bf7590 as nil")
}
b.PutInt32(a.TotalCount)
b.PutInt(len(a.Reactions))
for idx, v := range a.Reactions {
if err := v.EncodeBare(b); err != nil {
return fmt.Errorf("unable to encode bare addedReactions#77bf7590: field reactions element with index %d: %w", idx, err)
}
}
b.PutString(a.NextOffset)
return nil
}
// Decode implements bin.Decoder.
func (a *AddedReactions) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addedReactions#77bf7590 to nil")
}
if err := b.ConsumeID(AddedReactionsTypeID); err != nil {
return fmt.Errorf("unable to decode addedReactions#77bf7590: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AddedReactions) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode addedReactions#77bf7590 to nil")
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode addedReactions#77bf7590: field total_count: %w", err)
}
a.TotalCount = value
}
{
headerLen, err := b.Int()
if err != nil {
return fmt.Errorf("unable to decode addedReactions#77bf7590: field reactions: %w", err)
}
if headerLen > 0 {
a.Reactions = make([]AddedReaction, 0, headerLen%bin.PreallocateLimit)
}
for idx := 0; idx < headerLen; idx++ {
var value AddedReaction
if err := value.DecodeBare(b); err != nil {
return fmt.Errorf("unable to decode bare addedReactions#77bf7590: field reactions: %w", err)
}
a.Reactions = append(a.Reactions, value)
}
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode addedReactions#77bf7590: field next_offset: %w", err)
}
a.NextOffset = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AddedReactions) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode addedReactions#77bf7590 as nil")
}
b.ObjStart()
b.PutID("addedReactions")
b.Comma()
b.FieldStart("total_count")
b.PutInt32(a.TotalCount)
b.Comma()
b.FieldStart("reactions")
b.ArrStart()
for idx, v := range a.Reactions {
if err := v.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode addedReactions#77bf7590: field reactions element with index %d: %w", idx, err)
}
b.Comma()
}
b.StripComma()
b.ArrEnd()
b.Comma()
b.FieldStart("next_offset")
b.PutString(a.NextOffset)
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AddedReactions) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode addedReactions#77bf7590 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("addedReactions"); err != nil {
return fmt.Errorf("unable to decode addedReactions#77bf7590: %w", err)
}
case "total_count":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode addedReactions#77bf7590: field total_count: %w", err)
}
a.TotalCount = value
case "reactions":
if err := b.Arr(func(b tdjson.Decoder) error {
var value AddedReaction
if err := value.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode addedReactions#77bf7590: field reactions: %w", err)
}
a.Reactions = append(a.Reactions, value)
return nil
}); err != nil {
return fmt.Errorf("unable to decode addedReactions#77bf7590: field reactions: %w", err)
}
case "next_offset":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode addedReactions#77bf7590: field next_offset: %w", err)
}
a.NextOffset = value
default:
return b.Skip()
}
return nil
})
}
// GetTotalCount returns value of TotalCount field.
func (a *AddedReactions) GetTotalCount() (value int32) {
if a == nil {
return
}
return a.TotalCount
}
// GetReactions returns value of Reactions field.
func (a *AddedReactions) GetReactions() (value []AddedReaction) {
if a == nil {
return
}
return a.Reactions
}
// GetNextOffset returns value of NextOffset field.
func (a *AddedReactions) GetNextOffset() (value string) {
if a == nil {
return
}
return a.NextOffset
}
-363
View File
@@ -1,363 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// Address represents TL type `address#86304f3a`.
type Address struct {
// A two-letter ISO 3166-1 alpha-2 country code
CountryCode string
// State, if applicable
State string
// City
City string
// First line of the address
StreetLine1 string
// Second line of the address
StreetLine2 string
// Address postal code
PostalCode string
}
// AddressTypeID is TL type id of Address.
const AddressTypeID = 0x86304f3a
// Ensuring interfaces in compile-time for Address.
var (
_ bin.Encoder = &Address{}
_ bin.Decoder = &Address{}
_ bin.BareEncoder = &Address{}
_ bin.BareDecoder = &Address{}
)
func (a *Address) Zero() bool {
if a == nil {
return true
}
if !(a.CountryCode == "") {
return false
}
if !(a.State == "") {
return false
}
if !(a.City == "") {
return false
}
if !(a.StreetLine1 == "") {
return false
}
if !(a.StreetLine2 == "") {
return false
}
if !(a.PostalCode == "") {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *Address) String() string {
if a == nil {
return "Address(nil)"
}
type Alias Address
return fmt.Sprintf("Address%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*Address) TypeID() uint32 {
return AddressTypeID
}
// TypeName returns name of type in TL schema.
func (*Address) TypeName() string {
return "address"
}
// TypeInfo returns info about TL type.
func (a *Address) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "address",
ID: AddressTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "CountryCode",
SchemaName: "country_code",
},
{
Name: "State",
SchemaName: "state",
},
{
Name: "City",
SchemaName: "city",
},
{
Name: "StreetLine1",
SchemaName: "street_line1",
},
{
Name: "StreetLine2",
SchemaName: "street_line2",
},
{
Name: "PostalCode",
SchemaName: "postal_code",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *Address) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode address#86304f3a as nil")
}
b.PutID(AddressTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *Address) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode address#86304f3a as nil")
}
b.PutString(a.CountryCode)
b.PutString(a.State)
b.PutString(a.City)
b.PutString(a.StreetLine1)
b.PutString(a.StreetLine2)
b.PutString(a.PostalCode)
return nil
}
// Decode implements bin.Decoder.
func (a *Address) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode address#86304f3a to nil")
}
if err := b.ConsumeID(AddressTypeID); err != nil {
return fmt.Errorf("unable to decode address#86304f3a: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *Address) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode address#86304f3a to nil")
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode address#86304f3a: field country_code: %w", err)
}
a.CountryCode = value
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode address#86304f3a: field state: %w", err)
}
a.State = value
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode address#86304f3a: field city: %w", err)
}
a.City = value
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode address#86304f3a: field street_line1: %w", err)
}
a.StreetLine1 = value
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode address#86304f3a: field street_line2: %w", err)
}
a.StreetLine2 = value
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode address#86304f3a: field postal_code: %w", err)
}
a.PostalCode = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *Address) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode address#86304f3a as nil")
}
b.ObjStart()
b.PutID("address")
b.Comma()
b.FieldStart("country_code")
b.PutString(a.CountryCode)
b.Comma()
b.FieldStart("state")
b.PutString(a.State)
b.Comma()
b.FieldStart("city")
b.PutString(a.City)
b.Comma()
b.FieldStart("street_line1")
b.PutString(a.StreetLine1)
b.Comma()
b.FieldStart("street_line2")
b.PutString(a.StreetLine2)
b.Comma()
b.FieldStart("postal_code")
b.PutString(a.PostalCode)
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *Address) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode address#86304f3a to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("address"); err != nil {
return fmt.Errorf("unable to decode address#86304f3a: %w", err)
}
case "country_code":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode address#86304f3a: field country_code: %w", err)
}
a.CountryCode = value
case "state":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode address#86304f3a: field state: %w", err)
}
a.State = value
case "city":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode address#86304f3a: field city: %w", err)
}
a.City = value
case "street_line1":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode address#86304f3a: field street_line1: %w", err)
}
a.StreetLine1 = value
case "street_line2":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode address#86304f3a: field street_line2: %w", err)
}
a.StreetLine2 = value
case "postal_code":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode address#86304f3a: field postal_code: %w", err)
}
a.PostalCode = value
default:
return b.Skip()
}
return nil
})
}
// GetCountryCode returns value of CountryCode field.
func (a *Address) GetCountryCode() (value string) {
if a == nil {
return
}
return a.CountryCode
}
// GetState returns value of State field.
func (a *Address) GetState() (value string) {
if a == nil {
return
}
return a.State
}
// GetCity returns value of City field.
func (a *Address) GetCity() (value string) {
if a == nil {
return
}
return a.City
}
// GetStreetLine1 returns value of StreetLine1 field.
func (a *Address) GetStreetLine1() (value string) {
if a == nil {
return
}
return a.StreetLine1
}
// GetStreetLine2 returns value of StreetLine2 field.
func (a *Address) GetStreetLine2() (value string) {
if a == nil {
return
}
return a.StreetLine2
}
// GetPostalCode returns value of PostalCode field.
func (a *Address) GetPostalCode() (value string) {
if a == nil {
return
}
return a.PostalCode
}
-263
View File
@@ -1,263 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AffiliateInfo represents TL type `affiliateInfo#b1c1dcfa`.
type AffiliateInfo struct {
// The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars
// received by the program owner
CommissionPerMille int32
// Identifier of the chat which received the commission
AffiliateChatID int64
// The amount of Telegram Stars that were received by the affiliate; can be negative for
// refunds
StarAmount StarAmount
}
// AffiliateInfoTypeID is TL type id of AffiliateInfo.
const AffiliateInfoTypeID = 0xb1c1dcfa
// Ensuring interfaces in compile-time for AffiliateInfo.
var (
_ bin.Encoder = &AffiliateInfo{}
_ bin.Decoder = &AffiliateInfo{}
_ bin.BareEncoder = &AffiliateInfo{}
_ bin.BareDecoder = &AffiliateInfo{}
)
func (a *AffiliateInfo) Zero() bool {
if a == nil {
return true
}
if !(a.CommissionPerMille == 0) {
return false
}
if !(a.AffiliateChatID == 0) {
return false
}
if !(a.StarAmount.Zero()) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AffiliateInfo) String() string {
if a == nil {
return "AffiliateInfo(nil)"
}
type Alias AffiliateInfo
return fmt.Sprintf("AffiliateInfo%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AffiliateInfo) TypeID() uint32 {
return AffiliateInfoTypeID
}
// TypeName returns name of type in TL schema.
func (*AffiliateInfo) TypeName() string {
return "affiliateInfo"
}
// TypeInfo returns info about TL type.
func (a *AffiliateInfo) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "affiliateInfo",
ID: AffiliateInfoTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "CommissionPerMille",
SchemaName: "commission_per_mille",
},
{
Name: "AffiliateChatID",
SchemaName: "affiliate_chat_id",
},
{
Name: "StarAmount",
SchemaName: "star_amount",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AffiliateInfo) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode affiliateInfo#b1c1dcfa as nil")
}
b.PutID(AffiliateInfoTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AffiliateInfo) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode affiliateInfo#b1c1dcfa as nil")
}
b.PutInt32(a.CommissionPerMille)
b.PutInt53(a.AffiliateChatID)
if err := a.StarAmount.Encode(b); err != nil {
return fmt.Errorf("unable to encode affiliateInfo#b1c1dcfa: field star_amount: %w", err)
}
return nil
}
// Decode implements bin.Decoder.
func (a *AffiliateInfo) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode affiliateInfo#b1c1dcfa to nil")
}
if err := b.ConsumeID(AffiliateInfoTypeID); err != nil {
return fmt.Errorf("unable to decode affiliateInfo#b1c1dcfa: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AffiliateInfo) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode affiliateInfo#b1c1dcfa to nil")
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode affiliateInfo#b1c1dcfa: field commission_per_mille: %w", err)
}
a.CommissionPerMille = value
}
{
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode affiliateInfo#b1c1dcfa: field affiliate_chat_id: %w", err)
}
a.AffiliateChatID = value
}
{
if err := a.StarAmount.Decode(b); err != nil {
return fmt.Errorf("unable to decode affiliateInfo#b1c1dcfa: field star_amount: %w", err)
}
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AffiliateInfo) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode affiliateInfo#b1c1dcfa as nil")
}
b.ObjStart()
b.PutID("affiliateInfo")
b.Comma()
b.FieldStart("commission_per_mille")
b.PutInt32(a.CommissionPerMille)
b.Comma()
b.FieldStart("affiliate_chat_id")
b.PutInt53(a.AffiliateChatID)
b.Comma()
b.FieldStart("star_amount")
if err := a.StarAmount.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode affiliateInfo#b1c1dcfa: field star_amount: %w", err)
}
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AffiliateInfo) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode affiliateInfo#b1c1dcfa to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("affiliateInfo"); err != nil {
return fmt.Errorf("unable to decode affiliateInfo#b1c1dcfa: %w", err)
}
case "commission_per_mille":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode affiliateInfo#b1c1dcfa: field commission_per_mille: %w", err)
}
a.CommissionPerMille = value
case "affiliate_chat_id":
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode affiliateInfo#b1c1dcfa: field affiliate_chat_id: %w", err)
}
a.AffiliateChatID = value
case "star_amount":
if err := a.StarAmount.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode affiliateInfo#b1c1dcfa: field star_amount: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// GetCommissionPerMille returns value of CommissionPerMille field.
func (a *AffiliateInfo) GetCommissionPerMille() (value int32) {
if a == nil {
return
}
return a.CommissionPerMille
}
// GetAffiliateChatID returns value of AffiliateChatID field.
func (a *AffiliateInfo) GetAffiliateChatID() (value int64) {
if a == nil {
return
}
return a.AffiliateChatID
}
// GetStarAmount returns value of StarAmount field.
func (a *AffiliateInfo) GetStarAmount() (value StarAmount) {
if a == nil {
return
}
return a.StarAmount
}
-263
View File
@@ -1,263 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AffiliateProgramInfo represents TL type `affiliateProgramInfo#96fce8b5`.
type AffiliateProgramInfo struct {
// Parameters of the affiliate program
Parameters AffiliateProgramParameters
// Point in time (Unix timestamp) when the affiliate program will be closed; 0 if the
// affiliate program isn't scheduled to be closed.
EndDate int32
// The amount of daily revenue per user in Telegram Stars of the bot that created the
// affiliate program
DailyRevenuePerUserAmount StarAmount
}
// AffiliateProgramInfoTypeID is TL type id of AffiliateProgramInfo.
const AffiliateProgramInfoTypeID = 0x96fce8b5
// Ensuring interfaces in compile-time for AffiliateProgramInfo.
var (
_ bin.Encoder = &AffiliateProgramInfo{}
_ bin.Decoder = &AffiliateProgramInfo{}
_ bin.BareEncoder = &AffiliateProgramInfo{}
_ bin.BareDecoder = &AffiliateProgramInfo{}
)
func (a *AffiliateProgramInfo) Zero() bool {
if a == nil {
return true
}
if !(a.Parameters.Zero()) {
return false
}
if !(a.EndDate == 0) {
return false
}
if !(a.DailyRevenuePerUserAmount.Zero()) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AffiliateProgramInfo) String() string {
if a == nil {
return "AffiliateProgramInfo(nil)"
}
type Alias AffiliateProgramInfo
return fmt.Sprintf("AffiliateProgramInfo%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AffiliateProgramInfo) TypeID() uint32 {
return AffiliateProgramInfoTypeID
}
// TypeName returns name of type in TL schema.
func (*AffiliateProgramInfo) TypeName() string {
return "affiliateProgramInfo"
}
// TypeInfo returns info about TL type.
func (a *AffiliateProgramInfo) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "affiliateProgramInfo",
ID: AffiliateProgramInfoTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "Parameters",
SchemaName: "parameters",
},
{
Name: "EndDate",
SchemaName: "end_date",
},
{
Name: "DailyRevenuePerUserAmount",
SchemaName: "daily_revenue_per_user_amount",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AffiliateProgramInfo) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode affiliateProgramInfo#96fce8b5 as nil")
}
b.PutID(AffiliateProgramInfoTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AffiliateProgramInfo) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode affiliateProgramInfo#96fce8b5 as nil")
}
if err := a.Parameters.Encode(b); err != nil {
return fmt.Errorf("unable to encode affiliateProgramInfo#96fce8b5: field parameters: %w", err)
}
b.PutInt32(a.EndDate)
if err := a.DailyRevenuePerUserAmount.Encode(b); err != nil {
return fmt.Errorf("unable to encode affiliateProgramInfo#96fce8b5: field daily_revenue_per_user_amount: %w", err)
}
return nil
}
// Decode implements bin.Decoder.
func (a *AffiliateProgramInfo) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode affiliateProgramInfo#96fce8b5 to nil")
}
if err := b.ConsumeID(AffiliateProgramInfoTypeID); err != nil {
return fmt.Errorf("unable to decode affiliateProgramInfo#96fce8b5: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AffiliateProgramInfo) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode affiliateProgramInfo#96fce8b5 to nil")
}
{
if err := a.Parameters.Decode(b); err != nil {
return fmt.Errorf("unable to decode affiliateProgramInfo#96fce8b5: field parameters: %w", err)
}
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode affiliateProgramInfo#96fce8b5: field end_date: %w", err)
}
a.EndDate = value
}
{
if err := a.DailyRevenuePerUserAmount.Decode(b); err != nil {
return fmt.Errorf("unable to decode affiliateProgramInfo#96fce8b5: field daily_revenue_per_user_amount: %w", err)
}
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AffiliateProgramInfo) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode affiliateProgramInfo#96fce8b5 as nil")
}
b.ObjStart()
b.PutID("affiliateProgramInfo")
b.Comma()
b.FieldStart("parameters")
if err := a.Parameters.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode affiliateProgramInfo#96fce8b5: field parameters: %w", err)
}
b.Comma()
b.FieldStart("end_date")
b.PutInt32(a.EndDate)
b.Comma()
b.FieldStart("daily_revenue_per_user_amount")
if err := a.DailyRevenuePerUserAmount.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode affiliateProgramInfo#96fce8b5: field daily_revenue_per_user_amount: %w", err)
}
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AffiliateProgramInfo) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode affiliateProgramInfo#96fce8b5 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("affiliateProgramInfo"); err != nil {
return fmt.Errorf("unable to decode affiliateProgramInfo#96fce8b5: %w", err)
}
case "parameters":
if err := a.Parameters.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode affiliateProgramInfo#96fce8b5: field parameters: %w", err)
}
case "end_date":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode affiliateProgramInfo#96fce8b5: field end_date: %w", err)
}
a.EndDate = value
case "daily_revenue_per_user_amount":
if err := a.DailyRevenuePerUserAmount.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode affiliateProgramInfo#96fce8b5: field daily_revenue_per_user_amount: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// GetParameters returns value of Parameters field.
func (a *AffiliateProgramInfo) GetParameters() (value AffiliateProgramParameters) {
if a == nil {
return
}
return a.Parameters
}
// GetEndDate returns value of EndDate field.
func (a *AffiliateProgramInfo) GetEndDate() (value int32) {
if a == nil {
return
}
return a.EndDate
}
// GetDailyRevenuePerUserAmount returns value of DailyRevenuePerUserAmount field.
func (a *AffiliateProgramInfo) GetDailyRevenuePerUserAmount() (value StarAmount) {
if a == nil {
return
}
return a.DailyRevenuePerUserAmount
}
-228
View File
@@ -1,228 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AffiliateProgramParameters represents TL type `affiliateProgramParameters#61e90c54`.
type AffiliateProgramParameters struct {
// The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars
// received by the program owner;
CommissionPerMille int32
// Number of months the program will be active; 0-36. If 0, then the program is eternal
MonthCount int32
}
// AffiliateProgramParametersTypeID is TL type id of AffiliateProgramParameters.
const AffiliateProgramParametersTypeID = 0x61e90c54
// Ensuring interfaces in compile-time for AffiliateProgramParameters.
var (
_ bin.Encoder = &AffiliateProgramParameters{}
_ bin.Decoder = &AffiliateProgramParameters{}
_ bin.BareEncoder = &AffiliateProgramParameters{}
_ bin.BareDecoder = &AffiliateProgramParameters{}
)
func (a *AffiliateProgramParameters) Zero() bool {
if a == nil {
return true
}
if !(a.CommissionPerMille == 0) {
return false
}
if !(a.MonthCount == 0) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AffiliateProgramParameters) String() string {
if a == nil {
return "AffiliateProgramParameters(nil)"
}
type Alias AffiliateProgramParameters
return fmt.Sprintf("AffiliateProgramParameters%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AffiliateProgramParameters) TypeID() uint32 {
return AffiliateProgramParametersTypeID
}
// TypeName returns name of type in TL schema.
func (*AffiliateProgramParameters) TypeName() string {
return "affiliateProgramParameters"
}
// TypeInfo returns info about TL type.
func (a *AffiliateProgramParameters) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "affiliateProgramParameters",
ID: AffiliateProgramParametersTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "CommissionPerMille",
SchemaName: "commission_per_mille",
},
{
Name: "MonthCount",
SchemaName: "month_count",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AffiliateProgramParameters) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode affiliateProgramParameters#61e90c54 as nil")
}
b.PutID(AffiliateProgramParametersTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AffiliateProgramParameters) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode affiliateProgramParameters#61e90c54 as nil")
}
b.PutInt32(a.CommissionPerMille)
b.PutInt32(a.MonthCount)
return nil
}
// Decode implements bin.Decoder.
func (a *AffiliateProgramParameters) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode affiliateProgramParameters#61e90c54 to nil")
}
if err := b.ConsumeID(AffiliateProgramParametersTypeID); err != nil {
return fmt.Errorf("unable to decode affiliateProgramParameters#61e90c54: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AffiliateProgramParameters) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode affiliateProgramParameters#61e90c54 to nil")
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode affiliateProgramParameters#61e90c54: field commission_per_mille: %w", err)
}
a.CommissionPerMille = value
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode affiliateProgramParameters#61e90c54: field month_count: %w", err)
}
a.MonthCount = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AffiliateProgramParameters) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode affiliateProgramParameters#61e90c54 as nil")
}
b.ObjStart()
b.PutID("affiliateProgramParameters")
b.Comma()
b.FieldStart("commission_per_mille")
b.PutInt32(a.CommissionPerMille)
b.Comma()
b.FieldStart("month_count")
b.PutInt32(a.MonthCount)
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AffiliateProgramParameters) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode affiliateProgramParameters#61e90c54 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("affiliateProgramParameters"); err != nil {
return fmt.Errorf("unable to decode affiliateProgramParameters#61e90c54: %w", err)
}
case "commission_per_mille":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode affiliateProgramParameters#61e90c54: field commission_per_mille: %w", err)
}
a.CommissionPerMille = value
case "month_count":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode affiliateProgramParameters#61e90c54: field month_count: %w", err)
}
a.MonthCount = value
default:
return b.Skip()
}
return nil
})
}
// GetCommissionPerMille returns value of CommissionPerMille field.
func (a *AffiliateProgramParameters) GetCommissionPerMille() (value int32) {
if a == nil {
return
}
return a.CommissionPerMille
}
// GetMonthCount returns value of MonthCount field.
func (a *AffiliateProgramParameters) GetMonthCount() (value int32) {
if a == nil {
return
}
return a.MonthCount
}
-577
View File
@@ -1,577 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AffiliateProgramSortOrderProfitability represents TL type `affiliateProgramSortOrderProfitability#8afaaf67`.
type AffiliateProgramSortOrderProfitability struct {
}
// AffiliateProgramSortOrderProfitabilityTypeID is TL type id of AffiliateProgramSortOrderProfitability.
const AffiliateProgramSortOrderProfitabilityTypeID = 0x8afaaf67
// construct implements constructor of AffiliateProgramSortOrderClass.
func (a AffiliateProgramSortOrderProfitability) construct() AffiliateProgramSortOrderClass { return &a }
// Ensuring interfaces in compile-time for AffiliateProgramSortOrderProfitability.
var (
_ bin.Encoder = &AffiliateProgramSortOrderProfitability{}
_ bin.Decoder = &AffiliateProgramSortOrderProfitability{}
_ bin.BareEncoder = &AffiliateProgramSortOrderProfitability{}
_ bin.BareDecoder = &AffiliateProgramSortOrderProfitability{}
_ AffiliateProgramSortOrderClass = &AffiliateProgramSortOrderProfitability{}
)
func (a *AffiliateProgramSortOrderProfitability) Zero() bool {
if a == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (a *AffiliateProgramSortOrderProfitability) String() string {
if a == nil {
return "AffiliateProgramSortOrderProfitability(nil)"
}
type Alias AffiliateProgramSortOrderProfitability
return fmt.Sprintf("AffiliateProgramSortOrderProfitability%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AffiliateProgramSortOrderProfitability) TypeID() uint32 {
return AffiliateProgramSortOrderProfitabilityTypeID
}
// TypeName returns name of type in TL schema.
func (*AffiliateProgramSortOrderProfitability) TypeName() string {
return "affiliateProgramSortOrderProfitability"
}
// TypeInfo returns info about TL type.
func (a *AffiliateProgramSortOrderProfitability) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "affiliateProgramSortOrderProfitability",
ID: AffiliateProgramSortOrderProfitabilityTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (a *AffiliateProgramSortOrderProfitability) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode affiliateProgramSortOrderProfitability#8afaaf67 as nil")
}
b.PutID(AffiliateProgramSortOrderProfitabilityTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AffiliateProgramSortOrderProfitability) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode affiliateProgramSortOrderProfitability#8afaaf67 as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (a *AffiliateProgramSortOrderProfitability) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode affiliateProgramSortOrderProfitability#8afaaf67 to nil")
}
if err := b.ConsumeID(AffiliateProgramSortOrderProfitabilityTypeID); err != nil {
return fmt.Errorf("unable to decode affiliateProgramSortOrderProfitability#8afaaf67: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AffiliateProgramSortOrderProfitability) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode affiliateProgramSortOrderProfitability#8afaaf67 to nil")
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AffiliateProgramSortOrderProfitability) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode affiliateProgramSortOrderProfitability#8afaaf67 as nil")
}
b.ObjStart()
b.PutID("affiliateProgramSortOrderProfitability")
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AffiliateProgramSortOrderProfitability) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode affiliateProgramSortOrderProfitability#8afaaf67 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("affiliateProgramSortOrderProfitability"); err != nil {
return fmt.Errorf("unable to decode affiliateProgramSortOrderProfitability#8afaaf67: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// AffiliateProgramSortOrderCreationDate represents TL type `affiliateProgramSortOrderCreationDate#a319390d`.
type AffiliateProgramSortOrderCreationDate struct {
}
// AffiliateProgramSortOrderCreationDateTypeID is TL type id of AffiliateProgramSortOrderCreationDate.
const AffiliateProgramSortOrderCreationDateTypeID = 0xa319390d
// construct implements constructor of AffiliateProgramSortOrderClass.
func (a AffiliateProgramSortOrderCreationDate) construct() AffiliateProgramSortOrderClass { return &a }
// Ensuring interfaces in compile-time for AffiliateProgramSortOrderCreationDate.
var (
_ bin.Encoder = &AffiliateProgramSortOrderCreationDate{}
_ bin.Decoder = &AffiliateProgramSortOrderCreationDate{}
_ bin.BareEncoder = &AffiliateProgramSortOrderCreationDate{}
_ bin.BareDecoder = &AffiliateProgramSortOrderCreationDate{}
_ AffiliateProgramSortOrderClass = &AffiliateProgramSortOrderCreationDate{}
)
func (a *AffiliateProgramSortOrderCreationDate) Zero() bool {
if a == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (a *AffiliateProgramSortOrderCreationDate) String() string {
if a == nil {
return "AffiliateProgramSortOrderCreationDate(nil)"
}
type Alias AffiliateProgramSortOrderCreationDate
return fmt.Sprintf("AffiliateProgramSortOrderCreationDate%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AffiliateProgramSortOrderCreationDate) TypeID() uint32 {
return AffiliateProgramSortOrderCreationDateTypeID
}
// TypeName returns name of type in TL schema.
func (*AffiliateProgramSortOrderCreationDate) TypeName() string {
return "affiliateProgramSortOrderCreationDate"
}
// TypeInfo returns info about TL type.
func (a *AffiliateProgramSortOrderCreationDate) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "affiliateProgramSortOrderCreationDate",
ID: AffiliateProgramSortOrderCreationDateTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (a *AffiliateProgramSortOrderCreationDate) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode affiliateProgramSortOrderCreationDate#a319390d as nil")
}
b.PutID(AffiliateProgramSortOrderCreationDateTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AffiliateProgramSortOrderCreationDate) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode affiliateProgramSortOrderCreationDate#a319390d as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (a *AffiliateProgramSortOrderCreationDate) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode affiliateProgramSortOrderCreationDate#a319390d to nil")
}
if err := b.ConsumeID(AffiliateProgramSortOrderCreationDateTypeID); err != nil {
return fmt.Errorf("unable to decode affiliateProgramSortOrderCreationDate#a319390d: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AffiliateProgramSortOrderCreationDate) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode affiliateProgramSortOrderCreationDate#a319390d to nil")
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AffiliateProgramSortOrderCreationDate) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode affiliateProgramSortOrderCreationDate#a319390d as nil")
}
b.ObjStart()
b.PutID("affiliateProgramSortOrderCreationDate")
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AffiliateProgramSortOrderCreationDate) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode affiliateProgramSortOrderCreationDate#a319390d to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("affiliateProgramSortOrderCreationDate"); err != nil {
return fmt.Errorf("unable to decode affiliateProgramSortOrderCreationDate#a319390d: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// AffiliateProgramSortOrderRevenue represents TL type `affiliateProgramSortOrderRevenue#72a2c2b8`.
type AffiliateProgramSortOrderRevenue struct {
}
// AffiliateProgramSortOrderRevenueTypeID is TL type id of AffiliateProgramSortOrderRevenue.
const AffiliateProgramSortOrderRevenueTypeID = 0x72a2c2b8
// construct implements constructor of AffiliateProgramSortOrderClass.
func (a AffiliateProgramSortOrderRevenue) construct() AffiliateProgramSortOrderClass { return &a }
// Ensuring interfaces in compile-time for AffiliateProgramSortOrderRevenue.
var (
_ bin.Encoder = &AffiliateProgramSortOrderRevenue{}
_ bin.Decoder = &AffiliateProgramSortOrderRevenue{}
_ bin.BareEncoder = &AffiliateProgramSortOrderRevenue{}
_ bin.BareDecoder = &AffiliateProgramSortOrderRevenue{}
_ AffiliateProgramSortOrderClass = &AffiliateProgramSortOrderRevenue{}
)
func (a *AffiliateProgramSortOrderRevenue) Zero() bool {
if a == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (a *AffiliateProgramSortOrderRevenue) String() string {
if a == nil {
return "AffiliateProgramSortOrderRevenue(nil)"
}
type Alias AffiliateProgramSortOrderRevenue
return fmt.Sprintf("AffiliateProgramSortOrderRevenue%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AffiliateProgramSortOrderRevenue) TypeID() uint32 {
return AffiliateProgramSortOrderRevenueTypeID
}
// TypeName returns name of type in TL schema.
func (*AffiliateProgramSortOrderRevenue) TypeName() string {
return "affiliateProgramSortOrderRevenue"
}
// TypeInfo returns info about TL type.
func (a *AffiliateProgramSortOrderRevenue) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "affiliateProgramSortOrderRevenue",
ID: AffiliateProgramSortOrderRevenueTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (a *AffiliateProgramSortOrderRevenue) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode affiliateProgramSortOrderRevenue#72a2c2b8 as nil")
}
b.PutID(AffiliateProgramSortOrderRevenueTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AffiliateProgramSortOrderRevenue) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode affiliateProgramSortOrderRevenue#72a2c2b8 as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (a *AffiliateProgramSortOrderRevenue) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode affiliateProgramSortOrderRevenue#72a2c2b8 to nil")
}
if err := b.ConsumeID(AffiliateProgramSortOrderRevenueTypeID); err != nil {
return fmt.Errorf("unable to decode affiliateProgramSortOrderRevenue#72a2c2b8: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AffiliateProgramSortOrderRevenue) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode affiliateProgramSortOrderRevenue#72a2c2b8 to nil")
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AffiliateProgramSortOrderRevenue) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode affiliateProgramSortOrderRevenue#72a2c2b8 as nil")
}
b.ObjStart()
b.PutID("affiliateProgramSortOrderRevenue")
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AffiliateProgramSortOrderRevenue) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode affiliateProgramSortOrderRevenue#72a2c2b8 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("affiliateProgramSortOrderRevenue"); err != nil {
return fmt.Errorf("unable to decode affiliateProgramSortOrderRevenue#72a2c2b8: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// AffiliateProgramSortOrderClassName is schema name of AffiliateProgramSortOrderClass.
const AffiliateProgramSortOrderClassName = "AffiliateProgramSortOrder"
// AffiliateProgramSortOrderClass represents AffiliateProgramSortOrder generic type.
//
// Example:
//
// g, err := tdapi.DecodeAffiliateProgramSortOrder(buf)
// if err != nil {
// panic(err)
// }
// switch v := g.(type) {
// case *tdapi.AffiliateProgramSortOrderProfitability: // affiliateProgramSortOrderProfitability#8afaaf67
// case *tdapi.AffiliateProgramSortOrderCreationDate: // affiliateProgramSortOrderCreationDate#a319390d
// case *tdapi.AffiliateProgramSortOrderRevenue: // affiliateProgramSortOrderRevenue#72a2c2b8
// default: panic(v)
// }
type AffiliateProgramSortOrderClass interface {
bin.Encoder
bin.Decoder
bin.BareEncoder
bin.BareDecoder
construct() AffiliateProgramSortOrderClass
// 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
EncodeTDLibJSON(b tdjson.Encoder) error
DecodeTDLibJSON(b tdjson.Decoder) error
}
// DecodeAffiliateProgramSortOrder implements binary de-serialization for AffiliateProgramSortOrderClass.
func DecodeAffiliateProgramSortOrder(buf *bin.Buffer) (AffiliateProgramSortOrderClass, error) {
id, err := buf.PeekID()
if err != nil {
return nil, err
}
switch id {
case AffiliateProgramSortOrderProfitabilityTypeID:
// Decoding affiliateProgramSortOrderProfitability#8afaaf67.
v := AffiliateProgramSortOrderProfitability{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode AffiliateProgramSortOrderClass: %w", err)
}
return &v, nil
case AffiliateProgramSortOrderCreationDateTypeID:
// Decoding affiliateProgramSortOrderCreationDate#a319390d.
v := AffiliateProgramSortOrderCreationDate{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode AffiliateProgramSortOrderClass: %w", err)
}
return &v, nil
case AffiliateProgramSortOrderRevenueTypeID:
// Decoding affiliateProgramSortOrderRevenue#72a2c2b8.
v := AffiliateProgramSortOrderRevenue{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode AffiliateProgramSortOrderClass: %w", err)
}
return &v, nil
default:
return nil, fmt.Errorf("unable to decode AffiliateProgramSortOrderClass: %w", bin.NewUnexpectedID(id))
}
}
// DecodeTDLibJSONAffiliateProgramSortOrder implements binary de-serialization for AffiliateProgramSortOrderClass.
func DecodeTDLibJSONAffiliateProgramSortOrder(buf tdjson.Decoder) (AffiliateProgramSortOrderClass, error) {
id, err := buf.FindTypeID()
if err != nil {
return nil, err
}
switch id {
case "affiliateProgramSortOrderProfitability":
// Decoding affiliateProgramSortOrderProfitability#8afaaf67.
v := AffiliateProgramSortOrderProfitability{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode AffiliateProgramSortOrderClass: %w", err)
}
return &v, nil
case "affiliateProgramSortOrderCreationDate":
// Decoding affiliateProgramSortOrderCreationDate#a319390d.
v := AffiliateProgramSortOrderCreationDate{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode AffiliateProgramSortOrderClass: %w", err)
}
return &v, nil
case "affiliateProgramSortOrderRevenue":
// Decoding affiliateProgramSortOrderRevenue#72a2c2b8.
v := AffiliateProgramSortOrderRevenue{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode AffiliateProgramSortOrderClass: %w", err)
}
return &v, nil
default:
return nil, fmt.Errorf("unable to decode AffiliateProgramSortOrderClass: %w", tdjson.NewUnexpectedID(id))
}
}
// AffiliateProgramSortOrder boxes the AffiliateProgramSortOrderClass providing a helper.
type AffiliateProgramSortOrderBox struct {
AffiliateProgramSortOrder AffiliateProgramSortOrderClass
}
// Decode implements bin.Decoder for AffiliateProgramSortOrderBox.
func (b *AffiliateProgramSortOrderBox) Decode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("unable to decode AffiliateProgramSortOrderBox to nil")
}
v, err := DecodeAffiliateProgramSortOrder(buf)
if err != nil {
return fmt.Errorf("unable to decode boxed value: %w", err)
}
b.AffiliateProgramSortOrder = v
return nil
}
// Encode implements bin.Encode for AffiliateProgramSortOrderBox.
func (b *AffiliateProgramSortOrderBox) Encode(buf *bin.Buffer) error {
if b == nil || b.AffiliateProgramSortOrder == nil {
return fmt.Errorf("unable to encode AffiliateProgramSortOrderClass as nil")
}
return b.AffiliateProgramSortOrder.Encode(buf)
}
// DecodeTDLibJSON implements bin.Decoder for AffiliateProgramSortOrderBox.
func (b *AffiliateProgramSortOrderBox) DecodeTDLibJSON(buf tdjson.Decoder) error {
if b == nil {
return fmt.Errorf("unable to decode AffiliateProgramSortOrderBox to nil")
}
v, err := DecodeTDLibJSONAffiliateProgramSortOrder(buf)
if err != nil {
return fmt.Errorf("unable to decode boxed value: %w", err)
}
b.AffiliateProgramSortOrder = v
return nil
}
// EncodeTDLibJSON implements bin.Encode for AffiliateProgramSortOrderBox.
func (b *AffiliateProgramSortOrderBox) EncodeTDLibJSON(buf tdjson.Encoder) error {
if b == nil || b.AffiliateProgramSortOrder == nil {
return fmt.Errorf("unable to encode AffiliateProgramSortOrderClass as nil")
}
return b.AffiliateProgramSortOrder.EncodeTDLibJSON(buf)
}
-647
View File
@@ -1,647 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AffiliateTypeCurrentUser represents TL type `affiliateTypeCurrentUser#56a701f5`.
type AffiliateTypeCurrentUser struct {
}
// AffiliateTypeCurrentUserTypeID is TL type id of AffiliateTypeCurrentUser.
const AffiliateTypeCurrentUserTypeID = 0x56a701f5
// construct implements constructor of AffiliateTypeClass.
func (a AffiliateTypeCurrentUser) construct() AffiliateTypeClass { return &a }
// Ensuring interfaces in compile-time for AffiliateTypeCurrentUser.
var (
_ bin.Encoder = &AffiliateTypeCurrentUser{}
_ bin.Decoder = &AffiliateTypeCurrentUser{}
_ bin.BareEncoder = &AffiliateTypeCurrentUser{}
_ bin.BareDecoder = &AffiliateTypeCurrentUser{}
_ AffiliateTypeClass = &AffiliateTypeCurrentUser{}
)
func (a *AffiliateTypeCurrentUser) Zero() bool {
if a == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (a *AffiliateTypeCurrentUser) String() string {
if a == nil {
return "AffiliateTypeCurrentUser(nil)"
}
type Alias AffiliateTypeCurrentUser
return fmt.Sprintf("AffiliateTypeCurrentUser%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AffiliateTypeCurrentUser) TypeID() uint32 {
return AffiliateTypeCurrentUserTypeID
}
// TypeName returns name of type in TL schema.
func (*AffiliateTypeCurrentUser) TypeName() string {
return "affiliateTypeCurrentUser"
}
// TypeInfo returns info about TL type.
func (a *AffiliateTypeCurrentUser) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "affiliateTypeCurrentUser",
ID: AffiliateTypeCurrentUserTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (a *AffiliateTypeCurrentUser) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode affiliateTypeCurrentUser#56a701f5 as nil")
}
b.PutID(AffiliateTypeCurrentUserTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AffiliateTypeCurrentUser) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode affiliateTypeCurrentUser#56a701f5 as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (a *AffiliateTypeCurrentUser) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode affiliateTypeCurrentUser#56a701f5 to nil")
}
if err := b.ConsumeID(AffiliateTypeCurrentUserTypeID); err != nil {
return fmt.Errorf("unable to decode affiliateTypeCurrentUser#56a701f5: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AffiliateTypeCurrentUser) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode affiliateTypeCurrentUser#56a701f5 to nil")
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AffiliateTypeCurrentUser) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode affiliateTypeCurrentUser#56a701f5 as nil")
}
b.ObjStart()
b.PutID("affiliateTypeCurrentUser")
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AffiliateTypeCurrentUser) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode affiliateTypeCurrentUser#56a701f5 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("affiliateTypeCurrentUser"); err != nil {
return fmt.Errorf("unable to decode affiliateTypeCurrentUser#56a701f5: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// AffiliateTypeBot represents TL type `affiliateTypeBot#c273f840`.
type AffiliateTypeBot struct {
// User identifier of the bot
UserID int64
}
// AffiliateTypeBotTypeID is TL type id of AffiliateTypeBot.
const AffiliateTypeBotTypeID = 0xc273f840
// construct implements constructor of AffiliateTypeClass.
func (a AffiliateTypeBot) construct() AffiliateTypeClass { return &a }
// Ensuring interfaces in compile-time for AffiliateTypeBot.
var (
_ bin.Encoder = &AffiliateTypeBot{}
_ bin.Decoder = &AffiliateTypeBot{}
_ bin.BareEncoder = &AffiliateTypeBot{}
_ bin.BareDecoder = &AffiliateTypeBot{}
_ AffiliateTypeClass = &AffiliateTypeBot{}
)
func (a *AffiliateTypeBot) Zero() bool {
if a == nil {
return true
}
if !(a.UserID == 0) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AffiliateTypeBot) String() string {
if a == nil {
return "AffiliateTypeBot(nil)"
}
type Alias AffiliateTypeBot
return fmt.Sprintf("AffiliateTypeBot%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AffiliateTypeBot) TypeID() uint32 {
return AffiliateTypeBotTypeID
}
// TypeName returns name of type in TL schema.
func (*AffiliateTypeBot) TypeName() string {
return "affiliateTypeBot"
}
// TypeInfo returns info about TL type.
func (a *AffiliateTypeBot) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "affiliateTypeBot",
ID: AffiliateTypeBotTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "UserID",
SchemaName: "user_id",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AffiliateTypeBot) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode affiliateTypeBot#c273f840 as nil")
}
b.PutID(AffiliateTypeBotTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AffiliateTypeBot) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode affiliateTypeBot#c273f840 as nil")
}
b.PutInt53(a.UserID)
return nil
}
// Decode implements bin.Decoder.
func (a *AffiliateTypeBot) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode affiliateTypeBot#c273f840 to nil")
}
if err := b.ConsumeID(AffiliateTypeBotTypeID); err != nil {
return fmt.Errorf("unable to decode affiliateTypeBot#c273f840: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AffiliateTypeBot) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode affiliateTypeBot#c273f840 to nil")
}
{
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode affiliateTypeBot#c273f840: field user_id: %w", err)
}
a.UserID = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AffiliateTypeBot) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode affiliateTypeBot#c273f840 as nil")
}
b.ObjStart()
b.PutID("affiliateTypeBot")
b.Comma()
b.FieldStart("user_id")
b.PutInt53(a.UserID)
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AffiliateTypeBot) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode affiliateTypeBot#c273f840 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("affiliateTypeBot"); err != nil {
return fmt.Errorf("unable to decode affiliateTypeBot#c273f840: %w", err)
}
case "user_id":
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode affiliateTypeBot#c273f840: field user_id: %w", err)
}
a.UserID = value
default:
return b.Skip()
}
return nil
})
}
// GetUserID returns value of UserID field.
func (a *AffiliateTypeBot) GetUserID() (value int64) {
if a == nil {
return
}
return a.UserID
}
// AffiliateTypeChannel represents TL type `affiliateTypeChannel#d73be869`.
type AffiliateTypeChannel struct {
// Identifier of the channel chat
ChatID int64
}
// AffiliateTypeChannelTypeID is TL type id of AffiliateTypeChannel.
const AffiliateTypeChannelTypeID = 0xd73be869
// construct implements constructor of AffiliateTypeClass.
func (a AffiliateTypeChannel) construct() AffiliateTypeClass { return &a }
// Ensuring interfaces in compile-time for AffiliateTypeChannel.
var (
_ bin.Encoder = &AffiliateTypeChannel{}
_ bin.Decoder = &AffiliateTypeChannel{}
_ bin.BareEncoder = &AffiliateTypeChannel{}
_ bin.BareDecoder = &AffiliateTypeChannel{}
_ AffiliateTypeClass = &AffiliateTypeChannel{}
)
func (a *AffiliateTypeChannel) Zero() bool {
if a == nil {
return true
}
if !(a.ChatID == 0) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AffiliateTypeChannel) String() string {
if a == nil {
return "AffiliateTypeChannel(nil)"
}
type Alias AffiliateTypeChannel
return fmt.Sprintf("AffiliateTypeChannel%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AffiliateTypeChannel) TypeID() uint32 {
return AffiliateTypeChannelTypeID
}
// TypeName returns name of type in TL schema.
func (*AffiliateTypeChannel) TypeName() string {
return "affiliateTypeChannel"
}
// TypeInfo returns info about TL type.
func (a *AffiliateTypeChannel) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "affiliateTypeChannel",
ID: AffiliateTypeChannelTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "ChatID",
SchemaName: "chat_id",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AffiliateTypeChannel) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode affiliateTypeChannel#d73be869 as nil")
}
b.PutID(AffiliateTypeChannelTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AffiliateTypeChannel) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode affiliateTypeChannel#d73be869 as nil")
}
b.PutInt53(a.ChatID)
return nil
}
// Decode implements bin.Decoder.
func (a *AffiliateTypeChannel) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode affiliateTypeChannel#d73be869 to nil")
}
if err := b.ConsumeID(AffiliateTypeChannelTypeID); err != nil {
return fmt.Errorf("unable to decode affiliateTypeChannel#d73be869: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AffiliateTypeChannel) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode affiliateTypeChannel#d73be869 to nil")
}
{
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode affiliateTypeChannel#d73be869: field chat_id: %w", err)
}
a.ChatID = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AffiliateTypeChannel) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode affiliateTypeChannel#d73be869 as nil")
}
b.ObjStart()
b.PutID("affiliateTypeChannel")
b.Comma()
b.FieldStart("chat_id")
b.PutInt53(a.ChatID)
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AffiliateTypeChannel) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode affiliateTypeChannel#d73be869 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("affiliateTypeChannel"); err != nil {
return fmt.Errorf("unable to decode affiliateTypeChannel#d73be869: %w", err)
}
case "chat_id":
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode affiliateTypeChannel#d73be869: field chat_id: %w", err)
}
a.ChatID = value
default:
return b.Skip()
}
return nil
})
}
// GetChatID returns value of ChatID field.
func (a *AffiliateTypeChannel) GetChatID() (value int64) {
if a == nil {
return
}
return a.ChatID
}
// AffiliateTypeClassName is schema name of AffiliateTypeClass.
const AffiliateTypeClassName = "AffiliateType"
// AffiliateTypeClass represents AffiliateType generic type.
//
// Example:
//
// g, err := tdapi.DecodeAffiliateType(buf)
// if err != nil {
// panic(err)
// }
// switch v := g.(type) {
// case *tdapi.AffiliateTypeCurrentUser: // affiliateTypeCurrentUser#56a701f5
// case *tdapi.AffiliateTypeBot: // affiliateTypeBot#c273f840
// case *tdapi.AffiliateTypeChannel: // affiliateTypeChannel#d73be869
// default: panic(v)
// }
type AffiliateTypeClass interface {
bin.Encoder
bin.Decoder
bin.BareEncoder
bin.BareDecoder
construct() AffiliateTypeClass
// 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
EncodeTDLibJSON(b tdjson.Encoder) error
DecodeTDLibJSON(b tdjson.Decoder) error
}
// DecodeAffiliateType implements binary de-serialization for AffiliateTypeClass.
func DecodeAffiliateType(buf *bin.Buffer) (AffiliateTypeClass, error) {
id, err := buf.PeekID()
if err != nil {
return nil, err
}
switch id {
case AffiliateTypeCurrentUserTypeID:
// Decoding affiliateTypeCurrentUser#56a701f5.
v := AffiliateTypeCurrentUser{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode AffiliateTypeClass: %w", err)
}
return &v, nil
case AffiliateTypeBotTypeID:
// Decoding affiliateTypeBot#c273f840.
v := AffiliateTypeBot{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode AffiliateTypeClass: %w", err)
}
return &v, nil
case AffiliateTypeChannelTypeID:
// Decoding affiliateTypeChannel#d73be869.
v := AffiliateTypeChannel{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode AffiliateTypeClass: %w", err)
}
return &v, nil
default:
return nil, fmt.Errorf("unable to decode AffiliateTypeClass: %w", bin.NewUnexpectedID(id))
}
}
// DecodeTDLibJSONAffiliateType implements binary de-serialization for AffiliateTypeClass.
func DecodeTDLibJSONAffiliateType(buf tdjson.Decoder) (AffiliateTypeClass, error) {
id, err := buf.FindTypeID()
if err != nil {
return nil, err
}
switch id {
case "affiliateTypeCurrentUser":
// Decoding affiliateTypeCurrentUser#56a701f5.
v := AffiliateTypeCurrentUser{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode AffiliateTypeClass: %w", err)
}
return &v, nil
case "affiliateTypeBot":
// Decoding affiliateTypeBot#c273f840.
v := AffiliateTypeBot{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode AffiliateTypeClass: %w", err)
}
return &v, nil
case "affiliateTypeChannel":
// Decoding affiliateTypeChannel#d73be869.
v := AffiliateTypeChannel{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode AffiliateTypeClass: %w", err)
}
return &v, nil
default:
return nil, fmt.Errorf("unable to decode AffiliateTypeClass: %w", tdjson.NewUnexpectedID(id))
}
}
// AffiliateType boxes the AffiliateTypeClass providing a helper.
type AffiliateTypeBox struct {
AffiliateType AffiliateTypeClass
}
// Decode implements bin.Decoder for AffiliateTypeBox.
func (b *AffiliateTypeBox) Decode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("unable to decode AffiliateTypeBox to nil")
}
v, err := DecodeAffiliateType(buf)
if err != nil {
return fmt.Errorf("unable to decode boxed value: %w", err)
}
b.AffiliateType = v
return nil
}
// Encode implements bin.Encode for AffiliateTypeBox.
func (b *AffiliateTypeBox) Encode(buf *bin.Buffer) error {
if b == nil || b.AffiliateType == nil {
return fmt.Errorf("unable to encode AffiliateTypeClass as nil")
}
return b.AffiliateType.Encode(buf)
}
// DecodeTDLibJSON implements bin.Decoder for AffiliateTypeBox.
func (b *AffiliateTypeBox) DecodeTDLibJSON(buf tdjson.Decoder) error {
if b == nil {
return fmt.Errorf("unable to decode AffiliateTypeBox to nil")
}
v, err := DecodeTDLibJSONAffiliateType(buf)
if err != nil {
return fmt.Errorf("unable to decode boxed value: %w", err)
}
b.AffiliateType = v
return nil
}
// EncodeTDLibJSON implements bin.Encode for AffiliateTypeBox.
func (b *AffiliateTypeBox) EncodeTDLibJSON(buf tdjson.Encoder) error {
if b == nil || b.AffiliateType == nil {
return fmt.Errorf("unable to encode AffiliateTypeClass as nil")
}
return b.AffiliateType.EncodeTDLibJSON(buf)
}
-206
View File
@@ -1,206 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AllowBotToSendMessagesRequest represents TL type `allowBotToSendMessages#69e9c58e`.
type AllowBotToSendMessagesRequest struct {
// Identifier of the target bot
BotUserID int64
}
// AllowBotToSendMessagesRequestTypeID is TL type id of AllowBotToSendMessagesRequest.
const AllowBotToSendMessagesRequestTypeID = 0x69e9c58e
// Ensuring interfaces in compile-time for AllowBotToSendMessagesRequest.
var (
_ bin.Encoder = &AllowBotToSendMessagesRequest{}
_ bin.Decoder = &AllowBotToSendMessagesRequest{}
_ bin.BareEncoder = &AllowBotToSendMessagesRequest{}
_ bin.BareDecoder = &AllowBotToSendMessagesRequest{}
)
func (a *AllowBotToSendMessagesRequest) Zero() bool {
if a == nil {
return true
}
if !(a.BotUserID == 0) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AllowBotToSendMessagesRequest) String() string {
if a == nil {
return "AllowBotToSendMessagesRequest(nil)"
}
type Alias AllowBotToSendMessagesRequest
return fmt.Sprintf("AllowBotToSendMessagesRequest%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AllowBotToSendMessagesRequest) TypeID() uint32 {
return AllowBotToSendMessagesRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*AllowBotToSendMessagesRequest) TypeName() string {
return "allowBotToSendMessages"
}
// TypeInfo returns info about TL type.
func (a *AllowBotToSendMessagesRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "allowBotToSendMessages",
ID: AllowBotToSendMessagesRequestTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "BotUserID",
SchemaName: "bot_user_id",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AllowBotToSendMessagesRequest) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode allowBotToSendMessages#69e9c58e as nil")
}
b.PutID(AllowBotToSendMessagesRequestTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AllowBotToSendMessagesRequest) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode allowBotToSendMessages#69e9c58e as nil")
}
b.PutInt53(a.BotUserID)
return nil
}
// Decode implements bin.Decoder.
func (a *AllowBotToSendMessagesRequest) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode allowBotToSendMessages#69e9c58e to nil")
}
if err := b.ConsumeID(AllowBotToSendMessagesRequestTypeID); err != nil {
return fmt.Errorf("unable to decode allowBotToSendMessages#69e9c58e: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AllowBotToSendMessagesRequest) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode allowBotToSendMessages#69e9c58e to nil")
}
{
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode allowBotToSendMessages#69e9c58e: field bot_user_id: %w", err)
}
a.BotUserID = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AllowBotToSendMessagesRequest) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode allowBotToSendMessages#69e9c58e as nil")
}
b.ObjStart()
b.PutID("allowBotToSendMessages")
b.Comma()
b.FieldStart("bot_user_id")
b.PutInt53(a.BotUserID)
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AllowBotToSendMessagesRequest) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode allowBotToSendMessages#69e9c58e to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("allowBotToSendMessages"); err != nil {
return fmt.Errorf("unable to decode allowBotToSendMessages#69e9c58e: %w", err)
}
case "bot_user_id":
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode allowBotToSendMessages#69e9c58e: field bot_user_id: %w", err)
}
a.BotUserID = value
default:
return b.Skip()
}
return nil
})
}
// GetBotUserID returns value of BotUserID field.
func (a *AllowBotToSendMessagesRequest) GetBotUserID() (value int64) {
if a == nil {
return
}
return a.BotUserID
}
// AllowBotToSendMessages invokes method allowBotToSendMessages#69e9c58e returning error if any.
func (c *Client) AllowBotToSendMessages(ctx context.Context, botuserid int64) error {
var ok Ok
request := &AllowBotToSendMessagesRequest{
BotUserID: botuserid,
}
if err := c.rpc.Invoke(ctx, request, &ok); err != nil {
return err
}
return nil
}
-237
View File
@@ -1,237 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AllowUnpaidMessagesFromUserRequest represents TL type `allowUnpaidMessagesFromUser#2fe57f57`.
type AllowUnpaidMessagesFromUserRequest struct {
// Identifier of the user
UserID int64
// Pass true to refund the user previously paid messages
RefundPayments bool
}
// AllowUnpaidMessagesFromUserRequestTypeID is TL type id of AllowUnpaidMessagesFromUserRequest.
const AllowUnpaidMessagesFromUserRequestTypeID = 0x2fe57f57
// Ensuring interfaces in compile-time for AllowUnpaidMessagesFromUserRequest.
var (
_ bin.Encoder = &AllowUnpaidMessagesFromUserRequest{}
_ bin.Decoder = &AllowUnpaidMessagesFromUserRequest{}
_ bin.BareEncoder = &AllowUnpaidMessagesFromUserRequest{}
_ bin.BareDecoder = &AllowUnpaidMessagesFromUserRequest{}
)
func (a *AllowUnpaidMessagesFromUserRequest) Zero() bool {
if a == nil {
return true
}
if !(a.UserID == 0) {
return false
}
if !(a.RefundPayments == false) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AllowUnpaidMessagesFromUserRequest) String() string {
if a == nil {
return "AllowUnpaidMessagesFromUserRequest(nil)"
}
type Alias AllowUnpaidMessagesFromUserRequest
return fmt.Sprintf("AllowUnpaidMessagesFromUserRequest%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AllowUnpaidMessagesFromUserRequest) TypeID() uint32 {
return AllowUnpaidMessagesFromUserRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*AllowUnpaidMessagesFromUserRequest) TypeName() string {
return "allowUnpaidMessagesFromUser"
}
// TypeInfo returns info about TL type.
func (a *AllowUnpaidMessagesFromUserRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "allowUnpaidMessagesFromUser",
ID: AllowUnpaidMessagesFromUserRequestTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "UserID",
SchemaName: "user_id",
},
{
Name: "RefundPayments",
SchemaName: "refund_payments",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AllowUnpaidMessagesFromUserRequest) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode allowUnpaidMessagesFromUser#2fe57f57 as nil")
}
b.PutID(AllowUnpaidMessagesFromUserRequestTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AllowUnpaidMessagesFromUserRequest) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode allowUnpaidMessagesFromUser#2fe57f57 as nil")
}
b.PutInt53(a.UserID)
b.PutBool(a.RefundPayments)
return nil
}
// Decode implements bin.Decoder.
func (a *AllowUnpaidMessagesFromUserRequest) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode allowUnpaidMessagesFromUser#2fe57f57 to nil")
}
if err := b.ConsumeID(AllowUnpaidMessagesFromUserRequestTypeID); err != nil {
return fmt.Errorf("unable to decode allowUnpaidMessagesFromUser#2fe57f57: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AllowUnpaidMessagesFromUserRequest) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode allowUnpaidMessagesFromUser#2fe57f57 to nil")
}
{
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode allowUnpaidMessagesFromUser#2fe57f57: field user_id: %w", err)
}
a.UserID = value
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode allowUnpaidMessagesFromUser#2fe57f57: field refund_payments: %w", err)
}
a.RefundPayments = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AllowUnpaidMessagesFromUserRequest) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode allowUnpaidMessagesFromUser#2fe57f57 as nil")
}
b.ObjStart()
b.PutID("allowUnpaidMessagesFromUser")
b.Comma()
b.FieldStart("user_id")
b.PutInt53(a.UserID)
b.Comma()
b.FieldStart("refund_payments")
b.PutBool(a.RefundPayments)
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AllowUnpaidMessagesFromUserRequest) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode allowUnpaidMessagesFromUser#2fe57f57 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("allowUnpaidMessagesFromUser"); err != nil {
return fmt.Errorf("unable to decode allowUnpaidMessagesFromUser#2fe57f57: %w", err)
}
case "user_id":
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode allowUnpaidMessagesFromUser#2fe57f57: field user_id: %w", err)
}
a.UserID = value
case "refund_payments":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode allowUnpaidMessagesFromUser#2fe57f57: field refund_payments: %w", err)
}
a.RefundPayments = value
default:
return b.Skip()
}
return nil
})
}
// GetUserID returns value of UserID field.
func (a *AllowUnpaidMessagesFromUserRequest) GetUserID() (value int64) {
if a == nil {
return
}
return a.UserID
}
// GetRefundPayments returns value of RefundPayments field.
func (a *AllowUnpaidMessagesFromUserRequest) GetRefundPayments() (value bool) {
if a == nil {
return
}
return a.RefundPayments
}
// AllowUnpaidMessagesFromUser invokes method allowUnpaidMessagesFromUser#2fe57f57 returning error if any.
func (c *Client) AllowUnpaidMessagesFromUser(ctx context.Context, request *AllowUnpaidMessagesFromUserRequest) error {
var ok Ok
if err := c.rpc.Invoke(ctx, request, &ok); err != nil {
return err
}
return nil
}
-363
View File
@@ -1,363 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AlternativeVideo represents TL type `alternativeVideo#1ccfc90e`.
type AlternativeVideo struct {
// Unique identifier of the alternative video, which is used in the HLS file
ID int64
// Video width
Width int32
// Video height
Height int32
// Codec used for video file encoding, for example, "h264", "h265", or "av1"
Codec string
// HLS file describing the video
HlsFile File
// File containing the video
Video File
}
// AlternativeVideoTypeID is TL type id of AlternativeVideo.
const AlternativeVideoTypeID = 0x1ccfc90e
// Ensuring interfaces in compile-time for AlternativeVideo.
var (
_ bin.Encoder = &AlternativeVideo{}
_ bin.Decoder = &AlternativeVideo{}
_ bin.BareEncoder = &AlternativeVideo{}
_ bin.BareDecoder = &AlternativeVideo{}
)
func (a *AlternativeVideo) Zero() bool {
if a == nil {
return true
}
if !(a.ID == 0) {
return false
}
if !(a.Width == 0) {
return false
}
if !(a.Height == 0) {
return false
}
if !(a.Codec == "") {
return false
}
if !(a.HlsFile.Zero()) {
return false
}
if !(a.Video.Zero()) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AlternativeVideo) String() string {
if a == nil {
return "AlternativeVideo(nil)"
}
type Alias AlternativeVideo
return fmt.Sprintf("AlternativeVideo%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AlternativeVideo) TypeID() uint32 {
return AlternativeVideoTypeID
}
// TypeName returns name of type in TL schema.
func (*AlternativeVideo) TypeName() string {
return "alternativeVideo"
}
// TypeInfo returns info about TL type.
func (a *AlternativeVideo) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "alternativeVideo",
ID: AlternativeVideoTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "ID",
SchemaName: "id",
},
{
Name: "Width",
SchemaName: "width",
},
{
Name: "Height",
SchemaName: "height",
},
{
Name: "Codec",
SchemaName: "codec",
},
{
Name: "HlsFile",
SchemaName: "hls_file",
},
{
Name: "Video",
SchemaName: "video",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AlternativeVideo) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode alternativeVideo#1ccfc90e as nil")
}
b.PutID(AlternativeVideoTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AlternativeVideo) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode alternativeVideo#1ccfc90e as nil")
}
b.PutLong(a.ID)
b.PutInt32(a.Width)
b.PutInt32(a.Height)
b.PutString(a.Codec)
if err := a.HlsFile.Encode(b); err != nil {
return fmt.Errorf("unable to encode alternativeVideo#1ccfc90e: field hls_file: %w", err)
}
if err := a.Video.Encode(b); err != nil {
return fmt.Errorf("unable to encode alternativeVideo#1ccfc90e: field video: %w", err)
}
return nil
}
// Decode implements bin.Decoder.
func (a *AlternativeVideo) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode alternativeVideo#1ccfc90e to nil")
}
if err := b.ConsumeID(AlternativeVideoTypeID); err != nil {
return fmt.Errorf("unable to decode alternativeVideo#1ccfc90e: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AlternativeVideo) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode alternativeVideo#1ccfc90e to nil")
}
{
value, err := b.Long()
if err != nil {
return fmt.Errorf("unable to decode alternativeVideo#1ccfc90e: field id: %w", err)
}
a.ID = value
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode alternativeVideo#1ccfc90e: field width: %w", err)
}
a.Width = value
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode alternativeVideo#1ccfc90e: field height: %w", err)
}
a.Height = value
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode alternativeVideo#1ccfc90e: field codec: %w", err)
}
a.Codec = value
}
{
if err := a.HlsFile.Decode(b); err != nil {
return fmt.Errorf("unable to decode alternativeVideo#1ccfc90e: field hls_file: %w", err)
}
}
{
if err := a.Video.Decode(b); err != nil {
return fmt.Errorf("unable to decode alternativeVideo#1ccfc90e: field video: %w", err)
}
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AlternativeVideo) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode alternativeVideo#1ccfc90e as nil")
}
b.ObjStart()
b.PutID("alternativeVideo")
b.Comma()
b.FieldStart("id")
b.PutLong(a.ID)
b.Comma()
b.FieldStart("width")
b.PutInt32(a.Width)
b.Comma()
b.FieldStart("height")
b.PutInt32(a.Height)
b.Comma()
b.FieldStart("codec")
b.PutString(a.Codec)
b.Comma()
b.FieldStart("hls_file")
if err := a.HlsFile.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode alternativeVideo#1ccfc90e: field hls_file: %w", err)
}
b.Comma()
b.FieldStart("video")
if err := a.Video.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode alternativeVideo#1ccfc90e: field video: %w", err)
}
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AlternativeVideo) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode alternativeVideo#1ccfc90e to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("alternativeVideo"); err != nil {
return fmt.Errorf("unable to decode alternativeVideo#1ccfc90e: %w", err)
}
case "id":
value, err := b.Long()
if err != nil {
return fmt.Errorf("unable to decode alternativeVideo#1ccfc90e: field id: %w", err)
}
a.ID = value
case "width":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode alternativeVideo#1ccfc90e: field width: %w", err)
}
a.Width = value
case "height":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode alternativeVideo#1ccfc90e: field height: %w", err)
}
a.Height = value
case "codec":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode alternativeVideo#1ccfc90e: field codec: %w", err)
}
a.Codec = value
case "hls_file":
if err := a.HlsFile.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode alternativeVideo#1ccfc90e: field hls_file: %w", err)
}
case "video":
if err := a.Video.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode alternativeVideo#1ccfc90e: field video: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// GetID returns value of ID field.
func (a *AlternativeVideo) GetID() (value int64) {
if a == nil {
return
}
return a.ID
}
// GetWidth returns value of Width field.
func (a *AlternativeVideo) GetWidth() (value int32) {
if a == nil {
return
}
return a.Width
}
// GetHeight returns value of Height field.
func (a *AlternativeVideo) GetHeight() (value int32) {
if a == nil {
return
}
return a.Height
}
// GetCodec returns value of Codec field.
func (a *AlternativeVideo) GetCodec() (value string) {
if a == nil {
return
}
return a.Codec
}
// GetHlsFile returns value of HlsFile field.
func (a *AlternativeVideo) GetHlsFile() (value File) {
if a == nil {
return
}
return a.HlsFile
}
// GetVideo returns value of Video field.
func (a *AlternativeVideo) GetVideo() (value File) {
if a == nil {
return
}
return a.Video
}
-261
View File
@@ -1,261 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AnimatedChatPhoto represents TL type `animatedChatPhoto#b719c2e`.
type AnimatedChatPhoto struct {
// Animation width and height
Length int32
// Information about the animation file
File File
// Timestamp of the frame, used as a static chat photo
MainFrameTimestamp float64
}
// AnimatedChatPhotoTypeID is TL type id of AnimatedChatPhoto.
const AnimatedChatPhotoTypeID = 0xb719c2e
// Ensuring interfaces in compile-time for AnimatedChatPhoto.
var (
_ bin.Encoder = &AnimatedChatPhoto{}
_ bin.Decoder = &AnimatedChatPhoto{}
_ bin.BareEncoder = &AnimatedChatPhoto{}
_ bin.BareDecoder = &AnimatedChatPhoto{}
)
func (a *AnimatedChatPhoto) Zero() bool {
if a == nil {
return true
}
if !(a.Length == 0) {
return false
}
if !(a.File.Zero()) {
return false
}
if !(a.MainFrameTimestamp == 0) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AnimatedChatPhoto) String() string {
if a == nil {
return "AnimatedChatPhoto(nil)"
}
type Alias AnimatedChatPhoto
return fmt.Sprintf("AnimatedChatPhoto%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AnimatedChatPhoto) TypeID() uint32 {
return AnimatedChatPhotoTypeID
}
// TypeName returns name of type in TL schema.
func (*AnimatedChatPhoto) TypeName() string {
return "animatedChatPhoto"
}
// TypeInfo returns info about TL type.
func (a *AnimatedChatPhoto) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "animatedChatPhoto",
ID: AnimatedChatPhotoTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "Length",
SchemaName: "length",
},
{
Name: "File",
SchemaName: "file",
},
{
Name: "MainFrameTimestamp",
SchemaName: "main_frame_timestamp",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AnimatedChatPhoto) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode animatedChatPhoto#b719c2e as nil")
}
b.PutID(AnimatedChatPhotoTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AnimatedChatPhoto) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode animatedChatPhoto#b719c2e as nil")
}
b.PutInt32(a.Length)
if err := a.File.Encode(b); err != nil {
return fmt.Errorf("unable to encode animatedChatPhoto#b719c2e: field file: %w", err)
}
b.PutDouble(a.MainFrameTimestamp)
return nil
}
// Decode implements bin.Decoder.
func (a *AnimatedChatPhoto) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode animatedChatPhoto#b719c2e to nil")
}
if err := b.ConsumeID(AnimatedChatPhotoTypeID); err != nil {
return fmt.Errorf("unable to decode animatedChatPhoto#b719c2e: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AnimatedChatPhoto) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode animatedChatPhoto#b719c2e to nil")
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode animatedChatPhoto#b719c2e: field length: %w", err)
}
a.Length = value
}
{
if err := a.File.Decode(b); err != nil {
return fmt.Errorf("unable to decode animatedChatPhoto#b719c2e: field file: %w", err)
}
}
{
value, err := b.Double()
if err != nil {
return fmt.Errorf("unable to decode animatedChatPhoto#b719c2e: field main_frame_timestamp: %w", err)
}
a.MainFrameTimestamp = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AnimatedChatPhoto) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode animatedChatPhoto#b719c2e as nil")
}
b.ObjStart()
b.PutID("animatedChatPhoto")
b.Comma()
b.FieldStart("length")
b.PutInt32(a.Length)
b.Comma()
b.FieldStart("file")
if err := a.File.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode animatedChatPhoto#b719c2e: field file: %w", err)
}
b.Comma()
b.FieldStart("main_frame_timestamp")
b.PutDouble(a.MainFrameTimestamp)
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AnimatedChatPhoto) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode animatedChatPhoto#b719c2e to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("animatedChatPhoto"); err != nil {
return fmt.Errorf("unable to decode animatedChatPhoto#b719c2e: %w", err)
}
case "length":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode animatedChatPhoto#b719c2e: field length: %w", err)
}
a.Length = value
case "file":
if err := a.File.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode animatedChatPhoto#b719c2e: field file: %w", err)
}
case "main_frame_timestamp":
value, err := b.Double()
if err != nil {
return fmt.Errorf("unable to decode animatedChatPhoto#b719c2e: field main_frame_timestamp: %w", err)
}
a.MainFrameTimestamp = value
default:
return b.Skip()
}
return nil
})
}
// GetLength returns value of Length field.
func (a *AnimatedChatPhoto) GetLength() (value int32) {
if a == nil {
return
}
return a.Length
}
// GetFile returns value of File field.
func (a *AnimatedChatPhoto) GetFile() (value File) {
if a == nil {
return
}
return a.File
}
// GetMainFrameTimestamp returns value of MainFrameTimestamp field.
func (a *AnimatedChatPhoto) GetMainFrameTimestamp() (value float64) {
if a == nil {
return
}
return a.MainFrameTimestamp
}
-331
View File
@@ -1,331 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AnimatedEmoji represents TL type `animatedEmoji#52309ebf`.
type AnimatedEmoji struct {
// Sticker for the emoji; may be null if yet unknown for a custom emoji. If the sticker
// is a custom emoji, then it can have arbitrary format
Sticker Sticker
// Expected width of the sticker, which can be used if the sticker is null
StickerWidth int32
// Expected height of the sticker, which can be used if the sticker is null
StickerHeight int32
// Emoji modifier fitzpatrick type; 0-6; 0 if none
FitzpatrickType int32
// File containing the sound to be played when the sticker is clicked; may be null. The
// sound is encoded with the Opus codec, and stored inside an OGG container
Sound File
}
// AnimatedEmojiTypeID is TL type id of AnimatedEmoji.
const AnimatedEmojiTypeID = 0x52309ebf
// Ensuring interfaces in compile-time for AnimatedEmoji.
var (
_ bin.Encoder = &AnimatedEmoji{}
_ bin.Decoder = &AnimatedEmoji{}
_ bin.BareEncoder = &AnimatedEmoji{}
_ bin.BareDecoder = &AnimatedEmoji{}
)
func (a *AnimatedEmoji) Zero() bool {
if a == nil {
return true
}
if !(a.Sticker.Zero()) {
return false
}
if !(a.StickerWidth == 0) {
return false
}
if !(a.StickerHeight == 0) {
return false
}
if !(a.FitzpatrickType == 0) {
return false
}
if !(a.Sound.Zero()) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AnimatedEmoji) String() string {
if a == nil {
return "AnimatedEmoji(nil)"
}
type Alias AnimatedEmoji
return fmt.Sprintf("AnimatedEmoji%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AnimatedEmoji) TypeID() uint32 {
return AnimatedEmojiTypeID
}
// TypeName returns name of type in TL schema.
func (*AnimatedEmoji) TypeName() string {
return "animatedEmoji"
}
// TypeInfo returns info about TL type.
func (a *AnimatedEmoji) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "animatedEmoji",
ID: AnimatedEmojiTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "Sticker",
SchemaName: "sticker",
},
{
Name: "StickerWidth",
SchemaName: "sticker_width",
},
{
Name: "StickerHeight",
SchemaName: "sticker_height",
},
{
Name: "FitzpatrickType",
SchemaName: "fitzpatrick_type",
},
{
Name: "Sound",
SchemaName: "sound",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AnimatedEmoji) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode animatedEmoji#52309ebf as nil")
}
b.PutID(AnimatedEmojiTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AnimatedEmoji) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode animatedEmoji#52309ebf as nil")
}
if err := a.Sticker.Encode(b); err != nil {
return fmt.Errorf("unable to encode animatedEmoji#52309ebf: field sticker: %w", err)
}
b.PutInt32(a.StickerWidth)
b.PutInt32(a.StickerHeight)
b.PutInt32(a.FitzpatrickType)
if err := a.Sound.Encode(b); err != nil {
return fmt.Errorf("unable to encode animatedEmoji#52309ebf: field sound: %w", err)
}
return nil
}
// Decode implements bin.Decoder.
func (a *AnimatedEmoji) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode animatedEmoji#52309ebf to nil")
}
if err := b.ConsumeID(AnimatedEmojiTypeID); err != nil {
return fmt.Errorf("unable to decode animatedEmoji#52309ebf: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AnimatedEmoji) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode animatedEmoji#52309ebf to nil")
}
{
if err := a.Sticker.Decode(b); err != nil {
return fmt.Errorf("unable to decode animatedEmoji#52309ebf: field sticker: %w", err)
}
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode animatedEmoji#52309ebf: field sticker_width: %w", err)
}
a.StickerWidth = value
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode animatedEmoji#52309ebf: field sticker_height: %w", err)
}
a.StickerHeight = value
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode animatedEmoji#52309ebf: field fitzpatrick_type: %w", err)
}
a.FitzpatrickType = value
}
{
if err := a.Sound.Decode(b); err != nil {
return fmt.Errorf("unable to decode animatedEmoji#52309ebf: field sound: %w", err)
}
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AnimatedEmoji) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode animatedEmoji#52309ebf as nil")
}
b.ObjStart()
b.PutID("animatedEmoji")
b.Comma()
b.FieldStart("sticker")
if err := a.Sticker.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode animatedEmoji#52309ebf: field sticker: %w", err)
}
b.Comma()
b.FieldStart("sticker_width")
b.PutInt32(a.StickerWidth)
b.Comma()
b.FieldStart("sticker_height")
b.PutInt32(a.StickerHeight)
b.Comma()
b.FieldStart("fitzpatrick_type")
b.PutInt32(a.FitzpatrickType)
b.Comma()
b.FieldStart("sound")
if err := a.Sound.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode animatedEmoji#52309ebf: field sound: %w", err)
}
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AnimatedEmoji) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode animatedEmoji#52309ebf to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("animatedEmoji"); err != nil {
return fmt.Errorf("unable to decode animatedEmoji#52309ebf: %w", err)
}
case "sticker":
if err := a.Sticker.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode animatedEmoji#52309ebf: field sticker: %w", err)
}
case "sticker_width":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode animatedEmoji#52309ebf: field sticker_width: %w", err)
}
a.StickerWidth = value
case "sticker_height":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode animatedEmoji#52309ebf: field sticker_height: %w", err)
}
a.StickerHeight = value
case "fitzpatrick_type":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode animatedEmoji#52309ebf: field fitzpatrick_type: %w", err)
}
a.FitzpatrickType = value
case "sound":
if err := a.Sound.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode animatedEmoji#52309ebf: field sound: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// GetSticker returns value of Sticker field.
func (a *AnimatedEmoji) GetSticker() (value Sticker) {
if a == nil {
return
}
return a.Sticker
}
// GetStickerWidth returns value of StickerWidth field.
func (a *AnimatedEmoji) GetStickerWidth() (value int32) {
if a == nil {
return
}
return a.StickerWidth
}
// GetStickerHeight returns value of StickerHeight field.
func (a *AnimatedEmoji) GetStickerHeight() (value int32) {
if a == nil {
return
}
return a.StickerHeight
}
// GetFitzpatrickType returns value of FitzpatrickType field.
func (a *AnimatedEmoji) GetFitzpatrickType() (value int32) {
if a == nil {
return
}
return a.FitzpatrickType
}
// GetSound returns value of Sound field.
func (a *AnimatedEmoji) GetSound() (value File) {
if a == nil {
return
}
return a.Sound
}
-466
View File
@@ -1,466 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// Animation represents TL type `animation#cc00db3e`.
type Animation struct {
// Duration of the animation, in seconds; as defined by the sender
Duration int32
// Width of the animation
Width int32
// Height of the animation
Height int32
// Original name of the file; as defined by the sender
FileName string
// MIME type of the file, usually "image/gif" or "video/mp4"
MimeType string
// True, if stickers were added to the animation. The list of corresponding sticker set
// can be received using getAttachedStickerSets
HasStickers bool
// Animation minithumbnail; may be null
Minithumbnail Minithumbnail
// Animation thumbnail in JPEG or MPEG4 format; may be null
Thumbnail Thumbnail
// File containing the animation
Animation File
}
// AnimationTypeID is TL type id of Animation.
const AnimationTypeID = 0xcc00db3e
// Ensuring interfaces in compile-time for Animation.
var (
_ bin.Encoder = &Animation{}
_ bin.Decoder = &Animation{}
_ bin.BareEncoder = &Animation{}
_ bin.BareDecoder = &Animation{}
)
func (a *Animation) Zero() bool {
if a == nil {
return true
}
if !(a.Duration == 0) {
return false
}
if !(a.Width == 0) {
return false
}
if !(a.Height == 0) {
return false
}
if !(a.FileName == "") {
return false
}
if !(a.MimeType == "") {
return false
}
if !(a.HasStickers == false) {
return false
}
if !(a.Minithumbnail.Zero()) {
return false
}
if !(a.Thumbnail.Zero()) {
return false
}
if !(a.Animation.Zero()) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *Animation) String() string {
if a == nil {
return "Animation(nil)"
}
type Alias Animation
return fmt.Sprintf("Animation%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*Animation) TypeID() uint32 {
return AnimationTypeID
}
// TypeName returns name of type in TL schema.
func (*Animation) TypeName() string {
return "animation"
}
// TypeInfo returns info about TL type.
func (a *Animation) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "animation",
ID: AnimationTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "Duration",
SchemaName: "duration",
},
{
Name: "Width",
SchemaName: "width",
},
{
Name: "Height",
SchemaName: "height",
},
{
Name: "FileName",
SchemaName: "file_name",
},
{
Name: "MimeType",
SchemaName: "mime_type",
},
{
Name: "HasStickers",
SchemaName: "has_stickers",
},
{
Name: "Minithumbnail",
SchemaName: "minithumbnail",
},
{
Name: "Thumbnail",
SchemaName: "thumbnail",
},
{
Name: "Animation",
SchemaName: "animation",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *Animation) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode animation#cc00db3e as nil")
}
b.PutID(AnimationTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *Animation) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode animation#cc00db3e as nil")
}
b.PutInt32(a.Duration)
b.PutInt32(a.Width)
b.PutInt32(a.Height)
b.PutString(a.FileName)
b.PutString(a.MimeType)
b.PutBool(a.HasStickers)
if err := a.Minithumbnail.Encode(b); err != nil {
return fmt.Errorf("unable to encode animation#cc00db3e: field minithumbnail: %w", err)
}
if err := a.Thumbnail.Encode(b); err != nil {
return fmt.Errorf("unable to encode animation#cc00db3e: field thumbnail: %w", err)
}
if err := a.Animation.Encode(b); err != nil {
return fmt.Errorf("unable to encode animation#cc00db3e: field animation: %w", err)
}
return nil
}
// Decode implements bin.Decoder.
func (a *Animation) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode animation#cc00db3e to nil")
}
if err := b.ConsumeID(AnimationTypeID); err != nil {
return fmt.Errorf("unable to decode animation#cc00db3e: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *Animation) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode animation#cc00db3e to nil")
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode animation#cc00db3e: field duration: %w", err)
}
a.Duration = value
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode animation#cc00db3e: field width: %w", err)
}
a.Width = value
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode animation#cc00db3e: field height: %w", err)
}
a.Height = value
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode animation#cc00db3e: field file_name: %w", err)
}
a.FileName = value
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode animation#cc00db3e: field mime_type: %w", err)
}
a.MimeType = value
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode animation#cc00db3e: field has_stickers: %w", err)
}
a.HasStickers = value
}
{
if err := a.Minithumbnail.Decode(b); err != nil {
return fmt.Errorf("unable to decode animation#cc00db3e: field minithumbnail: %w", err)
}
}
{
if err := a.Thumbnail.Decode(b); err != nil {
return fmt.Errorf("unable to decode animation#cc00db3e: field thumbnail: %w", err)
}
}
{
if err := a.Animation.Decode(b); err != nil {
return fmt.Errorf("unable to decode animation#cc00db3e: field animation: %w", err)
}
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *Animation) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode animation#cc00db3e as nil")
}
b.ObjStart()
b.PutID("animation")
b.Comma()
b.FieldStart("duration")
b.PutInt32(a.Duration)
b.Comma()
b.FieldStart("width")
b.PutInt32(a.Width)
b.Comma()
b.FieldStart("height")
b.PutInt32(a.Height)
b.Comma()
b.FieldStart("file_name")
b.PutString(a.FileName)
b.Comma()
b.FieldStart("mime_type")
b.PutString(a.MimeType)
b.Comma()
b.FieldStart("has_stickers")
b.PutBool(a.HasStickers)
b.Comma()
b.FieldStart("minithumbnail")
if err := a.Minithumbnail.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode animation#cc00db3e: field minithumbnail: %w", err)
}
b.Comma()
b.FieldStart("thumbnail")
if err := a.Thumbnail.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode animation#cc00db3e: field thumbnail: %w", err)
}
b.Comma()
b.FieldStart("animation")
if err := a.Animation.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode animation#cc00db3e: field animation: %w", err)
}
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *Animation) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode animation#cc00db3e to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("animation"); err != nil {
return fmt.Errorf("unable to decode animation#cc00db3e: %w", err)
}
case "duration":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode animation#cc00db3e: field duration: %w", err)
}
a.Duration = value
case "width":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode animation#cc00db3e: field width: %w", err)
}
a.Width = value
case "height":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode animation#cc00db3e: field height: %w", err)
}
a.Height = value
case "file_name":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode animation#cc00db3e: field file_name: %w", err)
}
a.FileName = value
case "mime_type":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode animation#cc00db3e: field mime_type: %w", err)
}
a.MimeType = value
case "has_stickers":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode animation#cc00db3e: field has_stickers: %w", err)
}
a.HasStickers = value
case "minithumbnail":
if err := a.Minithumbnail.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode animation#cc00db3e: field minithumbnail: %w", err)
}
case "thumbnail":
if err := a.Thumbnail.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode animation#cc00db3e: field thumbnail: %w", err)
}
case "animation":
if err := a.Animation.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode animation#cc00db3e: field animation: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// GetDuration returns value of Duration field.
func (a *Animation) GetDuration() (value int32) {
if a == nil {
return
}
return a.Duration
}
// GetWidth returns value of Width field.
func (a *Animation) GetWidth() (value int32) {
if a == nil {
return
}
return a.Width
}
// GetHeight returns value of Height field.
func (a *Animation) GetHeight() (value int32) {
if a == nil {
return
}
return a.Height
}
// GetFileName returns value of FileName field.
func (a *Animation) GetFileName() (value string) {
if a == nil {
return
}
return a.FileName
}
// GetMimeType returns value of MimeType field.
func (a *Animation) GetMimeType() (value string) {
if a == nil {
return
}
return a.MimeType
}
// GetHasStickers returns value of HasStickers field.
func (a *Animation) GetHasStickers() (value bool) {
if a == nil {
return
}
return a.HasStickers
}
// GetMinithumbnail returns value of Minithumbnail field.
func (a *Animation) GetMinithumbnail() (value Minithumbnail) {
if a == nil {
return
}
return a.Minithumbnail
}
// GetThumbnail returns value of Thumbnail field.
func (a *Animation) GetThumbnail() (value Thumbnail) {
if a == nil {
return
}
return a.Thumbnail
}
// GetAnimation returns value of Animation field.
func (a *Animation) GetAnimation() (value File) {
if a == nil {
return
}
return a.Animation
}
-221
View File
@@ -1,221 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// Animations represents TL type `animations#2ce4157c`.
type Animations struct {
// List of animations
Animations []Animation
}
// AnimationsTypeID is TL type id of Animations.
const AnimationsTypeID = 0x2ce4157c
// Ensuring interfaces in compile-time for Animations.
var (
_ bin.Encoder = &Animations{}
_ bin.Decoder = &Animations{}
_ bin.BareEncoder = &Animations{}
_ bin.BareDecoder = &Animations{}
)
func (a *Animations) Zero() bool {
if a == nil {
return true
}
if !(a.Animations == nil) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *Animations) String() string {
if a == nil {
return "Animations(nil)"
}
type Alias Animations
return fmt.Sprintf("Animations%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*Animations) TypeID() uint32 {
return AnimationsTypeID
}
// TypeName returns name of type in TL schema.
func (*Animations) TypeName() string {
return "animations"
}
// TypeInfo returns info about TL type.
func (a *Animations) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "animations",
ID: AnimationsTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "Animations",
SchemaName: "animations",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *Animations) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode animations#2ce4157c as nil")
}
b.PutID(AnimationsTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *Animations) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode animations#2ce4157c as nil")
}
b.PutInt(len(a.Animations))
for idx, v := range a.Animations {
if err := v.EncodeBare(b); err != nil {
return fmt.Errorf("unable to encode bare animations#2ce4157c: field animations element with index %d: %w", idx, err)
}
}
return nil
}
// Decode implements bin.Decoder.
func (a *Animations) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode animations#2ce4157c to nil")
}
if err := b.ConsumeID(AnimationsTypeID); err != nil {
return fmt.Errorf("unable to decode animations#2ce4157c: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *Animations) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode animations#2ce4157c to nil")
}
{
headerLen, err := b.Int()
if err != nil {
return fmt.Errorf("unable to decode animations#2ce4157c: field animations: %w", err)
}
if headerLen > 0 {
a.Animations = make([]Animation, 0, headerLen%bin.PreallocateLimit)
}
for idx := 0; idx < headerLen; idx++ {
var value Animation
if err := value.DecodeBare(b); err != nil {
return fmt.Errorf("unable to decode bare animations#2ce4157c: field animations: %w", err)
}
a.Animations = append(a.Animations, value)
}
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *Animations) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode animations#2ce4157c as nil")
}
b.ObjStart()
b.PutID("animations")
b.Comma()
b.FieldStart("animations")
b.ArrStart()
for idx, v := range a.Animations {
if err := v.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode animations#2ce4157c: field animations element with index %d: %w", idx, err)
}
b.Comma()
}
b.StripComma()
b.ArrEnd()
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *Animations) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode animations#2ce4157c to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("animations"); err != nil {
return fmt.Errorf("unable to decode animations#2ce4157c: %w", err)
}
case "animations":
if err := b.Arr(func(b tdjson.Decoder) error {
var value Animation
if err := value.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode animations#2ce4157c: field animations: %w", err)
}
a.Animations = append(a.Animations, value)
return nil
}); err != nil {
return fmt.Errorf("unable to decode animations#2ce4157c: field animations: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// GetAnimations returns value of Animations field.
func (a *Animations) GetAnimations() (value []Animation) {
if a == nil {
return
}
return a.Animations
}
-339
View File
@@ -1,339 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AnswerCallbackQueryRequest represents TL type `answerCallbackQuery#bb462e76`.
type AnswerCallbackQueryRequest struct {
// Identifier of the callback query
CallbackQueryID int64
// Text of the answer
Text string
// Pass true to show an alert to the user instead of a toast notification
ShowAlert bool
// URL to be opened
URL string
// Time during which the result of the query can be cached, in seconds
CacheTime int32
}
// AnswerCallbackQueryRequestTypeID is TL type id of AnswerCallbackQueryRequest.
const AnswerCallbackQueryRequestTypeID = 0xbb462e76
// Ensuring interfaces in compile-time for AnswerCallbackQueryRequest.
var (
_ bin.Encoder = &AnswerCallbackQueryRequest{}
_ bin.Decoder = &AnswerCallbackQueryRequest{}
_ bin.BareEncoder = &AnswerCallbackQueryRequest{}
_ bin.BareDecoder = &AnswerCallbackQueryRequest{}
)
func (a *AnswerCallbackQueryRequest) Zero() bool {
if a == nil {
return true
}
if !(a.CallbackQueryID == 0) {
return false
}
if !(a.Text == "") {
return false
}
if !(a.ShowAlert == false) {
return false
}
if !(a.URL == "") {
return false
}
if !(a.CacheTime == 0) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AnswerCallbackQueryRequest) String() string {
if a == nil {
return "AnswerCallbackQueryRequest(nil)"
}
type Alias AnswerCallbackQueryRequest
return fmt.Sprintf("AnswerCallbackQueryRequest%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AnswerCallbackQueryRequest) TypeID() uint32 {
return AnswerCallbackQueryRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*AnswerCallbackQueryRequest) TypeName() string {
return "answerCallbackQuery"
}
// TypeInfo returns info about TL type.
func (a *AnswerCallbackQueryRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "answerCallbackQuery",
ID: AnswerCallbackQueryRequestTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "CallbackQueryID",
SchemaName: "callback_query_id",
},
{
Name: "Text",
SchemaName: "text",
},
{
Name: "ShowAlert",
SchemaName: "show_alert",
},
{
Name: "URL",
SchemaName: "url",
},
{
Name: "CacheTime",
SchemaName: "cache_time",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AnswerCallbackQueryRequest) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode answerCallbackQuery#bb462e76 as nil")
}
b.PutID(AnswerCallbackQueryRequestTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AnswerCallbackQueryRequest) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode answerCallbackQuery#bb462e76 as nil")
}
b.PutLong(a.CallbackQueryID)
b.PutString(a.Text)
b.PutBool(a.ShowAlert)
b.PutString(a.URL)
b.PutInt32(a.CacheTime)
return nil
}
// Decode implements bin.Decoder.
func (a *AnswerCallbackQueryRequest) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode answerCallbackQuery#bb462e76 to nil")
}
if err := b.ConsumeID(AnswerCallbackQueryRequestTypeID); err != nil {
return fmt.Errorf("unable to decode answerCallbackQuery#bb462e76: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AnswerCallbackQueryRequest) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode answerCallbackQuery#bb462e76 to nil")
}
{
value, err := b.Long()
if err != nil {
return fmt.Errorf("unable to decode answerCallbackQuery#bb462e76: field callback_query_id: %w", err)
}
a.CallbackQueryID = value
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode answerCallbackQuery#bb462e76: field text: %w", err)
}
a.Text = value
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode answerCallbackQuery#bb462e76: field show_alert: %w", err)
}
a.ShowAlert = value
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode answerCallbackQuery#bb462e76: field url: %w", err)
}
a.URL = value
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode answerCallbackQuery#bb462e76: field cache_time: %w", err)
}
a.CacheTime = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AnswerCallbackQueryRequest) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode answerCallbackQuery#bb462e76 as nil")
}
b.ObjStart()
b.PutID("answerCallbackQuery")
b.Comma()
b.FieldStart("callback_query_id")
b.PutLong(a.CallbackQueryID)
b.Comma()
b.FieldStart("text")
b.PutString(a.Text)
b.Comma()
b.FieldStart("show_alert")
b.PutBool(a.ShowAlert)
b.Comma()
b.FieldStart("url")
b.PutString(a.URL)
b.Comma()
b.FieldStart("cache_time")
b.PutInt32(a.CacheTime)
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AnswerCallbackQueryRequest) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode answerCallbackQuery#bb462e76 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("answerCallbackQuery"); err != nil {
return fmt.Errorf("unable to decode answerCallbackQuery#bb462e76: %w", err)
}
case "callback_query_id":
value, err := b.Long()
if err != nil {
return fmt.Errorf("unable to decode answerCallbackQuery#bb462e76: field callback_query_id: %w", err)
}
a.CallbackQueryID = value
case "text":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode answerCallbackQuery#bb462e76: field text: %w", err)
}
a.Text = value
case "show_alert":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode answerCallbackQuery#bb462e76: field show_alert: %w", err)
}
a.ShowAlert = value
case "url":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode answerCallbackQuery#bb462e76: field url: %w", err)
}
a.URL = value
case "cache_time":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode answerCallbackQuery#bb462e76: field cache_time: %w", err)
}
a.CacheTime = value
default:
return b.Skip()
}
return nil
})
}
// GetCallbackQueryID returns value of CallbackQueryID field.
func (a *AnswerCallbackQueryRequest) GetCallbackQueryID() (value int64) {
if a == nil {
return
}
return a.CallbackQueryID
}
// GetText returns value of Text field.
func (a *AnswerCallbackQueryRequest) GetText() (value string) {
if a == nil {
return
}
return a.Text
}
// GetShowAlert returns value of ShowAlert field.
func (a *AnswerCallbackQueryRequest) GetShowAlert() (value bool) {
if a == nil {
return
}
return a.ShowAlert
}
// GetURL returns value of URL field.
func (a *AnswerCallbackQueryRequest) GetURL() (value string) {
if a == nil {
return
}
return a.URL
}
// GetCacheTime returns value of CacheTime field.
func (a *AnswerCallbackQueryRequest) GetCacheTime() (value int32) {
if a == nil {
return
}
return a.CacheTime
}
// AnswerCallbackQuery invokes method answerCallbackQuery#bb462e76 returning error if any.
func (c *Client) AnswerCallbackQuery(ctx context.Context, request *AnswerCallbackQueryRequest) error {
var ok Ok
if err := c.rpc.Invoke(ctx, request, &ok); err != nil {
return err
}
return nil
}
-237
View File
@@ -1,237 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AnswerCustomQueryRequest represents TL type `answerCustomQuery#b2e52d3f`.
type AnswerCustomQueryRequest struct {
// Identifier of a custom query
CustomQueryID int64
// JSON-serialized answer to the query
Data string
}
// AnswerCustomQueryRequestTypeID is TL type id of AnswerCustomQueryRequest.
const AnswerCustomQueryRequestTypeID = 0xb2e52d3f
// Ensuring interfaces in compile-time for AnswerCustomQueryRequest.
var (
_ bin.Encoder = &AnswerCustomQueryRequest{}
_ bin.Decoder = &AnswerCustomQueryRequest{}
_ bin.BareEncoder = &AnswerCustomQueryRequest{}
_ bin.BareDecoder = &AnswerCustomQueryRequest{}
)
func (a *AnswerCustomQueryRequest) Zero() bool {
if a == nil {
return true
}
if !(a.CustomQueryID == 0) {
return false
}
if !(a.Data == "") {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AnswerCustomQueryRequest) String() string {
if a == nil {
return "AnswerCustomQueryRequest(nil)"
}
type Alias AnswerCustomQueryRequest
return fmt.Sprintf("AnswerCustomQueryRequest%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AnswerCustomQueryRequest) TypeID() uint32 {
return AnswerCustomQueryRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*AnswerCustomQueryRequest) TypeName() string {
return "answerCustomQuery"
}
// TypeInfo returns info about TL type.
func (a *AnswerCustomQueryRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "answerCustomQuery",
ID: AnswerCustomQueryRequestTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "CustomQueryID",
SchemaName: "custom_query_id",
},
{
Name: "Data",
SchemaName: "data",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AnswerCustomQueryRequest) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode answerCustomQuery#b2e52d3f as nil")
}
b.PutID(AnswerCustomQueryRequestTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AnswerCustomQueryRequest) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode answerCustomQuery#b2e52d3f as nil")
}
b.PutLong(a.CustomQueryID)
b.PutString(a.Data)
return nil
}
// Decode implements bin.Decoder.
func (a *AnswerCustomQueryRequest) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode answerCustomQuery#b2e52d3f to nil")
}
if err := b.ConsumeID(AnswerCustomQueryRequestTypeID); err != nil {
return fmt.Errorf("unable to decode answerCustomQuery#b2e52d3f: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AnswerCustomQueryRequest) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode answerCustomQuery#b2e52d3f to nil")
}
{
value, err := b.Long()
if err != nil {
return fmt.Errorf("unable to decode answerCustomQuery#b2e52d3f: field custom_query_id: %w", err)
}
a.CustomQueryID = value
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode answerCustomQuery#b2e52d3f: field data: %w", err)
}
a.Data = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AnswerCustomQueryRequest) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode answerCustomQuery#b2e52d3f as nil")
}
b.ObjStart()
b.PutID("answerCustomQuery")
b.Comma()
b.FieldStart("custom_query_id")
b.PutLong(a.CustomQueryID)
b.Comma()
b.FieldStart("data")
b.PutString(a.Data)
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AnswerCustomQueryRequest) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode answerCustomQuery#b2e52d3f to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("answerCustomQuery"); err != nil {
return fmt.Errorf("unable to decode answerCustomQuery#b2e52d3f: %w", err)
}
case "custom_query_id":
value, err := b.Long()
if err != nil {
return fmt.Errorf("unable to decode answerCustomQuery#b2e52d3f: field custom_query_id: %w", err)
}
a.CustomQueryID = value
case "data":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode answerCustomQuery#b2e52d3f: field data: %w", err)
}
a.Data = value
default:
return b.Skip()
}
return nil
})
}
// GetCustomQueryID returns value of CustomQueryID field.
func (a *AnswerCustomQueryRequest) GetCustomQueryID() (value int64) {
if a == nil {
return
}
return a.CustomQueryID
}
// GetData returns value of Data field.
func (a *AnswerCustomQueryRequest) GetData() (value string) {
if a == nil {
return
}
return a.Data
}
// AnswerCustomQuery invokes method answerCustomQuery#b2e52d3f returning error if any.
func (c *Client) AnswerCustomQuery(ctx context.Context, request *AnswerCustomQueryRequest) error {
var ok Ok
if err := c.rpc.Invoke(ctx, request, &ok); err != nil {
return err
}
return nil
}
-408
View File
@@ -1,408 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AnswerInlineQueryRequest represents TL type `answerInlineQuery#ac7cc5e6`.
type AnswerInlineQueryRequest struct {
// Identifier of the inline query
InlineQueryID int64
// Pass true if results may be cached and returned only for the user that sent the query.
// By default, results may be returned to any user who sends the same query
IsPersonal bool
// Button to be shown above inline query results; pass null if none
Button InlineQueryResultsButton
// The results of the query
Results []InputInlineQueryResultClass
// Allowed time to cache the results of the query, in seconds
CacheTime int32
// Offset for the next inline query; pass an empty string if there are no more results
NextOffset string
}
// AnswerInlineQueryRequestTypeID is TL type id of AnswerInlineQueryRequest.
const AnswerInlineQueryRequestTypeID = 0xac7cc5e6
// Ensuring interfaces in compile-time for AnswerInlineQueryRequest.
var (
_ bin.Encoder = &AnswerInlineQueryRequest{}
_ bin.Decoder = &AnswerInlineQueryRequest{}
_ bin.BareEncoder = &AnswerInlineQueryRequest{}
_ bin.BareDecoder = &AnswerInlineQueryRequest{}
)
func (a *AnswerInlineQueryRequest) Zero() bool {
if a == nil {
return true
}
if !(a.InlineQueryID == 0) {
return false
}
if !(a.IsPersonal == false) {
return false
}
if !(a.Button.Zero()) {
return false
}
if !(a.Results == nil) {
return false
}
if !(a.CacheTime == 0) {
return false
}
if !(a.NextOffset == "") {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AnswerInlineQueryRequest) String() string {
if a == nil {
return "AnswerInlineQueryRequest(nil)"
}
type Alias AnswerInlineQueryRequest
return fmt.Sprintf("AnswerInlineQueryRequest%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AnswerInlineQueryRequest) TypeID() uint32 {
return AnswerInlineQueryRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*AnswerInlineQueryRequest) TypeName() string {
return "answerInlineQuery"
}
// TypeInfo returns info about TL type.
func (a *AnswerInlineQueryRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "answerInlineQuery",
ID: AnswerInlineQueryRequestTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "InlineQueryID",
SchemaName: "inline_query_id",
},
{
Name: "IsPersonal",
SchemaName: "is_personal",
},
{
Name: "Button",
SchemaName: "button",
},
{
Name: "Results",
SchemaName: "results",
},
{
Name: "CacheTime",
SchemaName: "cache_time",
},
{
Name: "NextOffset",
SchemaName: "next_offset",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AnswerInlineQueryRequest) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode answerInlineQuery#ac7cc5e6 as nil")
}
b.PutID(AnswerInlineQueryRequestTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AnswerInlineQueryRequest) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode answerInlineQuery#ac7cc5e6 as nil")
}
b.PutLong(a.InlineQueryID)
b.PutBool(a.IsPersonal)
if err := a.Button.Encode(b); err != nil {
return fmt.Errorf("unable to encode answerInlineQuery#ac7cc5e6: field button: %w", err)
}
b.PutInt(len(a.Results))
for idx, v := range a.Results {
if v == nil {
return fmt.Errorf("unable to encode answerInlineQuery#ac7cc5e6: field results element with index %d is nil", idx)
}
if err := v.EncodeBare(b); err != nil {
return fmt.Errorf("unable to encode bare answerInlineQuery#ac7cc5e6: field results element with index %d: %w", idx, err)
}
}
b.PutInt32(a.CacheTime)
b.PutString(a.NextOffset)
return nil
}
// Decode implements bin.Decoder.
func (a *AnswerInlineQueryRequest) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode answerInlineQuery#ac7cc5e6 to nil")
}
if err := b.ConsumeID(AnswerInlineQueryRequestTypeID); err != nil {
return fmt.Errorf("unable to decode answerInlineQuery#ac7cc5e6: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AnswerInlineQueryRequest) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode answerInlineQuery#ac7cc5e6 to nil")
}
{
value, err := b.Long()
if err != nil {
return fmt.Errorf("unable to decode answerInlineQuery#ac7cc5e6: field inline_query_id: %w", err)
}
a.InlineQueryID = value
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode answerInlineQuery#ac7cc5e6: field is_personal: %w", err)
}
a.IsPersonal = value
}
{
if err := a.Button.Decode(b); err != nil {
return fmt.Errorf("unable to decode answerInlineQuery#ac7cc5e6: field button: %w", err)
}
}
{
headerLen, err := b.Int()
if err != nil {
return fmt.Errorf("unable to decode answerInlineQuery#ac7cc5e6: field results: %w", err)
}
if headerLen > 0 {
a.Results = make([]InputInlineQueryResultClass, 0, headerLen%bin.PreallocateLimit)
}
for idx := 0; idx < headerLen; idx++ {
value, err := DecodeInputInlineQueryResult(b)
if err != nil {
return fmt.Errorf("unable to decode answerInlineQuery#ac7cc5e6: field results: %w", err)
}
a.Results = append(a.Results, value)
}
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode answerInlineQuery#ac7cc5e6: field cache_time: %w", err)
}
a.CacheTime = value
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode answerInlineQuery#ac7cc5e6: field next_offset: %w", err)
}
a.NextOffset = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AnswerInlineQueryRequest) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode answerInlineQuery#ac7cc5e6 as nil")
}
b.ObjStart()
b.PutID("answerInlineQuery")
b.Comma()
b.FieldStart("inline_query_id")
b.PutLong(a.InlineQueryID)
b.Comma()
b.FieldStart("is_personal")
b.PutBool(a.IsPersonal)
b.Comma()
b.FieldStart("button")
if err := a.Button.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode answerInlineQuery#ac7cc5e6: field button: %w", err)
}
b.Comma()
b.FieldStart("results")
b.ArrStart()
for idx, v := range a.Results {
if v == nil {
return fmt.Errorf("unable to encode answerInlineQuery#ac7cc5e6: field results element with index %d is nil", idx)
}
if err := v.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode answerInlineQuery#ac7cc5e6: field results element with index %d: %w", idx, err)
}
b.Comma()
}
b.StripComma()
b.ArrEnd()
b.Comma()
b.FieldStart("cache_time")
b.PutInt32(a.CacheTime)
b.Comma()
b.FieldStart("next_offset")
b.PutString(a.NextOffset)
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AnswerInlineQueryRequest) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode answerInlineQuery#ac7cc5e6 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("answerInlineQuery"); err != nil {
return fmt.Errorf("unable to decode answerInlineQuery#ac7cc5e6: %w", err)
}
case "inline_query_id":
value, err := b.Long()
if err != nil {
return fmt.Errorf("unable to decode answerInlineQuery#ac7cc5e6: field inline_query_id: %w", err)
}
a.InlineQueryID = value
case "is_personal":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode answerInlineQuery#ac7cc5e6: field is_personal: %w", err)
}
a.IsPersonal = value
case "button":
if err := a.Button.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode answerInlineQuery#ac7cc5e6: field button: %w", err)
}
case "results":
if err := b.Arr(func(b tdjson.Decoder) error {
value, err := DecodeTDLibJSONInputInlineQueryResult(b)
if err != nil {
return fmt.Errorf("unable to decode answerInlineQuery#ac7cc5e6: field results: %w", err)
}
a.Results = append(a.Results, value)
return nil
}); err != nil {
return fmt.Errorf("unable to decode answerInlineQuery#ac7cc5e6: field results: %w", err)
}
case "cache_time":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode answerInlineQuery#ac7cc5e6: field cache_time: %w", err)
}
a.CacheTime = value
case "next_offset":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode answerInlineQuery#ac7cc5e6: field next_offset: %w", err)
}
a.NextOffset = value
default:
return b.Skip()
}
return nil
})
}
// GetInlineQueryID returns value of InlineQueryID field.
func (a *AnswerInlineQueryRequest) GetInlineQueryID() (value int64) {
if a == nil {
return
}
return a.InlineQueryID
}
// GetIsPersonal returns value of IsPersonal field.
func (a *AnswerInlineQueryRequest) GetIsPersonal() (value bool) {
if a == nil {
return
}
return a.IsPersonal
}
// GetButton returns value of Button field.
func (a *AnswerInlineQueryRequest) GetButton() (value InlineQueryResultsButton) {
if a == nil {
return
}
return a.Button
}
// GetResults returns value of Results field.
func (a *AnswerInlineQueryRequest) GetResults() (value []InputInlineQueryResultClass) {
if a == nil {
return
}
return a.Results
}
// GetCacheTime returns value of CacheTime field.
func (a *AnswerInlineQueryRequest) GetCacheTime() (value int32) {
if a == nil {
return
}
return a.CacheTime
}
// GetNextOffset returns value of NextOffset field.
func (a *AnswerInlineQueryRequest) GetNextOffset() (value string) {
if a == nil {
return
}
return a.NextOffset
}
// AnswerInlineQuery invokes method answerInlineQuery#ac7cc5e6 returning error if any.
func (c *Client) AnswerInlineQuery(ctx context.Context, request *AnswerInlineQueryRequest) error {
var ok Ok
if err := c.rpc.Invoke(ctx, request, &ok); err != nil {
return err
}
return nil
}
-237
View File
@@ -1,237 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AnswerPreCheckoutQueryRequest represents TL type `answerPreCheckoutQuery#a76163eb`.
type AnswerPreCheckoutQueryRequest struct {
// Identifier of the pre-checkout query
PreCheckoutQueryID int64
// An error message, empty on success
ErrorMessage string
}
// AnswerPreCheckoutQueryRequestTypeID is TL type id of AnswerPreCheckoutQueryRequest.
const AnswerPreCheckoutQueryRequestTypeID = 0xa76163eb
// Ensuring interfaces in compile-time for AnswerPreCheckoutQueryRequest.
var (
_ bin.Encoder = &AnswerPreCheckoutQueryRequest{}
_ bin.Decoder = &AnswerPreCheckoutQueryRequest{}
_ bin.BareEncoder = &AnswerPreCheckoutQueryRequest{}
_ bin.BareDecoder = &AnswerPreCheckoutQueryRequest{}
)
func (a *AnswerPreCheckoutQueryRequest) Zero() bool {
if a == nil {
return true
}
if !(a.PreCheckoutQueryID == 0) {
return false
}
if !(a.ErrorMessage == "") {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AnswerPreCheckoutQueryRequest) String() string {
if a == nil {
return "AnswerPreCheckoutQueryRequest(nil)"
}
type Alias AnswerPreCheckoutQueryRequest
return fmt.Sprintf("AnswerPreCheckoutQueryRequest%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AnswerPreCheckoutQueryRequest) TypeID() uint32 {
return AnswerPreCheckoutQueryRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*AnswerPreCheckoutQueryRequest) TypeName() string {
return "answerPreCheckoutQuery"
}
// TypeInfo returns info about TL type.
func (a *AnswerPreCheckoutQueryRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "answerPreCheckoutQuery",
ID: AnswerPreCheckoutQueryRequestTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "PreCheckoutQueryID",
SchemaName: "pre_checkout_query_id",
},
{
Name: "ErrorMessage",
SchemaName: "error_message",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AnswerPreCheckoutQueryRequest) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode answerPreCheckoutQuery#a76163eb as nil")
}
b.PutID(AnswerPreCheckoutQueryRequestTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AnswerPreCheckoutQueryRequest) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode answerPreCheckoutQuery#a76163eb as nil")
}
b.PutLong(a.PreCheckoutQueryID)
b.PutString(a.ErrorMessage)
return nil
}
// Decode implements bin.Decoder.
func (a *AnswerPreCheckoutQueryRequest) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode answerPreCheckoutQuery#a76163eb to nil")
}
if err := b.ConsumeID(AnswerPreCheckoutQueryRequestTypeID); err != nil {
return fmt.Errorf("unable to decode answerPreCheckoutQuery#a76163eb: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AnswerPreCheckoutQueryRequest) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode answerPreCheckoutQuery#a76163eb to nil")
}
{
value, err := b.Long()
if err != nil {
return fmt.Errorf("unable to decode answerPreCheckoutQuery#a76163eb: field pre_checkout_query_id: %w", err)
}
a.PreCheckoutQueryID = value
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode answerPreCheckoutQuery#a76163eb: field error_message: %w", err)
}
a.ErrorMessage = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AnswerPreCheckoutQueryRequest) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode answerPreCheckoutQuery#a76163eb as nil")
}
b.ObjStart()
b.PutID("answerPreCheckoutQuery")
b.Comma()
b.FieldStart("pre_checkout_query_id")
b.PutLong(a.PreCheckoutQueryID)
b.Comma()
b.FieldStart("error_message")
b.PutString(a.ErrorMessage)
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AnswerPreCheckoutQueryRequest) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode answerPreCheckoutQuery#a76163eb to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("answerPreCheckoutQuery"); err != nil {
return fmt.Errorf("unable to decode answerPreCheckoutQuery#a76163eb: %w", err)
}
case "pre_checkout_query_id":
value, err := b.Long()
if err != nil {
return fmt.Errorf("unable to decode answerPreCheckoutQuery#a76163eb: field pre_checkout_query_id: %w", err)
}
a.PreCheckoutQueryID = value
case "error_message":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode answerPreCheckoutQuery#a76163eb: field error_message: %w", err)
}
a.ErrorMessage = value
default:
return b.Skip()
}
return nil
})
}
// GetPreCheckoutQueryID returns value of PreCheckoutQueryID field.
func (a *AnswerPreCheckoutQueryRequest) GetPreCheckoutQueryID() (value int64) {
if a == nil {
return
}
return a.PreCheckoutQueryID
}
// GetErrorMessage returns value of ErrorMessage field.
func (a *AnswerPreCheckoutQueryRequest) GetErrorMessage() (value string) {
if a == nil {
return
}
return a.ErrorMessage
}
// AnswerPreCheckoutQuery invokes method answerPreCheckoutQuery#a76163eb returning error if any.
func (c *Client) AnswerPreCheckoutQuery(ctx context.Context, request *AnswerPreCheckoutQueryRequest) error {
var ok Ok
if err := c.rpc.Invoke(ctx, request, &ok); err != nil {
return err
}
return nil
}
-299
View File
@@ -1,299 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AnswerShippingQueryRequest represents TL type `answerShippingQuery#7a3c2432`.
type AnswerShippingQueryRequest struct {
// Identifier of the shipping query
ShippingQueryID int64
// Available shipping options
ShippingOptions []ShippingOption
// An error message, empty on success
ErrorMessage string
}
// AnswerShippingQueryRequestTypeID is TL type id of AnswerShippingQueryRequest.
const AnswerShippingQueryRequestTypeID = 0x7a3c2432
// Ensuring interfaces in compile-time for AnswerShippingQueryRequest.
var (
_ bin.Encoder = &AnswerShippingQueryRequest{}
_ bin.Decoder = &AnswerShippingQueryRequest{}
_ bin.BareEncoder = &AnswerShippingQueryRequest{}
_ bin.BareDecoder = &AnswerShippingQueryRequest{}
)
func (a *AnswerShippingQueryRequest) Zero() bool {
if a == nil {
return true
}
if !(a.ShippingQueryID == 0) {
return false
}
if !(a.ShippingOptions == nil) {
return false
}
if !(a.ErrorMessage == "") {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AnswerShippingQueryRequest) String() string {
if a == nil {
return "AnswerShippingQueryRequest(nil)"
}
type Alias AnswerShippingQueryRequest
return fmt.Sprintf("AnswerShippingQueryRequest%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AnswerShippingQueryRequest) TypeID() uint32 {
return AnswerShippingQueryRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*AnswerShippingQueryRequest) TypeName() string {
return "answerShippingQuery"
}
// TypeInfo returns info about TL type.
func (a *AnswerShippingQueryRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "answerShippingQuery",
ID: AnswerShippingQueryRequestTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "ShippingQueryID",
SchemaName: "shipping_query_id",
},
{
Name: "ShippingOptions",
SchemaName: "shipping_options",
},
{
Name: "ErrorMessage",
SchemaName: "error_message",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AnswerShippingQueryRequest) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode answerShippingQuery#7a3c2432 as nil")
}
b.PutID(AnswerShippingQueryRequestTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AnswerShippingQueryRequest) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode answerShippingQuery#7a3c2432 as nil")
}
b.PutLong(a.ShippingQueryID)
b.PutInt(len(a.ShippingOptions))
for idx, v := range a.ShippingOptions {
if err := v.EncodeBare(b); err != nil {
return fmt.Errorf("unable to encode bare answerShippingQuery#7a3c2432: field shipping_options element with index %d: %w", idx, err)
}
}
b.PutString(a.ErrorMessage)
return nil
}
// Decode implements bin.Decoder.
func (a *AnswerShippingQueryRequest) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode answerShippingQuery#7a3c2432 to nil")
}
if err := b.ConsumeID(AnswerShippingQueryRequestTypeID); err != nil {
return fmt.Errorf("unable to decode answerShippingQuery#7a3c2432: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AnswerShippingQueryRequest) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode answerShippingQuery#7a3c2432 to nil")
}
{
value, err := b.Long()
if err != nil {
return fmt.Errorf("unable to decode answerShippingQuery#7a3c2432: field shipping_query_id: %w", err)
}
a.ShippingQueryID = value
}
{
headerLen, err := b.Int()
if err != nil {
return fmt.Errorf("unable to decode answerShippingQuery#7a3c2432: field shipping_options: %w", err)
}
if headerLen > 0 {
a.ShippingOptions = make([]ShippingOption, 0, headerLen%bin.PreallocateLimit)
}
for idx := 0; idx < headerLen; idx++ {
var value ShippingOption
if err := value.DecodeBare(b); err != nil {
return fmt.Errorf("unable to decode bare answerShippingQuery#7a3c2432: field shipping_options: %w", err)
}
a.ShippingOptions = append(a.ShippingOptions, value)
}
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode answerShippingQuery#7a3c2432: field error_message: %w", err)
}
a.ErrorMessage = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AnswerShippingQueryRequest) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode answerShippingQuery#7a3c2432 as nil")
}
b.ObjStart()
b.PutID("answerShippingQuery")
b.Comma()
b.FieldStart("shipping_query_id")
b.PutLong(a.ShippingQueryID)
b.Comma()
b.FieldStart("shipping_options")
b.ArrStart()
for idx, v := range a.ShippingOptions {
if err := v.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode answerShippingQuery#7a3c2432: field shipping_options element with index %d: %w", idx, err)
}
b.Comma()
}
b.StripComma()
b.ArrEnd()
b.Comma()
b.FieldStart("error_message")
b.PutString(a.ErrorMessage)
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AnswerShippingQueryRequest) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode answerShippingQuery#7a3c2432 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("answerShippingQuery"); err != nil {
return fmt.Errorf("unable to decode answerShippingQuery#7a3c2432: %w", err)
}
case "shipping_query_id":
value, err := b.Long()
if err != nil {
return fmt.Errorf("unable to decode answerShippingQuery#7a3c2432: field shipping_query_id: %w", err)
}
a.ShippingQueryID = value
case "shipping_options":
if err := b.Arr(func(b tdjson.Decoder) error {
var value ShippingOption
if err := value.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode answerShippingQuery#7a3c2432: field shipping_options: %w", err)
}
a.ShippingOptions = append(a.ShippingOptions, value)
return nil
}); err != nil {
return fmt.Errorf("unable to decode answerShippingQuery#7a3c2432: field shipping_options: %w", err)
}
case "error_message":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode answerShippingQuery#7a3c2432: field error_message: %w", err)
}
a.ErrorMessage = value
default:
return b.Skip()
}
return nil
})
}
// GetShippingQueryID returns value of ShippingQueryID field.
func (a *AnswerShippingQueryRequest) GetShippingQueryID() (value int64) {
if a == nil {
return
}
return a.ShippingQueryID
}
// GetShippingOptions returns value of ShippingOptions field.
func (a *AnswerShippingQueryRequest) GetShippingOptions() (value []ShippingOption) {
if a == nil {
return
}
return a.ShippingOptions
}
// GetErrorMessage returns value of ErrorMessage field.
func (a *AnswerShippingQueryRequest) GetErrorMessage() (value string) {
if a == nil {
return
}
return a.ErrorMessage
}
// AnswerShippingQuery invokes method answerShippingQuery#7a3c2432 returning error if any.
func (c *Client) AnswerShippingQuery(ctx context.Context, request *AnswerShippingQueryRequest) error {
var ok Ok
if err := c.rpc.Invoke(ctx, request, &ok); err != nil {
return err
}
return nil
}
-247
View File
@@ -1,247 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AnswerWebAppQueryRequest represents TL type `answerWebAppQuery#a0b49cf1`.
type AnswerWebAppQueryRequest struct {
// Identifier of the Web App query
WebAppQueryID string
// The result of the query
Result InputInlineQueryResultClass
}
// AnswerWebAppQueryRequestTypeID is TL type id of AnswerWebAppQueryRequest.
const AnswerWebAppQueryRequestTypeID = 0xa0b49cf1
// Ensuring interfaces in compile-time for AnswerWebAppQueryRequest.
var (
_ bin.Encoder = &AnswerWebAppQueryRequest{}
_ bin.Decoder = &AnswerWebAppQueryRequest{}
_ bin.BareEncoder = &AnswerWebAppQueryRequest{}
_ bin.BareDecoder = &AnswerWebAppQueryRequest{}
)
func (a *AnswerWebAppQueryRequest) Zero() bool {
if a == nil {
return true
}
if !(a.WebAppQueryID == "") {
return false
}
if !(a.Result == nil) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AnswerWebAppQueryRequest) String() string {
if a == nil {
return "AnswerWebAppQueryRequest(nil)"
}
type Alias AnswerWebAppQueryRequest
return fmt.Sprintf("AnswerWebAppQueryRequest%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AnswerWebAppQueryRequest) TypeID() uint32 {
return AnswerWebAppQueryRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*AnswerWebAppQueryRequest) TypeName() string {
return "answerWebAppQuery"
}
// TypeInfo returns info about TL type.
func (a *AnswerWebAppQueryRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "answerWebAppQuery",
ID: AnswerWebAppQueryRequestTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "WebAppQueryID",
SchemaName: "web_app_query_id",
},
{
Name: "Result",
SchemaName: "result",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AnswerWebAppQueryRequest) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode answerWebAppQuery#a0b49cf1 as nil")
}
b.PutID(AnswerWebAppQueryRequestTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AnswerWebAppQueryRequest) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode answerWebAppQuery#a0b49cf1 as nil")
}
b.PutString(a.WebAppQueryID)
if a.Result == nil {
return fmt.Errorf("unable to encode answerWebAppQuery#a0b49cf1: field result is nil")
}
if err := a.Result.Encode(b); err != nil {
return fmt.Errorf("unable to encode answerWebAppQuery#a0b49cf1: field result: %w", err)
}
return nil
}
// Decode implements bin.Decoder.
func (a *AnswerWebAppQueryRequest) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode answerWebAppQuery#a0b49cf1 to nil")
}
if err := b.ConsumeID(AnswerWebAppQueryRequestTypeID); err != nil {
return fmt.Errorf("unable to decode answerWebAppQuery#a0b49cf1: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AnswerWebAppQueryRequest) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode answerWebAppQuery#a0b49cf1 to nil")
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode answerWebAppQuery#a0b49cf1: field web_app_query_id: %w", err)
}
a.WebAppQueryID = value
}
{
value, err := DecodeInputInlineQueryResult(b)
if err != nil {
return fmt.Errorf("unable to decode answerWebAppQuery#a0b49cf1: field result: %w", err)
}
a.Result = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AnswerWebAppQueryRequest) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode answerWebAppQuery#a0b49cf1 as nil")
}
b.ObjStart()
b.PutID("answerWebAppQuery")
b.Comma()
b.FieldStart("web_app_query_id")
b.PutString(a.WebAppQueryID)
b.Comma()
b.FieldStart("result")
if a.Result == nil {
return fmt.Errorf("unable to encode answerWebAppQuery#a0b49cf1: field result is nil")
}
if err := a.Result.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode answerWebAppQuery#a0b49cf1: field result: %w", err)
}
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AnswerWebAppQueryRequest) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode answerWebAppQuery#a0b49cf1 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("answerWebAppQuery"); err != nil {
return fmt.Errorf("unable to decode answerWebAppQuery#a0b49cf1: %w", err)
}
case "web_app_query_id":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode answerWebAppQuery#a0b49cf1: field web_app_query_id: %w", err)
}
a.WebAppQueryID = value
case "result":
value, err := DecodeTDLibJSONInputInlineQueryResult(b)
if err != nil {
return fmt.Errorf("unable to decode answerWebAppQuery#a0b49cf1: field result: %w", err)
}
a.Result = value
default:
return b.Skip()
}
return nil
})
}
// GetWebAppQueryID returns value of WebAppQueryID field.
func (a *AnswerWebAppQueryRequest) GetWebAppQueryID() (value string) {
if a == nil {
return
}
return a.WebAppQueryID
}
// GetResult returns value of Result field.
func (a *AnswerWebAppQueryRequest) GetResult() (value InputInlineQueryResultClass) {
if a == nil {
return
}
return a.Result
}
// AnswerWebAppQuery invokes method answerWebAppQuery#a0b49cf1 returning error if any.
func (c *Client) AnswerWebAppQuery(ctx context.Context, request *AnswerWebAppQueryRequest) (*SentWebAppMessage, error) {
var result SentWebAppMessage
if err := c.rpc.Invoke(ctx, request, &result); err != nil {
return nil, err
}
return &result, nil
}
-206
View File
@@ -1,206 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// ApplyPremiumGiftCodeRequest represents TL type `applyPremiumGiftCode#afb44c1e`.
type ApplyPremiumGiftCodeRequest struct {
// The code to apply
Code string
}
// ApplyPremiumGiftCodeRequestTypeID is TL type id of ApplyPremiumGiftCodeRequest.
const ApplyPremiumGiftCodeRequestTypeID = 0xafb44c1e
// Ensuring interfaces in compile-time for ApplyPremiumGiftCodeRequest.
var (
_ bin.Encoder = &ApplyPremiumGiftCodeRequest{}
_ bin.Decoder = &ApplyPremiumGiftCodeRequest{}
_ bin.BareEncoder = &ApplyPremiumGiftCodeRequest{}
_ bin.BareDecoder = &ApplyPremiumGiftCodeRequest{}
)
func (a *ApplyPremiumGiftCodeRequest) Zero() bool {
if a == nil {
return true
}
if !(a.Code == "") {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *ApplyPremiumGiftCodeRequest) String() string {
if a == nil {
return "ApplyPremiumGiftCodeRequest(nil)"
}
type Alias ApplyPremiumGiftCodeRequest
return fmt.Sprintf("ApplyPremiumGiftCodeRequest%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*ApplyPremiumGiftCodeRequest) TypeID() uint32 {
return ApplyPremiumGiftCodeRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*ApplyPremiumGiftCodeRequest) TypeName() string {
return "applyPremiumGiftCode"
}
// TypeInfo returns info about TL type.
func (a *ApplyPremiumGiftCodeRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "applyPremiumGiftCode",
ID: ApplyPremiumGiftCodeRequestTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "Code",
SchemaName: "code",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *ApplyPremiumGiftCodeRequest) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode applyPremiumGiftCode#afb44c1e as nil")
}
b.PutID(ApplyPremiumGiftCodeRequestTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *ApplyPremiumGiftCodeRequest) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode applyPremiumGiftCode#afb44c1e as nil")
}
b.PutString(a.Code)
return nil
}
// Decode implements bin.Decoder.
func (a *ApplyPremiumGiftCodeRequest) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode applyPremiumGiftCode#afb44c1e to nil")
}
if err := b.ConsumeID(ApplyPremiumGiftCodeRequestTypeID); err != nil {
return fmt.Errorf("unable to decode applyPremiumGiftCode#afb44c1e: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *ApplyPremiumGiftCodeRequest) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode applyPremiumGiftCode#afb44c1e to nil")
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode applyPremiumGiftCode#afb44c1e: field code: %w", err)
}
a.Code = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *ApplyPremiumGiftCodeRequest) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode applyPremiumGiftCode#afb44c1e as nil")
}
b.ObjStart()
b.PutID("applyPremiumGiftCode")
b.Comma()
b.FieldStart("code")
b.PutString(a.Code)
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *ApplyPremiumGiftCodeRequest) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode applyPremiumGiftCode#afb44c1e to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("applyPremiumGiftCode"); err != nil {
return fmt.Errorf("unable to decode applyPremiumGiftCode#afb44c1e: %w", err)
}
case "code":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode applyPremiumGiftCode#afb44c1e: field code: %w", err)
}
a.Code = value
default:
return b.Skip()
}
return nil
})
}
// GetCode returns value of Code field.
func (a *ApplyPremiumGiftCodeRequest) GetCode() (value string) {
if a == nil {
return
}
return a.Code
}
// ApplyPremiumGiftCode invokes method applyPremiumGiftCode#afb44c1e returning error if any.
func (c *Client) ApplyPremiumGiftCode(ctx context.Context, code string) error {
var ok Ok
request := &ApplyPremiumGiftCodeRequest{
Code: code,
}
if err := c.rpc.Invoke(ctx, request, &ok); err != nil {
return err
}
return nil
}
-266
View File
@@ -1,266 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// ArchiveChatListSettings represents TL type `archiveChatListSettings#3f176aa4`.
type ArchiveChatListSettings struct {
// True, if new chats from non-contacts will be automatically archived and muted. Can be
// set to true only if the option "can_archive_and_mute_new_chats_from_unknown_users" is
// true
ArchiveAndMuteNewChatsFromUnknownUsers bool
// True, if unmuted chats will be kept in the Archive chat list when they get a new
// message
KeepUnmutedChatsArchived bool
// True, if unmuted chats, that are always included or pinned in a folder, will be kept
// in the Archive chat list when they get a new message. Ignored if
// keep_unmuted_chats_archived == true
KeepChatsFromFoldersArchived bool
}
// ArchiveChatListSettingsTypeID is TL type id of ArchiveChatListSettings.
const ArchiveChatListSettingsTypeID = 0x3f176aa4
// Ensuring interfaces in compile-time for ArchiveChatListSettings.
var (
_ bin.Encoder = &ArchiveChatListSettings{}
_ bin.Decoder = &ArchiveChatListSettings{}
_ bin.BareEncoder = &ArchiveChatListSettings{}
_ bin.BareDecoder = &ArchiveChatListSettings{}
)
func (a *ArchiveChatListSettings) Zero() bool {
if a == nil {
return true
}
if !(a.ArchiveAndMuteNewChatsFromUnknownUsers == false) {
return false
}
if !(a.KeepUnmutedChatsArchived == false) {
return false
}
if !(a.KeepChatsFromFoldersArchived == false) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *ArchiveChatListSettings) String() string {
if a == nil {
return "ArchiveChatListSettings(nil)"
}
type Alias ArchiveChatListSettings
return fmt.Sprintf("ArchiveChatListSettings%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*ArchiveChatListSettings) TypeID() uint32 {
return ArchiveChatListSettingsTypeID
}
// TypeName returns name of type in TL schema.
func (*ArchiveChatListSettings) TypeName() string {
return "archiveChatListSettings"
}
// TypeInfo returns info about TL type.
func (a *ArchiveChatListSettings) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "archiveChatListSettings",
ID: ArchiveChatListSettingsTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "ArchiveAndMuteNewChatsFromUnknownUsers",
SchemaName: "archive_and_mute_new_chats_from_unknown_users",
},
{
Name: "KeepUnmutedChatsArchived",
SchemaName: "keep_unmuted_chats_archived",
},
{
Name: "KeepChatsFromFoldersArchived",
SchemaName: "keep_chats_from_folders_archived",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *ArchiveChatListSettings) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode archiveChatListSettings#3f176aa4 as nil")
}
b.PutID(ArchiveChatListSettingsTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *ArchiveChatListSettings) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode archiveChatListSettings#3f176aa4 as nil")
}
b.PutBool(a.ArchiveAndMuteNewChatsFromUnknownUsers)
b.PutBool(a.KeepUnmutedChatsArchived)
b.PutBool(a.KeepChatsFromFoldersArchived)
return nil
}
// Decode implements bin.Decoder.
func (a *ArchiveChatListSettings) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode archiveChatListSettings#3f176aa4 to nil")
}
if err := b.ConsumeID(ArchiveChatListSettingsTypeID); err != nil {
return fmt.Errorf("unable to decode archiveChatListSettings#3f176aa4: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *ArchiveChatListSettings) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode archiveChatListSettings#3f176aa4 to nil")
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode archiveChatListSettings#3f176aa4: field archive_and_mute_new_chats_from_unknown_users: %w", err)
}
a.ArchiveAndMuteNewChatsFromUnknownUsers = value
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode archiveChatListSettings#3f176aa4: field keep_unmuted_chats_archived: %w", err)
}
a.KeepUnmutedChatsArchived = value
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode archiveChatListSettings#3f176aa4: field keep_chats_from_folders_archived: %w", err)
}
a.KeepChatsFromFoldersArchived = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *ArchiveChatListSettings) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode archiveChatListSettings#3f176aa4 as nil")
}
b.ObjStart()
b.PutID("archiveChatListSettings")
b.Comma()
b.FieldStart("archive_and_mute_new_chats_from_unknown_users")
b.PutBool(a.ArchiveAndMuteNewChatsFromUnknownUsers)
b.Comma()
b.FieldStart("keep_unmuted_chats_archived")
b.PutBool(a.KeepUnmutedChatsArchived)
b.Comma()
b.FieldStart("keep_chats_from_folders_archived")
b.PutBool(a.KeepChatsFromFoldersArchived)
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *ArchiveChatListSettings) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode archiveChatListSettings#3f176aa4 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("archiveChatListSettings"); err != nil {
return fmt.Errorf("unable to decode archiveChatListSettings#3f176aa4: %w", err)
}
case "archive_and_mute_new_chats_from_unknown_users":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode archiveChatListSettings#3f176aa4: field archive_and_mute_new_chats_from_unknown_users: %w", err)
}
a.ArchiveAndMuteNewChatsFromUnknownUsers = value
case "keep_unmuted_chats_archived":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode archiveChatListSettings#3f176aa4: field keep_unmuted_chats_archived: %w", err)
}
a.KeepUnmutedChatsArchived = value
case "keep_chats_from_folders_archived":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode archiveChatListSettings#3f176aa4: field keep_chats_from_folders_archived: %w", err)
}
a.KeepChatsFromFoldersArchived = value
default:
return b.Skip()
}
return nil
})
}
// GetArchiveAndMuteNewChatsFromUnknownUsers returns value of ArchiveAndMuteNewChatsFromUnknownUsers field.
func (a *ArchiveChatListSettings) GetArchiveAndMuteNewChatsFromUnknownUsers() (value bool) {
if a == nil {
return
}
return a.ArchiveAndMuteNewChatsFromUnknownUsers
}
// GetKeepUnmutedChatsArchived returns value of KeepUnmutedChatsArchived field.
func (a *ArchiveChatListSettings) GetKeepUnmutedChatsArchived() (value bool) {
if a == nil {
return
}
return a.KeepUnmutedChatsArchived
}
// GetKeepChatsFromFoldersArchived returns value of KeepChatsFromFoldersArchived field.
func (a *ArchiveChatListSettings) GetKeepChatsFromFoldersArchived() (value bool) {
if a == nil {
return
}
return a.KeepChatsFromFoldersArchived
}
-257
View File
@@ -1,257 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AssignStoreTransactionRequest represents TL type `assignStoreTransaction#86096bec`.
type AssignStoreTransactionRequest struct {
// Information about the transaction
Transaction StoreTransactionClass
// Transaction purpose
Purpose StorePaymentPurposeClass
}
// AssignStoreTransactionRequestTypeID is TL type id of AssignStoreTransactionRequest.
const AssignStoreTransactionRequestTypeID = 0x86096bec
// Ensuring interfaces in compile-time for AssignStoreTransactionRequest.
var (
_ bin.Encoder = &AssignStoreTransactionRequest{}
_ bin.Decoder = &AssignStoreTransactionRequest{}
_ bin.BareEncoder = &AssignStoreTransactionRequest{}
_ bin.BareDecoder = &AssignStoreTransactionRequest{}
)
func (a *AssignStoreTransactionRequest) Zero() bool {
if a == nil {
return true
}
if !(a.Transaction == nil) {
return false
}
if !(a.Purpose == nil) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AssignStoreTransactionRequest) String() string {
if a == nil {
return "AssignStoreTransactionRequest(nil)"
}
type Alias AssignStoreTransactionRequest
return fmt.Sprintf("AssignStoreTransactionRequest%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AssignStoreTransactionRequest) TypeID() uint32 {
return AssignStoreTransactionRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*AssignStoreTransactionRequest) TypeName() string {
return "assignStoreTransaction"
}
// TypeInfo returns info about TL type.
func (a *AssignStoreTransactionRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "assignStoreTransaction",
ID: AssignStoreTransactionRequestTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "Transaction",
SchemaName: "transaction",
},
{
Name: "Purpose",
SchemaName: "purpose",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AssignStoreTransactionRequest) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode assignStoreTransaction#86096bec as nil")
}
b.PutID(AssignStoreTransactionRequestTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AssignStoreTransactionRequest) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode assignStoreTransaction#86096bec as nil")
}
if a.Transaction == nil {
return fmt.Errorf("unable to encode assignStoreTransaction#86096bec: field transaction is nil")
}
if err := a.Transaction.Encode(b); err != nil {
return fmt.Errorf("unable to encode assignStoreTransaction#86096bec: field transaction: %w", err)
}
if a.Purpose == nil {
return fmt.Errorf("unable to encode assignStoreTransaction#86096bec: field purpose is nil")
}
if err := a.Purpose.Encode(b); err != nil {
return fmt.Errorf("unable to encode assignStoreTransaction#86096bec: field purpose: %w", err)
}
return nil
}
// Decode implements bin.Decoder.
func (a *AssignStoreTransactionRequest) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode assignStoreTransaction#86096bec to nil")
}
if err := b.ConsumeID(AssignStoreTransactionRequestTypeID); err != nil {
return fmt.Errorf("unable to decode assignStoreTransaction#86096bec: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AssignStoreTransactionRequest) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode assignStoreTransaction#86096bec to nil")
}
{
value, err := DecodeStoreTransaction(b)
if err != nil {
return fmt.Errorf("unable to decode assignStoreTransaction#86096bec: field transaction: %w", err)
}
a.Transaction = value
}
{
value, err := DecodeStorePaymentPurpose(b)
if err != nil {
return fmt.Errorf("unable to decode assignStoreTransaction#86096bec: field purpose: %w", err)
}
a.Purpose = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AssignStoreTransactionRequest) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode assignStoreTransaction#86096bec as nil")
}
b.ObjStart()
b.PutID("assignStoreTransaction")
b.Comma()
b.FieldStart("transaction")
if a.Transaction == nil {
return fmt.Errorf("unable to encode assignStoreTransaction#86096bec: field transaction is nil")
}
if err := a.Transaction.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode assignStoreTransaction#86096bec: field transaction: %w", err)
}
b.Comma()
b.FieldStart("purpose")
if a.Purpose == nil {
return fmt.Errorf("unable to encode assignStoreTransaction#86096bec: field purpose is nil")
}
if err := a.Purpose.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode assignStoreTransaction#86096bec: field purpose: %w", err)
}
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AssignStoreTransactionRequest) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode assignStoreTransaction#86096bec to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("assignStoreTransaction"); err != nil {
return fmt.Errorf("unable to decode assignStoreTransaction#86096bec: %w", err)
}
case "transaction":
value, err := DecodeTDLibJSONStoreTransaction(b)
if err != nil {
return fmt.Errorf("unable to decode assignStoreTransaction#86096bec: field transaction: %w", err)
}
a.Transaction = value
case "purpose":
value, err := DecodeTDLibJSONStorePaymentPurpose(b)
if err != nil {
return fmt.Errorf("unable to decode assignStoreTransaction#86096bec: field purpose: %w", err)
}
a.Purpose = value
default:
return b.Skip()
}
return nil
})
}
// GetTransaction returns value of Transaction field.
func (a *AssignStoreTransactionRequest) GetTransaction() (value StoreTransactionClass) {
if a == nil {
return
}
return a.Transaction
}
// GetPurpose returns value of Purpose field.
func (a *AssignStoreTransactionRequest) GetPurpose() (value StorePaymentPurposeClass) {
if a == nil {
return
}
return a.Purpose
}
// AssignStoreTransaction invokes method assignStoreTransaction#86096bec returning error if any.
func (c *Client) AssignStoreTransaction(ctx context.Context, request *AssignStoreTransactionRequest) error {
var ok Ok
if err := c.rpc.Invoke(ctx, request, &ok); err != nil {
return err
}
return nil
}
-227
View File
@@ -1,227 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AttachmentMenuBotColor represents TL type `attachmentMenuBotColor#64235ebc`.
type AttachmentMenuBotColor struct {
// Color in the RGB format for light themes
LightColor int32
// Color in the RGB format for dark themes
DarkColor int32
}
// AttachmentMenuBotColorTypeID is TL type id of AttachmentMenuBotColor.
const AttachmentMenuBotColorTypeID = 0x64235ebc
// Ensuring interfaces in compile-time for AttachmentMenuBotColor.
var (
_ bin.Encoder = &AttachmentMenuBotColor{}
_ bin.Decoder = &AttachmentMenuBotColor{}
_ bin.BareEncoder = &AttachmentMenuBotColor{}
_ bin.BareDecoder = &AttachmentMenuBotColor{}
)
func (a *AttachmentMenuBotColor) Zero() bool {
if a == nil {
return true
}
if !(a.LightColor == 0) {
return false
}
if !(a.DarkColor == 0) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AttachmentMenuBotColor) String() string {
if a == nil {
return "AttachmentMenuBotColor(nil)"
}
type Alias AttachmentMenuBotColor
return fmt.Sprintf("AttachmentMenuBotColor%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AttachmentMenuBotColor) TypeID() uint32 {
return AttachmentMenuBotColorTypeID
}
// TypeName returns name of type in TL schema.
func (*AttachmentMenuBotColor) TypeName() string {
return "attachmentMenuBotColor"
}
// TypeInfo returns info about TL type.
func (a *AttachmentMenuBotColor) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "attachmentMenuBotColor",
ID: AttachmentMenuBotColorTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "LightColor",
SchemaName: "light_color",
},
{
Name: "DarkColor",
SchemaName: "dark_color",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AttachmentMenuBotColor) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode attachmentMenuBotColor#64235ebc as nil")
}
b.PutID(AttachmentMenuBotColorTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AttachmentMenuBotColor) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode attachmentMenuBotColor#64235ebc as nil")
}
b.PutInt32(a.LightColor)
b.PutInt32(a.DarkColor)
return nil
}
// Decode implements bin.Decoder.
func (a *AttachmentMenuBotColor) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode attachmentMenuBotColor#64235ebc to nil")
}
if err := b.ConsumeID(AttachmentMenuBotColorTypeID); err != nil {
return fmt.Errorf("unable to decode attachmentMenuBotColor#64235ebc: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AttachmentMenuBotColor) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode attachmentMenuBotColor#64235ebc to nil")
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode attachmentMenuBotColor#64235ebc: field light_color: %w", err)
}
a.LightColor = value
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode attachmentMenuBotColor#64235ebc: field dark_color: %w", err)
}
a.DarkColor = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AttachmentMenuBotColor) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode attachmentMenuBotColor#64235ebc as nil")
}
b.ObjStart()
b.PutID("attachmentMenuBotColor")
b.Comma()
b.FieldStart("light_color")
b.PutInt32(a.LightColor)
b.Comma()
b.FieldStart("dark_color")
b.PutInt32(a.DarkColor)
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AttachmentMenuBotColor) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode attachmentMenuBotColor#64235ebc to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("attachmentMenuBotColor"); err != nil {
return fmt.Errorf("unable to decode attachmentMenuBotColor#64235ebc: %w", err)
}
case "light_color":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode attachmentMenuBotColor#64235ebc: field light_color: %w", err)
}
a.LightColor = value
case "dark_color":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode attachmentMenuBotColor#64235ebc: field dark_color: %w", err)
}
a.DarkColor = value
default:
return b.Skip()
}
return nil
})
}
// GetLightColor returns value of LightColor field.
func (a *AttachmentMenuBotColor) GetLightColor() (value int32) {
if a == nil {
return
}
return a.LightColor
}
// GetDarkColor returns value of DarkColor field.
func (a *AttachmentMenuBotColor) GetDarkColor() (value int32) {
if a == nil {
return
}
return a.DarkColor
}
-946
View File
@@ -1,946 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AttachmentMenuBot represents TL type `attachmentMenuBot#b96e1bbf`.
type AttachmentMenuBot struct {
// User identifier of the bot
BotUserID int64
// True, if the bot supports opening from attachment menu in the chat with the bot
SupportsSelfChat bool
// True, if the bot supports opening from attachment menu in private chats with ordinary
// users
SupportsUserChats bool
// True, if the bot supports opening from attachment menu in private chats with other
// bots
SupportsBotChats bool
// True, if the bot supports opening from attachment menu in basic group and supergroup
// chats
SupportsGroupChats bool
// True, if the bot supports opening from attachment menu in channel chats
SupportsChannelChats bool
// True, if the user must be asked for the permission to send messages to the bot
RequestWriteAccess bool
// True, if the bot was explicitly added by the user. If the bot isn't added, then on the
// first bot launch toggleBotIsAddedToAttachmentMenu must be called and the bot must be
// added or removed
IsAdded bool
// True, if the bot must be shown in the attachment menu
ShowInAttachmentMenu bool
// True, if the bot must be shown in the side menu
ShowInSideMenu bool
// True, if a disclaimer, why the bot is shown in the side menu, is needed
ShowDisclaimerInSideMenu bool
// Name for the bot in attachment menu
Name string
// Color to highlight selected name of the bot if appropriate; may be null
NameColor AttachmentMenuBotColor
// Default icon for the bot in SVG format; may be null
DefaultIcon File
// Icon for the bot in SVG format for the official iOS app; may be null
IosStaticIcon File
// Icon for the bot in TGS format for the official iOS app; may be null
IosAnimatedIcon File
// Icon for the bot in PNG format for the official iOS app side menu; may be null
IosSideMenuIcon File
// Icon for the bot in TGS format for the official Android app; may be null
AndroidIcon File
// Icon for the bot in SVG format for the official Android app side menu; may be null
AndroidSideMenuIcon File
// Icon for the bot in TGS format for the official native macOS app; may be null
MacosIcon File
// Icon for the bot in PNG format for the official macOS app side menu; may be null
MacosSideMenuIcon File
// Color to highlight selected icon of the bot if appropriate; may be null
IconColor AttachmentMenuBotColor
// Default placeholder for opened Web Apps in SVG format; may be null
WebAppPlaceholder File
}
// AttachmentMenuBotTypeID is TL type id of AttachmentMenuBot.
const AttachmentMenuBotTypeID = 0xb96e1bbf
// Ensuring interfaces in compile-time for AttachmentMenuBot.
var (
_ bin.Encoder = &AttachmentMenuBot{}
_ bin.Decoder = &AttachmentMenuBot{}
_ bin.BareEncoder = &AttachmentMenuBot{}
_ bin.BareDecoder = &AttachmentMenuBot{}
)
func (a *AttachmentMenuBot) Zero() bool {
if a == nil {
return true
}
if !(a.BotUserID == 0) {
return false
}
if !(a.SupportsSelfChat == false) {
return false
}
if !(a.SupportsUserChats == false) {
return false
}
if !(a.SupportsBotChats == false) {
return false
}
if !(a.SupportsGroupChats == false) {
return false
}
if !(a.SupportsChannelChats == false) {
return false
}
if !(a.RequestWriteAccess == false) {
return false
}
if !(a.IsAdded == false) {
return false
}
if !(a.ShowInAttachmentMenu == false) {
return false
}
if !(a.ShowInSideMenu == false) {
return false
}
if !(a.ShowDisclaimerInSideMenu == false) {
return false
}
if !(a.Name == "") {
return false
}
if !(a.NameColor.Zero()) {
return false
}
if !(a.DefaultIcon.Zero()) {
return false
}
if !(a.IosStaticIcon.Zero()) {
return false
}
if !(a.IosAnimatedIcon.Zero()) {
return false
}
if !(a.IosSideMenuIcon.Zero()) {
return false
}
if !(a.AndroidIcon.Zero()) {
return false
}
if !(a.AndroidSideMenuIcon.Zero()) {
return false
}
if !(a.MacosIcon.Zero()) {
return false
}
if !(a.MacosSideMenuIcon.Zero()) {
return false
}
if !(a.IconColor.Zero()) {
return false
}
if !(a.WebAppPlaceholder.Zero()) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AttachmentMenuBot) String() string {
if a == nil {
return "AttachmentMenuBot(nil)"
}
type Alias AttachmentMenuBot
return fmt.Sprintf("AttachmentMenuBot%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AttachmentMenuBot) TypeID() uint32 {
return AttachmentMenuBotTypeID
}
// TypeName returns name of type in TL schema.
func (*AttachmentMenuBot) TypeName() string {
return "attachmentMenuBot"
}
// TypeInfo returns info about TL type.
func (a *AttachmentMenuBot) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "attachmentMenuBot",
ID: AttachmentMenuBotTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "BotUserID",
SchemaName: "bot_user_id",
},
{
Name: "SupportsSelfChat",
SchemaName: "supports_self_chat",
},
{
Name: "SupportsUserChats",
SchemaName: "supports_user_chats",
},
{
Name: "SupportsBotChats",
SchemaName: "supports_bot_chats",
},
{
Name: "SupportsGroupChats",
SchemaName: "supports_group_chats",
},
{
Name: "SupportsChannelChats",
SchemaName: "supports_channel_chats",
},
{
Name: "RequestWriteAccess",
SchemaName: "request_write_access",
},
{
Name: "IsAdded",
SchemaName: "is_added",
},
{
Name: "ShowInAttachmentMenu",
SchemaName: "show_in_attachment_menu",
},
{
Name: "ShowInSideMenu",
SchemaName: "show_in_side_menu",
},
{
Name: "ShowDisclaimerInSideMenu",
SchemaName: "show_disclaimer_in_side_menu",
},
{
Name: "Name",
SchemaName: "name",
},
{
Name: "NameColor",
SchemaName: "name_color",
},
{
Name: "DefaultIcon",
SchemaName: "default_icon",
},
{
Name: "IosStaticIcon",
SchemaName: "ios_static_icon",
},
{
Name: "IosAnimatedIcon",
SchemaName: "ios_animated_icon",
},
{
Name: "IosSideMenuIcon",
SchemaName: "ios_side_menu_icon",
},
{
Name: "AndroidIcon",
SchemaName: "android_icon",
},
{
Name: "AndroidSideMenuIcon",
SchemaName: "android_side_menu_icon",
},
{
Name: "MacosIcon",
SchemaName: "macos_icon",
},
{
Name: "MacosSideMenuIcon",
SchemaName: "macos_side_menu_icon",
},
{
Name: "IconColor",
SchemaName: "icon_color",
},
{
Name: "WebAppPlaceholder",
SchemaName: "web_app_placeholder",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AttachmentMenuBot) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode attachmentMenuBot#b96e1bbf as nil")
}
b.PutID(AttachmentMenuBotTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AttachmentMenuBot) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode attachmentMenuBot#b96e1bbf as nil")
}
b.PutInt53(a.BotUserID)
b.PutBool(a.SupportsSelfChat)
b.PutBool(a.SupportsUserChats)
b.PutBool(a.SupportsBotChats)
b.PutBool(a.SupportsGroupChats)
b.PutBool(a.SupportsChannelChats)
b.PutBool(a.RequestWriteAccess)
b.PutBool(a.IsAdded)
b.PutBool(a.ShowInAttachmentMenu)
b.PutBool(a.ShowInSideMenu)
b.PutBool(a.ShowDisclaimerInSideMenu)
b.PutString(a.Name)
if err := a.NameColor.Encode(b); err != nil {
return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field name_color: %w", err)
}
if err := a.DefaultIcon.Encode(b); err != nil {
return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field default_icon: %w", err)
}
if err := a.IosStaticIcon.Encode(b); err != nil {
return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field ios_static_icon: %w", err)
}
if err := a.IosAnimatedIcon.Encode(b); err != nil {
return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field ios_animated_icon: %w", err)
}
if err := a.IosSideMenuIcon.Encode(b); err != nil {
return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field ios_side_menu_icon: %w", err)
}
if err := a.AndroidIcon.Encode(b); err != nil {
return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field android_icon: %w", err)
}
if err := a.AndroidSideMenuIcon.Encode(b); err != nil {
return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field android_side_menu_icon: %w", err)
}
if err := a.MacosIcon.Encode(b); err != nil {
return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field macos_icon: %w", err)
}
if err := a.MacosSideMenuIcon.Encode(b); err != nil {
return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field macos_side_menu_icon: %w", err)
}
if err := a.IconColor.Encode(b); err != nil {
return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field icon_color: %w", err)
}
if err := a.WebAppPlaceholder.Encode(b); err != nil {
return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field web_app_placeholder: %w", err)
}
return nil
}
// Decode implements bin.Decoder.
func (a *AttachmentMenuBot) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode attachmentMenuBot#b96e1bbf to nil")
}
if err := b.ConsumeID(AttachmentMenuBotTypeID); err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AttachmentMenuBot) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode attachmentMenuBot#b96e1bbf to nil")
}
{
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field bot_user_id: %w", err)
}
a.BotUserID = value
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field supports_self_chat: %w", err)
}
a.SupportsSelfChat = value
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field supports_user_chats: %w", err)
}
a.SupportsUserChats = value
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field supports_bot_chats: %w", err)
}
a.SupportsBotChats = value
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field supports_group_chats: %w", err)
}
a.SupportsGroupChats = value
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field supports_channel_chats: %w", err)
}
a.SupportsChannelChats = value
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field request_write_access: %w", err)
}
a.RequestWriteAccess = value
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field is_added: %w", err)
}
a.IsAdded = value
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field show_in_attachment_menu: %w", err)
}
a.ShowInAttachmentMenu = value
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field show_in_side_menu: %w", err)
}
a.ShowInSideMenu = value
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field show_disclaimer_in_side_menu: %w", err)
}
a.ShowDisclaimerInSideMenu = value
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field name: %w", err)
}
a.Name = value
}
{
if err := a.NameColor.Decode(b); err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field name_color: %w", err)
}
}
{
if err := a.DefaultIcon.Decode(b); err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field default_icon: %w", err)
}
}
{
if err := a.IosStaticIcon.Decode(b); err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field ios_static_icon: %w", err)
}
}
{
if err := a.IosAnimatedIcon.Decode(b); err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field ios_animated_icon: %w", err)
}
}
{
if err := a.IosSideMenuIcon.Decode(b); err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field ios_side_menu_icon: %w", err)
}
}
{
if err := a.AndroidIcon.Decode(b); err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field android_icon: %w", err)
}
}
{
if err := a.AndroidSideMenuIcon.Decode(b); err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field android_side_menu_icon: %w", err)
}
}
{
if err := a.MacosIcon.Decode(b); err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field macos_icon: %w", err)
}
}
{
if err := a.MacosSideMenuIcon.Decode(b); err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field macos_side_menu_icon: %w", err)
}
}
{
if err := a.IconColor.Decode(b); err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field icon_color: %w", err)
}
}
{
if err := a.WebAppPlaceholder.Decode(b); err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field web_app_placeholder: %w", err)
}
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AttachmentMenuBot) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode attachmentMenuBot#b96e1bbf as nil")
}
b.ObjStart()
b.PutID("attachmentMenuBot")
b.Comma()
b.FieldStart("bot_user_id")
b.PutInt53(a.BotUserID)
b.Comma()
b.FieldStart("supports_self_chat")
b.PutBool(a.SupportsSelfChat)
b.Comma()
b.FieldStart("supports_user_chats")
b.PutBool(a.SupportsUserChats)
b.Comma()
b.FieldStart("supports_bot_chats")
b.PutBool(a.SupportsBotChats)
b.Comma()
b.FieldStart("supports_group_chats")
b.PutBool(a.SupportsGroupChats)
b.Comma()
b.FieldStart("supports_channel_chats")
b.PutBool(a.SupportsChannelChats)
b.Comma()
b.FieldStart("request_write_access")
b.PutBool(a.RequestWriteAccess)
b.Comma()
b.FieldStart("is_added")
b.PutBool(a.IsAdded)
b.Comma()
b.FieldStart("show_in_attachment_menu")
b.PutBool(a.ShowInAttachmentMenu)
b.Comma()
b.FieldStart("show_in_side_menu")
b.PutBool(a.ShowInSideMenu)
b.Comma()
b.FieldStart("show_disclaimer_in_side_menu")
b.PutBool(a.ShowDisclaimerInSideMenu)
b.Comma()
b.FieldStart("name")
b.PutString(a.Name)
b.Comma()
b.FieldStart("name_color")
if err := a.NameColor.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field name_color: %w", err)
}
b.Comma()
b.FieldStart("default_icon")
if err := a.DefaultIcon.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field default_icon: %w", err)
}
b.Comma()
b.FieldStart("ios_static_icon")
if err := a.IosStaticIcon.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field ios_static_icon: %w", err)
}
b.Comma()
b.FieldStart("ios_animated_icon")
if err := a.IosAnimatedIcon.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field ios_animated_icon: %w", err)
}
b.Comma()
b.FieldStart("ios_side_menu_icon")
if err := a.IosSideMenuIcon.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field ios_side_menu_icon: %w", err)
}
b.Comma()
b.FieldStart("android_icon")
if err := a.AndroidIcon.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field android_icon: %w", err)
}
b.Comma()
b.FieldStart("android_side_menu_icon")
if err := a.AndroidSideMenuIcon.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field android_side_menu_icon: %w", err)
}
b.Comma()
b.FieldStart("macos_icon")
if err := a.MacosIcon.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field macos_icon: %w", err)
}
b.Comma()
b.FieldStart("macos_side_menu_icon")
if err := a.MacosSideMenuIcon.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field macos_side_menu_icon: %w", err)
}
b.Comma()
b.FieldStart("icon_color")
if err := a.IconColor.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field icon_color: %w", err)
}
b.Comma()
b.FieldStart("web_app_placeholder")
if err := a.WebAppPlaceholder.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode attachmentMenuBot#b96e1bbf: field web_app_placeholder: %w", err)
}
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AttachmentMenuBot) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode attachmentMenuBot#b96e1bbf to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("attachmentMenuBot"); err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: %w", err)
}
case "bot_user_id":
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field bot_user_id: %w", err)
}
a.BotUserID = value
case "supports_self_chat":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field supports_self_chat: %w", err)
}
a.SupportsSelfChat = value
case "supports_user_chats":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field supports_user_chats: %w", err)
}
a.SupportsUserChats = value
case "supports_bot_chats":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field supports_bot_chats: %w", err)
}
a.SupportsBotChats = value
case "supports_group_chats":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field supports_group_chats: %w", err)
}
a.SupportsGroupChats = value
case "supports_channel_chats":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field supports_channel_chats: %w", err)
}
a.SupportsChannelChats = value
case "request_write_access":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field request_write_access: %w", err)
}
a.RequestWriteAccess = value
case "is_added":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field is_added: %w", err)
}
a.IsAdded = value
case "show_in_attachment_menu":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field show_in_attachment_menu: %w", err)
}
a.ShowInAttachmentMenu = value
case "show_in_side_menu":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field show_in_side_menu: %w", err)
}
a.ShowInSideMenu = value
case "show_disclaimer_in_side_menu":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field show_disclaimer_in_side_menu: %w", err)
}
a.ShowDisclaimerInSideMenu = value
case "name":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field name: %w", err)
}
a.Name = value
case "name_color":
if err := a.NameColor.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field name_color: %w", err)
}
case "default_icon":
if err := a.DefaultIcon.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field default_icon: %w", err)
}
case "ios_static_icon":
if err := a.IosStaticIcon.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field ios_static_icon: %w", err)
}
case "ios_animated_icon":
if err := a.IosAnimatedIcon.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field ios_animated_icon: %w", err)
}
case "ios_side_menu_icon":
if err := a.IosSideMenuIcon.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field ios_side_menu_icon: %w", err)
}
case "android_icon":
if err := a.AndroidIcon.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field android_icon: %w", err)
}
case "android_side_menu_icon":
if err := a.AndroidSideMenuIcon.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field android_side_menu_icon: %w", err)
}
case "macos_icon":
if err := a.MacosIcon.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field macos_icon: %w", err)
}
case "macos_side_menu_icon":
if err := a.MacosSideMenuIcon.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field macos_side_menu_icon: %w", err)
}
case "icon_color":
if err := a.IconColor.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field icon_color: %w", err)
}
case "web_app_placeholder":
if err := a.WebAppPlaceholder.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode attachmentMenuBot#b96e1bbf: field web_app_placeholder: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// GetBotUserID returns value of BotUserID field.
func (a *AttachmentMenuBot) GetBotUserID() (value int64) {
if a == nil {
return
}
return a.BotUserID
}
// GetSupportsSelfChat returns value of SupportsSelfChat field.
func (a *AttachmentMenuBot) GetSupportsSelfChat() (value bool) {
if a == nil {
return
}
return a.SupportsSelfChat
}
// GetSupportsUserChats returns value of SupportsUserChats field.
func (a *AttachmentMenuBot) GetSupportsUserChats() (value bool) {
if a == nil {
return
}
return a.SupportsUserChats
}
// GetSupportsBotChats returns value of SupportsBotChats field.
func (a *AttachmentMenuBot) GetSupportsBotChats() (value bool) {
if a == nil {
return
}
return a.SupportsBotChats
}
// GetSupportsGroupChats returns value of SupportsGroupChats field.
func (a *AttachmentMenuBot) GetSupportsGroupChats() (value bool) {
if a == nil {
return
}
return a.SupportsGroupChats
}
// GetSupportsChannelChats returns value of SupportsChannelChats field.
func (a *AttachmentMenuBot) GetSupportsChannelChats() (value bool) {
if a == nil {
return
}
return a.SupportsChannelChats
}
// GetRequestWriteAccess returns value of RequestWriteAccess field.
func (a *AttachmentMenuBot) GetRequestWriteAccess() (value bool) {
if a == nil {
return
}
return a.RequestWriteAccess
}
// GetIsAdded returns value of IsAdded field.
func (a *AttachmentMenuBot) GetIsAdded() (value bool) {
if a == nil {
return
}
return a.IsAdded
}
// GetShowInAttachmentMenu returns value of ShowInAttachmentMenu field.
func (a *AttachmentMenuBot) GetShowInAttachmentMenu() (value bool) {
if a == nil {
return
}
return a.ShowInAttachmentMenu
}
// GetShowInSideMenu returns value of ShowInSideMenu field.
func (a *AttachmentMenuBot) GetShowInSideMenu() (value bool) {
if a == nil {
return
}
return a.ShowInSideMenu
}
// GetShowDisclaimerInSideMenu returns value of ShowDisclaimerInSideMenu field.
func (a *AttachmentMenuBot) GetShowDisclaimerInSideMenu() (value bool) {
if a == nil {
return
}
return a.ShowDisclaimerInSideMenu
}
// GetName returns value of Name field.
func (a *AttachmentMenuBot) GetName() (value string) {
if a == nil {
return
}
return a.Name
}
// GetNameColor returns value of NameColor field.
func (a *AttachmentMenuBot) GetNameColor() (value AttachmentMenuBotColor) {
if a == nil {
return
}
return a.NameColor
}
// GetDefaultIcon returns value of DefaultIcon field.
func (a *AttachmentMenuBot) GetDefaultIcon() (value File) {
if a == nil {
return
}
return a.DefaultIcon
}
// GetIosStaticIcon returns value of IosStaticIcon field.
func (a *AttachmentMenuBot) GetIosStaticIcon() (value File) {
if a == nil {
return
}
return a.IosStaticIcon
}
// GetIosAnimatedIcon returns value of IosAnimatedIcon field.
func (a *AttachmentMenuBot) GetIosAnimatedIcon() (value File) {
if a == nil {
return
}
return a.IosAnimatedIcon
}
// GetIosSideMenuIcon returns value of IosSideMenuIcon field.
func (a *AttachmentMenuBot) GetIosSideMenuIcon() (value File) {
if a == nil {
return
}
return a.IosSideMenuIcon
}
// GetAndroidIcon returns value of AndroidIcon field.
func (a *AttachmentMenuBot) GetAndroidIcon() (value File) {
if a == nil {
return
}
return a.AndroidIcon
}
// GetAndroidSideMenuIcon returns value of AndroidSideMenuIcon field.
func (a *AttachmentMenuBot) GetAndroidSideMenuIcon() (value File) {
if a == nil {
return
}
return a.AndroidSideMenuIcon
}
// GetMacosIcon returns value of MacosIcon field.
func (a *AttachmentMenuBot) GetMacosIcon() (value File) {
if a == nil {
return
}
return a.MacosIcon
}
// GetMacosSideMenuIcon returns value of MacosSideMenuIcon field.
func (a *AttachmentMenuBot) GetMacosSideMenuIcon() (value File) {
if a == nil {
return
}
return a.MacosSideMenuIcon
}
// GetIconColor returns value of IconColor field.
func (a *AttachmentMenuBot) GetIconColor() (value AttachmentMenuBotColor) {
if a == nil {
return
}
return a.IconColor
}
// GetWebAppPlaceholder returns value of WebAppPlaceholder field.
func (a *AttachmentMenuBot) GetWebAppPlaceholder() (value File) {
if a == nil {
return
}
return a.WebAppPlaceholder
}
-495
View File
@@ -1,495 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// Audio represents TL type `audio#a3769600`.
type Audio struct {
// Duration of the audio, in seconds; as defined by the sender
Duration int32
// Title of the audio; as defined by the sender
Title string
// Performer of the audio; as defined by the sender
Performer string
// Original name of the file; as defined by the sender
FileName string
// The MIME type of the file; as defined by the sender
MimeType string
// The minithumbnail of the album cover; may be null
AlbumCoverMinithumbnail Minithumbnail
// The thumbnail of the album cover in JPEG format; as defined by the sender. The full
// size thumbnail is expected to be extracted from the downloaded audio file; may be null
AlbumCoverThumbnail Thumbnail
// Album cover variants to use if the downloaded audio file contains no album cover.
// Provided thumbnail dimensions are approximate
ExternalAlbumCovers []Thumbnail
// File containing the audio
Audio File
}
// AudioTypeID is TL type id of Audio.
const AudioTypeID = 0xa3769600
// Ensuring interfaces in compile-time for Audio.
var (
_ bin.Encoder = &Audio{}
_ bin.Decoder = &Audio{}
_ bin.BareEncoder = &Audio{}
_ bin.BareDecoder = &Audio{}
)
func (a *Audio) Zero() bool {
if a == nil {
return true
}
if !(a.Duration == 0) {
return false
}
if !(a.Title == "") {
return false
}
if !(a.Performer == "") {
return false
}
if !(a.FileName == "") {
return false
}
if !(a.MimeType == "") {
return false
}
if !(a.AlbumCoverMinithumbnail.Zero()) {
return false
}
if !(a.AlbumCoverThumbnail.Zero()) {
return false
}
if !(a.ExternalAlbumCovers == nil) {
return false
}
if !(a.Audio.Zero()) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *Audio) String() string {
if a == nil {
return "Audio(nil)"
}
type Alias Audio
return fmt.Sprintf("Audio%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*Audio) TypeID() uint32 {
return AudioTypeID
}
// TypeName returns name of type in TL schema.
func (*Audio) TypeName() string {
return "audio"
}
// TypeInfo returns info about TL type.
func (a *Audio) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "audio",
ID: AudioTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "Duration",
SchemaName: "duration",
},
{
Name: "Title",
SchemaName: "title",
},
{
Name: "Performer",
SchemaName: "performer",
},
{
Name: "FileName",
SchemaName: "file_name",
},
{
Name: "MimeType",
SchemaName: "mime_type",
},
{
Name: "AlbumCoverMinithumbnail",
SchemaName: "album_cover_minithumbnail",
},
{
Name: "AlbumCoverThumbnail",
SchemaName: "album_cover_thumbnail",
},
{
Name: "ExternalAlbumCovers",
SchemaName: "external_album_covers",
},
{
Name: "Audio",
SchemaName: "audio",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *Audio) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode audio#a3769600 as nil")
}
b.PutID(AudioTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *Audio) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode audio#a3769600 as nil")
}
b.PutInt32(a.Duration)
b.PutString(a.Title)
b.PutString(a.Performer)
b.PutString(a.FileName)
b.PutString(a.MimeType)
if err := a.AlbumCoverMinithumbnail.Encode(b); err != nil {
return fmt.Errorf("unable to encode audio#a3769600: field album_cover_minithumbnail: %w", err)
}
if err := a.AlbumCoverThumbnail.Encode(b); err != nil {
return fmt.Errorf("unable to encode audio#a3769600: field album_cover_thumbnail: %w", err)
}
b.PutInt(len(a.ExternalAlbumCovers))
for idx, v := range a.ExternalAlbumCovers {
if err := v.EncodeBare(b); err != nil {
return fmt.Errorf("unable to encode bare audio#a3769600: field external_album_covers element with index %d: %w", idx, err)
}
}
if err := a.Audio.Encode(b); err != nil {
return fmt.Errorf("unable to encode audio#a3769600: field audio: %w", err)
}
return nil
}
// Decode implements bin.Decoder.
func (a *Audio) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode audio#a3769600 to nil")
}
if err := b.ConsumeID(AudioTypeID); err != nil {
return fmt.Errorf("unable to decode audio#a3769600: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *Audio) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode audio#a3769600 to nil")
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode audio#a3769600: field duration: %w", err)
}
a.Duration = value
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode audio#a3769600: field title: %w", err)
}
a.Title = value
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode audio#a3769600: field performer: %w", err)
}
a.Performer = value
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode audio#a3769600: field file_name: %w", err)
}
a.FileName = value
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode audio#a3769600: field mime_type: %w", err)
}
a.MimeType = value
}
{
if err := a.AlbumCoverMinithumbnail.Decode(b); err != nil {
return fmt.Errorf("unable to decode audio#a3769600: field album_cover_minithumbnail: %w", err)
}
}
{
if err := a.AlbumCoverThumbnail.Decode(b); err != nil {
return fmt.Errorf("unable to decode audio#a3769600: field album_cover_thumbnail: %w", err)
}
}
{
headerLen, err := b.Int()
if err != nil {
return fmt.Errorf("unable to decode audio#a3769600: field external_album_covers: %w", err)
}
if headerLen > 0 {
a.ExternalAlbumCovers = make([]Thumbnail, 0, headerLen%bin.PreallocateLimit)
}
for idx := 0; idx < headerLen; idx++ {
var value Thumbnail
if err := value.DecodeBare(b); err != nil {
return fmt.Errorf("unable to decode bare audio#a3769600: field external_album_covers: %w", err)
}
a.ExternalAlbumCovers = append(a.ExternalAlbumCovers, value)
}
}
{
if err := a.Audio.Decode(b); err != nil {
return fmt.Errorf("unable to decode audio#a3769600: field audio: %w", err)
}
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *Audio) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode audio#a3769600 as nil")
}
b.ObjStart()
b.PutID("audio")
b.Comma()
b.FieldStart("duration")
b.PutInt32(a.Duration)
b.Comma()
b.FieldStart("title")
b.PutString(a.Title)
b.Comma()
b.FieldStart("performer")
b.PutString(a.Performer)
b.Comma()
b.FieldStart("file_name")
b.PutString(a.FileName)
b.Comma()
b.FieldStart("mime_type")
b.PutString(a.MimeType)
b.Comma()
b.FieldStart("album_cover_minithumbnail")
if err := a.AlbumCoverMinithumbnail.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode audio#a3769600: field album_cover_minithumbnail: %w", err)
}
b.Comma()
b.FieldStart("album_cover_thumbnail")
if err := a.AlbumCoverThumbnail.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode audio#a3769600: field album_cover_thumbnail: %w", err)
}
b.Comma()
b.FieldStart("external_album_covers")
b.ArrStart()
for idx, v := range a.ExternalAlbumCovers {
if err := v.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode audio#a3769600: field external_album_covers element with index %d: %w", idx, err)
}
b.Comma()
}
b.StripComma()
b.ArrEnd()
b.Comma()
b.FieldStart("audio")
if err := a.Audio.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode audio#a3769600: field audio: %w", err)
}
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *Audio) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode audio#a3769600 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("audio"); err != nil {
return fmt.Errorf("unable to decode audio#a3769600: %w", err)
}
case "duration":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode audio#a3769600: field duration: %w", err)
}
a.Duration = value
case "title":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode audio#a3769600: field title: %w", err)
}
a.Title = value
case "performer":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode audio#a3769600: field performer: %w", err)
}
a.Performer = value
case "file_name":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode audio#a3769600: field file_name: %w", err)
}
a.FileName = value
case "mime_type":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode audio#a3769600: field mime_type: %w", err)
}
a.MimeType = value
case "album_cover_minithumbnail":
if err := a.AlbumCoverMinithumbnail.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode audio#a3769600: field album_cover_minithumbnail: %w", err)
}
case "album_cover_thumbnail":
if err := a.AlbumCoverThumbnail.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode audio#a3769600: field album_cover_thumbnail: %w", err)
}
case "external_album_covers":
if err := b.Arr(func(b tdjson.Decoder) error {
var value Thumbnail
if err := value.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode audio#a3769600: field external_album_covers: %w", err)
}
a.ExternalAlbumCovers = append(a.ExternalAlbumCovers, value)
return nil
}); err != nil {
return fmt.Errorf("unable to decode audio#a3769600: field external_album_covers: %w", err)
}
case "audio":
if err := a.Audio.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode audio#a3769600: field audio: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// GetDuration returns value of Duration field.
func (a *Audio) GetDuration() (value int32) {
if a == nil {
return
}
return a.Duration
}
// GetTitle returns value of Title field.
func (a *Audio) GetTitle() (value string) {
if a == nil {
return
}
return a.Title
}
// GetPerformer returns value of Performer field.
func (a *Audio) GetPerformer() (value string) {
if a == nil {
return
}
return a.Performer
}
// GetFileName returns value of FileName field.
func (a *Audio) GetFileName() (value string) {
if a == nil {
return
}
return a.FileName
}
// GetMimeType returns value of MimeType field.
func (a *Audio) GetMimeType() (value string) {
if a == nil {
return
}
return a.MimeType
}
// GetAlbumCoverMinithumbnail returns value of AlbumCoverMinithumbnail field.
func (a *Audio) GetAlbumCoverMinithumbnail() (value Minithumbnail) {
if a == nil {
return
}
return a.AlbumCoverMinithumbnail
}
// GetAlbumCoverThumbnail returns value of AlbumCoverThumbnail field.
func (a *Audio) GetAlbumCoverThumbnail() (value Thumbnail) {
if a == nil {
return
}
return a.AlbumCoverThumbnail
}
// GetExternalAlbumCovers returns value of ExternalAlbumCovers field.
func (a *Audio) GetExternalAlbumCovers() (value []Thumbnail) {
if a == nil {
return
}
return a.ExternalAlbumCovers
}
// GetAudio returns value of Audio field.
func (a *Audio) GetAudio() (value File) {
if a == nil {
return
}
return a.Audio
}
-315
View File
@@ -1,315 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AuthenticationCodeInfo represents TL type `authenticationCodeInfo#ccb82bb8`.
type AuthenticationCodeInfo struct {
// A phone number that is being authenticated
PhoneNumber string
// The way the code was sent to the user
Type AuthenticationCodeTypeClass
// The way the next code will be sent to the user; may be null
NextType AuthenticationCodeTypeClass
// Timeout before the code can be re-sent, in seconds
Timeout int32
}
// AuthenticationCodeInfoTypeID is TL type id of AuthenticationCodeInfo.
const AuthenticationCodeInfoTypeID = 0xccb82bb8
// Ensuring interfaces in compile-time for AuthenticationCodeInfo.
var (
_ bin.Encoder = &AuthenticationCodeInfo{}
_ bin.Decoder = &AuthenticationCodeInfo{}
_ bin.BareEncoder = &AuthenticationCodeInfo{}
_ bin.BareDecoder = &AuthenticationCodeInfo{}
)
func (a *AuthenticationCodeInfo) Zero() bool {
if a == nil {
return true
}
if !(a.PhoneNumber == "") {
return false
}
if !(a.Type == nil) {
return false
}
if !(a.NextType == nil) {
return false
}
if !(a.Timeout == 0) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AuthenticationCodeInfo) String() string {
if a == nil {
return "AuthenticationCodeInfo(nil)"
}
type Alias AuthenticationCodeInfo
return fmt.Sprintf("AuthenticationCodeInfo%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AuthenticationCodeInfo) TypeID() uint32 {
return AuthenticationCodeInfoTypeID
}
// TypeName returns name of type in TL schema.
func (*AuthenticationCodeInfo) TypeName() string {
return "authenticationCodeInfo"
}
// TypeInfo returns info about TL type.
func (a *AuthenticationCodeInfo) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "authenticationCodeInfo",
ID: AuthenticationCodeInfoTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "PhoneNumber",
SchemaName: "phone_number",
},
{
Name: "Type",
SchemaName: "type",
},
{
Name: "NextType",
SchemaName: "next_type",
},
{
Name: "Timeout",
SchemaName: "timeout",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AuthenticationCodeInfo) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode authenticationCodeInfo#ccb82bb8 as nil")
}
b.PutID(AuthenticationCodeInfoTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AuthenticationCodeInfo) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode authenticationCodeInfo#ccb82bb8 as nil")
}
b.PutString(a.PhoneNumber)
if a.Type == nil {
return fmt.Errorf("unable to encode authenticationCodeInfo#ccb82bb8: field type is nil")
}
if err := a.Type.Encode(b); err != nil {
return fmt.Errorf("unable to encode authenticationCodeInfo#ccb82bb8: field type: %w", err)
}
if a.NextType == nil {
return fmt.Errorf("unable to encode authenticationCodeInfo#ccb82bb8: field next_type is nil")
}
if err := a.NextType.Encode(b); err != nil {
return fmt.Errorf("unable to encode authenticationCodeInfo#ccb82bb8: field next_type: %w", err)
}
b.PutInt32(a.Timeout)
return nil
}
// Decode implements bin.Decoder.
func (a *AuthenticationCodeInfo) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode authenticationCodeInfo#ccb82bb8 to nil")
}
if err := b.ConsumeID(AuthenticationCodeInfoTypeID); err != nil {
return fmt.Errorf("unable to decode authenticationCodeInfo#ccb82bb8: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AuthenticationCodeInfo) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode authenticationCodeInfo#ccb82bb8 to nil")
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode authenticationCodeInfo#ccb82bb8: field phone_number: %w", err)
}
a.PhoneNumber = value
}
{
value, err := DecodeAuthenticationCodeType(b)
if err != nil {
return fmt.Errorf("unable to decode authenticationCodeInfo#ccb82bb8: field type: %w", err)
}
a.Type = value
}
{
value, err := DecodeAuthenticationCodeType(b)
if err != nil {
return fmt.Errorf("unable to decode authenticationCodeInfo#ccb82bb8: field next_type: %w", err)
}
a.NextType = value
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode authenticationCodeInfo#ccb82bb8: field timeout: %w", err)
}
a.Timeout = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AuthenticationCodeInfo) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode authenticationCodeInfo#ccb82bb8 as nil")
}
b.ObjStart()
b.PutID("authenticationCodeInfo")
b.Comma()
b.FieldStart("phone_number")
b.PutString(a.PhoneNumber)
b.Comma()
b.FieldStart("type")
if a.Type == nil {
return fmt.Errorf("unable to encode authenticationCodeInfo#ccb82bb8: field type is nil")
}
if err := a.Type.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode authenticationCodeInfo#ccb82bb8: field type: %w", err)
}
b.Comma()
b.FieldStart("next_type")
if a.NextType == nil {
return fmt.Errorf("unable to encode authenticationCodeInfo#ccb82bb8: field next_type is nil")
}
if err := a.NextType.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode authenticationCodeInfo#ccb82bb8: field next_type: %w", err)
}
b.Comma()
b.FieldStart("timeout")
b.PutInt32(a.Timeout)
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AuthenticationCodeInfo) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode authenticationCodeInfo#ccb82bb8 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("authenticationCodeInfo"); err != nil {
return fmt.Errorf("unable to decode authenticationCodeInfo#ccb82bb8: %w", err)
}
case "phone_number":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode authenticationCodeInfo#ccb82bb8: field phone_number: %w", err)
}
a.PhoneNumber = value
case "type":
value, err := DecodeTDLibJSONAuthenticationCodeType(b)
if err != nil {
return fmt.Errorf("unable to decode authenticationCodeInfo#ccb82bb8: field type: %w", err)
}
a.Type = value
case "next_type":
value, err := DecodeTDLibJSONAuthenticationCodeType(b)
if err != nil {
return fmt.Errorf("unable to decode authenticationCodeInfo#ccb82bb8: field next_type: %w", err)
}
a.NextType = value
case "timeout":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode authenticationCodeInfo#ccb82bb8: field timeout: %w", err)
}
a.Timeout = value
default:
return b.Skip()
}
return nil
})
}
// GetPhoneNumber returns value of PhoneNumber field.
func (a *AuthenticationCodeInfo) GetPhoneNumber() (value string) {
if a == nil {
return
}
return a.PhoneNumber
}
// GetType returns value of Type field.
func (a *AuthenticationCodeInfo) GetType() (value AuthenticationCodeTypeClass) {
if a == nil {
return
}
return a.Type
}
// GetNextType returns value of NextType field.
func (a *AuthenticationCodeInfo) GetNextType() (value AuthenticationCodeTypeClass) {
if a == nil {
return
}
return a.NextType
}
// GetTimeout returns value of Timeout field.
func (a *AuthenticationCodeInfo) GetTimeout() (value int32) {
if a == nil {
return
}
return a.Timeout
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-466
View File
@@ -1,466 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AutoDownloadSettings represents TL type `autoDownloadSettings#3b1813e0`.
type AutoDownloadSettings struct {
// True, if the auto-download is enabled
IsAutoDownloadEnabled bool
// The maximum size of a photo file to be auto-downloaded, in bytes
MaxPhotoFileSize int32
// The maximum size of a video file to be auto-downloaded, in bytes
MaxVideoFileSize int64
// The maximum size of other file types to be auto-downloaded, in bytes
MaxOtherFileSize int64
// The maximum suggested bitrate for uploaded videos, in kbit/s
VideoUploadBitrate int32
// True, if the beginning of video files needs to be preloaded for instant playback
PreloadLargeVideos bool
// True, if the next audio track needs to be preloaded while the user is listening to an
// audio file
PreloadNextAudio bool
// True, if stories needs to be preloaded
PreloadStories bool
// True, if "use less data for calls" option needs to be enabled
UseLessDataForCalls bool
}
// AutoDownloadSettingsTypeID is TL type id of AutoDownloadSettings.
const AutoDownloadSettingsTypeID = 0x3b1813e0
// Ensuring interfaces in compile-time for AutoDownloadSettings.
var (
_ bin.Encoder = &AutoDownloadSettings{}
_ bin.Decoder = &AutoDownloadSettings{}
_ bin.BareEncoder = &AutoDownloadSettings{}
_ bin.BareDecoder = &AutoDownloadSettings{}
)
func (a *AutoDownloadSettings) Zero() bool {
if a == nil {
return true
}
if !(a.IsAutoDownloadEnabled == false) {
return false
}
if !(a.MaxPhotoFileSize == 0) {
return false
}
if !(a.MaxVideoFileSize == 0) {
return false
}
if !(a.MaxOtherFileSize == 0) {
return false
}
if !(a.VideoUploadBitrate == 0) {
return false
}
if !(a.PreloadLargeVideos == false) {
return false
}
if !(a.PreloadNextAudio == false) {
return false
}
if !(a.PreloadStories == false) {
return false
}
if !(a.UseLessDataForCalls == false) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AutoDownloadSettings) String() string {
if a == nil {
return "AutoDownloadSettings(nil)"
}
type Alias AutoDownloadSettings
return fmt.Sprintf("AutoDownloadSettings%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AutoDownloadSettings) TypeID() uint32 {
return AutoDownloadSettingsTypeID
}
// TypeName returns name of type in TL schema.
func (*AutoDownloadSettings) TypeName() string {
return "autoDownloadSettings"
}
// TypeInfo returns info about TL type.
func (a *AutoDownloadSettings) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "autoDownloadSettings",
ID: AutoDownloadSettingsTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "IsAutoDownloadEnabled",
SchemaName: "is_auto_download_enabled",
},
{
Name: "MaxPhotoFileSize",
SchemaName: "max_photo_file_size",
},
{
Name: "MaxVideoFileSize",
SchemaName: "max_video_file_size",
},
{
Name: "MaxOtherFileSize",
SchemaName: "max_other_file_size",
},
{
Name: "VideoUploadBitrate",
SchemaName: "video_upload_bitrate",
},
{
Name: "PreloadLargeVideos",
SchemaName: "preload_large_videos",
},
{
Name: "PreloadNextAudio",
SchemaName: "preload_next_audio",
},
{
Name: "PreloadStories",
SchemaName: "preload_stories",
},
{
Name: "UseLessDataForCalls",
SchemaName: "use_less_data_for_calls",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AutoDownloadSettings) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode autoDownloadSettings#3b1813e0 as nil")
}
b.PutID(AutoDownloadSettingsTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AutoDownloadSettings) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode autoDownloadSettings#3b1813e0 as nil")
}
b.PutBool(a.IsAutoDownloadEnabled)
b.PutInt32(a.MaxPhotoFileSize)
b.PutInt53(a.MaxVideoFileSize)
b.PutInt53(a.MaxOtherFileSize)
b.PutInt32(a.VideoUploadBitrate)
b.PutBool(a.PreloadLargeVideos)
b.PutBool(a.PreloadNextAudio)
b.PutBool(a.PreloadStories)
b.PutBool(a.UseLessDataForCalls)
return nil
}
// Decode implements bin.Decoder.
func (a *AutoDownloadSettings) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode autoDownloadSettings#3b1813e0 to nil")
}
if err := b.ConsumeID(AutoDownloadSettingsTypeID); err != nil {
return fmt.Errorf("unable to decode autoDownloadSettings#3b1813e0: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AutoDownloadSettings) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode autoDownloadSettings#3b1813e0 to nil")
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode autoDownloadSettings#3b1813e0: field is_auto_download_enabled: %w", err)
}
a.IsAutoDownloadEnabled = value
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode autoDownloadSettings#3b1813e0: field max_photo_file_size: %w", err)
}
a.MaxPhotoFileSize = value
}
{
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode autoDownloadSettings#3b1813e0: field max_video_file_size: %w", err)
}
a.MaxVideoFileSize = value
}
{
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode autoDownloadSettings#3b1813e0: field max_other_file_size: %w", err)
}
a.MaxOtherFileSize = value
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode autoDownloadSettings#3b1813e0: field video_upload_bitrate: %w", err)
}
a.VideoUploadBitrate = value
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode autoDownloadSettings#3b1813e0: field preload_large_videos: %w", err)
}
a.PreloadLargeVideos = value
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode autoDownloadSettings#3b1813e0: field preload_next_audio: %w", err)
}
a.PreloadNextAudio = value
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode autoDownloadSettings#3b1813e0: field preload_stories: %w", err)
}
a.PreloadStories = value
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode autoDownloadSettings#3b1813e0: field use_less_data_for_calls: %w", err)
}
a.UseLessDataForCalls = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AutoDownloadSettings) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode autoDownloadSettings#3b1813e0 as nil")
}
b.ObjStart()
b.PutID("autoDownloadSettings")
b.Comma()
b.FieldStart("is_auto_download_enabled")
b.PutBool(a.IsAutoDownloadEnabled)
b.Comma()
b.FieldStart("max_photo_file_size")
b.PutInt32(a.MaxPhotoFileSize)
b.Comma()
b.FieldStart("max_video_file_size")
b.PutInt53(a.MaxVideoFileSize)
b.Comma()
b.FieldStart("max_other_file_size")
b.PutInt53(a.MaxOtherFileSize)
b.Comma()
b.FieldStart("video_upload_bitrate")
b.PutInt32(a.VideoUploadBitrate)
b.Comma()
b.FieldStart("preload_large_videos")
b.PutBool(a.PreloadLargeVideos)
b.Comma()
b.FieldStart("preload_next_audio")
b.PutBool(a.PreloadNextAudio)
b.Comma()
b.FieldStart("preload_stories")
b.PutBool(a.PreloadStories)
b.Comma()
b.FieldStart("use_less_data_for_calls")
b.PutBool(a.UseLessDataForCalls)
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AutoDownloadSettings) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode autoDownloadSettings#3b1813e0 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("autoDownloadSettings"); err != nil {
return fmt.Errorf("unable to decode autoDownloadSettings#3b1813e0: %w", err)
}
case "is_auto_download_enabled":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode autoDownloadSettings#3b1813e0: field is_auto_download_enabled: %w", err)
}
a.IsAutoDownloadEnabled = value
case "max_photo_file_size":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode autoDownloadSettings#3b1813e0: field max_photo_file_size: %w", err)
}
a.MaxPhotoFileSize = value
case "max_video_file_size":
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode autoDownloadSettings#3b1813e0: field max_video_file_size: %w", err)
}
a.MaxVideoFileSize = value
case "max_other_file_size":
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode autoDownloadSettings#3b1813e0: field max_other_file_size: %w", err)
}
a.MaxOtherFileSize = value
case "video_upload_bitrate":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode autoDownloadSettings#3b1813e0: field video_upload_bitrate: %w", err)
}
a.VideoUploadBitrate = value
case "preload_large_videos":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode autoDownloadSettings#3b1813e0: field preload_large_videos: %w", err)
}
a.PreloadLargeVideos = value
case "preload_next_audio":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode autoDownloadSettings#3b1813e0: field preload_next_audio: %w", err)
}
a.PreloadNextAudio = value
case "preload_stories":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode autoDownloadSettings#3b1813e0: field preload_stories: %w", err)
}
a.PreloadStories = value
case "use_less_data_for_calls":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode autoDownloadSettings#3b1813e0: field use_less_data_for_calls: %w", err)
}
a.UseLessDataForCalls = value
default:
return b.Skip()
}
return nil
})
}
// GetIsAutoDownloadEnabled returns value of IsAutoDownloadEnabled field.
func (a *AutoDownloadSettings) GetIsAutoDownloadEnabled() (value bool) {
if a == nil {
return
}
return a.IsAutoDownloadEnabled
}
// GetMaxPhotoFileSize returns value of MaxPhotoFileSize field.
func (a *AutoDownloadSettings) GetMaxPhotoFileSize() (value int32) {
if a == nil {
return
}
return a.MaxPhotoFileSize
}
// GetMaxVideoFileSize returns value of MaxVideoFileSize field.
func (a *AutoDownloadSettings) GetMaxVideoFileSize() (value int64) {
if a == nil {
return
}
return a.MaxVideoFileSize
}
// GetMaxOtherFileSize returns value of MaxOtherFileSize field.
func (a *AutoDownloadSettings) GetMaxOtherFileSize() (value int64) {
if a == nil {
return
}
return a.MaxOtherFileSize
}
// GetVideoUploadBitrate returns value of VideoUploadBitrate field.
func (a *AutoDownloadSettings) GetVideoUploadBitrate() (value int32) {
if a == nil {
return
}
return a.VideoUploadBitrate
}
// GetPreloadLargeVideos returns value of PreloadLargeVideos field.
func (a *AutoDownloadSettings) GetPreloadLargeVideos() (value bool) {
if a == nil {
return
}
return a.PreloadLargeVideos
}
// GetPreloadNextAudio returns value of PreloadNextAudio field.
func (a *AutoDownloadSettings) GetPreloadNextAudio() (value bool) {
if a == nil {
return
}
return a.PreloadNextAudio
}
// GetPreloadStories returns value of PreloadStories field.
func (a *AutoDownloadSettings) GetPreloadStories() (value bool) {
if a == nil {
return
}
return a.PreloadStories
}
// GetUseLessDataForCalls returns value of UseLessDataForCalls field.
func (a *AutoDownloadSettings) GetUseLessDataForCalls() (value bool) {
if a == nil {
return
}
return a.UseLessDataForCalls
}
-261
View File
@@ -1,261 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AutoDownloadSettingsPresets represents TL type `autoDownloadSettingsPresets#d1621d22`.
type AutoDownloadSettingsPresets struct {
// Preset with lowest settings; expected to be used by default when roaming
Low AutoDownloadSettings
// Preset with medium settings; expected to be used by default when using mobile data
Medium AutoDownloadSettings
// Preset with highest settings; expected to be used by default when connected on Wi-Fi
High AutoDownloadSettings
}
// AutoDownloadSettingsPresetsTypeID is TL type id of AutoDownloadSettingsPresets.
const AutoDownloadSettingsPresetsTypeID = 0xd1621d22
// Ensuring interfaces in compile-time for AutoDownloadSettingsPresets.
var (
_ bin.Encoder = &AutoDownloadSettingsPresets{}
_ bin.Decoder = &AutoDownloadSettingsPresets{}
_ bin.BareEncoder = &AutoDownloadSettingsPresets{}
_ bin.BareDecoder = &AutoDownloadSettingsPresets{}
)
func (a *AutoDownloadSettingsPresets) Zero() bool {
if a == nil {
return true
}
if !(a.Low.Zero()) {
return false
}
if !(a.Medium.Zero()) {
return false
}
if !(a.High.Zero()) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AutoDownloadSettingsPresets) String() string {
if a == nil {
return "AutoDownloadSettingsPresets(nil)"
}
type Alias AutoDownloadSettingsPresets
return fmt.Sprintf("AutoDownloadSettingsPresets%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AutoDownloadSettingsPresets) TypeID() uint32 {
return AutoDownloadSettingsPresetsTypeID
}
// TypeName returns name of type in TL schema.
func (*AutoDownloadSettingsPresets) TypeName() string {
return "autoDownloadSettingsPresets"
}
// TypeInfo returns info about TL type.
func (a *AutoDownloadSettingsPresets) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "autoDownloadSettingsPresets",
ID: AutoDownloadSettingsPresetsTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "Low",
SchemaName: "low",
},
{
Name: "Medium",
SchemaName: "medium",
},
{
Name: "High",
SchemaName: "high",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AutoDownloadSettingsPresets) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode autoDownloadSettingsPresets#d1621d22 as nil")
}
b.PutID(AutoDownloadSettingsPresetsTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AutoDownloadSettingsPresets) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode autoDownloadSettingsPresets#d1621d22 as nil")
}
if err := a.Low.Encode(b); err != nil {
return fmt.Errorf("unable to encode autoDownloadSettingsPresets#d1621d22: field low: %w", err)
}
if err := a.Medium.Encode(b); err != nil {
return fmt.Errorf("unable to encode autoDownloadSettingsPresets#d1621d22: field medium: %w", err)
}
if err := a.High.Encode(b); err != nil {
return fmt.Errorf("unable to encode autoDownloadSettingsPresets#d1621d22: field high: %w", err)
}
return nil
}
// Decode implements bin.Decoder.
func (a *AutoDownloadSettingsPresets) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode autoDownloadSettingsPresets#d1621d22 to nil")
}
if err := b.ConsumeID(AutoDownloadSettingsPresetsTypeID); err != nil {
return fmt.Errorf("unable to decode autoDownloadSettingsPresets#d1621d22: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AutoDownloadSettingsPresets) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode autoDownloadSettingsPresets#d1621d22 to nil")
}
{
if err := a.Low.Decode(b); err != nil {
return fmt.Errorf("unable to decode autoDownloadSettingsPresets#d1621d22: field low: %w", err)
}
}
{
if err := a.Medium.Decode(b); err != nil {
return fmt.Errorf("unable to decode autoDownloadSettingsPresets#d1621d22: field medium: %w", err)
}
}
{
if err := a.High.Decode(b); err != nil {
return fmt.Errorf("unable to decode autoDownloadSettingsPresets#d1621d22: field high: %w", err)
}
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AutoDownloadSettingsPresets) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode autoDownloadSettingsPresets#d1621d22 as nil")
}
b.ObjStart()
b.PutID("autoDownloadSettingsPresets")
b.Comma()
b.FieldStart("low")
if err := a.Low.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode autoDownloadSettingsPresets#d1621d22: field low: %w", err)
}
b.Comma()
b.FieldStart("medium")
if err := a.Medium.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode autoDownloadSettingsPresets#d1621d22: field medium: %w", err)
}
b.Comma()
b.FieldStart("high")
if err := a.High.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode autoDownloadSettingsPresets#d1621d22: field high: %w", err)
}
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AutoDownloadSettingsPresets) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode autoDownloadSettingsPresets#d1621d22 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("autoDownloadSettingsPresets"); err != nil {
return fmt.Errorf("unable to decode autoDownloadSettingsPresets#d1621d22: %w", err)
}
case "low":
if err := a.Low.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode autoDownloadSettingsPresets#d1621d22: field low: %w", err)
}
case "medium":
if err := a.Medium.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode autoDownloadSettingsPresets#d1621d22: field medium: %w", err)
}
case "high":
if err := a.High.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode autoDownloadSettingsPresets#d1621d22: field high: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// GetLow returns value of Low field.
func (a *AutoDownloadSettingsPresets) GetLow() (value AutoDownloadSettings) {
if a == nil {
return
}
return a.Low
}
// GetMedium returns value of Medium field.
func (a *AutoDownloadSettingsPresets) GetMedium() (value AutoDownloadSettings) {
if a == nil {
return
}
return a.Medium
}
// GetHigh returns value of High field.
func (a *AutoDownloadSettingsPresets) GetHigh() (value AutoDownloadSettings) {
if a == nil {
return
}
return a.High
}
-227
View File
@@ -1,227 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AutosaveSettingsException represents TL type `autosaveSettingsException#586bf5c8`.
type AutosaveSettingsException struct {
// Chat identifier
ChatID int64
// Autosave settings for the chat
Settings ScopeAutosaveSettings
}
// AutosaveSettingsExceptionTypeID is TL type id of AutosaveSettingsException.
const AutosaveSettingsExceptionTypeID = 0x586bf5c8
// Ensuring interfaces in compile-time for AutosaveSettingsException.
var (
_ bin.Encoder = &AutosaveSettingsException{}
_ bin.Decoder = &AutosaveSettingsException{}
_ bin.BareEncoder = &AutosaveSettingsException{}
_ bin.BareDecoder = &AutosaveSettingsException{}
)
func (a *AutosaveSettingsException) Zero() bool {
if a == nil {
return true
}
if !(a.ChatID == 0) {
return false
}
if !(a.Settings.Zero()) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AutosaveSettingsException) String() string {
if a == nil {
return "AutosaveSettingsException(nil)"
}
type Alias AutosaveSettingsException
return fmt.Sprintf("AutosaveSettingsException%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AutosaveSettingsException) TypeID() uint32 {
return AutosaveSettingsExceptionTypeID
}
// TypeName returns name of type in TL schema.
func (*AutosaveSettingsException) TypeName() string {
return "autosaveSettingsException"
}
// TypeInfo returns info about TL type.
func (a *AutosaveSettingsException) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "autosaveSettingsException",
ID: AutosaveSettingsExceptionTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "ChatID",
SchemaName: "chat_id",
},
{
Name: "Settings",
SchemaName: "settings",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AutosaveSettingsException) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode autosaveSettingsException#586bf5c8 as nil")
}
b.PutID(AutosaveSettingsExceptionTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AutosaveSettingsException) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode autosaveSettingsException#586bf5c8 as nil")
}
b.PutInt53(a.ChatID)
if err := a.Settings.Encode(b); err != nil {
return fmt.Errorf("unable to encode autosaveSettingsException#586bf5c8: field settings: %w", err)
}
return nil
}
// Decode implements bin.Decoder.
func (a *AutosaveSettingsException) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode autosaveSettingsException#586bf5c8 to nil")
}
if err := b.ConsumeID(AutosaveSettingsExceptionTypeID); err != nil {
return fmt.Errorf("unable to decode autosaveSettingsException#586bf5c8: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AutosaveSettingsException) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode autosaveSettingsException#586bf5c8 to nil")
}
{
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode autosaveSettingsException#586bf5c8: field chat_id: %w", err)
}
a.ChatID = value
}
{
if err := a.Settings.Decode(b); err != nil {
return fmt.Errorf("unable to decode autosaveSettingsException#586bf5c8: field settings: %w", err)
}
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AutosaveSettingsException) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode autosaveSettingsException#586bf5c8 as nil")
}
b.ObjStart()
b.PutID("autosaveSettingsException")
b.Comma()
b.FieldStart("chat_id")
b.PutInt53(a.ChatID)
b.Comma()
b.FieldStart("settings")
if err := a.Settings.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode autosaveSettingsException#586bf5c8: field settings: %w", err)
}
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AutosaveSettingsException) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode autosaveSettingsException#586bf5c8 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("autosaveSettingsException"); err != nil {
return fmt.Errorf("unable to decode autosaveSettingsException#586bf5c8: %w", err)
}
case "chat_id":
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode autosaveSettingsException#586bf5c8: field chat_id: %w", err)
}
a.ChatID = value
case "settings":
if err := a.Settings.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode autosaveSettingsException#586bf5c8: field settings: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// GetChatID returns value of ChatID field.
func (a *AutosaveSettingsException) GetChatID() (value int64) {
if a == nil {
return
}
return a.ChatID
}
// GetSettings returns value of Settings field.
func (a *AutosaveSettingsException) GetSettings() (value ScopeAutosaveSettings) {
if a == nil {
return
}
return a.Settings
}
-323
View File
@@ -1,323 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AutosaveSettings represents TL type `autosaveSettings#c0d11a28`.
type AutosaveSettings struct {
// Default autosave settings for private chats
PrivateChatSettings ScopeAutosaveSettings
// Default autosave settings for basic group and supergroup chats
GroupSettings ScopeAutosaveSettings
// Default autosave settings for channel chats
ChannelSettings ScopeAutosaveSettings
// Autosave settings for specific chats
Exceptions []AutosaveSettingsException
}
// AutosaveSettingsTypeID is TL type id of AutosaveSettings.
const AutosaveSettingsTypeID = 0xc0d11a28
// Ensuring interfaces in compile-time for AutosaveSettings.
var (
_ bin.Encoder = &AutosaveSettings{}
_ bin.Decoder = &AutosaveSettings{}
_ bin.BareEncoder = &AutosaveSettings{}
_ bin.BareDecoder = &AutosaveSettings{}
)
func (a *AutosaveSettings) Zero() bool {
if a == nil {
return true
}
if !(a.PrivateChatSettings.Zero()) {
return false
}
if !(a.GroupSettings.Zero()) {
return false
}
if !(a.ChannelSettings.Zero()) {
return false
}
if !(a.Exceptions == nil) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AutosaveSettings) String() string {
if a == nil {
return "AutosaveSettings(nil)"
}
type Alias AutosaveSettings
return fmt.Sprintf("AutosaveSettings%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AutosaveSettings) TypeID() uint32 {
return AutosaveSettingsTypeID
}
// TypeName returns name of type in TL schema.
func (*AutosaveSettings) TypeName() string {
return "autosaveSettings"
}
// TypeInfo returns info about TL type.
func (a *AutosaveSettings) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "autosaveSettings",
ID: AutosaveSettingsTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "PrivateChatSettings",
SchemaName: "private_chat_settings",
},
{
Name: "GroupSettings",
SchemaName: "group_settings",
},
{
Name: "ChannelSettings",
SchemaName: "channel_settings",
},
{
Name: "Exceptions",
SchemaName: "exceptions",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AutosaveSettings) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode autosaveSettings#c0d11a28 as nil")
}
b.PutID(AutosaveSettingsTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AutosaveSettings) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode autosaveSettings#c0d11a28 as nil")
}
if err := a.PrivateChatSettings.Encode(b); err != nil {
return fmt.Errorf("unable to encode autosaveSettings#c0d11a28: field private_chat_settings: %w", err)
}
if err := a.GroupSettings.Encode(b); err != nil {
return fmt.Errorf("unable to encode autosaveSettings#c0d11a28: field group_settings: %w", err)
}
if err := a.ChannelSettings.Encode(b); err != nil {
return fmt.Errorf("unable to encode autosaveSettings#c0d11a28: field channel_settings: %w", err)
}
b.PutInt(len(a.Exceptions))
for idx, v := range a.Exceptions {
if err := v.EncodeBare(b); err != nil {
return fmt.Errorf("unable to encode bare autosaveSettings#c0d11a28: field exceptions element with index %d: %w", idx, err)
}
}
return nil
}
// Decode implements bin.Decoder.
func (a *AutosaveSettings) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode autosaveSettings#c0d11a28 to nil")
}
if err := b.ConsumeID(AutosaveSettingsTypeID); err != nil {
return fmt.Errorf("unable to decode autosaveSettings#c0d11a28: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AutosaveSettings) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode autosaveSettings#c0d11a28 to nil")
}
{
if err := a.PrivateChatSettings.Decode(b); err != nil {
return fmt.Errorf("unable to decode autosaveSettings#c0d11a28: field private_chat_settings: %w", err)
}
}
{
if err := a.GroupSettings.Decode(b); err != nil {
return fmt.Errorf("unable to decode autosaveSettings#c0d11a28: field group_settings: %w", err)
}
}
{
if err := a.ChannelSettings.Decode(b); err != nil {
return fmt.Errorf("unable to decode autosaveSettings#c0d11a28: field channel_settings: %w", err)
}
}
{
headerLen, err := b.Int()
if err != nil {
return fmt.Errorf("unable to decode autosaveSettings#c0d11a28: field exceptions: %w", err)
}
if headerLen > 0 {
a.Exceptions = make([]AutosaveSettingsException, 0, headerLen%bin.PreallocateLimit)
}
for idx := 0; idx < headerLen; idx++ {
var value AutosaveSettingsException
if err := value.DecodeBare(b); err != nil {
return fmt.Errorf("unable to decode bare autosaveSettings#c0d11a28: field exceptions: %w", err)
}
a.Exceptions = append(a.Exceptions, value)
}
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AutosaveSettings) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode autosaveSettings#c0d11a28 as nil")
}
b.ObjStart()
b.PutID("autosaveSettings")
b.Comma()
b.FieldStart("private_chat_settings")
if err := a.PrivateChatSettings.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode autosaveSettings#c0d11a28: field private_chat_settings: %w", err)
}
b.Comma()
b.FieldStart("group_settings")
if err := a.GroupSettings.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode autosaveSettings#c0d11a28: field group_settings: %w", err)
}
b.Comma()
b.FieldStart("channel_settings")
if err := a.ChannelSettings.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode autosaveSettings#c0d11a28: field channel_settings: %w", err)
}
b.Comma()
b.FieldStart("exceptions")
b.ArrStart()
for idx, v := range a.Exceptions {
if err := v.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode autosaveSettings#c0d11a28: field exceptions element with index %d: %w", idx, err)
}
b.Comma()
}
b.StripComma()
b.ArrEnd()
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AutosaveSettings) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode autosaveSettings#c0d11a28 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("autosaveSettings"); err != nil {
return fmt.Errorf("unable to decode autosaveSettings#c0d11a28: %w", err)
}
case "private_chat_settings":
if err := a.PrivateChatSettings.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode autosaveSettings#c0d11a28: field private_chat_settings: %w", err)
}
case "group_settings":
if err := a.GroupSettings.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode autosaveSettings#c0d11a28: field group_settings: %w", err)
}
case "channel_settings":
if err := a.ChannelSettings.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode autosaveSettings#c0d11a28: field channel_settings: %w", err)
}
case "exceptions":
if err := b.Arr(func(b tdjson.Decoder) error {
var value AutosaveSettingsException
if err := value.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode autosaveSettings#c0d11a28: field exceptions: %w", err)
}
a.Exceptions = append(a.Exceptions, value)
return nil
}); err != nil {
return fmt.Errorf("unable to decode autosaveSettings#c0d11a28: field exceptions: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// GetPrivateChatSettings returns value of PrivateChatSettings field.
func (a *AutosaveSettings) GetPrivateChatSettings() (value ScopeAutosaveSettings) {
if a == nil {
return
}
return a.PrivateChatSettings
}
// GetGroupSettings returns value of GroupSettings field.
func (a *AutosaveSettings) GetGroupSettings() (value ScopeAutosaveSettings) {
if a == nil {
return
}
return a.GroupSettings
}
// GetChannelSettings returns value of ChannelSettings field.
func (a *AutosaveSettings) GetChannelSettings() (value ScopeAutosaveSettings) {
if a == nil {
return
}
return a.ChannelSettings
}
// GetExceptions returns value of Exceptions field.
func (a *AutosaveSettings) GetExceptions() (value []AutosaveSettingsException) {
if a == nil {
return
}
return a.Exceptions
}
-758
View File
@@ -1,758 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AutosaveSettingsScopePrivateChats represents TL type `autosaveSettingsScopePrivateChats#5329797f`.
type AutosaveSettingsScopePrivateChats struct {
}
// AutosaveSettingsScopePrivateChatsTypeID is TL type id of AutosaveSettingsScopePrivateChats.
const AutosaveSettingsScopePrivateChatsTypeID = 0x5329797f
// construct implements constructor of AutosaveSettingsScopeClass.
func (a AutosaveSettingsScopePrivateChats) construct() AutosaveSettingsScopeClass { return &a }
// Ensuring interfaces in compile-time for AutosaveSettingsScopePrivateChats.
var (
_ bin.Encoder = &AutosaveSettingsScopePrivateChats{}
_ bin.Decoder = &AutosaveSettingsScopePrivateChats{}
_ bin.BareEncoder = &AutosaveSettingsScopePrivateChats{}
_ bin.BareDecoder = &AutosaveSettingsScopePrivateChats{}
_ AutosaveSettingsScopeClass = &AutosaveSettingsScopePrivateChats{}
)
func (a *AutosaveSettingsScopePrivateChats) Zero() bool {
if a == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (a *AutosaveSettingsScopePrivateChats) String() string {
if a == nil {
return "AutosaveSettingsScopePrivateChats(nil)"
}
type Alias AutosaveSettingsScopePrivateChats
return fmt.Sprintf("AutosaveSettingsScopePrivateChats%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AutosaveSettingsScopePrivateChats) TypeID() uint32 {
return AutosaveSettingsScopePrivateChatsTypeID
}
// TypeName returns name of type in TL schema.
func (*AutosaveSettingsScopePrivateChats) TypeName() string {
return "autosaveSettingsScopePrivateChats"
}
// TypeInfo returns info about TL type.
func (a *AutosaveSettingsScopePrivateChats) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "autosaveSettingsScopePrivateChats",
ID: AutosaveSettingsScopePrivateChatsTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (a *AutosaveSettingsScopePrivateChats) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode autosaveSettingsScopePrivateChats#5329797f as nil")
}
b.PutID(AutosaveSettingsScopePrivateChatsTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AutosaveSettingsScopePrivateChats) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode autosaveSettingsScopePrivateChats#5329797f as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (a *AutosaveSettingsScopePrivateChats) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode autosaveSettingsScopePrivateChats#5329797f to nil")
}
if err := b.ConsumeID(AutosaveSettingsScopePrivateChatsTypeID); err != nil {
return fmt.Errorf("unable to decode autosaveSettingsScopePrivateChats#5329797f: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AutosaveSettingsScopePrivateChats) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode autosaveSettingsScopePrivateChats#5329797f to nil")
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AutosaveSettingsScopePrivateChats) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode autosaveSettingsScopePrivateChats#5329797f as nil")
}
b.ObjStart()
b.PutID("autosaveSettingsScopePrivateChats")
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AutosaveSettingsScopePrivateChats) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode autosaveSettingsScopePrivateChats#5329797f to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("autosaveSettingsScopePrivateChats"); err != nil {
return fmt.Errorf("unable to decode autosaveSettingsScopePrivateChats#5329797f: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// AutosaveSettingsScopeGroupChats represents TL type `autosaveSettingsScopeGroupChats#32e00e4e`.
type AutosaveSettingsScopeGroupChats struct {
}
// AutosaveSettingsScopeGroupChatsTypeID is TL type id of AutosaveSettingsScopeGroupChats.
const AutosaveSettingsScopeGroupChatsTypeID = 0x32e00e4e
// construct implements constructor of AutosaveSettingsScopeClass.
func (a AutosaveSettingsScopeGroupChats) construct() AutosaveSettingsScopeClass { return &a }
// Ensuring interfaces in compile-time for AutosaveSettingsScopeGroupChats.
var (
_ bin.Encoder = &AutosaveSettingsScopeGroupChats{}
_ bin.Decoder = &AutosaveSettingsScopeGroupChats{}
_ bin.BareEncoder = &AutosaveSettingsScopeGroupChats{}
_ bin.BareDecoder = &AutosaveSettingsScopeGroupChats{}
_ AutosaveSettingsScopeClass = &AutosaveSettingsScopeGroupChats{}
)
func (a *AutosaveSettingsScopeGroupChats) Zero() bool {
if a == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (a *AutosaveSettingsScopeGroupChats) String() string {
if a == nil {
return "AutosaveSettingsScopeGroupChats(nil)"
}
type Alias AutosaveSettingsScopeGroupChats
return fmt.Sprintf("AutosaveSettingsScopeGroupChats%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AutosaveSettingsScopeGroupChats) TypeID() uint32 {
return AutosaveSettingsScopeGroupChatsTypeID
}
// TypeName returns name of type in TL schema.
func (*AutosaveSettingsScopeGroupChats) TypeName() string {
return "autosaveSettingsScopeGroupChats"
}
// TypeInfo returns info about TL type.
func (a *AutosaveSettingsScopeGroupChats) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "autosaveSettingsScopeGroupChats",
ID: AutosaveSettingsScopeGroupChatsTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (a *AutosaveSettingsScopeGroupChats) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode autosaveSettingsScopeGroupChats#32e00e4e as nil")
}
b.PutID(AutosaveSettingsScopeGroupChatsTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AutosaveSettingsScopeGroupChats) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode autosaveSettingsScopeGroupChats#32e00e4e as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (a *AutosaveSettingsScopeGroupChats) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode autosaveSettingsScopeGroupChats#32e00e4e to nil")
}
if err := b.ConsumeID(AutosaveSettingsScopeGroupChatsTypeID); err != nil {
return fmt.Errorf("unable to decode autosaveSettingsScopeGroupChats#32e00e4e: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AutosaveSettingsScopeGroupChats) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode autosaveSettingsScopeGroupChats#32e00e4e to nil")
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AutosaveSettingsScopeGroupChats) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode autosaveSettingsScopeGroupChats#32e00e4e as nil")
}
b.ObjStart()
b.PutID("autosaveSettingsScopeGroupChats")
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AutosaveSettingsScopeGroupChats) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode autosaveSettingsScopeGroupChats#32e00e4e to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("autosaveSettingsScopeGroupChats"); err != nil {
return fmt.Errorf("unable to decode autosaveSettingsScopeGroupChats#32e00e4e: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// AutosaveSettingsScopeChannelChats represents TL type `autosaveSettingsScopeChannelChats#e2391fd1`.
type AutosaveSettingsScopeChannelChats struct {
}
// AutosaveSettingsScopeChannelChatsTypeID is TL type id of AutosaveSettingsScopeChannelChats.
const AutosaveSettingsScopeChannelChatsTypeID = 0xe2391fd1
// construct implements constructor of AutosaveSettingsScopeClass.
func (a AutosaveSettingsScopeChannelChats) construct() AutosaveSettingsScopeClass { return &a }
// Ensuring interfaces in compile-time for AutosaveSettingsScopeChannelChats.
var (
_ bin.Encoder = &AutosaveSettingsScopeChannelChats{}
_ bin.Decoder = &AutosaveSettingsScopeChannelChats{}
_ bin.BareEncoder = &AutosaveSettingsScopeChannelChats{}
_ bin.BareDecoder = &AutosaveSettingsScopeChannelChats{}
_ AutosaveSettingsScopeClass = &AutosaveSettingsScopeChannelChats{}
)
func (a *AutosaveSettingsScopeChannelChats) Zero() bool {
if a == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (a *AutosaveSettingsScopeChannelChats) String() string {
if a == nil {
return "AutosaveSettingsScopeChannelChats(nil)"
}
type Alias AutosaveSettingsScopeChannelChats
return fmt.Sprintf("AutosaveSettingsScopeChannelChats%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AutosaveSettingsScopeChannelChats) TypeID() uint32 {
return AutosaveSettingsScopeChannelChatsTypeID
}
// TypeName returns name of type in TL schema.
func (*AutosaveSettingsScopeChannelChats) TypeName() string {
return "autosaveSettingsScopeChannelChats"
}
// TypeInfo returns info about TL type.
func (a *AutosaveSettingsScopeChannelChats) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "autosaveSettingsScopeChannelChats",
ID: AutosaveSettingsScopeChannelChatsTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (a *AutosaveSettingsScopeChannelChats) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode autosaveSettingsScopeChannelChats#e2391fd1 as nil")
}
b.PutID(AutosaveSettingsScopeChannelChatsTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AutosaveSettingsScopeChannelChats) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode autosaveSettingsScopeChannelChats#e2391fd1 as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (a *AutosaveSettingsScopeChannelChats) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode autosaveSettingsScopeChannelChats#e2391fd1 to nil")
}
if err := b.ConsumeID(AutosaveSettingsScopeChannelChatsTypeID); err != nil {
return fmt.Errorf("unable to decode autosaveSettingsScopeChannelChats#e2391fd1: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AutosaveSettingsScopeChannelChats) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode autosaveSettingsScopeChannelChats#e2391fd1 to nil")
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AutosaveSettingsScopeChannelChats) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode autosaveSettingsScopeChannelChats#e2391fd1 as nil")
}
b.ObjStart()
b.PutID("autosaveSettingsScopeChannelChats")
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AutosaveSettingsScopeChannelChats) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode autosaveSettingsScopeChannelChats#e2391fd1 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("autosaveSettingsScopeChannelChats"); err != nil {
return fmt.Errorf("unable to decode autosaveSettingsScopeChannelChats#e2391fd1: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// AutosaveSettingsScopeChat represents TL type `autosaveSettingsScopeChat#9eb5c2e9`.
type AutosaveSettingsScopeChat struct {
// Chat identifier
ChatID int64
}
// AutosaveSettingsScopeChatTypeID is TL type id of AutosaveSettingsScopeChat.
const AutosaveSettingsScopeChatTypeID = 0x9eb5c2e9
// construct implements constructor of AutosaveSettingsScopeClass.
func (a AutosaveSettingsScopeChat) construct() AutosaveSettingsScopeClass { return &a }
// Ensuring interfaces in compile-time for AutosaveSettingsScopeChat.
var (
_ bin.Encoder = &AutosaveSettingsScopeChat{}
_ bin.Decoder = &AutosaveSettingsScopeChat{}
_ bin.BareEncoder = &AutosaveSettingsScopeChat{}
_ bin.BareDecoder = &AutosaveSettingsScopeChat{}
_ AutosaveSettingsScopeClass = &AutosaveSettingsScopeChat{}
)
func (a *AutosaveSettingsScopeChat) Zero() bool {
if a == nil {
return true
}
if !(a.ChatID == 0) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AutosaveSettingsScopeChat) String() string {
if a == nil {
return "AutosaveSettingsScopeChat(nil)"
}
type Alias AutosaveSettingsScopeChat
return fmt.Sprintf("AutosaveSettingsScopeChat%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AutosaveSettingsScopeChat) TypeID() uint32 {
return AutosaveSettingsScopeChatTypeID
}
// TypeName returns name of type in TL schema.
func (*AutosaveSettingsScopeChat) TypeName() string {
return "autosaveSettingsScopeChat"
}
// TypeInfo returns info about TL type.
func (a *AutosaveSettingsScopeChat) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "autosaveSettingsScopeChat",
ID: AutosaveSettingsScopeChatTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "ChatID",
SchemaName: "chat_id",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AutosaveSettingsScopeChat) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode autosaveSettingsScopeChat#9eb5c2e9 as nil")
}
b.PutID(AutosaveSettingsScopeChatTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AutosaveSettingsScopeChat) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode autosaveSettingsScopeChat#9eb5c2e9 as nil")
}
b.PutInt53(a.ChatID)
return nil
}
// Decode implements bin.Decoder.
func (a *AutosaveSettingsScopeChat) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode autosaveSettingsScopeChat#9eb5c2e9 to nil")
}
if err := b.ConsumeID(AutosaveSettingsScopeChatTypeID); err != nil {
return fmt.Errorf("unable to decode autosaveSettingsScopeChat#9eb5c2e9: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AutosaveSettingsScopeChat) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode autosaveSettingsScopeChat#9eb5c2e9 to nil")
}
{
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode autosaveSettingsScopeChat#9eb5c2e9: field chat_id: %w", err)
}
a.ChatID = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AutosaveSettingsScopeChat) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode autosaveSettingsScopeChat#9eb5c2e9 as nil")
}
b.ObjStart()
b.PutID("autosaveSettingsScopeChat")
b.Comma()
b.FieldStart("chat_id")
b.PutInt53(a.ChatID)
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AutosaveSettingsScopeChat) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode autosaveSettingsScopeChat#9eb5c2e9 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("autosaveSettingsScopeChat"); err != nil {
return fmt.Errorf("unable to decode autosaveSettingsScopeChat#9eb5c2e9: %w", err)
}
case "chat_id":
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode autosaveSettingsScopeChat#9eb5c2e9: field chat_id: %w", err)
}
a.ChatID = value
default:
return b.Skip()
}
return nil
})
}
// GetChatID returns value of ChatID field.
func (a *AutosaveSettingsScopeChat) GetChatID() (value int64) {
if a == nil {
return
}
return a.ChatID
}
// AutosaveSettingsScopeClassName is schema name of AutosaveSettingsScopeClass.
const AutosaveSettingsScopeClassName = "AutosaveSettingsScope"
// AutosaveSettingsScopeClass represents AutosaveSettingsScope generic type.
//
// Example:
//
// g, err := tdapi.DecodeAutosaveSettingsScope(buf)
// if err != nil {
// panic(err)
// }
// switch v := g.(type) {
// case *tdapi.AutosaveSettingsScopePrivateChats: // autosaveSettingsScopePrivateChats#5329797f
// case *tdapi.AutosaveSettingsScopeGroupChats: // autosaveSettingsScopeGroupChats#32e00e4e
// case *tdapi.AutosaveSettingsScopeChannelChats: // autosaveSettingsScopeChannelChats#e2391fd1
// case *tdapi.AutosaveSettingsScopeChat: // autosaveSettingsScopeChat#9eb5c2e9
// default: panic(v)
// }
type AutosaveSettingsScopeClass interface {
bin.Encoder
bin.Decoder
bin.BareEncoder
bin.BareDecoder
construct() AutosaveSettingsScopeClass
// 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
EncodeTDLibJSON(b tdjson.Encoder) error
DecodeTDLibJSON(b tdjson.Decoder) error
}
// DecodeAutosaveSettingsScope implements binary de-serialization for AutosaveSettingsScopeClass.
func DecodeAutosaveSettingsScope(buf *bin.Buffer) (AutosaveSettingsScopeClass, error) {
id, err := buf.PeekID()
if err != nil {
return nil, err
}
switch id {
case AutosaveSettingsScopePrivateChatsTypeID:
// Decoding autosaveSettingsScopePrivateChats#5329797f.
v := AutosaveSettingsScopePrivateChats{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode AutosaveSettingsScopeClass: %w", err)
}
return &v, nil
case AutosaveSettingsScopeGroupChatsTypeID:
// Decoding autosaveSettingsScopeGroupChats#32e00e4e.
v := AutosaveSettingsScopeGroupChats{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode AutosaveSettingsScopeClass: %w", err)
}
return &v, nil
case AutosaveSettingsScopeChannelChatsTypeID:
// Decoding autosaveSettingsScopeChannelChats#e2391fd1.
v := AutosaveSettingsScopeChannelChats{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode AutosaveSettingsScopeClass: %w", err)
}
return &v, nil
case AutosaveSettingsScopeChatTypeID:
// Decoding autosaveSettingsScopeChat#9eb5c2e9.
v := AutosaveSettingsScopeChat{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode AutosaveSettingsScopeClass: %w", err)
}
return &v, nil
default:
return nil, fmt.Errorf("unable to decode AutosaveSettingsScopeClass: %w", bin.NewUnexpectedID(id))
}
}
// DecodeTDLibJSONAutosaveSettingsScope implements binary de-serialization for AutosaveSettingsScopeClass.
func DecodeTDLibJSONAutosaveSettingsScope(buf tdjson.Decoder) (AutosaveSettingsScopeClass, error) {
id, err := buf.FindTypeID()
if err != nil {
return nil, err
}
switch id {
case "autosaveSettingsScopePrivateChats":
// Decoding autosaveSettingsScopePrivateChats#5329797f.
v := AutosaveSettingsScopePrivateChats{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode AutosaveSettingsScopeClass: %w", err)
}
return &v, nil
case "autosaveSettingsScopeGroupChats":
// Decoding autosaveSettingsScopeGroupChats#32e00e4e.
v := AutosaveSettingsScopeGroupChats{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode AutosaveSettingsScopeClass: %w", err)
}
return &v, nil
case "autosaveSettingsScopeChannelChats":
// Decoding autosaveSettingsScopeChannelChats#e2391fd1.
v := AutosaveSettingsScopeChannelChats{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode AutosaveSettingsScopeClass: %w", err)
}
return &v, nil
case "autosaveSettingsScopeChat":
// Decoding autosaveSettingsScopeChat#9eb5c2e9.
v := AutosaveSettingsScopeChat{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode AutosaveSettingsScopeClass: %w", err)
}
return &v, nil
default:
return nil, fmt.Errorf("unable to decode AutosaveSettingsScopeClass: %w", tdjson.NewUnexpectedID(id))
}
}
// AutosaveSettingsScope boxes the AutosaveSettingsScopeClass providing a helper.
type AutosaveSettingsScopeBox struct {
AutosaveSettingsScope AutosaveSettingsScopeClass
}
// Decode implements bin.Decoder for AutosaveSettingsScopeBox.
func (b *AutosaveSettingsScopeBox) Decode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("unable to decode AutosaveSettingsScopeBox to nil")
}
v, err := DecodeAutosaveSettingsScope(buf)
if err != nil {
return fmt.Errorf("unable to decode boxed value: %w", err)
}
b.AutosaveSettingsScope = v
return nil
}
// Encode implements bin.Encode for AutosaveSettingsScopeBox.
func (b *AutosaveSettingsScopeBox) Encode(buf *bin.Buffer) error {
if b == nil || b.AutosaveSettingsScope == nil {
return fmt.Errorf("unable to encode AutosaveSettingsScopeClass as nil")
}
return b.AutosaveSettingsScope.Encode(buf)
}
// DecodeTDLibJSON implements bin.Decoder for AutosaveSettingsScopeBox.
func (b *AutosaveSettingsScopeBox) DecodeTDLibJSON(buf tdjson.Decoder) error {
if b == nil {
return fmt.Errorf("unable to decode AutosaveSettingsScopeBox to nil")
}
v, err := DecodeTDLibJSONAutosaveSettingsScope(buf)
if err != nil {
return fmt.Errorf("unable to decode boxed value: %w", err)
}
b.AutosaveSettingsScope = v
return nil
}
// EncodeTDLibJSON implements bin.Encode for AutosaveSettingsScopeBox.
func (b *AutosaveSettingsScopeBox) EncodeTDLibJSON(buf tdjson.Encoder) error {
if b == nil || b.AutosaveSettingsScope == nil {
return fmt.Errorf("unable to encode AutosaveSettingsScopeClass as nil")
}
return b.AutosaveSettingsScope.EncodeTDLibJSON(buf)
}
-295
View File
@@ -1,295 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AvailableGift represents TL type `availableGift#32b210c6`.
type AvailableGift struct {
// The gift
Gift Gift
// Number of gifts that are available for resale
ResaleCount int32
// The minimum price for the gifts available for resale; 0 if there are no such gifts
MinResaleStarCount int64
// The title of the upgraded gift; empty if the gift isn't available for resale
Title string
}
// AvailableGiftTypeID is TL type id of AvailableGift.
const AvailableGiftTypeID = 0x32b210c6
// Ensuring interfaces in compile-time for AvailableGift.
var (
_ bin.Encoder = &AvailableGift{}
_ bin.Decoder = &AvailableGift{}
_ bin.BareEncoder = &AvailableGift{}
_ bin.BareDecoder = &AvailableGift{}
)
func (a *AvailableGift) Zero() bool {
if a == nil {
return true
}
if !(a.Gift.Zero()) {
return false
}
if !(a.ResaleCount == 0) {
return false
}
if !(a.MinResaleStarCount == 0) {
return false
}
if !(a.Title == "") {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AvailableGift) String() string {
if a == nil {
return "AvailableGift(nil)"
}
type Alias AvailableGift
return fmt.Sprintf("AvailableGift%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AvailableGift) TypeID() uint32 {
return AvailableGiftTypeID
}
// TypeName returns name of type in TL schema.
func (*AvailableGift) TypeName() string {
return "availableGift"
}
// TypeInfo returns info about TL type.
func (a *AvailableGift) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "availableGift",
ID: AvailableGiftTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "Gift",
SchemaName: "gift",
},
{
Name: "ResaleCount",
SchemaName: "resale_count",
},
{
Name: "MinResaleStarCount",
SchemaName: "min_resale_star_count",
},
{
Name: "Title",
SchemaName: "title",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AvailableGift) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode availableGift#32b210c6 as nil")
}
b.PutID(AvailableGiftTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AvailableGift) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode availableGift#32b210c6 as nil")
}
if err := a.Gift.Encode(b); err != nil {
return fmt.Errorf("unable to encode availableGift#32b210c6: field gift: %w", err)
}
b.PutInt32(a.ResaleCount)
b.PutInt53(a.MinResaleStarCount)
b.PutString(a.Title)
return nil
}
// Decode implements bin.Decoder.
func (a *AvailableGift) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode availableGift#32b210c6 to nil")
}
if err := b.ConsumeID(AvailableGiftTypeID); err != nil {
return fmt.Errorf("unable to decode availableGift#32b210c6: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AvailableGift) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode availableGift#32b210c6 to nil")
}
{
if err := a.Gift.Decode(b); err != nil {
return fmt.Errorf("unable to decode availableGift#32b210c6: field gift: %w", err)
}
}
{
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode availableGift#32b210c6: field resale_count: %w", err)
}
a.ResaleCount = value
}
{
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode availableGift#32b210c6: field min_resale_star_count: %w", err)
}
a.MinResaleStarCount = value
}
{
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode availableGift#32b210c6: field title: %w", err)
}
a.Title = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AvailableGift) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode availableGift#32b210c6 as nil")
}
b.ObjStart()
b.PutID("availableGift")
b.Comma()
b.FieldStart("gift")
if err := a.Gift.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode availableGift#32b210c6: field gift: %w", err)
}
b.Comma()
b.FieldStart("resale_count")
b.PutInt32(a.ResaleCount)
b.Comma()
b.FieldStart("min_resale_star_count")
b.PutInt53(a.MinResaleStarCount)
b.Comma()
b.FieldStart("title")
b.PutString(a.Title)
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AvailableGift) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode availableGift#32b210c6 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("availableGift"); err != nil {
return fmt.Errorf("unable to decode availableGift#32b210c6: %w", err)
}
case "gift":
if err := a.Gift.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode availableGift#32b210c6: field gift: %w", err)
}
case "resale_count":
value, err := b.Int32()
if err != nil {
return fmt.Errorf("unable to decode availableGift#32b210c6: field resale_count: %w", err)
}
a.ResaleCount = value
case "min_resale_star_count":
value, err := b.Int53()
if err != nil {
return fmt.Errorf("unable to decode availableGift#32b210c6: field min_resale_star_count: %w", err)
}
a.MinResaleStarCount = value
case "title":
value, err := b.String()
if err != nil {
return fmt.Errorf("unable to decode availableGift#32b210c6: field title: %w", err)
}
a.Title = value
default:
return b.Skip()
}
return nil
})
}
// GetGift returns value of Gift field.
func (a *AvailableGift) GetGift() (value Gift) {
if a == nil {
return
}
return a.Gift
}
// GetResaleCount returns value of ResaleCount field.
func (a *AvailableGift) GetResaleCount() (value int32) {
if a == nil {
return
}
return a.ResaleCount
}
// GetMinResaleStarCount returns value of MinResaleStarCount field.
func (a *AvailableGift) GetMinResaleStarCount() (value int64) {
if a == nil {
return
}
return a.MinResaleStarCount
}
// GetTitle returns value of Title field.
func (a *AvailableGift) GetTitle() (value string) {
if a == nil {
return
}
return a.Title
}
-221
View File
@@ -1,221 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AvailableGifts represents TL type `availableGifts#5ce74501`.
type AvailableGifts struct {
// The list of gifts
Gifts []AvailableGift
}
// AvailableGiftsTypeID is TL type id of AvailableGifts.
const AvailableGiftsTypeID = 0x5ce74501
// Ensuring interfaces in compile-time for AvailableGifts.
var (
_ bin.Encoder = &AvailableGifts{}
_ bin.Decoder = &AvailableGifts{}
_ bin.BareEncoder = &AvailableGifts{}
_ bin.BareDecoder = &AvailableGifts{}
)
func (a *AvailableGifts) Zero() bool {
if a == nil {
return true
}
if !(a.Gifts == nil) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AvailableGifts) String() string {
if a == nil {
return "AvailableGifts(nil)"
}
type Alias AvailableGifts
return fmt.Sprintf("AvailableGifts%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AvailableGifts) TypeID() uint32 {
return AvailableGiftsTypeID
}
// TypeName returns name of type in TL schema.
func (*AvailableGifts) TypeName() string {
return "availableGifts"
}
// TypeInfo returns info about TL type.
func (a *AvailableGifts) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "availableGifts",
ID: AvailableGiftsTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "Gifts",
SchemaName: "gifts",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AvailableGifts) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode availableGifts#5ce74501 as nil")
}
b.PutID(AvailableGiftsTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AvailableGifts) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode availableGifts#5ce74501 as nil")
}
b.PutInt(len(a.Gifts))
for idx, v := range a.Gifts {
if err := v.EncodeBare(b); err != nil {
return fmt.Errorf("unable to encode bare availableGifts#5ce74501: field gifts element with index %d: %w", idx, err)
}
}
return nil
}
// Decode implements bin.Decoder.
func (a *AvailableGifts) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode availableGifts#5ce74501 to nil")
}
if err := b.ConsumeID(AvailableGiftsTypeID); err != nil {
return fmt.Errorf("unable to decode availableGifts#5ce74501: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AvailableGifts) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode availableGifts#5ce74501 to nil")
}
{
headerLen, err := b.Int()
if err != nil {
return fmt.Errorf("unable to decode availableGifts#5ce74501: field gifts: %w", err)
}
if headerLen > 0 {
a.Gifts = make([]AvailableGift, 0, headerLen%bin.PreallocateLimit)
}
for idx := 0; idx < headerLen; idx++ {
var value AvailableGift
if err := value.DecodeBare(b); err != nil {
return fmt.Errorf("unable to decode bare availableGifts#5ce74501: field gifts: %w", err)
}
a.Gifts = append(a.Gifts, value)
}
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AvailableGifts) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode availableGifts#5ce74501 as nil")
}
b.ObjStart()
b.PutID("availableGifts")
b.Comma()
b.FieldStart("gifts")
b.ArrStart()
for idx, v := range a.Gifts {
if err := v.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode availableGifts#5ce74501: field gifts element with index %d: %w", idx, err)
}
b.Comma()
}
b.StripComma()
b.ArrEnd()
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AvailableGifts) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode availableGifts#5ce74501 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("availableGifts"); err != nil {
return fmt.Errorf("unable to decode availableGifts#5ce74501: %w", err)
}
case "gifts":
if err := b.Arr(func(b tdjson.Decoder) error {
var value AvailableGift
if err := value.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode availableGifts#5ce74501: field gifts: %w", err)
}
a.Gifts = append(a.Gifts, value)
return nil
}); err != nil {
return fmt.Errorf("unable to decode availableGifts#5ce74501: field gifts: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// GetGifts returns value of Gifts field.
func (a *AvailableGifts) GetGifts() (value []AvailableGift) {
if a == nil {
return
}
return a.Gifts
}
-237
View File
@@ -1,237 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AvailableReaction represents TL type `availableReaction#f9024387`.
type AvailableReaction struct {
// Type of the reaction
Type ReactionTypeClass
// True, if Telegram Premium is needed to send the reaction
NeedsPremium bool
}
// AvailableReactionTypeID is TL type id of AvailableReaction.
const AvailableReactionTypeID = 0xf9024387
// Ensuring interfaces in compile-time for AvailableReaction.
var (
_ bin.Encoder = &AvailableReaction{}
_ bin.Decoder = &AvailableReaction{}
_ bin.BareEncoder = &AvailableReaction{}
_ bin.BareDecoder = &AvailableReaction{}
)
func (a *AvailableReaction) Zero() bool {
if a == nil {
return true
}
if !(a.Type == nil) {
return false
}
if !(a.NeedsPremium == false) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AvailableReaction) String() string {
if a == nil {
return "AvailableReaction(nil)"
}
type Alias AvailableReaction
return fmt.Sprintf("AvailableReaction%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AvailableReaction) TypeID() uint32 {
return AvailableReactionTypeID
}
// TypeName returns name of type in TL schema.
func (*AvailableReaction) TypeName() string {
return "availableReaction"
}
// TypeInfo returns info about TL type.
func (a *AvailableReaction) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "availableReaction",
ID: AvailableReactionTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "Type",
SchemaName: "type",
},
{
Name: "NeedsPremium",
SchemaName: "needs_premium",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AvailableReaction) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode availableReaction#f9024387 as nil")
}
b.PutID(AvailableReactionTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AvailableReaction) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode availableReaction#f9024387 as nil")
}
if a.Type == nil {
return fmt.Errorf("unable to encode availableReaction#f9024387: field type is nil")
}
if err := a.Type.Encode(b); err != nil {
return fmt.Errorf("unable to encode availableReaction#f9024387: field type: %w", err)
}
b.PutBool(a.NeedsPremium)
return nil
}
// Decode implements bin.Decoder.
func (a *AvailableReaction) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode availableReaction#f9024387 to nil")
}
if err := b.ConsumeID(AvailableReactionTypeID); err != nil {
return fmt.Errorf("unable to decode availableReaction#f9024387: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AvailableReaction) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode availableReaction#f9024387 to nil")
}
{
value, err := DecodeReactionType(b)
if err != nil {
return fmt.Errorf("unable to decode availableReaction#f9024387: field type: %w", err)
}
a.Type = value
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode availableReaction#f9024387: field needs_premium: %w", err)
}
a.NeedsPremium = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AvailableReaction) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode availableReaction#f9024387 as nil")
}
b.ObjStart()
b.PutID("availableReaction")
b.Comma()
b.FieldStart("type")
if a.Type == nil {
return fmt.Errorf("unable to encode availableReaction#f9024387: field type is nil")
}
if err := a.Type.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode availableReaction#f9024387: field type: %w", err)
}
b.Comma()
b.FieldStart("needs_premium")
b.PutBool(a.NeedsPremium)
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AvailableReaction) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode availableReaction#f9024387 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("availableReaction"); err != nil {
return fmt.Errorf("unable to decode availableReaction#f9024387: %w", err)
}
case "type":
value, err := DecodeTDLibJSONReactionType(b)
if err != nil {
return fmt.Errorf("unable to decode availableReaction#f9024387: field type: %w", err)
}
a.Type = value
case "needs_premium":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode availableReaction#f9024387: field needs_premium: %w", err)
}
a.NeedsPremium = value
default:
return b.Skip()
}
return nil
})
}
// GetType returns value of Type field.
func (a *AvailableReaction) GetType() (value ReactionTypeClass) {
if a == nil {
return
}
return a.Type
}
// GetNeedsPremium returns value of NeedsPremium field.
func (a *AvailableReaction) GetNeedsPremium() (value bool) {
if a == nil {
return
}
return a.NeedsPremium
}
-458
View File
@@ -1,458 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// AvailableReactions represents TL type `availableReactions#3596f453`.
type AvailableReactions struct {
// List of reactions to be shown at the top
TopReactions []AvailableReaction
// List of recently used reactions
RecentReactions []AvailableReaction
// List of popular reactions
PopularReactions []AvailableReaction
// True, if any custom emoji reaction can be added by Telegram Premium subscribers
AllowCustomEmoji bool
// True, if the reactions will be tags and the message can be found by them
AreTags bool
// The reason why the current user can't add reactions to the message, despite some other
// users can; may be null if none
UnavailabilityReason ReactionUnavailabilityReasonClass
}
// AvailableReactionsTypeID is TL type id of AvailableReactions.
const AvailableReactionsTypeID = 0x3596f453
// Ensuring interfaces in compile-time for AvailableReactions.
var (
_ bin.Encoder = &AvailableReactions{}
_ bin.Decoder = &AvailableReactions{}
_ bin.BareEncoder = &AvailableReactions{}
_ bin.BareDecoder = &AvailableReactions{}
)
func (a *AvailableReactions) Zero() bool {
if a == nil {
return true
}
if !(a.TopReactions == nil) {
return false
}
if !(a.RecentReactions == nil) {
return false
}
if !(a.PopularReactions == nil) {
return false
}
if !(a.AllowCustomEmoji == false) {
return false
}
if !(a.AreTags == false) {
return false
}
if !(a.UnavailabilityReason == nil) {
return false
}
return true
}
// String implements fmt.Stringer.
func (a *AvailableReactions) String() string {
if a == nil {
return "AvailableReactions(nil)"
}
type Alias AvailableReactions
return fmt.Sprintf("AvailableReactions%+v", Alias(*a))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AvailableReactions) TypeID() uint32 {
return AvailableReactionsTypeID
}
// TypeName returns name of type in TL schema.
func (*AvailableReactions) TypeName() string {
return "availableReactions"
}
// TypeInfo returns info about TL type.
func (a *AvailableReactions) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "availableReactions",
ID: AvailableReactionsTypeID,
}
if a == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "TopReactions",
SchemaName: "top_reactions",
},
{
Name: "RecentReactions",
SchemaName: "recent_reactions",
},
{
Name: "PopularReactions",
SchemaName: "popular_reactions",
},
{
Name: "AllowCustomEmoji",
SchemaName: "allow_custom_emoji",
},
{
Name: "AreTags",
SchemaName: "are_tags",
},
{
Name: "UnavailabilityReason",
SchemaName: "unavailability_reason",
},
}
return typ
}
// Encode implements bin.Encoder.
func (a *AvailableReactions) Encode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode availableReactions#3596f453 as nil")
}
b.PutID(AvailableReactionsTypeID)
return a.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (a *AvailableReactions) EncodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't encode availableReactions#3596f453 as nil")
}
b.PutInt(len(a.TopReactions))
for idx, v := range a.TopReactions {
if err := v.EncodeBare(b); err != nil {
return fmt.Errorf("unable to encode bare availableReactions#3596f453: field top_reactions element with index %d: %w", idx, err)
}
}
b.PutInt(len(a.RecentReactions))
for idx, v := range a.RecentReactions {
if err := v.EncodeBare(b); err != nil {
return fmt.Errorf("unable to encode bare availableReactions#3596f453: field recent_reactions element with index %d: %w", idx, err)
}
}
b.PutInt(len(a.PopularReactions))
for idx, v := range a.PopularReactions {
if err := v.EncodeBare(b); err != nil {
return fmt.Errorf("unable to encode bare availableReactions#3596f453: field popular_reactions element with index %d: %w", idx, err)
}
}
b.PutBool(a.AllowCustomEmoji)
b.PutBool(a.AreTags)
if a.UnavailabilityReason == nil {
return fmt.Errorf("unable to encode availableReactions#3596f453: field unavailability_reason is nil")
}
if err := a.UnavailabilityReason.Encode(b); err != nil {
return fmt.Errorf("unable to encode availableReactions#3596f453: field unavailability_reason: %w", err)
}
return nil
}
// Decode implements bin.Decoder.
func (a *AvailableReactions) Decode(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode availableReactions#3596f453 to nil")
}
if err := b.ConsumeID(AvailableReactionsTypeID); err != nil {
return fmt.Errorf("unable to decode availableReactions#3596f453: %w", err)
}
return a.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (a *AvailableReactions) DecodeBare(b *bin.Buffer) error {
if a == nil {
return fmt.Errorf("can't decode availableReactions#3596f453 to nil")
}
{
headerLen, err := b.Int()
if err != nil {
return fmt.Errorf("unable to decode availableReactions#3596f453: field top_reactions: %w", err)
}
if headerLen > 0 {
a.TopReactions = make([]AvailableReaction, 0, headerLen%bin.PreallocateLimit)
}
for idx := 0; idx < headerLen; idx++ {
var value AvailableReaction
if err := value.DecodeBare(b); err != nil {
return fmt.Errorf("unable to decode bare availableReactions#3596f453: field top_reactions: %w", err)
}
a.TopReactions = append(a.TopReactions, value)
}
}
{
headerLen, err := b.Int()
if err != nil {
return fmt.Errorf("unable to decode availableReactions#3596f453: field recent_reactions: %w", err)
}
if headerLen > 0 {
a.RecentReactions = make([]AvailableReaction, 0, headerLen%bin.PreallocateLimit)
}
for idx := 0; idx < headerLen; idx++ {
var value AvailableReaction
if err := value.DecodeBare(b); err != nil {
return fmt.Errorf("unable to decode bare availableReactions#3596f453: field recent_reactions: %w", err)
}
a.RecentReactions = append(a.RecentReactions, value)
}
}
{
headerLen, err := b.Int()
if err != nil {
return fmt.Errorf("unable to decode availableReactions#3596f453: field popular_reactions: %w", err)
}
if headerLen > 0 {
a.PopularReactions = make([]AvailableReaction, 0, headerLen%bin.PreallocateLimit)
}
for idx := 0; idx < headerLen; idx++ {
var value AvailableReaction
if err := value.DecodeBare(b); err != nil {
return fmt.Errorf("unable to decode bare availableReactions#3596f453: field popular_reactions: %w", err)
}
a.PopularReactions = append(a.PopularReactions, value)
}
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode availableReactions#3596f453: field allow_custom_emoji: %w", err)
}
a.AllowCustomEmoji = value
}
{
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode availableReactions#3596f453: field are_tags: %w", err)
}
a.AreTags = value
}
{
value, err := DecodeReactionUnavailabilityReason(b)
if err != nil {
return fmt.Errorf("unable to decode availableReactions#3596f453: field unavailability_reason: %w", err)
}
a.UnavailabilityReason = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (a *AvailableReactions) EncodeTDLibJSON(b tdjson.Encoder) error {
if a == nil {
return fmt.Errorf("can't encode availableReactions#3596f453 as nil")
}
b.ObjStart()
b.PutID("availableReactions")
b.Comma()
b.FieldStart("top_reactions")
b.ArrStart()
for idx, v := range a.TopReactions {
if err := v.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode availableReactions#3596f453: field top_reactions element with index %d: %w", idx, err)
}
b.Comma()
}
b.StripComma()
b.ArrEnd()
b.Comma()
b.FieldStart("recent_reactions")
b.ArrStart()
for idx, v := range a.RecentReactions {
if err := v.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode availableReactions#3596f453: field recent_reactions element with index %d: %w", idx, err)
}
b.Comma()
}
b.StripComma()
b.ArrEnd()
b.Comma()
b.FieldStart("popular_reactions")
b.ArrStart()
for idx, v := range a.PopularReactions {
if err := v.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode availableReactions#3596f453: field popular_reactions element with index %d: %w", idx, err)
}
b.Comma()
}
b.StripComma()
b.ArrEnd()
b.Comma()
b.FieldStart("allow_custom_emoji")
b.PutBool(a.AllowCustomEmoji)
b.Comma()
b.FieldStart("are_tags")
b.PutBool(a.AreTags)
b.Comma()
b.FieldStart("unavailability_reason")
if a.UnavailabilityReason == nil {
return fmt.Errorf("unable to encode availableReactions#3596f453: field unavailability_reason is nil")
}
if err := a.UnavailabilityReason.EncodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to encode availableReactions#3596f453: field unavailability_reason: %w", err)
}
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (a *AvailableReactions) DecodeTDLibJSON(b tdjson.Decoder) error {
if a == nil {
return fmt.Errorf("can't decode availableReactions#3596f453 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("availableReactions"); err != nil {
return fmt.Errorf("unable to decode availableReactions#3596f453: %w", err)
}
case "top_reactions":
if err := b.Arr(func(b tdjson.Decoder) error {
var value AvailableReaction
if err := value.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode availableReactions#3596f453: field top_reactions: %w", err)
}
a.TopReactions = append(a.TopReactions, value)
return nil
}); err != nil {
return fmt.Errorf("unable to decode availableReactions#3596f453: field top_reactions: %w", err)
}
case "recent_reactions":
if err := b.Arr(func(b tdjson.Decoder) error {
var value AvailableReaction
if err := value.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode availableReactions#3596f453: field recent_reactions: %w", err)
}
a.RecentReactions = append(a.RecentReactions, value)
return nil
}); err != nil {
return fmt.Errorf("unable to decode availableReactions#3596f453: field recent_reactions: %w", err)
}
case "popular_reactions":
if err := b.Arr(func(b tdjson.Decoder) error {
var value AvailableReaction
if err := value.DecodeTDLibJSON(b); err != nil {
return fmt.Errorf("unable to decode availableReactions#3596f453: field popular_reactions: %w", err)
}
a.PopularReactions = append(a.PopularReactions, value)
return nil
}); err != nil {
return fmt.Errorf("unable to decode availableReactions#3596f453: field popular_reactions: %w", err)
}
case "allow_custom_emoji":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode availableReactions#3596f453: field allow_custom_emoji: %w", err)
}
a.AllowCustomEmoji = value
case "are_tags":
value, err := b.Bool()
if err != nil {
return fmt.Errorf("unable to decode availableReactions#3596f453: field are_tags: %w", err)
}
a.AreTags = value
case "unavailability_reason":
value, err := DecodeTDLibJSONReactionUnavailabilityReason(b)
if err != nil {
return fmt.Errorf("unable to decode availableReactions#3596f453: field unavailability_reason: %w", err)
}
a.UnavailabilityReason = value
default:
return b.Skip()
}
return nil
})
}
// GetTopReactions returns value of TopReactions field.
func (a *AvailableReactions) GetTopReactions() (value []AvailableReaction) {
if a == nil {
return
}
return a.TopReactions
}
// GetRecentReactions returns value of RecentReactions field.
func (a *AvailableReactions) GetRecentReactions() (value []AvailableReaction) {
if a == nil {
return
}
return a.RecentReactions
}
// GetPopularReactions returns value of PopularReactions field.
func (a *AvailableReactions) GetPopularReactions() (value []AvailableReaction) {
if a == nil {
return
}
return a.PopularReactions
}
// GetAllowCustomEmoji returns value of AllowCustomEmoji field.
func (a *AvailableReactions) GetAllowCustomEmoji() (value bool) {
if a == nil {
return
}
return a.AllowCustomEmoji
}
// GetAreTags returns value of AreTags field.
func (a *AvailableReactions) GetAreTags() (value bool) {
if a == nil {
return
}
return a.AreTags
}
// GetUnavailabilityReason returns value of UnavailabilityReason field.
func (a *AvailableReactions) GetUnavailabilityReason() (value ReactionUnavailabilityReasonClass) {
if a == nil {
return
}
return a.UnavailabilityReason
}
-775
View File
@@ -1,775 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// BackgroundFillSolid represents TL type `backgroundFillSolid#3c3dbc1d`.
type BackgroundFillSolid struct {
// A color of the background in the RGB format
Color int32
}
// BackgroundFillSolidTypeID is TL type id of BackgroundFillSolid.
const BackgroundFillSolidTypeID = 0x3c3dbc1d
// construct implements constructor of BackgroundFillClass.
func (b BackgroundFillSolid) construct() BackgroundFillClass { return &b }
// Ensuring interfaces in compile-time for BackgroundFillSolid.
var (
_ bin.Encoder = &BackgroundFillSolid{}
_ bin.Decoder = &BackgroundFillSolid{}
_ bin.BareEncoder = &BackgroundFillSolid{}
_ bin.BareDecoder = &BackgroundFillSolid{}
_ BackgroundFillClass = &BackgroundFillSolid{}
)
func (b *BackgroundFillSolid) Zero() bool {
if b == nil {
return true
}
if !(b.Color == 0) {
return false
}
return true
}
// String implements fmt.Stringer.
func (b *BackgroundFillSolid) String() string {
if b == nil {
return "BackgroundFillSolid(nil)"
}
type Alias BackgroundFillSolid
return fmt.Sprintf("BackgroundFillSolid%+v", Alias(*b))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*BackgroundFillSolid) TypeID() uint32 {
return BackgroundFillSolidTypeID
}
// TypeName returns name of type in TL schema.
func (*BackgroundFillSolid) TypeName() string {
return "backgroundFillSolid"
}
// TypeInfo returns info about TL type.
func (b *BackgroundFillSolid) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "backgroundFillSolid",
ID: BackgroundFillSolidTypeID,
}
if b == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "Color",
SchemaName: "color",
},
}
return typ
}
// Encode implements bin.Encoder.
func (b *BackgroundFillSolid) Encode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode backgroundFillSolid#3c3dbc1d as nil")
}
buf.PutID(BackgroundFillSolidTypeID)
return b.EncodeBare(buf)
}
// EncodeBare implements bin.BareEncoder.
func (b *BackgroundFillSolid) EncodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode backgroundFillSolid#3c3dbc1d as nil")
}
buf.PutInt32(b.Color)
return nil
}
// Decode implements bin.Decoder.
func (b *BackgroundFillSolid) Decode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode backgroundFillSolid#3c3dbc1d to nil")
}
if err := buf.ConsumeID(BackgroundFillSolidTypeID); err != nil {
return fmt.Errorf("unable to decode backgroundFillSolid#3c3dbc1d: %w", err)
}
return b.DecodeBare(buf)
}
// DecodeBare implements bin.BareDecoder.
func (b *BackgroundFillSolid) DecodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode backgroundFillSolid#3c3dbc1d to nil")
}
{
value, err := buf.Int32()
if err != nil {
return fmt.Errorf("unable to decode backgroundFillSolid#3c3dbc1d: field color: %w", err)
}
b.Color = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (b *BackgroundFillSolid) EncodeTDLibJSON(buf tdjson.Encoder) error {
if b == nil {
return fmt.Errorf("can't encode backgroundFillSolid#3c3dbc1d as nil")
}
buf.ObjStart()
buf.PutID("backgroundFillSolid")
buf.Comma()
buf.FieldStart("color")
buf.PutInt32(b.Color)
buf.Comma()
buf.StripComma()
buf.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (b *BackgroundFillSolid) DecodeTDLibJSON(buf tdjson.Decoder) error {
if b == nil {
return fmt.Errorf("can't decode backgroundFillSolid#3c3dbc1d to nil")
}
return buf.Obj(func(buf tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := buf.ConsumeID("backgroundFillSolid"); err != nil {
return fmt.Errorf("unable to decode backgroundFillSolid#3c3dbc1d: %w", err)
}
case "color":
value, err := buf.Int32()
if err != nil {
return fmt.Errorf("unable to decode backgroundFillSolid#3c3dbc1d: field color: %w", err)
}
b.Color = value
default:
return buf.Skip()
}
return nil
})
}
// GetColor returns value of Color field.
func (b *BackgroundFillSolid) GetColor() (value int32) {
if b == nil {
return
}
return b.Color
}
// BackgroundFillGradient represents TL type `backgroundFillGradient#925ff17f`.
type BackgroundFillGradient struct {
// A top color of the background in the RGB format
TopColor int32
// A bottom color of the background in the RGB format
BottomColor int32
// Clockwise rotation angle of the gradient, in degrees; 0-359. Must always be divisible
// by 45
RotationAngle int32
}
// BackgroundFillGradientTypeID is TL type id of BackgroundFillGradient.
const BackgroundFillGradientTypeID = 0x925ff17f
// construct implements constructor of BackgroundFillClass.
func (b BackgroundFillGradient) construct() BackgroundFillClass { return &b }
// Ensuring interfaces in compile-time for BackgroundFillGradient.
var (
_ bin.Encoder = &BackgroundFillGradient{}
_ bin.Decoder = &BackgroundFillGradient{}
_ bin.BareEncoder = &BackgroundFillGradient{}
_ bin.BareDecoder = &BackgroundFillGradient{}
_ BackgroundFillClass = &BackgroundFillGradient{}
)
func (b *BackgroundFillGradient) Zero() bool {
if b == nil {
return true
}
if !(b.TopColor == 0) {
return false
}
if !(b.BottomColor == 0) {
return false
}
if !(b.RotationAngle == 0) {
return false
}
return true
}
// String implements fmt.Stringer.
func (b *BackgroundFillGradient) String() string {
if b == nil {
return "BackgroundFillGradient(nil)"
}
type Alias BackgroundFillGradient
return fmt.Sprintf("BackgroundFillGradient%+v", Alias(*b))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*BackgroundFillGradient) TypeID() uint32 {
return BackgroundFillGradientTypeID
}
// TypeName returns name of type in TL schema.
func (*BackgroundFillGradient) TypeName() string {
return "backgroundFillGradient"
}
// TypeInfo returns info about TL type.
func (b *BackgroundFillGradient) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "backgroundFillGradient",
ID: BackgroundFillGradientTypeID,
}
if b == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "TopColor",
SchemaName: "top_color",
},
{
Name: "BottomColor",
SchemaName: "bottom_color",
},
{
Name: "RotationAngle",
SchemaName: "rotation_angle",
},
}
return typ
}
// Encode implements bin.Encoder.
func (b *BackgroundFillGradient) Encode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode backgroundFillGradient#925ff17f as nil")
}
buf.PutID(BackgroundFillGradientTypeID)
return b.EncodeBare(buf)
}
// EncodeBare implements bin.BareEncoder.
func (b *BackgroundFillGradient) EncodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode backgroundFillGradient#925ff17f as nil")
}
buf.PutInt32(b.TopColor)
buf.PutInt32(b.BottomColor)
buf.PutInt32(b.RotationAngle)
return nil
}
// Decode implements bin.Decoder.
func (b *BackgroundFillGradient) Decode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode backgroundFillGradient#925ff17f to nil")
}
if err := buf.ConsumeID(BackgroundFillGradientTypeID); err != nil {
return fmt.Errorf("unable to decode backgroundFillGradient#925ff17f: %w", err)
}
return b.DecodeBare(buf)
}
// DecodeBare implements bin.BareDecoder.
func (b *BackgroundFillGradient) DecodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode backgroundFillGradient#925ff17f to nil")
}
{
value, err := buf.Int32()
if err != nil {
return fmt.Errorf("unable to decode backgroundFillGradient#925ff17f: field top_color: %w", err)
}
b.TopColor = value
}
{
value, err := buf.Int32()
if err != nil {
return fmt.Errorf("unable to decode backgroundFillGradient#925ff17f: field bottom_color: %w", err)
}
b.BottomColor = value
}
{
value, err := buf.Int32()
if err != nil {
return fmt.Errorf("unable to decode backgroundFillGradient#925ff17f: field rotation_angle: %w", err)
}
b.RotationAngle = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (b *BackgroundFillGradient) EncodeTDLibJSON(buf tdjson.Encoder) error {
if b == nil {
return fmt.Errorf("can't encode backgroundFillGradient#925ff17f as nil")
}
buf.ObjStart()
buf.PutID("backgroundFillGradient")
buf.Comma()
buf.FieldStart("top_color")
buf.PutInt32(b.TopColor)
buf.Comma()
buf.FieldStart("bottom_color")
buf.PutInt32(b.BottomColor)
buf.Comma()
buf.FieldStart("rotation_angle")
buf.PutInt32(b.RotationAngle)
buf.Comma()
buf.StripComma()
buf.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (b *BackgroundFillGradient) DecodeTDLibJSON(buf tdjson.Decoder) error {
if b == nil {
return fmt.Errorf("can't decode backgroundFillGradient#925ff17f to nil")
}
return buf.Obj(func(buf tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := buf.ConsumeID("backgroundFillGradient"); err != nil {
return fmt.Errorf("unable to decode backgroundFillGradient#925ff17f: %w", err)
}
case "top_color":
value, err := buf.Int32()
if err != nil {
return fmt.Errorf("unable to decode backgroundFillGradient#925ff17f: field top_color: %w", err)
}
b.TopColor = value
case "bottom_color":
value, err := buf.Int32()
if err != nil {
return fmt.Errorf("unable to decode backgroundFillGradient#925ff17f: field bottom_color: %w", err)
}
b.BottomColor = value
case "rotation_angle":
value, err := buf.Int32()
if err != nil {
return fmt.Errorf("unable to decode backgroundFillGradient#925ff17f: field rotation_angle: %w", err)
}
b.RotationAngle = value
default:
return buf.Skip()
}
return nil
})
}
// GetTopColor returns value of TopColor field.
func (b *BackgroundFillGradient) GetTopColor() (value int32) {
if b == nil {
return
}
return b.TopColor
}
// GetBottomColor returns value of BottomColor field.
func (b *BackgroundFillGradient) GetBottomColor() (value int32) {
if b == nil {
return
}
return b.BottomColor
}
// GetRotationAngle returns value of RotationAngle field.
func (b *BackgroundFillGradient) GetRotationAngle() (value int32) {
if b == nil {
return
}
return b.RotationAngle
}
// BackgroundFillFreeformGradient represents TL type `backgroundFillFreeformGradient#fa31756a`.
type BackgroundFillFreeformGradient struct {
// A list of 3 or 4 colors of the freeform gradient in the RGB format
Colors []int32
}
// BackgroundFillFreeformGradientTypeID is TL type id of BackgroundFillFreeformGradient.
const BackgroundFillFreeformGradientTypeID = 0xfa31756a
// construct implements constructor of BackgroundFillClass.
func (b BackgroundFillFreeformGradient) construct() BackgroundFillClass { return &b }
// Ensuring interfaces in compile-time for BackgroundFillFreeformGradient.
var (
_ bin.Encoder = &BackgroundFillFreeformGradient{}
_ bin.Decoder = &BackgroundFillFreeformGradient{}
_ bin.BareEncoder = &BackgroundFillFreeformGradient{}
_ bin.BareDecoder = &BackgroundFillFreeformGradient{}
_ BackgroundFillClass = &BackgroundFillFreeformGradient{}
)
func (b *BackgroundFillFreeformGradient) Zero() bool {
if b == nil {
return true
}
if !(b.Colors == nil) {
return false
}
return true
}
// String implements fmt.Stringer.
func (b *BackgroundFillFreeformGradient) String() string {
if b == nil {
return "BackgroundFillFreeformGradient(nil)"
}
type Alias BackgroundFillFreeformGradient
return fmt.Sprintf("BackgroundFillFreeformGradient%+v", Alias(*b))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*BackgroundFillFreeformGradient) TypeID() uint32 {
return BackgroundFillFreeformGradientTypeID
}
// TypeName returns name of type in TL schema.
func (*BackgroundFillFreeformGradient) TypeName() string {
return "backgroundFillFreeformGradient"
}
// TypeInfo returns info about TL type.
func (b *BackgroundFillFreeformGradient) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "backgroundFillFreeformGradient",
ID: BackgroundFillFreeformGradientTypeID,
}
if b == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "Colors",
SchemaName: "colors",
},
}
return typ
}
// Encode implements bin.Encoder.
func (b *BackgroundFillFreeformGradient) Encode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode backgroundFillFreeformGradient#fa31756a as nil")
}
buf.PutID(BackgroundFillFreeformGradientTypeID)
return b.EncodeBare(buf)
}
// EncodeBare implements bin.BareEncoder.
func (b *BackgroundFillFreeformGradient) EncodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode backgroundFillFreeformGradient#fa31756a as nil")
}
buf.PutInt(len(b.Colors))
for _, v := range b.Colors {
buf.PutInt32(v)
}
return nil
}
// Decode implements bin.Decoder.
func (b *BackgroundFillFreeformGradient) Decode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode backgroundFillFreeformGradient#fa31756a to nil")
}
if err := buf.ConsumeID(BackgroundFillFreeformGradientTypeID); err != nil {
return fmt.Errorf("unable to decode backgroundFillFreeformGradient#fa31756a: %w", err)
}
return b.DecodeBare(buf)
}
// DecodeBare implements bin.BareDecoder.
func (b *BackgroundFillFreeformGradient) DecodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode backgroundFillFreeformGradient#fa31756a to nil")
}
{
headerLen, err := buf.Int()
if err != nil {
return fmt.Errorf("unable to decode backgroundFillFreeformGradient#fa31756a: field colors: %w", err)
}
if headerLen > 0 {
b.Colors = make([]int32, 0, headerLen%bin.PreallocateLimit)
}
for idx := 0; idx < headerLen; idx++ {
value, err := buf.Int32()
if err != nil {
return fmt.Errorf("unable to decode backgroundFillFreeformGradient#fa31756a: field colors: %w", err)
}
b.Colors = append(b.Colors, value)
}
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (b *BackgroundFillFreeformGradient) EncodeTDLibJSON(buf tdjson.Encoder) error {
if b == nil {
return fmt.Errorf("can't encode backgroundFillFreeformGradient#fa31756a as nil")
}
buf.ObjStart()
buf.PutID("backgroundFillFreeformGradient")
buf.Comma()
buf.FieldStart("colors")
buf.ArrStart()
for _, v := range b.Colors {
buf.PutInt32(v)
buf.Comma()
}
buf.StripComma()
buf.ArrEnd()
buf.Comma()
buf.StripComma()
buf.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (b *BackgroundFillFreeformGradient) DecodeTDLibJSON(buf tdjson.Decoder) error {
if b == nil {
return fmt.Errorf("can't decode backgroundFillFreeformGradient#fa31756a to nil")
}
return buf.Obj(func(buf tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := buf.ConsumeID("backgroundFillFreeformGradient"); err != nil {
return fmt.Errorf("unable to decode backgroundFillFreeformGradient#fa31756a: %w", err)
}
case "colors":
if err := buf.Arr(func(buf tdjson.Decoder) error {
value, err := buf.Int32()
if err != nil {
return fmt.Errorf("unable to decode backgroundFillFreeformGradient#fa31756a: field colors: %w", err)
}
b.Colors = append(b.Colors, value)
return nil
}); err != nil {
return fmt.Errorf("unable to decode backgroundFillFreeformGradient#fa31756a: field colors: %w", err)
}
default:
return buf.Skip()
}
return nil
})
}
// GetColors returns value of Colors field.
func (b *BackgroundFillFreeformGradient) GetColors() (value []int32) {
if b == nil {
return
}
return b.Colors
}
// BackgroundFillClassName is schema name of BackgroundFillClass.
const BackgroundFillClassName = "BackgroundFill"
// BackgroundFillClass represents BackgroundFill generic type.
//
// Example:
//
// g, err := tdapi.DecodeBackgroundFill(buf)
// if err != nil {
// panic(err)
// }
// switch v := g.(type) {
// case *tdapi.BackgroundFillSolid: // backgroundFillSolid#3c3dbc1d
// case *tdapi.BackgroundFillGradient: // backgroundFillGradient#925ff17f
// case *tdapi.BackgroundFillFreeformGradient: // backgroundFillFreeformGradient#fa31756a
// default: panic(v)
// }
type BackgroundFillClass interface {
bin.Encoder
bin.Decoder
bin.BareEncoder
bin.BareDecoder
construct() BackgroundFillClass
// 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
EncodeTDLibJSON(b tdjson.Encoder) error
DecodeTDLibJSON(b tdjson.Decoder) error
}
// DecodeBackgroundFill implements binary de-serialization for BackgroundFillClass.
func DecodeBackgroundFill(buf *bin.Buffer) (BackgroundFillClass, error) {
id, err := buf.PeekID()
if err != nil {
return nil, err
}
switch id {
case BackgroundFillSolidTypeID:
// Decoding backgroundFillSolid#3c3dbc1d.
v := BackgroundFillSolid{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode BackgroundFillClass: %w", err)
}
return &v, nil
case BackgroundFillGradientTypeID:
// Decoding backgroundFillGradient#925ff17f.
v := BackgroundFillGradient{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode BackgroundFillClass: %w", err)
}
return &v, nil
case BackgroundFillFreeformGradientTypeID:
// Decoding backgroundFillFreeformGradient#fa31756a.
v := BackgroundFillFreeformGradient{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode BackgroundFillClass: %w", err)
}
return &v, nil
default:
return nil, fmt.Errorf("unable to decode BackgroundFillClass: %w", bin.NewUnexpectedID(id))
}
}
// DecodeTDLibJSONBackgroundFill implements binary de-serialization for BackgroundFillClass.
func DecodeTDLibJSONBackgroundFill(buf tdjson.Decoder) (BackgroundFillClass, error) {
id, err := buf.FindTypeID()
if err != nil {
return nil, err
}
switch id {
case "backgroundFillSolid":
// Decoding backgroundFillSolid#3c3dbc1d.
v := BackgroundFillSolid{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode BackgroundFillClass: %w", err)
}
return &v, nil
case "backgroundFillGradient":
// Decoding backgroundFillGradient#925ff17f.
v := BackgroundFillGradient{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode BackgroundFillClass: %w", err)
}
return &v, nil
case "backgroundFillFreeformGradient":
// Decoding backgroundFillFreeformGradient#fa31756a.
v := BackgroundFillFreeformGradient{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode BackgroundFillClass: %w", err)
}
return &v, nil
default:
return nil, fmt.Errorf("unable to decode BackgroundFillClass: %w", tdjson.NewUnexpectedID(id))
}
}
// BackgroundFill boxes the BackgroundFillClass providing a helper.
type BackgroundFillBox struct {
BackgroundFill BackgroundFillClass
}
// Decode implements bin.Decoder for BackgroundFillBox.
func (b *BackgroundFillBox) Decode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("unable to decode BackgroundFillBox to nil")
}
v, err := DecodeBackgroundFill(buf)
if err != nil {
return fmt.Errorf("unable to decode boxed value: %w", err)
}
b.BackgroundFill = v
return nil
}
// Encode implements bin.Encode for BackgroundFillBox.
func (b *BackgroundFillBox) Encode(buf *bin.Buffer) error {
if b == nil || b.BackgroundFill == nil {
return fmt.Errorf("unable to encode BackgroundFillClass as nil")
}
return b.BackgroundFill.Encode(buf)
}
// DecodeTDLibJSON implements bin.Decoder for BackgroundFillBox.
func (b *BackgroundFillBox) DecodeTDLibJSON(buf tdjson.Decoder) error {
if b == nil {
return fmt.Errorf("unable to decode BackgroundFillBox to nil")
}
v, err := DecodeTDLibJSONBackgroundFill(buf)
if err != nil {
return fmt.Errorf("unable to decode boxed value: %w", err)
}
b.BackgroundFill = v
return nil
}
// EncodeTDLibJSON implements bin.Encode for BackgroundFillBox.
func (b *BackgroundFillBox) EncodeTDLibJSON(buf tdjson.Encoder) error {
if b == nil || b.BackgroundFill == nil {
return fmt.Errorf("unable to encode BackgroundFillClass as nil")
}
return b.BackgroundFill.EncodeTDLibJSON(buf)
}
-374
View File
@@ -1,374 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// Background represents TL type `background#e65f291c`.
type Background struct {
// Unique background identifier
ID int64
// True, if this is one of default backgrounds
IsDefault bool
// True, if the background is dark and is recommended to be used with dark theme
IsDark bool
// Unique background name
Name string
// Document with the background; may be null. Null only for filled and chat theme
// backgrounds
Document Document
// Type of the background
Type BackgroundTypeClass
}
// BackgroundTypeID is TL type id of Background.
const BackgroundTypeID = 0xe65f291c
// Ensuring interfaces in compile-time for Background.
var (
_ bin.Encoder = &Background{}
_ bin.Decoder = &Background{}
_ bin.BareEncoder = &Background{}
_ bin.BareDecoder = &Background{}
)
func (b *Background) Zero() bool {
if b == nil {
return true
}
if !(b.ID == 0) {
return false
}
if !(b.IsDefault == false) {
return false
}
if !(b.IsDark == false) {
return false
}
if !(b.Name == "") {
return false
}
if !(b.Document.Zero()) {
return false
}
if !(b.Type == nil) {
return false
}
return true
}
// String implements fmt.Stringer.
func (b *Background) String() string {
if b == nil {
return "Background(nil)"
}
type Alias Background
return fmt.Sprintf("Background%+v", Alias(*b))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*Background) TypeID() uint32 {
return BackgroundTypeID
}
// TypeName returns name of type in TL schema.
func (*Background) TypeName() string {
return "background"
}
// TypeInfo returns info about TL type.
func (b *Background) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "background",
ID: BackgroundTypeID,
}
if b == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "ID",
SchemaName: "id",
},
{
Name: "IsDefault",
SchemaName: "is_default",
},
{
Name: "IsDark",
SchemaName: "is_dark",
},
{
Name: "Name",
SchemaName: "name",
},
{
Name: "Document",
SchemaName: "document",
},
{
Name: "Type",
SchemaName: "type",
},
}
return typ
}
// Encode implements bin.Encoder.
func (b *Background) Encode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode background#e65f291c as nil")
}
buf.PutID(BackgroundTypeID)
return b.EncodeBare(buf)
}
// EncodeBare implements bin.BareEncoder.
func (b *Background) EncodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode background#e65f291c as nil")
}
buf.PutLong(b.ID)
buf.PutBool(b.IsDefault)
buf.PutBool(b.IsDark)
buf.PutString(b.Name)
if err := b.Document.Encode(buf); err != nil {
return fmt.Errorf("unable to encode background#e65f291c: field document: %w", err)
}
if b.Type == nil {
return fmt.Errorf("unable to encode background#e65f291c: field type is nil")
}
if err := b.Type.Encode(buf); err != nil {
return fmt.Errorf("unable to encode background#e65f291c: field type: %w", err)
}
return nil
}
// Decode implements bin.Decoder.
func (b *Background) Decode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode background#e65f291c to nil")
}
if err := buf.ConsumeID(BackgroundTypeID); err != nil {
return fmt.Errorf("unable to decode background#e65f291c: %w", err)
}
return b.DecodeBare(buf)
}
// DecodeBare implements bin.BareDecoder.
func (b *Background) DecodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode background#e65f291c to nil")
}
{
value, err := buf.Long()
if err != nil {
return fmt.Errorf("unable to decode background#e65f291c: field id: %w", err)
}
b.ID = value
}
{
value, err := buf.Bool()
if err != nil {
return fmt.Errorf("unable to decode background#e65f291c: field is_default: %w", err)
}
b.IsDefault = value
}
{
value, err := buf.Bool()
if err != nil {
return fmt.Errorf("unable to decode background#e65f291c: field is_dark: %w", err)
}
b.IsDark = value
}
{
value, err := buf.String()
if err != nil {
return fmt.Errorf("unable to decode background#e65f291c: field name: %w", err)
}
b.Name = value
}
{
if err := b.Document.Decode(buf); err != nil {
return fmt.Errorf("unable to decode background#e65f291c: field document: %w", err)
}
}
{
value, err := DecodeBackgroundType(buf)
if err != nil {
return fmt.Errorf("unable to decode background#e65f291c: field type: %w", err)
}
b.Type = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (b *Background) EncodeTDLibJSON(buf tdjson.Encoder) error {
if b == nil {
return fmt.Errorf("can't encode background#e65f291c as nil")
}
buf.ObjStart()
buf.PutID("background")
buf.Comma()
buf.FieldStart("id")
buf.PutLong(b.ID)
buf.Comma()
buf.FieldStart("is_default")
buf.PutBool(b.IsDefault)
buf.Comma()
buf.FieldStart("is_dark")
buf.PutBool(b.IsDark)
buf.Comma()
buf.FieldStart("name")
buf.PutString(b.Name)
buf.Comma()
buf.FieldStart("document")
if err := b.Document.EncodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to encode background#e65f291c: field document: %w", err)
}
buf.Comma()
buf.FieldStart("type")
if b.Type == nil {
return fmt.Errorf("unable to encode background#e65f291c: field type is nil")
}
if err := b.Type.EncodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to encode background#e65f291c: field type: %w", err)
}
buf.Comma()
buf.StripComma()
buf.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (b *Background) DecodeTDLibJSON(buf tdjson.Decoder) error {
if b == nil {
return fmt.Errorf("can't decode background#e65f291c to nil")
}
return buf.Obj(func(buf tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := buf.ConsumeID("background"); err != nil {
return fmt.Errorf("unable to decode background#e65f291c: %w", err)
}
case "id":
value, err := buf.Long()
if err != nil {
return fmt.Errorf("unable to decode background#e65f291c: field id: %w", err)
}
b.ID = value
case "is_default":
value, err := buf.Bool()
if err != nil {
return fmt.Errorf("unable to decode background#e65f291c: field is_default: %w", err)
}
b.IsDefault = value
case "is_dark":
value, err := buf.Bool()
if err != nil {
return fmt.Errorf("unable to decode background#e65f291c: field is_dark: %w", err)
}
b.IsDark = value
case "name":
value, err := buf.String()
if err != nil {
return fmt.Errorf("unable to decode background#e65f291c: field name: %w", err)
}
b.Name = value
case "document":
if err := b.Document.DecodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to decode background#e65f291c: field document: %w", err)
}
case "type":
value, err := DecodeTDLibJSONBackgroundType(buf)
if err != nil {
return fmt.Errorf("unable to decode background#e65f291c: field type: %w", err)
}
b.Type = value
default:
return buf.Skip()
}
return nil
})
}
// GetID returns value of ID field.
func (b *Background) GetID() (value int64) {
if b == nil {
return
}
return b.ID
}
// GetIsDefault returns value of IsDefault field.
func (b *Background) GetIsDefault() (value bool) {
if b == nil {
return
}
return b.IsDefault
}
// GetIsDark returns value of IsDark field.
func (b *Background) GetIsDark() (value bool) {
if b == nil {
return
}
return b.IsDark
}
// GetName returns value of Name field.
func (b *Background) GetName() (value string) {
if b == nil {
return
}
return b.Name
}
// GetDocument returns value of Document field.
func (b *Background) GetDocument() (value Document) {
if b == nil {
return
}
return b.Document
}
// GetType returns value of Type field.
func (b *Background) GetType() (value BackgroundTypeClass) {
if b == nil {
return
}
return b.Type
}
File diff suppressed because it is too large Load Diff
-221
View File
@@ -1,221 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// Backgrounds represents TL type `backgrounds#b4671319`.
type Backgrounds struct {
// A list of backgrounds
Backgrounds []Background
}
// BackgroundsTypeID is TL type id of Backgrounds.
const BackgroundsTypeID = 0xb4671319
// Ensuring interfaces in compile-time for Backgrounds.
var (
_ bin.Encoder = &Backgrounds{}
_ bin.Decoder = &Backgrounds{}
_ bin.BareEncoder = &Backgrounds{}
_ bin.BareDecoder = &Backgrounds{}
)
func (b *Backgrounds) Zero() bool {
if b == nil {
return true
}
if !(b.Backgrounds == nil) {
return false
}
return true
}
// String implements fmt.Stringer.
func (b *Backgrounds) String() string {
if b == nil {
return "Backgrounds(nil)"
}
type Alias Backgrounds
return fmt.Sprintf("Backgrounds%+v", Alias(*b))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*Backgrounds) TypeID() uint32 {
return BackgroundsTypeID
}
// TypeName returns name of type in TL schema.
func (*Backgrounds) TypeName() string {
return "backgrounds"
}
// TypeInfo returns info about TL type.
func (b *Backgrounds) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "backgrounds",
ID: BackgroundsTypeID,
}
if b == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "Backgrounds",
SchemaName: "backgrounds",
},
}
return typ
}
// Encode implements bin.Encoder.
func (b *Backgrounds) Encode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode backgrounds#b4671319 as nil")
}
buf.PutID(BackgroundsTypeID)
return b.EncodeBare(buf)
}
// EncodeBare implements bin.BareEncoder.
func (b *Backgrounds) EncodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode backgrounds#b4671319 as nil")
}
buf.PutInt(len(b.Backgrounds))
for idx, v := range b.Backgrounds {
if err := v.EncodeBare(buf); err != nil {
return fmt.Errorf("unable to encode bare backgrounds#b4671319: field backgrounds element with index %d: %w", idx, err)
}
}
return nil
}
// Decode implements bin.Decoder.
func (b *Backgrounds) Decode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode backgrounds#b4671319 to nil")
}
if err := buf.ConsumeID(BackgroundsTypeID); err != nil {
return fmt.Errorf("unable to decode backgrounds#b4671319: %w", err)
}
return b.DecodeBare(buf)
}
// DecodeBare implements bin.BareDecoder.
func (b *Backgrounds) DecodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode backgrounds#b4671319 to nil")
}
{
headerLen, err := buf.Int()
if err != nil {
return fmt.Errorf("unable to decode backgrounds#b4671319: field backgrounds: %w", err)
}
if headerLen > 0 {
b.Backgrounds = make([]Background, 0, headerLen%bin.PreallocateLimit)
}
for idx := 0; idx < headerLen; idx++ {
var value Background
if err := value.DecodeBare(buf); err != nil {
return fmt.Errorf("unable to decode bare backgrounds#b4671319: field backgrounds: %w", err)
}
b.Backgrounds = append(b.Backgrounds, value)
}
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (b *Backgrounds) EncodeTDLibJSON(buf tdjson.Encoder) error {
if b == nil {
return fmt.Errorf("can't encode backgrounds#b4671319 as nil")
}
buf.ObjStart()
buf.PutID("backgrounds")
buf.Comma()
buf.FieldStart("backgrounds")
buf.ArrStart()
for idx, v := range b.Backgrounds {
if err := v.EncodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to encode backgrounds#b4671319: field backgrounds element with index %d: %w", idx, err)
}
buf.Comma()
}
buf.StripComma()
buf.ArrEnd()
buf.Comma()
buf.StripComma()
buf.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (b *Backgrounds) DecodeTDLibJSON(buf tdjson.Decoder) error {
if b == nil {
return fmt.Errorf("can't decode backgrounds#b4671319 to nil")
}
return buf.Obj(func(buf tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := buf.ConsumeID("backgrounds"); err != nil {
return fmt.Errorf("unable to decode backgrounds#b4671319: %w", err)
}
case "backgrounds":
if err := buf.Arr(func(buf tdjson.Decoder) error {
var value Background
if err := value.DecodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to decode backgrounds#b4671319: field backgrounds: %w", err)
}
b.Backgrounds = append(b.Backgrounds, value)
return nil
}); err != nil {
return fmt.Errorf("unable to decode backgrounds#b4671319: field backgrounds: %w", err)
}
default:
return buf.Skip()
}
return nil
})
}
// GetBackgrounds returns value of Backgrounds field.
func (b *Backgrounds) GetBackgrounds() (value []Background) {
if b == nil {
return
}
return b.Backgrounds
}
-319
View File
@@ -1,319 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// BanChatMemberRequest represents TL type `banChatMember#cb107d7c`.
type BanChatMemberRequest struct {
// Chat identifier
ChatID int64
// Member identifier
MemberID MessageSenderClass
// Point in time (Unix timestamp) when the user will be unbanned; 0 if never. If the user
// is banned for more than 366 days or for less than 30 seconds from the current time,
// the user is considered to be banned forever. Ignored in basic groups and if a chat is
// banned
BannedUntilDate int32
// Pass true to delete all messages in the chat for the user that is being removed.
// Always true for supergroups and channels
RevokeMessages bool
}
// BanChatMemberRequestTypeID is TL type id of BanChatMemberRequest.
const BanChatMemberRequestTypeID = 0xcb107d7c
// Ensuring interfaces in compile-time for BanChatMemberRequest.
var (
_ bin.Encoder = &BanChatMemberRequest{}
_ bin.Decoder = &BanChatMemberRequest{}
_ bin.BareEncoder = &BanChatMemberRequest{}
_ bin.BareDecoder = &BanChatMemberRequest{}
)
func (b *BanChatMemberRequest) Zero() bool {
if b == nil {
return true
}
if !(b.ChatID == 0) {
return false
}
if !(b.MemberID == nil) {
return false
}
if !(b.BannedUntilDate == 0) {
return false
}
if !(b.RevokeMessages == false) {
return false
}
return true
}
// String implements fmt.Stringer.
func (b *BanChatMemberRequest) String() string {
if b == nil {
return "BanChatMemberRequest(nil)"
}
type Alias BanChatMemberRequest
return fmt.Sprintf("BanChatMemberRequest%+v", Alias(*b))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*BanChatMemberRequest) TypeID() uint32 {
return BanChatMemberRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*BanChatMemberRequest) TypeName() string {
return "banChatMember"
}
// TypeInfo returns info about TL type.
func (b *BanChatMemberRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "banChatMember",
ID: BanChatMemberRequestTypeID,
}
if b == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "ChatID",
SchemaName: "chat_id",
},
{
Name: "MemberID",
SchemaName: "member_id",
},
{
Name: "BannedUntilDate",
SchemaName: "banned_until_date",
},
{
Name: "RevokeMessages",
SchemaName: "revoke_messages",
},
}
return typ
}
// Encode implements bin.Encoder.
func (b *BanChatMemberRequest) Encode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode banChatMember#cb107d7c as nil")
}
buf.PutID(BanChatMemberRequestTypeID)
return b.EncodeBare(buf)
}
// EncodeBare implements bin.BareEncoder.
func (b *BanChatMemberRequest) EncodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode banChatMember#cb107d7c as nil")
}
buf.PutInt53(b.ChatID)
if b.MemberID == nil {
return fmt.Errorf("unable to encode banChatMember#cb107d7c: field member_id is nil")
}
if err := b.MemberID.Encode(buf); err != nil {
return fmt.Errorf("unable to encode banChatMember#cb107d7c: field member_id: %w", err)
}
buf.PutInt32(b.BannedUntilDate)
buf.PutBool(b.RevokeMessages)
return nil
}
// Decode implements bin.Decoder.
func (b *BanChatMemberRequest) Decode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode banChatMember#cb107d7c to nil")
}
if err := buf.ConsumeID(BanChatMemberRequestTypeID); err != nil {
return fmt.Errorf("unable to decode banChatMember#cb107d7c: %w", err)
}
return b.DecodeBare(buf)
}
// DecodeBare implements bin.BareDecoder.
func (b *BanChatMemberRequest) DecodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode banChatMember#cb107d7c to nil")
}
{
value, err := buf.Int53()
if err != nil {
return fmt.Errorf("unable to decode banChatMember#cb107d7c: field chat_id: %w", err)
}
b.ChatID = value
}
{
value, err := DecodeMessageSender(buf)
if err != nil {
return fmt.Errorf("unable to decode banChatMember#cb107d7c: field member_id: %w", err)
}
b.MemberID = value
}
{
value, err := buf.Int32()
if err != nil {
return fmt.Errorf("unable to decode banChatMember#cb107d7c: field banned_until_date: %w", err)
}
b.BannedUntilDate = value
}
{
value, err := buf.Bool()
if err != nil {
return fmt.Errorf("unable to decode banChatMember#cb107d7c: field revoke_messages: %w", err)
}
b.RevokeMessages = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (b *BanChatMemberRequest) EncodeTDLibJSON(buf tdjson.Encoder) error {
if b == nil {
return fmt.Errorf("can't encode banChatMember#cb107d7c as nil")
}
buf.ObjStart()
buf.PutID("banChatMember")
buf.Comma()
buf.FieldStart("chat_id")
buf.PutInt53(b.ChatID)
buf.Comma()
buf.FieldStart("member_id")
if b.MemberID == nil {
return fmt.Errorf("unable to encode banChatMember#cb107d7c: field member_id is nil")
}
if err := b.MemberID.EncodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to encode banChatMember#cb107d7c: field member_id: %w", err)
}
buf.Comma()
buf.FieldStart("banned_until_date")
buf.PutInt32(b.BannedUntilDate)
buf.Comma()
buf.FieldStart("revoke_messages")
buf.PutBool(b.RevokeMessages)
buf.Comma()
buf.StripComma()
buf.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (b *BanChatMemberRequest) DecodeTDLibJSON(buf tdjson.Decoder) error {
if b == nil {
return fmt.Errorf("can't decode banChatMember#cb107d7c to nil")
}
return buf.Obj(func(buf tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := buf.ConsumeID("banChatMember"); err != nil {
return fmt.Errorf("unable to decode banChatMember#cb107d7c: %w", err)
}
case "chat_id":
value, err := buf.Int53()
if err != nil {
return fmt.Errorf("unable to decode banChatMember#cb107d7c: field chat_id: %w", err)
}
b.ChatID = value
case "member_id":
value, err := DecodeTDLibJSONMessageSender(buf)
if err != nil {
return fmt.Errorf("unable to decode banChatMember#cb107d7c: field member_id: %w", err)
}
b.MemberID = value
case "banned_until_date":
value, err := buf.Int32()
if err != nil {
return fmt.Errorf("unable to decode banChatMember#cb107d7c: field banned_until_date: %w", err)
}
b.BannedUntilDate = value
case "revoke_messages":
value, err := buf.Bool()
if err != nil {
return fmt.Errorf("unable to decode banChatMember#cb107d7c: field revoke_messages: %w", err)
}
b.RevokeMessages = value
default:
return buf.Skip()
}
return nil
})
}
// GetChatID returns value of ChatID field.
func (b *BanChatMemberRequest) GetChatID() (value int64) {
if b == nil {
return
}
return b.ChatID
}
// GetMemberID returns value of MemberID field.
func (b *BanChatMemberRequest) GetMemberID() (value MessageSenderClass) {
if b == nil {
return
}
return b.MemberID
}
// GetBannedUntilDate returns value of BannedUntilDate field.
func (b *BanChatMemberRequest) GetBannedUntilDate() (value int32) {
if b == nil {
return
}
return b.BannedUntilDate
}
// GetRevokeMessages returns value of RevokeMessages field.
func (b *BanChatMemberRequest) GetRevokeMessages() (value bool) {
if b == nil {
return
}
return b.RevokeMessages
}
// BanChatMember invokes method banChatMember#cb107d7c returning error if any.
func (c *Client) BanChatMember(ctx context.Context, request *BanChatMemberRequest) error {
var ok Ok
if err := c.rpc.Invoke(ctx, request, &ok); err != nil {
return err
}
return nil
}
-262
View File
@@ -1,262 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// BanGroupCallParticipantsRequest represents TL type `banGroupCallParticipants#60890d03`.
type BanGroupCallParticipantsRequest struct {
// Group call identifier
GroupCallID int32
// Identifiers of group call participants to ban; identifiers of unknown users from the
// update updateGroupCallParticipants can be also passed to the method
UserIDs []int64
}
// BanGroupCallParticipantsRequestTypeID is TL type id of BanGroupCallParticipantsRequest.
const BanGroupCallParticipantsRequestTypeID = 0x60890d03
// Ensuring interfaces in compile-time for BanGroupCallParticipantsRequest.
var (
_ bin.Encoder = &BanGroupCallParticipantsRequest{}
_ bin.Decoder = &BanGroupCallParticipantsRequest{}
_ bin.BareEncoder = &BanGroupCallParticipantsRequest{}
_ bin.BareDecoder = &BanGroupCallParticipantsRequest{}
)
func (b *BanGroupCallParticipantsRequest) Zero() bool {
if b == nil {
return true
}
if !(b.GroupCallID == 0) {
return false
}
if !(b.UserIDs == nil) {
return false
}
return true
}
// String implements fmt.Stringer.
func (b *BanGroupCallParticipantsRequest) String() string {
if b == nil {
return "BanGroupCallParticipantsRequest(nil)"
}
type Alias BanGroupCallParticipantsRequest
return fmt.Sprintf("BanGroupCallParticipantsRequest%+v", Alias(*b))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*BanGroupCallParticipantsRequest) TypeID() uint32 {
return BanGroupCallParticipantsRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*BanGroupCallParticipantsRequest) TypeName() string {
return "banGroupCallParticipants"
}
// TypeInfo returns info about TL type.
func (b *BanGroupCallParticipantsRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "banGroupCallParticipants",
ID: BanGroupCallParticipantsRequestTypeID,
}
if b == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "GroupCallID",
SchemaName: "group_call_id",
},
{
Name: "UserIDs",
SchemaName: "user_ids",
},
}
return typ
}
// Encode implements bin.Encoder.
func (b *BanGroupCallParticipantsRequest) Encode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode banGroupCallParticipants#60890d03 as nil")
}
buf.PutID(BanGroupCallParticipantsRequestTypeID)
return b.EncodeBare(buf)
}
// EncodeBare implements bin.BareEncoder.
func (b *BanGroupCallParticipantsRequest) EncodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode banGroupCallParticipants#60890d03 as nil")
}
buf.PutInt32(b.GroupCallID)
buf.PutInt(len(b.UserIDs))
for _, v := range b.UserIDs {
buf.PutLong(v)
}
return nil
}
// Decode implements bin.Decoder.
func (b *BanGroupCallParticipantsRequest) Decode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode banGroupCallParticipants#60890d03 to nil")
}
if err := buf.ConsumeID(BanGroupCallParticipantsRequestTypeID); err != nil {
return fmt.Errorf("unable to decode banGroupCallParticipants#60890d03: %w", err)
}
return b.DecodeBare(buf)
}
// DecodeBare implements bin.BareDecoder.
func (b *BanGroupCallParticipantsRequest) DecodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode banGroupCallParticipants#60890d03 to nil")
}
{
value, err := buf.Int32()
if err != nil {
return fmt.Errorf("unable to decode banGroupCallParticipants#60890d03: field group_call_id: %w", err)
}
b.GroupCallID = value
}
{
headerLen, err := buf.Int()
if err != nil {
return fmt.Errorf("unable to decode banGroupCallParticipants#60890d03: field user_ids: %w", err)
}
if headerLen > 0 {
b.UserIDs = make([]int64, 0, headerLen%bin.PreallocateLimit)
}
for idx := 0; idx < headerLen; idx++ {
value, err := buf.Long()
if err != nil {
return fmt.Errorf("unable to decode banGroupCallParticipants#60890d03: field user_ids: %w", err)
}
b.UserIDs = append(b.UserIDs, value)
}
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (b *BanGroupCallParticipantsRequest) EncodeTDLibJSON(buf tdjson.Encoder) error {
if b == nil {
return fmt.Errorf("can't encode banGroupCallParticipants#60890d03 as nil")
}
buf.ObjStart()
buf.PutID("banGroupCallParticipants")
buf.Comma()
buf.FieldStart("group_call_id")
buf.PutInt32(b.GroupCallID)
buf.Comma()
buf.FieldStart("user_ids")
buf.ArrStart()
for _, v := range b.UserIDs {
buf.PutLong(v)
buf.Comma()
}
buf.StripComma()
buf.ArrEnd()
buf.Comma()
buf.StripComma()
buf.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (b *BanGroupCallParticipantsRequest) DecodeTDLibJSON(buf tdjson.Decoder) error {
if b == nil {
return fmt.Errorf("can't decode banGroupCallParticipants#60890d03 to nil")
}
return buf.Obj(func(buf tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := buf.ConsumeID("banGroupCallParticipants"); err != nil {
return fmt.Errorf("unable to decode banGroupCallParticipants#60890d03: %w", err)
}
case "group_call_id":
value, err := buf.Int32()
if err != nil {
return fmt.Errorf("unable to decode banGroupCallParticipants#60890d03: field group_call_id: %w", err)
}
b.GroupCallID = value
case "user_ids":
if err := buf.Arr(func(buf tdjson.Decoder) error {
value, err := buf.Long()
if err != nil {
return fmt.Errorf("unable to decode banGroupCallParticipants#60890d03: field user_ids: %w", err)
}
b.UserIDs = append(b.UserIDs, value)
return nil
}); err != nil {
return fmt.Errorf("unable to decode banGroupCallParticipants#60890d03: field user_ids: %w", err)
}
default:
return buf.Skip()
}
return nil
})
}
// GetGroupCallID returns value of GroupCallID field.
func (b *BanGroupCallParticipantsRequest) GetGroupCallID() (value int32) {
if b == nil {
return
}
return b.GroupCallID
}
// GetUserIDs returns value of UserIDs field.
func (b *BanGroupCallParticipantsRequest) GetUserIDs() (value []int64) {
if b == nil {
return
}
return b.UserIDs
}
// BanGroupCallParticipants invokes method banGroupCallParticipants#60890d03 returning error if any.
func (c *Client) BanGroupCallParticipants(ctx context.Context, request *BanGroupCallParticipantsRequest) error {
var ok Ok
if err := c.rpc.Invoke(ctx, request, &ok); err != nil {
return err
}
return nil
}
-227
View File
@@ -1,227 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// BankCardActionOpenURL represents TL type `bankCardActionOpenUrl#f44a5885`.
type BankCardActionOpenURL struct {
// Action text
Text string
// The URL to be opened
URL string
}
// BankCardActionOpenURLTypeID is TL type id of BankCardActionOpenURL.
const BankCardActionOpenURLTypeID = 0xf44a5885
// Ensuring interfaces in compile-time for BankCardActionOpenURL.
var (
_ bin.Encoder = &BankCardActionOpenURL{}
_ bin.Decoder = &BankCardActionOpenURL{}
_ bin.BareEncoder = &BankCardActionOpenURL{}
_ bin.BareDecoder = &BankCardActionOpenURL{}
)
func (b *BankCardActionOpenURL) Zero() bool {
if b == nil {
return true
}
if !(b.Text == "") {
return false
}
if !(b.URL == "") {
return false
}
return true
}
// String implements fmt.Stringer.
func (b *BankCardActionOpenURL) String() string {
if b == nil {
return "BankCardActionOpenURL(nil)"
}
type Alias BankCardActionOpenURL
return fmt.Sprintf("BankCardActionOpenURL%+v", Alias(*b))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*BankCardActionOpenURL) TypeID() uint32 {
return BankCardActionOpenURLTypeID
}
// TypeName returns name of type in TL schema.
func (*BankCardActionOpenURL) TypeName() string {
return "bankCardActionOpenUrl"
}
// TypeInfo returns info about TL type.
func (b *BankCardActionOpenURL) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "bankCardActionOpenUrl",
ID: BankCardActionOpenURLTypeID,
}
if b == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "Text",
SchemaName: "text",
},
{
Name: "URL",
SchemaName: "url",
},
}
return typ
}
// Encode implements bin.Encoder.
func (b *BankCardActionOpenURL) Encode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode bankCardActionOpenUrl#f44a5885 as nil")
}
buf.PutID(BankCardActionOpenURLTypeID)
return b.EncodeBare(buf)
}
// EncodeBare implements bin.BareEncoder.
func (b *BankCardActionOpenURL) EncodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode bankCardActionOpenUrl#f44a5885 as nil")
}
buf.PutString(b.Text)
buf.PutString(b.URL)
return nil
}
// Decode implements bin.Decoder.
func (b *BankCardActionOpenURL) Decode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode bankCardActionOpenUrl#f44a5885 to nil")
}
if err := buf.ConsumeID(BankCardActionOpenURLTypeID); err != nil {
return fmt.Errorf("unable to decode bankCardActionOpenUrl#f44a5885: %w", err)
}
return b.DecodeBare(buf)
}
// DecodeBare implements bin.BareDecoder.
func (b *BankCardActionOpenURL) DecodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode bankCardActionOpenUrl#f44a5885 to nil")
}
{
value, err := buf.String()
if err != nil {
return fmt.Errorf("unable to decode bankCardActionOpenUrl#f44a5885: field text: %w", err)
}
b.Text = value
}
{
value, err := buf.String()
if err != nil {
return fmt.Errorf("unable to decode bankCardActionOpenUrl#f44a5885: field url: %w", err)
}
b.URL = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (b *BankCardActionOpenURL) EncodeTDLibJSON(buf tdjson.Encoder) error {
if b == nil {
return fmt.Errorf("can't encode bankCardActionOpenUrl#f44a5885 as nil")
}
buf.ObjStart()
buf.PutID("bankCardActionOpenUrl")
buf.Comma()
buf.FieldStart("text")
buf.PutString(b.Text)
buf.Comma()
buf.FieldStart("url")
buf.PutString(b.URL)
buf.Comma()
buf.StripComma()
buf.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (b *BankCardActionOpenURL) DecodeTDLibJSON(buf tdjson.Decoder) error {
if b == nil {
return fmt.Errorf("can't decode bankCardActionOpenUrl#f44a5885 to nil")
}
return buf.Obj(func(buf tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := buf.ConsumeID("bankCardActionOpenUrl"); err != nil {
return fmt.Errorf("unable to decode bankCardActionOpenUrl#f44a5885: %w", err)
}
case "text":
value, err := buf.String()
if err != nil {
return fmt.Errorf("unable to decode bankCardActionOpenUrl#f44a5885: field text: %w", err)
}
b.Text = value
case "url":
value, err := buf.String()
if err != nil {
return fmt.Errorf("unable to decode bankCardActionOpenUrl#f44a5885: field url: %w", err)
}
b.URL = value
default:
return buf.Skip()
}
return nil
})
}
// GetText returns value of Text field.
func (b *BankCardActionOpenURL) GetText() (value string) {
if b == nil {
return
}
return b.Text
}
// GetURL returns value of URL field.
func (b *BankCardActionOpenURL) GetURL() (value string) {
if b == nil {
return
}
return b.URL
}
-255
View File
@@ -1,255 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// BankCardInfo represents TL type `bankCardInfo#2bc7da9f`.
type BankCardInfo struct {
// Title of the bank card description
Title string
// Actions that can be done with the bank card number
Actions []BankCardActionOpenURL
}
// BankCardInfoTypeID is TL type id of BankCardInfo.
const BankCardInfoTypeID = 0x2bc7da9f
// Ensuring interfaces in compile-time for BankCardInfo.
var (
_ bin.Encoder = &BankCardInfo{}
_ bin.Decoder = &BankCardInfo{}
_ bin.BareEncoder = &BankCardInfo{}
_ bin.BareDecoder = &BankCardInfo{}
)
func (b *BankCardInfo) Zero() bool {
if b == nil {
return true
}
if !(b.Title == "") {
return false
}
if !(b.Actions == nil) {
return false
}
return true
}
// String implements fmt.Stringer.
func (b *BankCardInfo) String() string {
if b == nil {
return "BankCardInfo(nil)"
}
type Alias BankCardInfo
return fmt.Sprintf("BankCardInfo%+v", Alias(*b))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*BankCardInfo) TypeID() uint32 {
return BankCardInfoTypeID
}
// TypeName returns name of type in TL schema.
func (*BankCardInfo) TypeName() string {
return "bankCardInfo"
}
// TypeInfo returns info about TL type.
func (b *BankCardInfo) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "bankCardInfo",
ID: BankCardInfoTypeID,
}
if b == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "Title",
SchemaName: "title",
},
{
Name: "Actions",
SchemaName: "actions",
},
}
return typ
}
// Encode implements bin.Encoder.
func (b *BankCardInfo) Encode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode bankCardInfo#2bc7da9f as nil")
}
buf.PutID(BankCardInfoTypeID)
return b.EncodeBare(buf)
}
// EncodeBare implements bin.BareEncoder.
func (b *BankCardInfo) EncodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode bankCardInfo#2bc7da9f as nil")
}
buf.PutString(b.Title)
buf.PutInt(len(b.Actions))
for idx, v := range b.Actions {
if err := v.EncodeBare(buf); err != nil {
return fmt.Errorf("unable to encode bare bankCardInfo#2bc7da9f: field actions element with index %d: %w", idx, err)
}
}
return nil
}
// Decode implements bin.Decoder.
func (b *BankCardInfo) Decode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode bankCardInfo#2bc7da9f to nil")
}
if err := buf.ConsumeID(BankCardInfoTypeID); err != nil {
return fmt.Errorf("unable to decode bankCardInfo#2bc7da9f: %w", err)
}
return b.DecodeBare(buf)
}
// DecodeBare implements bin.BareDecoder.
func (b *BankCardInfo) DecodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode bankCardInfo#2bc7da9f to nil")
}
{
value, err := buf.String()
if err != nil {
return fmt.Errorf("unable to decode bankCardInfo#2bc7da9f: field title: %w", err)
}
b.Title = value
}
{
headerLen, err := buf.Int()
if err != nil {
return fmt.Errorf("unable to decode bankCardInfo#2bc7da9f: field actions: %w", err)
}
if headerLen > 0 {
b.Actions = make([]BankCardActionOpenURL, 0, headerLen%bin.PreallocateLimit)
}
for idx := 0; idx < headerLen; idx++ {
var value BankCardActionOpenURL
if err := value.DecodeBare(buf); err != nil {
return fmt.Errorf("unable to decode bare bankCardInfo#2bc7da9f: field actions: %w", err)
}
b.Actions = append(b.Actions, value)
}
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (b *BankCardInfo) EncodeTDLibJSON(buf tdjson.Encoder) error {
if b == nil {
return fmt.Errorf("can't encode bankCardInfo#2bc7da9f as nil")
}
buf.ObjStart()
buf.PutID("bankCardInfo")
buf.Comma()
buf.FieldStart("title")
buf.PutString(b.Title)
buf.Comma()
buf.FieldStart("actions")
buf.ArrStart()
for idx, v := range b.Actions {
if err := v.EncodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to encode bankCardInfo#2bc7da9f: field actions element with index %d: %w", idx, err)
}
buf.Comma()
}
buf.StripComma()
buf.ArrEnd()
buf.Comma()
buf.StripComma()
buf.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (b *BankCardInfo) DecodeTDLibJSON(buf tdjson.Decoder) error {
if b == nil {
return fmt.Errorf("can't decode bankCardInfo#2bc7da9f to nil")
}
return buf.Obj(func(buf tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := buf.ConsumeID("bankCardInfo"); err != nil {
return fmt.Errorf("unable to decode bankCardInfo#2bc7da9f: %w", err)
}
case "title":
value, err := buf.String()
if err != nil {
return fmt.Errorf("unable to decode bankCardInfo#2bc7da9f: field title: %w", err)
}
b.Title = value
case "actions":
if err := buf.Arr(func(buf tdjson.Decoder) error {
var value BankCardActionOpenURL
if err := value.DecodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to decode bankCardInfo#2bc7da9f: field actions: %w", err)
}
b.Actions = append(b.Actions, value)
return nil
}); err != nil {
return fmt.Errorf("unable to decode bankCardInfo#2bc7da9f: field actions: %w", err)
}
default:
return buf.Skip()
}
return nil
})
}
// GetTitle returns value of Title field.
func (b *BankCardInfo) GetTitle() (value string) {
if b == nil {
return
}
return b.Title
}
// GetActions returns value of Actions field.
func (b *BankCardInfo) GetActions() (value []BankCardActionOpenURL) {
if b == nil {
return
}
return b.Actions
}
-492
View File
@@ -1,492 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// BasicGroupFullInfo represents TL type `basicGroupFullInfo#d62e521e`.
type BasicGroupFullInfo struct {
// Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as
// in chat.photo
Photo ChatPhoto
// Contains full information about a basic group
Description string
// User identifier of the creator of the group; 0 if unknown
CreatorUserID int64
// Group members
Members []ChatMember
// True, if non-administrators and non-bots can be hidden in responses to
// getSupergroupMembers and searchChatMembers for non-administrators after upgrading the
// basic group to a supergroup
CanHideMembers bool
// True, if aggressive anti-spam checks can be enabled or disabled in the supergroup
// after upgrading the basic group to a supergroup
CanToggleAggressiveAntiSpam bool
// Primary invite link for this group; may be null. For chat administrators with
// can_invite_users right only. Updated only after the basic group is opened
InviteLink ChatInviteLink
// List of commands of bots in the group
BotCommands []BotCommands
}
// BasicGroupFullInfoTypeID is TL type id of BasicGroupFullInfo.
const BasicGroupFullInfoTypeID = 0xd62e521e
// Ensuring interfaces in compile-time for BasicGroupFullInfo.
var (
_ bin.Encoder = &BasicGroupFullInfo{}
_ bin.Decoder = &BasicGroupFullInfo{}
_ bin.BareEncoder = &BasicGroupFullInfo{}
_ bin.BareDecoder = &BasicGroupFullInfo{}
)
func (b *BasicGroupFullInfo) Zero() bool {
if b == nil {
return true
}
if !(b.Photo.Zero()) {
return false
}
if !(b.Description == "") {
return false
}
if !(b.CreatorUserID == 0) {
return false
}
if !(b.Members == nil) {
return false
}
if !(b.CanHideMembers == false) {
return false
}
if !(b.CanToggleAggressiveAntiSpam == false) {
return false
}
if !(b.InviteLink.Zero()) {
return false
}
if !(b.BotCommands == nil) {
return false
}
return true
}
// String implements fmt.Stringer.
func (b *BasicGroupFullInfo) String() string {
if b == nil {
return "BasicGroupFullInfo(nil)"
}
type Alias BasicGroupFullInfo
return fmt.Sprintf("BasicGroupFullInfo%+v", Alias(*b))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*BasicGroupFullInfo) TypeID() uint32 {
return BasicGroupFullInfoTypeID
}
// TypeName returns name of type in TL schema.
func (*BasicGroupFullInfo) TypeName() string {
return "basicGroupFullInfo"
}
// TypeInfo returns info about TL type.
func (b *BasicGroupFullInfo) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "basicGroupFullInfo",
ID: BasicGroupFullInfoTypeID,
}
if b == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "Photo",
SchemaName: "photo",
},
{
Name: "Description",
SchemaName: "description",
},
{
Name: "CreatorUserID",
SchemaName: "creator_user_id",
},
{
Name: "Members",
SchemaName: "members",
},
{
Name: "CanHideMembers",
SchemaName: "can_hide_members",
},
{
Name: "CanToggleAggressiveAntiSpam",
SchemaName: "can_toggle_aggressive_anti_spam",
},
{
Name: "InviteLink",
SchemaName: "invite_link",
},
{
Name: "BotCommands",
SchemaName: "bot_commands",
},
}
return typ
}
// Encode implements bin.Encoder.
func (b *BasicGroupFullInfo) Encode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode basicGroupFullInfo#d62e521e as nil")
}
buf.PutID(BasicGroupFullInfoTypeID)
return b.EncodeBare(buf)
}
// EncodeBare implements bin.BareEncoder.
func (b *BasicGroupFullInfo) EncodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode basicGroupFullInfo#d62e521e as nil")
}
if err := b.Photo.Encode(buf); err != nil {
return fmt.Errorf("unable to encode basicGroupFullInfo#d62e521e: field photo: %w", err)
}
buf.PutString(b.Description)
buf.PutInt53(b.CreatorUserID)
buf.PutInt(len(b.Members))
for idx, v := range b.Members {
if err := v.EncodeBare(buf); err != nil {
return fmt.Errorf("unable to encode bare basicGroupFullInfo#d62e521e: field members element with index %d: %w", idx, err)
}
}
buf.PutBool(b.CanHideMembers)
buf.PutBool(b.CanToggleAggressiveAntiSpam)
if err := b.InviteLink.Encode(buf); err != nil {
return fmt.Errorf("unable to encode basicGroupFullInfo#d62e521e: field invite_link: %w", err)
}
buf.PutInt(len(b.BotCommands))
for idx, v := range b.BotCommands {
if err := v.EncodeBare(buf); err != nil {
return fmt.Errorf("unable to encode bare basicGroupFullInfo#d62e521e: field bot_commands element with index %d: %w", idx, err)
}
}
return nil
}
// Decode implements bin.Decoder.
func (b *BasicGroupFullInfo) Decode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode basicGroupFullInfo#d62e521e to nil")
}
if err := buf.ConsumeID(BasicGroupFullInfoTypeID); err != nil {
return fmt.Errorf("unable to decode basicGroupFullInfo#d62e521e: %w", err)
}
return b.DecodeBare(buf)
}
// DecodeBare implements bin.BareDecoder.
func (b *BasicGroupFullInfo) DecodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode basicGroupFullInfo#d62e521e to nil")
}
{
if err := b.Photo.Decode(buf); err != nil {
return fmt.Errorf("unable to decode basicGroupFullInfo#d62e521e: field photo: %w", err)
}
}
{
value, err := buf.String()
if err != nil {
return fmt.Errorf("unable to decode basicGroupFullInfo#d62e521e: field description: %w", err)
}
b.Description = value
}
{
value, err := buf.Int53()
if err != nil {
return fmt.Errorf("unable to decode basicGroupFullInfo#d62e521e: field creator_user_id: %w", err)
}
b.CreatorUserID = value
}
{
headerLen, err := buf.Int()
if err != nil {
return fmt.Errorf("unable to decode basicGroupFullInfo#d62e521e: field members: %w", err)
}
if headerLen > 0 {
b.Members = make([]ChatMember, 0, headerLen%bin.PreallocateLimit)
}
for idx := 0; idx < headerLen; idx++ {
var value ChatMember
if err := value.DecodeBare(buf); err != nil {
return fmt.Errorf("unable to decode bare basicGroupFullInfo#d62e521e: field members: %w", err)
}
b.Members = append(b.Members, value)
}
}
{
value, err := buf.Bool()
if err != nil {
return fmt.Errorf("unable to decode basicGroupFullInfo#d62e521e: field can_hide_members: %w", err)
}
b.CanHideMembers = value
}
{
value, err := buf.Bool()
if err != nil {
return fmt.Errorf("unable to decode basicGroupFullInfo#d62e521e: field can_toggle_aggressive_anti_spam: %w", err)
}
b.CanToggleAggressiveAntiSpam = value
}
{
if err := b.InviteLink.Decode(buf); err != nil {
return fmt.Errorf("unable to decode basicGroupFullInfo#d62e521e: field invite_link: %w", err)
}
}
{
headerLen, err := buf.Int()
if err != nil {
return fmt.Errorf("unable to decode basicGroupFullInfo#d62e521e: field bot_commands: %w", err)
}
if headerLen > 0 {
b.BotCommands = make([]BotCommands, 0, headerLen%bin.PreallocateLimit)
}
for idx := 0; idx < headerLen; idx++ {
var value BotCommands
if err := value.DecodeBare(buf); err != nil {
return fmt.Errorf("unable to decode bare basicGroupFullInfo#d62e521e: field bot_commands: %w", err)
}
b.BotCommands = append(b.BotCommands, value)
}
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (b *BasicGroupFullInfo) EncodeTDLibJSON(buf tdjson.Encoder) error {
if b == nil {
return fmt.Errorf("can't encode basicGroupFullInfo#d62e521e as nil")
}
buf.ObjStart()
buf.PutID("basicGroupFullInfo")
buf.Comma()
buf.FieldStart("photo")
if err := b.Photo.EncodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to encode basicGroupFullInfo#d62e521e: field photo: %w", err)
}
buf.Comma()
buf.FieldStart("description")
buf.PutString(b.Description)
buf.Comma()
buf.FieldStart("creator_user_id")
buf.PutInt53(b.CreatorUserID)
buf.Comma()
buf.FieldStart("members")
buf.ArrStart()
for idx, v := range b.Members {
if err := v.EncodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to encode basicGroupFullInfo#d62e521e: field members element with index %d: %w", idx, err)
}
buf.Comma()
}
buf.StripComma()
buf.ArrEnd()
buf.Comma()
buf.FieldStart("can_hide_members")
buf.PutBool(b.CanHideMembers)
buf.Comma()
buf.FieldStart("can_toggle_aggressive_anti_spam")
buf.PutBool(b.CanToggleAggressiveAntiSpam)
buf.Comma()
buf.FieldStart("invite_link")
if err := b.InviteLink.EncodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to encode basicGroupFullInfo#d62e521e: field invite_link: %w", err)
}
buf.Comma()
buf.FieldStart("bot_commands")
buf.ArrStart()
for idx, v := range b.BotCommands {
if err := v.EncodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to encode basicGroupFullInfo#d62e521e: field bot_commands element with index %d: %w", idx, err)
}
buf.Comma()
}
buf.StripComma()
buf.ArrEnd()
buf.Comma()
buf.StripComma()
buf.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (b *BasicGroupFullInfo) DecodeTDLibJSON(buf tdjson.Decoder) error {
if b == nil {
return fmt.Errorf("can't decode basicGroupFullInfo#d62e521e to nil")
}
return buf.Obj(func(buf tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := buf.ConsumeID("basicGroupFullInfo"); err != nil {
return fmt.Errorf("unable to decode basicGroupFullInfo#d62e521e: %w", err)
}
case "photo":
if err := b.Photo.DecodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to decode basicGroupFullInfo#d62e521e: field photo: %w", err)
}
case "description":
value, err := buf.String()
if err != nil {
return fmt.Errorf("unable to decode basicGroupFullInfo#d62e521e: field description: %w", err)
}
b.Description = value
case "creator_user_id":
value, err := buf.Int53()
if err != nil {
return fmt.Errorf("unable to decode basicGroupFullInfo#d62e521e: field creator_user_id: %w", err)
}
b.CreatorUserID = value
case "members":
if err := buf.Arr(func(buf tdjson.Decoder) error {
var value ChatMember
if err := value.DecodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to decode basicGroupFullInfo#d62e521e: field members: %w", err)
}
b.Members = append(b.Members, value)
return nil
}); err != nil {
return fmt.Errorf("unable to decode basicGroupFullInfo#d62e521e: field members: %w", err)
}
case "can_hide_members":
value, err := buf.Bool()
if err != nil {
return fmt.Errorf("unable to decode basicGroupFullInfo#d62e521e: field can_hide_members: %w", err)
}
b.CanHideMembers = value
case "can_toggle_aggressive_anti_spam":
value, err := buf.Bool()
if err != nil {
return fmt.Errorf("unable to decode basicGroupFullInfo#d62e521e: field can_toggle_aggressive_anti_spam: %w", err)
}
b.CanToggleAggressiveAntiSpam = value
case "invite_link":
if err := b.InviteLink.DecodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to decode basicGroupFullInfo#d62e521e: field invite_link: %w", err)
}
case "bot_commands":
if err := buf.Arr(func(buf tdjson.Decoder) error {
var value BotCommands
if err := value.DecodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to decode basicGroupFullInfo#d62e521e: field bot_commands: %w", err)
}
b.BotCommands = append(b.BotCommands, value)
return nil
}); err != nil {
return fmt.Errorf("unable to decode basicGroupFullInfo#d62e521e: field bot_commands: %w", err)
}
default:
return buf.Skip()
}
return nil
})
}
// GetPhoto returns value of Photo field.
func (b *BasicGroupFullInfo) GetPhoto() (value ChatPhoto) {
if b == nil {
return
}
return b.Photo
}
// GetDescription returns value of Description field.
func (b *BasicGroupFullInfo) GetDescription() (value string) {
if b == nil {
return
}
return b.Description
}
// GetCreatorUserID returns value of CreatorUserID field.
func (b *BasicGroupFullInfo) GetCreatorUserID() (value int64) {
if b == nil {
return
}
return b.CreatorUserID
}
// GetMembers returns value of Members field.
func (b *BasicGroupFullInfo) GetMembers() (value []ChatMember) {
if b == nil {
return
}
return b.Members
}
// GetCanHideMembers returns value of CanHideMembers field.
func (b *BasicGroupFullInfo) GetCanHideMembers() (value bool) {
if b == nil {
return
}
return b.CanHideMembers
}
// GetCanToggleAggressiveAntiSpam returns value of CanToggleAggressiveAntiSpam field.
func (b *BasicGroupFullInfo) GetCanToggleAggressiveAntiSpam() (value bool) {
if b == nil {
return
}
return b.CanToggleAggressiveAntiSpam
}
// GetInviteLink returns value of InviteLink field.
func (b *BasicGroupFullInfo) GetInviteLink() (value ChatInviteLink) {
if b == nil {
return
}
return b.InviteLink
}
// GetBotCommands returns value of BotCommands field.
func (b *BasicGroupFullInfo) GetBotCommands() (value []BotCommands) {
if b == nil {
return
}
return b.BotCommands
}
-339
View File
@@ -1,339 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// BasicGroup represents TL type `basicGroup#f464168f`.
type BasicGroup struct {
// Group identifier
ID int64
// Number of members in the group
MemberCount int32
// Status of the current user in the group
Status ChatMemberStatusClass
// True, if the group is active
IsActive bool
// Identifier of the supergroup to which this group was upgraded; 0 if none
UpgradedToSupergroupID int64
}
// BasicGroupTypeID is TL type id of BasicGroup.
const BasicGroupTypeID = 0xf464168f
// Ensuring interfaces in compile-time for BasicGroup.
var (
_ bin.Encoder = &BasicGroup{}
_ bin.Decoder = &BasicGroup{}
_ bin.BareEncoder = &BasicGroup{}
_ bin.BareDecoder = &BasicGroup{}
)
func (b *BasicGroup) Zero() bool {
if b == nil {
return true
}
if !(b.ID == 0) {
return false
}
if !(b.MemberCount == 0) {
return false
}
if !(b.Status == nil) {
return false
}
if !(b.IsActive == false) {
return false
}
if !(b.UpgradedToSupergroupID == 0) {
return false
}
return true
}
// String implements fmt.Stringer.
func (b *BasicGroup) String() string {
if b == nil {
return "BasicGroup(nil)"
}
type Alias BasicGroup
return fmt.Sprintf("BasicGroup%+v", Alias(*b))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*BasicGroup) TypeID() uint32 {
return BasicGroupTypeID
}
// TypeName returns name of type in TL schema.
func (*BasicGroup) TypeName() string {
return "basicGroup"
}
// TypeInfo returns info about TL type.
func (b *BasicGroup) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "basicGroup",
ID: BasicGroupTypeID,
}
if b == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "ID",
SchemaName: "id",
},
{
Name: "MemberCount",
SchemaName: "member_count",
},
{
Name: "Status",
SchemaName: "status",
},
{
Name: "IsActive",
SchemaName: "is_active",
},
{
Name: "UpgradedToSupergroupID",
SchemaName: "upgraded_to_supergroup_id",
},
}
return typ
}
// Encode implements bin.Encoder.
func (b *BasicGroup) Encode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode basicGroup#f464168f as nil")
}
buf.PutID(BasicGroupTypeID)
return b.EncodeBare(buf)
}
// EncodeBare implements bin.BareEncoder.
func (b *BasicGroup) EncodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode basicGroup#f464168f as nil")
}
buf.PutInt53(b.ID)
buf.PutInt32(b.MemberCount)
if b.Status == nil {
return fmt.Errorf("unable to encode basicGroup#f464168f: field status is nil")
}
if err := b.Status.Encode(buf); err != nil {
return fmt.Errorf("unable to encode basicGroup#f464168f: field status: %w", err)
}
buf.PutBool(b.IsActive)
buf.PutInt53(b.UpgradedToSupergroupID)
return nil
}
// Decode implements bin.Decoder.
func (b *BasicGroup) Decode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode basicGroup#f464168f to nil")
}
if err := buf.ConsumeID(BasicGroupTypeID); err != nil {
return fmt.Errorf("unable to decode basicGroup#f464168f: %w", err)
}
return b.DecodeBare(buf)
}
// DecodeBare implements bin.BareDecoder.
func (b *BasicGroup) DecodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode basicGroup#f464168f to nil")
}
{
value, err := buf.Int53()
if err != nil {
return fmt.Errorf("unable to decode basicGroup#f464168f: field id: %w", err)
}
b.ID = value
}
{
value, err := buf.Int32()
if err != nil {
return fmt.Errorf("unable to decode basicGroup#f464168f: field member_count: %w", err)
}
b.MemberCount = value
}
{
value, err := DecodeChatMemberStatus(buf)
if err != nil {
return fmt.Errorf("unable to decode basicGroup#f464168f: field status: %w", err)
}
b.Status = value
}
{
value, err := buf.Bool()
if err != nil {
return fmt.Errorf("unable to decode basicGroup#f464168f: field is_active: %w", err)
}
b.IsActive = value
}
{
value, err := buf.Int53()
if err != nil {
return fmt.Errorf("unable to decode basicGroup#f464168f: field upgraded_to_supergroup_id: %w", err)
}
b.UpgradedToSupergroupID = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (b *BasicGroup) EncodeTDLibJSON(buf tdjson.Encoder) error {
if b == nil {
return fmt.Errorf("can't encode basicGroup#f464168f as nil")
}
buf.ObjStart()
buf.PutID("basicGroup")
buf.Comma()
buf.FieldStart("id")
buf.PutInt53(b.ID)
buf.Comma()
buf.FieldStart("member_count")
buf.PutInt32(b.MemberCount)
buf.Comma()
buf.FieldStart("status")
if b.Status == nil {
return fmt.Errorf("unable to encode basicGroup#f464168f: field status is nil")
}
if err := b.Status.EncodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to encode basicGroup#f464168f: field status: %w", err)
}
buf.Comma()
buf.FieldStart("is_active")
buf.PutBool(b.IsActive)
buf.Comma()
buf.FieldStart("upgraded_to_supergroup_id")
buf.PutInt53(b.UpgradedToSupergroupID)
buf.Comma()
buf.StripComma()
buf.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (b *BasicGroup) DecodeTDLibJSON(buf tdjson.Decoder) error {
if b == nil {
return fmt.Errorf("can't decode basicGroup#f464168f to nil")
}
return buf.Obj(func(buf tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := buf.ConsumeID("basicGroup"); err != nil {
return fmt.Errorf("unable to decode basicGroup#f464168f: %w", err)
}
case "id":
value, err := buf.Int53()
if err != nil {
return fmt.Errorf("unable to decode basicGroup#f464168f: field id: %w", err)
}
b.ID = value
case "member_count":
value, err := buf.Int32()
if err != nil {
return fmt.Errorf("unable to decode basicGroup#f464168f: field member_count: %w", err)
}
b.MemberCount = value
case "status":
value, err := DecodeTDLibJSONChatMemberStatus(buf)
if err != nil {
return fmt.Errorf("unable to decode basicGroup#f464168f: field status: %w", err)
}
b.Status = value
case "is_active":
value, err := buf.Bool()
if err != nil {
return fmt.Errorf("unable to decode basicGroup#f464168f: field is_active: %w", err)
}
b.IsActive = value
case "upgraded_to_supergroup_id":
value, err := buf.Int53()
if err != nil {
return fmt.Errorf("unable to decode basicGroup#f464168f: field upgraded_to_supergroup_id: %w", err)
}
b.UpgradedToSupergroupID = value
default:
return buf.Skip()
}
return nil
})
}
// GetID returns value of ID field.
func (b *BasicGroup) GetID() (value int64) {
if b == nil {
return
}
return b.ID
}
// GetMemberCount returns value of MemberCount field.
func (b *BasicGroup) GetMemberCount() (value int32) {
if b == nil {
return
}
return b.MemberCount
}
// GetStatus returns value of Status field.
func (b *BasicGroup) GetStatus() (value ChatMemberStatusClass) {
if b == nil {
return
}
return b.Status
}
// GetIsActive returns value of IsActive field.
func (b *BasicGroup) GetIsActive() (value bool) {
if b == nil {
return
}
return b.IsActive
}
// GetUpgradedToSupergroupID returns value of UpgradedToSupergroupID field.
func (b *BasicGroup) GetUpgradedToSupergroupID() (value int64) {
if b == nil {
return
}
return b.UpgradedToSupergroupID
}
-261
View File
@@ -1,261 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// Birthdate represents TL type `birthdate#61fe6d1e`.
type Birthdate struct {
// Day of the month; 1-31
Day int32
// Month of the year; 1-12
Month int32
// Birth year; 0 if unknown
Year int32
}
// BirthdateTypeID is TL type id of Birthdate.
const BirthdateTypeID = 0x61fe6d1e
// Ensuring interfaces in compile-time for Birthdate.
var (
_ bin.Encoder = &Birthdate{}
_ bin.Decoder = &Birthdate{}
_ bin.BareEncoder = &Birthdate{}
_ bin.BareDecoder = &Birthdate{}
)
func (b *Birthdate) Zero() bool {
if b == nil {
return true
}
if !(b.Day == 0) {
return false
}
if !(b.Month == 0) {
return false
}
if !(b.Year == 0) {
return false
}
return true
}
// String implements fmt.Stringer.
func (b *Birthdate) String() string {
if b == nil {
return "Birthdate(nil)"
}
type Alias Birthdate
return fmt.Sprintf("Birthdate%+v", Alias(*b))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*Birthdate) TypeID() uint32 {
return BirthdateTypeID
}
// TypeName returns name of type in TL schema.
func (*Birthdate) TypeName() string {
return "birthdate"
}
// TypeInfo returns info about TL type.
func (b *Birthdate) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "birthdate",
ID: BirthdateTypeID,
}
if b == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "Day",
SchemaName: "day",
},
{
Name: "Month",
SchemaName: "month",
},
{
Name: "Year",
SchemaName: "year",
},
}
return typ
}
// Encode implements bin.Encoder.
func (b *Birthdate) Encode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode birthdate#61fe6d1e as nil")
}
buf.PutID(BirthdateTypeID)
return b.EncodeBare(buf)
}
// EncodeBare implements bin.BareEncoder.
func (b *Birthdate) EncodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode birthdate#61fe6d1e as nil")
}
buf.PutInt32(b.Day)
buf.PutInt32(b.Month)
buf.PutInt32(b.Year)
return nil
}
// Decode implements bin.Decoder.
func (b *Birthdate) Decode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode birthdate#61fe6d1e to nil")
}
if err := buf.ConsumeID(BirthdateTypeID); err != nil {
return fmt.Errorf("unable to decode birthdate#61fe6d1e: %w", err)
}
return b.DecodeBare(buf)
}
// DecodeBare implements bin.BareDecoder.
func (b *Birthdate) DecodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode birthdate#61fe6d1e to nil")
}
{
value, err := buf.Int32()
if err != nil {
return fmt.Errorf("unable to decode birthdate#61fe6d1e: field day: %w", err)
}
b.Day = value
}
{
value, err := buf.Int32()
if err != nil {
return fmt.Errorf("unable to decode birthdate#61fe6d1e: field month: %w", err)
}
b.Month = value
}
{
value, err := buf.Int32()
if err != nil {
return fmt.Errorf("unable to decode birthdate#61fe6d1e: field year: %w", err)
}
b.Year = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (b *Birthdate) EncodeTDLibJSON(buf tdjson.Encoder) error {
if b == nil {
return fmt.Errorf("can't encode birthdate#61fe6d1e as nil")
}
buf.ObjStart()
buf.PutID("birthdate")
buf.Comma()
buf.FieldStart("day")
buf.PutInt32(b.Day)
buf.Comma()
buf.FieldStart("month")
buf.PutInt32(b.Month)
buf.Comma()
buf.FieldStart("year")
buf.PutInt32(b.Year)
buf.Comma()
buf.StripComma()
buf.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (b *Birthdate) DecodeTDLibJSON(buf tdjson.Decoder) error {
if b == nil {
return fmt.Errorf("can't decode birthdate#61fe6d1e to nil")
}
return buf.Obj(func(buf tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := buf.ConsumeID("birthdate"); err != nil {
return fmt.Errorf("unable to decode birthdate#61fe6d1e: %w", err)
}
case "day":
value, err := buf.Int32()
if err != nil {
return fmt.Errorf("unable to decode birthdate#61fe6d1e: field day: %w", err)
}
b.Day = value
case "month":
value, err := buf.Int32()
if err != nil {
return fmt.Errorf("unable to decode birthdate#61fe6d1e: field month: %w", err)
}
b.Month = value
case "year":
value, err := buf.Int32()
if err != nil {
return fmt.Errorf("unable to decode birthdate#61fe6d1e: field year: %w", err)
}
b.Year = value
default:
return buf.Skip()
}
return nil
})
}
// GetDay returns value of Day field.
func (b *Birthdate) GetDay() (value int32) {
if b == nil {
return
}
return b.Day
}
// GetMonth returns value of Month field.
func (b *Birthdate) GetMonth() (value int32) {
if b == nil {
return
}
return b.Month
}
// GetYear returns value of Year field.
func (b *Birthdate) GetYear() (value int32) {
if b == nil {
return
}
return b.Year
}
-431
View File
@@ -1,431 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// BlockListMain represents TL type `blockListMain#50a4137c`.
type BlockListMain struct {
}
// BlockListMainTypeID is TL type id of BlockListMain.
const BlockListMainTypeID = 0x50a4137c
// construct implements constructor of BlockListClass.
func (b BlockListMain) construct() BlockListClass { return &b }
// Ensuring interfaces in compile-time for BlockListMain.
var (
_ bin.Encoder = &BlockListMain{}
_ bin.Decoder = &BlockListMain{}
_ bin.BareEncoder = &BlockListMain{}
_ bin.BareDecoder = &BlockListMain{}
_ BlockListClass = &BlockListMain{}
)
func (b *BlockListMain) Zero() bool {
if b == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (b *BlockListMain) String() string {
if b == nil {
return "BlockListMain(nil)"
}
type Alias BlockListMain
return fmt.Sprintf("BlockListMain%+v", Alias(*b))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*BlockListMain) TypeID() uint32 {
return BlockListMainTypeID
}
// TypeName returns name of type in TL schema.
func (*BlockListMain) TypeName() string {
return "blockListMain"
}
// TypeInfo returns info about TL type.
func (b *BlockListMain) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "blockListMain",
ID: BlockListMainTypeID,
}
if b == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (b *BlockListMain) Encode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode blockListMain#50a4137c as nil")
}
buf.PutID(BlockListMainTypeID)
return b.EncodeBare(buf)
}
// EncodeBare implements bin.BareEncoder.
func (b *BlockListMain) EncodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode blockListMain#50a4137c as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (b *BlockListMain) Decode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode blockListMain#50a4137c to nil")
}
if err := buf.ConsumeID(BlockListMainTypeID); err != nil {
return fmt.Errorf("unable to decode blockListMain#50a4137c: %w", err)
}
return b.DecodeBare(buf)
}
// DecodeBare implements bin.BareDecoder.
func (b *BlockListMain) DecodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode blockListMain#50a4137c to nil")
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (b *BlockListMain) EncodeTDLibJSON(buf tdjson.Encoder) error {
if b == nil {
return fmt.Errorf("can't encode blockListMain#50a4137c as nil")
}
buf.ObjStart()
buf.PutID("blockListMain")
buf.Comma()
buf.StripComma()
buf.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (b *BlockListMain) DecodeTDLibJSON(buf tdjson.Decoder) error {
if b == nil {
return fmt.Errorf("can't decode blockListMain#50a4137c to nil")
}
return buf.Obj(func(buf tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := buf.ConsumeID("blockListMain"); err != nil {
return fmt.Errorf("unable to decode blockListMain#50a4137c: %w", err)
}
default:
return buf.Skip()
}
return nil
})
}
// BlockListStories represents TL type `blockListStories#628965c`.
type BlockListStories struct {
}
// BlockListStoriesTypeID is TL type id of BlockListStories.
const BlockListStoriesTypeID = 0x628965c
// construct implements constructor of BlockListClass.
func (b BlockListStories) construct() BlockListClass { return &b }
// Ensuring interfaces in compile-time for BlockListStories.
var (
_ bin.Encoder = &BlockListStories{}
_ bin.Decoder = &BlockListStories{}
_ bin.BareEncoder = &BlockListStories{}
_ bin.BareDecoder = &BlockListStories{}
_ BlockListClass = &BlockListStories{}
)
func (b *BlockListStories) Zero() bool {
if b == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (b *BlockListStories) String() string {
if b == nil {
return "BlockListStories(nil)"
}
type Alias BlockListStories
return fmt.Sprintf("BlockListStories%+v", Alias(*b))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*BlockListStories) TypeID() uint32 {
return BlockListStoriesTypeID
}
// TypeName returns name of type in TL schema.
func (*BlockListStories) TypeName() string {
return "blockListStories"
}
// TypeInfo returns info about TL type.
func (b *BlockListStories) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "blockListStories",
ID: BlockListStoriesTypeID,
}
if b == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (b *BlockListStories) Encode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode blockListStories#628965c as nil")
}
buf.PutID(BlockListStoriesTypeID)
return b.EncodeBare(buf)
}
// EncodeBare implements bin.BareEncoder.
func (b *BlockListStories) EncodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode blockListStories#628965c as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (b *BlockListStories) Decode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode blockListStories#628965c to nil")
}
if err := buf.ConsumeID(BlockListStoriesTypeID); err != nil {
return fmt.Errorf("unable to decode blockListStories#628965c: %w", err)
}
return b.DecodeBare(buf)
}
// DecodeBare implements bin.BareDecoder.
func (b *BlockListStories) DecodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode blockListStories#628965c to nil")
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (b *BlockListStories) EncodeTDLibJSON(buf tdjson.Encoder) error {
if b == nil {
return fmt.Errorf("can't encode blockListStories#628965c as nil")
}
buf.ObjStart()
buf.PutID("blockListStories")
buf.Comma()
buf.StripComma()
buf.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (b *BlockListStories) DecodeTDLibJSON(buf tdjson.Decoder) error {
if b == nil {
return fmt.Errorf("can't decode blockListStories#628965c to nil")
}
return buf.Obj(func(buf tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := buf.ConsumeID("blockListStories"); err != nil {
return fmt.Errorf("unable to decode blockListStories#628965c: %w", err)
}
default:
return buf.Skip()
}
return nil
})
}
// BlockListClassName is schema name of BlockListClass.
const BlockListClassName = "BlockList"
// BlockListClass represents BlockList generic type.
//
// Example:
//
// g, err := tdapi.DecodeBlockList(buf)
// if err != nil {
// panic(err)
// }
// switch v := g.(type) {
// case *tdapi.BlockListMain: // blockListMain#50a4137c
// case *tdapi.BlockListStories: // blockListStories#628965c
// default: panic(v)
// }
type BlockListClass interface {
bin.Encoder
bin.Decoder
bin.BareEncoder
bin.BareDecoder
construct() BlockListClass
// 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
EncodeTDLibJSON(b tdjson.Encoder) error
DecodeTDLibJSON(b tdjson.Decoder) error
}
// DecodeBlockList implements binary de-serialization for BlockListClass.
func DecodeBlockList(buf *bin.Buffer) (BlockListClass, error) {
id, err := buf.PeekID()
if err != nil {
return nil, err
}
switch id {
case BlockListMainTypeID:
// Decoding blockListMain#50a4137c.
v := BlockListMain{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode BlockListClass: %w", err)
}
return &v, nil
case BlockListStoriesTypeID:
// Decoding blockListStories#628965c.
v := BlockListStories{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode BlockListClass: %w", err)
}
return &v, nil
default:
return nil, fmt.Errorf("unable to decode BlockListClass: %w", bin.NewUnexpectedID(id))
}
}
// DecodeTDLibJSONBlockList implements binary de-serialization for BlockListClass.
func DecodeTDLibJSONBlockList(buf tdjson.Decoder) (BlockListClass, error) {
id, err := buf.FindTypeID()
if err != nil {
return nil, err
}
switch id {
case "blockListMain":
// Decoding blockListMain#50a4137c.
v := BlockListMain{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode BlockListClass: %w", err)
}
return &v, nil
case "blockListStories":
// Decoding blockListStories#628965c.
v := BlockListStories{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode BlockListClass: %w", err)
}
return &v, nil
default:
return nil, fmt.Errorf("unable to decode BlockListClass: %w", tdjson.NewUnexpectedID(id))
}
}
// BlockList boxes the BlockListClass providing a helper.
type BlockListBox struct {
BlockList BlockListClass
}
// Decode implements bin.Decoder for BlockListBox.
func (b *BlockListBox) Decode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("unable to decode BlockListBox to nil")
}
v, err := DecodeBlockList(buf)
if err != nil {
return fmt.Errorf("unable to decode boxed value: %w", err)
}
b.BlockList = v
return nil
}
// Encode implements bin.Encode for BlockListBox.
func (b *BlockListBox) Encode(buf *bin.Buffer) error {
if b == nil || b.BlockList == nil {
return fmt.Errorf("unable to encode BlockListClass as nil")
}
return b.BlockList.Encode(buf)
}
// DecodeTDLibJSON implements bin.Decoder for BlockListBox.
func (b *BlockListBox) DecodeTDLibJSON(buf tdjson.Decoder) error {
if b == nil {
return fmt.Errorf("unable to decode BlockListBox to nil")
}
v, err := DecodeTDLibJSONBlockList(buf)
if err != nil {
return fmt.Errorf("unable to decode boxed value: %w", err)
}
b.BlockList = v
return nil
}
// EncodeTDLibJSON implements bin.Encode for BlockListBox.
func (b *BlockListBox) EncodeTDLibJSON(buf tdjson.Encoder) error {
if b == nil || b.BlockList == nil {
return fmt.Errorf("unable to encode BlockListClass as nil")
}
return b.BlockList.EncodeTDLibJSON(buf)
}
-305
View File
@@ -1,305 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// BlockMessageSenderFromRepliesRequest represents TL type `blockMessageSenderFromReplies#b79df58b`.
type BlockMessageSenderFromRepliesRequest struct {
// The identifier of an incoming message in the Replies chat
MessageID int64
// Pass true to delete the message
DeleteMessage bool
// Pass true to delete all messages from the same sender
DeleteAllMessages bool
// Pass true to report the sender to the Telegram moderators
ReportSpam bool
}
// BlockMessageSenderFromRepliesRequestTypeID is TL type id of BlockMessageSenderFromRepliesRequest.
const BlockMessageSenderFromRepliesRequestTypeID = 0xb79df58b
// Ensuring interfaces in compile-time for BlockMessageSenderFromRepliesRequest.
var (
_ bin.Encoder = &BlockMessageSenderFromRepliesRequest{}
_ bin.Decoder = &BlockMessageSenderFromRepliesRequest{}
_ bin.BareEncoder = &BlockMessageSenderFromRepliesRequest{}
_ bin.BareDecoder = &BlockMessageSenderFromRepliesRequest{}
)
func (b *BlockMessageSenderFromRepliesRequest) Zero() bool {
if b == nil {
return true
}
if !(b.MessageID == 0) {
return false
}
if !(b.DeleteMessage == false) {
return false
}
if !(b.DeleteAllMessages == false) {
return false
}
if !(b.ReportSpam == false) {
return false
}
return true
}
// String implements fmt.Stringer.
func (b *BlockMessageSenderFromRepliesRequest) String() string {
if b == nil {
return "BlockMessageSenderFromRepliesRequest(nil)"
}
type Alias BlockMessageSenderFromRepliesRequest
return fmt.Sprintf("BlockMessageSenderFromRepliesRequest%+v", Alias(*b))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*BlockMessageSenderFromRepliesRequest) TypeID() uint32 {
return BlockMessageSenderFromRepliesRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*BlockMessageSenderFromRepliesRequest) TypeName() string {
return "blockMessageSenderFromReplies"
}
// TypeInfo returns info about TL type.
func (b *BlockMessageSenderFromRepliesRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "blockMessageSenderFromReplies",
ID: BlockMessageSenderFromRepliesRequestTypeID,
}
if b == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "MessageID",
SchemaName: "message_id",
},
{
Name: "DeleteMessage",
SchemaName: "delete_message",
},
{
Name: "DeleteAllMessages",
SchemaName: "delete_all_messages",
},
{
Name: "ReportSpam",
SchemaName: "report_spam",
},
}
return typ
}
// Encode implements bin.Encoder.
func (b *BlockMessageSenderFromRepliesRequest) Encode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode blockMessageSenderFromReplies#b79df58b as nil")
}
buf.PutID(BlockMessageSenderFromRepliesRequestTypeID)
return b.EncodeBare(buf)
}
// EncodeBare implements bin.BareEncoder.
func (b *BlockMessageSenderFromRepliesRequest) EncodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode blockMessageSenderFromReplies#b79df58b as nil")
}
buf.PutInt53(b.MessageID)
buf.PutBool(b.DeleteMessage)
buf.PutBool(b.DeleteAllMessages)
buf.PutBool(b.ReportSpam)
return nil
}
// Decode implements bin.Decoder.
func (b *BlockMessageSenderFromRepliesRequest) Decode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode blockMessageSenderFromReplies#b79df58b to nil")
}
if err := buf.ConsumeID(BlockMessageSenderFromRepliesRequestTypeID); err != nil {
return fmt.Errorf("unable to decode blockMessageSenderFromReplies#b79df58b: %w", err)
}
return b.DecodeBare(buf)
}
// DecodeBare implements bin.BareDecoder.
func (b *BlockMessageSenderFromRepliesRequest) DecodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode blockMessageSenderFromReplies#b79df58b to nil")
}
{
value, err := buf.Int53()
if err != nil {
return fmt.Errorf("unable to decode blockMessageSenderFromReplies#b79df58b: field message_id: %w", err)
}
b.MessageID = value
}
{
value, err := buf.Bool()
if err != nil {
return fmt.Errorf("unable to decode blockMessageSenderFromReplies#b79df58b: field delete_message: %w", err)
}
b.DeleteMessage = value
}
{
value, err := buf.Bool()
if err != nil {
return fmt.Errorf("unable to decode blockMessageSenderFromReplies#b79df58b: field delete_all_messages: %w", err)
}
b.DeleteAllMessages = value
}
{
value, err := buf.Bool()
if err != nil {
return fmt.Errorf("unable to decode blockMessageSenderFromReplies#b79df58b: field report_spam: %w", err)
}
b.ReportSpam = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (b *BlockMessageSenderFromRepliesRequest) EncodeTDLibJSON(buf tdjson.Encoder) error {
if b == nil {
return fmt.Errorf("can't encode blockMessageSenderFromReplies#b79df58b as nil")
}
buf.ObjStart()
buf.PutID("blockMessageSenderFromReplies")
buf.Comma()
buf.FieldStart("message_id")
buf.PutInt53(b.MessageID)
buf.Comma()
buf.FieldStart("delete_message")
buf.PutBool(b.DeleteMessage)
buf.Comma()
buf.FieldStart("delete_all_messages")
buf.PutBool(b.DeleteAllMessages)
buf.Comma()
buf.FieldStart("report_spam")
buf.PutBool(b.ReportSpam)
buf.Comma()
buf.StripComma()
buf.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (b *BlockMessageSenderFromRepliesRequest) DecodeTDLibJSON(buf tdjson.Decoder) error {
if b == nil {
return fmt.Errorf("can't decode blockMessageSenderFromReplies#b79df58b to nil")
}
return buf.Obj(func(buf tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := buf.ConsumeID("blockMessageSenderFromReplies"); err != nil {
return fmt.Errorf("unable to decode blockMessageSenderFromReplies#b79df58b: %w", err)
}
case "message_id":
value, err := buf.Int53()
if err != nil {
return fmt.Errorf("unable to decode blockMessageSenderFromReplies#b79df58b: field message_id: %w", err)
}
b.MessageID = value
case "delete_message":
value, err := buf.Bool()
if err != nil {
return fmt.Errorf("unable to decode blockMessageSenderFromReplies#b79df58b: field delete_message: %w", err)
}
b.DeleteMessage = value
case "delete_all_messages":
value, err := buf.Bool()
if err != nil {
return fmt.Errorf("unable to decode blockMessageSenderFromReplies#b79df58b: field delete_all_messages: %w", err)
}
b.DeleteAllMessages = value
case "report_spam":
value, err := buf.Bool()
if err != nil {
return fmt.Errorf("unable to decode blockMessageSenderFromReplies#b79df58b: field report_spam: %w", err)
}
b.ReportSpam = value
default:
return buf.Skip()
}
return nil
})
}
// GetMessageID returns value of MessageID field.
func (b *BlockMessageSenderFromRepliesRequest) GetMessageID() (value int64) {
if b == nil {
return
}
return b.MessageID
}
// GetDeleteMessage returns value of DeleteMessage field.
func (b *BlockMessageSenderFromRepliesRequest) GetDeleteMessage() (value bool) {
if b == nil {
return
}
return b.DeleteMessage
}
// GetDeleteAllMessages returns value of DeleteAllMessages field.
func (b *BlockMessageSenderFromRepliesRequest) GetDeleteAllMessages() (value bool) {
if b == nil {
return
}
return b.DeleteAllMessages
}
// GetReportSpam returns value of ReportSpam field.
func (b *BlockMessageSenderFromRepliesRequest) GetReportSpam() (value bool) {
if b == nil {
return
}
return b.ReportSpam
}
// BlockMessageSenderFromReplies invokes method blockMessageSenderFromReplies#b79df58b returning error if any.
func (c *Client) BlockMessageSenderFromReplies(ctx context.Context, request *BlockMessageSenderFromRepliesRequest) error {
var ok Ok
if err := c.rpc.Invoke(ctx, request, &ok); err != nil {
return err
}
return nil
}
-431
View File
@@ -1,431 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// BoolFalse represents TL type `boolFalse#bc799737`.
type BoolFalse struct {
}
// BoolFalseTypeID is TL type id of BoolFalse.
const BoolFalseTypeID = 0xbc799737
// construct implements constructor of BoolClass.
func (b BoolFalse) construct() BoolClass { return &b }
// Ensuring interfaces in compile-time for BoolFalse.
var (
_ bin.Encoder = &BoolFalse{}
_ bin.Decoder = &BoolFalse{}
_ bin.BareEncoder = &BoolFalse{}
_ bin.BareDecoder = &BoolFalse{}
_ BoolClass = &BoolFalse{}
)
func (b *BoolFalse) Zero() bool {
if b == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (b *BoolFalse) String() string {
if b == nil {
return "BoolFalse(nil)"
}
type Alias BoolFalse
return fmt.Sprintf("BoolFalse%+v", Alias(*b))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*BoolFalse) TypeID() uint32 {
return BoolFalseTypeID
}
// TypeName returns name of type in TL schema.
func (*BoolFalse) TypeName() string {
return "boolFalse"
}
// TypeInfo returns info about TL type.
func (b *BoolFalse) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "boolFalse",
ID: BoolFalseTypeID,
}
if b == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (b *BoolFalse) Encode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode boolFalse#bc799737 as nil")
}
buf.PutID(BoolFalseTypeID)
return b.EncodeBare(buf)
}
// EncodeBare implements bin.BareEncoder.
func (b *BoolFalse) EncodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode boolFalse#bc799737 as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (b *BoolFalse) Decode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode boolFalse#bc799737 to nil")
}
if err := buf.ConsumeID(BoolFalseTypeID); err != nil {
return fmt.Errorf("unable to decode boolFalse#bc799737: %w", err)
}
return b.DecodeBare(buf)
}
// DecodeBare implements bin.BareDecoder.
func (b *BoolFalse) DecodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode boolFalse#bc799737 to nil")
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (b *BoolFalse) EncodeTDLibJSON(buf tdjson.Encoder) error {
if b == nil {
return fmt.Errorf("can't encode boolFalse#bc799737 as nil")
}
buf.ObjStart()
buf.PutID("boolFalse")
buf.Comma()
buf.StripComma()
buf.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (b *BoolFalse) DecodeTDLibJSON(buf tdjson.Decoder) error {
if b == nil {
return fmt.Errorf("can't decode boolFalse#bc799737 to nil")
}
return buf.Obj(func(buf tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := buf.ConsumeID("boolFalse"); err != nil {
return fmt.Errorf("unable to decode boolFalse#bc799737: %w", err)
}
default:
return buf.Skip()
}
return nil
})
}
// BoolTrue represents TL type `boolTrue#997275b5`.
type BoolTrue struct {
}
// BoolTrueTypeID is TL type id of BoolTrue.
const BoolTrueTypeID = 0x997275b5
// construct implements constructor of BoolClass.
func (b BoolTrue) construct() BoolClass { return &b }
// Ensuring interfaces in compile-time for BoolTrue.
var (
_ bin.Encoder = &BoolTrue{}
_ bin.Decoder = &BoolTrue{}
_ bin.BareEncoder = &BoolTrue{}
_ bin.BareDecoder = &BoolTrue{}
_ BoolClass = &BoolTrue{}
)
func (b *BoolTrue) Zero() bool {
if b == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (b *BoolTrue) String() string {
if b == nil {
return "BoolTrue(nil)"
}
type Alias BoolTrue
return fmt.Sprintf("BoolTrue%+v", Alias(*b))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*BoolTrue) TypeID() uint32 {
return BoolTrueTypeID
}
// TypeName returns name of type in TL schema.
func (*BoolTrue) TypeName() string {
return "boolTrue"
}
// TypeInfo returns info about TL type.
func (b *BoolTrue) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "boolTrue",
ID: BoolTrueTypeID,
}
if b == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (b *BoolTrue) Encode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode boolTrue#997275b5 as nil")
}
buf.PutID(BoolTrueTypeID)
return b.EncodeBare(buf)
}
// EncodeBare implements bin.BareEncoder.
func (b *BoolTrue) EncodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode boolTrue#997275b5 as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (b *BoolTrue) Decode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode boolTrue#997275b5 to nil")
}
if err := buf.ConsumeID(BoolTrueTypeID); err != nil {
return fmt.Errorf("unable to decode boolTrue#997275b5: %w", err)
}
return b.DecodeBare(buf)
}
// DecodeBare implements bin.BareDecoder.
func (b *BoolTrue) DecodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode boolTrue#997275b5 to nil")
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (b *BoolTrue) EncodeTDLibJSON(buf tdjson.Encoder) error {
if b == nil {
return fmt.Errorf("can't encode boolTrue#997275b5 as nil")
}
buf.ObjStart()
buf.PutID("boolTrue")
buf.Comma()
buf.StripComma()
buf.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (b *BoolTrue) DecodeTDLibJSON(buf tdjson.Decoder) error {
if b == nil {
return fmt.Errorf("can't decode boolTrue#997275b5 to nil")
}
return buf.Obj(func(buf tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := buf.ConsumeID("boolTrue"); err != nil {
return fmt.Errorf("unable to decode boolTrue#997275b5: %w", err)
}
default:
return buf.Skip()
}
return nil
})
}
// BoolClassName is schema name of BoolClass.
const BoolClassName = "Bool"
// BoolClass represents Bool generic type.
//
// Example:
//
// g, err := tdapi.DecodeBool(buf)
// if err != nil {
// panic(err)
// }
// switch v := g.(type) {
// case *tdapi.BoolFalse: // boolFalse#bc799737
// case *tdapi.BoolTrue: // boolTrue#997275b5
// default: panic(v)
// }
type BoolClass interface {
bin.Encoder
bin.Decoder
bin.BareEncoder
bin.BareDecoder
construct() BoolClass
// 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
EncodeTDLibJSON(b tdjson.Encoder) error
DecodeTDLibJSON(b tdjson.Decoder) error
}
// DecodeBool implements binary de-serialization for BoolClass.
func DecodeBool(buf *bin.Buffer) (BoolClass, error) {
id, err := buf.PeekID()
if err != nil {
return nil, err
}
switch id {
case BoolFalseTypeID:
// Decoding boolFalse#bc799737.
v := BoolFalse{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode BoolClass: %w", err)
}
return &v, nil
case BoolTrueTypeID:
// Decoding boolTrue#997275b5.
v := BoolTrue{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode BoolClass: %w", err)
}
return &v, nil
default:
return nil, fmt.Errorf("unable to decode BoolClass: %w", bin.NewUnexpectedID(id))
}
}
// DecodeTDLibJSONBool implements binary de-serialization for BoolClass.
func DecodeTDLibJSONBool(buf tdjson.Decoder) (BoolClass, error) {
id, err := buf.FindTypeID()
if err != nil {
return nil, err
}
switch id {
case "boolFalse":
// Decoding boolFalse#bc799737.
v := BoolFalse{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode BoolClass: %w", err)
}
return &v, nil
case "boolTrue":
// Decoding boolTrue#997275b5.
v := BoolTrue{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode BoolClass: %w", err)
}
return &v, nil
default:
return nil, fmt.Errorf("unable to decode BoolClass: %w", tdjson.NewUnexpectedID(id))
}
}
// Bool boxes the BoolClass providing a helper.
type BoolBox struct {
Bool BoolClass
}
// Decode implements bin.Decoder for BoolBox.
func (b *BoolBox) Decode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("unable to decode BoolBox to nil")
}
v, err := DecodeBool(buf)
if err != nil {
return fmt.Errorf("unable to decode boxed value: %w", err)
}
b.Bool = v
return nil
}
// Encode implements bin.Encode for BoolBox.
func (b *BoolBox) Encode(buf *bin.Buffer) error {
if b == nil || b.Bool == nil {
return fmt.Errorf("unable to encode BoolClass as nil")
}
return b.Bool.Encode(buf)
}
// DecodeTDLibJSON implements bin.Decoder for BoolBox.
func (b *BoolBox) DecodeTDLibJSON(buf tdjson.Decoder) error {
if b == nil {
return fmt.Errorf("unable to decode BoolBox to nil")
}
v, err := DecodeTDLibJSONBool(buf)
if err != nil {
return fmt.Errorf("unable to decode boxed value: %w", err)
}
b.Bool = v
return nil
}
// EncodeTDLibJSON implements bin.Encode for BoolBox.
func (b *BoolBox) EncodeTDLibJSON(buf tdjson.Encoder) error {
if b == nil || b.Bool == nil {
return fmt.Errorf("unable to encode BoolClass as nil")
}
return b.Bool.EncodeTDLibJSON(buf)
}
-261
View File
@@ -1,261 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// BoostChatRequest represents TL type `boostChat#890ccd68`.
type BoostChatRequest struct {
// Identifier of the chat
ChatID int64
// Identifiers of boost slots of the current user from which to apply boosts to the chat
SlotIDs []int32
}
// BoostChatRequestTypeID is TL type id of BoostChatRequest.
const BoostChatRequestTypeID = 0x890ccd68
// Ensuring interfaces in compile-time for BoostChatRequest.
var (
_ bin.Encoder = &BoostChatRequest{}
_ bin.Decoder = &BoostChatRequest{}
_ bin.BareEncoder = &BoostChatRequest{}
_ bin.BareDecoder = &BoostChatRequest{}
)
func (b *BoostChatRequest) Zero() bool {
if b == nil {
return true
}
if !(b.ChatID == 0) {
return false
}
if !(b.SlotIDs == nil) {
return false
}
return true
}
// String implements fmt.Stringer.
func (b *BoostChatRequest) String() string {
if b == nil {
return "BoostChatRequest(nil)"
}
type Alias BoostChatRequest
return fmt.Sprintf("BoostChatRequest%+v", Alias(*b))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*BoostChatRequest) TypeID() uint32 {
return BoostChatRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*BoostChatRequest) TypeName() string {
return "boostChat"
}
// TypeInfo returns info about TL type.
func (b *BoostChatRequest) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "boostChat",
ID: BoostChatRequestTypeID,
}
if b == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "ChatID",
SchemaName: "chat_id",
},
{
Name: "SlotIDs",
SchemaName: "slot_ids",
},
}
return typ
}
// Encode implements bin.Encoder.
func (b *BoostChatRequest) Encode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode boostChat#890ccd68 as nil")
}
buf.PutID(BoostChatRequestTypeID)
return b.EncodeBare(buf)
}
// EncodeBare implements bin.BareEncoder.
func (b *BoostChatRequest) EncodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode boostChat#890ccd68 as nil")
}
buf.PutInt53(b.ChatID)
buf.PutInt(len(b.SlotIDs))
for _, v := range b.SlotIDs {
buf.PutInt32(v)
}
return nil
}
// Decode implements bin.Decoder.
func (b *BoostChatRequest) Decode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode boostChat#890ccd68 to nil")
}
if err := buf.ConsumeID(BoostChatRequestTypeID); err != nil {
return fmt.Errorf("unable to decode boostChat#890ccd68: %w", err)
}
return b.DecodeBare(buf)
}
// DecodeBare implements bin.BareDecoder.
func (b *BoostChatRequest) DecodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode boostChat#890ccd68 to nil")
}
{
value, err := buf.Int53()
if err != nil {
return fmt.Errorf("unable to decode boostChat#890ccd68: field chat_id: %w", err)
}
b.ChatID = value
}
{
headerLen, err := buf.Int()
if err != nil {
return fmt.Errorf("unable to decode boostChat#890ccd68: field slot_ids: %w", err)
}
if headerLen > 0 {
b.SlotIDs = make([]int32, 0, headerLen%bin.PreallocateLimit)
}
for idx := 0; idx < headerLen; idx++ {
value, err := buf.Int32()
if err != nil {
return fmt.Errorf("unable to decode boostChat#890ccd68: field slot_ids: %w", err)
}
b.SlotIDs = append(b.SlotIDs, value)
}
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (b *BoostChatRequest) EncodeTDLibJSON(buf tdjson.Encoder) error {
if b == nil {
return fmt.Errorf("can't encode boostChat#890ccd68 as nil")
}
buf.ObjStart()
buf.PutID("boostChat")
buf.Comma()
buf.FieldStart("chat_id")
buf.PutInt53(b.ChatID)
buf.Comma()
buf.FieldStart("slot_ids")
buf.ArrStart()
for _, v := range b.SlotIDs {
buf.PutInt32(v)
buf.Comma()
}
buf.StripComma()
buf.ArrEnd()
buf.Comma()
buf.StripComma()
buf.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (b *BoostChatRequest) DecodeTDLibJSON(buf tdjson.Decoder) error {
if b == nil {
return fmt.Errorf("can't decode boostChat#890ccd68 to nil")
}
return buf.Obj(func(buf tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := buf.ConsumeID("boostChat"); err != nil {
return fmt.Errorf("unable to decode boostChat#890ccd68: %w", err)
}
case "chat_id":
value, err := buf.Int53()
if err != nil {
return fmt.Errorf("unable to decode boostChat#890ccd68: field chat_id: %w", err)
}
b.ChatID = value
case "slot_ids":
if err := buf.Arr(func(buf tdjson.Decoder) error {
value, err := buf.Int32()
if err != nil {
return fmt.Errorf("unable to decode boostChat#890ccd68: field slot_ids: %w", err)
}
b.SlotIDs = append(b.SlotIDs, value)
return nil
}); err != nil {
return fmt.Errorf("unable to decode boostChat#890ccd68: field slot_ids: %w", err)
}
default:
return buf.Skip()
}
return nil
})
}
// GetChatID returns value of ChatID field.
func (b *BoostChatRequest) GetChatID() (value int64) {
if b == nil {
return
}
return b.ChatID
}
// GetSlotIDs returns value of SlotIDs field.
func (b *BoostChatRequest) GetSlotIDs() (value []int32) {
if b == nil {
return
}
return b.SlotIDs
}
// BoostChat invokes method boostChat#890ccd68 returning error if any.
func (c *Client) BoostChat(ctx context.Context, request *BoostChatRequest) (*ChatBoostSlots, error) {
var result ChatBoostSlots
if err := c.rpc.Invoke(ctx, request, &result); err != nil {
return nil, err
}
return &result, nil
}
-227
View File
@@ -1,227 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// BotCommand represents TL type `botCommand#c27ac8c7`.
type BotCommand struct {
// Text of the bot command
Command string
// Represents a command supported by a bot
Description string
}
// BotCommandTypeID is TL type id of BotCommand.
const BotCommandTypeID = 0xc27ac8c7
// Ensuring interfaces in compile-time for BotCommand.
var (
_ bin.Encoder = &BotCommand{}
_ bin.Decoder = &BotCommand{}
_ bin.BareEncoder = &BotCommand{}
_ bin.BareDecoder = &BotCommand{}
)
func (b *BotCommand) Zero() bool {
if b == nil {
return true
}
if !(b.Command == "") {
return false
}
if !(b.Description == "") {
return false
}
return true
}
// String implements fmt.Stringer.
func (b *BotCommand) String() string {
if b == nil {
return "BotCommand(nil)"
}
type Alias BotCommand
return fmt.Sprintf("BotCommand%+v", Alias(*b))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*BotCommand) TypeID() uint32 {
return BotCommandTypeID
}
// TypeName returns name of type in TL schema.
func (*BotCommand) TypeName() string {
return "botCommand"
}
// TypeInfo returns info about TL type.
func (b *BotCommand) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "botCommand",
ID: BotCommandTypeID,
}
if b == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "Command",
SchemaName: "command",
},
{
Name: "Description",
SchemaName: "description",
},
}
return typ
}
// Encode implements bin.Encoder.
func (b *BotCommand) Encode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode botCommand#c27ac8c7 as nil")
}
buf.PutID(BotCommandTypeID)
return b.EncodeBare(buf)
}
// EncodeBare implements bin.BareEncoder.
func (b *BotCommand) EncodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode botCommand#c27ac8c7 as nil")
}
buf.PutString(b.Command)
buf.PutString(b.Description)
return nil
}
// Decode implements bin.Decoder.
func (b *BotCommand) Decode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode botCommand#c27ac8c7 to nil")
}
if err := buf.ConsumeID(BotCommandTypeID); err != nil {
return fmt.Errorf("unable to decode botCommand#c27ac8c7: %w", err)
}
return b.DecodeBare(buf)
}
// DecodeBare implements bin.BareDecoder.
func (b *BotCommand) DecodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode botCommand#c27ac8c7 to nil")
}
{
value, err := buf.String()
if err != nil {
return fmt.Errorf("unable to decode botCommand#c27ac8c7: field command: %w", err)
}
b.Command = value
}
{
value, err := buf.String()
if err != nil {
return fmt.Errorf("unable to decode botCommand#c27ac8c7: field description: %w", err)
}
b.Description = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (b *BotCommand) EncodeTDLibJSON(buf tdjson.Encoder) error {
if b == nil {
return fmt.Errorf("can't encode botCommand#c27ac8c7 as nil")
}
buf.ObjStart()
buf.PutID("botCommand")
buf.Comma()
buf.FieldStart("command")
buf.PutString(b.Command)
buf.Comma()
buf.FieldStart("description")
buf.PutString(b.Description)
buf.Comma()
buf.StripComma()
buf.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (b *BotCommand) DecodeTDLibJSON(buf tdjson.Decoder) error {
if b == nil {
return fmt.Errorf("can't decode botCommand#c27ac8c7 to nil")
}
return buf.Obj(func(buf tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := buf.ConsumeID("botCommand"); err != nil {
return fmt.Errorf("unable to decode botCommand#c27ac8c7: %w", err)
}
case "command":
value, err := buf.String()
if err != nil {
return fmt.Errorf("unable to decode botCommand#c27ac8c7: field command: %w", err)
}
b.Command = value
case "description":
value, err := buf.String()
if err != nil {
return fmt.Errorf("unable to decode botCommand#c27ac8c7: field description: %w", err)
}
b.Description = value
default:
return buf.Skip()
}
return nil
})
}
// GetCommand returns value of Command field.
func (b *BotCommand) GetCommand() (value string) {
if b == nil {
return
}
return b.Command
}
// GetDescription returns value of Description field.
func (b *BotCommand) GetDescription() (value string) {
if b == nil {
return
}
return b.Description
}
File diff suppressed because it is too large Load Diff
-255
View File
@@ -1,255 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// BotCommands represents TL type `botCommands#4f9aa2c5`.
type BotCommands struct {
// Bot's user identifier
BotUserID int64
// List of bot commands
Commands []BotCommand
}
// BotCommandsTypeID is TL type id of BotCommands.
const BotCommandsTypeID = 0x4f9aa2c5
// Ensuring interfaces in compile-time for BotCommands.
var (
_ bin.Encoder = &BotCommands{}
_ bin.Decoder = &BotCommands{}
_ bin.BareEncoder = &BotCommands{}
_ bin.BareDecoder = &BotCommands{}
)
func (b *BotCommands) Zero() bool {
if b == nil {
return true
}
if !(b.BotUserID == 0) {
return false
}
if !(b.Commands == nil) {
return false
}
return true
}
// String implements fmt.Stringer.
func (b *BotCommands) String() string {
if b == nil {
return "BotCommands(nil)"
}
type Alias BotCommands
return fmt.Sprintf("BotCommands%+v", Alias(*b))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*BotCommands) TypeID() uint32 {
return BotCommandsTypeID
}
// TypeName returns name of type in TL schema.
func (*BotCommands) TypeName() string {
return "botCommands"
}
// TypeInfo returns info about TL type.
func (b *BotCommands) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "botCommands",
ID: BotCommandsTypeID,
}
if b == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "BotUserID",
SchemaName: "bot_user_id",
},
{
Name: "Commands",
SchemaName: "commands",
},
}
return typ
}
// Encode implements bin.Encoder.
func (b *BotCommands) Encode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode botCommands#4f9aa2c5 as nil")
}
buf.PutID(BotCommandsTypeID)
return b.EncodeBare(buf)
}
// EncodeBare implements bin.BareEncoder.
func (b *BotCommands) EncodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode botCommands#4f9aa2c5 as nil")
}
buf.PutInt53(b.BotUserID)
buf.PutInt(len(b.Commands))
for idx, v := range b.Commands {
if err := v.EncodeBare(buf); err != nil {
return fmt.Errorf("unable to encode bare botCommands#4f9aa2c5: field commands element with index %d: %w", idx, err)
}
}
return nil
}
// Decode implements bin.Decoder.
func (b *BotCommands) Decode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode botCommands#4f9aa2c5 to nil")
}
if err := buf.ConsumeID(BotCommandsTypeID); err != nil {
return fmt.Errorf("unable to decode botCommands#4f9aa2c5: %w", err)
}
return b.DecodeBare(buf)
}
// DecodeBare implements bin.BareDecoder.
func (b *BotCommands) DecodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode botCommands#4f9aa2c5 to nil")
}
{
value, err := buf.Int53()
if err != nil {
return fmt.Errorf("unable to decode botCommands#4f9aa2c5: field bot_user_id: %w", err)
}
b.BotUserID = value
}
{
headerLen, err := buf.Int()
if err != nil {
return fmt.Errorf("unable to decode botCommands#4f9aa2c5: field commands: %w", err)
}
if headerLen > 0 {
b.Commands = make([]BotCommand, 0, headerLen%bin.PreallocateLimit)
}
for idx := 0; idx < headerLen; idx++ {
var value BotCommand
if err := value.DecodeBare(buf); err != nil {
return fmt.Errorf("unable to decode bare botCommands#4f9aa2c5: field commands: %w", err)
}
b.Commands = append(b.Commands, value)
}
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (b *BotCommands) EncodeTDLibJSON(buf tdjson.Encoder) error {
if b == nil {
return fmt.Errorf("can't encode botCommands#4f9aa2c5 as nil")
}
buf.ObjStart()
buf.PutID("botCommands")
buf.Comma()
buf.FieldStart("bot_user_id")
buf.PutInt53(b.BotUserID)
buf.Comma()
buf.FieldStart("commands")
buf.ArrStart()
for idx, v := range b.Commands {
if err := v.EncodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to encode botCommands#4f9aa2c5: field commands element with index %d: %w", idx, err)
}
buf.Comma()
}
buf.StripComma()
buf.ArrEnd()
buf.Comma()
buf.StripComma()
buf.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (b *BotCommands) DecodeTDLibJSON(buf tdjson.Decoder) error {
if b == nil {
return fmt.Errorf("can't decode botCommands#4f9aa2c5 to nil")
}
return buf.Obj(func(buf tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := buf.ConsumeID("botCommands"); err != nil {
return fmt.Errorf("unable to decode botCommands#4f9aa2c5: %w", err)
}
case "bot_user_id":
value, err := buf.Int53()
if err != nil {
return fmt.Errorf("unable to decode botCommands#4f9aa2c5: field bot_user_id: %w", err)
}
b.BotUserID = value
case "commands":
if err := buf.Arr(func(buf tdjson.Decoder) error {
var value BotCommand
if err := value.DecodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to decode botCommands#4f9aa2c5: field commands: %w", err)
}
b.Commands = append(b.Commands, value)
return nil
}); err != nil {
return fmt.Errorf("unable to decode botCommands#4f9aa2c5: field commands: %w", err)
}
default:
return buf.Skip()
}
return nil
})
}
// GetBotUserID returns value of BotUserID field.
func (b *BotCommands) GetBotUserID() (value int64) {
if b == nil {
return
}
return b.BotUserID
}
// GetCommands returns value of Commands field.
func (b *BotCommands) GetCommands() (value []BotCommand) {
if b == nil {
return
}
return b.Commands
}
-982
View File
@@ -1,982 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// BotInfo represents TL type `botInfo#d16edb85`.
type BotInfo struct {
// The text that is shown on the bot's profile page and is sent together with the link
// when users share the bot
ShortDescription string
// Contains information about a bot
Description string
// Photo shown in the chat with the bot if the chat is empty; may be null
Photo Photo
// Animation shown in the chat with the bot if the chat is empty; may be null
Animation Animation
// Information about a button to show instead of the bot commands menu button; may be
// null if ordinary bot commands menu must be shown
MenuButton BotMenuButton
// List of the bot commands
Commands []BotCommand
// The HTTP link to the privacy policy of the bot. If empty, then /privacy command must
// be used if supported by the bot. If the command isn't supported, then https://telegram
// org/privacy-tpa must be opened
PrivacyPolicyURL string
// Default administrator rights for adding the bot to basic group and supergroup chats;
// may be null
DefaultGroupAdministratorRights ChatAdministratorRights
// Default administrator rights for adding the bot to channels; may be null
DefaultChannelAdministratorRights ChatAdministratorRights
// Information about the affiliate program of the bot; may be null if none
AffiliateProgram AffiliateProgramInfo
// Default light background color for bot Web Apps; -1 if not specified
WebAppBackgroundLightColor int32
// Default dark background color for bot Web Apps; -1 if not specified
WebAppBackgroundDarkColor int32
// Default light header color for bot Web Apps; -1 if not specified
WebAppHeaderLightColor int32
// Default dark header color for bot Web Apps; -1 if not specified
WebAppHeaderDarkColor int32
// Parameters of the verification that can be provided by the bot; may be null if none or
// the current user isn't the owner of the bot
VerificationParameters BotVerificationParameters
// True, if the bot's revenue statistics are available to the current user
CanGetRevenueStatistics bool
// True, if the bot can manage emoji status of the current user
CanManageEmojiStatus bool
// True, if the bot has media previews
HasMediaPreviews bool
// The internal link, which can be used to edit bot commands; may be null
EditCommandsLink InternalLinkTypeClass
// The internal link, which can be used to edit bot description; may be null
EditDescriptionLink InternalLinkTypeClass
// The internal link, which can be used to edit the photo or animation shown in the chat
// with the bot if the chat is empty; may be null
EditDescriptionMediaLink InternalLinkTypeClass
// The internal link, which can be used to edit bot settings; may be null
EditSettingsLink InternalLinkTypeClass
}
// BotInfoTypeID is TL type id of BotInfo.
const BotInfoTypeID = 0xd16edb85
// Ensuring interfaces in compile-time for BotInfo.
var (
_ bin.Encoder = &BotInfo{}
_ bin.Decoder = &BotInfo{}
_ bin.BareEncoder = &BotInfo{}
_ bin.BareDecoder = &BotInfo{}
)
func (b *BotInfo) Zero() bool {
if b == nil {
return true
}
if !(b.ShortDescription == "") {
return false
}
if !(b.Description == "") {
return false
}
if !(b.Photo.Zero()) {
return false
}
if !(b.Animation.Zero()) {
return false
}
if !(b.MenuButton.Zero()) {
return false
}
if !(b.Commands == nil) {
return false
}
if !(b.PrivacyPolicyURL == "") {
return false
}
if !(b.DefaultGroupAdministratorRights.Zero()) {
return false
}
if !(b.DefaultChannelAdministratorRights.Zero()) {
return false
}
if !(b.AffiliateProgram.Zero()) {
return false
}
if !(b.WebAppBackgroundLightColor == 0) {
return false
}
if !(b.WebAppBackgroundDarkColor == 0) {
return false
}
if !(b.WebAppHeaderLightColor == 0) {
return false
}
if !(b.WebAppHeaderDarkColor == 0) {
return false
}
if !(b.VerificationParameters.Zero()) {
return false
}
if !(b.CanGetRevenueStatistics == false) {
return false
}
if !(b.CanManageEmojiStatus == false) {
return false
}
if !(b.HasMediaPreviews == false) {
return false
}
if !(b.EditCommandsLink == nil) {
return false
}
if !(b.EditDescriptionLink == nil) {
return false
}
if !(b.EditDescriptionMediaLink == nil) {
return false
}
if !(b.EditSettingsLink == nil) {
return false
}
return true
}
// String implements fmt.Stringer.
func (b *BotInfo) String() string {
if b == nil {
return "BotInfo(nil)"
}
type Alias BotInfo
return fmt.Sprintf("BotInfo%+v", Alias(*b))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*BotInfo) TypeID() uint32 {
return BotInfoTypeID
}
// TypeName returns name of type in TL schema.
func (*BotInfo) TypeName() string {
return "botInfo"
}
// TypeInfo returns info about TL type.
func (b *BotInfo) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "botInfo",
ID: BotInfoTypeID,
}
if b == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "ShortDescription",
SchemaName: "short_description",
},
{
Name: "Description",
SchemaName: "description",
},
{
Name: "Photo",
SchemaName: "photo",
},
{
Name: "Animation",
SchemaName: "animation",
},
{
Name: "MenuButton",
SchemaName: "menu_button",
},
{
Name: "Commands",
SchemaName: "commands",
},
{
Name: "PrivacyPolicyURL",
SchemaName: "privacy_policy_url",
},
{
Name: "DefaultGroupAdministratorRights",
SchemaName: "default_group_administrator_rights",
},
{
Name: "DefaultChannelAdministratorRights",
SchemaName: "default_channel_administrator_rights",
},
{
Name: "AffiliateProgram",
SchemaName: "affiliate_program",
},
{
Name: "WebAppBackgroundLightColor",
SchemaName: "web_app_background_light_color",
},
{
Name: "WebAppBackgroundDarkColor",
SchemaName: "web_app_background_dark_color",
},
{
Name: "WebAppHeaderLightColor",
SchemaName: "web_app_header_light_color",
},
{
Name: "WebAppHeaderDarkColor",
SchemaName: "web_app_header_dark_color",
},
{
Name: "VerificationParameters",
SchemaName: "verification_parameters",
},
{
Name: "CanGetRevenueStatistics",
SchemaName: "can_get_revenue_statistics",
},
{
Name: "CanManageEmojiStatus",
SchemaName: "can_manage_emoji_status",
},
{
Name: "HasMediaPreviews",
SchemaName: "has_media_previews",
},
{
Name: "EditCommandsLink",
SchemaName: "edit_commands_link",
},
{
Name: "EditDescriptionLink",
SchemaName: "edit_description_link",
},
{
Name: "EditDescriptionMediaLink",
SchemaName: "edit_description_media_link",
},
{
Name: "EditSettingsLink",
SchemaName: "edit_settings_link",
},
}
return typ
}
// Encode implements bin.Encoder.
func (b *BotInfo) Encode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode botInfo#d16edb85 as nil")
}
buf.PutID(BotInfoTypeID)
return b.EncodeBare(buf)
}
// EncodeBare implements bin.BareEncoder.
func (b *BotInfo) EncodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode botInfo#d16edb85 as nil")
}
buf.PutString(b.ShortDescription)
buf.PutString(b.Description)
if err := b.Photo.Encode(buf); err != nil {
return fmt.Errorf("unable to encode botInfo#d16edb85: field photo: %w", err)
}
if err := b.Animation.Encode(buf); err != nil {
return fmt.Errorf("unable to encode botInfo#d16edb85: field animation: %w", err)
}
if err := b.MenuButton.Encode(buf); err != nil {
return fmt.Errorf("unable to encode botInfo#d16edb85: field menu_button: %w", err)
}
buf.PutInt(len(b.Commands))
for idx, v := range b.Commands {
if err := v.EncodeBare(buf); err != nil {
return fmt.Errorf("unable to encode bare botInfo#d16edb85: field commands element with index %d: %w", idx, err)
}
}
buf.PutString(b.PrivacyPolicyURL)
if err := b.DefaultGroupAdministratorRights.Encode(buf); err != nil {
return fmt.Errorf("unable to encode botInfo#d16edb85: field default_group_administrator_rights: %w", err)
}
if err := b.DefaultChannelAdministratorRights.Encode(buf); err != nil {
return fmt.Errorf("unable to encode botInfo#d16edb85: field default_channel_administrator_rights: %w", err)
}
if err := b.AffiliateProgram.Encode(buf); err != nil {
return fmt.Errorf("unable to encode botInfo#d16edb85: field affiliate_program: %w", err)
}
buf.PutInt32(b.WebAppBackgroundLightColor)
buf.PutInt32(b.WebAppBackgroundDarkColor)
buf.PutInt32(b.WebAppHeaderLightColor)
buf.PutInt32(b.WebAppHeaderDarkColor)
if err := b.VerificationParameters.Encode(buf); err != nil {
return fmt.Errorf("unable to encode botInfo#d16edb85: field verification_parameters: %w", err)
}
buf.PutBool(b.CanGetRevenueStatistics)
buf.PutBool(b.CanManageEmojiStatus)
buf.PutBool(b.HasMediaPreviews)
if b.EditCommandsLink == nil {
return fmt.Errorf("unable to encode botInfo#d16edb85: field edit_commands_link is nil")
}
if err := b.EditCommandsLink.Encode(buf); err != nil {
return fmt.Errorf("unable to encode botInfo#d16edb85: field edit_commands_link: %w", err)
}
if b.EditDescriptionLink == nil {
return fmt.Errorf("unable to encode botInfo#d16edb85: field edit_description_link is nil")
}
if err := b.EditDescriptionLink.Encode(buf); err != nil {
return fmt.Errorf("unable to encode botInfo#d16edb85: field edit_description_link: %w", err)
}
if b.EditDescriptionMediaLink == nil {
return fmt.Errorf("unable to encode botInfo#d16edb85: field edit_description_media_link is nil")
}
if err := b.EditDescriptionMediaLink.Encode(buf); err != nil {
return fmt.Errorf("unable to encode botInfo#d16edb85: field edit_description_media_link: %w", err)
}
if b.EditSettingsLink == nil {
return fmt.Errorf("unable to encode botInfo#d16edb85: field edit_settings_link is nil")
}
if err := b.EditSettingsLink.Encode(buf); err != nil {
return fmt.Errorf("unable to encode botInfo#d16edb85: field edit_settings_link: %w", err)
}
return nil
}
// Decode implements bin.Decoder.
func (b *BotInfo) Decode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode botInfo#d16edb85 to nil")
}
if err := buf.ConsumeID(BotInfoTypeID); err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: %w", err)
}
return b.DecodeBare(buf)
}
// DecodeBare implements bin.BareDecoder.
func (b *BotInfo) DecodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode botInfo#d16edb85 to nil")
}
{
value, err := buf.String()
if err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field short_description: %w", err)
}
b.ShortDescription = value
}
{
value, err := buf.String()
if err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field description: %w", err)
}
b.Description = value
}
{
if err := b.Photo.Decode(buf); err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field photo: %w", err)
}
}
{
if err := b.Animation.Decode(buf); err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field animation: %w", err)
}
}
{
if err := b.MenuButton.Decode(buf); err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field menu_button: %w", err)
}
}
{
headerLen, err := buf.Int()
if err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field commands: %w", err)
}
if headerLen > 0 {
b.Commands = make([]BotCommand, 0, headerLen%bin.PreallocateLimit)
}
for idx := 0; idx < headerLen; idx++ {
var value BotCommand
if err := value.DecodeBare(buf); err != nil {
return fmt.Errorf("unable to decode bare botInfo#d16edb85: field commands: %w", err)
}
b.Commands = append(b.Commands, value)
}
}
{
value, err := buf.String()
if err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field privacy_policy_url: %w", err)
}
b.PrivacyPolicyURL = value
}
{
if err := b.DefaultGroupAdministratorRights.Decode(buf); err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field default_group_administrator_rights: %w", err)
}
}
{
if err := b.DefaultChannelAdministratorRights.Decode(buf); err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field default_channel_administrator_rights: %w", err)
}
}
{
if err := b.AffiliateProgram.Decode(buf); err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field affiliate_program: %w", err)
}
}
{
value, err := buf.Int32()
if err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field web_app_background_light_color: %w", err)
}
b.WebAppBackgroundLightColor = value
}
{
value, err := buf.Int32()
if err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field web_app_background_dark_color: %w", err)
}
b.WebAppBackgroundDarkColor = value
}
{
value, err := buf.Int32()
if err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field web_app_header_light_color: %w", err)
}
b.WebAppHeaderLightColor = value
}
{
value, err := buf.Int32()
if err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field web_app_header_dark_color: %w", err)
}
b.WebAppHeaderDarkColor = value
}
{
if err := b.VerificationParameters.Decode(buf); err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field verification_parameters: %w", err)
}
}
{
value, err := buf.Bool()
if err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field can_get_revenue_statistics: %w", err)
}
b.CanGetRevenueStatistics = value
}
{
value, err := buf.Bool()
if err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field can_manage_emoji_status: %w", err)
}
b.CanManageEmojiStatus = value
}
{
value, err := buf.Bool()
if err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field has_media_previews: %w", err)
}
b.HasMediaPreviews = value
}
{
value, err := DecodeInternalLinkType(buf)
if err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field edit_commands_link: %w", err)
}
b.EditCommandsLink = value
}
{
value, err := DecodeInternalLinkType(buf)
if err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field edit_description_link: %w", err)
}
b.EditDescriptionLink = value
}
{
value, err := DecodeInternalLinkType(buf)
if err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field edit_description_media_link: %w", err)
}
b.EditDescriptionMediaLink = value
}
{
value, err := DecodeInternalLinkType(buf)
if err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field edit_settings_link: %w", err)
}
b.EditSettingsLink = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (b *BotInfo) EncodeTDLibJSON(buf tdjson.Encoder) error {
if b == nil {
return fmt.Errorf("can't encode botInfo#d16edb85 as nil")
}
buf.ObjStart()
buf.PutID("botInfo")
buf.Comma()
buf.FieldStart("short_description")
buf.PutString(b.ShortDescription)
buf.Comma()
buf.FieldStart("description")
buf.PutString(b.Description)
buf.Comma()
buf.FieldStart("photo")
if err := b.Photo.EncodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to encode botInfo#d16edb85: field photo: %w", err)
}
buf.Comma()
buf.FieldStart("animation")
if err := b.Animation.EncodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to encode botInfo#d16edb85: field animation: %w", err)
}
buf.Comma()
buf.FieldStart("menu_button")
if err := b.MenuButton.EncodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to encode botInfo#d16edb85: field menu_button: %w", err)
}
buf.Comma()
buf.FieldStart("commands")
buf.ArrStart()
for idx, v := range b.Commands {
if err := v.EncodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to encode botInfo#d16edb85: field commands element with index %d: %w", idx, err)
}
buf.Comma()
}
buf.StripComma()
buf.ArrEnd()
buf.Comma()
buf.FieldStart("privacy_policy_url")
buf.PutString(b.PrivacyPolicyURL)
buf.Comma()
buf.FieldStart("default_group_administrator_rights")
if err := b.DefaultGroupAdministratorRights.EncodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to encode botInfo#d16edb85: field default_group_administrator_rights: %w", err)
}
buf.Comma()
buf.FieldStart("default_channel_administrator_rights")
if err := b.DefaultChannelAdministratorRights.EncodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to encode botInfo#d16edb85: field default_channel_administrator_rights: %w", err)
}
buf.Comma()
buf.FieldStart("affiliate_program")
if err := b.AffiliateProgram.EncodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to encode botInfo#d16edb85: field affiliate_program: %w", err)
}
buf.Comma()
buf.FieldStart("web_app_background_light_color")
buf.PutInt32(b.WebAppBackgroundLightColor)
buf.Comma()
buf.FieldStart("web_app_background_dark_color")
buf.PutInt32(b.WebAppBackgroundDarkColor)
buf.Comma()
buf.FieldStart("web_app_header_light_color")
buf.PutInt32(b.WebAppHeaderLightColor)
buf.Comma()
buf.FieldStart("web_app_header_dark_color")
buf.PutInt32(b.WebAppHeaderDarkColor)
buf.Comma()
buf.FieldStart("verification_parameters")
if err := b.VerificationParameters.EncodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to encode botInfo#d16edb85: field verification_parameters: %w", err)
}
buf.Comma()
buf.FieldStart("can_get_revenue_statistics")
buf.PutBool(b.CanGetRevenueStatistics)
buf.Comma()
buf.FieldStart("can_manage_emoji_status")
buf.PutBool(b.CanManageEmojiStatus)
buf.Comma()
buf.FieldStart("has_media_previews")
buf.PutBool(b.HasMediaPreviews)
buf.Comma()
buf.FieldStart("edit_commands_link")
if b.EditCommandsLink == nil {
return fmt.Errorf("unable to encode botInfo#d16edb85: field edit_commands_link is nil")
}
if err := b.EditCommandsLink.EncodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to encode botInfo#d16edb85: field edit_commands_link: %w", err)
}
buf.Comma()
buf.FieldStart("edit_description_link")
if b.EditDescriptionLink == nil {
return fmt.Errorf("unable to encode botInfo#d16edb85: field edit_description_link is nil")
}
if err := b.EditDescriptionLink.EncodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to encode botInfo#d16edb85: field edit_description_link: %w", err)
}
buf.Comma()
buf.FieldStart("edit_description_media_link")
if b.EditDescriptionMediaLink == nil {
return fmt.Errorf("unable to encode botInfo#d16edb85: field edit_description_media_link is nil")
}
if err := b.EditDescriptionMediaLink.EncodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to encode botInfo#d16edb85: field edit_description_media_link: %w", err)
}
buf.Comma()
buf.FieldStart("edit_settings_link")
if b.EditSettingsLink == nil {
return fmt.Errorf("unable to encode botInfo#d16edb85: field edit_settings_link is nil")
}
if err := b.EditSettingsLink.EncodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to encode botInfo#d16edb85: field edit_settings_link: %w", err)
}
buf.Comma()
buf.StripComma()
buf.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (b *BotInfo) DecodeTDLibJSON(buf tdjson.Decoder) error {
if b == nil {
return fmt.Errorf("can't decode botInfo#d16edb85 to nil")
}
return buf.Obj(func(buf tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := buf.ConsumeID("botInfo"); err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: %w", err)
}
case "short_description":
value, err := buf.String()
if err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field short_description: %w", err)
}
b.ShortDescription = value
case "description":
value, err := buf.String()
if err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field description: %w", err)
}
b.Description = value
case "photo":
if err := b.Photo.DecodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field photo: %w", err)
}
case "animation":
if err := b.Animation.DecodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field animation: %w", err)
}
case "menu_button":
if err := b.MenuButton.DecodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field menu_button: %w", err)
}
case "commands":
if err := buf.Arr(func(buf tdjson.Decoder) error {
var value BotCommand
if err := value.DecodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field commands: %w", err)
}
b.Commands = append(b.Commands, value)
return nil
}); err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field commands: %w", err)
}
case "privacy_policy_url":
value, err := buf.String()
if err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field privacy_policy_url: %w", err)
}
b.PrivacyPolicyURL = value
case "default_group_administrator_rights":
if err := b.DefaultGroupAdministratorRights.DecodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field default_group_administrator_rights: %w", err)
}
case "default_channel_administrator_rights":
if err := b.DefaultChannelAdministratorRights.DecodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field default_channel_administrator_rights: %w", err)
}
case "affiliate_program":
if err := b.AffiliateProgram.DecodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field affiliate_program: %w", err)
}
case "web_app_background_light_color":
value, err := buf.Int32()
if err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field web_app_background_light_color: %w", err)
}
b.WebAppBackgroundLightColor = value
case "web_app_background_dark_color":
value, err := buf.Int32()
if err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field web_app_background_dark_color: %w", err)
}
b.WebAppBackgroundDarkColor = value
case "web_app_header_light_color":
value, err := buf.Int32()
if err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field web_app_header_light_color: %w", err)
}
b.WebAppHeaderLightColor = value
case "web_app_header_dark_color":
value, err := buf.Int32()
if err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field web_app_header_dark_color: %w", err)
}
b.WebAppHeaderDarkColor = value
case "verification_parameters":
if err := b.VerificationParameters.DecodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field verification_parameters: %w", err)
}
case "can_get_revenue_statistics":
value, err := buf.Bool()
if err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field can_get_revenue_statistics: %w", err)
}
b.CanGetRevenueStatistics = value
case "can_manage_emoji_status":
value, err := buf.Bool()
if err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field can_manage_emoji_status: %w", err)
}
b.CanManageEmojiStatus = value
case "has_media_previews":
value, err := buf.Bool()
if err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field has_media_previews: %w", err)
}
b.HasMediaPreviews = value
case "edit_commands_link":
value, err := DecodeTDLibJSONInternalLinkType(buf)
if err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field edit_commands_link: %w", err)
}
b.EditCommandsLink = value
case "edit_description_link":
value, err := DecodeTDLibJSONInternalLinkType(buf)
if err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field edit_description_link: %w", err)
}
b.EditDescriptionLink = value
case "edit_description_media_link":
value, err := DecodeTDLibJSONInternalLinkType(buf)
if err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field edit_description_media_link: %w", err)
}
b.EditDescriptionMediaLink = value
case "edit_settings_link":
value, err := DecodeTDLibJSONInternalLinkType(buf)
if err != nil {
return fmt.Errorf("unable to decode botInfo#d16edb85: field edit_settings_link: %w", err)
}
b.EditSettingsLink = value
default:
return buf.Skip()
}
return nil
})
}
// GetShortDescription returns value of ShortDescription field.
func (b *BotInfo) GetShortDescription() (value string) {
if b == nil {
return
}
return b.ShortDescription
}
// GetDescription returns value of Description field.
func (b *BotInfo) GetDescription() (value string) {
if b == nil {
return
}
return b.Description
}
// GetPhoto returns value of Photo field.
func (b *BotInfo) GetPhoto() (value Photo) {
if b == nil {
return
}
return b.Photo
}
// GetAnimation returns value of Animation field.
func (b *BotInfo) GetAnimation() (value Animation) {
if b == nil {
return
}
return b.Animation
}
// GetMenuButton returns value of MenuButton field.
func (b *BotInfo) GetMenuButton() (value BotMenuButton) {
if b == nil {
return
}
return b.MenuButton
}
// GetCommands returns value of Commands field.
func (b *BotInfo) GetCommands() (value []BotCommand) {
if b == nil {
return
}
return b.Commands
}
// GetPrivacyPolicyURL returns value of PrivacyPolicyURL field.
func (b *BotInfo) GetPrivacyPolicyURL() (value string) {
if b == nil {
return
}
return b.PrivacyPolicyURL
}
// GetDefaultGroupAdministratorRights returns value of DefaultGroupAdministratorRights field.
func (b *BotInfo) GetDefaultGroupAdministratorRights() (value ChatAdministratorRights) {
if b == nil {
return
}
return b.DefaultGroupAdministratorRights
}
// GetDefaultChannelAdministratorRights returns value of DefaultChannelAdministratorRights field.
func (b *BotInfo) GetDefaultChannelAdministratorRights() (value ChatAdministratorRights) {
if b == nil {
return
}
return b.DefaultChannelAdministratorRights
}
// GetAffiliateProgram returns value of AffiliateProgram field.
func (b *BotInfo) GetAffiliateProgram() (value AffiliateProgramInfo) {
if b == nil {
return
}
return b.AffiliateProgram
}
// GetWebAppBackgroundLightColor returns value of WebAppBackgroundLightColor field.
func (b *BotInfo) GetWebAppBackgroundLightColor() (value int32) {
if b == nil {
return
}
return b.WebAppBackgroundLightColor
}
// GetWebAppBackgroundDarkColor returns value of WebAppBackgroundDarkColor field.
func (b *BotInfo) GetWebAppBackgroundDarkColor() (value int32) {
if b == nil {
return
}
return b.WebAppBackgroundDarkColor
}
// GetWebAppHeaderLightColor returns value of WebAppHeaderLightColor field.
func (b *BotInfo) GetWebAppHeaderLightColor() (value int32) {
if b == nil {
return
}
return b.WebAppHeaderLightColor
}
// GetWebAppHeaderDarkColor returns value of WebAppHeaderDarkColor field.
func (b *BotInfo) GetWebAppHeaderDarkColor() (value int32) {
if b == nil {
return
}
return b.WebAppHeaderDarkColor
}
// GetVerificationParameters returns value of VerificationParameters field.
func (b *BotInfo) GetVerificationParameters() (value BotVerificationParameters) {
if b == nil {
return
}
return b.VerificationParameters
}
// GetCanGetRevenueStatistics returns value of CanGetRevenueStatistics field.
func (b *BotInfo) GetCanGetRevenueStatistics() (value bool) {
if b == nil {
return
}
return b.CanGetRevenueStatistics
}
// GetCanManageEmojiStatus returns value of CanManageEmojiStatus field.
func (b *BotInfo) GetCanManageEmojiStatus() (value bool) {
if b == nil {
return
}
return b.CanManageEmojiStatus
}
// GetHasMediaPreviews returns value of HasMediaPreviews field.
func (b *BotInfo) GetHasMediaPreviews() (value bool) {
if b == nil {
return
}
return b.HasMediaPreviews
}
// GetEditCommandsLink returns value of EditCommandsLink field.
func (b *BotInfo) GetEditCommandsLink() (value InternalLinkTypeClass) {
if b == nil {
return
}
return b.EditCommandsLink
}
// GetEditDescriptionLink returns value of EditDescriptionLink field.
func (b *BotInfo) GetEditDescriptionLink() (value InternalLinkTypeClass) {
if b == nil {
return
}
return b.EditDescriptionLink
}
// GetEditDescriptionMediaLink returns value of EditDescriptionMediaLink field.
func (b *BotInfo) GetEditDescriptionMediaLink() (value InternalLinkTypeClass) {
if b == nil {
return
}
return b.EditDescriptionMediaLink
}
// GetEditSettingsLink returns value of EditSettingsLink field.
func (b *BotInfo) GetEditSettingsLink() (value InternalLinkTypeClass) {
if b == nil {
return
}
return b.EditSettingsLink
}
-237
View File
@@ -1,237 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// BotMediaPreview represents TL type `botMediaPreview#9eb59ce8`.
type BotMediaPreview struct {
// Point in time (Unix timestamp) when the preview was added or changed last time
Date int32
// Content of the preview
Content StoryContentClass
}
// BotMediaPreviewTypeID is TL type id of BotMediaPreview.
const BotMediaPreviewTypeID = 0x9eb59ce8
// Ensuring interfaces in compile-time for BotMediaPreview.
var (
_ bin.Encoder = &BotMediaPreview{}
_ bin.Decoder = &BotMediaPreview{}
_ bin.BareEncoder = &BotMediaPreview{}
_ bin.BareDecoder = &BotMediaPreview{}
)
func (b *BotMediaPreview) Zero() bool {
if b == nil {
return true
}
if !(b.Date == 0) {
return false
}
if !(b.Content == nil) {
return false
}
return true
}
// String implements fmt.Stringer.
func (b *BotMediaPreview) String() string {
if b == nil {
return "BotMediaPreview(nil)"
}
type Alias BotMediaPreview
return fmt.Sprintf("BotMediaPreview%+v", Alias(*b))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*BotMediaPreview) TypeID() uint32 {
return BotMediaPreviewTypeID
}
// TypeName returns name of type in TL schema.
func (*BotMediaPreview) TypeName() string {
return "botMediaPreview"
}
// TypeInfo returns info about TL type.
func (b *BotMediaPreview) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "botMediaPreview",
ID: BotMediaPreviewTypeID,
}
if b == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "Date",
SchemaName: "date",
},
{
Name: "Content",
SchemaName: "content",
},
}
return typ
}
// Encode implements bin.Encoder.
func (b *BotMediaPreview) Encode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode botMediaPreview#9eb59ce8 as nil")
}
buf.PutID(BotMediaPreviewTypeID)
return b.EncodeBare(buf)
}
// EncodeBare implements bin.BareEncoder.
func (b *BotMediaPreview) EncodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode botMediaPreview#9eb59ce8 as nil")
}
buf.PutInt32(b.Date)
if b.Content == nil {
return fmt.Errorf("unable to encode botMediaPreview#9eb59ce8: field content is nil")
}
if err := b.Content.Encode(buf); err != nil {
return fmt.Errorf("unable to encode botMediaPreview#9eb59ce8: field content: %w", err)
}
return nil
}
// Decode implements bin.Decoder.
func (b *BotMediaPreview) Decode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode botMediaPreview#9eb59ce8 to nil")
}
if err := buf.ConsumeID(BotMediaPreviewTypeID); err != nil {
return fmt.Errorf("unable to decode botMediaPreview#9eb59ce8: %w", err)
}
return b.DecodeBare(buf)
}
// DecodeBare implements bin.BareDecoder.
func (b *BotMediaPreview) DecodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode botMediaPreview#9eb59ce8 to nil")
}
{
value, err := buf.Int32()
if err != nil {
return fmt.Errorf("unable to decode botMediaPreview#9eb59ce8: field date: %w", err)
}
b.Date = value
}
{
value, err := DecodeStoryContent(buf)
if err != nil {
return fmt.Errorf("unable to decode botMediaPreview#9eb59ce8: field content: %w", err)
}
b.Content = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (b *BotMediaPreview) EncodeTDLibJSON(buf tdjson.Encoder) error {
if b == nil {
return fmt.Errorf("can't encode botMediaPreview#9eb59ce8 as nil")
}
buf.ObjStart()
buf.PutID("botMediaPreview")
buf.Comma()
buf.FieldStart("date")
buf.PutInt32(b.Date)
buf.Comma()
buf.FieldStart("content")
if b.Content == nil {
return fmt.Errorf("unable to encode botMediaPreview#9eb59ce8: field content is nil")
}
if err := b.Content.EncodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to encode botMediaPreview#9eb59ce8: field content: %w", err)
}
buf.Comma()
buf.StripComma()
buf.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (b *BotMediaPreview) DecodeTDLibJSON(buf tdjson.Decoder) error {
if b == nil {
return fmt.Errorf("can't decode botMediaPreview#9eb59ce8 to nil")
}
return buf.Obj(func(buf tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := buf.ConsumeID("botMediaPreview"); err != nil {
return fmt.Errorf("unable to decode botMediaPreview#9eb59ce8: %w", err)
}
case "date":
value, err := buf.Int32()
if err != nil {
return fmt.Errorf("unable to decode botMediaPreview#9eb59ce8: field date: %w", err)
}
b.Date = value
case "content":
value, err := DecodeTDLibJSONStoryContent(buf)
if err != nil {
return fmt.Errorf("unable to decode botMediaPreview#9eb59ce8: field content: %w", err)
}
b.Content = value
default:
return buf.Skip()
}
return nil
})
}
// GetDate returns value of Date field.
func (b *BotMediaPreview) GetDate() (value int32) {
if b == nil {
return
}
return b.Date
}
// GetContent returns value of Content field.
func (b *BotMediaPreview) GetContent() (value StoryContentClass) {
if b == nil {
return
}
return b.Content
}
-279
View File
@@ -1,279 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// BotMediaPreviewInfo represents TL type `botMediaPreviewInfo#e49169db`.
type BotMediaPreviewInfo struct {
// List of media previews
Previews []BotMediaPreview
// List of language codes for which the bot has dedicated previews
LanguageCodes []string
}
// BotMediaPreviewInfoTypeID is TL type id of BotMediaPreviewInfo.
const BotMediaPreviewInfoTypeID = 0xe49169db
// Ensuring interfaces in compile-time for BotMediaPreviewInfo.
var (
_ bin.Encoder = &BotMediaPreviewInfo{}
_ bin.Decoder = &BotMediaPreviewInfo{}
_ bin.BareEncoder = &BotMediaPreviewInfo{}
_ bin.BareDecoder = &BotMediaPreviewInfo{}
)
func (b *BotMediaPreviewInfo) Zero() bool {
if b == nil {
return true
}
if !(b.Previews == nil) {
return false
}
if !(b.LanguageCodes == nil) {
return false
}
return true
}
// String implements fmt.Stringer.
func (b *BotMediaPreviewInfo) String() string {
if b == nil {
return "BotMediaPreviewInfo(nil)"
}
type Alias BotMediaPreviewInfo
return fmt.Sprintf("BotMediaPreviewInfo%+v", Alias(*b))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*BotMediaPreviewInfo) TypeID() uint32 {
return BotMediaPreviewInfoTypeID
}
// TypeName returns name of type in TL schema.
func (*BotMediaPreviewInfo) TypeName() string {
return "botMediaPreviewInfo"
}
// TypeInfo returns info about TL type.
func (b *BotMediaPreviewInfo) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "botMediaPreviewInfo",
ID: BotMediaPreviewInfoTypeID,
}
if b == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "Previews",
SchemaName: "previews",
},
{
Name: "LanguageCodes",
SchemaName: "language_codes",
},
}
return typ
}
// Encode implements bin.Encoder.
func (b *BotMediaPreviewInfo) Encode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode botMediaPreviewInfo#e49169db as nil")
}
buf.PutID(BotMediaPreviewInfoTypeID)
return b.EncodeBare(buf)
}
// EncodeBare implements bin.BareEncoder.
func (b *BotMediaPreviewInfo) EncodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode botMediaPreviewInfo#e49169db as nil")
}
buf.PutInt(len(b.Previews))
for idx, v := range b.Previews {
if err := v.EncodeBare(buf); err != nil {
return fmt.Errorf("unable to encode bare botMediaPreviewInfo#e49169db: field previews element with index %d: %w", idx, err)
}
}
buf.PutInt(len(b.LanguageCodes))
for _, v := range b.LanguageCodes {
buf.PutString(v)
}
return nil
}
// Decode implements bin.Decoder.
func (b *BotMediaPreviewInfo) Decode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode botMediaPreviewInfo#e49169db to nil")
}
if err := buf.ConsumeID(BotMediaPreviewInfoTypeID); err != nil {
return fmt.Errorf("unable to decode botMediaPreviewInfo#e49169db: %w", err)
}
return b.DecodeBare(buf)
}
// DecodeBare implements bin.BareDecoder.
func (b *BotMediaPreviewInfo) DecodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode botMediaPreviewInfo#e49169db to nil")
}
{
headerLen, err := buf.Int()
if err != nil {
return fmt.Errorf("unable to decode botMediaPreviewInfo#e49169db: field previews: %w", err)
}
if headerLen > 0 {
b.Previews = make([]BotMediaPreview, 0, headerLen%bin.PreallocateLimit)
}
for idx := 0; idx < headerLen; idx++ {
var value BotMediaPreview
if err := value.DecodeBare(buf); err != nil {
return fmt.Errorf("unable to decode bare botMediaPreviewInfo#e49169db: field previews: %w", err)
}
b.Previews = append(b.Previews, value)
}
}
{
headerLen, err := buf.Int()
if err != nil {
return fmt.Errorf("unable to decode botMediaPreviewInfo#e49169db: field language_codes: %w", err)
}
if headerLen > 0 {
b.LanguageCodes = make([]string, 0, headerLen%bin.PreallocateLimit)
}
for idx := 0; idx < headerLen; idx++ {
value, err := buf.String()
if err != nil {
return fmt.Errorf("unable to decode botMediaPreviewInfo#e49169db: field language_codes: %w", err)
}
b.LanguageCodes = append(b.LanguageCodes, value)
}
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (b *BotMediaPreviewInfo) EncodeTDLibJSON(buf tdjson.Encoder) error {
if b == nil {
return fmt.Errorf("can't encode botMediaPreviewInfo#e49169db as nil")
}
buf.ObjStart()
buf.PutID("botMediaPreviewInfo")
buf.Comma()
buf.FieldStart("previews")
buf.ArrStart()
for idx, v := range b.Previews {
if err := v.EncodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to encode botMediaPreviewInfo#e49169db: field previews element with index %d: %w", idx, err)
}
buf.Comma()
}
buf.StripComma()
buf.ArrEnd()
buf.Comma()
buf.FieldStart("language_codes")
buf.ArrStart()
for _, v := range b.LanguageCodes {
buf.PutString(v)
buf.Comma()
}
buf.StripComma()
buf.ArrEnd()
buf.Comma()
buf.StripComma()
buf.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (b *BotMediaPreviewInfo) DecodeTDLibJSON(buf tdjson.Decoder) error {
if b == nil {
return fmt.Errorf("can't decode botMediaPreviewInfo#e49169db to nil")
}
return buf.Obj(func(buf tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := buf.ConsumeID("botMediaPreviewInfo"); err != nil {
return fmt.Errorf("unable to decode botMediaPreviewInfo#e49169db: %w", err)
}
case "previews":
if err := buf.Arr(func(buf tdjson.Decoder) error {
var value BotMediaPreview
if err := value.DecodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to decode botMediaPreviewInfo#e49169db: field previews: %w", err)
}
b.Previews = append(b.Previews, value)
return nil
}); err != nil {
return fmt.Errorf("unable to decode botMediaPreviewInfo#e49169db: field previews: %w", err)
}
case "language_codes":
if err := buf.Arr(func(buf tdjson.Decoder) error {
value, err := buf.String()
if err != nil {
return fmt.Errorf("unable to decode botMediaPreviewInfo#e49169db: field language_codes: %w", err)
}
b.LanguageCodes = append(b.LanguageCodes, value)
return nil
}); err != nil {
return fmt.Errorf("unable to decode botMediaPreviewInfo#e49169db: field language_codes: %w", err)
}
default:
return buf.Skip()
}
return nil
})
}
// GetPreviews returns value of Previews field.
func (b *BotMediaPreviewInfo) GetPreviews() (value []BotMediaPreview) {
if b == nil {
return
}
return b.Previews
}
// GetLanguageCodes returns value of LanguageCodes field.
func (b *BotMediaPreviewInfo) GetLanguageCodes() (value []string) {
if b == nil {
return
}
return b.LanguageCodes
}
-221
View File
@@ -1,221 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// BotMediaPreviews represents TL type `botMediaPreviews#f1b8f27d`.
type BotMediaPreviews struct {
// List of media previews
Previews []BotMediaPreview
}
// BotMediaPreviewsTypeID is TL type id of BotMediaPreviews.
const BotMediaPreviewsTypeID = 0xf1b8f27d
// Ensuring interfaces in compile-time for BotMediaPreviews.
var (
_ bin.Encoder = &BotMediaPreviews{}
_ bin.Decoder = &BotMediaPreviews{}
_ bin.BareEncoder = &BotMediaPreviews{}
_ bin.BareDecoder = &BotMediaPreviews{}
)
func (b *BotMediaPreviews) Zero() bool {
if b == nil {
return true
}
if !(b.Previews == nil) {
return false
}
return true
}
// String implements fmt.Stringer.
func (b *BotMediaPreviews) String() string {
if b == nil {
return "BotMediaPreviews(nil)"
}
type Alias BotMediaPreviews
return fmt.Sprintf("BotMediaPreviews%+v", Alias(*b))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*BotMediaPreviews) TypeID() uint32 {
return BotMediaPreviewsTypeID
}
// TypeName returns name of type in TL schema.
func (*BotMediaPreviews) TypeName() string {
return "botMediaPreviews"
}
// TypeInfo returns info about TL type.
func (b *BotMediaPreviews) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "botMediaPreviews",
ID: BotMediaPreviewsTypeID,
}
if b == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "Previews",
SchemaName: "previews",
},
}
return typ
}
// Encode implements bin.Encoder.
func (b *BotMediaPreviews) Encode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode botMediaPreviews#f1b8f27d as nil")
}
buf.PutID(BotMediaPreviewsTypeID)
return b.EncodeBare(buf)
}
// EncodeBare implements bin.BareEncoder.
func (b *BotMediaPreviews) EncodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode botMediaPreviews#f1b8f27d as nil")
}
buf.PutInt(len(b.Previews))
for idx, v := range b.Previews {
if err := v.EncodeBare(buf); err != nil {
return fmt.Errorf("unable to encode bare botMediaPreviews#f1b8f27d: field previews element with index %d: %w", idx, err)
}
}
return nil
}
// Decode implements bin.Decoder.
func (b *BotMediaPreviews) Decode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode botMediaPreviews#f1b8f27d to nil")
}
if err := buf.ConsumeID(BotMediaPreviewsTypeID); err != nil {
return fmt.Errorf("unable to decode botMediaPreviews#f1b8f27d: %w", err)
}
return b.DecodeBare(buf)
}
// DecodeBare implements bin.BareDecoder.
func (b *BotMediaPreviews) DecodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode botMediaPreviews#f1b8f27d to nil")
}
{
headerLen, err := buf.Int()
if err != nil {
return fmt.Errorf("unable to decode botMediaPreviews#f1b8f27d: field previews: %w", err)
}
if headerLen > 0 {
b.Previews = make([]BotMediaPreview, 0, headerLen%bin.PreallocateLimit)
}
for idx := 0; idx < headerLen; idx++ {
var value BotMediaPreview
if err := value.DecodeBare(buf); err != nil {
return fmt.Errorf("unable to decode bare botMediaPreviews#f1b8f27d: field previews: %w", err)
}
b.Previews = append(b.Previews, value)
}
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (b *BotMediaPreviews) EncodeTDLibJSON(buf tdjson.Encoder) error {
if b == nil {
return fmt.Errorf("can't encode botMediaPreviews#f1b8f27d as nil")
}
buf.ObjStart()
buf.PutID("botMediaPreviews")
buf.Comma()
buf.FieldStart("previews")
buf.ArrStart()
for idx, v := range b.Previews {
if err := v.EncodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to encode botMediaPreviews#f1b8f27d: field previews element with index %d: %w", idx, err)
}
buf.Comma()
}
buf.StripComma()
buf.ArrEnd()
buf.Comma()
buf.StripComma()
buf.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (b *BotMediaPreviews) DecodeTDLibJSON(buf tdjson.Decoder) error {
if b == nil {
return fmt.Errorf("can't decode botMediaPreviews#f1b8f27d to nil")
}
return buf.Obj(func(buf tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := buf.ConsumeID("botMediaPreviews"); err != nil {
return fmt.Errorf("unable to decode botMediaPreviews#f1b8f27d: %w", err)
}
case "previews":
if err := buf.Arr(func(buf tdjson.Decoder) error {
var value BotMediaPreview
if err := value.DecodeTDLibJSON(buf); err != nil {
return fmt.Errorf("unable to decode botMediaPreviews#f1b8f27d: field previews: %w", err)
}
b.Previews = append(b.Previews, value)
return nil
}); err != nil {
return fmt.Errorf("unable to decode botMediaPreviews#f1b8f27d: field previews: %w", err)
}
default:
return buf.Skip()
}
return nil
})
}
// GetPreviews returns value of Previews field.
func (b *BotMediaPreviews) GetPreviews() (value []BotMediaPreview) {
if b == nil {
return
}
return b.Previews
}
-229
View File
@@ -1,229 +0,0 @@
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/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{}
_ = tdjson.Encoder{}
)
// BotMenuButton represents TL type `botMenuButton#c7b57ce6`.
type BotMenuButton struct {
// Text of the button
Text string
// URL of a Web App to open when the button is pressed. If the link is of the type
// internalLinkTypeWebApp, then it must be processed accordingly. Otherwise, the link
// must be passed to openWebApp
URL string
}
// BotMenuButtonTypeID is TL type id of BotMenuButton.
const BotMenuButtonTypeID = 0xc7b57ce6
// Ensuring interfaces in compile-time for BotMenuButton.
var (
_ bin.Encoder = &BotMenuButton{}
_ bin.Decoder = &BotMenuButton{}
_ bin.BareEncoder = &BotMenuButton{}
_ bin.BareDecoder = &BotMenuButton{}
)
func (b *BotMenuButton) Zero() bool {
if b == nil {
return true
}
if !(b.Text == "") {
return false
}
if !(b.URL == "") {
return false
}
return true
}
// String implements fmt.Stringer.
func (b *BotMenuButton) String() string {
if b == nil {
return "BotMenuButton(nil)"
}
type Alias BotMenuButton
return fmt.Sprintf("BotMenuButton%+v", Alias(*b))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*BotMenuButton) TypeID() uint32 {
return BotMenuButtonTypeID
}
// TypeName returns name of type in TL schema.
func (*BotMenuButton) TypeName() string {
return "botMenuButton"
}
// TypeInfo returns info about TL type.
func (b *BotMenuButton) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "botMenuButton",
ID: BotMenuButtonTypeID,
}
if b == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{
{
Name: "Text",
SchemaName: "text",
},
{
Name: "URL",
SchemaName: "url",
},
}
return typ
}
// Encode implements bin.Encoder.
func (b *BotMenuButton) Encode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode botMenuButton#c7b57ce6 as nil")
}
buf.PutID(BotMenuButtonTypeID)
return b.EncodeBare(buf)
}
// EncodeBare implements bin.BareEncoder.
func (b *BotMenuButton) EncodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't encode botMenuButton#c7b57ce6 as nil")
}
buf.PutString(b.Text)
buf.PutString(b.URL)
return nil
}
// Decode implements bin.Decoder.
func (b *BotMenuButton) Decode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode botMenuButton#c7b57ce6 to nil")
}
if err := buf.ConsumeID(BotMenuButtonTypeID); err != nil {
return fmt.Errorf("unable to decode botMenuButton#c7b57ce6: %w", err)
}
return b.DecodeBare(buf)
}
// DecodeBare implements bin.BareDecoder.
func (b *BotMenuButton) DecodeBare(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("can't decode botMenuButton#c7b57ce6 to nil")
}
{
value, err := buf.String()
if err != nil {
return fmt.Errorf("unable to decode botMenuButton#c7b57ce6: field text: %w", err)
}
b.Text = value
}
{
value, err := buf.String()
if err != nil {
return fmt.Errorf("unable to decode botMenuButton#c7b57ce6: field url: %w", err)
}
b.URL = value
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (b *BotMenuButton) EncodeTDLibJSON(buf tdjson.Encoder) error {
if b == nil {
return fmt.Errorf("can't encode botMenuButton#c7b57ce6 as nil")
}
buf.ObjStart()
buf.PutID("botMenuButton")
buf.Comma()
buf.FieldStart("text")
buf.PutString(b.Text)
buf.Comma()
buf.FieldStart("url")
buf.PutString(b.URL)
buf.Comma()
buf.StripComma()
buf.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (b *BotMenuButton) DecodeTDLibJSON(buf tdjson.Decoder) error {
if b == nil {
return fmt.Errorf("can't decode botMenuButton#c7b57ce6 to nil")
}
return buf.Obj(func(buf tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := buf.ConsumeID("botMenuButton"); err != nil {
return fmt.Errorf("unable to decode botMenuButton#c7b57ce6: %w", err)
}
case "text":
value, err := buf.String()
if err != nil {
return fmt.Errorf("unable to decode botMenuButton#c7b57ce6: field text: %w", err)
}
b.Text = value
case "url":
value, err := buf.String()
if err != nil {
return fmt.Errorf("unable to decode botMenuButton#c7b57ce6: field url: %w", err)
}
b.URL = value
default:
return buf.Skip()
}
return nil
})
}
// GetText returns value of Text field.
func (b *BotMenuButton) GetText() (value string) {
if b == nil {
return
}
return b.Text
}
// GetURL returns value of URL field.
func (b *BotMenuButton) GetURL() (value string) {
if b == nil {
return
}
return b.URL
}

Some files were not shown because too many files have changed in this diff Show More