From f86291117f2c6fbb9659f3434226a2d49e659326 Mon Sep 17 00:00:00 2001 From: Wizou <11647984+wiz0u@users.noreply.github.com> Date: Sat, 4 Feb 2023 10:36:19 +0100 Subject: [PATCH] API Layer 152: emoji pfp, autosave medias, auto-translations, media permissions, Firebase... --- EXAMPLES.md | 1 + README.md | 2 +- src/Client.cs | 102 +++++++------- src/TL.Schema.cs | 248 ++++++++++++++++++++++++++++++--- src/TL.SchemaFuncs.cs | 275 +++++++++++++++++++++++++++++++------ src/TL.Table.cs | 34 ++++- src/WTelegramClient.csproj | 2 +- 7 files changed, 547 insertions(+), 117 deletions(-) diff --git a/EXAMPLES.md b/EXAMPLES.md index c871113..ff7700d 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -373,6 +373,7 @@ var chatInvite = await client.Messages_CheckChatInvite("HASH"); // optional: get await client.Messages_ImportChatInvite("HASH"); // join the channel/group // Note: This works also with HASH invite links from public channel/group ``` +Note: `CheckChatInvite` can return [3 different types of invitation object](https://corefork.telegram.org/type/ChatInvite) ## Add/Invite/Remove someone in a chat diff --git a/README.md b/README.md index 4a2b470..edd746b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![API Layer](https://img.shields.io/badge/API_Layer-151-blueviolet)](https://corefork.telegram.org/methods) +[![API Layer](https://img.shields.io/badge/API_Layer-152-blueviolet)](https://corefork.telegram.org/methods) [![NuGet version](https://img.shields.io/nuget/v/WTelegramClient?color=00508F)](https://www.nuget.org/packages/WTelegramClient/) [![Build Status](https://img.shields.io/azure-devops/build/wiz0u/WTelegramClient/7)](https://dev.azure.com/wiz0u/WTelegramClient/_build?definitionId=7) [![Donate](https://img.shields.io/badge/Help_this_project:-Donate-ff4444)](http://t.me/WTelegramBot?start=donate) diff --git a/src/Client.cs b/src/Client.cs index 7918d1f..b0c76b0 100644 --- a/src/Client.cs +++ b/src/Client.cs @@ -1016,29 +1016,31 @@ namespace WTelegram User = null; } phone_number ??= Config("phone_number"); - Auth_SentCode sentCode; + Auth_SentCodeBase sentCodeBase; #pragma warning disable CS0618 // Auth_* methods are marked as obsolete try { - sentCode = await this.Auth_SendCode(phone_number, _session.ApiId, _apiHash ??= Config("api_hash"), settings ??= new()); + sentCodeBase = await this.Auth_SendCode(phone_number, _session.ApiId, _apiHash ??= Config("api_hash"), settings ??= new()); } catch (RpcException ex) when (ex.Code == 500 && ex.Message == "AUTH_RESTART") { - sentCode = await this.Auth_SendCode(phone_number, _session.ApiId, _apiHash, settings); + sentCodeBase = await this.Auth_SendCode(phone_number, _session.ApiId, _apiHash, settings); } Auth_AuthorizationBase authorization = null; + string phone_code_hash = null; try { - if (sentCode.type is Auth_SentCodeTypeSetUpEmailRequired setupEmail) + if (sentCodeBase is Auth_SentCode { type: Auth_SentCodeTypeSetUpEmailRequired setupEmail } setupSentCode) { + phone_code_hash = setupSentCode.phone_code_hash; Helpers.Log(3, "A login email is required"); - RaiseUpdate(sentCode); + RaiseUpdate(sentCodeBase); var email = _config("email"); if (string.IsNullOrEmpty(email)) - sentCode = await this.Auth_ResendCode(phone_number, sentCode.phone_code_hash); + sentCodeBase = await this.Auth_ResendCode(phone_number, phone_code_hash); else { - var purpose = new EmailVerifyPurposeLoginSetup { phone_number = phone_number, phone_code_hash = sentCode.phone_code_hash }; + var purpose = new EmailVerifyPurposeLoginSetup { phone_number = phone_number, phone_code_hash = phone_code_hash }; if (email is not "Google" and not "Apple") { var sentEmail = await this.Account_SendVerifyEmailCode(purpose, email); @@ -1063,55 +1065,61 @@ namespace WTelegram if (retry >= MaxCodePwdAttempts) throw; } if (verified is Account_EmailVerifiedLogin verifiedLogin) // (it should always be) - sentCode = verifiedLogin.sent_code; + sentCodeBase = verifiedLogin.sent_code; } } resent: - var timeout = DateTime.UtcNow + TimeSpan.FromSeconds(sentCode.timeout); - Helpers.Log(3, $"A verification code has been sent via {sentCode.type.GetType().Name[17..]}"); - RaiseUpdate(sentCode); - for (int retry = 1; authorization == null; retry++) - try - { - var verification_code = await ConfigAsync("verification_code"); - if (verification_code == "" && sentCode.next_type != 0) + if (sentCodeBase is Auth_SentCodeSuccess success) + authorization = success.authorization; + else if (sentCodeBase is Auth_SentCode sentCode) + { + phone_code_hash = sentCode.phone_code_hash; + var timeout = DateTime.UtcNow + TimeSpan.FromSeconds(sentCode.timeout); + Helpers.Log(3, $"A verification code has been sent via {sentCode.type.GetType().Name[17..]}"); + RaiseUpdate(sentCode); + for (int retry = 1; authorization == null; retry++) + try { - var mustWait = timeout - DateTime.UtcNow; - if (mustWait.Ticks > 0) + var verification_code = await ConfigAsync("verification_code"); + if (verification_code == "" && sentCode.next_type != 0) { - Helpers.Log(3, $"You must wait {(int)(mustWait.TotalSeconds + 0.5)} more seconds before requesting the code to be sent via {sentCode.next_type}"); - continue; + var mustWait = timeout - DateTime.UtcNow; + if (mustWait.Ticks > 0) + { + Helpers.Log(3, $"You must wait {(int)(mustWait.TotalSeconds + 0.5)} more seconds before requesting the code to be sent via {sentCode.next_type}"); + continue; + } + sentCodeBase = await this.Auth_ResendCode(phone_number, phone_code_hash); + goto resent; } - sentCode = await this.Auth_ResendCode(phone_number, sentCode.phone_code_hash); - goto resent; + authorization = await this.Auth_SignIn(phone_number, phone_code_hash, verification_code); } - authorization = await this.Auth_SignIn(phone_number, sentCode.phone_code_hash, verification_code); - } - catch (RpcException e) when (e.Code == 400 && e.Message == "PHONE_CODE_INVALID") - { - Helpers.Log(4, "Wrong verification code!"); - if (retry >= MaxCodePwdAttempts) throw; - } - catch (RpcException e) when (e.Code == 401 && e.Message == "SESSION_PASSWORD_NEEDED") - { - for (int pwdRetry = 1; authorization == null; pwdRetry++) - try - { - var accountPassword = await this.Account_GetPassword(); - RaiseUpdate(accountPassword); - var checkPasswordSRP = await Check2FA(accountPassword, () => ConfigAsync("password")); - authorization = await this.Auth_CheckPassword(checkPasswordSRP); - } - catch (RpcException pe) when (pe.Code == 400 && pe.Message == "PASSWORD_HASH_INVALID") - { - Helpers.Log(4, "Wrong password!"); - if (pwdRetry >= MaxCodePwdAttempts) throw; - } - } + catch (RpcException e) when (e.Code == 400 && e.Message == "PHONE_CODE_INVALID") + { + Helpers.Log(4, "Wrong verification code!"); + if (retry >= MaxCodePwdAttempts) throw; + } + catch (RpcException e) when (e.Code == 401 && e.Message == "SESSION_PASSWORD_NEEDED") + { + for (int pwdRetry = 1; authorization == null; pwdRetry++) + try + { + var accountPassword = await this.Account_GetPassword(); + RaiseUpdate(accountPassword); + var checkPasswordSRP = await Check2FA(accountPassword, () => ConfigAsync("password")); + authorization = await this.Auth_CheckPassword(checkPasswordSRP); + } + catch (RpcException pe) when (pe.Code == 400 && pe.Message == "PASSWORD_HASH_INVALID") + { + Helpers.Log(4, "Wrong password!"); + if (pwdRetry >= MaxCodePwdAttempts) throw; + } + } + } } catch (Exception ex) when (ex is not RpcException { Message: "FLOOD_WAIT_X" }) { - try { await this.Auth_CancelCode(phone_number, sentCode.phone_code_hash); } catch { } + try { await this.Auth_CancelCode(phone_number, phone_code_hash); } catch { } throw; } if (authorization is Auth_AuthorizationSignUpRequired signUpRequired) @@ -1122,7 +1130,7 @@ namespace WTelegram var last_name = Config("last_name"); var wait = waitUntil - DateTime.UtcNow; if (wait > TimeSpan.Zero) await Task.Delay(wait); // we get a FLOOD_WAIT_3 if we SignUp too fast - authorization = await this.Auth_SignUp(phone_number, sentCode.phone_code_hash, first_name, last_name); + authorization = await this.Auth_SignUp(phone_number, phone_code_hash, first_name, last_name); } #pragma warning restore CS0618 LoginAlreadyDone(authorization); diff --git a/src/TL.Schema.cs b/src/TL.Schema.cs index 92f176b..a62ef21 100644 --- a/src/TL.Schema.cs +++ b/src/TL.Schema.cs @@ -452,7 +452,7 @@ namespace TL /// a value means inputChatPhotoEmpty public abstract class InputChatPhotoBase : IObject { } /// New photo to be set as group profile photo. See - [TLDef(0xC642724E)] + [TLDef(0xBDCDAEC0)] public class InputChatUploadedPhoto : InputChatPhotoBase { /// Flags, see TL conditional fields @@ -463,6 +463,7 @@ namespace TL [IfFlag(1)] public InputFileBase video; /// Timestamp that should be shown as static preview to the user (seconds) [IfFlag(2)] public double video_start_ts; + [IfFlag(3)] public VideoSizeBase video_emoji_markup; [Flags] public enum Flags : uint { @@ -472,6 +473,8 @@ namespace TL has_video = 0x2, /// Field has a value has_video_start_ts = 0x4, + /// Field has a value + has_video_emoji_markup = 0x8, } } /// Existing photo to be set as a chat profile photo. See @@ -1169,6 +1172,7 @@ namespace TL has_requests_pending = 0x20000, /// Field has a value has_available_reactions = 0x40000, + translations_disabled = 0x80000, } /// ID of the chat @@ -1353,6 +1357,7 @@ namespace TL can_delete_channel = 0x1, antispam = 0x2, participants_hidden = 0x4, + translations_disabled = 0x8, } /// ID of the channel @@ -2213,6 +2218,13 @@ namespace TL /// See [TLDef(0xE7E75F97)] public class MessageActionAttachMenuBotAllowed : MessageAction { } + /// See + [TLDef(0xFE77345D)] + public class MessageActionRequestedPeer : MessageAction + { + public int button_id; + public Peer peer; + } /// Chat info. See Derived classes: , public abstract class DialogBase : IObject @@ -2332,7 +2344,7 @@ namespace TL /// Available sizes for download public PhotoSizeBase[] sizes; /// For animated profiles, the MPEG4 videos - [IfFlag(1)] public VideoSize[] video_sizes; + [IfFlag(1)] public VideoSizeBase[] video_sizes; /// DC ID to use for download public int dc_id; @@ -2457,9 +2469,11 @@ namespace TL } } + /// Contains info on a confirmation code message sent via SMS, phone call or Telegram. See Derived classes: + public abstract class Auth_SentCodeBase : IObject { } /// Contains info about a sent verification code. See [TLDef(0x5E002502)] - public class Auth_SentCode : IObject + public class Auth_SentCode : Auth_SentCodeBase { /// Flags, see TL conditional fields public Flags flags; @@ -2480,11 +2494,17 @@ namespace TL has_timeout = 0x4, } } + /// See + [TLDef(0x2390FE44)] + public class Auth_SentCodeSuccess : Auth_SentCodeBase + { + public Auth_AuthorizationBase authorization; + } /// Object contains info on user authorization. See Derived classes: , public abstract class Auth_AuthorizationBase : IObject { } /// Contains user authorization info. See - [TLDef(0x33FB7BB8)] + [TLDef(0x2EA2C0D4)] public class Auth_Authorization : Auth_AuthorizationBase { /// Flags, see TL conditional fields @@ -2493,6 +2513,7 @@ namespace TL [IfFlag(1)] public int otherwise_relogin_days; /// Temporary passport sessions [IfFlag(0)] public int tmp_sessions; + [IfFlag(2)] public byte[] future_auth_token; /// Info on authorized user public UserBase user; @@ -2502,6 +2523,8 @@ namespace TL has_tmp_sessions = 0x1, /// Suggests the user to set up a 2-step verification password to be able to log in again setup_password_required = 0x2, + /// Field has a value + has_future_auth_token = 0x4, } } /// An account with this phone number doesn't exist on telegram: the user has to enter basic information and sign up See @@ -2837,6 +2860,7 @@ namespace TL has_personal_photo = 0x200000, /// Field has a value has_fallback_photo = 0x400000, + translations_disabled = 0x800000, } } @@ -4414,6 +4438,9 @@ namespace TL { public long user_id; } + /// See + [TLDef(0xEC05B097)] + public class UpdateAutoSaveSettings : Update { } /// Updates state. See [TLDef(0xA56C2A3E)] @@ -5377,7 +5404,7 @@ namespace TL /// Thumbnails [IfFlag(0)] public PhotoSizeBase[] thumbs; /// Video thumbnails - [IfFlag(1)] public VideoSize[] video_thumbs; + [IfFlag(1)] public VideoSizeBase[] video_thumbs; /// DC ID public int dc_id; /// Attributes @@ -6574,6 +6601,13 @@ namespace TL public class KeyboardButtonSimpleWebView : KeyboardButtonWebView { } + /// See + [TLDef(0x0D0B468C, inheritBefore = true)] + public class KeyboardButtonRequestPeer : KeyboardButton + { + public int button_id; + public RequestPeerType peer_type; + } /// Inline keyboard row See [TLDef(0x77608B83)] @@ -7863,6 +7897,21 @@ namespace TL { public string url; } + /// See + [TLDef(0xE57B1432)] + public class Auth_SentCodeTypeFirebaseSms : Auth_SentCodeTypeSms + { + public Flags flags; + [IfFlag(0)] public byte[] nonce; + [IfFlag(1)] public string receipt; + [IfFlag(1)] public int push_timeout; + + [Flags] public enum Flags : uint + { + has_nonce = 0x1, + has_receipt = 0x2, + } + } /// Callback answer sent by the bot in response to a button press See [TLDef(0x36585EA4)] @@ -11378,6 +11427,13 @@ namespace TL /// If set, does not allow any user to pin messages in a supergroup/chat pin_messages = 0x20000, manage_topics = 0x40000, + send_photos = 0x80000, + send_videos = 0x100000, + send_roundvideos = 0x200000, + send_audios = 0x400000, + send_voices = 0x800000, + send_docs = 0x1000000, + send_plain = 0x2000000, } } @@ -11419,13 +11475,15 @@ namespace TL } /// Settings used by telegram servers for sending the confirm code. See - [TLDef(0x8A6469C2)] + [TLDef(0xAD253D78)] public class CodeSettings : IObject { /// Flags, see TL conditional fields public Flags flags; /// Previously stored logout tokens, see the documentation for more info » [IfFlag(6)] public byte[][] logout_tokens; + [IfFlag(8)] public string token; + [IfFlag(8)] public bool app_sandbox; [Flags] public enum Flags : uint { @@ -11439,6 +11497,9 @@ namespace TL allow_missed_call = 0x20, /// Field has a value has_logout_tokens = 0x40, + allow_firebase = 0x80, + /// Field has a value + has_token = 0x100, } } @@ -12241,9 +12302,11 @@ namespace TL public IPeerInfo UserOrChat => peer?.UserOrChat(users, chats); } + /// Represents an animated video thumbnail See Derived classes: + public abstract class VideoSizeBase : IObject { } /// Animated profile picture in MPEG4 format See [TLDef(0xDE33B094)] - public class VideoSize : IObject + public class VideoSize : VideoSizeBase { /// Flags, see TL conditional fields public Flags flags; @@ -12264,6 +12327,21 @@ namespace TL has_video_start_ts = 0x1, } } + /// See + [TLDef(0xF85C413C)] + public class VideoSizeEmojiMarkup : VideoSizeBase + { + public long emoji_id; + public int[] background_colors; + } + /// See + [TLDef(0x0DA082FE)] + public class VideoSizeStickerMarkup : VideoSizeBase + { + public InputStickerSet stickerset; + public long sticker_id; + public int[] background_colors; + } /// Information about an active user in a supergroup See [TLDef(0x9D04AF9B)] @@ -13354,19 +13432,6 @@ namespace TL public AvailableReaction[] reactions; } - /// Translated text, or no result See Derived classes: , - public abstract class Messages_TranslatedText : IObject { } - /// No translation is available See - [TLDef(0x67CA4737)] - public class Messages_TranslateNoResult : Messages_TranslatedText { } - /// Translated text See - [TLDef(0xA214F7D0)] - public class Messages_TranslateResultText : Messages_TranslatedText - { - /// Translated text - public string text; - } - /// How a certain peer reacted to the message See [TLDef(0xB156FE9C)] public class MessagePeerReaction : IObject @@ -13685,6 +13750,7 @@ namespace TL { /// Pass true if this is a restore of a Telegram Premium purchase; only for the App Store restore = 0x1, + upgrade = 0x2, } } /// Info about a gifted Telegram Premium purchase See @@ -13867,15 +13933,16 @@ namespace TL public class Account_EmailVerifiedLogin : Account_EmailVerified { /// Info about the sent login code - public Auth_SentCode sent_code; + public Auth_SentCodeBase sent_code; } /// Describes a Telegram Premium subscription option See - [TLDef(0xB6F11EBE)] + [TLDef(0x5F2D1DF2)] public class PremiumSubscriptionOption : IObject { /// Flags, see TL conditional fields public Flags flags; + [IfFlag(3)] public string transaction; /// Duration of subscription in months public int months; /// Three-letter ISO 4217 currency code @@ -13893,6 +13960,8 @@ namespace TL has_store_product = 0x1, current = 0x2, can_purchase_upgrade = 0x4, + /// Field has a value + has_transaction = 0x8, } } @@ -14041,4 +14110,139 @@ namespace TL public string url; public DateTime expires; } + + /// See + public abstract class RequestPeerType : IObject { } + /// See + [TLDef(0x5F3B8A00)] + public class RequestPeerTypeUser : RequestPeerType + { + public Flags flags; + [IfFlag(0)] public bool bot; + [IfFlag(1)] public bool premium; + + [Flags] public enum Flags : uint + { + has_bot = 0x1, + has_premium = 0x2, + } + } + /// See + [TLDef(0xC9F06E1B)] + public class RequestPeerTypeChat : RequestPeerType + { + public Flags flags; + [IfFlag(3)] public bool has_username; + [IfFlag(4)] public bool forum; + [IfFlag(1)] public ChatAdminRights user_admin_rights; + [IfFlag(2)] public ChatAdminRights bot_admin_rights; + + [Flags] public enum Flags : uint + { + creator = 0x1, + has_user_admin_rights = 0x2, + has_bot_admin_rights = 0x4, + has_has_username = 0x8, + has_forum = 0x10, + bot_participant = 0x20, + } + } + /// See + [TLDef(0x339BEF6C)] + public class RequestPeerTypeBroadcast : RequestPeerType + { + public Flags flags; + [IfFlag(3)] public bool has_username; + [IfFlag(1)] public ChatAdminRights user_admin_rights; + [IfFlag(2)] public ChatAdminRights bot_admin_rights; + + [Flags] public enum Flags : uint + { + creator = 0x1, + has_user_admin_rights = 0x2, + has_bot_admin_rights = 0x4, + has_has_username = 0x8, + } + } + + /// See + /// a value means emojiListNotModified + [TLDef(0x7A1E11D1)] + public class EmojiList : IObject + { + public long hash; + public long[] document_id; + } + + /// See + [TLDef(0x7A9ABDA9)] + public class EmojiGroup : IObject + { + public string title; + public long icon_emoji_id; + public string[] emoticons; + } + + /// See + /// a value means messages.emojiGroupsNotModified + [TLDef(0x881FB94B)] + public class Messages_EmojiGroups : IObject + { + public int hash; + public EmojiGroup[] groups; + } + + /// See + [TLDef(0x751F3146)] + public class TextWithEntities : IObject + { + public string text; + public MessageEntity[] entities; + } + + /// Translated text, or no result See Derived classes: , + public abstract class Messages_TranslatedText : IObject { } + /// See + [TLDef(0x33DB32F8)] + public class Messages_TranslateResult : Messages_TranslatedText + { + public TextWithEntities[] result; + } + + /// See + [TLDef(0xC84834CE)] + public class AutoSaveSettings : IObject + { + public Flags flags; + [IfFlag(2)] public long video_max_size; + + [Flags] public enum Flags : uint + { + photos = 0x1, + videos = 0x2, + has_video_max_size = 0x4, + } + } + + /// See + [TLDef(0x81602D47)] + public class AutoSaveException : IObject + { + public Peer peer; + public AutoSaveSettings settings; + } + + /// See + [TLDef(0x4C3E069D)] + public class Account_AutoSaveSettings : IObject, IPeerResolver + { + public AutoSaveSettings users_settings; + public AutoSaveSettings chats_settings; + public AutoSaveSettings broadcasts_settings; + public AutoSaveException[] exceptions; + public Dictionary chats; + public Dictionary users; + /// returns a or for the given Peer + public IPeerInfo UserOrChat(Peer peer) => peer?.UserOrChat(users, chats); + } } diff --git a/src/TL.SchemaFuncs.cs b/src/TL.SchemaFuncs.cs index a940a30..de02856 100644 --- a/src/TL.SchemaFuncs.cs +++ b/src/TL.SchemaFuncs.cs @@ -98,7 +98,7 @@ namespace TL /// Application secret hash (see App configuration) /// Settings for the code type to send [Obsolete("Use LoginUserIfNeeded instead of this method. See https://wiz0u.github.io/WTelegramClient/FAQ#tlsharp")] - public static Task Auth_SendCode(this Client client, string phone_number, int api_id, string api_hash, CodeSettings settings) + public static Task Auth_SendCode(this Client client, string phone_number, int api_id, string api_hash, CodeSettings settings) => client.Invoke(new Auth_SendCode { phone_number = phone_number, @@ -224,7 +224,7 @@ namespace TL /// The phone number /// The phone code hash obtained from Auth_SendCode [Obsolete("Use LoginUserIfNeeded instead of this method. See https://wiz0u.github.io/WTelegramClient/FAQ#tlsharp")] - public static Task Auth_ResendCode(this Client client, string phone_number, string phone_code_hash) + public static Task Auth_ResendCode(this Client client, string phone_number, string phone_code_hash) => client.Invoke(new Auth_ResendCode { phone_number = phone_number, @@ -295,6 +295,17 @@ namespace TL web_auth_token = web_auth_token, }); + /// See + public static Task Auth_RequestFirebaseSms(this Client client, string phone_number, string phone_code_hash, string safety_net_token = null, string ios_push_secret = null) + => client.Invoke(new Auth_RequestFirebaseSms + { + flags = (Auth_RequestFirebaseSms.Flags)((safety_net_token != null ? 0x1 : 0) | (ios_push_secret != null ? 0x2 : 0)), + phone_number = phone_number, + phone_code_hash = phone_code_hash, + safety_net_token = safety_net_token, + ios_push_secret = ios_push_secret, + }); + /// Register device to receive PUSH notifications See Possible codes: 400 (details) /// Avoid receiving (silent and invisible background) notifications. Useful to save battery. /// Device token type, see PUSH updates for the possible values. @@ -453,7 +464,7 @@ namespace TL /// Verify a new phone number to associate to the current account See Possible codes: 400,406 (details) /// New phone number /// Phone code settings - public static Task Account_SendChangePhoneCode(this Client client, string phone_number, CodeSettings settings) + public static Task Account_SendChangePhoneCode(this Client client, string phone_number, CodeSettings settings) => client.Invoke(new Account_SendChangePhoneCode { phone_number = phone_number, @@ -521,7 +532,7 @@ namespace TL /// Send confirmation code to cancel account deletion, for more info click here » See Possible codes: 400 (details) /// The hash from the service notification, for more info click here » /// Phone code settings - public static Task Account_SendConfirmPhoneCode(this Client client, string hash, CodeSettings settings) + public static Task Account_SendConfirmPhoneCode(this Client client, string hash, CodeSettings settings) => client.Invoke(new Account_SendConfirmPhoneCode { hash = hash, @@ -631,7 +642,7 @@ namespace TL /// Send the verification phone code for telegram passport. See Possible codes: 400 (details) /// The phone number to verify /// Phone code settings - public static Task Account_SendVerifyPhoneCode(this Client client, string phone_number, CodeSettings settings) + public static Task Account_SendVerifyPhoneCode(this Client client, string phone_number, CodeSettings settings) => client.Invoke(new Account_SendVerifyPhoneCode { phone_number = phone_number, @@ -1066,6 +1077,43 @@ namespace TL active = active, }); + /// See + /// a null value means emojiListNotModified + public static Task Account_GetDefaultProfilePhotoEmojis(this Client client, long hash = default) + => client.Invoke(new Account_GetDefaultProfilePhotoEmojis + { + hash = hash, + }); + + /// See + /// a null value means emojiListNotModified + public static Task Account_GetDefaultGroupPhotoEmojis(this Client client, long hash = default) + => client.Invoke(new Account_GetDefaultGroupPhotoEmojis + { + hash = hash, + }); + + /// See + public static Task Account_GetAutoSaveSettings(this Client client) + => client.Invoke(new Account_GetAutoSaveSettings + { + }); + + /// See + public static Task Account_SaveAutoSaveSettings(this Client client, AutoSaveSettings settings, InputPeer peer = null, bool users = false, bool chats = false, bool broadcasts = false) + => client.Invoke(new Account_SaveAutoSaveSettings + { + flags = (Account_SaveAutoSaveSettings.Flags)((peer != null ? 0x8 : 0) | (users ? 0x1 : 0) | (chats ? 0x2 : 0) | (broadcasts ? 0x4 : 0)), + peer = peer, + settings = settings, + }); + + /// See + public static Task Account_DeleteAutoSaveExceptions(this Client client) + => client.Invoke(new Account_DeleteAutoSaveExceptions + { + }); + /// Returns basic user info according to their identifiers. See [bots: ✓] Possible codes: 400 (details) /// List of user identifiers public static Task Users_GetUsers(this Client client, params InputUserBase[] id) @@ -1455,7 +1503,7 @@ namespace TL /// The destination where the message will be sent /// The message ID to which this message will reply to /// The message - /// Unique client message ID required to prevent message resending + /// Unique client message ID required to prevent message resending You can use /// Reply markup for sending bot buttons /// Message entities for sending styled text /// Scheduled message date for scheduled messages @@ -1485,7 +1533,7 @@ namespace TL /// Message ID to which this message should reply to /// Attached media /// Caption - /// Random ID to avoid resending the same message + /// Random ID to avoid resending the same message You can use /// Reply markup for bot keyboards /// Message entities for styled text /// Scheduled message date for scheduled messages @@ -1515,7 +1563,7 @@ namespace TL /// Only for bots, disallows further re-forwarding and saving of the messages, even if the destination chat doesn't have content protection enabled /// Source of messages /// IDs of messages - /// Random ID to prevent resending of messages + /// Random ID to prevent resending of messages You can use /// Destination peer /// Scheduled message date for scheduled messages /// Forward the messages as the specified peer @@ -1701,7 +1749,7 @@ namespace TL /// Sends a text message to a secret chat. See Possible codes: 400,403 (details) /// Send encrypted message without a notification /// Secret chat ID - /// Unique client message ID, necessary to avoid message resending + /// Unique client message ID, necessary to avoid message resending You can use /// TL-serialization of type, encrypted with a key that was created during chat initialization public static Task Messages_SendEncrypted(this Client client, InputEncryptedChat peer, long random_id, byte[] data, bool silent = false) => client.Invoke(new Messages_SendEncrypted @@ -1715,7 +1763,7 @@ namespace TL /// Sends a message with a file attachment to a secret chat See Possible codes: 400 (details) /// Whether to send the file without triggering a notification /// Secret chat ID - /// Unique client message ID necessary to prevent message resending + /// Unique client message ID necessary to prevent message resending You can use /// TL-serialization of type, encrypted with a key generated during chat initialization /// File attachment for the secret chat public static Task Messages_SendEncryptedFile(this Client client, InputEncryptedChat peer, long random_id, byte[] data, InputEncryptedFileBase file, bool silent = false) @@ -1730,7 +1778,7 @@ namespace TL /// Sends a service message to a secret chat. See Possible codes: 400,403 (details) /// Secret chat ID - /// Unique client message ID required to prevent message resending + /// Unique client message ID required to prevent message resending You can use /// TL-serialization of type, encrypted with a key generated during chat initialization public static Task Messages_SendEncryptedService(this Client client, InputEncryptedChat peer, long random_id, byte[] data) => client.Invoke(new Messages_SendEncryptedService @@ -1861,7 +1909,7 @@ namespace TL /// Start a conversation with a bot using a deep linking parameter See Possible codes: 400,403,500 (details) /// The bot /// The chat where to start the bot, can be the bot's private chat or a group - /// Random ID to avoid resending the same message + /// Random ID to avoid resending the same message You can use /// Deep linking parameter public static Task Messages_StartBot(this Client client, InputUserBase bot, InputPeer peer, long random_id, string start_param) => client.Invoke(new Messages_StartBot @@ -2014,7 +2062,7 @@ namespace TL /// Whether to hide the via @botname in the resulting message (only for bot usernames encountered in the ) /// Destination /// ID of the message this message should reply to - /// Random ID to avoid resending the same query + /// Random ID to avoid resending the same query You can use /// Query ID from Messages_GetInlineBotResults /// Result ID from Messages_GetInlineBotResults /// Scheduled message date for scheduled messages @@ -2376,7 +2424,7 @@ namespace TL /// Notify the other user in a private chat that a screenshot of the chat was taken See Possible codes: 400 (details) /// Other user /// ID of message that was screenshotted, can be 0 - /// Random ID to avoid message resending + /// Random ID to avoid message resending You can use public static Task Messages_SendScreenshotNotification(this Client client, InputPeer peer, int reply_to_msg_id, long random_id) => client.Invoke(new Messages_SendScreenshotNotification { @@ -3178,18 +3226,15 @@ namespace TL /// Translate a given text See Possible codes: 400 (details) /// If the text is a chat message, the peer ID - /// If the text is a chat message, the message ID /// The text to translate - /// Two-letter ISO 639-1 language code of the language from which the message is translated, if not set will be autodetected /// Two-letter ISO 639-1 language code of the language to which the message is translated - public static Task Messages_TranslateText(this Client client, string to_lang, InputPeer peer = null, int? msg_id = null, string text = null, string from_lang = null) + public static Task Messages_TranslateText(this Client client, string to_lang, InputPeer peer = null, int[] id = null, TextWithEntities[] text = null) => client.Invoke(new Messages_TranslateText { - flags = (Messages_TranslateText.Flags)((peer != null ? 0x1 : 0) | (msg_id != null ? 0x1 : 0) | (text != null ? 0x2 : 0) | (from_lang != null ? 0x4 : 0)), + flags = (Messages_TranslateText.Flags)((peer != null ? 0x1 : 0) | (id != null ? 0x1 : 0) | (text != null ? 0x2 : 0)), peer = peer, - msg_id = msg_id.GetValueOrDefault(), + id = id, text = text, - from_lang = from_lang, to_lang = to_lang, }); @@ -3335,7 +3380,7 @@ namespace TL /// Used by the user to relay data from an opened reply keyboard bot web app to the bot that owns it. See /// Bot that owns the web app - /// Unique client message ID to prevent duplicate sending of the same event + /// Unique client message ID to prevent duplicate sending of the same event You can use /// Text of the that was pressed to open the web app. /// Data to relay to the bot, obtained from a web_app_data_send JS event. public static Task Messages_SendWebViewData(this Client client, InputUserBase bot, long random_id, string button_text, string data) @@ -3457,6 +3502,57 @@ namespace TL { }); + /// See + public static Task Messages_SendBotRequestedPeer(this Client client, InputPeer peer, int msg_id, int button_id, InputPeer requested_peer) + => client.Invoke(new Messages_SendBotRequestedPeer + { + peer = peer, + msg_id = msg_id, + button_id = button_id, + requested_peer = requested_peer, + }); + + /// See + /// a null value means messages.emojiGroupsNotModified + public static Task Messages_GetEmojiGroups(this Client client, int hash = default) + => client.Invoke(new Messages_GetEmojiGroups + { + hash = hash, + }); + + /// See + /// a null value means messages.emojiGroupsNotModified + public static Task Messages_GetEmojiStatusGroups(this Client client, int hash = default) + => client.Invoke(new Messages_GetEmojiStatusGroups + { + hash = hash, + }); + + /// See + /// a null value means messages.emojiGroupsNotModified + public static Task Messages_GetEmojiProfilePhotoGroups(this Client client, int hash = default) + => client.Invoke(new Messages_GetEmojiProfilePhotoGroups + { + hash = hash, + }); + + /// See + /// a null value means emojiListNotModified + public static Task Messages_SearchCustomEmoji(this Client client, string emoticon, long hash = default) + => client.Invoke(new Messages_SearchCustomEmoji + { + emoticon = emoticon, + hash = hash, + }); + + /// See + public static Task Messages_TogglePeerTranslations(this Client client, InputPeer peer, bool disabled = false) + => client.Invoke(new Messages_TogglePeerTranslations + { + flags = (Messages_TogglePeerTranslations.Flags)(disabled ? 0x1 : 0), + peer = peer, + }); + /// Returns a current state of updates. See [bots: ✓] public static Task Updates_GetState(this Client client) => client.Invoke(new Updates_GetState @@ -3507,13 +3603,14 @@ namespace TL /// File saved in parts by means of Upload_SaveFilePart method /// Animated profile picture video /// Floating point UNIX timestamp in seconds, indicating the frame of the video that should be used as static preview. - public static Task Photos_UploadProfilePhoto(this Client client, InputFileBase file = null, InputFileBase video = null, double? video_start_ts = null, bool fallback = false) + public static Task Photos_UploadProfilePhoto(this Client client, InputFileBase file = null, InputFileBase video = null, double? video_start_ts = null, VideoSizeBase video_emoji_markup = null, bool fallback = false) => client.Invoke(new Photos_UploadProfilePhoto { - flags = (Photos_UploadProfilePhoto.Flags)((file != null ? 0x1 : 0) | (video != null ? 0x2 : 0) | (video_start_ts != null ? 0x4 : 0) | (fallback ? 0x8 : 0)), + flags = (Photos_UploadProfilePhoto.Flags)((file != null ? 0x1 : 0) | (video != null ? 0x2 : 0) | (video_start_ts != null ? 0x4 : 0) | (video_emoji_markup != null ? 0x10 : 0) | (fallback ? 0x8 : 0)), file = file, video = video, video_start_ts = video_start_ts.GetValueOrDefault(), + video_emoji_markup = video_emoji_markup, }); /// Deletes profile photos. The method returns a list of successfully deleted photo IDs. See @@ -3539,14 +3636,15 @@ namespace TL }); /// See - public static Task Photos_UploadContactProfilePhoto(this Client client, InputUserBase user_id, InputFileBase file = null, InputFileBase video = null, double? video_start_ts = null, bool suggest = false, bool save = false) + public static Task Photos_UploadContactProfilePhoto(this Client client, InputUserBase user_id, InputFileBase file = null, InputFileBase video = null, double? video_start_ts = null, VideoSizeBase video_emoji_markup = null, bool suggest = false, bool save = false) => client.Invoke(new Photos_UploadContactProfilePhoto { - flags = (Photos_UploadContactProfilePhoto.Flags)((file != null ? 0x1 : 0) | (video != null ? 0x2 : 0) | (video_start_ts != null ? 0x4 : 0) | (suggest ? 0x8 : 0) | (save ? 0x10 : 0)), + flags = (Photos_UploadContactProfilePhoto.Flags)((file != null ? 0x1 : 0) | (video != null ? 0x2 : 0) | (video_start_ts != null ? 0x4 : 0) | (video_emoji_markup != null ? 0x20 : 0) | (suggest ? 0x8 : 0) | (save ? 0x10 : 0)), user_id = user_id, file = file, video = video, video_start_ts = video_start_ts.GetValueOrDefault(), + video_emoji_markup = video_emoji_markup, }); /// Saves a part of file for further sending to one of the methods. See [bots: ✓] Possible codes: 400 (details) @@ -3917,10 +4015,10 @@ namespace TL /// Channel description /// Geogroup location /// Geogroup address - public static Task Channels_CreateChannel(this Client client, string title, string about, InputGeoPoint geo_point = null, string address = null, int? ttl_period = null, bool broadcast = false, bool megagroup = false, bool for_import = false) + public static Task Channels_CreateChannel(this Client client, string title, string about, InputGeoPoint geo_point = null, string address = null, int? ttl_period = null, bool broadcast = false, bool megagroup = false, bool for_import = false, bool forum = false) => client.Invoke(new Channels_CreateChannel { - flags = (Channels_CreateChannel.Flags)((geo_point != null ? 0x4 : 0) | (address != null ? 0x4 : 0) | (ttl_period != null ? 0x10 : 0) | (broadcast ? 0x1 : 0) | (megagroup ? 0x2 : 0) | (for_import ? 0x8 : 0)), + flags = (Channels_CreateChannel.Flags)((geo_point != null ? 0x4 : 0) | (address != null ? 0x4 : 0) | (ttl_period != null ? 0x10 : 0) | (broadcast ? 0x1 : 0) | (megagroup ? 0x2 : 0) | (for_import ? 0x8 : 0) | (forum ? 0x20 : 0)), title = title, about = about, geo_point = geo_point, @@ -5212,7 +5310,7 @@ namespace TL.Methods } [TLDef(0xA677244F)] - public class Auth_SendCode : IMethod + public class Auth_SendCode : IMethod { public string phone_number; public int api_id; @@ -5305,7 +5403,7 @@ namespace TL.Methods } [TLDef(0x3EF1A9BF)] - public class Auth_ResendCode : IMethod + public class Auth_ResendCode : IMethod { public string phone_number; public string phone_code_hash; @@ -5358,6 +5456,22 @@ namespace TL.Methods public string web_auth_token; } + [TLDef(0x89464B50)] + public class Auth_RequestFirebaseSms : IMethod + { + public Flags flags; + public string phone_number; + public string phone_code_hash; + [IfFlag(0)] public string safety_net_token; + [IfFlag(1)] public string ios_push_secret; + + [Flags] public enum Flags : uint + { + has_safety_net_token = 0x1, + has_ios_push_secret = 0x2, + } + } + [TLDef(0xEC86017A)] public class Account_RegisterDevice : IMethod { @@ -5482,7 +5596,7 @@ namespace TL.Methods } [TLDef(0x82574AE5)] - public class Account_SendChangePhoneCode : IMethod + public class Account_SendChangePhoneCode : IMethod { public string phone_number; public CodeSettings settings; @@ -5528,7 +5642,7 @@ namespace TL.Methods } [TLDef(0x1B3FAA88)] - public class Account_SendConfirmPhoneCode : IMethod + public class Account_SendConfirmPhoneCode : IMethod { public string hash; public CodeSettings settings; @@ -5601,7 +5715,7 @@ namespace TL.Methods } [TLDef(0xA5A356F9)] - public class Account_SendVerifyPhoneCode : IMethod + public class Account_SendVerifyPhoneCode : IMethod { public string phone_number; public CodeSettings settings; @@ -5954,6 +6068,40 @@ namespace TL.Methods public bool active; } + [TLDef(0xE2750328)] + public class Account_GetDefaultProfilePhotoEmojis : IMethod + { + public long hash; + } + + [TLDef(0x915860AE)] + public class Account_GetDefaultGroupPhotoEmojis : IMethod + { + public long hash; + } + + [TLDef(0xADCBBCDA)] + public class Account_GetAutoSaveSettings : IMethod { } + + [TLDef(0xD69B8361)] + public class Account_SaveAutoSaveSettings : IMethod + { + public Flags flags; + [IfFlag(3)] public InputPeer peer; + public AutoSaveSettings settings; + + [Flags] public enum Flags : uint + { + users = 0x1, + chats = 0x2, + broadcasts = 0x4, + has_peer = 0x8, + } + } + + [TLDef(0x53BC0020)] + public class Account_DeleteAutoSaveExceptions : IMethod { } + [TLDef(0x0D91A548)] public class Users_GetUsers : IMethod { @@ -7742,21 +7890,19 @@ namespace TL.Methods public Reaction reaction; } - [TLDef(0x24CE6DEE)] + [TLDef(0x63183030)] public class Messages_TranslateText : IMethod { public Flags flags; [IfFlag(0)] public InputPeer peer; - [IfFlag(0)] public int msg_id; - [IfFlag(1)] public string text; - [IfFlag(2)] public string from_lang; + [IfFlag(0)] public int[] id; + [IfFlag(1)] public TextWithEntities[] text; public string to_lang; [Flags] public enum Flags : uint { has_peer = 0x1, has_text = 0x2, - has_from_lang = 0x4, } } @@ -7977,6 +8123,52 @@ namespace TL.Methods [TLDef(0x658B7188)] public class Messages_GetDefaultHistoryTTL : IMethod { } + [TLDef(0xFE38D01B)] + public class Messages_SendBotRequestedPeer : IMethod + { + public InputPeer peer; + public int msg_id; + public int button_id; + public InputPeer requested_peer; + } + + [TLDef(0x7488CE5B)] + public class Messages_GetEmojiGroups : IMethod + { + public int hash; + } + + [TLDef(0x2ECD56CD)] + public class Messages_GetEmojiStatusGroups : IMethod + { + public int hash; + } + + [TLDef(0x21A548F3)] + public class Messages_GetEmojiProfilePhotoGroups : IMethod + { + public int hash; + } + + [TLDef(0x2C11C0D7)] + public class Messages_SearchCustomEmoji : IMethod + { + public string emoticon; + public long hash; + } + + [TLDef(0xE47CB579)] + public class Messages_TogglePeerTranslations : IMethod + { + public Flags flags; + public InputPeer peer; + + [Flags] public enum Flags : uint + { + disabled = 0x1, + } + } + [TLDef(0xEDD4882A)] public class Updates_GetState : IMethod { } @@ -8022,13 +8214,14 @@ namespace TL.Methods } } - [TLDef(0x89F30F69)] + [TLDef(0x093C9A51)] public class Photos_UploadProfilePhoto : IMethod { public Flags flags; [IfFlag(0)] public InputFileBase file; [IfFlag(1)] public InputFileBase video; [IfFlag(2)] public double video_start_ts; + [IfFlag(4)] public VideoSizeBase video_emoji_markup; [Flags] public enum Flags : uint { @@ -8036,6 +8229,7 @@ namespace TL.Methods has_video = 0x2, has_video_start_ts = 0x4, fallback = 0x8, + has_video_emoji_markup = 0x10, } } @@ -8054,7 +8248,7 @@ namespace TL.Methods public int limit; } - [TLDef(0xB91A83BF)] + [TLDef(0xE14C4A71)] public class Photos_UploadContactProfilePhoto : IMethod { public Flags flags; @@ -8062,6 +8256,7 @@ namespace TL.Methods [IfFlag(0)] public InputFileBase file; [IfFlag(1)] public InputFileBase video; [IfFlag(2)] public double video_start_ts; + [IfFlag(5)] public VideoSizeBase video_emoji_markup; [Flags] public enum Flags : uint { @@ -8070,6 +8265,7 @@ namespace TL.Methods has_video_start_ts = 0x4, suggest = 0x8, save = 0x10, + has_video_emoji_markup = 0x20, } } @@ -8330,6 +8526,7 @@ namespace TL.Methods has_geo_point = 0x4, for_import = 0x8, has_ttl_period = 0x10, + forum = 0x20, } } diff --git a/src/TL.Table.cs b/src/TL.Table.cs index cc4740e..f7e6dbe 100644 --- a/src/TL.Table.cs +++ b/src/TL.Table.cs @@ -6,7 +6,7 @@ namespace TL { public static class Layer { - public const int Version = 151; // fetched 29/12/2022 21:30:31 + public const int Version = 152; // fetched 03/02/2023 21:46:20 internal const int SecretChats = 144; internal const int MTProto2 = 73; internal const uint VectorCtor = 0x1CB5C415; @@ -99,7 +99,7 @@ namespace TL [0x0F94E5F1] = typeof(InputMediaPoll), [0xE66FBF7B] = typeof(InputMediaDice), [0x1CA48F57] = null,//InputChatPhotoEmpty - [0xC642724E] = typeof(InputChatUploadedPhoto), + [0xBDCDAEC0] = typeof(InputChatUploadedPhoto), [0x8953AD37] = typeof(InputChatPhoto), [0xE4C123D6] = null,//InputGeoPointEmpty [0x48222FAF] = typeof(InputGeoPoint), @@ -195,6 +195,7 @@ namespace TL [0xC0944820] = typeof(MessageActionTopicEdit), [0x57DE635E] = typeof(MessageActionSuggestProfilePhoto), [0xE7E75F97] = typeof(MessageActionAttachMenuBotAllowed), + [0xFE77345D] = typeof(MessageActionRequestedPeer), [0xD58A08C6] = typeof(Dialog), [0x71BD134C] = typeof(DialogFolder), [0x2331B22D] = typeof(PhotoEmpty), @@ -208,7 +209,8 @@ namespace TL [0x1117DD5F] = null,//GeoPointEmpty [0xB2A2F663] = typeof(GeoPoint), [0x5E002502] = typeof(Auth_SentCode), - [0x33FB7BB8] = typeof(Auth_Authorization), + [0x2390FE44] = typeof(Auth_SentCodeSuccess), + [0x2EA2C0D4] = typeof(Auth_Authorization), [0x44747E9A] = typeof(Auth_AuthorizationSignUpRequired), [0xB434E2B8] = typeof(Auth_ExportedAuthorization), [0xB8BC5B0C] = typeof(InputNotifyPeer), @@ -367,6 +369,7 @@ namespace TL [0x192EFBE3] = typeof(UpdateChannelPinnedTopic), [0xFE198602] = typeof(UpdateChannelPinnedTopics), [0x20529438] = typeof(UpdateUser), + [0xEC05B097] = typeof(UpdateAutoSaveSettings), [0xA56C2A3E] = typeof(Updates_State), [0x5D75A138] = typeof(Updates_DifferenceEmpty), [0x00F49CA0] = typeof(Updates_Difference), @@ -515,6 +518,7 @@ namespace TL [0x308660C1] = typeof(KeyboardButtonUserProfile), [0x13767230] = typeof(KeyboardButtonWebView), [0xA0C0505C] = typeof(KeyboardButtonSimpleWebView), + [0x0D0B468C] = typeof(KeyboardButtonRequestPeer), [0x77608B83] = typeof(KeyboardButtonRow), [0xA03E5B85] = typeof(ReplyKeyboardHide), [0x86B40B08] = typeof(ReplyKeyboardForceReply), @@ -601,6 +605,7 @@ namespace TL [0x5A159841] = typeof(Auth_SentCodeTypeEmailCode), [0xA5491DEA] = typeof(Auth_SentCodeTypeSetUpEmailRequired), [0xD9565C39] = typeof(Auth_SentCodeTypeFragmentSms), + [0xE57B1432] = typeof(Auth_SentCodeTypeFirebaseSms), [0x36585EA4] = typeof(Messages_BotCallbackAnswer), [0x26B5DDE6] = typeof(Messages_MessageEditData), [0x890C3D89] = typeof(InputBotInlineMessageID), @@ -868,7 +873,7 @@ namespace TL [0x967A462E] = typeof(InputWallPaperNoFile), [0x1C199183] = null,//Account_WallPapersNotModified [0xCDC3858C] = typeof(Account_WallPapers), - [0x8A6469C2] = typeof(CodeSettings), + [0xAD253D78] = typeof(CodeSettings), [0x1DC1BCA4] = typeof(WallPaperSettings), [0x8EFAB953] = typeof(AutoDownloadSettings), [0x63CACF26] = typeof(Account_AutoDownloadSettings), @@ -922,6 +927,8 @@ namespace TL [0x98F6AC75] = typeof(Help_PromoDataEmpty), [0x8C39793F] = typeof(Help_PromoData), [0xDE33B094] = typeof(VideoSize), + [0xF85C413C] = typeof(VideoSizeEmojiMarkup), + [0x0DA082FE] = typeof(VideoSizeStickerMarkup), [0x9D04AF9B] = typeof(StatsGroupTopPoster), [0xD7584C87] = typeof(StatsGroupTopAdmin), [0x535F779D] = typeof(StatsGroupTopInviter), @@ -987,8 +994,6 @@ namespace TL [0xC077EC01] = typeof(AvailableReaction), [0x9F071957] = null,//Messages_AvailableReactionsNotModified [0x768E3AAD] = typeof(Messages_AvailableReactions), - [0x67CA4737] = typeof(Messages_TranslateNoResult), - [0xA214F7D0] = typeof(Messages_TranslateResultText), [0xB156FE9C] = typeof(MessagePeerReaction), [0x80EB48AF] = typeof(GroupCallStreamChannel), [0xD0E482B2] = typeof(Phone_GroupCallStreamChannels), @@ -1043,7 +1048,7 @@ namespace TL [0x96D074FD] = typeof(EmailVerificationApple), [0x2B96CD1B] = typeof(Account_EmailVerified), [0xE1BB0D61] = typeof(Account_EmailVerifiedLogin), - [0xB6F11EBE] = typeof(PremiumSubscriptionOption), + [0x5F2D1DF2] = typeof(PremiumSubscriptionOption), [0xB81C7034] = typeof(SendAsPeer), [0xAD628CC8] = typeof(MessageExtendedMediaPreview), [0xEE479C64] = typeof(MessageExtendedMedia), @@ -1054,6 +1059,19 @@ namespace TL [0x367617D3] = typeof(Messages_ForumTopics), [0x43B46B20] = typeof(DefaultHistoryTTL), [0x41BF109B] = typeof(ExportedContactToken), + [0x5F3B8A00] = typeof(RequestPeerTypeUser), + [0xC9F06E1B] = typeof(RequestPeerTypeChat), + [0x339BEF6C] = typeof(RequestPeerTypeBroadcast), + [0x481EADFA] = null,//EmojiListNotModified + [0x7A1E11D1] = typeof(EmojiList), + [0x7A9ABDA9] = typeof(EmojiGroup), + [0x6FB4AD87] = null,//Messages_EmojiGroupsNotModified + [0x881FB94B] = typeof(Messages_EmojiGroups), + [0x751F3146] = typeof(TextWithEntities), + [0x33DB32F8] = typeof(Messages_TranslateResult), + [0xC84834CE] = typeof(AutoSaveSettings), + [0x81602D47] = typeof(AutoSaveException), + [0x4C3E069D] = typeof(Account_AutoSaveSettings), // from TL.Secret: [0x6ABD9782] = typeof(Layer143.DecryptedMessageMediaDocument), [0x91CC4674] = typeof(Layer73.DecryptedMessage), @@ -1170,6 +1188,8 @@ namespace TL [typeof(ChatReactions)] = 0xEAFC32BC, //chatReactionsNone [typeof(Messages_Reactions)] = 0xB06FDBDF, //messages.reactionsNotModified // from TL.Secret: + [typeof(EmojiList)] = 0x481EADFA, //emojiListNotModified + [typeof(Messages_EmojiGroups)] = 0x6FB4AD87, //messages.emojiGroupsNotModified [typeof(DecryptedMessageMedia)] = 0x089F5C4A, //decryptedMessageMediaEmpty }; } diff --git a/src/WTelegramClient.csproj b/src/WTelegramClient.csproj index 6eedad4..f65b2bf 100644 --- a/src/WTelegramClient.csproj +++ b/src/WTelegramClient.csproj @@ -13,7 +13,7 @@ WTelegramClient 0.0.0 Wizou - Telegram Client API (MTProto) library written 100% in C# and .NET Standard | Latest API layer: 151 Release Notes: $(ReleaseNotes.Replace("|", "%0D%0A").Replace(" - ","%0D%0A- ").Replace(" ", "%0D%0A%0D%0A")) + Telegram Client API (MTProto) library written 100% in C# and .NET Standard | Latest API layer: 152 Release Notes: $(ReleaseNotes.Replace("|", "%0D%0A").Replace(" - ","%0D%0A- ").Replace(" ", "%0D%0A%0D%0A")) Copyright © Olivier Marcoux 2021-2023 MIT https://github.com/wiz0u/WTelegramClient