From 30f20fad0e05a770ebb364953492f96260218dc9 Mon Sep 17 00:00:00 2001 From: Wizou Date: Wed, 10 Nov 2021 02:17:08 +0100 Subject: [PATCH] [rollback] Use records for TL methods It was a nice idea and it worked but it made the lib 3x larger just for sugar syntax in generated code --- src/Client.cs | 16 +- src/TL.MTProto.cs | 133 +- src/TL.Schema.cs | 5704 ++++++++++++++++++++++++++++++++++++++------- src/TL.cs | 4 +- 4 files changed, 4964 insertions(+), 893 deletions(-) diff --git a/src/Client.cs b/src/Client.cs index 7123cf7..7563d85 100644 --- a/src/Client.cs +++ b/src/Client.cs @@ -261,11 +261,17 @@ namespace WTelegram var keepAliveTask = KeepAlive(_cts.Token); TLConfig = await this.InvokeWithLayer(Layer.Version, - new Schema.InitConnection_(0, _apiId, - Config("device_model"), Config("system_version"), Config("app_version"), - Config("system_lang_code"), Config("lang_pack"), Config("lang_code"), - null, null, new Schema.Help_GetConfig_() - )); + new Schema.InitConnection_ + { + api_id = _apiId, + device_model = Config("device_model"), + system_version = Config("system_version"), + app_version = Config("app_version"), + system_lang_code = Config("system_lang_code"), + lang_pack = Config("lang_pack"), + lang_code = Config("lang_code"), + query = new Schema.Help_GetConfig_() + }); _session.DcOptions = TLConfig.dc_options; _saltChangeCounter = 0; if (_dcSession.DataCenter == null) diff --git a/src/TL.MTProto.cs b/src/TL.MTProto.cs index 1518232..d76bc16 100644 --- a/src/TL.MTProto.cs +++ b/src/TL.MTProto.cs @@ -294,58 +294,129 @@ namespace TL } // ---functions--- - #pragma warning disable IDE1006 public static class MTProto { - [TLDef(0x60469778)] - public record ReqPq_(Int128 nonce) : IMethod; + [TLDef(0x60469778)] //req_pq#60469778 nonce:int128 = ResPQ + public partial class ReqPq_ : IMethod + { + public Int128 nonce; + } public static Task ReqPq(this Client client, Int128 nonce) - => client.CallBareAsync(new ReqPq_(nonce)); + => client.CallBareAsync(new ReqPq_ + { + nonce = nonce, + }); - [TLDef(0xBE7E8EF1)] - public record ReqPqMulti_(Int128 nonce) : IMethod; + [TLDef(0xBE7E8EF1)] //req_pq_multi#be7e8ef1 nonce:int128 = ResPQ + public partial class ReqPqMulti_ : IMethod + { + public Int128 nonce; + } public static Task ReqPqMulti(this Client client, Int128 nonce) - => client.CallBareAsync(new ReqPqMulti_(nonce)); + => client.CallBareAsync(new ReqPqMulti_ + { + nonce = nonce, + }); - [TLDef(0xD712E4BE)] - public record ReqDHParams_(Int128 nonce, Int128 server_nonce, byte[] p, byte[] q, long public_key_fingerprint, byte[] encrypted_data) : IMethod; + [TLDef(0xD712E4BE)] //req_DH_params#d712e4be nonce:int128 server_nonce:int128 p:bytes q:bytes public_key_fingerprint:long encrypted_data:bytes = Server_DH_Params + public partial class ReqDHParams_ : IMethod + { + public Int128 nonce; + public Int128 server_nonce; + public byte[] p; + public byte[] q; + public long public_key_fingerprint; + public byte[] encrypted_data; + } public static Task ReqDHParams(this Client client, Int128 nonce, Int128 server_nonce, byte[] p, byte[] q, long public_key_fingerprint, byte[] encrypted_data) - => client.CallBareAsync(new ReqDHParams_(nonce, server_nonce, p, q, public_key_fingerprint, encrypted_data)); + => client.CallBareAsync(new ReqDHParams_ + { + nonce = nonce, + server_nonce = server_nonce, + p = p, + q = q, + public_key_fingerprint = public_key_fingerprint, + encrypted_data = encrypted_data, + }); - [TLDef(0xF5045F1F)] - public record SetClientDHParams_(Int128 nonce, Int128 server_nonce, byte[] encrypted_data) : IMethod; + [TLDef(0xF5045F1F)] //set_client_DH_params#f5045f1f nonce:int128 server_nonce:int128 encrypted_data:bytes = Set_client_DH_params_answer + public partial class SetClientDHParams_ : IMethod + { + public Int128 nonce; + public Int128 server_nonce; + public byte[] encrypted_data; + } public static Task SetClientDHParams(this Client client, Int128 nonce, Int128 server_nonce, byte[] encrypted_data) - => client.CallBareAsync(new SetClientDHParams_(nonce, server_nonce, encrypted_data)); + => client.CallBareAsync(new SetClientDHParams_ + { + nonce = nonce, + server_nonce = server_nonce, + encrypted_data = encrypted_data, + }); - [TLDef(0xD1435160)] - public record DestroyAuthKey_() : IMethod; + [TLDef(0xD1435160)] //destroy_auth_key#d1435160 = DestroyAuthKeyRes + public partial class DestroyAuthKey_ : IMethod { } public static Task DestroyAuthKey(this Client client) - => client.CallBareAsync(new DestroyAuthKey_()); + => client.CallBareAsync(new DestroyAuthKey_ + { + }); - [TLDef(0x58E4A740)] - public record RpcDropAnswer_(long req_msg_id) : IMethod; + [TLDef(0x58E4A740)] //rpc_drop_answer#58e4a740 req_msg_id:long = RpcDropAnswer + public partial class RpcDropAnswer_ : IMethod + { + public long req_msg_id; + } public static Task RpcDropAnswer(this Client client, long req_msg_id) - => client.CallBareAsync(new RpcDropAnswer_(req_msg_id)); + => client.CallBareAsync(new RpcDropAnswer_ + { + req_msg_id = req_msg_id, + }); - [TLDef(0xB921BD04)] - public record GetFutureSalts_(int num) : IMethod; + [TLDef(0xB921BD04)] //get_future_salts#b921bd04 num:int = FutureSalts + public partial class GetFutureSalts_ : IMethod + { + public int num; + } public static Task GetFutureSalts(this Client client, int num) - => client.CallAsync(new GetFutureSalts_(num)); + => client.CallAsync(new GetFutureSalts_ + { + num = num, + }); - [TLDef(0x7ABE77EC)] - public record Ping_(long ping_id) : IMethod; + [TLDef(0x7ABE77EC)] //ping#7abe77ec ping_id:long = Pong + public partial class Ping_ : IMethod + { + public long ping_id; + } public static Task Ping(this Client client, long ping_id) - => client.CallAsync(new Ping_(ping_id)); + => client.CallAsync(new Ping_ + { + ping_id = ping_id, + }); - [TLDef(0xF3427B8C)] - public record PingDelayDisconnect_(long ping_id, int disconnect_delay) : IMethod; + [TLDef(0xF3427B8C)] //ping_delay_disconnect#f3427b8c ping_id:long disconnect_delay:int = Pong + public partial class PingDelayDisconnect_ : IMethod + { + public long ping_id; + public int disconnect_delay; + } public static Task PingDelayDisconnect(this Client client, long ping_id, int disconnect_delay) - => client.CallAsync(new PingDelayDisconnect_(ping_id, disconnect_delay)); + => client.CallAsync(new PingDelayDisconnect_ + { + ping_id = ping_id, + disconnect_delay = disconnect_delay, + }); - [TLDef(0xE7512126)] - public record DestroySession_(long session_id) : IMethod; + [TLDef(0xE7512126)] //destroy_session#e7512126 session_id:long = DestroySessionRes + public partial class DestroySession_ : IMethod + { + public long session_id; + } public static Task DestroySession(this Client client, long session_id) - => client.CallBareAsync(new DestroySession_(session_id)); + => client.CallBareAsync(new DestroySession_ + { + session_id = session_id, + }); } } diff --git a/src/TL.Schema.cs b/src/TL.Schema.cs index f28b387..730fd88 100644 --- a/src/TL.Schema.cs +++ b/src/TL.Schema.cs @@ -12233,28 +12233,64 @@ namespace TL } // ---functions--- - #pragma warning disable IDE1006 public static class Schema { [TLDef(0xCB9F372D)] - public record InvokeAfterMsg_(long msg_id, IMethod query) : IMethod; + public partial class InvokeAfterMsg_ : IMethod + { + public long msg_id; + public IMethod query; + } /// Invokes a query after successfull completion of one of the previous queries. See /// Message identifier on which a current query depends /// The query itself public static Task InvokeAfterMsg(this Client client, long msg_id, IMethod query) - => client.CallAsync(new InvokeAfterMsg_(msg_id, query)); + => client.CallAsync(new InvokeAfterMsg_ + { + msg_id = msg_id, + query = query, + }); [TLDef(0x3DC4B4F0)] - public record InvokeAfterMsgs_(long[] msg_ids, IMethod query) : IMethod; + public partial class InvokeAfterMsgs_ : IMethod + { + public long[] msg_ids; + public IMethod query; + } /// Invokes a query after a successfull completion of previous queries See /// List of messages on which a current query depends /// The query itself public static Task InvokeAfterMsgs(this Client client, long[] msg_ids, IMethod query) - => client.CallAsync(new InvokeAfterMsgs_(msg_ids, query)); + => client.CallAsync(new InvokeAfterMsgs_ + { + msg_ids = msg_ids, + query = query, + }); [TLDef(0xC1CD5EA9)] - public record InitConnection_(int flags, int api_id, string device_model, string system_version, string app_version, string system_lang_code, string lang_pack, string lang_code, [field:IfFlag(0)] InputClientProxy proxy, [field:IfFlag(1)] JSONValue params_, IMethod query) : IMethod; + public partial class InitConnection_ : IMethod + { + public Flags flags; + public int api_id; + public string device_model; + public string system_version; + public string app_version; + public string system_lang_code; + public string lang_pack; + public string lang_code; + [IfFlag(0)] public InputClientProxy proxy; + [IfFlag(1)] public JSONValue params_; + public IMethod query; + + [Flags] public enum Flags + { + /// Field has a value + has_proxy = 0x1, + /// Field has a value + has_params = 0x2, + } + } /// Initialize connection See Possible codes: 400 (details) /// Application identifier (see. App configuration) /// Device model @@ -12267,192 +12303,396 @@ namespace TL /// Additional initConnection parameters.
For now, only the tz_offset field is supported, for specifying timezone offset in seconds. /// The query itself public static Task InitConnection(this Client client, int api_id, string device_model, string system_version, string app_version, string system_lang_code, string lang_pack, string lang_code, IMethod query, InputClientProxy proxy = null, JSONValue params_ = null) - => client.CallAsync(new InitConnection_((proxy != null ? 0x1 : 0) | (params_ != null ? 0x2 : 0), - api_id, device_model, system_version, app_version, system_lang_code, lang_pack, lang_code, proxy, params_, query)); + => client.CallAsync(new InitConnection_ + { + flags = (InitConnection_.Flags)((proxy != null ? 0x1 : 0) | (params_ != null ? 0x2 : 0)), + api_id = api_id, + device_model = device_model, + system_version = system_version, + app_version = app_version, + system_lang_code = system_lang_code, + lang_pack = lang_pack, + lang_code = lang_code, + proxy = proxy, + params_ = params_, + query = query, + }); [TLDef(0xDA9B0D0D)] - public record InvokeWithLayer_(int layer, IMethod query) : IMethod; + public partial class InvokeWithLayer_ : IMethod + { + public int layer; + public IMethod query; + } /// Invoke the specified query using the specified API layer See Possible codes: 400,403 (details) /// The layer to use /// The query public static Task InvokeWithLayer(this Client client, int layer, IMethod query) - => client.CallAsync(new InvokeWithLayer_(layer, query)); + => client.CallAsync(new InvokeWithLayer_ + { + layer = layer, + query = query, + }); [TLDef(0xBF9459B7)] - public record InvokeWithoutUpdates_(IMethod query) : IMethod; + public partial class InvokeWithoutUpdates_ : IMethod + { + public IMethod query; + } /// Invoke a request without subscribing the used connection for updates (this is enabled by default for file queries). See /// The query public static Task InvokeWithoutUpdates(this Client client, IMethod query) - => client.CallAsync(new InvokeWithoutUpdates_(query)); + => client.CallAsync(new InvokeWithoutUpdates_ + { + query = query, + }); [TLDef(0x365275F2)] - public record InvokeWithMessagesRange_(MessageRange range, IMethod query) : IMethod; + public partial class InvokeWithMessagesRange_ : IMethod + { + public MessageRange range; + public IMethod query; + } /// Invoke with the given message range See /// Message range /// Query public static Task InvokeWithMessagesRange(this Client client, MessageRange range, IMethod query) - => client.CallAsync(new InvokeWithMessagesRange_(range, query)); + => client.CallAsync(new InvokeWithMessagesRange_ + { + range = range, + query = query, + }); [TLDef(0xACA9FD2E)] - public record InvokeWithTakeout_(long takeout_id, IMethod query) : IMethod; + public partial class InvokeWithTakeout_ : IMethod + { + public long takeout_id; + public IMethod query; + } /// Invoke a method within a takeout session See /// Takeout session ID /// Query public static Task InvokeWithTakeout(this Client client, long takeout_id, IMethod query) - => client.CallAsync(new InvokeWithTakeout_(takeout_id, query)); + => client.CallAsync(new InvokeWithTakeout_ + { + takeout_id = takeout_id, + query = query, + }); [TLDef(0xA677244F)] - public record Auth_SendCode_(string phone_number, int api_id, string api_hash, CodeSettings settings) : IMethod; + public partial class Auth_SendCode_ : IMethod + { + public string phone_number; + public int api_id; + public string api_hash; + public CodeSettings settings; + } /// Send the verification code for login See Possible codes: 303,400,401,406 (details) /// Phone number in international format /// Application identifier (see App configuration) /// Application secret hash (see App configuration) /// Settings for the code type to send public static Task Auth_SendCode(this Client client, string phone_number, int api_id, string api_hash, CodeSettings settings) - => client.CallAsync(new Auth_SendCode_(phone_number, api_id, api_hash, settings)); + => client.CallAsync(new Auth_SendCode_ + { + phone_number = phone_number, + api_id = api_id, + api_hash = api_hash, + settings = settings, + }); [TLDef(0x80EEE427)] - public record Auth_SignUp_(string phone_number, string phone_code_hash, string first_name, string last_name) : IMethod; + public partial class Auth_SignUp_ : IMethod + { + public string phone_number; + public string phone_code_hash; + public string first_name; + public string last_name; + } /// Registers a validated phone number in the system. See Possible codes: 400 (details) /// Phone number in the international format /// SMS-message ID /// New user first name /// New user last name public static Task Auth_SignUp(this Client client, string phone_number, string phone_code_hash, string first_name, string last_name) - => client.CallAsync(new Auth_SignUp_(phone_number, phone_code_hash, first_name, last_name)); + => client.CallAsync(new Auth_SignUp_ + { + phone_number = phone_number, + phone_code_hash = phone_code_hash, + first_name = first_name, + last_name = last_name, + }); [TLDef(0xBCD51581)] - public record Auth_SignIn_(string phone_number, string phone_code_hash, string phone_code) : IMethod; + public partial class Auth_SignIn_ : IMethod + { + public string phone_number; + public string phone_code_hash; + public string phone_code; + } /// Signs in a user with a validated phone number. See Possible codes: 400 (details) /// Phone number in the international format /// SMS-message ID, obtained from auth.sendCode /// Valid numerical code from the SMS-message public static Task Auth_SignIn(this Client client, string phone_number, string phone_code_hash, string phone_code) - => client.CallAsync(new Auth_SignIn_(phone_number, phone_code_hash, phone_code)); + => client.CallAsync(new Auth_SignIn_ + { + phone_number = phone_number, + phone_code_hash = phone_code_hash, + phone_code = phone_code, + }); [TLDef(0x5717DA40)] - public record Auth_LogOut_() : IMethod; + public partial class Auth_LogOut_ : IMethod { } /// Logs out the user. See [bots: ✓] public static Task Auth_LogOut(this Client client) - => client.CallAsync(new Auth_LogOut_()); + => client.CallAsync(new Auth_LogOut_ + { + }); [TLDef(0x9FAB0D1A)] - public record Auth_ResetAuthorizations_() : IMethod; + public partial class Auth_ResetAuthorizations_ : IMethod { } /// Terminates all user's authorized sessions except for the current one. See Possible codes: 406 (details) public static Task Auth_ResetAuthorizations(this Client client) - => client.CallAsync(new Auth_ResetAuthorizations_()); + => client.CallAsync(new Auth_ResetAuthorizations_ + { + }); [TLDef(0xE5BFFFCD)] - public record Auth_ExportAuthorization_(int dc_id) : IMethod; + public partial class Auth_ExportAuthorization_ : IMethod + { + public int dc_id; + } /// Returns data for copying authorization to another data-centre. See [bots: ✓] Possible codes: 400 (details) /// Number of a target data-centre public static Task Auth_ExportAuthorization(this Client client, int dc_id) - => client.CallAsync(new Auth_ExportAuthorization_(dc_id)); + => client.CallAsync(new Auth_ExportAuthorization_ + { + dc_id = dc_id, + }); [TLDef(0xA57A7DAD)] - public record Auth_ImportAuthorization_(long id, byte[] bytes) : IMethod; + public partial class Auth_ImportAuthorization_ : IMethod + { + public long id; + public byte[] bytes; + } /// Logs in a user using a key transmitted from his native data-centre. See [bots: ✓] Possible codes: 400 (details) /// User ID /// Authorization key public static Task Auth_ImportAuthorization(this Client client, long id, byte[] bytes) - => client.CallAsync(new Auth_ImportAuthorization_(id, bytes)); + => client.CallAsync(new Auth_ImportAuthorization_ + { + id = id, + bytes = bytes, + }); [TLDef(0xCDD42A05)] - public record Auth_BindTempAuthKey_(long perm_auth_key_id, long nonce, DateTime expires_at, byte[] encrypted_message) : IMethod; + public partial class Auth_BindTempAuthKey_ : IMethod + { + public long perm_auth_key_id; + public long nonce; + public DateTime expires_at; + public byte[] encrypted_message; + } /// Binds a temporary authorization key temp_auth_key_id to the permanent authorization key perm_auth_key_id. Each permanent key may only be bound to one temporary key at a time, binding a new temporary key overwrites the previous one. See [bots: ✓] Possible codes: 400 (details) /// Permanent auth_key_id to bind to /// Random long from Binding message contents /// Unix timestamp to invalidate temporary key, see Binding message contents /// See Generating encrypted_message public static Task Auth_BindTempAuthKey(this Client client, long perm_auth_key_id, long nonce, DateTime expires_at, byte[] encrypted_message) - => client.CallAsync(new Auth_BindTempAuthKey_(perm_auth_key_id, nonce, expires_at, encrypted_message)); + => client.CallAsync(new Auth_BindTempAuthKey_ + { + perm_auth_key_id = perm_auth_key_id, + nonce = nonce, + expires_at = expires_at, + encrypted_message = encrypted_message, + }); [TLDef(0x67A3FF2C)] - public record Auth_ImportBotAuthorization_(int flags, int api_id, string api_hash, string bot_auth_token) : IMethod; + public partial class Auth_ImportBotAuthorization_ : IMethod + { + public int flags; + public int api_id; + public string api_hash; + public string bot_auth_token; + } /// Login as a bot See [bots: ✓] Possible codes: 400,401 (details) /// Application identifier (see. App configuration) /// Application identifier hash (see. App configuration) /// Bot token (see bots) public static Task Auth_ImportBotAuthorization(this Client client, int flags, int api_id, string api_hash, string bot_auth_token) - => client.CallAsync(new Auth_ImportBotAuthorization_(flags, api_id, api_hash, bot_auth_token)); + => client.CallAsync(new Auth_ImportBotAuthorization_ + { + flags = flags, + api_id = api_id, + api_hash = api_hash, + bot_auth_token = bot_auth_token, + }); [TLDef(0xD18B4D16)] - public record Auth_CheckPassword_(InputCheckPasswordSRP password) : IMethod; + public partial class Auth_CheckPassword_ : IMethod + { + public InputCheckPasswordSRP password; + } /// Try logging to an account protected by a 2FA password. See Possible codes: 400 (details) /// The account's password (see SRP) public static Task Auth_CheckPassword(this Client client, InputCheckPasswordSRP password) - => client.CallAsync(new Auth_CheckPassword_(password)); + => client.CallAsync(new Auth_CheckPassword_ + { + password = password, + }); [TLDef(0xD897BC66)] - public record Auth_RequestPasswordRecovery_() : IMethod; + public partial class Auth_RequestPasswordRecovery_ : IMethod { } /// Request recovery code of a 2FA password, only for accounts with a recovery email configured. See Possible codes: 400 (details) public static Task Auth_RequestPasswordRecovery(this Client client) - => client.CallAsync(new Auth_RequestPasswordRecovery_()); + => client.CallAsync(new Auth_RequestPasswordRecovery_ + { + }); [TLDef(0x37096C70)] - public record Auth_RecoverPassword_(int flags, string code, [field:IfFlag(0)] Account_PasswordInputSettings new_settings) : IMethod; + public partial class Auth_RecoverPassword_ : IMethod + { + public Flags flags; + public string code; + [IfFlag(0)] public Account_PasswordInputSettings new_settings; + + [Flags] public enum Flags + { + /// Field has a value + has_new_settings = 0x1, + } + } /// Reset the 2FA password using the recovery code sent using auth.requestPasswordRecovery. See Possible codes: 400 (details) /// Code received via email /// New password public static Task Auth_RecoverPassword(this Client client, string code, Account_PasswordInputSettings new_settings = null) - => client.CallAsync(new Auth_RecoverPassword_(new_settings != null ? 0x1 : 0, - code, new_settings)); + => client.CallAsync(new Auth_RecoverPassword_ + { + flags = (Auth_RecoverPassword_.Flags)(new_settings != null ? 0x1 : 0), + code = code, + new_settings = new_settings, + }); [TLDef(0x3EF1A9BF)] - public record Auth_ResendCode_(string phone_number, string phone_code_hash) : IMethod; + public partial class Auth_ResendCode_ : IMethod + { + public string phone_number; + public string phone_code_hash; + } /// Resend the login code via another medium, the phone code type is determined by the return value of the previous auth.sendCode/auth.resendCode: see login for more info. See Possible codes: 400,406 (details) /// The phone number /// The phone code hash obtained from auth.sendCode public static Task Auth_ResendCode(this Client client, string phone_number, string phone_code_hash) - => client.CallAsync(new Auth_ResendCode_(phone_number, phone_code_hash)); + => client.CallAsync(new Auth_ResendCode_ + { + phone_number = phone_number, + phone_code_hash = phone_code_hash, + }); [TLDef(0x1F040578)] - public record Auth_CancelCode_(string phone_number, string phone_code_hash) : IMethod; + public partial class Auth_CancelCode_ : IMethod + { + public string phone_number; + public string phone_code_hash; + } /// Cancel the login verification code See Possible codes: 400 (details) /// Phone number /// Phone code hash from auth.sendCode public static Task Auth_CancelCode(this Client client, string phone_number, string phone_code_hash) - => client.CallAsync(new Auth_CancelCode_(phone_number, phone_code_hash)); + => client.CallAsync(new Auth_CancelCode_ + { + phone_number = phone_number, + phone_code_hash = phone_code_hash, + }); [TLDef(0x8E48A188)] - public record Auth_DropTempAuthKeys_(long[] except_auth_keys) : IMethod; + public partial class Auth_DropTempAuthKeys_ : IMethod + { + public long[] except_auth_keys; + } /// Delete all temporary authorization keys except for the ones specified See [bots: ✓] /// The auth keys that shouldn't be dropped. public static Task Auth_DropTempAuthKeys(this Client client, long[] except_auth_keys) - => client.CallAsync(new Auth_DropTempAuthKeys_(except_auth_keys)); + => client.CallAsync(new Auth_DropTempAuthKeys_ + { + except_auth_keys = except_auth_keys, + }); [TLDef(0xB7E085FE)] - public record Auth_ExportLoginToken_(int api_id, string api_hash, long[] except_ids) : IMethod; + public partial class Auth_ExportLoginToken_ : IMethod + { + public int api_id; + public string api_hash; + public long[] except_ids; + } /// Generate a login token, for login via QR code.
The generated login token should be encoded using base64url, then shown as a tg://login?token=base64encodedtoken URL in the QR code. See Possible codes: 400 (details)
/// Application identifier (see. App configuration) /// Application identifier hash (see. App configuration) /// List of already logged-in user IDs, to prevent logging in twice with the same user public static Task Auth_ExportLoginToken(this Client client, int api_id, string api_hash, long[] except_ids) - => client.CallAsync(new Auth_ExportLoginToken_(api_id, api_hash, except_ids)); + => client.CallAsync(new Auth_ExportLoginToken_ + { + api_id = api_id, + api_hash = api_hash, + except_ids = except_ids, + }); [TLDef(0x95AC5CE4)] - public record Auth_ImportLoginToken_(byte[] token) : IMethod; + public partial class Auth_ImportLoginToken_ : IMethod + { + public byte[] token; + } /// Login using a redirected login token, generated in case of DC mismatch during QR code login. See Possible codes: 400 (details) /// Login token public static Task Auth_ImportLoginToken(this Client client, byte[] token) - => client.CallAsync(new Auth_ImportLoginToken_(token)); + => client.CallAsync(new Auth_ImportLoginToken_ + { + token = token, + }); [TLDef(0xE894AD4D)] - public record Auth_AcceptLoginToken_(byte[] token) : IMethod; + public partial class Auth_AcceptLoginToken_ : IMethod + { + public byte[] token; + } /// Accept QR code login token, logging in the app that generated it. See Possible codes: 400 (details) /// Login token embedded in QR code, for more info, see login via QR code. public static Task Auth_AcceptLoginToken(this Client client, byte[] token) - => client.CallAsync(new Auth_AcceptLoginToken_(token)); + => client.CallAsync(new Auth_AcceptLoginToken_ + { + token = token, + }); [TLDef(0x0D36BF79)] - public record Auth_CheckRecoveryPassword_(string code) : IMethod; + public partial class Auth_CheckRecoveryPassword_ : IMethod + { + public string code; + } /// Check if the 2FA recovery code sent using auth.requestPasswordRecovery is valid, before passing it to auth.recoverPassword. See Possible codes: 400 (details) /// Code received via email public static Task Auth_CheckRecoveryPassword(this Client client, string code) - => client.CallAsync(new Auth_CheckRecoveryPassword_(code)); + => client.CallAsync(new Auth_CheckRecoveryPassword_ + { + code = code, + }); [TLDef(0xEC86017A)] - public record Account_RegisterDevice_(int flags, int token_type, string token, bool app_sandbox, byte[] secret, long[] other_uids) : IMethod; + public partial class Account_RegisterDevice_ : IMethod + { + public Flags flags; + public int token_type; + public string token; + public bool app_sandbox; + public byte[] secret; + public long[] other_uids; + + [Flags] public enum Flags + { + no_muted = 0x1, + } + } /// 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.
Possible values:
1 - APNS (device token for apple push)
2 - FCM (firebase token for google firebase)
3 - MPNS (channel URI for microsoft push)
4 - Simple push (endpoint for firefox's simple push API)
5 - Ubuntu phone (token for ubuntu push)
6 - Blackberry (token for blackberry push)
7 - Unused
8 - WNS (windows push)
9 - APNS VoIP (token for apple push VoIP)
10 - Web push (web push, see below)
11 - MPNS VoIP (token for microsoft push VoIP)
12 - Tizen (token for tizen push)

For 10 web push, the token must be a JSON-encoded object containing the keys described in PUSH updates @@ -12461,261 +12701,499 @@ namespace TL /// For FCM and APNS VoIP, optional encryption key used to encrypt push notifications /// List of user identifiers of other users currently using the client public static Task Account_RegisterDevice(this Client client, int token_type, string token, bool app_sandbox, byte[] secret, long[] other_uids, bool no_muted = false) - => client.CallAsync(new Account_RegisterDevice_(no_muted ? 0x1 : 0, token_type, token, app_sandbox, secret, other_uids)); + => client.CallAsync(new Account_RegisterDevice_ + { + flags = (Account_RegisterDevice_.Flags)(no_muted ? 0x1 : 0), + token_type = token_type, + token = token, + app_sandbox = app_sandbox, + secret = secret, + other_uids = other_uids, + }); [TLDef(0x6A0D3206)] - public record Account_UnregisterDevice_(int token_type, string token, long[] other_uids) : IMethod; + public partial class Account_UnregisterDevice_ : IMethod + { + public int token_type; + public string token; + public long[] other_uids; + } /// Deletes a device by its token, stops sending PUSH-notifications to it. See Possible codes: 400 (details) /// Device token type.
Possible values:
1 - APNS (device token for apple push)
2 - FCM (firebase token for google firebase)
3 - MPNS (channel URI for microsoft push)
4 - Simple push (endpoint for firefox's simple push API)
5 - Ubuntu phone (token for ubuntu push)
6 - Blackberry (token for blackberry push)
7 - Unused
8 - WNS (windows push)
9 - APNS VoIP (token for apple push VoIP)
10 - Web push (web push, see below)
11 - MPNS VoIP (token for microsoft push VoIP)
12 - Tizen (token for tizen push)

For 10 web push, the token must be a JSON-encoded object containing the keys described in PUSH updates /// Device token /// List of user identifiers of other users currently using the client public static Task Account_UnregisterDevice(this Client client, int token_type, string token, long[] other_uids) - => client.CallAsync(new Account_UnregisterDevice_(token_type, token, other_uids)); + => client.CallAsync(new Account_UnregisterDevice_ + { + token_type = token_type, + token = token, + other_uids = other_uids, + }); [TLDef(0x84BE5B93)] - public record Account_UpdateNotifySettings_(InputNotifyPeerBase peer, InputPeerNotifySettings settings) : IMethod; + public partial class Account_UpdateNotifySettings_ : IMethod + { + public InputNotifyPeerBase peer; + public InputPeerNotifySettings settings; + } /// Edits notification settings from a given user/group, from all users/all groups. See Possible codes: 400 (details) /// Notification source /// Notification settings public static Task Account_UpdateNotifySettings(this Client client, InputNotifyPeerBase peer, InputPeerNotifySettings settings) - => client.CallAsync(new Account_UpdateNotifySettings_(peer, settings)); + => client.CallAsync(new Account_UpdateNotifySettings_ + { + peer = peer, + settings = settings, + }); [TLDef(0x12B3AD31)] - public record Account_GetNotifySettings_(InputNotifyPeerBase peer) : IMethod; + public partial class Account_GetNotifySettings_ : IMethod + { + public InputNotifyPeerBase peer; + } /// Gets current notification settings for a given user/group, from all users/all groups. See Possible codes: 400 (details) /// Notification source public static Task Account_GetNotifySettings(this Client client, InputNotifyPeerBase peer) - => client.CallAsync(new Account_GetNotifySettings_(peer)); + => client.CallAsync(new Account_GetNotifySettings_ + { + peer = peer, + }); [TLDef(0xDB7E1747)] - public record Account_ResetNotifySettings_() : IMethod; + public partial class Account_ResetNotifySettings_ : IMethod { } /// Resets all notification settings from users and groups. See public static Task Account_ResetNotifySettings(this Client client) - => client.CallAsync(new Account_ResetNotifySettings_()); + => client.CallAsync(new Account_ResetNotifySettings_ + { + }); [TLDef(0x78515775)] - public record Account_UpdateProfile_(int flags, [field:IfFlag(0)] string first_name, [field:IfFlag(1)] string last_name, [field:IfFlag(2)] string about) : IMethod; + public partial class Account_UpdateProfile_ : IMethod + { + public Flags flags; + [IfFlag(0)] public string first_name; + [IfFlag(1)] public string last_name; + [IfFlag(2)] public string about; + + [Flags] public enum Flags + { + /// Field has a value + has_first_name = 0x1, + /// Field has a value + has_last_name = 0x2, + /// Field has a value + has_about = 0x4, + } + } /// Updates user profile. See Possible codes: 400 (details) /// New user first name /// New user last name /// New bio public static Task Account_UpdateProfile(this Client client, string first_name = null, string last_name = null, string about = null) - => client.CallAsync(new Account_UpdateProfile_((first_name != null ? 0x1 : 0) | (last_name != null ? 0x2 : 0) | (about != null ? 0x4 : 0), - first_name, last_name, about)); + => client.CallAsync(new Account_UpdateProfile_ + { + flags = (Account_UpdateProfile_.Flags)((first_name != null ? 0x1 : 0) | (last_name != null ? 0x2 : 0) | (about != null ? 0x4 : 0)), + first_name = first_name, + last_name = last_name, + about = about, + }); [TLDef(0x6628562C)] - public record Account_UpdateStatus_(bool offline) : IMethod; + public partial class Account_UpdateStatus_ : IMethod + { + public bool offline; + } /// Updates online user status. See /// If is transmitted, user status will change to . public static Task Account_UpdateStatus(this Client client, bool offline) - => client.CallAsync(new Account_UpdateStatus_(offline)); + => client.CallAsync(new Account_UpdateStatus_ + { + offline = offline, + }); [TLDef(0x07967D36)] - public record Account_GetWallPapers_(long hash) : IMethod; + public partial class Account_GetWallPapers_ : IMethod + { + public long hash; + } /// Returns a list of available wallpapers. See /// Hash for pagination, for more info click here /// a null value means account.wallPapersNotModified public static Task Account_GetWallPapers(this Client client, long hash) - => client.CallAsync(new Account_GetWallPapers_(hash)); + => client.CallAsync(new Account_GetWallPapers_ + { + hash = hash, + }); [TLDef(0xC5BA3D86)] - public record Account_ReportPeer_(InputPeer peer, ReportReason reason, string message) : IMethod; + public partial class Account_ReportPeer_ : IMethod + { + public InputPeer peer; + public ReportReason reason; + public string message; + } /// Report a peer for violation of telegram's Terms of Service See Possible codes: 400 (details) /// The peer to report /// The reason why this peer is being reported /// Comment for report moderation public static Task Account_ReportPeer(this Client client, InputPeer peer, ReportReason reason, string message) - => client.CallAsync(new Account_ReportPeer_(peer, reason, message)); + => client.CallAsync(new Account_ReportPeer_ + { + peer = peer, + reason = reason, + message = message, + }); [TLDef(0x2714D86C)] - public record Account_CheckUsername_(string username) : IMethod; + public partial class Account_CheckUsername_ : IMethod + { + public string username; + } /// Validates a username and checks availability. See Possible codes: 400 (details) /// username
Accepted characters: A-z (case-insensitive), 0-9 and underscores.
Length: 5-32 characters. public static Task Account_CheckUsername(this Client client, string username) - => client.CallAsync(new Account_CheckUsername_(username)); + => client.CallAsync(new Account_CheckUsername_ + { + username = username, + }); [TLDef(0x3E0BDD7C)] - public record Account_UpdateUsername_(string username) : IMethod; + public partial class Account_UpdateUsername_ : IMethod + { + public string username; + } /// Changes username for the current user. See Possible codes: 400,401 (details) /// username or empty string if username is to be removed
Accepted characters: a-z (case-insensitive), 0-9 and underscores.
Length: 5-32 characters. public static Task Account_UpdateUsername(this Client client, string username) - => client.CallAsync(new Account_UpdateUsername_(username)); + => client.CallAsync(new Account_UpdateUsername_ + { + username = username, + }); [TLDef(0xDADBC950)] - public record Account_GetPrivacy_(InputPrivacyKey key) : IMethod; + public partial class Account_GetPrivacy_ : IMethod + { + public InputPrivacyKey key; + } /// Get privacy settings of current account See Possible codes: 400 (details) /// Peer category whose privacy settings should be fetched public static Task Account_GetPrivacy(this Client client, InputPrivacyKey key) - => client.CallAsync(new Account_GetPrivacy_(key)); + => client.CallAsync(new Account_GetPrivacy_ + { + key = key, + }); [TLDef(0xC9F81CE8)] - public record Account_SetPrivacy_(InputPrivacyKey key, InputPrivacyRule[] rules) : IMethod; + public partial class Account_SetPrivacy_ : IMethod + { + public InputPrivacyKey key; + public InputPrivacyRule[] rules; + } /// Change privacy settings of current account See Possible codes: 400 (details) /// Peers to which the privacy rules apply /// New privacy rules public static Task Account_SetPrivacy(this Client client, InputPrivacyKey key, InputPrivacyRule[] rules) - => client.CallAsync(new Account_SetPrivacy_(key, rules)); + => client.CallAsync(new Account_SetPrivacy_ + { + key = key, + rules = rules, + }); [TLDef(0x418D4E0B)] - public record Account_DeleteAccount_(string reason) : IMethod; + public partial class Account_DeleteAccount_ : IMethod + { + public string reason; + } /// Delete the user's account from the telegram servers. Can be used, for example, to delete the account of a user that provided the login code, but forgot the 2FA password and no recovery method is configured. See Possible codes: 420 (details) /// Why is the account being deleted, can be empty public static Task Account_DeleteAccount(this Client client, string reason) - => client.CallAsync(new Account_DeleteAccount_(reason)); + => client.CallAsync(new Account_DeleteAccount_ + { + reason = reason, + }); [TLDef(0x08FC711D)] - public record Account_GetAccountTTL_() : IMethod; + public partial class Account_GetAccountTTL_ : IMethod { } /// Get days to live of account See public static Task Account_GetAccountTTL(this Client client) - => client.CallAsync(new Account_GetAccountTTL_()); + => client.CallAsync(new Account_GetAccountTTL_ + { + }); [TLDef(0x2442485E)] - public record Account_SetAccountTTL_(AccountDaysTTL ttl) : IMethod; + public partial class Account_SetAccountTTL_ : IMethod + { + public AccountDaysTTL ttl; + } /// Set account self-destruction period See Possible codes: 400 (details) /// Time to live in days public static Task Account_SetAccountTTL(this Client client, AccountDaysTTL ttl) - => client.CallAsync(new Account_SetAccountTTL_(ttl)); + => client.CallAsync(new Account_SetAccountTTL_ + { + ttl = ttl, + }); [TLDef(0x82574AE5)] - public record Account_SendChangePhoneCode_(string phone_number, CodeSettings settings) : IMethod; + public partial class Account_SendChangePhoneCode_ : IMethod + { + public string phone_number; + public CodeSettings settings; + } /// 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) - => client.CallAsync(new Account_SendChangePhoneCode_(phone_number, settings)); + => client.CallAsync(new Account_SendChangePhoneCode_ + { + phone_number = phone_number, + settings = settings, + }); [TLDef(0x70C32EDB)] - public record Account_ChangePhone_(string phone_number, string phone_code_hash, string phone_code) : IMethod; + public partial class Account_ChangePhone_ : IMethod + { + public string phone_number; + public string phone_code_hash; + public string phone_code; + } /// Change the phone number of the current account See Possible codes: 400 (details) /// New phone number /// Phone code hash received when calling account.sendChangePhoneCode /// Phone code received when calling account.sendChangePhoneCode public static Task Account_ChangePhone(this Client client, string phone_number, string phone_code_hash, string phone_code) - => client.CallAsync(new Account_ChangePhone_(phone_number, phone_code_hash, phone_code)); + => client.CallAsync(new Account_ChangePhone_ + { + phone_number = phone_number, + phone_code_hash = phone_code_hash, + phone_code = phone_code, + }); [TLDef(0x38DF3532)] - public record Account_UpdateDeviceLocked_(int period) : IMethod; + public partial class Account_UpdateDeviceLocked_ : IMethod + { + public int period; + } /// When client-side passcode lock feature is enabled, will not show message texts in incoming PUSH notifications. See /// Inactivity period after which to start hiding message texts in PUSH notifications. public static Task Account_UpdateDeviceLocked(this Client client, int period) - => client.CallAsync(new Account_UpdateDeviceLocked_(period)); + => client.CallAsync(new Account_UpdateDeviceLocked_ + { + period = period, + }); [TLDef(0xE320C158)] - public record Account_GetAuthorizations_() : IMethod; + public partial class Account_GetAuthorizations_ : IMethod { } /// Get logged-in sessions See public static Task Account_GetAuthorizations(this Client client) - => client.CallAsync(new Account_GetAuthorizations_()); + => client.CallAsync(new Account_GetAuthorizations_ + { + }); [TLDef(0xDF77F3BC)] - public record Account_ResetAuthorization_(long hash) : IMethod; + public partial class Account_ResetAuthorization_ : IMethod + { + public long hash; + } /// Log out an active authorized session by its hash See Possible codes: 400,406 (details) /// Session hash public static Task Account_ResetAuthorization(this Client client, long hash) - => client.CallAsync(new Account_ResetAuthorization_(hash)); + => client.CallAsync(new Account_ResetAuthorization_ + { + hash = hash, + }); [TLDef(0x548A30F5)] - public record Account_GetPassword_() : IMethod; + public partial class Account_GetPassword_ : IMethod { } /// Obtain configuration for two-factor authorization with password See public static Task Account_GetPassword(this Client client) - => client.CallAsync(new Account_GetPassword_()); + => client.CallAsync(new Account_GetPassword_ + { + }); [TLDef(0x9CD4EAF9)] - public record Account_GetPasswordSettings_(InputCheckPasswordSRP password) : IMethod; + public partial class Account_GetPasswordSettings_ : IMethod + { + public InputCheckPasswordSRP password; + } /// Get private info associated to the password info (recovery email, telegram passport info & so on) See Possible codes: 400 (details) /// The password (see SRP) public static Task Account_GetPasswordSettings(this Client client, InputCheckPasswordSRP password) - => client.CallAsync(new Account_GetPasswordSettings_(password)); + => client.CallAsync(new Account_GetPasswordSettings_ + { + password = password, + }); [TLDef(0xA59B102F)] - public record Account_UpdatePasswordSettings_(InputCheckPasswordSRP password, Account_PasswordInputSettings new_settings) : IMethod; + public partial class Account_UpdatePasswordSettings_ : IMethod + { + public InputCheckPasswordSRP password; + public Account_PasswordInputSettings new_settings; + } /// Set a new 2FA password See Possible codes: 400 (details) /// The old password (see SRP) /// The new password (see SRP) public static Task Account_UpdatePasswordSettings(this Client client, InputCheckPasswordSRP password, Account_PasswordInputSettings new_settings) - => client.CallAsync(new Account_UpdatePasswordSettings_(password, new_settings)); + => client.CallAsync(new Account_UpdatePasswordSettings_ + { + password = password, + new_settings = new_settings, + }); [TLDef(0x1B3FAA88)] - public record Account_SendConfirmPhoneCode_(string hash, CodeSettings settings) : IMethod; + public partial class Account_SendConfirmPhoneCode_ : IMethod + { + public string hash; + public CodeSettings settings; + } /// 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) - => client.CallAsync(new Account_SendConfirmPhoneCode_(hash, settings)); + => client.CallAsync(new Account_SendConfirmPhoneCode_ + { + hash = hash, + settings = settings, + }); [TLDef(0x5F2178C3)] - public record Account_ConfirmPhone_(string phone_code_hash, string phone_code) : IMethod; + public partial class Account_ConfirmPhone_ : IMethod + { + public string phone_code_hash; + public string phone_code; + } /// Confirm a phone number to cancel account deletion, for more info click here » See Possible codes: 400 (details) /// Phone code hash, for more info click here » /// SMS code, for more info click here » public static Task Account_ConfirmPhone(this Client client, string phone_code_hash, string phone_code) - => client.CallAsync(new Account_ConfirmPhone_(phone_code_hash, phone_code)); + => client.CallAsync(new Account_ConfirmPhone_ + { + phone_code_hash = phone_code_hash, + phone_code = phone_code, + }); [TLDef(0x449E0B51)] - public record Account_GetTmpPassword_(InputCheckPasswordSRP password, int period) : IMethod; + public partial class Account_GetTmpPassword_ : IMethod + { + public InputCheckPasswordSRP password; + public int period; + } /// Get temporary payment password See Possible codes: 400 (details) /// SRP password parameters /// Time during which the temporary password will be valid, in seconds; should be between 60 and 86400 public static Task Account_GetTmpPassword(this Client client, InputCheckPasswordSRP password, int period) - => client.CallAsync(new Account_GetTmpPassword_(password, period)); + => client.CallAsync(new Account_GetTmpPassword_ + { + password = password, + period = period, + }); [TLDef(0x182E6D6F)] - public record Account_GetWebAuthorizations_() : IMethod; + public partial class Account_GetWebAuthorizations_ : IMethod { } /// Get web login widget authorizations See public static Task Account_GetWebAuthorizations(this Client client) - => client.CallAsync(new Account_GetWebAuthorizations_()); + => client.CallAsync(new Account_GetWebAuthorizations_ + { + }); [TLDef(0x2D01B9EF)] - public record Account_ResetWebAuthorization_(long hash) : IMethod; + public partial class Account_ResetWebAuthorization_ : IMethod + { + public long hash; + } /// Log out an active web telegram login session See Possible codes: 400 (details) /// hash public static Task Account_ResetWebAuthorization(this Client client, long hash) - => client.CallAsync(new Account_ResetWebAuthorization_(hash)); + => client.CallAsync(new Account_ResetWebAuthorization_ + { + hash = hash, + }); [TLDef(0x682D2594)] - public record Account_ResetWebAuthorizations_() : IMethod; + public partial class Account_ResetWebAuthorizations_ : IMethod { } /// Reset all active web telegram login sessions See public static Task Account_ResetWebAuthorizations(this Client client) - => client.CallAsync(new Account_ResetWebAuthorizations_()); + => client.CallAsync(new Account_ResetWebAuthorizations_ + { + }); [TLDef(0xB288BC7D)] - public record Account_GetAllSecureValues_() : IMethod; + public partial class Account_GetAllSecureValues_ : IMethod { } /// Get all saved Telegram Passport documents, for more info see the passport docs » See public static Task Account_GetAllSecureValues(this Client client) - => client.CallAsync(new Account_GetAllSecureValues_()); + => client.CallAsync(new Account_GetAllSecureValues_ + { + }); [TLDef(0x73665BC2)] - public record Account_GetSecureValue_(SecureValueType[] types) : IMethod; + public partial class Account_GetSecureValue_ : IMethod + { + public SecureValueType[] types; + } /// Get saved Telegram Passport document, for more info see the passport docs » See /// Requested value types public static Task Account_GetSecureValue(this Client client, SecureValueType[] types) - => client.CallAsync(new Account_GetSecureValue_(types)); + => client.CallAsync(new Account_GetSecureValue_ + { + types = types, + }); [TLDef(0x899FE31D)] - public record Account_SaveSecureValue_(InputSecureValue value, long secure_secret_id) : IMethod; + public partial class Account_SaveSecureValue_ : IMethod + { + public InputSecureValue value; + public long secure_secret_id; + } /// Securely save Telegram Passport document, for more info see the passport docs » See Possible codes: 400 (details) /// Secure value, for more info see the passport docs » /// Passport secret hash, for more info see the passport docs » public static Task Account_SaveSecureValue(this Client client, InputSecureValue value, long secure_secret_id) - => client.CallAsync(new Account_SaveSecureValue_(value, secure_secret_id)); + => client.CallAsync(new Account_SaveSecureValue_ + { + value = value, + secure_secret_id = secure_secret_id, + }); [TLDef(0xB880BC4B)] - public record Account_DeleteSecureValue_(SecureValueType[] types) : IMethod; + public partial class Account_DeleteSecureValue_ : IMethod + { + public SecureValueType[] types; + } /// Delete stored Telegram Passport documents, for more info see the passport docs » See /// Document types to delete public static Task Account_DeleteSecureValue(this Client client, SecureValueType[] types) - => client.CallAsync(new Account_DeleteSecureValue_(types)); + => client.CallAsync(new Account_DeleteSecureValue_ + { + types = types, + }); [TLDef(0xA929597A)] - public record Account_GetAuthorizationForm_(long bot_id, string scope, string public_key) : IMethod; + public partial class Account_GetAuthorizationForm_ : IMethod + { + public long bot_id; + public string scope; + public string public_key; + } /// Returns a Telegram Passport authorization form for sharing data with a service See Possible codes: 400 (details) /// User identifier of the service's bot /// Telegram Passport element types requested by the service /// Service's public key public static Task Account_GetAuthorizationForm(this Client client, long bot_id, string scope, string public_key) - => client.CallAsync(new Account_GetAuthorizationForm_(bot_id, scope, public_key)); + => client.CallAsync(new Account_GetAuthorizationForm_ + { + bot_id = bot_id, + scope = scope, + public_key = public_key, + }); [TLDef(0xF3ED4C73)] - public record Account_AcceptAuthorization_(long bot_id, string scope, string public_key, SecureValueHash[] value_hashes, SecureCredentialsEncrypted credentials) : IMethod; + public partial class Account_AcceptAuthorization_ : IMethod + { + public long bot_id; + public string scope; + public string public_key; + public SecureValueHash[] value_hashes; + public SecureCredentialsEncrypted credentials; + } /// Sends a Telegram Passport authorization form, effectively sharing data with the service See /// Bot ID /// Telegram Passport element types requested by the service @@ -12723,42 +13201,95 @@ namespace TL /// Types of values sent and their hashes /// Encrypted values public static Task Account_AcceptAuthorization(this Client client, long bot_id, string scope, string public_key, SecureValueHash[] value_hashes, SecureCredentialsEncrypted credentials) - => client.CallAsync(new Account_AcceptAuthorization_(bot_id, scope, public_key, value_hashes, credentials)); + => client.CallAsync(new Account_AcceptAuthorization_ + { + bot_id = bot_id, + scope = scope, + public_key = public_key, + value_hashes = value_hashes, + credentials = credentials, + }); [TLDef(0xA5A356F9)] - public record Account_SendVerifyPhoneCode_(string phone_number, CodeSettings settings) : IMethod; + public partial class Account_SendVerifyPhoneCode_ : IMethod + { + public string phone_number; + public CodeSettings settings; + } /// 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) - => client.CallAsync(new Account_SendVerifyPhoneCode_(phone_number, settings)); + => client.CallAsync(new Account_SendVerifyPhoneCode_ + { + phone_number = phone_number, + settings = settings, + }); [TLDef(0x4DD3A7F6)] - public record Account_VerifyPhone_(string phone_number, string phone_code_hash, string phone_code) : IMethod; + public partial class Account_VerifyPhone_ : IMethod + { + public string phone_number; + public string phone_code_hash; + public string phone_code; + } /// Verify a phone number for telegram passport. See Possible codes: 400 (details) /// Phone number /// Phone code hash received from the call to account.sendVerifyPhoneCode /// Code received after the call to account.sendVerifyPhoneCode public static Task Account_VerifyPhone(this Client client, string phone_number, string phone_code_hash, string phone_code) - => client.CallAsync(new Account_VerifyPhone_(phone_number, phone_code_hash, phone_code)); + => client.CallAsync(new Account_VerifyPhone_ + { + phone_number = phone_number, + phone_code_hash = phone_code_hash, + phone_code = phone_code, + }); [TLDef(0x7011509F)] - public record Account_SendVerifyEmailCode_(string email) : IMethod; + public partial class Account_SendVerifyEmailCode_ : IMethod + { + public string email; + } /// Send the verification email code for telegram passport. See Possible codes: 400 (details) /// The email where to send the code public static Task Account_SendVerifyEmailCode(this Client client, string email) - => client.CallAsync(new Account_SendVerifyEmailCode_(email)); + => client.CallAsync(new Account_SendVerifyEmailCode_ + { + email = email, + }); [TLDef(0xECBA39DB)] - public record Account_VerifyEmail_(string email, string code) : IMethod; + public partial class Account_VerifyEmail_ : IMethod + { + public string email; + public string code; + } /// Verify an email address for telegram passport. See Possible codes: 400 (details) /// The email to verify /// The verification code that was received public static Task Account_VerifyEmail(this Client client, string email, string code) - => client.CallAsync(new Account_VerifyEmail_(email, code)); + => client.CallAsync(new Account_VerifyEmail_ + { + email = email, + code = code, + }); [TLDef(0xF05B4804)] - public record Account_InitTakeoutSession_(int flags, [field:IfFlag(5)] int file_max_size) : IMethod; + public partial class Account_InitTakeoutSession_ : IMethod + { + public Flags flags; + [IfFlag(5)] public int file_max_size; + + [Flags] public enum Flags + { + contacts = 0x1, + message_users = 0x2, + message_chats = 0x4, + message_megagroups = 0x8, + message_channels = 0x10, + files = 0x20, + } + } /// Initialize account takeout session See Possible codes: 420 (details) /// Whether to export contacts /// Whether to export messages in private chats @@ -12768,135 +13299,294 @@ namespace TL /// Whether to export files /// Maximum size of files to export public static Task Account_InitTakeoutSession(this Client client, bool contacts = false, bool message_users = false, bool message_chats = false, bool message_megagroups = false, bool message_channels = false, bool files = false, int? file_max_size = null) - => client.CallAsync(new Account_InitTakeoutSession_((contacts ? 0x1 : 0) | (message_users ? 0x2 : 0) | (message_chats ? 0x4 : 0) | (message_megagroups ? 0x8 : 0) | (message_channels ? 0x10 : 0) | (files ? 0x20 : 0) | (file_max_size != null ? 0x20 : 0), - file_max_size.GetValueOrDefault())); + => client.CallAsync(new Account_InitTakeoutSession_ + { + flags = (Account_InitTakeoutSession_.Flags)((contacts ? 0x1 : 0) | (message_users ? 0x2 : 0) | (message_chats ? 0x4 : 0) | (message_megagroups ? 0x8 : 0) | (message_channels ? 0x10 : 0) | (files ? 0x20 : 0) | (file_max_size != null ? 0x20 : 0)), + file_max_size = file_max_size.GetValueOrDefault(), + }); [TLDef(0x1D2652EE)] - public record Account_FinishTakeoutSession_(int flags) : IMethod; + public partial class Account_FinishTakeoutSession_ : IMethod + { + public Flags flags; + + [Flags] public enum Flags + { + success = 0x1, + } + } /// Finish account takeout session See Possible codes: 403 (details) /// Data exported successfully public static Task Account_FinishTakeoutSession(this Client client, bool success = false) - => client.CallAsync(new Account_FinishTakeoutSession_(success ? 0x1 : 0)); + => client.CallAsync(new Account_FinishTakeoutSession_ + { + flags = (Account_FinishTakeoutSession_.Flags)(success ? 0x1 : 0), + }); [TLDef(0x8FDF1920)] - public record Account_ConfirmPasswordEmail_(string code) : IMethod; + public partial class Account_ConfirmPasswordEmail_ : IMethod + { + public string code; + } /// Verify an email to use as 2FA recovery method. See Possible codes: 400 (details) /// The phone code that was received after setting a recovery email public static Task Account_ConfirmPasswordEmail(this Client client, string code) - => client.CallAsync(new Account_ConfirmPasswordEmail_(code)); + => client.CallAsync(new Account_ConfirmPasswordEmail_ + { + code = code, + }); [TLDef(0x7A7F2A15)] - public record Account_ResendPasswordEmail_() : IMethod; + public partial class Account_ResendPasswordEmail_ : IMethod { } /// Resend the code to verify an email to use as 2FA recovery method. See public static Task Account_ResendPasswordEmail(this Client client) - => client.CallAsync(new Account_ResendPasswordEmail_()); + => client.CallAsync(new Account_ResendPasswordEmail_ + { + }); [TLDef(0xC1CBD5B6)] - public record Account_CancelPasswordEmail_() : IMethod; + public partial class Account_CancelPasswordEmail_ : IMethod { } /// Cancel the code that was sent to verify an email to use as 2FA recovery method. See public static Task Account_CancelPasswordEmail(this Client client) - => client.CallAsync(new Account_CancelPasswordEmail_()); + => client.CallAsync(new Account_CancelPasswordEmail_ + { + }); [TLDef(0x9F07C728)] - public record Account_GetContactSignUpNotification_() : IMethod; + public partial class Account_GetContactSignUpNotification_ : IMethod { } /// Whether the user will receive notifications when contacts sign up See public static Task Account_GetContactSignUpNotification(this Client client) - => client.CallAsync(new Account_GetContactSignUpNotification_()); + => client.CallAsync(new Account_GetContactSignUpNotification_ + { + }); [TLDef(0xCFF43F61)] - public record Account_SetContactSignUpNotification_(bool silent) : IMethod; + public partial class Account_SetContactSignUpNotification_ : IMethod + { + public bool silent; + } /// Toggle contact sign up notifications See /// Whether to disable contact sign up notifications public static Task Account_SetContactSignUpNotification(this Client client, bool silent) - => client.CallAsync(new Account_SetContactSignUpNotification_(silent)); + => client.CallAsync(new Account_SetContactSignUpNotification_ + { + silent = silent, + }); [TLDef(0x53577479)] - public record Account_GetNotifyExceptions_(int flags, [field:IfFlag(0)] InputNotifyPeerBase peer) : IMethod; + public partial class Account_GetNotifyExceptions_ : IMethod + { + public Flags flags; + [IfFlag(0)] public InputNotifyPeerBase peer; + + [Flags] public enum Flags + { + /// Field has a value + has_peer = 0x1, + compare_sound = 0x2, + } + } /// Returns list of chats with non-default notification settings See /// If true, chats with non-default sound will also be returned /// If specified, only chats of the specified category will be returned public static Task Account_GetNotifyExceptions(this Client client, bool compare_sound = false, InputNotifyPeerBase peer = null) - => client.CallAsync(new Account_GetNotifyExceptions_((compare_sound ? 0x2 : 0) | (peer != null ? 0x1 : 0), - peer)); + => client.CallAsync(new Account_GetNotifyExceptions_ + { + flags = (Account_GetNotifyExceptions_.Flags)((compare_sound ? 0x2 : 0) | (peer != null ? 0x1 : 0)), + peer = peer, + }); [TLDef(0xFC8DDBEA)] - public record Account_GetWallPaper_(InputWallPaperBase wallpaper) : IMethod; + public partial class Account_GetWallPaper_ : IMethod + { + public InputWallPaperBase wallpaper; + } /// Get info about a certain wallpaper See Possible codes: 400 (details) /// The wallpaper to get info about public static Task Account_GetWallPaper(this Client client, InputWallPaperBase wallpaper) - => client.CallAsync(new Account_GetWallPaper_(wallpaper)); + => client.CallAsync(new Account_GetWallPaper_ + { + wallpaper = wallpaper, + }); [TLDef(0xDD853661)] - public record Account_UploadWallPaper_(InputFileBase file, string mime_type, WallPaperSettings settings) : IMethod; + public partial class Account_UploadWallPaper_ : IMethod + { + public InputFileBase file; + public string mime_type; + public WallPaperSettings settings; + } /// Create and upload a new wallpaper See Possible codes: 400 (details) /// The JPG/PNG wallpaper /// MIME type of uploaded wallpaper /// Wallpaper settings public static Task Account_UploadWallPaper(this Client client, InputFileBase file, string mime_type, WallPaperSettings settings) - => client.CallAsync(new Account_UploadWallPaper_(file, mime_type, settings)); + => client.CallAsync(new Account_UploadWallPaper_ + { + file = file, + mime_type = mime_type, + settings = settings, + }); [TLDef(0x6C5A5B37)] - public record Account_SaveWallPaper_(InputWallPaperBase wallpaper, bool unsave, WallPaperSettings settings) : IMethod; + public partial class Account_SaveWallPaper_ : IMethod + { + public InputWallPaperBase wallpaper; + public bool unsave; + public WallPaperSettings settings; + } /// Install/uninstall wallpaper See Possible codes: 400 (details) /// Wallpaper to save /// Uninstall wallpaper? /// Wallpaper settings public static Task Account_SaveWallPaper(this Client client, InputWallPaperBase wallpaper, bool unsave, WallPaperSettings settings) - => client.CallAsync(new Account_SaveWallPaper_(wallpaper, unsave, settings)); + => client.CallAsync(new Account_SaveWallPaper_ + { + wallpaper = wallpaper, + unsave = unsave, + settings = settings, + }); [TLDef(0xFEED5769)] - public record Account_InstallWallPaper_(InputWallPaperBase wallpaper, WallPaperSettings settings) : IMethod; + public partial class Account_InstallWallPaper_ : IMethod + { + public InputWallPaperBase wallpaper; + public WallPaperSettings settings; + } /// Install wallpaper See Possible codes: 400 (details) /// Wallpaper to install /// Wallpaper settings public static Task Account_InstallWallPaper(this Client client, InputWallPaperBase wallpaper, WallPaperSettings settings) - => client.CallAsync(new Account_InstallWallPaper_(wallpaper, settings)); + => client.CallAsync(new Account_InstallWallPaper_ + { + wallpaper = wallpaper, + settings = settings, + }); [TLDef(0xBB3B9804)] - public record Account_ResetWallPapers_() : IMethod; + public partial class Account_ResetWallPapers_ : IMethod { } /// Delete installed wallpapers See public static Task Account_ResetWallPapers(this Client client) - => client.CallAsync(new Account_ResetWallPapers_()); + => client.CallAsync(new Account_ResetWallPapers_ + { + }); [TLDef(0x56DA0B3F)] - public record Account_GetAutoDownloadSettings_() : IMethod; + public partial class Account_GetAutoDownloadSettings_ : IMethod { } /// Get media autodownload settings See public static Task Account_GetAutoDownloadSettings(this Client client) - => client.CallAsync(new Account_GetAutoDownloadSettings_()); + => client.CallAsync(new Account_GetAutoDownloadSettings_ + { + }); [TLDef(0x76F36233)] - public record Account_SaveAutoDownloadSettings_(int flags, AutoDownloadSettings settings) : IMethod; + public partial class Account_SaveAutoDownloadSettings_ : IMethod + { + public Flags flags; + public AutoDownloadSettings settings; + + [Flags] public enum Flags + { + low = 0x1, + high = 0x2, + } + } /// Change media autodownload settings See /// Whether to save settings in the low data usage preset /// Whether to save settings in the high data usage preset /// Media autodownload settings public static Task Account_SaveAutoDownloadSettings(this Client client, AutoDownloadSettings settings, bool low = false, bool high = false) - => client.CallAsync(new Account_SaveAutoDownloadSettings_((low ? 0x1 : 0) | (high ? 0x2 : 0), - settings)); + => client.CallAsync(new Account_SaveAutoDownloadSettings_ + { + flags = (Account_SaveAutoDownloadSettings_.Flags)((low ? 0x1 : 0) | (high ? 0x2 : 0)), + settings = settings, + }); [TLDef(0x1C3DB333)] - public record Account_UploadTheme_(int flags, InputFileBase file, [field:IfFlag(0)] InputFileBase thumb, string file_name, string mime_type) : IMethod; + public partial class Account_UploadTheme_ : IMethod + { + public Flags flags; + public InputFileBase file; + [IfFlag(0)] public InputFileBase thumb; + public string file_name; + public string mime_type; + + [Flags] public enum Flags + { + /// Field has a value + has_thumb = 0x1, + } + } /// Upload theme See Possible codes: 400 (details) /// Theme file uploaded as described in files » /// Thumbnail /// File name /// MIME type, must be application/x-tgtheme-{format}, where format depends on the client public static Task Account_UploadTheme(this Client client, InputFileBase file, string file_name, string mime_type, InputFileBase thumb = null) - => client.CallAsync(new Account_UploadTheme_(thumb != null ? 0x1 : 0, file, thumb, file_name, mime_type)); + => client.CallAsync(new Account_UploadTheme_ + { + flags = (Account_UploadTheme_.Flags)(thumb != null ? 0x1 : 0), + file = file, + thumb = thumb, + file_name = file_name, + mime_type = mime_type, + }); [TLDef(0x652E4400)] - public record Account_CreateTheme_(int flags, string slug, string title, [field:IfFlag(2)] InputDocument document, [field:IfFlag(3)] InputThemeSettings[] settings) : IMethod; + public partial class Account_CreateTheme_ : IMethod + { + public Flags flags; + public string slug; + public string title; + [IfFlag(2)] public InputDocument document; + [IfFlag(3)] public InputThemeSettings[] settings; + + [Flags] public enum Flags + { + /// Field has a value + has_document = 0x4, + /// Field has a value + has_settings = 0x8, + } + } /// Create a theme See Possible codes: 400 (details) /// Unique theme ID /// Theme name /// Theme file /// Theme settings public static Task Account_CreateTheme(this Client client, string slug, string title, InputDocument document = null, InputThemeSettings[] settings = null) - => client.CallAsync(new Account_CreateTheme_((document != null ? 0x4 : 0) | (settings != null ? 0x8 : 0), - slug, title, document, settings)); + => client.CallAsync(new Account_CreateTheme_ + { + flags = (Account_CreateTheme_.Flags)((document != null ? 0x4 : 0) | (settings != null ? 0x8 : 0)), + slug = slug, + title = title, + document = document, + settings = settings, + }); [TLDef(0x2BF40CCC)] - public record Account_UpdateTheme_(int flags, string format, InputThemeBase theme, [field:IfFlag(0)] string slug, [field:IfFlag(1)] string title, [field:IfFlag(2)] InputDocument document, [field:IfFlag(3)] InputThemeSettings[] settings) : IMethod; + public partial class Account_UpdateTheme_ : IMethod + { + public Flags flags; + public string format; + public InputThemeBase theme; + [IfFlag(0)] public string slug; + [IfFlag(1)] public string title; + [IfFlag(2)] public InputDocument document; + [IfFlag(3)] public InputThemeSettings[] settings; + + [Flags] public enum Flags + { + /// Field has a value + has_slug = 0x1, + /// Field has a value + has_title = 0x2, + /// Field has a value + has_document = 0x4, + /// Field has a value + has_settings = 0x8, + } + } /// Update theme See Possible codes: 400 (details) /// Theme format, a string that identifies the theming engines supported by the client /// Theme to update @@ -12905,211 +13595,420 @@ namespace TL /// Theme file /// Theme settings public static Task Account_UpdateTheme(this Client client, string format, InputThemeBase theme, string slug = null, string title = null, InputDocument document = null, InputThemeSettings[] settings = null) - => client.CallAsync(new Account_UpdateTheme_((slug != null ? 0x1 : 0) | (title != null ? 0x2 : 0) | (document != null ? 0x4 : 0) | (settings != null ? 0x8 : 0), - format, theme, slug, title, document, settings)); + => client.CallAsync(new Account_UpdateTheme_ + { + flags = (Account_UpdateTheme_.Flags)((slug != null ? 0x1 : 0) | (title != null ? 0x2 : 0) | (document != null ? 0x4 : 0) | (settings != null ? 0x8 : 0)), + format = format, + theme = theme, + slug = slug, + title = title, + document = document, + settings = settings, + }); [TLDef(0xF257106C)] - public record Account_SaveTheme_(InputThemeBase theme, bool unsave) : IMethod; + public partial class Account_SaveTheme_ : IMethod + { + public InputThemeBase theme; + public bool unsave; + } /// Save a theme See /// Theme to save /// Unsave public static Task Account_SaveTheme(this Client client, InputThemeBase theme, bool unsave) - => client.CallAsync(new Account_SaveTheme_(theme, unsave)); + => client.CallAsync(new Account_SaveTheme_ + { + theme = theme, + unsave = unsave, + }); [TLDef(0xC727BB3B)] - public record Account_InstallTheme_(int flags, [field:IfFlag(1)] InputThemeBase theme, [field:IfFlag(2)] string format, [field:IfFlag(3)] BaseTheme base_theme) : IMethod; + public partial class Account_InstallTheme_ : IMethod + { + public Flags flags; + [IfFlag(1)] public InputThemeBase theme; + [IfFlag(2)] public string format; + [IfFlag(3)] public BaseTheme base_theme; + + [Flags] public enum Flags + { + dark = 0x1, + /// Field has a value + has_theme = 0x2, + /// Field has a value + has_format = 0x4, + /// Field has a value + has_base_theme = 0x8, + } + } /// Install a theme See /// Whether to install the dark version /// Theme format, a string that identifies the theming engines supported by the client /// Theme to install public static Task Account_InstallTheme(this Client client, bool dark = false, InputThemeBase theme = null, string format = null, BaseTheme base_theme = default) - => client.CallAsync(new Account_InstallTheme_((dark ? 0x1 : 0) | (theme != null ? 0x2 : 0) | (format != null ? 0x4 : 0) | (base_theme != default ? 0x8 : 0), - theme, format, base_theme)); + => client.CallAsync(new Account_InstallTheme_ + { + flags = (Account_InstallTheme_.Flags)((dark ? 0x1 : 0) | (theme != null ? 0x2 : 0) | (format != null ? 0x4 : 0) | (base_theme != default ? 0x8 : 0)), + theme = theme, + format = format, + base_theme = base_theme, + }); [TLDef(0x8D9D742B)] - public record Account_GetTheme_(string format, InputThemeBase theme, long document_id) : IMethod; + public partial class Account_GetTheme_ : IMethod + { + public string format; + public InputThemeBase theme; + public long document_id; + } /// Get theme information See Possible codes: 400 (details) /// Theme format, a string that identifies the theming engines supported by the client /// Theme /// Document ID public static Task Account_GetTheme(this Client client, string format, InputThemeBase theme, long document_id) - => client.CallAsync(new Account_GetTheme_(format, theme, document_id)); + => client.CallAsync(new Account_GetTheme_ + { + format = format, + theme = theme, + document_id = document_id, + }); [TLDef(0x7206E458)] - public record Account_GetThemes_(string format, long hash) : IMethod; + public partial class Account_GetThemes_ : IMethod + { + public string format; + public long hash; + } /// Get installed themes See /// Theme format, a string that identifies the theming engines supported by the client /// Hash for pagination, for more info click here /// a null value means account.themesNotModified public static Task Account_GetThemes(this Client client, string format, long hash) - => client.CallAsync(new Account_GetThemes_(format, hash)); + => client.CallAsync(new Account_GetThemes_ + { + format = format, + hash = hash, + }); [TLDef(0xB574B16B)] - public record Account_SetContentSettings_(int flags) : IMethod; + public partial class Account_SetContentSettings_ : IMethod + { + public Flags flags; + + [Flags] public enum Flags + { + sensitive_enabled = 0x1, + } + } /// Set sensitive content settings (for viewing or hiding NSFW content) See Possible codes: 403 (details) /// Enable NSFW content public static Task Account_SetContentSettings(this Client client, bool sensitive_enabled = false) - => client.CallAsync(new Account_SetContentSettings_(sensitive_enabled ? 0x1 : 0)); + => client.CallAsync(new Account_SetContentSettings_ + { + flags = (Account_SetContentSettings_.Flags)(sensitive_enabled ? 0x1 : 0), + }); [TLDef(0x8B9B4DAE)] - public record Account_GetContentSettings_() : IMethod; + public partial class Account_GetContentSettings_ : IMethod { } /// Get sensitive content settings See public static Task Account_GetContentSettings(this Client client) - => client.CallAsync(new Account_GetContentSettings_()); + => client.CallAsync(new Account_GetContentSettings_ + { + }); [TLDef(0x65AD71DC)] - public record Account_GetMultiWallPapers_(InputWallPaperBase[] wallpapers) : IMethod; + public partial class Account_GetMultiWallPapers_ : IMethod + { + public InputWallPaperBase[] wallpapers; + } /// Get info about multiple wallpapers See /// Wallpapers to fetch info about public static Task Account_GetMultiWallPapers(this Client client, InputWallPaperBase[] wallpapers) - => client.CallAsync(new Account_GetMultiWallPapers_(wallpapers)); + => client.CallAsync(new Account_GetMultiWallPapers_ + { + wallpapers = wallpapers, + }); [TLDef(0xEB2B4CF6)] - public record Account_GetGlobalPrivacySettings_() : IMethod; + public partial class Account_GetGlobalPrivacySettings_ : IMethod { } /// Get global privacy settings See public static Task Account_GetGlobalPrivacySettings(this Client client) - => client.CallAsync(new Account_GetGlobalPrivacySettings_()); + => client.CallAsync(new Account_GetGlobalPrivacySettings_ + { + }); [TLDef(0x1EDAAAC2)] - public record Account_SetGlobalPrivacySettings_(GlobalPrivacySettings settings) : IMethod; + public partial class Account_SetGlobalPrivacySettings_ : IMethod + { + public GlobalPrivacySettings settings; + } /// Set global privacy settings See Possible codes: 400 (details) /// Global privacy settings public static Task Account_SetGlobalPrivacySettings(this Client client, GlobalPrivacySettings settings) - => client.CallAsync(new Account_SetGlobalPrivacySettings_(settings)); + => client.CallAsync(new Account_SetGlobalPrivacySettings_ + { + settings = settings, + }); [TLDef(0xFA8CC6F5)] - public record Account_ReportProfilePhoto_(InputPeer peer, InputPhoto photo_id, ReportReason reason, string message) : IMethod; + public partial class Account_ReportProfilePhoto_ : IMethod + { + public InputPeer peer; + public InputPhoto photo_id; + public ReportReason reason; + public string message; + } /// Report a profile photo of a dialog See /// The dialog /// Dialog photo ID /// Report reason /// Comment for report moderation public static Task Account_ReportProfilePhoto(this Client client, InputPeer peer, InputPhoto photo_id, ReportReason reason, string message) - => client.CallAsync(new Account_ReportProfilePhoto_(peer, photo_id, reason, message)); + => client.CallAsync(new Account_ReportProfilePhoto_ + { + peer = peer, + photo_id = photo_id, + reason = reason, + message = message, + }); [TLDef(0x9308CE1B)] - public record Account_ResetPassword_() : IMethod; + public partial class Account_ResetPassword_ : IMethod { } /// Initiate a 2FA password reset: can only be used if the user is already logged-in, see here for more info » See public static Task Account_ResetPassword(this Client client) - => client.CallAsync(new Account_ResetPassword_()); + => client.CallAsync(new Account_ResetPassword_ + { + }); [TLDef(0x4C9409F6)] - public record Account_DeclinePasswordReset_() : IMethod; + public partial class Account_DeclinePasswordReset_ : IMethod { } /// Abort a pending 2FA password reset, see here for more info » See Possible codes: 400 (details) public static Task Account_DeclinePasswordReset(this Client client) - => client.CallAsync(new Account_DeclinePasswordReset_()); + => client.CallAsync(new Account_DeclinePasswordReset_ + { + }); [TLDef(0xD638DE89)] - public record Account_GetChatThemes_(long hash) : IMethod; + public partial class Account_GetChatThemes_ : IMethod + { + public long hash; + } /// Get all available chat themes See /// Hash for pagination, for more info click here /// a null value means account.themesNotModified public static Task Account_GetChatThemes(this Client client, long hash) - => client.CallAsync(new Account_GetChatThemes_(hash)); + => client.CallAsync(new Account_GetChatThemes_ + { + hash = hash, + }); [TLDef(0x0D91A548)] - public record Users_GetUsers_(InputUserBase[] id) : IMethod; + public partial class Users_GetUsers_ : IMethod + { + public InputUserBase[] id; + } /// Returns basic user info according to their identifiers. See [bots: ✓] Possible codes: 400,401 (details) /// List of user identifiers public static Task Users_GetUsers(this Client client, InputUserBase[] id) - => client.CallAsync(new Users_GetUsers_(id)); + => client.CallAsync(new Users_GetUsers_ + { + id = id, + }); [TLDef(0xCA30A5B1)] - public record Users_GetFullUser_(InputUserBase id) : IMethod; + public partial class Users_GetFullUser_ : IMethod + { + public InputUserBase id; + } /// Returns extended user info by ID. See [bots: ✓] Possible codes: 400 (details) /// User ID public static Task Users_GetFullUser(this Client client, InputUserBase id) - => client.CallAsync(new Users_GetFullUser_(id)); + => client.CallAsync(new Users_GetFullUser_ + { + id = id, + }); [TLDef(0x90C894B5)] - public record Users_SetSecureValueErrors_(InputUserBase id, SecureValueErrorBase[] errors) : IMethod; + public partial class Users_SetSecureValueErrors_ : IMethod + { + public InputUserBase id; + public SecureValueErrorBase[] errors; + } /// Notify the user that the sent passport data contains some errors The user will not be able to re-submit their Passport data to you until the errors are fixed (the contents of the field for which you returned the error must change). See [bots: ✓] Possible codes: 400 (details) /// The user /// Errors public static Task Users_SetSecureValueErrors(this Client client, InputUserBase id, SecureValueErrorBase[] errors) - => client.CallAsync(new Users_SetSecureValueErrors_(id, errors)); + => client.CallAsync(new Users_SetSecureValueErrors_ + { + id = id, + errors = errors, + }); [TLDef(0x7ADC669D)] - public record Contacts_GetContactIDs_(long hash) : IMethod; + public partial class Contacts_GetContactIDs_ : IMethod + { + public long hash; + } /// Get contact by telegram IDs See /// Hash for pagination, for more info click here public static Task Contacts_GetContactIDs(this Client client, long hash) - => client.CallAsync(new Contacts_GetContactIDs_(hash)); + => client.CallAsync(new Contacts_GetContactIDs_ + { + hash = hash, + }); [TLDef(0xC4A353EE)] - public record Contacts_GetStatuses_() : IMethod; + public partial class Contacts_GetStatuses_ : IMethod { } /// Returns the list of contact statuses. See public static Task Contacts_GetStatuses(this Client client) - => client.CallAsync(new Contacts_GetStatuses_()); + => client.CallAsync(new Contacts_GetStatuses_ + { + }); [TLDef(0x5DD69E12)] - public record Contacts_GetContacts_(long hash) : IMethod; + public partial class Contacts_GetContacts_ : IMethod + { + public long hash; + } /// Returns the current user's contact list. See /// If there already is a full contact list on the client, a hash of a the list of contact IDs in ascending order may be passed in this parameter. If the contact set was not changed, will be returned. /// a null value means contacts.contactsNotModified public static Task Contacts_GetContacts(this Client client, long hash) - => client.CallAsync(new Contacts_GetContacts_(hash)); + => client.CallAsync(new Contacts_GetContacts_ + { + hash = hash, + }); [TLDef(0x2C800BE5)] - public record Contacts_ImportContacts_(InputContact[] contacts) : IMethod; + public partial class Contacts_ImportContacts_ : IMethod + { + public InputContact[] contacts; + } /// Imports contacts: saves a full list on the server, adds already registered contacts to the contact list, returns added contacts and their info. See /// List of contacts to import public static Task Contacts_ImportContacts(this Client client, InputContact[] contacts) - => client.CallAsync(new Contacts_ImportContacts_(contacts)); + => client.CallAsync(new Contacts_ImportContacts_ + { + contacts = contacts, + }); [TLDef(0x096A0E00)] - public record Contacts_DeleteContacts_(InputUserBase[] id) : IMethod; + public partial class Contacts_DeleteContacts_ : IMethod + { + public InputUserBase[] id; + } /// Deletes several contacts from the list. See /// User ID list public static Task Contacts_DeleteContacts(this Client client, InputUserBase[] id) - => client.CallAsync(new Contacts_DeleteContacts_(id)); + => client.CallAsync(new Contacts_DeleteContacts_ + { + id = id, + }); [TLDef(0x1013FD9E)] - public record Contacts_DeleteByPhones_(string[] phones) : IMethod; + public partial class Contacts_DeleteByPhones_ : IMethod + { + public string[] phones; + } /// Delete contacts by phone number See /// Phone numbers public static Task Contacts_DeleteByPhones(this Client client, string[] phones) - => client.CallAsync(new Contacts_DeleteByPhones_(phones)); + => client.CallAsync(new Contacts_DeleteByPhones_ + { + phones = phones, + }); [TLDef(0x68CC1411)] - public record Contacts_Block_(InputPeer id) : IMethod; + public partial class Contacts_Block_ : IMethod + { + public InputPeer id; + } /// Adds the user to the blacklist. See Possible codes: 400 (details) /// User ID public static Task Contacts_Block(this Client client, InputPeer id) - => client.CallAsync(new Contacts_Block_(id)); + => client.CallAsync(new Contacts_Block_ + { + id = id, + }); [TLDef(0xBEA65D50)] - public record Contacts_Unblock_(InputPeer id) : IMethod; + public partial class Contacts_Unblock_ : IMethod + { + public InputPeer id; + } /// Deletes the user from the blacklist. See Possible codes: 400 (details) /// User ID public static Task Contacts_Unblock(this Client client, InputPeer id) - => client.CallAsync(new Contacts_Unblock_(id)); + => client.CallAsync(new Contacts_Unblock_ + { + id = id, + }); [TLDef(0xF57C350F)] - public record Contacts_GetBlocked_(int offset, int limit) : IMethod; + public partial class Contacts_GetBlocked_ : IMethod + { + public int offset; + public int limit; + } /// Returns the list of blocked users. See /// The number of list elements to be skipped /// The number of list elements to be returned public static Task Contacts_GetBlocked(this Client client, int offset, int limit) - => client.CallAsync(new Contacts_GetBlocked_(offset, limit)); + => client.CallAsync(new Contacts_GetBlocked_ + { + offset = offset, + limit = limit, + }); [TLDef(0x11F812D8)] - public record Contacts_Search_(string q, int limit) : IMethod; + public partial class Contacts_Search_ : IMethod + { + public string q; + public int limit; + } /// Returns users found by username substring. See Possible codes: 400 (details) /// Target substring /// Maximum number of users to be returned public static Task Contacts_Search(this Client client, string q, int limit) - => client.CallAsync(new Contacts_Search_(q, limit)); + => client.CallAsync(new Contacts_Search_ + { + q = q, + limit = limit, + }); [TLDef(0xF93CCBA3)] - public record Contacts_ResolveUsername_(string username) : IMethod; + public partial class Contacts_ResolveUsername_ : IMethod + { + public string username; + } /// Resolve a @username to get peer info See [bots: ✓] Possible codes: 400,401 (details) /// @username to resolve public static Task Contacts_ResolveUsername(this Client client, string username) - => client.CallAsync(new Contacts_ResolveUsername_(username)); + => client.CallAsync(new Contacts_ResolveUsername_ + { + username = username, + }); [TLDef(0x973478B6)] - public record Contacts_GetTopPeers_(int flags, int offset, int limit, long hash) : IMethod; + public partial class Contacts_GetTopPeers_ : IMethod + { + public Flags flags; + public int offset; + public int limit; + public long hash; + + [Flags] public enum Flags + { + correspondents = 0x1, + bots_pm = 0x2, + bots_inline = 0x4, + phone_calls = 0x8, + forward_users = 0x10, + forward_chats = 0x20, + groups = 0x400, + channels = 0x8000, + } + } /// Get most used peers See Possible codes: 400 (details) /// Users we've chatted most frequently with /// Most used bots @@ -13124,38 +14023,73 @@ namespace TL /// Hash for pagination, for more info click here /// a null value means contacts.topPeersNotModified public static Task Contacts_GetTopPeers(this Client client, int offset, int limit, long hash, bool correspondents = false, bool bots_pm = false, bool bots_inline = false, bool phone_calls = false, bool forward_users = false, bool forward_chats = false, bool groups = false, bool channels = false) - => client.CallAsync(new Contacts_GetTopPeers_((correspondents ? 0x1 : 0) | (bots_pm ? 0x2 : 0) | (bots_inline ? 0x4 : 0) | (phone_calls ? 0x8 : 0) | (forward_users ? 0x10 : 0) | (forward_chats ? 0x20 : 0) | (groups ? 0x400 : 0) | (channels ? 0x8000 : 0), - offset, limit, hash)); + => client.CallAsync(new Contacts_GetTopPeers_ + { + flags = (Contacts_GetTopPeers_.Flags)((correspondents ? 0x1 : 0) | (bots_pm ? 0x2 : 0) | (bots_inline ? 0x4 : 0) | (phone_calls ? 0x8 : 0) | (forward_users ? 0x10 : 0) | (forward_chats ? 0x20 : 0) | (groups ? 0x400 : 0) | (channels ? 0x8000 : 0)), + offset = offset, + limit = limit, + hash = hash, + }); [TLDef(0x1AE373AC)] - public record Contacts_ResetTopPeerRating_(TopPeerCategory category, InputPeer peer) : IMethod; + public partial class Contacts_ResetTopPeerRating_ : IMethod + { + public TopPeerCategory category; + public InputPeer peer; + } /// Reset rating of top peer See Possible codes: 400 (details) /// Top peer category /// Peer whose rating should be reset public static Task Contacts_ResetTopPeerRating(this Client client, TopPeerCategory category, InputPeer peer) - => client.CallAsync(new Contacts_ResetTopPeerRating_(category, peer)); + => client.CallAsync(new Contacts_ResetTopPeerRating_ + { + category = category, + peer = peer, + }); [TLDef(0x879537F1)] - public record Contacts_ResetSaved_() : IMethod; + public partial class Contacts_ResetSaved_ : IMethod { } /// Delete saved contacts See public static Task Contacts_ResetSaved(this Client client) - => client.CallAsync(new Contacts_ResetSaved_()); + => client.CallAsync(new Contacts_ResetSaved_ + { + }); [TLDef(0x82F1E39F)] - public record Contacts_GetSaved_() : IMethod; + public partial class Contacts_GetSaved_ : IMethod { } /// Get all contacts See Possible codes: 403 (details) public static Task Contacts_GetSaved(this Client client) - => client.CallAsync(new Contacts_GetSaved_()); + => client.CallAsync(new Contacts_GetSaved_ + { + }); [TLDef(0x8514BDDA)] - public record Contacts_ToggleTopPeers_(bool enabled) : IMethod; + public partial class Contacts_ToggleTopPeers_ : IMethod + { + public bool enabled; + } /// Enable/disable top peers See /// Enable/disable public static Task Contacts_ToggleTopPeers(this Client client, bool enabled) - => client.CallAsync(new Contacts_ToggleTopPeers_(enabled)); + => client.CallAsync(new Contacts_ToggleTopPeers_ + { + enabled = enabled, + }); [TLDef(0xE8F463D0)] - public record Contacts_AddContact_(int flags, InputUserBase id, string first_name, string last_name, string phone) : IMethod; + public partial class Contacts_AddContact_ : IMethod + { + public Flags flags; + public InputUserBase id; + public string first_name; + public string last_name; + public string phone; + + [Flags] public enum Flags + { + add_phone_privacy_exception = 0x1, + } + } /// Add an existing telegram user as contact. See Possible codes: 400 (details) /// Allow the other user to see our phone number? /// Telegram ID of the other user @@ -13163,46 +14097,110 @@ namespace TL /// Last name /// User's phone number public static Task Contacts_AddContact(this Client client, InputUserBase id, string first_name, string last_name, string phone, bool add_phone_privacy_exception = false) - => client.CallAsync(new Contacts_AddContact_(add_phone_privacy_exception ? 0x1 : 0, - id, first_name, last_name, phone)); + => client.CallAsync(new Contacts_AddContact_ + { + flags = (Contacts_AddContact_.Flags)(add_phone_privacy_exception ? 0x1 : 0), + id = id, + first_name = first_name, + last_name = last_name, + phone = phone, + }); [TLDef(0xF831A20F)] - public record Contacts_AcceptContact_(InputUserBase id) : IMethod; + public partial class Contacts_AcceptContact_ : IMethod + { + public InputUserBase id; + } /// If the of a new user allow us to add him as contact, add that user as contact See Possible codes: 400 (details) /// The user to add as contact public static Task Contacts_AcceptContact(this Client client, InputUserBase id) - => client.CallAsync(new Contacts_AcceptContact_(id)); + => client.CallAsync(new Contacts_AcceptContact_ + { + id = id, + }); [TLDef(0xD348BC44)] - public record Contacts_GetLocated_(int flags, InputGeoPoint geo_point, [field:IfFlag(0)] int self_expires) : IMethod; + public partial class Contacts_GetLocated_ : IMethod + { + public Flags flags; + public InputGeoPoint geo_point; + [IfFlag(0)] public int self_expires; + + [Flags] public enum Flags + { + /// Field has a value + has_self_expires = 0x1, + background = 0x2, + } + } /// Get contacts near you See Possible codes: 400,406 (details) /// While the geolocation of the current user is public, clients should update it in the background every half-an-hour or so, while setting this flag.
Do this only if the new location is more than 1 KM away from the previous one, or if the previous location is unknown. /// Geolocation /// If set, the geolocation of the current user will be public for the specified number of seconds; pass 0x7fffffff to disable expiry, 0 to make the current geolocation private; if the flag isn't set, no changes will be applied. public static Task Contacts_GetLocated(this Client client, InputGeoPoint geo_point, bool background = false, int? self_expires = null) - => client.CallAsync(new Contacts_GetLocated_((background ? 0x2 : 0) | (self_expires != null ? 0x1 : 0), - geo_point, self_expires.GetValueOrDefault())); + => client.CallAsync(new Contacts_GetLocated_ + { + flags = (Contacts_GetLocated_.Flags)((background ? 0x2 : 0) | (self_expires != null ? 0x1 : 0)), + geo_point = geo_point, + self_expires = self_expires.GetValueOrDefault(), + }); [TLDef(0x29A8962C)] - public record Contacts_BlockFromReplies_(int flags, int msg_id) : IMethod; + public partial class Contacts_BlockFromReplies_ : IMethod + { + public Flags flags; + public int msg_id; + + [Flags] public enum Flags + { + delete_message = 0x1, + delete_history = 0x2, + report_spam = 0x4, + } + } /// Stop getting notifications about thread replies of a certain user in @replies See /// Whether to delete the specified message as well /// Whether to delete all @replies messages from this user as well /// Whether to also report this user for spam /// ID of the message in the @replies chat public static Task Contacts_BlockFromReplies(this Client client, int msg_id, bool delete_message = false, bool delete_history = false, bool report_spam = false) - => client.CallAsync(new Contacts_BlockFromReplies_((delete_message ? 0x1 : 0) | (delete_history ? 0x2 : 0) | (report_spam ? 0x4 : 0), - msg_id)); + => client.CallAsync(new Contacts_BlockFromReplies_ + { + flags = (Contacts_BlockFromReplies_.Flags)((delete_message ? 0x1 : 0) | (delete_history ? 0x2 : 0) | (report_spam ? 0x4 : 0)), + msg_id = msg_id, + }); [TLDef(0x63C66506)] - public record Messages_GetMessages_(InputMessage[] id) : IMethod; + public partial class Messages_GetMessages_ : IMethod + { + public InputMessage[] id; + } /// Returns the list of messages by their IDs. See [bots: ✓] /// Message ID list public static Task Messages_GetMessages(this Client client, InputMessage[] id) - => client.CallAsync(new Messages_GetMessages_(id)); + => client.CallAsync(new Messages_GetMessages_ + { + id = id, + }); [TLDef(0xA0F4CB4F)] - public record Messages_GetDialogs_(int flags, [field:IfFlag(1)] int folder_id, DateTime offset_date, int offset_id, InputPeer offset_peer, int limit, long hash) : IMethod; + public partial class Messages_GetDialogs_ : IMethod + { + public Flags flags; + [IfFlag(1)] public int folder_id; + public DateTime offset_date; + public int offset_id; + public InputPeer offset_peer; + public int limit; + public long hash; + + [Flags] public enum Flags + { + exclude_pinned = 0x1, + /// Field has a value + has_folder_id = 0x2, + } + } /// Returns the current user dialog list. See Possible codes: 400 (details) /// Exclude pinned dialogs /// Peer folder ID, for more info click here @@ -13212,11 +14210,29 @@ namespace TL /// Number of list elements to be returned /// Hash for pagination, for more info click here public static Task Messages_GetDialogs(this Client client, DateTime offset_date, int offset_id, InputPeer offset_peer, int limit, long hash, bool exclude_pinned = false, int? folder_id = null) - => client.CallAsync(new Messages_GetDialogs_((exclude_pinned ? 0x1 : 0) | (folder_id != null ? 0x2 : 0), - folder_id.GetValueOrDefault(), offset_date, offset_id, offset_peer, limit, hash)); + => client.CallAsync(new Messages_GetDialogs_ + { + flags = (Messages_GetDialogs_.Flags)((exclude_pinned ? 0x1 : 0) | (folder_id != null ? 0x2 : 0)), + folder_id = folder_id.GetValueOrDefault(), + offset_date = offset_date, + offset_id = offset_id, + offset_peer = offset_peer, + limit = limit, + hash = hash, + }); [TLDef(0x4423E6C5)] - public record Messages_GetHistory_(InputPeer peer, int offset_id, DateTime offset_date, int add_offset, int limit, int max_id, int min_id, long hash) : IMethod; + public partial class Messages_GetHistory_ : IMethod + { + public InputPeer peer; + public int offset_id; + public DateTime offset_date; + public int add_offset; + public int limit; + public int max_id; + public int min_id; + public long hash; + } /// Gets back the conversation history with one interlocutor / within a chat See Possible codes: 400,401 (details) /// Target peer /// Only return messages starting from the specified message ID @@ -13227,10 +14243,44 @@ namespace TL /// If a positive value was transferred, the method will return only messages with IDs more than min_id /// Result hash public static Task Messages_GetHistory(this Client client, InputPeer peer, int offset_id, DateTime offset_date, int add_offset, int limit, int max_id, int min_id, long hash) - => client.CallAsync(new Messages_GetHistory_(peer, offset_id, offset_date, add_offset, limit, max_id, min_id, hash)); + => client.CallAsync(new Messages_GetHistory_ + { + peer = peer, + offset_id = offset_id, + offset_date = offset_date, + add_offset = add_offset, + limit = limit, + max_id = max_id, + min_id = min_id, + hash = hash, + }); [TLDef(0xA0FDA762)] - public record Messages_Search_(int flags, InputPeer peer, string q, [field:IfFlag(0)] InputPeer from_id, [field:IfFlag(1)] int top_msg_id, MessagesFilter filter, DateTime min_date, DateTime max_date, int offset_id, int add_offset, int limit, int max_id, int min_id, long hash) : IMethod; + public partial class Messages_Search_ : IMethod + { + public Flags flags; + public InputPeer peer; + public string q; + [IfFlag(0)] public InputPeer from_id; + [IfFlag(1)] public int top_msg_id; + public MessagesFilter filter; + public DateTime min_date; + public DateTime max_date; + public int offset_id; + public int add_offset; + public int limit; + public int max_id; + public int min_id; + public long hash; + + [Flags] public enum Flags + { + /// Field has a value + has_from_id = 0x1, + /// Field has a value + has_top_msg_id = 0x2, + } + } /// Gets back found messages See Possible codes: 400 (details) /// User or chat, histories with which are searched, or constructor for global search /// Text search request @@ -13246,54 +14296,163 @@ namespace TL /// Minimum message ID to return /// Hash public static Task Messages_Search(this Client client, InputPeer peer, string q, MessagesFilter filter, DateTime min_date, DateTime max_date, int offset_id, int add_offset, int limit, int max_id, int min_id, long hash, InputPeer from_id = null, int? top_msg_id = null) - => client.CallAsync(new Messages_Search_((from_id != null ? 0x1 : 0) | (top_msg_id != null ? 0x2 : 0), - peer, q, from_id, top_msg_id.GetValueOrDefault(), filter, min_date, max_date, offset_id, add_offset, limit, max_id, min_id, hash)); + => client.CallAsync(new Messages_Search_ + { + flags = (Messages_Search_.Flags)((from_id != null ? 0x1 : 0) | (top_msg_id != null ? 0x2 : 0)), + peer = peer, + q = q, + from_id = from_id, + top_msg_id = top_msg_id.GetValueOrDefault(), + filter = filter, + min_date = min_date, + max_date = max_date, + offset_id = offset_id, + add_offset = add_offset, + limit = limit, + max_id = max_id, + min_id = min_id, + hash = hash, + }); [TLDef(0x0E306D3A)] - public record Messages_ReadHistory_(InputPeer peer, int max_id) : IMethod; + public partial class Messages_ReadHistory_ : IMethod + { + public InputPeer peer; + public int max_id; + } /// Marks message history as read. See Possible codes: 400 (details) /// Target user or group /// If a positive value is passed, only messages with identifiers less or equal than the given one will be read public static Task Messages_ReadHistory(this Client client, InputPeer peer, int max_id) - => client.CallAsync(new Messages_ReadHistory_(peer, max_id)); + => client.CallAsync(new Messages_ReadHistory_ + { + peer = peer, + max_id = max_id, + }); [TLDef(0xB08F922A)] - public record Messages_DeleteHistory_(int flags, InputPeer peer, int max_id, [field:IfFlag(2)] DateTime min_date, [field:IfFlag(3)] DateTime max_date) : IMethod; + public partial class Messages_DeleteHistory_ : IMethod + { + public Flags flags; + public InputPeer peer; + public int max_id; + [IfFlag(2)] public DateTime min_date; + [IfFlag(3)] public DateTime max_date; + + [Flags] public enum Flags + { + just_clear = 0x1, + revoke = 0x2, + /// Field has a value + has_min_date = 0x4, + /// Field has a value + has_max_date = 0x8, + } + } /// Deletes communication history. See Possible codes: 400 (details) /// Just clear history for the current user, without actually removing messages for every chat user /// Whether to delete the message history for all chat participants /// User or chat, communication history of which will be deleted /// Maximum ID of message to delete public static Task Messages_DeleteHistory(this Client client, InputPeer peer, int max_id, bool just_clear = false, bool revoke = false, DateTime? min_date = null, DateTime? max_date = null) - => client.CallAsync(new Messages_DeleteHistory_((just_clear ? 0x1 : 0) | (revoke ? 0x2 : 0) | (min_date != null ? 0x4 : 0) | (max_date != null ? 0x8 : 0), - peer, max_id, min_date.GetValueOrDefault(), max_date.GetValueOrDefault())); + => client.CallAsync(new Messages_DeleteHistory_ + { + flags = (Messages_DeleteHistory_.Flags)((just_clear ? 0x1 : 0) | (revoke ? 0x2 : 0) | (min_date != null ? 0x4 : 0) | (max_date != null ? 0x8 : 0)), + peer = peer, + max_id = max_id, + min_date = min_date.GetValueOrDefault(), + max_date = max_date.GetValueOrDefault(), + }); [TLDef(0xE58E95D2)] - public record Messages_DeleteMessages_(int flags, int[] id) : IMethod; + public partial class Messages_DeleteMessages_ : IMethod + { + public Flags flags; + public int[] id; + + [Flags] public enum Flags + { + revoke = 0x1, + } + } /// Deletes messages by their identifiers. See [bots: ✓] Possible codes: 403 (details) /// Whether to delete messages for all participants of the chat /// Message ID list public static Task Messages_DeleteMessages(this Client client, int[] id, bool revoke = false) - => client.CallAsync(new Messages_DeleteMessages_(revoke ? 0x1 : 0, id)); + => client.CallAsync(new Messages_DeleteMessages_ + { + flags = (Messages_DeleteMessages_.Flags)(revoke ? 0x1 : 0), + id = id, + }); [TLDef(0x05A954C0)] - public record Messages_ReceivedMessages_(int max_id) : IMethod; + public partial class Messages_ReceivedMessages_ : IMethod + { + public int max_id; + } /// Confirms receipt of messages by a client, cancels PUSH-notification sending. See /// Maximum message ID available in a client. public static Task Messages_ReceivedMessages(this Client client, int max_id) - => client.CallAsync(new Messages_ReceivedMessages_(max_id)); + => client.CallAsync(new Messages_ReceivedMessages_ + { + max_id = max_id, + }); [TLDef(0x58943EE2)] - public record Messages_SetTyping_(int flags, InputPeer peer, [field:IfFlag(0)] int top_msg_id, SendMessageAction action) : IMethod; + public partial class Messages_SetTyping_ : IMethod + { + public Flags flags; + public InputPeer peer; + [IfFlag(0)] public int top_msg_id; + public SendMessageAction action; + + [Flags] public enum Flags + { + /// Field has a value + has_top_msg_id = 0x1, + } + } /// Sends a current user typing event (see for all event types) to a conversation partner or group. See [bots: ✓] Possible codes: 400,403 (details) /// Target user or group /// Thread ID /// Type of action
Parameter added in Layer 17. public static Task Messages_SetTyping(this Client client, InputPeer peer, SendMessageAction action, int? top_msg_id = null) - => client.CallAsync(new Messages_SetTyping_(top_msg_id != null ? 0x1 : 0, peer, top_msg_id.GetValueOrDefault(), action)); + => client.CallAsync(new Messages_SetTyping_ + { + flags = (Messages_SetTyping_.Flags)(top_msg_id != null ? 0x1 : 0), + peer = peer, + top_msg_id = top_msg_id.GetValueOrDefault(), + action = action, + }); [TLDef(0x520C3870)] - public record Messages_SendMessage_(int flags, InputPeer peer, [field:IfFlag(0)] int reply_to_msg_id, string message, long random_id, [field:IfFlag(2)] ReplyMarkup reply_markup, [field:IfFlag(3)] MessageEntity[] entities, [field:IfFlag(10)] DateTime schedule_date) : IMethod; + public partial class Messages_SendMessage_ : IMethod + { + public Flags flags; + public InputPeer peer; + [IfFlag(0)] public int reply_to_msg_id; + public string message; + public long random_id; + [IfFlag(2)] public ReplyMarkup reply_markup; + [IfFlag(3)] public MessageEntity[] entities; + [IfFlag(10)] public DateTime schedule_date; + + [Flags] public enum Flags + { + /// Field has a value + has_reply_to_msg_id = 0x1, + no_webpage = 0x2, + /// Field has a value + has_reply_markup = 0x4, + /// Field has a value + has_entities = 0x8, + silent = 0x20, + background = 0x40, + clear_draft = 0x80, + /// Field has a value + has_schedule_date = 0x400, + } + } /// Sends a message to a chat See [bots: ✓] Possible codes: 400,401,403,420 (details) /// Set this flag to disable generation of the webpage preview /// Send this message silently (no notifications for the receivers) @@ -13307,11 +14466,46 @@ namespace TL /// Message entities for sending styled text /// Scheduled message date for scheduled messages public static Task Messages_SendMessage(this Client client, InputPeer peer, string message, long random_id, bool no_webpage = false, bool silent = false, bool background = false, bool clear_draft = false, int? reply_to_msg_id = null, ReplyMarkup reply_markup = null, MessageEntity[] entities = null, DateTime? schedule_date = null) - => client.CallAsync(new Messages_SendMessage_((no_webpage ? 0x2 : 0) | (silent ? 0x20 : 0) | (background ? 0x40 : 0) | (clear_draft ? 0x80 : 0) | (reply_to_msg_id != null ? 0x1 : 0) | (reply_markup != null ? 0x4 : 0) | (entities != null ? 0x8 : 0) | (schedule_date != null ? 0x400 : 0), - peer, reply_to_msg_id.GetValueOrDefault(), message, random_id, reply_markup, entities, schedule_date.GetValueOrDefault())); + => client.CallAsync(new Messages_SendMessage_ + { + flags = (Messages_SendMessage_.Flags)((no_webpage ? 0x2 : 0) | (silent ? 0x20 : 0) | (background ? 0x40 : 0) | (clear_draft ? 0x80 : 0) | (reply_to_msg_id != null ? 0x1 : 0) | (reply_markup != null ? 0x4 : 0) | (entities != null ? 0x8 : 0) | (schedule_date != null ? 0x400 : 0)), + peer = peer, + reply_to_msg_id = reply_to_msg_id.GetValueOrDefault(), + message = message, + random_id = random_id, + reply_markup = reply_markup, + entities = entities, + schedule_date = schedule_date.GetValueOrDefault(), + }); [TLDef(0x3491EBA9)] - public record Messages_SendMedia_(int flags, InputPeer peer, [field:IfFlag(0)] int reply_to_msg_id, InputMedia media, string message, long random_id, [field:IfFlag(2)] ReplyMarkup reply_markup, [field:IfFlag(3)] MessageEntity[] entities, [field:IfFlag(10)] DateTime schedule_date) : IMethod; + public partial class Messages_SendMedia_ : IMethod + { + public Flags flags; + public InputPeer peer; + [IfFlag(0)] public int reply_to_msg_id; + public InputMedia media; + public string message; + public long random_id; + [IfFlag(2)] public ReplyMarkup reply_markup; + [IfFlag(3)] public MessageEntity[] entities; + [IfFlag(10)] public DateTime schedule_date; + + [Flags] public enum Flags + { + /// Field has a value + has_reply_to_msg_id = 0x1, + /// Field has a value + has_reply_markup = 0x4, + /// Field has a value + has_entities = 0x8, + silent = 0x20, + background = 0x40, + clear_draft = 0x80, + /// Field has a value + has_schedule_date = 0x400, + } + } /// Send a media See [bots: ✓] Possible codes: 400,403,420 (details) /// Send message silently (no notification should be triggered) /// Send message in background @@ -13325,11 +14519,40 @@ namespace TL /// Message entities for styled text /// Scheduled message date for scheduled messages public static Task Messages_SendMedia(this Client client, InputPeer peer, InputMedia media, string message, long random_id, bool silent = false, bool background = false, bool clear_draft = false, int? reply_to_msg_id = null, ReplyMarkup reply_markup = null, MessageEntity[] entities = null, DateTime? schedule_date = null) - => client.CallAsync(new Messages_SendMedia_((silent ? 0x20 : 0) | (background ? 0x40 : 0) | (clear_draft ? 0x80 : 0) | (reply_to_msg_id != null ? 0x1 : 0) | (reply_markup != null ? 0x4 : 0) | (entities != null ? 0x8 : 0) | (schedule_date != null ? 0x400 : 0), - peer, reply_to_msg_id.GetValueOrDefault(), media, message, random_id, reply_markup, entities, schedule_date.GetValueOrDefault())); + => client.CallAsync(new Messages_SendMedia_ + { + flags = (Messages_SendMedia_.Flags)((silent ? 0x20 : 0) | (background ? 0x40 : 0) | (clear_draft ? 0x80 : 0) | (reply_to_msg_id != null ? 0x1 : 0) | (reply_markup != null ? 0x4 : 0) | (entities != null ? 0x8 : 0) | (schedule_date != null ? 0x400 : 0)), + peer = peer, + reply_to_msg_id = reply_to_msg_id.GetValueOrDefault(), + media = media, + message = message, + random_id = random_id, + reply_markup = reply_markup, + entities = entities, + schedule_date = schedule_date.GetValueOrDefault(), + }); [TLDef(0xD9FEE60E)] - public record Messages_ForwardMessages_(int flags, InputPeer from_peer, int[] id, long[] random_id, InputPeer to_peer, [field:IfFlag(10)] DateTime schedule_date) : IMethod; + public partial class Messages_ForwardMessages_ : IMethod + { + public Flags flags; + public InputPeer from_peer; + public int[] id; + public long[] random_id; + public InputPeer to_peer; + [IfFlag(10)] public DateTime schedule_date; + + [Flags] public enum Flags + { + silent = 0x20, + background = 0x40, + with_my_score = 0x100, + /// Field has a value + has_schedule_date = 0x400, + drop_author = 0x800, + drop_media_captions = 0x1000, + } + } /// Forwards messages by their IDs. See [bots: ✓] Possible codes: 400,403,420 (details) /// Whether to send messages silently (no notification will be triggered on the destination clients) /// Whether to send the message in background @@ -13342,151 +14565,329 @@ namespace TL /// Destination peer /// Scheduled message date for scheduled messages public static Task Messages_ForwardMessages(this Client client, InputPeer from_peer, int[] id, long[] random_id, InputPeer to_peer, bool silent = false, bool background = false, bool with_my_score = false, bool drop_author = false, bool drop_media_captions = false, DateTime? schedule_date = null) - => client.CallAsync(new Messages_ForwardMessages_((silent ? 0x20 : 0) | (background ? 0x40 : 0) | (with_my_score ? 0x100 : 0) | (drop_author ? 0x800 : 0) | (drop_media_captions ? 0x1000 : 0) | (schedule_date != null ? 0x400 : 0), - from_peer, id, random_id, to_peer, schedule_date.GetValueOrDefault())); + => client.CallAsync(new Messages_ForwardMessages_ + { + flags = (Messages_ForwardMessages_.Flags)((silent ? 0x20 : 0) | (background ? 0x40 : 0) | (with_my_score ? 0x100 : 0) | (drop_author ? 0x800 : 0) | (drop_media_captions ? 0x1000 : 0) | (schedule_date != null ? 0x400 : 0)), + from_peer = from_peer, + id = id, + random_id = random_id, + to_peer = to_peer, + schedule_date = schedule_date.GetValueOrDefault(), + }); [TLDef(0xCF1592DB)] - public record Messages_ReportSpam_(InputPeer peer) : IMethod; + public partial class Messages_ReportSpam_ : IMethod + { + public InputPeer peer; + } /// Report a new incoming chat for spam, if the of the chat allow us to do that See Possible codes: 400 (details) /// Peer to report public static Task Messages_ReportSpam(this Client client, InputPeer peer) - => client.CallAsync(new Messages_ReportSpam_(peer)); + => client.CallAsync(new Messages_ReportSpam_ + { + peer = peer, + }); [TLDef(0x3672E09C)] - public record Messages_GetPeerSettings_(InputPeer peer) : IMethod; + public partial class Messages_GetPeerSettings_ : IMethod + { + public InputPeer peer; + } /// Get peer settings See Possible codes: 400 (details) /// The peer public static Task Messages_GetPeerSettings(this Client client, InputPeer peer) - => client.CallAsync(new Messages_GetPeerSettings_(peer)); + => client.CallAsync(new Messages_GetPeerSettings_ + { + peer = peer, + }); [TLDef(0x8953AB4E)] - public record Messages_Report_(InputPeer peer, int[] id, ReportReason reason, string message) : IMethod; + public partial class Messages_Report_ : IMethod + { + public InputPeer peer; + public int[] id; + public ReportReason reason; + public string message; + } /// Report a message in a chat for violation of telegram's Terms of Service See Possible codes: 400 (details) /// Peer /// IDs of messages to report /// Why are these messages being reported /// Comment for report moderation public static Task Messages_Report(this Client client, InputPeer peer, int[] id, ReportReason reason, string message) - => client.CallAsync(new Messages_Report_(peer, id, reason, message)); + => client.CallAsync(new Messages_Report_ + { + peer = peer, + id = id, + reason = reason, + message = message, + }); [TLDef(0x49E9528F)] - public record Messages_GetChats_(long[] id) : IMethod; + public partial class Messages_GetChats_ : IMethod + { + public long[] id; + } /// Returns chat basic info on their IDs. See [bots: ✓] Possible codes: 400 (details) /// List of chat IDs public static Task Messages_GetChats(this Client client, long[] id) - => client.CallAsync(new Messages_GetChats_(id)); + => client.CallAsync(new Messages_GetChats_ + { + id = id, + }); [TLDef(0xAEB00B34)] - public record Messages_GetFullChat_(long chat_id) : IMethod; + public partial class Messages_GetFullChat_ : IMethod + { + public long chat_id; + } /// Returns full chat info according to its ID. See [bots: ✓] Possible codes: 400 (details) /// Chat ID public static Task Messages_GetFullChat(this Client client, long chat_id) - => client.CallAsync(new Messages_GetFullChat_(chat_id)); + => client.CallAsync(new Messages_GetFullChat_ + { + chat_id = chat_id, + }); [TLDef(0x73783FFD)] - public record Messages_EditChatTitle_(long chat_id, string title) : IMethod; + public partial class Messages_EditChatTitle_ : IMethod + { + public long chat_id; + public string title; + } /// Chanages chat name and sends a service message on it. See [bots: ✓] Possible codes: 400 (details) /// Chat ID /// New chat name, different from the old one public static Task Messages_EditChatTitle(this Client client, long chat_id, string title) - => client.CallAsync(new Messages_EditChatTitle_(chat_id, title)); + => client.CallAsync(new Messages_EditChatTitle_ + { + chat_id = chat_id, + title = title, + }); [TLDef(0x35DDD674)] - public record Messages_EditChatPhoto_(long chat_id, InputChatPhotoBase photo) : IMethod; + public partial class Messages_EditChatPhoto_ : IMethod + { + public long chat_id; + public InputChatPhotoBase photo; + } /// Changes chat photo and sends a service message on it See [bots: ✓] Possible codes: 400 (details) /// Chat ID /// Photo to be set public static Task Messages_EditChatPhoto(this Client client, long chat_id, InputChatPhotoBase photo) - => client.CallAsync(new Messages_EditChatPhoto_(chat_id, photo)); + => client.CallAsync(new Messages_EditChatPhoto_ + { + chat_id = chat_id, + photo = photo, + }); [TLDef(0xF24753E3)] - public record Messages_AddChatUser_(long chat_id, InputUserBase user_id, int fwd_limit) : IMethod; + public partial class Messages_AddChatUser_ : IMethod + { + public long chat_id; + public InputUserBase user_id; + public int fwd_limit; + } /// Adds a user to a chat and sends a service message on it. See Possible codes: 400,403 (details) /// Chat ID /// User ID to be added /// Number of last messages to be forwarded public static Task Messages_AddChatUser(this Client client, long chat_id, InputUserBase user_id, int fwd_limit) - => client.CallAsync(new Messages_AddChatUser_(chat_id, user_id, fwd_limit)); + => client.CallAsync(new Messages_AddChatUser_ + { + chat_id = chat_id, + user_id = user_id, + fwd_limit = fwd_limit, + }); [TLDef(0xA2185CAB)] - public record Messages_DeleteChatUser_(int flags, long chat_id, InputUserBase user_id) : IMethod; + public partial class Messages_DeleteChatUser_ : IMethod + { + public Flags flags; + public long chat_id; + public InputUserBase user_id; + + [Flags] public enum Flags + { + revoke_history = 0x1, + } + } /// Deletes a user from a chat and sends a service message on it. See [bots: ✓] Possible codes: 400 (details) /// Remove the entire chat history of the specified user in this chat. /// Chat ID /// User ID to be deleted public static Task Messages_DeleteChatUser(this Client client, long chat_id, InputUserBase user_id, bool revoke_history = false) - => client.CallAsync(new Messages_DeleteChatUser_(revoke_history ? 0x1 : 0, chat_id, user_id)); + => client.CallAsync(new Messages_DeleteChatUser_ + { + flags = (Messages_DeleteChatUser_.Flags)(revoke_history ? 0x1 : 0), + chat_id = chat_id, + user_id = user_id, + }); [TLDef(0x09CB126E)] - public record Messages_CreateChat_(InputUserBase[] users, string title) : IMethod; + public partial class Messages_CreateChat_ : IMethod + { + public InputUserBase[] users; + public string title; + } /// Creates a new chat. See Possible codes: 400,403 (details) /// List of user IDs to be invited /// Chat name public static Task Messages_CreateChat(this Client client, InputUserBase[] users, string title) - => client.CallAsync(new Messages_CreateChat_(users, title)); + => client.CallAsync(new Messages_CreateChat_ + { + users = users, + title = title, + }); [TLDef(0x26CF8950)] - public record Messages_GetDhConfig_(int version, int random_length) : IMethod; + public partial class Messages_GetDhConfig_ : IMethod + { + public int version; + public int random_length; + } /// Returns configuration parameters for Diffie-Hellman key generation. Can also return a random sequence of bytes of required length. See Possible codes: 400 (details) /// Value of the version parameter from , avialable at the client /// Length of the required random sequence public static Task Messages_GetDhConfig(this Client client, int version, int random_length) - => client.CallAsync(new Messages_GetDhConfig_(version, random_length)); + => client.CallAsync(new Messages_GetDhConfig_ + { + version = version, + random_length = random_length, + }); [TLDef(0xF64DAF43)] - public record Messages_RequestEncryption_(InputUserBase user_id, int random_id, byte[] g_a) : IMethod; + public partial class Messages_RequestEncryption_ : IMethod + { + public InputUserBase user_id; + public int random_id; + public byte[] g_a; + } /// Sends a request to start a secret chat to the user. See Possible codes: 400 (details) /// User ID /// Unique client request ID required to prevent resending. This also doubles as the chat ID. /// A = g ^ a mod p, see Wikipedia public static Task Messages_RequestEncryption(this Client client, InputUserBase user_id, int random_id, byte[] g_a) - => client.CallAsync(new Messages_RequestEncryption_(user_id, random_id, g_a)); + => client.CallAsync(new Messages_RequestEncryption_ + { + user_id = user_id, + random_id = random_id, + g_a = g_a, + }); [TLDef(0x3DBC0415)] - public record Messages_AcceptEncryption_(InputEncryptedChat peer, byte[] g_b, long key_fingerprint) : IMethod; + public partial class Messages_AcceptEncryption_ : IMethod + { + public InputEncryptedChat peer; + public byte[] g_b; + public long key_fingerprint; + } /// Confirms creation of a secret chat See Possible codes: 400 (details) /// Secret chat ID /// B = g ^ b mod p, see Wikipedia /// 64-bit fingerprint of the received key public static Task Messages_AcceptEncryption(this Client client, InputEncryptedChat peer, byte[] g_b, long key_fingerprint) - => client.CallAsync(new Messages_AcceptEncryption_(peer, g_b, key_fingerprint)); + => client.CallAsync(new Messages_AcceptEncryption_ + { + peer = peer, + g_b = g_b, + key_fingerprint = key_fingerprint, + }); [TLDef(0xF393AEA0)] - public record Messages_DiscardEncryption_(int flags, int chat_id) : IMethod; + public partial class Messages_DiscardEncryption_ : IMethod + { + public Flags flags; + public int chat_id; + + [Flags] public enum Flags + { + delete_history = 0x1, + } + } /// Cancels a request for creation and/or delete info on secret chat. See Possible codes: 400 (details) /// Whether to delete the entire chat history for the other user as well /// Secret chat ID public static Task Messages_DiscardEncryption(this Client client, int chat_id, bool delete_history = false) - => client.CallAsync(new Messages_DiscardEncryption_(delete_history ? 0x1 : 0, chat_id)); + => client.CallAsync(new Messages_DiscardEncryption_ + { + flags = (Messages_DiscardEncryption_.Flags)(delete_history ? 0x1 : 0), + chat_id = chat_id, + }); [TLDef(0x791451ED)] - public record Messages_SetEncryptedTyping_(InputEncryptedChat peer, bool typing) : IMethod; + public partial class Messages_SetEncryptedTyping_ : IMethod + { + public InputEncryptedChat peer; + public bool typing; + } /// Send typing event by the current user to a secret chat. See Possible codes: 400 (details) /// Secret chat ID /// Typing.
Possible values:
, if the user started typing and more than 5 seconds have passed since the last request
, if the user stopped typing public static Task Messages_SetEncryptedTyping(this Client client, InputEncryptedChat peer, bool typing) - => client.CallAsync(new Messages_SetEncryptedTyping_(peer, typing)); + => client.CallAsync(new Messages_SetEncryptedTyping_ + { + peer = peer, + typing = typing, + }); [TLDef(0x7F4B690A)] - public record Messages_ReadEncryptedHistory_(InputEncryptedChat peer, DateTime max_date) : IMethod; + public partial class Messages_ReadEncryptedHistory_ : IMethod + { + public InputEncryptedChat peer; + public DateTime max_date; + } /// Marks message history within a secret chat as read. See Possible codes: 400 (details) /// Secret chat ID /// Maximum date value for received messages in history public static Task Messages_ReadEncryptedHistory(this Client client, InputEncryptedChat peer, DateTime max_date) - => client.CallAsync(new Messages_ReadEncryptedHistory_(peer, max_date)); + => client.CallAsync(new Messages_ReadEncryptedHistory_ + { + peer = peer, + max_date = max_date, + }); [TLDef(0x44FA7A15)] - public record Messages_SendEncrypted_(int flags, InputEncryptedChat peer, long random_id, byte[] data) : IMethod; + public partial class Messages_SendEncrypted_ : IMethod + { + public Flags flags; + public InputEncryptedChat peer; + public long random_id; + public byte[] data; + + [Flags] public enum Flags + { + silent = 0x1, + } + } /// 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 /// 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.CallAsync(new Messages_SendEncrypted_(silent ? 0x1 : 0, peer, random_id, data)); + => client.CallAsync(new Messages_SendEncrypted_ + { + flags = (Messages_SendEncrypted_.Flags)(silent ? 0x1 : 0), + peer = peer, + random_id = random_id, + data = data, + }); [TLDef(0x5559481D)] - public record Messages_SendEncryptedFile_(int flags, InputEncryptedChat peer, long random_id, byte[] data, InputEncryptedFileBase file) : IMethod; + public partial class Messages_SendEncryptedFile_ : IMethod + { + public Flags flags; + public InputEncryptedChat peer; + public long random_id; + public byte[] data; + public InputEncryptedFileBase file; + + [Flags] public enum Flags + { + silent = 0x1, + } + } /// 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 @@ -13494,148 +14895,326 @@ namespace TL /// 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) - => client.CallAsync(new Messages_SendEncryptedFile_(silent ? 0x1 : 0, peer, random_id, data, file)); + => client.CallAsync(new Messages_SendEncryptedFile_ + { + flags = (Messages_SendEncryptedFile_.Flags)(silent ? 0x1 : 0), + peer = peer, + random_id = random_id, + data = data, + file = file, + }); [TLDef(0x32D439A4)] - public record Messages_SendEncryptedService_(InputEncryptedChat peer, long random_id, byte[] data) : IMethod; + public partial class Messages_SendEncryptedService_ : IMethod + { + public InputEncryptedChat peer; + public long random_id; + public byte[] data; + } /// 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 /// 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.CallAsync(new Messages_SendEncryptedService_(peer, random_id, data)); + => client.CallAsync(new Messages_SendEncryptedService_ + { + peer = peer, + random_id = random_id, + data = data, + }); [TLDef(0x55A5BB66)] - public record Messages_ReceivedQueue_(int max_qts) : IMethod; + public partial class Messages_ReceivedQueue_ : IMethod + { + public int max_qts; + } /// Confirms receipt of messages in a secret chat by client, cancels push notifications. See Possible codes: 400 (details) /// Maximum qts value available at the client public static Task Messages_ReceivedQueue(this Client client, int max_qts) - => client.CallAsync(new Messages_ReceivedQueue_(max_qts)); + => client.CallAsync(new Messages_ReceivedQueue_ + { + max_qts = max_qts, + }); [TLDef(0x4B0C8C0F)] - public record Messages_ReportEncryptedSpam_(InputEncryptedChat peer) : IMethod; + public partial class Messages_ReportEncryptedSpam_ : IMethod + { + public InputEncryptedChat peer; + } /// Report a secret chat for spam See Possible codes: 400 (details) /// The secret chat to report public static Task Messages_ReportEncryptedSpam(this Client client, InputEncryptedChat peer) - => client.CallAsync(new Messages_ReportEncryptedSpam_(peer)); + => client.CallAsync(new Messages_ReportEncryptedSpam_ + { + peer = peer, + }); [TLDef(0x36A73F77)] - public record Messages_ReadMessageContents_(int[] id) : IMethod; + public partial class Messages_ReadMessageContents_ : IMethod + { + public int[] id; + } /// Notifies the sender about the recipient having listened a voice message or watched a video. See /// Message ID list public static Task Messages_ReadMessageContents(this Client client, int[] id) - => client.CallAsync(new Messages_ReadMessageContents_(id)); + => client.CallAsync(new Messages_ReadMessageContents_ + { + id = id, + }); [TLDef(0xD5A5D3A1)] - public record Messages_GetStickers_(string emoticon, long hash) : IMethod; + public partial class Messages_GetStickers_ : IMethod + { + public string emoticon; + public long hash; + } /// Get stickers by emoji See Possible codes: 400 (details) /// The emoji /// Hash for pagination, for more info click here /// a null value means messages.stickersNotModified public static Task Messages_GetStickers(this Client client, string emoticon, long hash) - => client.CallAsync(new Messages_GetStickers_(emoticon, hash)); + => client.CallAsync(new Messages_GetStickers_ + { + emoticon = emoticon, + hash = hash, + }); [TLDef(0xB8A0A1A8)] - public record Messages_GetAllStickers_(long hash) : IMethod; + public partial class Messages_GetAllStickers_ : IMethod + { + public long hash; + } /// Get all installed stickers See /// Hash for pagination, for more info click here /// a null value means messages.allStickersNotModified public static Task Messages_GetAllStickers(this Client client, long hash) - => client.CallAsync(new Messages_GetAllStickers_(hash)); + => client.CallAsync(new Messages_GetAllStickers_ + { + hash = hash, + }); [TLDef(0x8B68B0CC)] - public record Messages_GetWebPagePreview_(int flags, string message, [field:IfFlag(3)] MessageEntity[] entities) : IMethod; + public partial class Messages_GetWebPagePreview_ : IMethod + { + public Flags flags; + public string message; + [IfFlag(3)] public MessageEntity[] entities; + + [Flags] public enum Flags + { + /// Field has a value + has_entities = 0x8, + } + } /// Get preview of webpage See Possible codes: 400 (details) /// Message from which to extract the preview /// Message entities for styled text /// a null value means messageMediaEmpty public static Task Messages_GetWebPagePreview(this Client client, string message, MessageEntity[] entities = null) - => client.CallAsync(new Messages_GetWebPagePreview_(entities != null ? 0x8 : 0, message, entities)); + => client.CallAsync(new Messages_GetWebPagePreview_ + { + flags = (Messages_GetWebPagePreview_.Flags)(entities != null ? 0x8 : 0), + message = message, + entities = entities, + }); [TLDef(0xA02CE5D5)] - public record Messages_ExportChatInvite_(int flags, InputPeer peer, [field:IfFlag(0)] DateTime expire_date, [field:IfFlag(1)] int usage_limit, [field:IfFlag(4)] string title) : IMethod; + public partial class Messages_ExportChatInvite_ : IMethod + { + public Flags flags; + public InputPeer peer; + [IfFlag(0)] public DateTime expire_date; + [IfFlag(1)] public int usage_limit; + [IfFlag(4)] public string title; + + [Flags] public enum Flags + { + /// Field has a value + has_expire_date = 0x1, + /// Field has a value + has_usage_limit = 0x2, + legacy_revoke_permanent = 0x4, + request_needed = 0x8, + /// Field has a value + has_title = 0x10, + } + } /// Export an invite link for a chat See [bots: ✓] Possible codes: 400,403 (details) /// Legacy flag, reproducing legacy behavior of this method: if set, revokes all previous links before creating a new one. Kept for bot API BC, should not be used by modern clients. /// Chat /// Expiration date /// Maximum number of users that can join using this link public static Task Messages_ExportChatInvite(this Client client, InputPeer peer, bool legacy_revoke_permanent = false, bool request_needed = false, DateTime? expire_date = null, int? usage_limit = null, string title = null) - => client.CallAsync(new Messages_ExportChatInvite_((legacy_revoke_permanent ? 0x4 : 0) | (request_needed ? 0x8 : 0) | (expire_date != null ? 0x1 : 0) | (usage_limit != null ? 0x2 : 0) | (title != null ? 0x10 : 0), - peer, expire_date.GetValueOrDefault(), usage_limit.GetValueOrDefault(), title)); + => client.CallAsync(new Messages_ExportChatInvite_ + { + flags = (Messages_ExportChatInvite_.Flags)((legacy_revoke_permanent ? 0x4 : 0) | (request_needed ? 0x8 : 0) | (expire_date != null ? 0x1 : 0) | (usage_limit != null ? 0x2 : 0) | (title != null ? 0x10 : 0)), + peer = peer, + expire_date = expire_date.GetValueOrDefault(), + usage_limit = usage_limit.GetValueOrDefault(), + title = title, + }); [TLDef(0x3EADB1BB)] - public record Messages_CheckChatInvite_(string hash) : IMethod; + public partial class Messages_CheckChatInvite_ : IMethod + { + public string hash; + } /// Check the validity of a chat invite link and get basic info about it See Possible codes: 400 (details) /// Invite hash in t.me/joinchat/hash public static Task Messages_CheckChatInvite(this Client client, string hash) - => client.CallAsync(new Messages_CheckChatInvite_(hash)); + => client.CallAsync(new Messages_CheckChatInvite_ + { + hash = hash, + }); [TLDef(0x6C50051C)] - public record Messages_ImportChatInvite_(string hash) : IMethod; + public partial class Messages_ImportChatInvite_ : IMethod + { + public string hash; + } /// Import a chat invite and join a private chat/supergroup/channel See Possible codes: 400 (details) /// hash from t.me/joinchat/hash public static Task Messages_ImportChatInvite(this Client client, string hash) - => client.CallAsync(new Messages_ImportChatInvite_(hash)); + => client.CallAsync(new Messages_ImportChatInvite_ + { + hash = hash, + }); [TLDef(0x2619A90E)] - public record Messages_GetStickerSet_(InputStickerSet stickerset) : IMethod; + public partial class Messages_GetStickerSet_ : IMethod + { + public InputStickerSet stickerset; + } /// Get info about a stickerset See [bots: ✓] Possible codes: 400 (details) /// Stickerset public static Task Messages_GetStickerSet(this Client client, InputStickerSet stickerset) - => client.CallAsync(new Messages_GetStickerSet_(stickerset)); + => client.CallAsync(new Messages_GetStickerSet_ + { + stickerset = stickerset, + }); [TLDef(0xC78FE460)] - public record Messages_InstallStickerSet_(InputStickerSet stickerset, bool archived) : IMethod; + public partial class Messages_InstallStickerSet_ : IMethod + { + public InputStickerSet stickerset; + public bool archived; + } /// Install a stickerset See Possible codes: 400 (details) /// Stickerset to install /// Whether to archive stickerset public static Task Messages_InstallStickerSet(this Client client, InputStickerSet stickerset, bool archived) - => client.CallAsync(new Messages_InstallStickerSet_(stickerset, archived)); + => client.CallAsync(new Messages_InstallStickerSet_ + { + stickerset = stickerset, + archived = archived, + }); [TLDef(0xF96E55DE)] - public record Messages_UninstallStickerSet_(InputStickerSet stickerset) : IMethod; + public partial class Messages_UninstallStickerSet_ : IMethod + { + public InputStickerSet stickerset; + } /// Uninstall a stickerset See Possible codes: 400 (details) /// The stickerset to uninstall public static Task Messages_UninstallStickerSet(this Client client, InputStickerSet stickerset) - => client.CallAsync(new Messages_UninstallStickerSet_(stickerset)); + => client.CallAsync(new Messages_UninstallStickerSet_ + { + stickerset = stickerset, + }); [TLDef(0xE6DF7378)] - public record Messages_StartBot_(InputUserBase bot, InputPeer peer, long random_id, string start_param) : IMethod; + public partial class Messages_StartBot_ : IMethod + { + public InputUserBase bot; + public InputPeer peer; + public long random_id; + public string start_param; + } /// Start a conversation with a bot using a deep linking parameter See Possible codes: 400 (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 /// Deep linking parameter public static Task Messages_StartBot(this Client client, InputUserBase bot, InputPeer peer, long random_id, string start_param) - => client.CallAsync(new Messages_StartBot_(bot, peer, random_id, start_param)); + => client.CallAsync(new Messages_StartBot_ + { + bot = bot, + peer = peer, + random_id = random_id, + start_param = start_param, + }); [TLDef(0x5784D3E1)] - public record Messages_GetMessagesViews_(InputPeer peer, int[] id, bool increment) : IMethod; + public partial class Messages_GetMessagesViews_ : IMethod + { + public InputPeer peer; + public int[] id; + public bool increment; + } /// Get and increase the view counter of a message sent or forwarded from a channel See Possible codes: 400 (details) /// Peer where the message was found /// ID of message /// Whether to mark the message as viewed and increment the view counter public static Task Messages_GetMessagesViews(this Client client, InputPeer peer, int[] id, bool increment) - => client.CallAsync(new Messages_GetMessagesViews_(peer, id, increment)); + => client.CallAsync(new Messages_GetMessagesViews_ + { + peer = peer, + id = id, + increment = increment, + }); [TLDef(0xA85BD1C2)] - public record Messages_EditChatAdmin_(long chat_id, InputUserBase user_id, bool is_admin) : IMethod; + public partial class Messages_EditChatAdmin_ : IMethod + { + public long chat_id; + public InputUserBase user_id; + public bool is_admin; + } /// Make a user admin in a legacy group. See Possible codes: 400 (details) /// The ID of the group /// The user to make admin /// Whether to make him admin public static Task Messages_EditChatAdmin(this Client client, long chat_id, InputUserBase user_id, bool is_admin) - => client.CallAsync(new Messages_EditChatAdmin_(chat_id, user_id, is_admin)); + => client.CallAsync(new Messages_EditChatAdmin_ + { + chat_id = chat_id, + user_id = user_id, + is_admin = is_admin, + }); [TLDef(0xA2875319)] - public record Messages_MigrateChat_(long chat_id) : IMethod; + public partial class Messages_MigrateChat_ : IMethod + { + public long chat_id; + } /// Turn a legacy group into a supergroup See Possible codes: 400,403 (details) /// Legacy group to migrate public static Task Messages_MigrateChat(this Client client, long chat_id) - => client.CallAsync(new Messages_MigrateChat_(chat_id)); + => client.CallAsync(new Messages_MigrateChat_ + { + chat_id = chat_id, + }); [TLDef(0x4BC6589A)] - public record Messages_SearchGlobal_(int flags, [field:IfFlag(0)] int folder_id, string q, MessagesFilter filter, DateTime min_date, DateTime max_date, int offset_rate, InputPeer offset_peer, int offset_id, int limit) : IMethod; + public partial class Messages_SearchGlobal_ : IMethod + { + public Flags flags; + [IfFlag(0)] public int folder_id; + public string q; + public MessagesFilter filter; + public DateTime min_date; + public DateTime max_date; + public int offset_rate; + public InputPeer offset_peer; + public int offset_id; + public int limit; + + [Flags] public enum Flags + { + /// Field has a value + has_folder_id = 0x1, + } + } /// Search for messages and peers globally See Possible codes: 400 (details) /// Peer folder ID, for more info click here /// Query @@ -13647,43 +15226,106 @@ namespace TL /// Offsets for pagination, for more info click here /// Offsets for pagination, for more info click here public static Task Messages_SearchGlobal(this Client client, string q, MessagesFilter filter, DateTime min_date, DateTime max_date, int offset_rate, InputPeer offset_peer, int offset_id, int limit, int? folder_id = null) - => client.CallAsync(new Messages_SearchGlobal_(folder_id != null ? 0x1 : 0, folder_id.GetValueOrDefault(), q, filter, min_date, max_date, offset_rate, offset_peer, offset_id, limit)); + => client.CallAsync(new Messages_SearchGlobal_ + { + flags = (Messages_SearchGlobal_.Flags)(folder_id != null ? 0x1 : 0), + folder_id = folder_id.GetValueOrDefault(), + q = q, + filter = filter, + min_date = min_date, + max_date = max_date, + offset_rate = offset_rate, + offset_peer = offset_peer, + offset_id = offset_id, + limit = limit, + }); [TLDef(0x78337739)] - public record Messages_ReorderStickerSets_(int flags, long[] order) : IMethod; + public partial class Messages_ReorderStickerSets_ : IMethod + { + public Flags flags; + public long[] order; + + [Flags] public enum Flags + { + masks = 0x1, + } + } /// Reorder installed stickersets See /// Reorder mask stickersets /// New stickerset order by stickerset IDs public static Task Messages_ReorderStickerSets(this Client client, long[] order, bool masks = false) - => client.CallAsync(new Messages_ReorderStickerSets_(masks ? 0x1 : 0, order)); + => client.CallAsync(new Messages_ReorderStickerSets_ + { + flags = (Messages_ReorderStickerSets_.Flags)(masks ? 0x1 : 0), + order = order, + }); [TLDef(0x338E2464)] - public record Messages_GetDocumentByHash_(byte[] sha256, int size, string mime_type) : IMethod; + public partial class Messages_GetDocumentByHash_ : IMethod + { + public byte[] sha256; + public int size; + public string mime_type; + } /// Get a document by its SHA256 hash, mainly used for gifs See [bots: ✓] Possible codes: 400 (details) /// SHA256 of file /// Size of the file in bytes /// Mime type public static Task Messages_GetDocumentByHash(this Client client, byte[] sha256, int size, string mime_type) - => client.CallAsync(new Messages_GetDocumentByHash_(sha256, size, mime_type)); + => client.CallAsync(new Messages_GetDocumentByHash_ + { + sha256 = sha256, + size = size, + mime_type = mime_type, + }); [TLDef(0x5CF09635)] - public record Messages_GetSavedGifs_(long hash) : IMethod; + public partial class Messages_GetSavedGifs_ : IMethod + { + public long hash; + } /// Get saved GIFs See /// Hash for pagination, for more info click here /// a null value means messages.savedGifsNotModified public static Task Messages_GetSavedGifs(this Client client, long hash) - => client.CallAsync(new Messages_GetSavedGifs_(hash)); + => client.CallAsync(new Messages_GetSavedGifs_ + { + hash = hash, + }); [TLDef(0x327A30CB)] - public record Messages_SaveGif_(InputDocument id, bool unsave) : IMethod; + public partial class Messages_SaveGif_ : IMethod + { + public InputDocument id; + public bool unsave; + } /// Add GIF to saved gifs list See Possible codes: 400 (details) /// GIF to save /// Whether to remove GIF from saved gifs list public static Task Messages_SaveGif(this Client client, InputDocument id, bool unsave) - => client.CallAsync(new Messages_SaveGif_(id, unsave)); + => client.CallAsync(new Messages_SaveGif_ + { + id = id, + unsave = unsave, + }); [TLDef(0x514E999D)] - public record Messages_GetInlineBotResults_(int flags, InputUserBase bot, InputPeer peer, [field:IfFlag(0)] InputGeoPoint geo_point, string query, string offset) : IMethod; + public partial class Messages_GetInlineBotResults_ : IMethod + { + public Flags flags; + public InputUserBase bot; + public InputPeer peer; + [IfFlag(0)] public InputGeoPoint geo_point; + public string query; + public string offset; + + [Flags] public enum Flags + { + /// Field has a value + has_geo_point = 0x1, + } + } /// Query an inline bot See Possible codes: -503,400 (details) /// The bot to query /// The currently opened chat @@ -13691,10 +15333,36 @@ namespace TL /// The query /// The offset within the results, will be passed directly as-is to the bot. public static Task Messages_GetInlineBotResults(this Client client, InputUserBase bot, InputPeer peer, string query, string offset, InputGeoPoint geo_point = null) - => client.CallAsync(new Messages_GetInlineBotResults_(geo_point != null ? 0x1 : 0, bot, peer, geo_point, query, offset)); + => client.CallAsync(new Messages_GetInlineBotResults_ + { + flags = (Messages_GetInlineBotResults_.Flags)(geo_point != null ? 0x1 : 0), + bot = bot, + peer = peer, + geo_point = geo_point, + query = query, + offset = offset, + }); [TLDef(0xEB5EA206)] - public record Messages_SetInlineBotResults_(int flags, long query_id, InputBotInlineResultBase[] results, DateTime cache_time, [field:IfFlag(2)] string next_offset, [field:IfFlag(3)] InlineBotSwitchPM switch_pm) : IMethod; + public partial class Messages_SetInlineBotResults_ : IMethod + { + public Flags flags; + public long query_id; + public InputBotInlineResultBase[] results; + public DateTime cache_time; + [IfFlag(2)] public string next_offset; + [IfFlag(3)] public InlineBotSwitchPM switch_pm; + + [Flags] public enum Flags + { + gallery = 0x1, + private_ = 0x2, + /// Field has a value + has_next_offset = 0x4, + /// Field has a value + has_switch_pm = 0x8, + } + } /// Answer an inline query, for bots only See [bots: ✓] Possible codes: 400,403 (details) /// Set this flag if the results are composed of media files /// Set this flag if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query @@ -13704,11 +15372,39 @@ namespace TL /// Pass the offset that a client should send in the next query with the same text to receive more results. Pass an empty string if there are no more results or if you don‘t support pagination. Offset length can’t exceed 64 bytes. /// If passed, clients will display a button with specified text that switches the user to a private chat with the bot and sends the bot a start message with a certain parameter. public static Task Messages_SetInlineBotResults(this Client client, long query_id, InputBotInlineResultBase[] results, DateTime cache_time, bool gallery = false, bool private_ = false, string next_offset = null, InlineBotSwitchPM switch_pm = null) - => client.CallAsync(new Messages_SetInlineBotResults_((gallery ? 0x1 : 0) | (private_ ? 0x2 : 0) | (next_offset != null ? 0x4 : 0) | (switch_pm != null ? 0x8 : 0), - query_id, results, cache_time, next_offset, switch_pm)); + => client.CallAsync(new Messages_SetInlineBotResults_ + { + flags = (Messages_SetInlineBotResults_.Flags)((gallery ? 0x1 : 0) | (private_ ? 0x2 : 0) | (next_offset != null ? 0x4 : 0) | (switch_pm != null ? 0x8 : 0)), + query_id = query_id, + results = results, + cache_time = cache_time, + next_offset = next_offset, + switch_pm = switch_pm, + }); [TLDef(0x220815B0)] - public record Messages_SendInlineBotResult_(int flags, InputPeer peer, [field:IfFlag(0)] int reply_to_msg_id, long random_id, long query_id, string id, [field:IfFlag(10)] DateTime schedule_date) : IMethod; + public partial class Messages_SendInlineBotResult_ : IMethod + { + public Flags flags; + public InputPeer peer; + [IfFlag(0)] public int reply_to_msg_id; + public long random_id; + public long query_id; + public string id; + [IfFlag(10)] public DateTime schedule_date; + + [Flags] public enum Flags + { + /// Field has a value + has_reply_to_msg_id = 0x1, + silent = 0x20, + background = 0x40, + clear_draft = 0x80, + /// Field has a value + has_schedule_date = 0x400, + hide_via = 0x800, + } + } /// Send a result obtained using messages.getInlineBotResults. See Possible codes: 400,403,420 (details) /// Whether to send the message silently (no notification will be triggered on the other client) /// Whether to send the message in background @@ -13721,19 +15417,60 @@ namespace TL /// Result ID from messages.getInlineBotResults /// Scheduled message date for scheduled messages public static Task Messages_SendInlineBotResult(this Client client, InputPeer peer, long random_id, long query_id, string id, bool silent = false, bool background = false, bool clear_draft = false, bool hide_via = false, int? reply_to_msg_id = null, DateTime? schedule_date = null) - => client.CallAsync(new Messages_SendInlineBotResult_((silent ? 0x20 : 0) | (background ? 0x40 : 0) | (clear_draft ? 0x80 : 0) | (hide_via ? 0x800 : 0) | (reply_to_msg_id != null ? 0x1 : 0) | (schedule_date != null ? 0x400 : 0), - peer, reply_to_msg_id.GetValueOrDefault(), random_id, query_id, id, schedule_date.GetValueOrDefault())); + => client.CallAsync(new Messages_SendInlineBotResult_ + { + flags = (Messages_SendInlineBotResult_.Flags)((silent ? 0x20 : 0) | (background ? 0x40 : 0) | (clear_draft ? 0x80 : 0) | (hide_via ? 0x800 : 0) | (reply_to_msg_id != null ? 0x1 : 0) | (schedule_date != null ? 0x400 : 0)), + peer = peer, + reply_to_msg_id = reply_to_msg_id.GetValueOrDefault(), + random_id = random_id, + query_id = query_id, + id = id, + schedule_date = schedule_date.GetValueOrDefault(), + }); [TLDef(0xFDA68D36)] - public record Messages_GetMessageEditData_(InputPeer peer, int id) : IMethod; + public partial class Messages_GetMessageEditData_ : IMethod + { + public InputPeer peer; + public int id; + } /// Find out if a media message's caption can be edited See Possible codes: 400,403 (details) /// Peer where the media was sent /// ID of message public static Task Messages_GetMessageEditData(this Client client, InputPeer peer, int id) - => client.CallAsync(new Messages_GetMessageEditData_(peer, id)); + => client.CallAsync(new Messages_GetMessageEditData_ + { + peer = peer, + id = id, + }); [TLDef(0x48F71778)] - public record Messages_EditMessage_(int flags, InputPeer peer, int id, [field:IfFlag(11)] string message, [field:IfFlag(14)] InputMedia media, [field:IfFlag(2)] ReplyMarkup reply_markup, [field:IfFlag(3)] MessageEntity[] entities, [field:IfFlag(15)] DateTime schedule_date) : IMethod; + public partial class Messages_EditMessage_ : IMethod + { + public Flags flags; + public InputPeer peer; + public int id; + [IfFlag(11)] public string message; + [IfFlag(14)] public InputMedia media; + [IfFlag(2)] public ReplyMarkup reply_markup; + [IfFlag(3)] public MessageEntity[] entities; + [IfFlag(15)] public DateTime schedule_date; + + [Flags] public enum Flags + { + no_webpage = 0x2, + /// Field has a value + has_reply_markup = 0x4, + /// Field has a value + has_entities = 0x8, + /// Field has a value + has_message = 0x800, + /// Field has a value + has_media = 0x4000, + /// Field has a value + has_schedule_date = 0x8000, + } + } /// Edit message See [bots: ✓] Possible codes: 400,403 (details) /// Disable webpage preview /// Where was the message sent @@ -13744,11 +15481,41 @@ namespace TL /// Message entities for styled text /// Scheduled message date for scheduled messages public static Task Messages_EditMessage(this Client client, InputPeer peer, int id, bool no_webpage = false, string message = null, InputMedia media = null, ReplyMarkup reply_markup = null, MessageEntity[] entities = null, DateTime? schedule_date = null) - => client.CallAsync(new Messages_EditMessage_((no_webpage ? 0x2 : 0) | (message != null ? 0x800 : 0) | (media != null ? 0x4000 : 0) | (reply_markup != null ? 0x4 : 0) | (entities != null ? 0x8 : 0) | (schedule_date != null ? 0x8000 : 0), - peer, id, message, media, reply_markup, entities, schedule_date.GetValueOrDefault())); + => client.CallAsync(new Messages_EditMessage_ + { + flags = (Messages_EditMessage_.Flags)((no_webpage ? 0x2 : 0) | (message != null ? 0x800 : 0) | (media != null ? 0x4000 : 0) | (reply_markup != null ? 0x4 : 0) | (entities != null ? 0x8 : 0) | (schedule_date != null ? 0x8000 : 0)), + peer = peer, + id = id, + message = message, + media = media, + reply_markup = reply_markup, + entities = entities, + schedule_date = schedule_date.GetValueOrDefault(), + }); [TLDef(0x83557DBA)] - public record Messages_EditInlineBotMessage_(int flags, InputBotInlineMessageIDBase id, [field:IfFlag(11)] string message, [field:IfFlag(14)] InputMedia media, [field:IfFlag(2)] ReplyMarkup reply_markup, [field:IfFlag(3)] MessageEntity[] entities) : IMethod; + public partial class Messages_EditInlineBotMessage_ : IMethod + { + public Flags flags; + public InputBotInlineMessageIDBase id; + [IfFlag(11)] public string message; + [IfFlag(14)] public InputMedia media; + [IfFlag(2)] public ReplyMarkup reply_markup; + [IfFlag(3)] public MessageEntity[] entities; + + [Flags] public enum Flags + { + no_webpage = 0x2, + /// Field has a value + has_reply_markup = 0x4, + /// Field has a value + has_entities = 0x8, + /// Field has a value + has_message = 0x800, + /// Field has a value + has_media = 0x4000, + } + } /// Edit an inline bot message See [bots: ✓] Possible codes: 400 (details) /// Disable webpage preview /// Sent inline message ID @@ -13757,11 +15524,34 @@ namespace TL /// Reply markup for inline keyboards /// Message entities for styled text public static Task Messages_EditInlineBotMessage(this Client client, InputBotInlineMessageIDBase id, bool no_webpage = false, string message = null, InputMedia media = null, ReplyMarkup reply_markup = null, MessageEntity[] entities = null) - => client.CallAsync(new Messages_EditInlineBotMessage_((no_webpage ? 0x2 : 0) | (message != null ? 0x800 : 0) | (media != null ? 0x4000 : 0) | (reply_markup != null ? 0x4 : 0) | (entities != null ? 0x8 : 0), - id, message, media, reply_markup, entities)); + => client.CallAsync(new Messages_EditInlineBotMessage_ + { + flags = (Messages_EditInlineBotMessage_.Flags)((no_webpage ? 0x2 : 0) | (message != null ? 0x800 : 0) | (media != null ? 0x4000 : 0) | (reply_markup != null ? 0x4 : 0) | (entities != null ? 0x8 : 0)), + id = id, + message = message, + media = media, + reply_markup = reply_markup, + entities = entities, + }); [TLDef(0x9342CA07)] - public record Messages_GetBotCallbackAnswer_(int flags, InputPeer peer, int msg_id, [field:IfFlag(0)] byte[] data, [field:IfFlag(2)] InputCheckPasswordSRP password) : IMethod; + public partial class Messages_GetBotCallbackAnswer_ : IMethod + { + public Flags flags; + public InputPeer peer; + public int msg_id; + [IfFlag(0)] public byte[] data; + [IfFlag(2)] public InputCheckPasswordSRP password; + + [Flags] public enum Flags + { + /// Field has a value + has_data = 0x1, + game = 0x2, + /// Field has a value + has_password = 0x4, + } + } /// Press an inline callback button and get a callback answer from the bot See Possible codes: -503,400 (details) /// Whether this is a "play game" button /// Where was the inline keyboard sent @@ -13769,11 +15559,33 @@ namespace TL /// Callback data /// For buttons , the SRP payload generated using SRP. public static Task Messages_GetBotCallbackAnswer(this Client client, InputPeer peer, int msg_id, bool game = false, byte[] data = null, InputCheckPasswordSRP password = null) - => client.CallAsync(new Messages_GetBotCallbackAnswer_((game ? 0x2 : 0) | (data != null ? 0x1 : 0) | (password != null ? 0x4 : 0), - peer, msg_id, data, password)); + => client.CallAsync(new Messages_GetBotCallbackAnswer_ + { + flags = (Messages_GetBotCallbackAnswer_.Flags)((game ? 0x2 : 0) | (data != null ? 0x1 : 0) | (password != null ? 0x4 : 0)), + peer = peer, + msg_id = msg_id, + data = data, + password = password, + }); [TLDef(0xD58F130A)] - public record Messages_SetBotCallbackAnswer_(int flags, long query_id, [field:IfFlag(0)] string message, [field:IfFlag(2)] string url, DateTime cache_time) : IMethod; + public partial class Messages_SetBotCallbackAnswer_ : IMethod + { + public Flags flags; + public long query_id; + [IfFlag(0)] public string message; + [IfFlag(2)] public string url; + public DateTime cache_time; + + [Flags] public enum Flags + { + /// Field has a value + has_message = 0x1, + alert = 0x2, + /// Field has a value + has_url = 0x4, + } + } /// Set the callback answer to a user button press (bots only) See [bots: ✓] Possible codes: 400 (details) /// Whether to show the message as a popup instead of a toast notification /// Query ID @@ -13781,18 +15593,46 @@ namespace TL /// URL to open /// Cache validity public static Task Messages_SetBotCallbackAnswer(this Client client, long query_id, DateTime cache_time, bool alert = false, string message = null, string url = null) - => client.CallAsync(new Messages_SetBotCallbackAnswer_((alert ? 0x2 : 0) | (message != null ? 0x1 : 0) | (url != null ? 0x4 : 0), - query_id, message, url, cache_time)); + => client.CallAsync(new Messages_SetBotCallbackAnswer_ + { + flags = (Messages_SetBotCallbackAnswer_.Flags)((alert ? 0x2 : 0) | (message != null ? 0x1 : 0) | (url != null ? 0x4 : 0)), + query_id = query_id, + message = message, + url = url, + cache_time = cache_time, + }); [TLDef(0xE470BCFD)] - public record Messages_GetPeerDialogs_(InputDialogPeerBase[] peers) : IMethod; + public partial class Messages_GetPeerDialogs_ : IMethod + { + public InputDialogPeerBase[] peers; + } /// Get dialog info of specified peers See Possible codes: 400 (details) /// Peers public static Task Messages_GetPeerDialogs(this Client client, InputDialogPeerBase[] peers) - => client.CallAsync(new Messages_GetPeerDialogs_(peers)); + => client.CallAsync(new Messages_GetPeerDialogs_ + { + peers = peers, + }); [TLDef(0xBC39E14B)] - public record Messages_SaveDraft_(int flags, [field:IfFlag(0)] int reply_to_msg_id, InputPeer peer, string message, [field:IfFlag(3)] MessageEntity[] entities) : IMethod; + public partial class Messages_SaveDraft_ : IMethod + { + public Flags flags; + [IfFlag(0)] public int reply_to_msg_id; + public InputPeer peer; + public string message; + [IfFlag(3)] public MessageEntity[] entities; + + [Flags] public enum Flags + { + /// Field has a value + has_reply_to_msg_id = 0x1, + no_webpage = 0x2, + /// Field has a value + has_entities = 0x8, + } + } /// Save a message draft associated to a chat. See Possible codes: 400 (details) /// Disable generation of the webpage preview /// Message ID the message should reply to @@ -13800,80 +15640,179 @@ namespace TL /// The draft /// Message entities for styled text public static Task Messages_SaveDraft(this Client client, InputPeer peer, string message, bool no_webpage = false, int? reply_to_msg_id = null, MessageEntity[] entities = null) - => client.CallAsync(new Messages_SaveDraft_((no_webpage ? 0x2 : 0) | (reply_to_msg_id != null ? 0x1 : 0) | (entities != null ? 0x8 : 0), - reply_to_msg_id.GetValueOrDefault(), peer, message, entities)); + => client.CallAsync(new Messages_SaveDraft_ + { + flags = (Messages_SaveDraft_.Flags)((no_webpage ? 0x2 : 0) | (reply_to_msg_id != null ? 0x1 : 0) | (entities != null ? 0x8 : 0)), + reply_to_msg_id = reply_to_msg_id.GetValueOrDefault(), + peer = peer, + message = message, + entities = entities, + }); [TLDef(0x6A3F8D65)] - public record Messages_GetAllDrafts_() : IMethod; + public partial class Messages_GetAllDrafts_ : IMethod { } /// Save get all message drafts. See public static Task Messages_GetAllDrafts(this Client client) - => client.CallAsync(new Messages_GetAllDrafts_()); + => client.CallAsync(new Messages_GetAllDrafts_ + { + }); [TLDef(0x64780B14)] - public record Messages_GetFeaturedStickers_(long hash) : IMethod; + public partial class Messages_GetFeaturedStickers_ : IMethod + { + public long hash; + } /// Get featured stickers See /// Hash for pagination, for more info click here public static Task Messages_GetFeaturedStickers(this Client client, long hash) - => client.CallAsync(new Messages_GetFeaturedStickers_(hash)); + => client.CallAsync(new Messages_GetFeaturedStickers_ + { + hash = hash, + }); [TLDef(0x5B118126)] - public record Messages_ReadFeaturedStickers_(long[] id) : IMethod; + public partial class Messages_ReadFeaturedStickers_ : IMethod + { + public long[] id; + } /// Mark new featured stickers as read See /// IDs of stickersets to mark as read public static Task Messages_ReadFeaturedStickers(this Client client, long[] id) - => client.CallAsync(new Messages_ReadFeaturedStickers_(id)); + => client.CallAsync(new Messages_ReadFeaturedStickers_ + { + id = id, + }); [TLDef(0x9DA9403B)] - public record Messages_GetRecentStickers_(int flags, long hash) : IMethod; + public partial class Messages_GetRecentStickers_ : IMethod + { + public Flags flags; + public long hash; + + [Flags] public enum Flags + { + attached = 0x1, + } + } /// Get recent stickers See /// Get stickers recently attached to photo or video files /// Hash for pagination, for more info click here /// a null value means messages.recentStickersNotModified public static Task Messages_GetRecentStickers(this Client client, long hash, bool attached = false) - => client.CallAsync(new Messages_GetRecentStickers_(attached ? 0x1 : 0, hash)); + => client.CallAsync(new Messages_GetRecentStickers_ + { + flags = (Messages_GetRecentStickers_.Flags)(attached ? 0x1 : 0), + hash = hash, + }); [TLDef(0x392718F8)] - public record Messages_SaveRecentSticker_(int flags, InputDocument id, bool unsave) : IMethod; + public partial class Messages_SaveRecentSticker_ : IMethod + { + public Flags flags; + public InputDocument id; + public bool unsave; + + [Flags] public enum Flags + { + attached = 0x1, + } + } /// Add/remove sticker from recent stickers list See Possible codes: 400 (details) /// Whether to add/remove stickers recently attached to photo or video files /// Sticker /// Whether to save or unsave the sticker public static Task Messages_SaveRecentSticker(this Client client, InputDocument id, bool unsave, bool attached = false) - => client.CallAsync(new Messages_SaveRecentSticker_(attached ? 0x1 : 0, id, unsave)); + => client.CallAsync(new Messages_SaveRecentSticker_ + { + flags = (Messages_SaveRecentSticker_.Flags)(attached ? 0x1 : 0), + id = id, + unsave = unsave, + }); [TLDef(0x8999602D)] - public record Messages_ClearRecentStickers_(int flags) : IMethod; + public partial class Messages_ClearRecentStickers_ : IMethod + { + public Flags flags; + + [Flags] public enum Flags + { + attached = 0x1, + } + } /// Clear recent stickers See /// Set this flag to clear the list of stickers recently attached to photo or video files public static Task Messages_ClearRecentStickers(this Client client, bool attached = false) - => client.CallAsync(new Messages_ClearRecentStickers_(attached ? 0x1 : 0)); + => client.CallAsync(new Messages_ClearRecentStickers_ + { + flags = (Messages_ClearRecentStickers_.Flags)(attached ? 0x1 : 0), + }); [TLDef(0x57F17692)] - public record Messages_GetArchivedStickers_(int flags, long offset_id, int limit) : IMethod; + public partial class Messages_GetArchivedStickers_ : IMethod + { + public Flags flags; + public long offset_id; + public int limit; + + [Flags] public enum Flags + { + masks = 0x1, + } + } /// Get all archived stickers See /// Get mask stickers /// Offsets for pagination, for more info click here /// Maximum number of results to return, see pagination public static Task Messages_GetArchivedStickers(this Client client, long offset_id, int limit, bool masks = false) - => client.CallAsync(new Messages_GetArchivedStickers_(masks ? 0x1 : 0, offset_id, limit)); + => client.CallAsync(new Messages_GetArchivedStickers_ + { + flags = (Messages_GetArchivedStickers_.Flags)(masks ? 0x1 : 0), + offset_id = offset_id, + limit = limit, + }); [TLDef(0x640F82B8)] - public record Messages_GetMaskStickers_(long hash) : IMethod; + public partial class Messages_GetMaskStickers_ : IMethod + { + public long hash; + } /// Get installed mask stickers See /// Hash for pagination, for more info click here /// a null value means messages.allStickersNotModified public static Task Messages_GetMaskStickers(this Client client, long hash) - => client.CallAsync(new Messages_GetMaskStickers_(hash)); + => client.CallAsync(new Messages_GetMaskStickers_ + { + hash = hash, + }); [TLDef(0xCC5B67CC)] - public record Messages_GetAttachedStickers_(InputStickeredMedia media) : IMethod; + public partial class Messages_GetAttachedStickers_ : IMethod + { + public InputStickeredMedia media; + } /// Get stickers attached to a photo or video See /// Stickered media public static Task Messages_GetAttachedStickers(this Client client, InputStickeredMedia media) - => client.CallAsync(new Messages_GetAttachedStickers_(media)); + => client.CallAsync(new Messages_GetAttachedStickers_ + { + media = media, + }); [TLDef(0x8EF8ECC0)] - public record Messages_SetGameScore_(int flags, InputPeer peer, int id, InputUserBase user_id, int score) : IMethod; + public partial class Messages_SetGameScore_ : IMethod + { + public Flags flags; + public InputPeer peer; + public int id; + public InputUserBase user_id; + public int score; + + [Flags] public enum Flags + { + edit_message = 0x1, + force = 0x2, + } + } /// Use this method to set the score of the specified user in a game sent as a normal message (bots only). See [bots: ✓] Possible codes: 400 (details) /// Set this flag if the game message should be automatically edited to include the current scoreboard /// Set this flag if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters @@ -13882,11 +15821,29 @@ namespace TL /// User identifier /// New score public static Task Messages_SetGameScore(this Client client, InputPeer peer, int id, InputUserBase user_id, int score, bool edit_message = false, bool force = false) - => client.CallAsync(new Messages_SetGameScore_((edit_message ? 0x1 : 0) | (force ? 0x2 : 0), - peer, id, user_id, score)); + => client.CallAsync(new Messages_SetGameScore_ + { + flags = (Messages_SetGameScore_.Flags)((edit_message ? 0x1 : 0) | (force ? 0x2 : 0)), + peer = peer, + id = id, + user_id = user_id, + score = score, + }); [TLDef(0x15AD9F64)] - public record Messages_SetInlineGameScore_(int flags, InputBotInlineMessageIDBase id, InputUserBase user_id, int score) : IMethod; + public partial class Messages_SetInlineGameScore_ : IMethod + { + public Flags flags; + public InputBotInlineMessageIDBase id; + public InputUserBase user_id; + public int score; + + [Flags] public enum Flags + { + edit_message = 0x1, + force = 0x2, + } + } /// Use this method to set the score of the specified user in a game sent as an inline message (bots only). See [bots: ✓] Possible codes: 400 (details) /// Set this flag if the game message should be automatically edited to include the current scoreboard /// Set this flag if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters @@ -13894,130 +15851,286 @@ namespace TL /// User identifier /// New score public static Task Messages_SetInlineGameScore(this Client client, InputBotInlineMessageIDBase id, InputUserBase user_id, int score, bool edit_message = false, bool force = false) - => client.CallAsync(new Messages_SetInlineGameScore_((edit_message ? 0x1 : 0) | (force ? 0x2 : 0), - id, user_id, score)); + => client.CallAsync(new Messages_SetInlineGameScore_ + { + flags = (Messages_SetInlineGameScore_.Flags)((edit_message ? 0x1 : 0) | (force ? 0x2 : 0)), + id = id, + user_id = user_id, + score = score, + }); [TLDef(0xE822649D)] - public record Messages_GetGameHighScores_(InputPeer peer, int id, InputUserBase user_id) : IMethod; + public partial class Messages_GetGameHighScores_ : IMethod + { + public InputPeer peer; + public int id; + public InputUserBase user_id; + } /// Get highscores of a game See [bots: ✓] Possible codes: 400 (details) /// Where was the game sent /// ID of message with game media attachment /// Get high scores made by a certain user public static Task Messages_GetGameHighScores(this Client client, InputPeer peer, int id, InputUserBase user_id) - => client.CallAsync(new Messages_GetGameHighScores_(peer, id, user_id)); + => client.CallAsync(new Messages_GetGameHighScores_ + { + peer = peer, + id = id, + user_id = user_id, + }); [TLDef(0x0F635E1B)] - public record Messages_GetInlineGameHighScores_(InputBotInlineMessageIDBase id, InputUserBase user_id) : IMethod; + public partial class Messages_GetInlineGameHighScores_ : IMethod + { + public InputBotInlineMessageIDBase id; + public InputUserBase user_id; + } /// Get highscores of a game sent using an inline bot See [bots: ✓] Possible codes: 400 (details) /// ID of inline message /// Get high scores of a certain user public static Task Messages_GetInlineGameHighScores(this Client client, InputBotInlineMessageIDBase id, InputUserBase user_id) - => client.CallAsync(new Messages_GetInlineGameHighScores_(id, user_id)); + => client.CallAsync(new Messages_GetInlineGameHighScores_ + { + id = id, + user_id = user_id, + }); [TLDef(0xE40CA104)] - public record Messages_GetCommonChats_(InputUserBase user_id, long max_id, int limit) : IMethod; + public partial class Messages_GetCommonChats_ : IMethod + { + public InputUserBase user_id; + public long max_id; + public int limit; + } /// Get chats in common with a user See Possible codes: 400 (details) /// User ID /// Maximum ID of chat to return (see pagination) /// Maximum number of results to return, see pagination public static Task Messages_GetCommonChats(this Client client, InputUserBase user_id, long max_id, int limit) - => client.CallAsync(new Messages_GetCommonChats_(user_id, max_id, limit)); + => client.CallAsync(new Messages_GetCommonChats_ + { + user_id = user_id, + max_id = max_id, + limit = limit, + }); [TLDef(0x875F74BE)] - public record Messages_GetAllChats_(long[] except_ids) : IMethod; + public partial class Messages_GetAllChats_ : IMethod + { + public long[] except_ids; + } /// Get all chats, channels and supergroups See /// Except these chats/channels/supergroups public static Task Messages_GetAllChats(this Client client, long[] except_ids) - => client.CallAsync(new Messages_GetAllChats_(except_ids)); + => client.CallAsync(new Messages_GetAllChats_ + { + except_ids = except_ids, + }); [TLDef(0x32CA8F91)] - public record Messages_GetWebPage_(string url, int hash) : IMethod; + public partial class Messages_GetWebPage_ : IMethod + { + public string url; + public int hash; + } /// Get instant view page See Possible codes: 400 (details) /// URL of IV page to fetch /// Hash for pagination, for more info click here public static Task Messages_GetWebPage(this Client client, string url, int hash) - => client.CallAsync(new Messages_GetWebPage_(url, hash)); + => client.CallAsync(new Messages_GetWebPage_ + { + url = url, + hash = hash, + }); [TLDef(0xA731E257)] - public record Messages_ToggleDialogPin_(int flags, InputDialogPeerBase peer) : IMethod; + public partial class Messages_ToggleDialogPin_ : IMethod + { + public Flags flags; + public InputDialogPeerBase peer; + + [Flags] public enum Flags + { + pinned = 0x1, + } + } /// Pin/unpin a dialog See Possible codes: 400 (details) /// Whether to pin or unpin the dialog /// The dialog to pin public static Task Messages_ToggleDialogPin(this Client client, InputDialogPeerBase peer, bool pinned = false) - => client.CallAsync(new Messages_ToggleDialogPin_(pinned ? 0x1 : 0, peer)); + => client.CallAsync(new Messages_ToggleDialogPin_ + { + flags = (Messages_ToggleDialogPin_.Flags)(pinned ? 0x1 : 0), + peer = peer, + }); [TLDef(0x3B1ADF37)] - public record Messages_ReorderPinnedDialogs_(int flags, int folder_id, InputDialogPeerBase[] order) : IMethod; + public partial class Messages_ReorderPinnedDialogs_ : IMethod + { + public Flags flags; + public int folder_id; + public InputDialogPeerBase[] order; + + [Flags] public enum Flags + { + force = 0x1, + } + } /// Reorder pinned dialogs See Possible codes: 400 (details) /// If set, dialogs pinned server-side but not present in the order field will be unpinned. /// Peer folder ID, for more info click here /// New dialog order public static Task Messages_ReorderPinnedDialogs(this Client client, int folder_id, InputDialogPeerBase[] order, bool force = false) - => client.CallAsync(new Messages_ReorderPinnedDialogs_(force ? 0x1 : 0, folder_id, order)); + => client.CallAsync(new Messages_ReorderPinnedDialogs_ + { + flags = (Messages_ReorderPinnedDialogs_.Flags)(force ? 0x1 : 0), + folder_id = folder_id, + order = order, + }); [TLDef(0xD6B94DF2)] - public record Messages_GetPinnedDialogs_(int folder_id) : IMethod; + public partial class Messages_GetPinnedDialogs_ : IMethod + { + public int folder_id; + } /// Get pinned dialogs See Possible codes: 400 (details) /// Peer folder ID, for more info click here public static Task Messages_GetPinnedDialogs(this Client client, int folder_id) - => client.CallAsync(new Messages_GetPinnedDialogs_(folder_id)); + => client.CallAsync(new Messages_GetPinnedDialogs_ + { + folder_id = folder_id, + }); [TLDef(0xE5F672FA)] - public record Messages_SetBotShippingResults_(int flags, long query_id, [field:IfFlag(0)] string error, [field:IfFlag(1)] ShippingOption[] shipping_options) : IMethod; + public partial class Messages_SetBotShippingResults_ : IMethod + { + public Flags flags; + public long query_id; + [IfFlag(0)] public string error; + [IfFlag(1)] public ShippingOption[] shipping_options; + + [Flags] public enum Flags + { + /// Field has a value + has_error = 0x1, + /// Field has a value + has_shipping_options = 0x2, + } + } /// If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the bot will receive an update. Use this method to reply to shipping queries. See [bots: ✓] Possible codes: 400 (details) /// Unique identifier for the query to be answered /// Error message in human readable form that explains why it is impossible to complete the order (e.g. "Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user. /// A vector of available shipping options. public static Task Messages_SetBotShippingResults(this Client client, long query_id, string error = null, ShippingOption[] shipping_options = null) - => client.CallAsync(new Messages_SetBotShippingResults_((error != null ? 0x1 : 0) | (shipping_options != null ? 0x2 : 0), - query_id, error, shipping_options)); + => client.CallAsync(new Messages_SetBotShippingResults_ + { + flags = (Messages_SetBotShippingResults_.Flags)((error != null ? 0x1 : 0) | (shipping_options != null ? 0x2 : 0)), + query_id = query_id, + error = error, + shipping_options = shipping_options, + }); [TLDef(0x09C2DD95)] - public record Messages_SetBotPrecheckoutResults_(int flags, long query_id, [field:IfFlag(0)] string error) : IMethod; + public partial class Messages_SetBotPrecheckoutResults_ : IMethod + { + public Flags flags; + public long query_id; + [IfFlag(0)] public string error; + + [Flags] public enum Flags + { + /// Field has a value + has_error = 0x1, + success = 0x2, + } + } /// Once the user has confirmed their payment and shipping details, the bot receives an update.
Use this method to respond to such pre-checkout queries.
Note: Telegram must receive an answer within 10 seconds after the pre-checkout query was sent. See [bots: ✓] Possible codes: 400 (details)
/// Set this flag if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order, otherwise do not set it, and set the error field, instead /// Unique identifier for the query to be answered /// Required if the success isn't set. Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user. public static Task Messages_SetBotPrecheckoutResults(this Client client, long query_id, bool success = false, string error = null) - => client.CallAsync(new Messages_SetBotPrecheckoutResults_((success ? 0x2 : 0) | (error != null ? 0x1 : 0), - query_id, error)); + => client.CallAsync(new Messages_SetBotPrecheckoutResults_ + { + flags = (Messages_SetBotPrecheckoutResults_.Flags)((success ? 0x2 : 0) | (error != null ? 0x1 : 0)), + query_id = query_id, + error = error, + }); [TLDef(0x519BC2B1)] - public record Messages_UploadMedia_(InputPeer peer, InputMedia media) : IMethod; + public partial class Messages_UploadMedia_ : IMethod + { + public InputPeer peer; + public InputMedia media; + } /// Upload a file and associate it to a chat (without actually sending it to the chat) See [bots: ✓] Possible codes: 400,403 (details) /// The chat, can be an for bots /// File uploaded in chunks as described in files » /// a null value means messageMediaEmpty public static Task Messages_UploadMedia(this Client client, InputPeer peer, InputMedia media) - => client.CallAsync(new Messages_UploadMedia_(peer, media)); + => client.CallAsync(new Messages_UploadMedia_ + { + peer = peer, + media = media, + }); [TLDef(0xC97DF020)] - public record Messages_SendScreenshotNotification_(InputPeer peer, int reply_to_msg_id, long random_id) : IMethod; + public partial class Messages_SendScreenshotNotification_ : IMethod + { + public InputPeer peer; + public int reply_to_msg_id; + public long random_id; + } /// 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 public static Task Messages_SendScreenshotNotification(this Client client, InputPeer peer, int reply_to_msg_id, long random_id) - => client.CallAsync(new Messages_SendScreenshotNotification_(peer, reply_to_msg_id, random_id)); + => client.CallAsync(new Messages_SendScreenshotNotification_ + { + peer = peer, + reply_to_msg_id = reply_to_msg_id, + random_id = random_id, + }); [TLDef(0x04F1AAA9)] - public record Messages_GetFavedStickers_(long hash) : IMethod; + public partial class Messages_GetFavedStickers_ : IMethod + { + public long hash; + } /// Get faved stickers See /// Hash for pagination, for more info click here /// a null value means messages.favedStickersNotModified public static Task Messages_GetFavedStickers(this Client client, long hash) - => client.CallAsync(new Messages_GetFavedStickers_(hash)); + => client.CallAsync(new Messages_GetFavedStickers_ + { + hash = hash, + }); [TLDef(0xB9FFC55B)] - public record Messages_FaveSticker_(InputDocument id, bool unfave) : IMethod; + public partial class Messages_FaveSticker_ : IMethod + { + public InputDocument id; + public bool unfave; + } /// Mark a sticker as favorite See Possible codes: 400 (details) /// Sticker to mark as favorite /// Unfavorite public static Task Messages_FaveSticker(this Client client, InputDocument id, bool unfave) - => client.CallAsync(new Messages_FaveSticker_(id, unfave)); + => client.CallAsync(new Messages_FaveSticker_ + { + id = id, + unfave = unfave, + }); [TLDef(0x46578472)] - public record Messages_GetUnreadMentions_(InputPeer peer, int offset_id, int add_offset, int limit, int max_id, int min_id) : IMethod; + public partial class Messages_GetUnreadMentions_ : IMethod + { + public InputPeer peer; + public int offset_id; + public int add_offset; + public int limit; + public int max_id; + public int min_id; + } /// Get unread messages where we were mentioned See Possible codes: 400 (details) /// Peer where to look for mentions /// Offsets for pagination, for more info click here @@ -14026,26 +16139,68 @@ namespace TL /// Maximum message ID to return, see pagination /// Minimum message ID to return, see pagination public static Task Messages_GetUnreadMentions(this Client client, InputPeer peer, int offset_id, int add_offset, int limit, int max_id, int min_id) - => client.CallAsync(new Messages_GetUnreadMentions_(peer, offset_id, add_offset, limit, max_id, min_id)); + => client.CallAsync(new Messages_GetUnreadMentions_ + { + peer = peer, + offset_id = offset_id, + add_offset = add_offset, + limit = limit, + max_id = max_id, + min_id = min_id, + }); [TLDef(0x0F0189D3)] - public record Messages_ReadMentions_(InputPeer peer) : IMethod; + public partial class Messages_ReadMentions_ : IMethod + { + public InputPeer peer; + } /// Mark mentions as read See Possible codes: 400 (details) /// Dialog public static Task Messages_ReadMentions(this Client client, InputPeer peer) - => client.CallAsync(new Messages_ReadMentions_(peer)); + => client.CallAsync(new Messages_ReadMentions_ + { + peer = peer, + }); [TLDef(0x702A40E0)] - public record Messages_GetRecentLocations_(InputPeer peer, int limit, long hash) : IMethod; + public partial class Messages_GetRecentLocations_ : IMethod + { + public InputPeer peer; + public int limit; + public long hash; + } /// Get live location history of a certain user See /// User /// Maximum number of results to return, see pagination /// Hash for pagination, for more info click here public static Task Messages_GetRecentLocations(this Client client, InputPeer peer, int limit, long hash) - => client.CallAsync(new Messages_GetRecentLocations_(peer, limit, hash)); + => client.CallAsync(new Messages_GetRecentLocations_ + { + peer = peer, + limit = limit, + hash = hash, + }); [TLDef(0xCC0110CB)] - public record Messages_SendMultiMedia_(int flags, InputPeer peer, [field:IfFlag(0)] int reply_to_msg_id, InputSingleMedia[] multi_media, [field:IfFlag(10)] DateTime schedule_date) : IMethod; + public partial class Messages_SendMultiMedia_ : IMethod + { + public Flags flags; + public InputPeer peer; + [IfFlag(0)] public int reply_to_msg_id; + public InputSingleMedia[] multi_media; + [IfFlag(10)] public DateTime schedule_date; + + [Flags] public enum Flags + { + /// Field has a value + has_reply_to_msg_id = 0x1, + silent = 0x20, + background = 0x40, + clear_draft = 0x80, + /// Field has a value + has_schedule_date = 0x400, + } + } /// Send an album or grouped media See [bots: ✓] Possible codes: 400,420 (details) /// Whether to send the album silently (no notification triggered) /// Send in background? @@ -14055,56 +16210,116 @@ namespace TL /// The medias to send /// Scheduled message date for scheduled messages public static Task Messages_SendMultiMedia(this Client client, InputPeer peer, InputSingleMedia[] multi_media, bool silent = false, bool background = false, bool clear_draft = false, int? reply_to_msg_id = null, DateTime? schedule_date = null) - => client.CallAsync(new Messages_SendMultiMedia_((silent ? 0x20 : 0) | (background ? 0x40 : 0) | (clear_draft ? 0x80 : 0) | (reply_to_msg_id != null ? 0x1 : 0) | (schedule_date != null ? 0x400 : 0), - peer, reply_to_msg_id.GetValueOrDefault(), multi_media, schedule_date.GetValueOrDefault())); + => client.CallAsync(new Messages_SendMultiMedia_ + { + flags = (Messages_SendMultiMedia_.Flags)((silent ? 0x20 : 0) | (background ? 0x40 : 0) | (clear_draft ? 0x80 : 0) | (reply_to_msg_id != null ? 0x1 : 0) | (schedule_date != null ? 0x400 : 0)), + peer = peer, + reply_to_msg_id = reply_to_msg_id.GetValueOrDefault(), + multi_media = multi_media, + schedule_date = schedule_date.GetValueOrDefault(), + }); [TLDef(0x5057C497)] - public record Messages_UploadEncryptedFile_(InputEncryptedChat peer, InputEncryptedFileBase file) : IMethod; + public partial class Messages_UploadEncryptedFile_ : IMethod + { + public InputEncryptedChat peer; + public InputEncryptedFileBase file; + } /// Upload encrypted file and associate it to a secret chat See /// The secret chat to associate the file to /// The file /// a null value means encryptedFileEmpty public static Task Messages_UploadEncryptedFile(this Client client, InputEncryptedChat peer, InputEncryptedFileBase file) - => client.CallAsync(new Messages_UploadEncryptedFile_(peer, file)); + => client.CallAsync(new Messages_UploadEncryptedFile_ + { + peer = peer, + file = file, + }); [TLDef(0x35705B8A)] - public record Messages_SearchStickerSets_(int flags, string q, long hash) : IMethod; + public partial class Messages_SearchStickerSets_ : IMethod + { + public Flags flags; + public string q; + public long hash; + + [Flags] public enum Flags + { + exclude_featured = 0x1, + } + } /// Search for stickersets See /// Exclude featured stickersets from results /// Query string /// Hash for pagination, for more info click here /// a null value means messages.foundStickerSetsNotModified public static Task Messages_SearchStickerSets(this Client client, string q, long hash, bool exclude_featured = false) - => client.CallAsync(new Messages_SearchStickerSets_(exclude_featured ? 0x1 : 0, q, hash)); + => client.CallAsync(new Messages_SearchStickerSets_ + { + flags = (Messages_SearchStickerSets_.Flags)(exclude_featured ? 0x1 : 0), + q = q, + hash = hash, + }); [TLDef(0x1CFF7E08)] - public record Messages_GetSplitRanges_() : IMethod; + public partial class Messages_GetSplitRanges_ : IMethod { } /// Get message ranges for saving the user's chat history See public static Task Messages_GetSplitRanges(this Client client) - => client.CallAsync(new Messages_GetSplitRanges_()); + => client.CallAsync(new Messages_GetSplitRanges_ + { + }); [TLDef(0xC286D98F)] - public record Messages_MarkDialogUnread_(int flags, InputDialogPeerBase peer) : IMethod; + public partial class Messages_MarkDialogUnread_ : IMethod + { + public Flags flags; + public InputDialogPeerBase peer; + + [Flags] public enum Flags + { + unread = 0x1, + } + } /// Manually mark dialog as unread See /// Mark as unread/read /// Dialog public static Task Messages_MarkDialogUnread(this Client client, InputDialogPeerBase peer, bool unread = false) - => client.CallAsync(new Messages_MarkDialogUnread_(unread ? 0x1 : 0, peer)); + => client.CallAsync(new Messages_MarkDialogUnread_ + { + flags = (Messages_MarkDialogUnread_.Flags)(unread ? 0x1 : 0), + peer = peer, + }); [TLDef(0x22E24E22)] - public record Messages_GetDialogUnreadMarks_() : IMethod; + public partial class Messages_GetDialogUnreadMarks_ : IMethod { } /// Get dialogs manually marked as unread See public static Task Messages_GetDialogUnreadMarks(this Client client) - => client.CallAsync(new Messages_GetDialogUnreadMarks_()); + => client.CallAsync(new Messages_GetDialogUnreadMarks_ + { + }); [TLDef(0x7E58EE9C)] - public record Messages_ClearAllDrafts_() : IMethod; + public partial class Messages_ClearAllDrafts_ : IMethod { } /// Clear all drafts. See public static Task Messages_ClearAllDrafts(this Client client) - => client.CallAsync(new Messages_ClearAllDrafts_()); + => client.CallAsync(new Messages_ClearAllDrafts_ + { + }); [TLDef(0xD2AAF7EC)] - public record Messages_UpdatePinnedMessage_(int flags, InputPeer peer, int id) : IMethod; + public partial class Messages_UpdatePinnedMessage_ : IMethod + { + public Flags flags; + public InputPeer peer; + public int id; + + [Flags] public enum Flags + { + silent = 0x1, + unpin = 0x2, + pm_oneside = 0x4, + } + } /// Pin a message See [bots: ✓] Possible codes: 400,403 (details) /// Pin the message silently, without triggering a notification /// Whether the message should unpinned or pinned @@ -14112,99 +16327,214 @@ namespace TL /// The peer where to pin the message /// The message to pin or unpin public static Task Messages_UpdatePinnedMessage(this Client client, InputPeer peer, int id, bool silent = false, bool unpin = false, bool pm_oneside = false) - => client.CallAsync(new Messages_UpdatePinnedMessage_((silent ? 0x1 : 0) | (unpin ? 0x2 : 0) | (pm_oneside ? 0x4 : 0), - peer, id)); + => client.CallAsync(new Messages_UpdatePinnedMessage_ + { + flags = (Messages_UpdatePinnedMessage_.Flags)((silent ? 0x1 : 0) | (unpin ? 0x2 : 0) | (pm_oneside ? 0x4 : 0)), + peer = peer, + id = id, + }); [TLDef(0x10EA6184)] - public record Messages_SendVote_(InputPeer peer, int msg_id, byte[][] options) : IMethod; + public partial class Messages_SendVote_ : IMethod + { + public InputPeer peer; + public int msg_id; + public byte[][] options; + } /// Vote in a See Possible codes: 400 (details) /// The chat where the poll was sent /// The message ID of the poll /// The options that were chosen public static Task Messages_SendVote(this Client client, InputPeer peer, int msg_id, byte[][] options) - => client.CallAsync(new Messages_SendVote_(peer, msg_id, options)); + => client.CallAsync(new Messages_SendVote_ + { + peer = peer, + msg_id = msg_id, + options = options, + }); [TLDef(0x73BB643B)] - public record Messages_GetPollResults_(InputPeer peer, int msg_id) : IMethod; + public partial class Messages_GetPollResults_ : IMethod + { + public InputPeer peer; + public int msg_id; + } /// Get poll results See Possible codes: 400 (details) /// Peer where the poll was found /// Message ID of poll message public static Task Messages_GetPollResults(this Client client, InputPeer peer, int msg_id) - => client.CallAsync(new Messages_GetPollResults_(peer, msg_id)); + => client.CallAsync(new Messages_GetPollResults_ + { + peer = peer, + msg_id = msg_id, + }); [TLDef(0x6E2BE050)] - public record Messages_GetOnlines_(InputPeer peer) : IMethod; + public partial class Messages_GetOnlines_ : IMethod + { + public InputPeer peer; + } /// Get count of online users in a chat See Possible codes: 400 (details) /// The chat public static Task Messages_GetOnlines(this Client client, InputPeer peer) - => client.CallAsync(new Messages_GetOnlines_(peer)); + => client.CallAsync(new Messages_GetOnlines_ + { + peer = peer, + }); [TLDef(0xDEF60797)] - public record Messages_EditChatAbout_(InputPeer peer, string about) : IMethod; + public partial class Messages_EditChatAbout_ : IMethod + { + public InputPeer peer; + public string about; + } /// Edit the description of a group/supergroup/channel. See [bots: ✓] Possible codes: 400,403 (details) /// The group/supergroup/channel. /// The new description public static Task Messages_EditChatAbout(this Client client, InputPeer peer, string about) - => client.CallAsync(new Messages_EditChatAbout_(peer, about)); + => client.CallAsync(new Messages_EditChatAbout_ + { + peer = peer, + about = about, + }); [TLDef(0xA5866B41)] - public record Messages_EditChatDefaultBannedRights_(InputPeer peer, ChatBannedRights banned_rights) : IMethod; + public partial class Messages_EditChatDefaultBannedRights_ : IMethod + { + public InputPeer peer; + public ChatBannedRights banned_rights; + } /// Edit the default banned rights of a channel/supergroup/group. See [bots: ✓] Possible codes: 400,403 (details) /// The peer /// The new global rights public static Task Messages_EditChatDefaultBannedRights(this Client client, InputPeer peer, ChatBannedRights banned_rights) - => client.CallAsync(new Messages_EditChatDefaultBannedRights_(peer, banned_rights)); + => client.CallAsync(new Messages_EditChatDefaultBannedRights_ + { + peer = peer, + banned_rights = banned_rights, + }); [TLDef(0x35A0E062)] - public record Messages_GetEmojiKeywords_(string lang_code) : IMethod; + public partial class Messages_GetEmojiKeywords_ : IMethod + { + public string lang_code; + } /// Get localized emoji keywords See /// Language code public static Task Messages_GetEmojiKeywords(this Client client, string lang_code) - => client.CallAsync(new Messages_GetEmojiKeywords_(lang_code)); + => client.CallAsync(new Messages_GetEmojiKeywords_ + { + lang_code = lang_code, + }); [TLDef(0x1508B6AF)] - public record Messages_GetEmojiKeywordsDifference_(string lang_code, int from_version) : IMethod; + public partial class Messages_GetEmojiKeywordsDifference_ : IMethod + { + public string lang_code; + public int from_version; + } /// Get changed emoji keywords See /// Language code /// Previous emoji keyword localization version public static Task Messages_GetEmojiKeywordsDifference(this Client client, string lang_code, int from_version) - => client.CallAsync(new Messages_GetEmojiKeywordsDifference_(lang_code, from_version)); + => client.CallAsync(new Messages_GetEmojiKeywordsDifference_ + { + lang_code = lang_code, + from_version = from_version, + }); [TLDef(0x4E9963B2)] - public record Messages_GetEmojiKeywordsLanguages_(string[] lang_codes) : IMethod; + public partial class Messages_GetEmojiKeywordsLanguages_ : IMethod + { + public string[] lang_codes; + } /// Get info about an emoji keyword localization See /// Language codes public static Task Messages_GetEmojiKeywordsLanguages(this Client client, string[] lang_codes) - => client.CallAsync(new Messages_GetEmojiKeywordsLanguages_(lang_codes)); + => client.CallAsync(new Messages_GetEmojiKeywordsLanguages_ + { + lang_codes = lang_codes, + }); [TLDef(0xD5B10C26)] - public record Messages_GetEmojiURL_(string lang_code) : IMethod; + public partial class Messages_GetEmojiURL_ : IMethod + { + public string lang_code; + } /// Returns an HTTP URL which can be used to automatically log in into translation platform and suggest new emoji replacements. The URL will be valid for 30 seconds after generation See /// Language code for which the emoji replacements will be suggested public static Task Messages_GetEmojiURL(this Client client, string lang_code) - => client.CallAsync(new Messages_GetEmojiURL_(lang_code)); + => client.CallAsync(new Messages_GetEmojiURL_ + { + lang_code = lang_code, + }); [TLDef(0x732EEF00)] - public record Messages_GetSearchCounters_(InputPeer peer, MessagesFilter[] filters) : IMethod; + public partial class Messages_GetSearchCounters_ : IMethod + { + public InputPeer peer; + public MessagesFilter[] filters; + } /// Get the number of results that would be found by a messages.search call with the same parameters See Possible codes: 400 (details) /// Peer where to search /// Search filters public static Task Messages_GetSearchCounters(this Client client, InputPeer peer, MessagesFilter[] filters) - => client.CallAsync(new Messages_GetSearchCounters_(peer, filters)); + => client.CallAsync(new Messages_GetSearchCounters_ + { + peer = peer, + filters = filters, + }); [TLDef(0x198FB446)] - public record Messages_RequestUrlAuth_(int flags, [field:IfFlag(1)] InputPeer peer, [field:IfFlag(1)] int msg_id, [field:IfFlag(1)] int button_id, [field:IfFlag(2)] string url) : IMethod; + public partial class Messages_RequestUrlAuth_ : IMethod + { + public Flags flags; + [IfFlag(1)] public InputPeer peer; + [IfFlag(1)] public int msg_id; + [IfFlag(1)] public int button_id; + [IfFlag(2)] public string url; + + [Flags] public enum Flags + { + /// Field has a value + has_peer = 0x2, + /// Field has a value + has_url = 0x4, + } + } /// Get more info about a Seamless Telegram Login authorization request, for more info click here » See /// Peer where the message is located /// The message /// The ID of the button with the authorization request /// URL used for link URL authorization, click here for more info » public static Task Messages_RequestUrlAuth(this Client client, InputPeer peer = null, int? msg_id = null, int? button_id = null, string url = null) - => client.CallAsync(new Messages_RequestUrlAuth_((peer != null ? 0x2 : 0) | (msg_id != null ? 0x2 : 0) | (button_id != null ? 0x2 : 0) | (url != null ? 0x4 : 0), - peer, msg_id.GetValueOrDefault(), button_id.GetValueOrDefault(), url)); + => client.CallAsync(new Messages_RequestUrlAuth_ + { + flags = (Messages_RequestUrlAuth_.Flags)((peer != null ? 0x2 : 0) | (msg_id != null ? 0x2 : 0) | (button_id != null ? 0x2 : 0) | (url != null ? 0x4 : 0)), + peer = peer, + msg_id = msg_id.GetValueOrDefault(), + button_id = button_id.GetValueOrDefault(), + url = url, + }); [TLDef(0xB12C7125)] - public record Messages_AcceptUrlAuth_(int flags, [field:IfFlag(1)] InputPeer peer, [field:IfFlag(1)] int msg_id, [field:IfFlag(1)] int button_id, [field:IfFlag(2)] string url) : IMethod; + public partial class Messages_AcceptUrlAuth_ : IMethod + { + public Flags flags; + [IfFlag(1)] public InputPeer peer; + [IfFlag(1)] public int msg_id; + [IfFlag(1)] public int button_id; + [IfFlag(2)] public string url; + + [Flags] public enum Flags + { + write_allowed = 0x1, + /// Field has a value + has_peer = 0x2, + /// Field has a value + has_url = 0x4, + } + } /// Use this to accept a Seamless Telegram Login authorization request, for more info click here » See /// Set this flag to allow the bot to send messages to you (if requested) /// The location of the message @@ -14212,50 +16542,110 @@ namespace TL /// ID of the login button /// URL used for link URL authorization, click here for more info » public static Task Messages_AcceptUrlAuth(this Client client, bool write_allowed = false, InputPeer peer = null, int? msg_id = null, int? button_id = null, string url = null) - => client.CallAsync(new Messages_AcceptUrlAuth_((write_allowed ? 0x1 : 0) | (peer != null ? 0x2 : 0) | (msg_id != null ? 0x2 : 0) | (button_id != null ? 0x2 : 0) | (url != null ? 0x4 : 0), - peer, msg_id.GetValueOrDefault(), button_id.GetValueOrDefault(), url)); + => client.CallAsync(new Messages_AcceptUrlAuth_ + { + flags = (Messages_AcceptUrlAuth_.Flags)((write_allowed ? 0x1 : 0) | (peer != null ? 0x2 : 0) | (msg_id != null ? 0x2 : 0) | (button_id != null ? 0x2 : 0) | (url != null ? 0x4 : 0)), + peer = peer, + msg_id = msg_id.GetValueOrDefault(), + button_id = button_id.GetValueOrDefault(), + url = url, + }); [TLDef(0x4FACB138)] - public record Messages_HidePeerSettingsBar_(InputPeer peer) : IMethod; + public partial class Messages_HidePeerSettingsBar_ : IMethod + { + public InputPeer peer; + } /// Should be called after the user hides the report spam/add as contact bar of a new chat, effectively prevents the user from executing the actions specified in the . See /// Peer public static Task Messages_HidePeerSettingsBar(this Client client, InputPeer peer) - => client.CallAsync(new Messages_HidePeerSettingsBar_(peer)); + => client.CallAsync(new Messages_HidePeerSettingsBar_ + { + peer = peer, + }); [TLDef(0xF516760B)] - public record Messages_GetScheduledHistory_(InputPeer peer, long hash) : IMethod; + public partial class Messages_GetScheduledHistory_ : IMethod + { + public InputPeer peer; + public long hash; + } /// Get scheduled messages See Possible codes: 400 (details) /// Peer /// Hash for pagination, for more info click here public static Task Messages_GetScheduledHistory(this Client client, InputPeer peer, long hash) - => client.CallAsync(new Messages_GetScheduledHistory_(peer, hash)); + => client.CallAsync(new Messages_GetScheduledHistory_ + { + peer = peer, + hash = hash, + }); [TLDef(0xBDBB0464)] - public record Messages_GetScheduledMessages_(InputPeer peer, int[] id) : IMethod; + public partial class Messages_GetScheduledMessages_ : IMethod + { + public InputPeer peer; + public int[] id; + } /// Get scheduled messages See Possible codes: 400 (details) /// Peer /// IDs of scheduled messages public static Task Messages_GetScheduledMessages(this Client client, InputPeer peer, int[] id) - => client.CallAsync(new Messages_GetScheduledMessages_(peer, id)); + => client.CallAsync(new Messages_GetScheduledMessages_ + { + peer = peer, + id = id, + }); [TLDef(0xBD38850A)] - public record Messages_SendScheduledMessages_(InputPeer peer, int[] id) : IMethod; + public partial class Messages_SendScheduledMessages_ : IMethod + { + public InputPeer peer; + public int[] id; + } /// Send scheduled messages right away See Possible codes: 400 (details) /// Peer /// Scheduled message IDs public static Task Messages_SendScheduledMessages(this Client client, InputPeer peer, int[] id) - => client.CallAsync(new Messages_SendScheduledMessages_(peer, id)); + => client.CallAsync(new Messages_SendScheduledMessages_ + { + peer = peer, + id = id, + }); [TLDef(0x59AE2B16)] - public record Messages_DeleteScheduledMessages_(InputPeer peer, int[] id) : IMethod; + public partial class Messages_DeleteScheduledMessages_ : IMethod + { + public InputPeer peer; + public int[] id; + } /// Delete scheduled messages See /// Peer /// Scheduled message IDs public static Task Messages_DeleteScheduledMessages(this Client client, InputPeer peer, int[] id) - => client.CallAsync(new Messages_DeleteScheduledMessages_(peer, id)); + => client.CallAsync(new Messages_DeleteScheduledMessages_ + { + peer = peer, + id = id, + }); [TLDef(0xB86E380E)] - public record Messages_GetPollVotes_(int flags, InputPeer peer, int id, [field:IfFlag(0)] byte[] option, [field:IfFlag(1)] string offset, int limit) : IMethod; + public partial class Messages_GetPollVotes_ : IMethod + { + public Flags flags; + public InputPeer peer; + public int id; + [IfFlag(0)] public byte[] option; + [IfFlag(1)] public string offset; + public int limit; + + [Flags] public enum Flags + { + /// Field has a value + has_option = 0x1, + /// Field has a value + has_offset = 0x2, + } + } /// Get poll results for non-anonymous polls See Possible codes: 400,403 (details) /// Chat where the poll was sent /// Message ID @@ -14263,58 +16653,126 @@ namespace TL /// Offset for results, taken from the next_offset field of , initially an empty string.
Note: if no more results are available, the method call will return an empty next_offset; thus, avoid providing the next_offset returned in if it is empty, to avoid an infinite loop. /// Number of results to return public static Task Messages_GetPollVotes(this Client client, InputPeer peer, int id, int limit, byte[] option = null, string offset = null) - => client.CallAsync(new Messages_GetPollVotes_((option != null ? 0x1 : 0) | (offset != null ? 0x2 : 0), - peer, id, option, offset, limit)); + => client.CallAsync(new Messages_GetPollVotes_ + { + flags = (Messages_GetPollVotes_.Flags)((option != null ? 0x1 : 0) | (offset != null ? 0x2 : 0)), + peer = peer, + id = id, + option = option, + offset = offset, + limit = limit, + }); [TLDef(0xB5052FEA)] - public record Messages_ToggleStickerSets_(int flags, InputStickerSet[] stickersets) : IMethod; + public partial class Messages_ToggleStickerSets_ : IMethod + { + public Flags flags; + public InputStickerSet[] stickersets; + + [Flags] public enum Flags + { + uninstall = 0x1, + archive = 0x2, + unarchive = 0x4, + } + } /// Apply changes to multiple stickersets See /// Uninstall the specified stickersets /// Archive the specified stickersets /// Unarchive the specified stickersets /// Stickersets to act upon public static Task Messages_ToggleStickerSets(this Client client, InputStickerSet[] stickersets, bool uninstall = false, bool archive = false, bool unarchive = false) - => client.CallAsync(new Messages_ToggleStickerSets_((uninstall ? 0x1 : 0) | (archive ? 0x2 : 0) | (unarchive ? 0x4 : 0), - stickersets)); + => client.CallAsync(new Messages_ToggleStickerSets_ + { + flags = (Messages_ToggleStickerSets_.Flags)((uninstall ? 0x1 : 0) | (archive ? 0x2 : 0) | (unarchive ? 0x4 : 0)), + stickersets = stickersets, + }); [TLDef(0xF19ED96D)] - public record Messages_GetDialogFilters_() : IMethod; + public partial class Messages_GetDialogFilters_ : IMethod { } /// Get folders See public static Task Messages_GetDialogFilters(this Client client) - => client.CallAsync(new Messages_GetDialogFilters_()); + => client.CallAsync(new Messages_GetDialogFilters_ + { + }); [TLDef(0xA29CD42C)] - public record Messages_GetSuggestedDialogFilters_() : IMethod; + public partial class Messages_GetSuggestedDialogFilters_ : IMethod { } /// Get suggested folders See public static Task Messages_GetSuggestedDialogFilters(this Client client) - => client.CallAsync(new Messages_GetSuggestedDialogFilters_()); + => client.CallAsync(new Messages_GetSuggestedDialogFilters_ + { + }); [TLDef(0x1AD4A04A)] - public record Messages_UpdateDialogFilter_(int flags, int id, [field:IfFlag(0)] DialogFilter filter) : IMethod; + public partial class Messages_UpdateDialogFilter_ : IMethod + { + public Flags flags; + public int id; + [IfFlag(0)] public DialogFilter filter; + + [Flags] public enum Flags + { + /// Field has a value + has_filter = 0x1, + } + } /// Update folder See Possible codes: 400 (details) /// Folder ID /// Folder info public static Task Messages_UpdateDialogFilter(this Client client, int id, DialogFilter filter = null) - => client.CallAsync(new Messages_UpdateDialogFilter_(filter != null ? 0x1 : 0, id, filter)); + => client.CallAsync(new Messages_UpdateDialogFilter_ + { + flags = (Messages_UpdateDialogFilter_.Flags)(filter != null ? 0x1 : 0), + id = id, + filter = filter, + }); [TLDef(0xC563C1E4)] - public record Messages_UpdateDialogFiltersOrder_(int[] order) : IMethod; + public partial class Messages_UpdateDialogFiltersOrder_ : IMethod + { + public int[] order; + } /// Reorder folders See /// New folder order public static Task Messages_UpdateDialogFiltersOrder(this Client client, int[] order) - => client.CallAsync(new Messages_UpdateDialogFiltersOrder_(order)); + => client.CallAsync(new Messages_UpdateDialogFiltersOrder_ + { + order = order, + }); [TLDef(0x7ED094A1)] - public record Messages_GetOldFeaturedStickers_(int offset, int limit, long hash) : IMethod; + public partial class Messages_GetOldFeaturedStickers_ : IMethod + { + public int offset; + public int limit; + public long hash; + } /// Method for fetching previously featured stickers See /// Offset /// Maximum number of results to return, see pagination /// Hash for pagination, for more info click here public static Task Messages_GetOldFeaturedStickers(this Client client, int offset, int limit, long hash) - => client.CallAsync(new Messages_GetOldFeaturedStickers_(offset, limit, hash)); + => client.CallAsync(new Messages_GetOldFeaturedStickers_ + { + offset = offset, + limit = limit, + hash = hash, + }); [TLDef(0x22DDD30C)] - public record Messages_GetReplies_(InputPeer peer, int msg_id, int offset_id, DateTime offset_date, int add_offset, int limit, int max_id, int min_id, long hash) : IMethod; + public partial class Messages_GetReplies_ : IMethod + { + public InputPeer peer; + public int msg_id; + public int offset_id; + public DateTime offset_date; + public int add_offset; + public int limit; + public int max_id; + public int min_id; + public long hash; + } /// Get messages in a reply thread See Possible codes: 400 (details) /// Peer /// Message ID @@ -14326,64 +16784,138 @@ namespace TL /// If a positive value was transferred, the method will return only messages with ID bigger than min_id /// Hash for pagination, for more info click here public static Task Messages_GetReplies(this Client client, InputPeer peer, int msg_id, int offset_id, DateTime offset_date, int add_offset, int limit, int max_id, int min_id, long hash) - => client.CallAsync(new Messages_GetReplies_(peer, msg_id, offset_id, offset_date, add_offset, limit, max_id, min_id, hash)); + => client.CallAsync(new Messages_GetReplies_ + { + peer = peer, + msg_id = msg_id, + offset_id = offset_id, + offset_date = offset_date, + add_offset = add_offset, + limit = limit, + max_id = max_id, + min_id = min_id, + hash = hash, + }); [TLDef(0x446972FD)] - public record Messages_GetDiscussionMessage_(InputPeer peer, int msg_id) : IMethod; + public partial class Messages_GetDiscussionMessage_ : IMethod + { + public InputPeer peer; + public int msg_id; + } /// Get discussion message from the associated discussion group of a channel to show it on top of the comment section, without actually joining the group See Possible codes: 400 (details) /// Channel ID /// Message ID public static Task Messages_GetDiscussionMessage(this Client client, InputPeer peer, int msg_id) - => client.CallAsync(new Messages_GetDiscussionMessage_(peer, msg_id)); + => client.CallAsync(new Messages_GetDiscussionMessage_ + { + peer = peer, + msg_id = msg_id, + }); [TLDef(0xF731A9F4)] - public record Messages_ReadDiscussion_(InputPeer peer, int msg_id, int read_max_id) : IMethod; + public partial class Messages_ReadDiscussion_ : IMethod + { + public InputPeer peer; + public int msg_id; + public int read_max_id; + } /// Mark a thread as read See Possible codes: 400 (details) /// Group ID /// ID of message that started the thread /// ID up to which thread messages were read public static Task Messages_ReadDiscussion(this Client client, InputPeer peer, int msg_id, int read_max_id) - => client.CallAsync(new Messages_ReadDiscussion_(peer, msg_id, read_max_id)); + => client.CallAsync(new Messages_ReadDiscussion_ + { + peer = peer, + msg_id = msg_id, + read_max_id = read_max_id, + }); [TLDef(0xF025BC8B)] - public record Messages_UnpinAllMessages_(InputPeer peer) : IMethod; + public partial class Messages_UnpinAllMessages_ : IMethod + { + public InputPeer peer; + } /// Unpin all pinned messages See [bots: ✓] /// Chat where to unpin public static Task Messages_UnpinAllMessages(this Client client, InputPeer peer) - => client.CallAsync(new Messages_UnpinAllMessages_(peer)); + => client.CallAsync(new Messages_UnpinAllMessages_ + { + peer = peer, + }); [TLDef(0x5BD0EE50)] - public record Messages_DeleteChat_(long chat_id) : IMethod; + public partial class Messages_DeleteChat_ : IMethod + { + public long chat_id; + } /// Delete a chat See Possible codes: 400 (details) /// Chat ID public static Task Messages_DeleteChat(this Client client, long chat_id) - => client.CallAsync(new Messages_DeleteChat_(chat_id)); + => client.CallAsync(new Messages_DeleteChat_ + { + chat_id = chat_id, + }); [TLDef(0xF9CBE409)] - public record Messages_DeletePhoneCallHistory_(int flags) : IMethod; + public partial class Messages_DeletePhoneCallHistory_ : IMethod + { + public Flags flags; + + [Flags] public enum Flags + { + revoke = 0x1, + } + } /// Delete the entire phone call history. See /// Whether to remove phone call history for participants as well public static Task Messages_DeletePhoneCallHistory(this Client client, bool revoke = false) - => client.CallAsync(new Messages_DeletePhoneCallHistory_(revoke ? 0x1 : 0)); + => client.CallAsync(new Messages_DeletePhoneCallHistory_ + { + flags = (Messages_DeletePhoneCallHistory_.Flags)(revoke ? 0x1 : 0), + }); [TLDef(0x43FE19F3)] - public record Messages_CheckHistoryImport_(string import_head) : IMethod; + public partial class Messages_CheckHistoryImport_ : IMethod + { + public string import_head; + } /// Obtains information about a chat export file, generated by a foreign chat app, click here for more info about imported chats ». See /// Beginning of the message file; up to 100 lines. public static Task Messages_CheckHistoryImport(this Client client, string import_head) - => client.CallAsync(new Messages_CheckHistoryImport_(import_head)); + => client.CallAsync(new Messages_CheckHistoryImport_ + { + import_head = import_head, + }); [TLDef(0x34090C3B)] - public record Messages_InitHistoryImport_(InputPeer peer, InputFileBase file, int media_count) : IMethod; + public partial class Messages_InitHistoryImport_ : IMethod + { + public InputPeer peer; + public InputFileBase file; + public int media_count; + } /// Import chat history from a foreign chat app into a specific Telegram chat, click here for more info about imported chats ». See Possible codes: 400,406 (details) /// The Telegram chat where the history should be imported. /// File with messages to import. /// Number of media files associated with the chat that will be uploaded using messages.uploadImportedMedia. public static Task Messages_InitHistoryImport(this Client client, InputPeer peer, InputFileBase file, int media_count) - => client.CallAsync(new Messages_InitHistoryImport_(peer, file, media_count)); + => client.CallAsync(new Messages_InitHistoryImport_ + { + peer = peer, + file = file, + media_count = media_count, + }); [TLDef(0x2A862092)] - public record Messages_UploadImportedMedia_(InputPeer peer, long import_id, string file_name, InputMedia media) : IMethod; + public partial class Messages_UploadImportedMedia_ : IMethod + { + public InputPeer peer; + public long import_id; + public string file_name; + public InputMedia media; + } /// Upload a media file associated with an imported chat, click here for more info ». See /// The Telegram chat where the media will be imported /// Identifier of a history import session, returned by messages.initHistoryImport @@ -14391,18 +16923,47 @@ namespace TL /// Media metadata /// a null value means messageMediaEmpty public static Task Messages_UploadImportedMedia(this Client client, InputPeer peer, long import_id, string file_name, InputMedia media) - => client.CallAsync(new Messages_UploadImportedMedia_(peer, import_id, file_name, media)); + => client.CallAsync(new Messages_UploadImportedMedia_ + { + peer = peer, + import_id = import_id, + file_name = file_name, + media = media, + }); [TLDef(0xB43DF344)] - public record Messages_StartHistoryImport_(InputPeer peer, long import_id) : IMethod; + public partial class Messages_StartHistoryImport_ : IMethod + { + public InputPeer peer; + public long import_id; + } /// Complete the history import process, importing all messages into the chat.
To be called only after initializing the import with messages.initHistoryImport and uploading all files using messages.uploadImportedMedia. See Possible codes: 400 (details)
/// The Telegram chat where the messages should be imported, click here for more info » /// Identifier of a history import session, returned by messages.initHistoryImport. public static Task Messages_StartHistoryImport(this Client client, InputPeer peer, long import_id) - => client.CallAsync(new Messages_StartHistoryImport_(peer, import_id)); + => client.CallAsync(new Messages_StartHistoryImport_ + { + peer = peer, + import_id = import_id, + }); [TLDef(0xA2B5A3F6)] - public record Messages_GetExportedChatInvites_(int flags, InputPeer peer, InputUserBase admin_id, [field:IfFlag(2)] DateTime offset_date, [field:IfFlag(2)] string offset_link, int limit) : IMethod; + public partial class Messages_GetExportedChatInvites_ : IMethod + { + public Flags flags; + public InputPeer peer; + public InputUserBase admin_id; + [IfFlag(2)] public DateTime offset_date; + [IfFlag(2)] public string offset_link; + public int limit; + + [Flags] public enum Flags + { + /// Field has a value + has_offset_date = 0x4, + revoked = 0x8, + } + } /// Get info about the chat invites of a specific chat See /// Whether to fetch revoked chat invites /// Chat @@ -14411,19 +16972,56 @@ namespace TL /// Offsets for pagination, for more info click here /// Maximum number of results to return, see pagination public static Task Messages_GetExportedChatInvites(this Client client, InputPeer peer, InputUserBase admin_id, int limit, bool revoked = false, DateTime? offset_date = null, string offset_link = null) - => client.CallAsync(new Messages_GetExportedChatInvites_((revoked ? 0x8 : 0) | (offset_date != null ? 0x4 : 0) | (offset_link != null ? 0x4 : 0), - peer, admin_id, offset_date.GetValueOrDefault(), offset_link, limit)); + => client.CallAsync(new Messages_GetExportedChatInvites_ + { + flags = (Messages_GetExportedChatInvites_.Flags)((revoked ? 0x8 : 0) | (offset_date != null ? 0x4 : 0) | (offset_link != null ? 0x4 : 0)), + peer = peer, + admin_id = admin_id, + offset_date = offset_date.GetValueOrDefault(), + offset_link = offset_link, + limit = limit, + }); [TLDef(0x73746F5C)] - public record Messages_GetExportedChatInvite_(InputPeer peer, string link) : IMethod; + public partial class Messages_GetExportedChatInvite_ : IMethod + { + public InputPeer peer; + public string link; + } /// Get info about a chat invite See /// Chat /// Invite link public static Task Messages_GetExportedChatInvite(this Client client, InputPeer peer, string link) - => client.CallAsync(new Messages_GetExportedChatInvite_(peer, link)); + => client.CallAsync(new Messages_GetExportedChatInvite_ + { + peer = peer, + link = link, + }); [TLDef(0xBDCA2F75)] - public record Messages_EditExportedChatInvite_(int flags, InputPeer peer, string link, [field:IfFlag(0)] DateTime expire_date, [field:IfFlag(1)] int usage_limit, [field:IfFlag(3)] bool request_needed, [field:IfFlag(4)] string title) : IMethod; + public partial class Messages_EditExportedChatInvite_ : IMethod + { + public Flags flags; + public InputPeer peer; + public string link; + [IfFlag(0)] public DateTime expire_date; + [IfFlag(1)] public int usage_limit; + [IfFlag(3)] public bool request_needed; + [IfFlag(4)] public string title; + + [Flags] public enum Flags + { + /// Field has a value + has_expire_date = 0x1, + /// Field has a value + has_usage_limit = 0x2, + revoked = 0x4, + /// Field has a value + has_request_needed = 0x8, + /// Field has a value + has_title = 0x10, + } + } /// Edit an exported chat invite See [bots: ✓] Possible codes: 400 (details) /// Whether to revoke the chat invite /// Chat @@ -14431,34 +17029,82 @@ namespace TL /// New expiration date /// Maximum number of users that can join using this link public static Task Messages_EditExportedChatInvite(this Client client, InputPeer peer, string link, bool revoked = false, DateTime? expire_date = null, int? usage_limit = null, bool? request_needed = default, string title = null) - => client.CallAsync(new Messages_EditExportedChatInvite_((revoked ? 0x4 : 0) | (expire_date != null ? 0x1 : 0) | (usage_limit != null ? 0x2 : 0) | (request_needed != default ? 0x8 : 0) | (title != null ? 0x10 : 0), - peer, link, expire_date.GetValueOrDefault(), usage_limit.GetValueOrDefault(), request_needed.GetValueOrDefault(), title)); + => client.CallAsync(new Messages_EditExportedChatInvite_ + { + flags = (Messages_EditExportedChatInvite_.Flags)((revoked ? 0x4 : 0) | (expire_date != null ? 0x1 : 0) | (usage_limit != null ? 0x2 : 0) | (request_needed != default ? 0x8 : 0) | (title != null ? 0x10 : 0)), + peer = peer, + link = link, + expire_date = expire_date.GetValueOrDefault(), + usage_limit = usage_limit.GetValueOrDefault(), + request_needed = request_needed.GetValueOrDefault(), + title = title, + }); [TLDef(0x56987BD5)] - public record Messages_DeleteRevokedExportedChatInvites_(InputPeer peer, InputUserBase admin_id) : IMethod; + public partial class Messages_DeleteRevokedExportedChatInvites_ : IMethod + { + public InputPeer peer; + public InputUserBase admin_id; + } /// Delete all revoked chat invites See /// Chat /// ID of the admin that originally generated the revoked chat invites public static Task Messages_DeleteRevokedExportedChatInvites(this Client client, InputPeer peer, InputUserBase admin_id) - => client.CallAsync(new Messages_DeleteRevokedExportedChatInvites_(peer, admin_id)); + => client.CallAsync(new Messages_DeleteRevokedExportedChatInvites_ + { + peer = peer, + admin_id = admin_id, + }); [TLDef(0xD464A42B)] - public record Messages_DeleteExportedChatInvite_(InputPeer peer, string link) : IMethod; + public partial class Messages_DeleteExportedChatInvite_ : IMethod + { + public InputPeer peer; + public string link; + } /// Delete a chat invite See /// Peer /// Invite link public static Task Messages_DeleteExportedChatInvite(this Client client, InputPeer peer, string link) - => client.CallAsync(new Messages_DeleteExportedChatInvite_(peer, link)); + => client.CallAsync(new Messages_DeleteExportedChatInvite_ + { + peer = peer, + link = link, + }); [TLDef(0x3920E6EF)] - public record Messages_GetAdminsWithInvites_(InputPeer peer) : IMethod; + public partial class Messages_GetAdminsWithInvites_ : IMethod + { + public InputPeer peer; + } /// Get info about chat invites generated by admins. See /// Chat public static Task Messages_GetAdminsWithInvites(this Client client, InputPeer peer) - => client.CallAsync(new Messages_GetAdminsWithInvites_(peer)); + => client.CallAsync(new Messages_GetAdminsWithInvites_ + { + peer = peer, + }); [TLDef(0xDF04DD4E)] - public record Messages_GetChatInviteImporters_(int flags, InputPeer peer, [field:IfFlag(1)] string link, [field:IfFlag(2)] string q, DateTime offset_date, InputUserBase offset_user, int limit) : IMethod; + public partial class Messages_GetChatInviteImporters_ : IMethod + { + public Flags flags; + public InputPeer peer; + [IfFlag(1)] public string link; + [IfFlag(2)] public string q; + public DateTime offset_date; + public InputUserBase offset_user; + public int limit; + + [Flags] public enum Flags + { + requested = 0x1, + /// Field has a value + has_link = 0x2, + /// Field has a value + has_q = 0x4, + } + } /// Get info about the users that joined the chat using a specific chat invite See /// Chat /// Invite link @@ -14466,77 +17112,187 @@ namespace TL /// User ID for pagination /// Maximum number of results to return, see pagination public static Task Messages_GetChatInviteImporters(this Client client, InputPeer peer, DateTime offset_date, InputUserBase offset_user, int limit, bool requested = false, string link = null, string q = null) - => client.CallAsync(new Messages_GetChatInviteImporters_((requested ? 0x1 : 0) | (link != null ? 0x2 : 0) | (q != null ? 0x4 : 0), - peer, link, q, offset_date, offset_user, limit)); + => client.CallAsync(new Messages_GetChatInviteImporters_ + { + flags = (Messages_GetChatInviteImporters_.Flags)((requested ? 0x1 : 0) | (link != null ? 0x2 : 0) | (q != null ? 0x4 : 0)), + peer = peer, + link = link, + q = q, + offset_date = offset_date, + offset_user = offset_user, + limit = limit, + }); [TLDef(0xB80E5FE4)] - public record Messages_SetHistoryTTL_(InputPeer peer, int period) : IMethod; + public partial class Messages_SetHistoryTTL_ : IMethod + { + public InputPeer peer; + public int period; + } /// Set maximum Time-To-Live of all messages in the specified chat See Possible codes: 400 (details) /// The dialog /// Automatically delete all messages sent in the chat after this many seconds public static Task Messages_SetHistoryTTL(this Client client, InputPeer peer, int period) - => client.CallAsync(new Messages_SetHistoryTTL_(peer, period)); + => client.CallAsync(new Messages_SetHistoryTTL_ + { + peer = peer, + period = period, + }); [TLDef(0x5DC60F03)] - public record Messages_CheckHistoryImportPeer_(InputPeer peer) : IMethod; + public partial class Messages_CheckHistoryImportPeer_ : IMethod + { + public InputPeer peer; + } /// Check whether chat history exported from another chat app can be imported into a specific Telegram chat, click here for more info ». See Possible codes: 400 (details) /// The chat where we want to import history ». public static Task Messages_CheckHistoryImportPeer(this Client client, InputPeer peer) - => client.CallAsync(new Messages_CheckHistoryImportPeer_(peer)); + => client.CallAsync(new Messages_CheckHistoryImportPeer_ + { + peer = peer, + }); [TLDef(0xE63BE13F)] - public record Messages_SetChatTheme_(InputPeer peer, string emoticon) : IMethod; + public partial class Messages_SetChatTheme_ : IMethod + { + public InputPeer peer; + public string emoticon; + } /// Change the chat theme of a certain chat See Possible codes: 400 (details) /// Private chat where to change theme /// Emoji, identifying a specific chat theme; a list of chat themes can be fetched using account.getChatThemes public static Task Messages_SetChatTheme(this Client client, InputPeer peer, string emoticon) - => client.CallAsync(new Messages_SetChatTheme_(peer, emoticon)); + => client.CallAsync(new Messages_SetChatTheme_ + { + peer = peer, + emoticon = emoticon, + }); [TLDef(0x2C6F97B7)] - public record Messages_GetMessageReadParticipants_(InputPeer peer, int msg_id) : IMethod; + public partial class Messages_GetMessageReadParticipants_ : IMethod + { + public InputPeer peer; + public int msg_id; + } /// Get which users read a specific message: only available for groups and supergroups with less than chat_read_mark_size_threshold members, read receipts will be stored for chat_read_mark_expire_period seconds after the message was sent, see client configuration for more info ». See Possible codes: 400 (details) /// Dialog /// Message ID public static Task Messages_GetMessageReadParticipants(this Client client, InputPeer peer, int msg_id) - => client.CallAsync(new Messages_GetMessageReadParticipants_(peer, msg_id)); + => client.CallAsync(new Messages_GetMessageReadParticipants_ + { + peer = peer, + msg_id = msg_id, + }); [TLDef(0x49F0BDE9)] - public record Messages_GetSearchResultsCalendar_(InputPeer peer, MessagesFilter filter, int offset_id, DateTime offset_date) : IMethod; + public partial class Messages_GetSearchResultsCalendar_ : IMethod + { + public InputPeer peer; + public MessagesFilter filter; + public int offset_id; + public DateTime offset_date; + } /// See public static Task Messages_GetSearchResultsCalendar(this Client client, InputPeer peer, MessagesFilter filter, int offset_id, DateTime offset_date) - => client.CallAsync(new Messages_GetSearchResultsCalendar_(peer, filter, offset_id, offset_date)); + => client.CallAsync(new Messages_GetSearchResultsCalendar_ + { + peer = peer, + filter = filter, + offset_id = offset_id, + offset_date = offset_date, + }); [TLDef(0x6E9583A3)] - public record Messages_GetSearchResultsPositions_(InputPeer peer, MessagesFilter filter, int offset_id, int limit) : IMethod; + public partial class Messages_GetSearchResultsPositions_ : IMethod + { + public InputPeer peer; + public MessagesFilter filter; + public int offset_id; + public int limit; + } /// See public static Task Messages_GetSearchResultsPositions(this Client client, InputPeer peer, MessagesFilter filter, int offset_id, int limit) - => client.CallAsync(new Messages_GetSearchResultsPositions_(peer, filter, offset_id, limit)); + => client.CallAsync(new Messages_GetSearchResultsPositions_ + { + peer = peer, + filter = filter, + offset_id = offset_id, + limit = limit, + }); [TLDef(0x7FE7E815)] - public record Messages_HideChatJoinRequest_(int flags, InputPeer peer, InputUserBase user_id) : IMethod; + public partial class Messages_HideChatJoinRequest_ : IMethod + { + public Flags flags; + public InputPeer peer; + public InputUserBase user_id; + + [Flags] public enum Flags + { + approved = 0x1, + } + } /// See public static Task Messages_HideChatJoinRequest(this Client client, InputPeer peer, InputUserBase user_id, bool approved = false) - => client.CallAsync(new Messages_HideChatJoinRequest_(approved ? 0x1 : 0, peer, user_id)); + => client.CallAsync(new Messages_HideChatJoinRequest_ + { + flags = (Messages_HideChatJoinRequest_.Flags)(approved ? 0x1 : 0), + peer = peer, + user_id = user_id, + }); [TLDef(0xEDD4882A)] - public record Updates_GetState_() : IMethod; + public partial class Updates_GetState_ : IMethod { } /// Returns a current state of updates. See [bots: ✓] public static Task Updates_GetState(this Client client) - => client.CallAsync(new Updates_GetState_()); + => client.CallAsync(new Updates_GetState_ + { + }); [TLDef(0x25939651)] - public record Updates_GetDifference_(int flags, int pts, [field:IfFlag(0)] int pts_total_limit, DateTime date, int qts) : IMethod; + public partial class Updates_GetDifference_ : IMethod + { + public Flags flags; + public int pts; + [IfFlag(0)] public int pts_total_limit; + public DateTime date; + public int qts; + + [Flags] public enum Flags + { + /// Field has a value + has_pts_total_limit = 0x1, + } + } /// Get new updates. See [bots: ✓] Possible codes: 400,401,403 (details) /// PTS, see updates. /// For fast updating: if provided and pts + pts_total_limit < remote pts, will be returned.
Simply tells the server to not return the difference if it is bigger than pts_total_limit
If the remote pts is too big (> ~4000000), this field will default to 1000000 /// date, see updates. /// QTS, see updates. public static Task Updates_GetDifference(this Client client, int pts, DateTime date, int qts, int? pts_total_limit = null) - => client.CallAsync(new Updates_GetDifference_(pts_total_limit != null ? 0x1 : 0, - pts, pts_total_limit.GetValueOrDefault(), date, qts)); + => client.CallAsync(new Updates_GetDifference_ + { + flags = (Updates_GetDifference_.Flags)(pts_total_limit != null ? 0x1 : 0), + pts = pts, + pts_total_limit = pts_total_limit.GetValueOrDefault(), + date = date, + qts = qts, + }); [TLDef(0x03173D78)] - public record Updates_GetChannelDifference_(int flags, InputChannelBase channel, ChannelMessagesFilter filter, int pts, int limit) : IMethod; + public partial class Updates_GetChannelDifference_ : IMethod + { + public Flags flags; + public InputChannelBase channel; + public ChannelMessagesFilter filter; + public int pts; + public int limit; + + [Flags] public enum Flags + { + force = 0x1, + } + } /// Returns the difference between the current state of updates of a certain channel and transmitted. See [bots: ✓] Possible codes: 400,403 (details) /// Set to true to skip some possibly unneeded updates and reduce server-side load /// The channel @@ -14544,53 +17300,127 @@ namespace TL /// Persistent timestamp (see updates) /// How many updates to fetch, max 100000
Ordinary (non-bot) users are supposed to pass 10-100 public static Task Updates_GetChannelDifference(this Client client, InputChannelBase channel, ChannelMessagesFilter filter, int pts, int limit, bool force = false) - => client.CallAsync(new Updates_GetChannelDifference_(force ? 0x1 : 0, channel, filter, pts, limit)); + => client.CallAsync(new Updates_GetChannelDifference_ + { + flags = (Updates_GetChannelDifference_.Flags)(force ? 0x1 : 0), + channel = channel, + filter = filter, + pts = pts, + limit = limit, + }); [TLDef(0x72D4742C)] - public record Photos_UpdateProfilePhoto_(InputPhoto id) : IMethod; + public partial class Photos_UpdateProfilePhoto_ : IMethod + { + public InputPhoto id; + } /// Installs a previously uploaded photo as a profile photo. See Possible codes: 400 (details) /// Input photo public static Task Photos_UpdateProfilePhoto(this Client client, InputPhoto id) - => client.CallAsync(new Photos_UpdateProfilePhoto_(id)); + => client.CallAsync(new Photos_UpdateProfilePhoto_ + { + id = id, + }); [TLDef(0x89F30F69)] - public record Photos_UploadProfilePhoto_(int flags, [field:IfFlag(0)] InputFileBase file, [field:IfFlag(1)] InputFileBase video, [field:IfFlag(2)] double video_start_ts) : IMethod; + public partial class Photos_UploadProfilePhoto_ : IMethod + { + public Flags flags; + [IfFlag(0)] public InputFileBase file; + [IfFlag(1)] public InputFileBase video; + [IfFlag(2)] public double video_start_ts; + + [Flags] public enum Flags + { + /// Field has a value + has_file = 0x1, + /// Field has a value + has_video = 0x2, + /// Field has a value + has_video_start_ts = 0x4, + } + } /// Updates current user profile photo. See Possible codes: 400 (details) /// 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) - => client.CallAsync(new Photos_UploadProfilePhoto_((file != null ? 0x1 : 0) | (video != null ? 0x2 : 0) | (video_start_ts != null ? 0x4 : 0), - file, video, video_start_ts.GetValueOrDefault())); + => client.CallAsync(new Photos_UploadProfilePhoto_ + { + flags = (Photos_UploadProfilePhoto_.Flags)((file != null ? 0x1 : 0) | (video != null ? 0x2 : 0) | (video_start_ts != null ? 0x4 : 0)), + file = file, + video = video, + video_start_ts = video_start_ts.GetValueOrDefault(), + }); [TLDef(0x87CF7F2F)] - public record Photos_DeletePhotos_(InputPhoto[] id) : IMethod; + public partial class Photos_DeletePhotos_ : IMethod + { + public InputPhoto[] id; + } /// Deletes profile photos. See /// Input photos to delete public static Task Photos_DeletePhotos(this Client client, InputPhoto[] id) - => client.CallAsync(new Photos_DeletePhotos_(id)); + => client.CallAsync(new Photos_DeletePhotos_ + { + id = id, + }); [TLDef(0x91CD32A8)] - public record Photos_GetUserPhotos_(InputUserBase user_id, int offset, long max_id, int limit) : IMethod; + public partial class Photos_GetUserPhotos_ : IMethod + { + public InputUserBase user_id; + public int offset; + public long max_id; + public int limit; + } /// Returns the list of user photos. See [bots: ✓] Possible codes: 400 (details) /// User ID /// Number of list elements to be skipped /// If a positive value was transferred, the method will return only photos with IDs less than the set one /// Number of list elements to be returned public static Task Photos_GetUserPhotos(this Client client, InputUserBase user_id, int offset, long max_id, int limit) - => client.CallAsync(new Photos_GetUserPhotos_(user_id, offset, max_id, limit)); + => client.CallAsync(new Photos_GetUserPhotos_ + { + user_id = user_id, + offset = offset, + max_id = max_id, + limit = limit, + }); [TLDef(0xB304A621)] - public record Upload_SaveFilePart_(long file_id, int file_part, byte[] bytes) : IMethod; + public partial class Upload_SaveFilePart_ : IMethod + { + public long file_id; + public int file_part; + public byte[] bytes; + } /// Saves a part of file for futher sending to one of the methods. See [bots: ✓] Possible codes: 400 (details) /// Random file identifier created by the client /// Numerical order of a part /// Binary data, contend of a part public static Task Upload_SaveFilePart(this Client client, long file_id, int file_part, byte[] bytes) - => client.CallAsync(new Upload_SaveFilePart_(file_id, file_part, bytes)); + => client.CallAsync(new Upload_SaveFilePart_ + { + file_id = file_id, + file_part = file_part, + bytes = bytes, + }); [TLDef(0xB15A9AFC)] - public record Upload_GetFile_(int flags, InputFileLocationBase location, int offset, int limit) : IMethod; + public partial class Upload_GetFile_ : IMethod + { + public Flags flags; + public InputFileLocationBase location; + public int offset; + public int limit; + + [Flags] public enum Flags + { + precise = 0x1, + cdn_supported = 0x2, + } + } /// Returns content of a whole file or its part. See [bots: ✓] Possible codes: 400,401,406 (details) /// Disable some checks on limit and offset values, useful for example to stream videos by keyframes /// Whether the current client supports CDN downloads @@ -14598,260 +17428,476 @@ namespace TL /// Number of bytes to be skipped /// Number of bytes to be returned public static Task Upload_GetFile(this Client client, InputFileLocationBase location, int offset, int limit, bool precise = false, bool cdn_supported = false) - => client.CallAsync(new Upload_GetFile_((precise ? 0x1 : 0) | (cdn_supported ? 0x2 : 0), - location, offset, limit)); + => client.CallAsync(new Upload_GetFile_ + { + flags = (Upload_GetFile_.Flags)((precise ? 0x1 : 0) | (cdn_supported ? 0x2 : 0)), + location = location, + offset = offset, + limit = limit, + }); [TLDef(0xDE7B673D)] - public record Upload_SaveBigFilePart_(long file_id, int file_part, int file_total_parts, byte[] bytes) : IMethod; + public partial class Upload_SaveBigFilePart_ : IMethod + { + public long file_id; + public int file_part; + public int file_total_parts; + public byte[] bytes; + } /// Saves a part of a large file (over 10Mb in size) to be later passed to one of the methods. See [bots: ✓] Possible codes: 400 (details) /// Random file id, created by the client /// Part sequence number /// Total number of parts /// Binary data, part contents public static Task Upload_SaveBigFilePart(this Client client, long file_id, int file_part, int file_total_parts, byte[] bytes) - => client.CallAsync(new Upload_SaveBigFilePart_(file_id, file_part, file_total_parts, bytes)); + => client.CallAsync(new Upload_SaveBigFilePart_ + { + file_id = file_id, + file_part = file_part, + file_total_parts = file_total_parts, + bytes = bytes, + }); [TLDef(0x24E6818D)] - public record Upload_GetWebFile_(InputWebFileLocationBase location, int offset, int limit) : IMethod; + public partial class Upload_GetWebFile_ : IMethod + { + public InputWebFileLocationBase location; + public int offset; + public int limit; + } /// Returns content of an HTTP file or a part, by proxying the request through telegram. See Possible codes: 400 (details) /// The file to download /// Number of bytes to be skipped /// Number of bytes to be returned public static Task Upload_GetWebFile(this Client client, InputWebFileLocationBase location, int offset, int limit) - => client.CallAsync(new Upload_GetWebFile_(location, offset, limit)); + => client.CallAsync(new Upload_GetWebFile_ + { + location = location, + offset = offset, + limit = limit, + }); [TLDef(0x2000BCC3)] - public record Upload_GetCdnFile_(byte[] file_token, int offset, int limit) : IMethod; + public partial class Upload_GetCdnFile_ : IMethod + { + public byte[] file_token; + public int offset; + public int limit; + } /// Download a CDN file. See /// File token /// Offset of chunk to download /// Length of chunk to download public static Task Upload_GetCdnFile(this Client client, byte[] file_token, int offset, int limit) - => client.CallAsync(new Upload_GetCdnFile_(file_token, offset, limit)); + => client.CallAsync(new Upload_GetCdnFile_ + { + file_token = file_token, + offset = offset, + limit = limit, + }); [TLDef(0x9B2754A8)] - public record Upload_ReuploadCdnFile_(byte[] file_token, byte[] request_token) : IMethod; + public partial class Upload_ReuploadCdnFile_ : IMethod + { + public byte[] file_token; + public byte[] request_token; + } /// Request a reupload of a certain file to a CDN DC. See [bots: ✓] Possible codes: 400 (details) /// File token /// Request token public static Task Upload_ReuploadCdnFile(this Client client, byte[] file_token, byte[] request_token) - => client.CallAsync(new Upload_ReuploadCdnFile_(file_token, request_token)); + => client.CallAsync(new Upload_ReuploadCdnFile_ + { + file_token = file_token, + request_token = request_token, + }); [TLDef(0x4DA54231)] - public record Upload_GetCdnFileHashes_(byte[] file_token, int offset) : IMethod; + public partial class Upload_GetCdnFileHashes_ : IMethod + { + public byte[] file_token; + public int offset; + } /// Get SHA256 hashes for verifying downloaded CDN files See [bots: ✓] Possible codes: 400 (details) /// File /// Offset from which to start getting hashes public static Task Upload_GetCdnFileHashes(this Client client, byte[] file_token, int offset) - => client.CallAsync(new Upload_GetCdnFileHashes_(file_token, offset)); + => client.CallAsync(new Upload_GetCdnFileHashes_ + { + file_token = file_token, + offset = offset, + }); [TLDef(0xC7025931)] - public record Upload_GetFileHashes_(InputFileLocationBase location, int offset) : IMethod; + public partial class Upload_GetFileHashes_ : IMethod + { + public InputFileLocationBase location; + public int offset; + } /// Get SHA256 hashes for verifying downloaded files See [bots: ✓] Possible codes: 400 (details) /// File /// Offset from which to get file hashes public static Task Upload_GetFileHashes(this Client client, InputFileLocationBase location, int offset) - => client.CallAsync(new Upload_GetFileHashes_(location, offset)); + => client.CallAsync(new Upload_GetFileHashes_ + { + location = location, + offset = offset, + }); [TLDef(0xC4F9186B)] - public record Help_GetConfig_() : IMethod; + public partial class Help_GetConfig_ : IMethod { } /// Returns current configuration, including data center configuration. See [bots: ✓] Possible codes: 400,403 (details) public static Task Help_GetConfig(this Client client) - => client.CallAsync(new Help_GetConfig_()); + => client.CallAsync(new Help_GetConfig_ + { + }); [TLDef(0x1FB33026)] - public record Help_GetNearestDc_() : IMethod; + public partial class Help_GetNearestDc_ : IMethod { } /// Returns info on data centre nearest to the user. See public static Task Help_GetNearestDc(this Client client) - => client.CallAsync(new Help_GetNearestDc_()); + => client.CallAsync(new Help_GetNearestDc_ + { + }); [TLDef(0x522D5A7D)] - public record Help_GetAppUpdate_(string source) : IMethod; + public partial class Help_GetAppUpdate_ : IMethod + { + public string source; + } /// Returns information on update availability for the current application. See /// Source /// a null value means help.noAppUpdate public static Task Help_GetAppUpdate(this Client client, string source) - => client.CallAsync(new Help_GetAppUpdate_(source)); + => client.CallAsync(new Help_GetAppUpdate_ + { + source = source, + }); [TLDef(0x4D392343)] - public record Help_GetInviteText_() : IMethod; + public partial class Help_GetInviteText_ : IMethod { } /// Returns localized text of a text message with an invitation. See public static Task Help_GetInviteText(this Client client) - => client.CallAsync(new Help_GetInviteText_()); + => client.CallAsync(new Help_GetInviteText_ + { + }); [TLDef(0x9CDF08CD)] - public record Help_GetSupport_() : IMethod; + public partial class Help_GetSupport_ : IMethod { } /// Returns the support user for the 'ask a question' feature. See public static Task Help_GetSupport(this Client client) - => client.CallAsync(new Help_GetSupport_()); + => client.CallAsync(new Help_GetSupport_ + { + }); [TLDef(0x9010EF6F)] - public record Help_GetAppChangelog_(string prev_app_version) : IMethod; + public partial class Help_GetAppChangelog_ : IMethod + { + public string prev_app_version; + } /// Get changelog of current app.
Typically, an constructor will be returned, containing one or more updates with app-specific changelogs. See
/// Previous app version public static Task Help_GetAppChangelog(this Client client, string prev_app_version) - => client.CallAsync(new Help_GetAppChangelog_(prev_app_version)); + => client.CallAsync(new Help_GetAppChangelog_ + { + prev_app_version = prev_app_version, + }); [TLDef(0xEC22CFCD)] - public record Help_SetBotUpdatesStatus_(int pending_updates_count, string message) : IMethod; + public partial class Help_SetBotUpdatesStatus_ : IMethod + { + public int pending_updates_count; + public string message; + } /// Informs the server about the number of pending bot updates if they haven't been processed for a long time; for bots only See [bots: ✓] /// Number of pending updates /// Error message, if present public static Task Help_SetBotUpdatesStatus(this Client client, int pending_updates_count, string message) - => client.CallAsync(new Help_SetBotUpdatesStatus_(pending_updates_count, message)); + => client.CallAsync(new Help_SetBotUpdatesStatus_ + { + pending_updates_count = pending_updates_count, + message = message, + }); [TLDef(0x52029342)] - public record Help_GetCdnConfig_() : IMethod; + public partial class Help_GetCdnConfig_ : IMethod { } /// Get configuration for CDN file downloads. See [bots: ✓] Possible codes: 401 (details) public static Task Help_GetCdnConfig(this Client client) - => client.CallAsync(new Help_GetCdnConfig_()); + => client.CallAsync(new Help_GetCdnConfig_ + { + }); [TLDef(0x3DC0F114)] - public record Help_GetRecentMeUrls_(string referer) : IMethod; + public partial class Help_GetRecentMeUrls_ : IMethod + { + public string referer; + } /// Get recently used t.me links See /// Referer public static Task Help_GetRecentMeUrls(this Client client, string referer) - => client.CallAsync(new Help_GetRecentMeUrls_(referer)); + => client.CallAsync(new Help_GetRecentMeUrls_ + { + referer = referer, + }); [TLDef(0x2CA51FD1)] - public record Help_GetTermsOfServiceUpdate_() : IMethod; + public partial class Help_GetTermsOfServiceUpdate_ : IMethod { } /// Look for updates of telegram's terms of service See public static Task Help_GetTermsOfServiceUpdate(this Client client) - => client.CallAsync(new Help_GetTermsOfServiceUpdate_()); + => client.CallAsync(new Help_GetTermsOfServiceUpdate_ + { + }); [TLDef(0xEE72F79A)] - public record Help_AcceptTermsOfService_(DataJSON id) : IMethod; + public partial class Help_AcceptTermsOfService_ : IMethod + { + public DataJSON id; + } /// Accept the new terms of service See /// ID of terms of service public static Task Help_AcceptTermsOfService(this Client client, DataJSON id) - => client.CallAsync(new Help_AcceptTermsOfService_(id)); + => client.CallAsync(new Help_AcceptTermsOfService_ + { + id = id, + }); [TLDef(0x3FEDC75F)] - public record Help_GetDeepLinkInfo_(string path) : IMethod; + public partial class Help_GetDeepLinkInfo_ : IMethod + { + public string path; + } /// Get info about a t.me link See /// Path in t.me/path /// a null value means help.deepLinkInfoEmpty public static Task Help_GetDeepLinkInfo(this Client client, string path) - => client.CallAsync(new Help_GetDeepLinkInfo_(path)); + => client.CallAsync(new Help_GetDeepLinkInfo_ + { + path = path, + }); [TLDef(0x98914110)] - public record Help_GetAppConfig_() : IMethod; + public partial class Help_GetAppConfig_ : IMethod { } /// Get app-specific configuration, see client configuration for more info on the result. See public static Task Help_GetAppConfig(this Client client) - => client.CallAsync(new Help_GetAppConfig_()); + => client.CallAsync(new Help_GetAppConfig_ + { + }); [TLDef(0x6F02F748)] - public record Help_SaveAppLog_(InputAppEvent[] events) : IMethod; + public partial class Help_SaveAppLog_ : IMethod + { + public InputAppEvent[] events; + } /// Saves logs of application on the server. See /// List of input events public static Task Help_SaveAppLog(this Client client, InputAppEvent[] events) - => client.CallAsync(new Help_SaveAppLog_(events)); + => client.CallAsync(new Help_SaveAppLog_ + { + events = events, + }); [TLDef(0xC661AD08)] - public record Help_GetPassportConfig_(int hash) : IMethod; + public partial class Help_GetPassportConfig_ : IMethod + { + public int hash; + } /// Get passport configuration See /// Hash for pagination, for more info click here /// a null value means help.passportConfigNotModified public static Task Help_GetPassportConfig(this Client client, int hash) - => client.CallAsync(new Help_GetPassportConfig_(hash)); + => client.CallAsync(new Help_GetPassportConfig_ + { + hash = hash, + }); [TLDef(0xD360E72C)] - public record Help_GetSupportName_() : IMethod; + public partial class Help_GetSupportName_ : IMethod { } /// Get localized name of the telegram support user See Possible codes: 403 (details) public static Task Help_GetSupportName(this Client client) - => client.CallAsync(new Help_GetSupportName_()); + => client.CallAsync(new Help_GetSupportName_ + { + }); [TLDef(0x038A08D3)] - public record Help_GetUserInfo_(InputUserBase user_id) : IMethod; + public partial class Help_GetUserInfo_ : IMethod + { + public InputUserBase user_id; + } /// Internal use See Possible codes: 403 (details) /// User ID /// a null value means help.userInfoEmpty public static Task Help_GetUserInfo(this Client client, InputUserBase user_id) - => client.CallAsync(new Help_GetUserInfo_(user_id)); + => client.CallAsync(new Help_GetUserInfo_ + { + user_id = user_id, + }); [TLDef(0x66B91B70)] - public record Help_EditUserInfo_(InputUserBase user_id, string message, MessageEntity[] entities) : IMethod; + public partial class Help_EditUserInfo_ : IMethod + { + public InputUserBase user_id; + public string message; + public MessageEntity[] entities; + } /// Internal use See Possible codes: 400 (details) /// User /// Message /// Message entities for styled text /// a null value means help.userInfoEmpty public static Task Help_EditUserInfo(this Client client, InputUserBase user_id, string message, MessageEntity[] entities) - => client.CallAsync(new Help_EditUserInfo_(user_id, message, entities)); + => client.CallAsync(new Help_EditUserInfo_ + { + user_id = user_id, + message = message, + entities = entities, + }); [TLDef(0xC0977421)] - public record Help_GetPromoData_() : IMethod; + public partial class Help_GetPromoData_ : IMethod { } /// Get MTProxy/Public Service Announcement information See public static Task Help_GetPromoData(this Client client) - => client.CallAsync(new Help_GetPromoData_()); + => client.CallAsync(new Help_GetPromoData_ + { + }); [TLDef(0x1E251C95)] - public record Help_HidePromoData_(InputPeer peer) : IMethod; + public partial class Help_HidePromoData_ : IMethod + { + public InputPeer peer; + } /// Hide MTProxy/Public Service Announcement information See /// Peer to hide public static Task Help_HidePromoData(this Client client, InputPeer peer) - => client.CallAsync(new Help_HidePromoData_(peer)); + => client.CallAsync(new Help_HidePromoData_ + { + peer = peer, + }); [TLDef(0xF50DBAA1)] - public record Help_DismissSuggestion_(InputPeer peer, string suggestion) : IMethod; + public partial class Help_DismissSuggestion_ : IMethod + { + public InputPeer peer; + public string suggestion; + } /// Dismiss a suggestion, see here for more info ». See /// In the case of pending suggestions in , the channel ID. /// Suggestion, see here for more info ». public static Task Help_DismissSuggestion(this Client client, InputPeer peer, string suggestion) - => client.CallAsync(new Help_DismissSuggestion_(peer, suggestion)); + => client.CallAsync(new Help_DismissSuggestion_ + { + peer = peer, + suggestion = suggestion, + }); [TLDef(0x735787A8)] - public record Help_GetCountriesList_(string lang_code, int hash) : IMethod; + public partial class Help_GetCountriesList_ : IMethod + { + public string lang_code; + public int hash; + } /// Get name, ISO code, localized name and phone codes/patterns of all available countries See /// Language code of the current user /// Hash for pagination, for more info click here /// a null value means help.countriesListNotModified public static Task Help_GetCountriesList(this Client client, string lang_code, int hash) - => client.CallAsync(new Help_GetCountriesList_(lang_code, hash)); + => client.CallAsync(new Help_GetCountriesList_ + { + lang_code = lang_code, + hash = hash, + }); [TLDef(0xCC104937)] - public record Channels_ReadHistory_(InputChannelBase channel, int max_id) : IMethod; + public partial class Channels_ReadHistory_ : IMethod + { + public InputChannelBase channel; + public int max_id; + } /// Mark channel/supergroup history as read See Possible codes: 400 (details) /// Channel/supergroup /// ID of message up to which messages should be marked as read public static Task Channels_ReadHistory(this Client client, InputChannelBase channel, int max_id) - => client.CallAsync(new Channels_ReadHistory_(channel, max_id)); + => client.CallAsync(new Channels_ReadHistory_ + { + channel = channel, + max_id = max_id, + }); [TLDef(0x84C1FD4E)] - public record Channels_DeleteMessages_(InputChannelBase channel, int[] id) : IMethod; + public partial class Channels_DeleteMessages_ : IMethod + { + public InputChannelBase channel; + public int[] id; + } /// Delete messages in a channel/supergroup See [bots: ✓] Possible codes: 400,403 (details) /// Channel/supergroup /// IDs of messages to delete public static Task Channels_DeleteMessages(this Client client, InputChannelBase channel, int[] id) - => client.CallAsync(new Channels_DeleteMessages_(channel, id)); + => client.CallAsync(new Channels_DeleteMessages_ + { + channel = channel, + id = id, + }); [TLDef(0xD10DD71B)] - public record Channels_DeleteUserHistory_(InputChannelBase channel, InputUserBase user_id) : IMethod; + public partial class Channels_DeleteUserHistory_ : IMethod + { + public InputChannelBase channel; + public InputUserBase user_id; + } /// Delete all messages sent by a certain user in a supergroup See Possible codes: 400,403 (details) /// Supergroup /// User whose messages should be deleted public static Task Channels_DeleteUserHistory(this Client client, InputChannelBase channel, InputUserBase user_id) - => client.CallAsync(new Channels_DeleteUserHistory_(channel, user_id)); + => client.CallAsync(new Channels_DeleteUserHistory_ + { + channel = channel, + user_id = user_id, + }); [TLDef(0xFE087810)] - public record Channels_ReportSpam_(InputChannelBase channel, InputUserBase user_id, int[] id) : IMethod; + public partial class Channels_ReportSpam_ : IMethod + { + public InputChannelBase channel; + public InputUserBase user_id; + public int[] id; + } /// Reports some messages from a user in a supergroup as spam; requires administrator rights in the supergroup See Possible codes: 400 (details) /// Supergroup /// ID of the user that sent the spam messages /// IDs of spam messages public static Task Channels_ReportSpam(this Client client, InputChannelBase channel, InputUserBase user_id, int[] id) - => client.CallAsync(new Channels_ReportSpam_(channel, user_id, id)); + => client.CallAsync(new Channels_ReportSpam_ + { + channel = channel, + user_id = user_id, + id = id, + }); [TLDef(0xAD8C9A23)] - public record Channels_GetMessages_(InputChannelBase channel, InputMessage[] id) : IMethod; + public partial class Channels_GetMessages_ : IMethod + { + public InputChannelBase channel; + public InputMessage[] id; + } /// Get channel/supergroup messages See [bots: ✓] Possible codes: 400 (details) /// Channel/supergroup /// IDs of messages to get public static Task Channels_GetMessages(this Client client, InputChannelBase channel, InputMessage[] id) - => client.CallAsync(new Channels_GetMessages_(channel, id)); + => client.CallAsync(new Channels_GetMessages_ + { + channel = channel, + id = id, + }); [TLDef(0x77CED9D0)] - public record Channels_GetParticipants_(InputChannelBase channel, ChannelParticipantsFilter filter, int offset, int limit, long hash) : IMethod; + public partial class Channels_GetParticipants_ : IMethod + { + public InputChannelBase channel; + public ChannelParticipantsFilter filter; + public int offset; + public int limit; + public long hash; + } /// Get the participants of a supergroup/channel See [bots: ✓] Possible codes: 400 (details) /// Channel /// Which participant types to fetch @@ -14860,32 +17906,75 @@ namespace TL /// Hash /// a null value means channels.channelParticipantsNotModified public static Task Channels_GetParticipants(this Client client, InputChannelBase channel, ChannelParticipantsFilter filter, int offset, int limit, long hash) - => client.CallAsync(new Channels_GetParticipants_(channel, filter, offset, limit, hash)); + => client.CallAsync(new Channels_GetParticipants_ + { + channel = channel, + filter = filter, + offset = offset, + limit = limit, + hash = hash, + }); [TLDef(0xA0AB6CC6)] - public record Channels_GetParticipant_(InputChannelBase channel, InputPeer participant) : IMethod; + public partial class Channels_GetParticipant_ : IMethod + { + public InputChannelBase channel; + public InputPeer participant; + } /// Get info about a channel/supergroup participant See [bots: ✓] Possible codes: 400 (details) /// Channel/supergroup /// Participant to get info about public static Task Channels_GetParticipant(this Client client, InputChannelBase channel, InputPeer participant) - => client.CallAsync(new Channels_GetParticipant_(channel, participant)); + => client.CallAsync(new Channels_GetParticipant_ + { + channel = channel, + participant = participant, + }); [TLDef(0x0A7F6BBB)] - public record Channels_GetChannels_(InputChannelBase[] id) : IMethod; + public partial class Channels_GetChannels_ : IMethod + { + public InputChannelBase[] id; + } /// Get info about channels/supergroups See [bots: ✓] Possible codes: 400 (details) /// IDs of channels/supergroups to get info about public static Task Channels_GetChannels(this Client client, InputChannelBase[] id) - => client.CallAsync(new Channels_GetChannels_(id)); + => client.CallAsync(new Channels_GetChannels_ + { + id = id, + }); [TLDef(0x08736A09)] - public record Channels_GetFullChannel_(InputChannelBase channel) : IMethod; + public partial class Channels_GetFullChannel_ : IMethod + { + public InputChannelBase channel; + } /// Get full info about a channel See [bots: ✓] Possible codes: 400,403 (details) /// The channel to get info about public static Task Channels_GetFullChannel(this Client client, InputChannelBase channel) - => client.CallAsync(new Channels_GetFullChannel_(channel)); + => client.CallAsync(new Channels_GetFullChannel_ + { + channel = channel, + }); [TLDef(0x3D5FB10F)] - public record Channels_CreateChannel_(int flags, string title, string about, [field:IfFlag(2)] InputGeoPoint geo_point, [field:IfFlag(2)] string address) : IMethod; + public partial class Channels_CreateChannel_ : IMethod + { + public Flags flags; + public string title; + public string about; + [IfFlag(2)] public InputGeoPoint geo_point; + [IfFlag(2)] public string address; + + [Flags] public enum Flags + { + broadcast = 0x1, + megagroup = 0x2, + /// Field has a value + has_geo_point = 0x4, + for_import = 0x8, + } + } /// Create a supergroup/channel. See Possible codes: 400,403 (details) /// Whether to create a channel /// Whether to create a supergroup @@ -14895,118 +17984,257 @@ namespace TL /// Geogroup location /// Geogroup address public static Task Channels_CreateChannel(this Client client, string title, string about, bool broadcast = false, bool megagroup = false, bool for_import = false, InputGeoPoint geo_point = null, string address = null) - => client.CallAsync(new Channels_CreateChannel_((broadcast ? 0x1 : 0) | (megagroup ? 0x2 : 0) | (for_import ? 0x8 : 0) | (geo_point != null ? 0x4 : 0) | (address != null ? 0x4 : 0), - title, about, geo_point, address)); + => client.CallAsync(new Channels_CreateChannel_ + { + flags = (Channels_CreateChannel_.Flags)((broadcast ? 0x1 : 0) | (megagroup ? 0x2 : 0) | (for_import ? 0x8 : 0) | (geo_point != null ? 0x4 : 0) | (address != null ? 0x4 : 0)), + title = title, + about = about, + geo_point = geo_point, + address = address, + }); [TLDef(0xD33C8902)] - public record Channels_EditAdmin_(InputChannelBase channel, InputUserBase user_id, ChatAdminRights admin_rights, string rank) : IMethod; + public partial class Channels_EditAdmin_ : IMethod + { + public InputChannelBase channel; + public InputUserBase user_id; + public ChatAdminRights admin_rights; + public string rank; + } /// Modify the admin rights of a user in a supergroup/channel. See [bots: ✓] Possible codes: 400,403,406 (details) /// The supergroup/channel. /// The ID of the user whose admin rights should be modified /// The admin rights /// Indicates the role (rank) of the admin in the group: just an arbitrary string public static Task Channels_EditAdmin(this Client client, InputChannelBase channel, InputUserBase user_id, ChatAdminRights admin_rights, string rank) - => client.CallAsync(new Channels_EditAdmin_(channel, user_id, admin_rights, rank)); + => client.CallAsync(new Channels_EditAdmin_ + { + channel = channel, + user_id = user_id, + admin_rights = admin_rights, + rank = rank, + }); [TLDef(0x566DECD0)] - public record Channels_EditTitle_(InputChannelBase channel, string title) : IMethod; + public partial class Channels_EditTitle_ : IMethod + { + public InputChannelBase channel; + public string title; + } /// Edit the name of a channel/supergroup See [bots: ✓] Possible codes: 400,403 (details) /// Channel/supergroup /// New name public static Task Channels_EditTitle(this Client client, InputChannelBase channel, string title) - => client.CallAsync(new Channels_EditTitle_(channel, title)); + => client.CallAsync(new Channels_EditTitle_ + { + channel = channel, + title = title, + }); [TLDef(0xF12E57C9)] - public record Channels_EditPhoto_(InputChannelBase channel, InputChatPhotoBase photo) : IMethod; + public partial class Channels_EditPhoto_ : IMethod + { + public InputChannelBase channel; + public InputChatPhotoBase photo; + } /// Change the photo of a channel/supergroup See [bots: ✓] Possible codes: 400,403 (details) /// Channel/supergroup whose photo should be edited /// New photo public static Task Channels_EditPhoto(this Client client, InputChannelBase channel, InputChatPhotoBase photo) - => client.CallAsync(new Channels_EditPhoto_(channel, photo)); + => client.CallAsync(new Channels_EditPhoto_ + { + channel = channel, + photo = photo, + }); [TLDef(0x10E6BD2C)] - public record Channels_CheckUsername_(InputChannelBase channel, string username) : IMethod; + public partial class Channels_CheckUsername_ : IMethod + { + public InputChannelBase channel; + public string username; + } /// Check if a username is free and can be assigned to a channel/supergroup See Possible codes: 400 (details) /// The channel/supergroup that will assigned the specified username /// The username to check public static Task Channels_CheckUsername(this Client client, InputChannelBase channel, string username) - => client.CallAsync(new Channels_CheckUsername_(channel, username)); + => client.CallAsync(new Channels_CheckUsername_ + { + channel = channel, + username = username, + }); [TLDef(0x3514B3DE)] - public record Channels_UpdateUsername_(InputChannelBase channel, string username) : IMethod; + public partial class Channels_UpdateUsername_ : IMethod + { + public InputChannelBase channel; + public string username; + } /// Change the username of a supergroup/channel See Possible codes: 400,403 (details) /// Channel /// New username public static Task Channels_UpdateUsername(this Client client, InputChannelBase channel, string username) - => client.CallAsync(new Channels_UpdateUsername_(channel, username)); + => client.CallAsync(new Channels_UpdateUsername_ + { + channel = channel, + username = username, + }); [TLDef(0x24B524C5)] - public record Channels_JoinChannel_(InputChannelBase channel) : IMethod; + public partial class Channels_JoinChannel_ : IMethod + { + public InputChannelBase channel; + } /// Join a channel/supergroup See Possible codes: 400 (details) /// Channel/supergroup to join public static Task Channels_JoinChannel(this Client client, InputChannelBase channel) - => client.CallAsync(new Channels_JoinChannel_(channel)); + => client.CallAsync(new Channels_JoinChannel_ + { + channel = channel, + }); [TLDef(0xF836AA95)] - public record Channels_LeaveChannel_(InputChannelBase channel) : IMethod; + public partial class Channels_LeaveChannel_ : IMethod + { + public InputChannelBase channel; + } /// Leave a channel/supergroup See [bots: ✓] Possible codes: 400,403 (details) /// Channel/supergroup to leave public static Task Channels_LeaveChannel(this Client client, InputChannelBase channel) - => client.CallAsync(new Channels_LeaveChannel_(channel)); + => client.CallAsync(new Channels_LeaveChannel_ + { + channel = channel, + }); [TLDef(0x199F3A6C)] - public record Channels_InviteToChannel_(InputChannelBase channel, InputUserBase[] users) : IMethod; + public partial class Channels_InviteToChannel_ : IMethod + { + public InputChannelBase channel; + public InputUserBase[] users; + } /// Invite users to a channel/supergroup See Possible codes: 400,403 (details) /// Channel/supergroup /// Users to invite public static Task Channels_InviteToChannel(this Client client, InputChannelBase channel, InputUserBase[] users) - => client.CallAsync(new Channels_InviteToChannel_(channel, users)); + => client.CallAsync(new Channels_InviteToChannel_ + { + channel = channel, + users = users, + }); [TLDef(0xC0111FE3)] - public record Channels_DeleteChannel_(InputChannelBase channel) : IMethod; + public partial class Channels_DeleteChannel_ : IMethod + { + public InputChannelBase channel; + } /// Delete a channel/supergroup See Possible codes: 400,403 (details) /// Channel/supergroup to delete public static Task Channels_DeleteChannel(this Client client, InputChannelBase channel) - => client.CallAsync(new Channels_DeleteChannel_(channel)); + => client.CallAsync(new Channels_DeleteChannel_ + { + channel = channel, + }); [TLDef(0xE63FADEB)] - public record Channels_ExportMessageLink_(int flags, InputChannelBase channel, int id) : IMethod; + public partial class Channels_ExportMessageLink_ : IMethod + { + public Flags flags; + public InputChannelBase channel; + public int id; + + [Flags] public enum Flags + { + grouped = 0x1, + thread = 0x2, + } + } /// Get link and embed info of a message in a channel/supergroup See Possible codes: 400 (details) /// Whether to include other grouped media (for albums) /// Whether to also include a thread ID, if available, inside of the link /// Channel /// Message ID public static Task Channels_ExportMessageLink(this Client client, InputChannelBase channel, int id, bool grouped = false, bool thread = false) - => client.CallAsync(new Channels_ExportMessageLink_((grouped ? 0x1 : 0) | (thread ? 0x2 : 0), - channel, id)); + => client.CallAsync(new Channels_ExportMessageLink_ + { + flags = (Channels_ExportMessageLink_.Flags)((grouped ? 0x1 : 0) | (thread ? 0x2 : 0)), + channel = channel, + id = id, + }); [TLDef(0x1F69B606)] - public record Channels_ToggleSignatures_(InputChannelBase channel, bool enabled) : IMethod; + public partial class Channels_ToggleSignatures_ : IMethod + { + public InputChannelBase channel; + public bool enabled; + } /// Enable/disable message signatures in channels See Possible codes: 400 (details) /// Channel /// Value public static Task Channels_ToggleSignatures(this Client client, InputChannelBase channel, bool enabled) - => client.CallAsync(new Channels_ToggleSignatures_(channel, enabled)); + => client.CallAsync(new Channels_ToggleSignatures_ + { + channel = channel, + enabled = enabled, + }); [TLDef(0xF8B036AF)] - public record Channels_GetAdminedPublicChannels_(int flags) : IMethod; + public partial class Channels_GetAdminedPublicChannels_ : IMethod + { + public Flags flags; + + [Flags] public enum Flags + { + by_location = 0x1, + check_limit = 0x2, + } + } /// Get channels/supergroups/geogroups we're admin in. Usually called when the user exceeds the for owned public channels/supergroups/geogroups, and the user is given the choice to remove one of his channels/supergroups/geogroups. See Possible codes: 400 (details) /// Get geogroups /// If set and the user has reached the limit of owned public channels/supergroups/geogroups, instead of returning the channel list one of the specified errors will be returned.
Useful to check if a new public channel can indeed be created, even before asking the user to enter a channel username to use in channels.checkUsername/channels.updateUsername. public static Task Channels_GetAdminedPublicChannels(this Client client, bool by_location = false, bool check_limit = false) - => client.CallAsync(new Channels_GetAdminedPublicChannels_((by_location ? 0x1 : 0) | (check_limit ? 0x2 : 0))); + => client.CallAsync(new Channels_GetAdminedPublicChannels_ + { + flags = (Channels_GetAdminedPublicChannels_.Flags)((by_location ? 0x1 : 0) | (check_limit ? 0x2 : 0)), + }); [TLDef(0x96E6CD81)] - public record Channels_EditBanned_(InputChannelBase channel, InputPeer participant, ChatBannedRights banned_rights) : IMethod; + public partial class Channels_EditBanned_ : IMethod + { + public InputChannelBase channel; + public InputPeer participant; + public ChatBannedRights banned_rights; + } /// Ban/unban/kick a user in a supergroup/channel. See [bots: ✓] Possible codes: 400,403 (details) /// The supergroup/channel. /// Participant to ban /// The banned rights public static Task Channels_EditBanned(this Client client, InputChannelBase channel, InputPeer participant, ChatBannedRights banned_rights) - => client.CallAsync(new Channels_EditBanned_(channel, participant, banned_rights)); + => client.CallAsync(new Channels_EditBanned_ + { + channel = channel, + participant = participant, + banned_rights = banned_rights, + }); [TLDef(0x33DDF480)] - public record Channels_GetAdminLog_(int flags, InputChannelBase channel, string q, [field:IfFlag(0)] ChannelAdminLogEventsFilter events_filter, [field:IfFlag(1)] InputUserBase[] admins, long max_id, long min_id, int limit) : IMethod; + public partial class Channels_GetAdminLog_ : IMethod + { + public Flags flags; + public InputChannelBase channel; + public string q; + [IfFlag(0)] public ChannelAdminLogEventsFilter events_filter; + [IfFlag(1)] public InputUserBase[] admins; + public long max_id; + public long min_id; + public int limit; + + [Flags] public enum Flags + { + /// Field has a value + has_events_filter = 0x1, + /// Field has a value + has_admins = 0x2, + } + } /// Get the admin log of a channel/supergroup See Possible codes: 400,403 (details) /// Channel /// Search query, can be empty @@ -15016,186 +18244,397 @@ namespace TL /// Minimum ID of message to return (see pagination) /// Maximum number of results to return, see pagination public static Task Channels_GetAdminLog(this Client client, InputChannelBase channel, string q, long max_id, long min_id, int limit, ChannelAdminLogEventsFilter events_filter = null, InputUserBase[] admins = null) - => client.CallAsync(new Channels_GetAdminLog_((events_filter != null ? 0x1 : 0) | (admins != null ? 0x2 : 0), - channel, q, events_filter, admins, max_id, min_id, limit)); + => client.CallAsync(new Channels_GetAdminLog_ + { + flags = (Channels_GetAdminLog_.Flags)((events_filter != null ? 0x1 : 0) | (admins != null ? 0x2 : 0)), + channel = channel, + q = q, + events_filter = events_filter, + admins = admins, + max_id = max_id, + min_id = min_id, + limit = limit, + }); [TLDef(0xEA8CA4F9)] - public record Channels_SetStickers_(InputChannelBase channel, InputStickerSet stickerset) : IMethod; + public partial class Channels_SetStickers_ : IMethod + { + public InputChannelBase channel; + public InputStickerSet stickerset; + } /// Associate a stickerset to the supergroup See [bots: ✓] Possible codes: 400,406 (details) /// Supergroup /// The stickerset to associate public static Task Channels_SetStickers(this Client client, InputChannelBase channel, InputStickerSet stickerset) - => client.CallAsync(new Channels_SetStickers_(channel, stickerset)); + => client.CallAsync(new Channels_SetStickers_ + { + channel = channel, + stickerset = stickerset, + }); [TLDef(0xEAB5DC38)] - public record Channels_ReadMessageContents_(InputChannelBase channel, int[] id) : IMethod; + public partial class Channels_ReadMessageContents_ : IMethod + { + public InputChannelBase channel; + public int[] id; + } /// Mark channel/supergroup message contents as read See Possible codes: 400 (details) /// Channel/supergroup /// IDs of messages whose contents should be marked as read public static Task Channels_ReadMessageContents(this Client client, InputChannelBase channel, int[] id) - => client.CallAsync(new Channels_ReadMessageContents_(channel, id)); + => client.CallAsync(new Channels_ReadMessageContents_ + { + channel = channel, + id = id, + }); [TLDef(0xAF369D42)] - public record Channels_DeleteHistory_(InputChannelBase channel, int max_id) : IMethod; + public partial class Channels_DeleteHistory_ : IMethod + { + public InputChannelBase channel; + public int max_id; + } /// Delete the history of a supergroup See Possible codes: 400 (details) /// Supergroup whose history must be deleted /// ID of message up to which the history must be deleted public static Task Channels_DeleteHistory(this Client client, InputChannelBase channel, int max_id) - => client.CallAsync(new Channels_DeleteHistory_(channel, max_id)); + => client.CallAsync(new Channels_DeleteHistory_ + { + channel = channel, + max_id = max_id, + }); [TLDef(0xEABBB94C)] - public record Channels_TogglePreHistoryHidden_(InputChannelBase channel, bool enabled) : IMethod; + public partial class Channels_TogglePreHistoryHidden_ : IMethod + { + public InputChannelBase channel; + public bool enabled; + } /// Hide/unhide message history for new channel/supergroup users See Possible codes: 400 (details) /// Channel/supergroup /// Hide/unhide public static Task Channels_TogglePreHistoryHidden(this Client client, InputChannelBase channel, bool enabled) - => client.CallAsync(new Channels_TogglePreHistoryHidden_(channel, enabled)); + => client.CallAsync(new Channels_TogglePreHistoryHidden_ + { + channel = channel, + enabled = enabled, + }); [TLDef(0x8341ECC0)] - public record Channels_GetLeftChannels_(int offset) : IMethod; + public partial class Channels_GetLeftChannels_ : IMethod + { + public int offset; + } /// Get a list of channels/supergroups we left See Possible codes: 403 (details) /// Offset for pagination public static Task Channels_GetLeftChannels(this Client client, int offset) - => client.CallAsync(new Channels_GetLeftChannels_(offset)); + => client.CallAsync(new Channels_GetLeftChannels_ + { + offset = offset, + }); [TLDef(0xF5DAD378)] - public record Channels_GetGroupsForDiscussion_() : IMethod; + public partial class Channels_GetGroupsForDiscussion_ : IMethod { } /// Get all groups that can be used as discussion groups. See public static Task Channels_GetGroupsForDiscussion(this Client client) - => client.CallAsync(new Channels_GetGroupsForDiscussion_()); + => client.CallAsync(new Channels_GetGroupsForDiscussion_ + { + }); [TLDef(0x40582BB2)] - public record Channels_SetDiscussionGroup_(InputChannelBase broadcast, InputChannelBase group) : IMethod; + public partial class Channels_SetDiscussionGroup_ : IMethod + { + public InputChannelBase broadcast; + public InputChannelBase group; + } /// Associate a group to a channel as discussion group for that channel See Possible codes: 400 (details) /// Channel /// Discussion group to associate to the channel public static Task Channels_SetDiscussionGroup(this Client client, InputChannelBase broadcast, InputChannelBase group) - => client.CallAsync(new Channels_SetDiscussionGroup_(broadcast, group)); + => client.CallAsync(new Channels_SetDiscussionGroup_ + { + broadcast = broadcast, + group = group, + }); [TLDef(0x8F38CD1F)] - public record Channels_EditCreator_(InputChannelBase channel, InputUserBase user_id, InputCheckPasswordSRP password) : IMethod; + public partial class Channels_EditCreator_ : IMethod + { + public InputChannelBase channel; + public InputUserBase user_id; + public InputCheckPasswordSRP password; + } /// Transfer channel ownership See Possible codes: 400,403 (details) /// Channel /// New channel owner /// 2FA password of account public static Task Channels_EditCreator(this Client client, InputChannelBase channel, InputUserBase user_id, InputCheckPasswordSRP password) - => client.CallAsync(new Channels_EditCreator_(channel, user_id, password)); + => client.CallAsync(new Channels_EditCreator_ + { + channel = channel, + user_id = user_id, + password = password, + }); [TLDef(0x58E63F6D)] - public record Channels_EditLocation_(InputChannelBase channel, InputGeoPoint geo_point, string address) : IMethod; + public partial class Channels_EditLocation_ : IMethod + { + public InputChannelBase channel; + public InputGeoPoint geo_point; + public string address; + } /// Edit location of geogroup See Possible codes: 400 (details) /// Geogroup /// New geolocation /// Address string public static Task Channels_EditLocation(this Client client, InputChannelBase channel, InputGeoPoint geo_point, string address) - => client.CallAsync(new Channels_EditLocation_(channel, geo_point, address)); + => client.CallAsync(new Channels_EditLocation_ + { + channel = channel, + geo_point = geo_point, + address = address, + }); [TLDef(0xEDD49EF0)] - public record Channels_ToggleSlowMode_(InputChannelBase channel, int seconds) : IMethod; + public partial class Channels_ToggleSlowMode_ : IMethod + { + public InputChannelBase channel; + public int seconds; + } /// Toggle supergroup slow mode: if enabled, users will only be able to send one message every seconds seconds See Possible codes: 400 (details) /// The supergroup /// Users will only be able to send one message every seconds seconds, 0 to disable the limitation public static Task Channels_ToggleSlowMode(this Client client, InputChannelBase channel, int seconds) - => client.CallAsync(new Channels_ToggleSlowMode_(channel, seconds)); + => client.CallAsync(new Channels_ToggleSlowMode_ + { + channel = channel, + seconds = seconds, + }); [TLDef(0x11E831EE)] - public record Channels_GetInactiveChannels_() : IMethod; + public partial class Channels_GetInactiveChannels_ : IMethod { } /// Get inactive channels and supergroups See public static Task Channels_GetInactiveChannels(this Client client) - => client.CallAsync(new Channels_GetInactiveChannels_()); + => client.CallAsync(new Channels_GetInactiveChannels_ + { + }); [TLDef(0x0B290C69)] - public record Channels_ConvertToGigagroup_(InputChannelBase channel) : IMethod; + public partial class Channels_ConvertToGigagroup_ : IMethod + { + public InputChannelBase channel; + } /// See public static Task Channels_ConvertToGigagroup(this Client client, InputChannelBase channel) - => client.CallAsync(new Channels_ConvertToGigagroup_(channel)); + => client.CallAsync(new Channels_ConvertToGigagroup_ + { + channel = channel, + }); [TLDef(0xBEAEDB94)] - public record Channels_ViewSponsoredMessage_(InputChannelBase channel, byte[] random_id) : IMethod; + public partial class Channels_ViewSponsoredMessage_ : IMethod + { + public InputChannelBase channel; + public byte[] random_id; + } /// Mark a specific sponsored message as read See Possible codes: 400 (details) /// Peer /// Message ID public static Task Channels_ViewSponsoredMessage(this Client client, InputChannelBase channel, byte[] random_id) - => client.CallAsync(new Channels_ViewSponsoredMessage_(channel, random_id)); + => client.CallAsync(new Channels_ViewSponsoredMessage_ + { + channel = channel, + random_id = random_id, + }); [TLDef(0xEC210FBF)] - public record Channels_GetSponsoredMessages_(InputChannelBase channel) : IMethod; + public partial class Channels_GetSponsoredMessages_ : IMethod + { + public InputChannelBase channel; + } /// Get a list of sponsored messages See /// Peer public static Task Channels_GetSponsoredMessages(this Client client, InputChannelBase channel) - => client.CallAsync(new Channels_GetSponsoredMessages_(channel)); + => client.CallAsync(new Channels_GetSponsoredMessages_ + { + channel = channel, + }); [TLDef(0xAA2769ED)] - public record Bots_SendCustomRequest_(string custom_method, DataJSON params_) : IMethod; + public partial class Bots_SendCustomRequest_ : IMethod + { + public string custom_method; + public DataJSON params_; + } /// Sends a custom request; for bots only See [bots: ✓] Possible codes: 400 (details) /// The method name /// JSON-serialized method parameters public static Task Bots_SendCustomRequest(this Client client, string custom_method, DataJSON params_) - => client.CallAsync(new Bots_SendCustomRequest_(custom_method, params_)); + => client.CallAsync(new Bots_SendCustomRequest_ + { + custom_method = custom_method, + params_ = params_, + }); [TLDef(0xE6213F4D)] - public record Bots_AnswerWebhookJSONQuery_(long query_id, DataJSON data) : IMethod; + public partial class Bots_AnswerWebhookJSONQuery_ : IMethod + { + public long query_id; + public DataJSON data; + } /// Answers a custom query; for bots only See [bots: ✓] Possible codes: 400 (details) /// Identifier of a custom query /// JSON-serialized answer to the query public static Task Bots_AnswerWebhookJSONQuery(this Client client, long query_id, DataJSON data) - => client.CallAsync(new Bots_AnswerWebhookJSONQuery_(query_id, data)); + => client.CallAsync(new Bots_AnswerWebhookJSONQuery_ + { + query_id = query_id, + data = data, + }); [TLDef(0x0517165A)] - public record Bots_SetBotCommands_(BotCommandScope scope, string lang_code, BotCommand[] commands) : IMethod; + public partial class Bots_SetBotCommands_ : IMethod + { + public BotCommandScope scope; + public string lang_code; + public BotCommand[] commands; + } /// Set bot command list See [bots: ✓] Possible codes: 400 (details) /// Command scope /// Language code /// Bot commands public static Task Bots_SetBotCommands(this Client client, BotCommandScope scope, string lang_code, BotCommand[] commands) - => client.CallAsync(new Bots_SetBotCommands_(scope, lang_code, commands)); + => client.CallAsync(new Bots_SetBotCommands_ + { + scope = scope, + lang_code = lang_code, + commands = commands, + }); [TLDef(0x3D8DE0F9)] - public record Bots_ResetBotCommands_(BotCommandScope scope, string lang_code) : IMethod; + public partial class Bots_ResetBotCommands_ : IMethod + { + public BotCommandScope scope; + public string lang_code; + } /// Clear bot commands for the specified bot scope and language code See [bots: ✓] /// Command scope /// Language code public static Task Bots_ResetBotCommands(this Client client, BotCommandScope scope, string lang_code) - => client.CallAsync(new Bots_ResetBotCommands_(scope, lang_code)); + => client.CallAsync(new Bots_ResetBotCommands_ + { + scope = scope, + lang_code = lang_code, + }); [TLDef(0xE34C0DD6)] - public record Bots_GetBotCommands_(BotCommandScope scope, string lang_code) : IMethod; + public partial class Bots_GetBotCommands_ : IMethod + { + public BotCommandScope scope; + public string lang_code; + } /// Obtain a list of bot commands for the specified bot scope and language code See [bots: ✓] /// Command scope /// Language code public static Task Bots_GetBotCommands(this Client client, BotCommandScope scope, string lang_code) - => client.CallAsync(new Bots_GetBotCommands_(scope, lang_code)); + => client.CallAsync(new Bots_GetBotCommands_ + { + scope = scope, + lang_code = lang_code, + }); [TLDef(0x8A333C8D)] - public record Payments_GetPaymentForm_(int flags, InputPeer peer, int msg_id, [field:IfFlag(0)] DataJSON theme_params) : IMethod; + public partial class Payments_GetPaymentForm_ : IMethod + { + public Flags flags; + public InputPeer peer; + public int msg_id; + [IfFlag(0)] public DataJSON theme_params; + + [Flags] public enum Flags + { + /// Field has a value + has_theme_params = 0x1, + } + } /// Get a payment form See Possible codes: 400 (details) /// The peer where the payment form was sent /// Message ID of payment form /// A JSON object with the following keys, containing color theme information (integers, RGB24) to pass to the payment provider, to apply in eventual verification pages:
bg_color - Background color
text_color - Text color
hint_color - Hint text color
link_color - Link color
button_color - Button color
button_text_color - Button text color public static Task Payments_GetPaymentForm(this Client client, InputPeer peer, int msg_id, DataJSON theme_params = null) - => client.CallAsync(new Payments_GetPaymentForm_(theme_params != null ? 0x1 : 0, - peer, msg_id, theme_params)); + => client.CallAsync(new Payments_GetPaymentForm_ + { + flags = (Payments_GetPaymentForm_.Flags)(theme_params != null ? 0x1 : 0), + peer = peer, + msg_id = msg_id, + theme_params = theme_params, + }); [TLDef(0x2478D1CC)] - public record Payments_GetPaymentReceipt_(InputPeer peer, int msg_id) : IMethod; + public partial class Payments_GetPaymentReceipt_ : IMethod + { + public InputPeer peer; + public int msg_id; + } /// Get payment receipt See Possible codes: 400 (details) /// The peer where the payment receipt was sent /// Message ID of receipt public static Task Payments_GetPaymentReceipt(this Client client, InputPeer peer, int msg_id) - => client.CallAsync(new Payments_GetPaymentReceipt_(peer, msg_id)); + => client.CallAsync(new Payments_GetPaymentReceipt_ + { + peer = peer, + msg_id = msg_id, + }); [TLDef(0xDB103170)] - public record Payments_ValidateRequestedInfo_(int flags, InputPeer peer, int msg_id, PaymentRequestedInfo info) : IMethod; + public partial class Payments_ValidateRequestedInfo_ : IMethod + { + public Flags flags; + public InputPeer peer; + public int msg_id; + public PaymentRequestedInfo info; + + [Flags] public enum Flags + { + save = 0x1, + } + } /// Submit requested order information for validation See Possible codes: 400 (details) /// Save order information to re-use it for future orders /// Peer where the payment form was sent /// Message ID of payment form /// Requested order information public static Task Payments_ValidateRequestedInfo(this Client client, InputPeer peer, int msg_id, PaymentRequestedInfo info, bool save = false) - => client.CallAsync(new Payments_ValidateRequestedInfo_(save ? 0x1 : 0, peer, msg_id, info)); + => client.CallAsync(new Payments_ValidateRequestedInfo_ + { + flags = (Payments_ValidateRequestedInfo_.Flags)(save ? 0x1 : 0), + peer = peer, + msg_id = msg_id, + info = info, + }); [TLDef(0x30C3BC9D)] - public record Payments_SendPaymentForm_(int flags, long form_id, InputPeer peer, int msg_id, [field:IfFlag(0)] string requested_info_id, [field:IfFlag(1)] string shipping_option_id, InputPaymentCredentialsBase credentials, [field:IfFlag(2)] long tip_amount) : IMethod; + public partial class Payments_SendPaymentForm_ : IMethod + { + public Flags flags; + public long form_id; + public InputPeer peer; + public int msg_id; + [IfFlag(0)] public string requested_info_id; + [IfFlag(1)] public string shipping_option_id; + public InputPaymentCredentialsBase credentials; + [IfFlag(2)] public long tip_amount; + + [Flags] public enum Flags + { + /// Field has a value + has_requested_info_id = 0x1, + /// Field has a value + has_shipping_option_id = 0x2, + /// Field has a value + has_tip_amount = 0x4, + } + } /// Send compiled payment form See Possible codes: 400 (details) /// Form ID /// The peer where the payment form was sent @@ -15205,32 +18644,80 @@ namespace TL /// Payment credentials /// Tip, in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). public static Task Payments_SendPaymentForm(this Client client, long form_id, InputPeer peer, int msg_id, InputPaymentCredentialsBase credentials, string requested_info_id = null, string shipping_option_id = null, long? tip_amount = null) - => client.CallAsync(new Payments_SendPaymentForm_((requested_info_id != null ? 0x1 : 0) | (shipping_option_id != null ? 0x2 : 0) | (tip_amount != null ? 0x4 : 0), - form_id, peer, msg_id, requested_info_id, shipping_option_id, credentials, tip_amount.GetValueOrDefault())); + => client.CallAsync(new Payments_SendPaymentForm_ + { + flags = (Payments_SendPaymentForm_.Flags)((requested_info_id != null ? 0x1 : 0) | (shipping_option_id != null ? 0x2 : 0) | (tip_amount != null ? 0x4 : 0)), + form_id = form_id, + peer = peer, + msg_id = msg_id, + requested_info_id = requested_info_id, + shipping_option_id = shipping_option_id, + credentials = credentials, + tip_amount = tip_amount.GetValueOrDefault(), + }); [TLDef(0x227D824B)] - public record Payments_GetSavedInfo_() : IMethod; + public partial class Payments_GetSavedInfo_ : IMethod { } /// Get saved payment information See public static Task Payments_GetSavedInfo(this Client client) - => client.CallAsync(new Payments_GetSavedInfo_()); + => client.CallAsync(new Payments_GetSavedInfo_ + { + }); [TLDef(0xD83D70C1)] - public record Payments_ClearSavedInfo_(int flags) : IMethod; + public partial class Payments_ClearSavedInfo_ : IMethod + { + public Flags flags; + + [Flags] public enum Flags + { + credentials = 0x1, + info = 0x2, + } + } /// Clear saved payment information See /// Remove saved payment credentials /// Clear the last order settings saved by the user public static Task Payments_ClearSavedInfo(this Client client, bool credentials = false, bool info = false) - => client.CallAsync(new Payments_ClearSavedInfo_((credentials ? 0x1 : 0) | (info ? 0x2 : 0))); + => client.CallAsync(new Payments_ClearSavedInfo_ + { + flags = (Payments_ClearSavedInfo_.Flags)((credentials ? 0x1 : 0) | (info ? 0x2 : 0)), + }); [TLDef(0x2E79D779)] - public record Payments_GetBankCardData_(string number) : IMethod; + public partial class Payments_GetBankCardData_ : IMethod + { + public string number; + } /// Get info about a credit card See Possible codes: 400 (details) /// Credit card number public static Task Payments_GetBankCardData(this Client client, string number) - => client.CallAsync(new Payments_GetBankCardData_(number)); + => client.CallAsync(new Payments_GetBankCardData_ + { + number = number, + }); [TLDef(0x9021AB67)] - public record Stickers_CreateStickerSet_(int flags, InputUserBase user_id, string title, string short_name, [field:IfFlag(2)] InputDocument thumb, InputStickerSetItem[] stickers, [field:IfFlag(3)] string software) : IMethod; + public partial class Stickers_CreateStickerSet_ : IMethod + { + public Flags flags; + public InputUserBase user_id; + public string title; + public string short_name; + [IfFlag(2)] public InputDocument thumb; + public InputStickerSetItem[] stickers; + [IfFlag(3)] public string software; + + [Flags] public enum Flags + { + masks = 0x1, + animated = 0x2, + /// Field has a value + has_thumb = 0x4, + /// Field has a value + has_software = 0x8, + } + } /// Create a stickerset, bots only. See [bots: ✓] Possible codes: 400 (details) /// Whether this is a mask stickerset /// Whether this is an animated stickerset @@ -15241,62 +18728,126 @@ namespace TL /// Stickers /// Used when importing stickers using the sticker import SDKs, specifies the name of the software that created the stickers public static Task Stickers_CreateStickerSet(this Client client, InputUserBase user_id, string title, string short_name, InputStickerSetItem[] stickers, bool masks = false, bool animated = false, InputDocument thumb = null, string software = null) - => client.CallAsync(new Stickers_CreateStickerSet_((masks ? 0x1 : 0) | (animated ? 0x2 : 0) | (thumb != null ? 0x4 : 0) | (software != null ? 0x8 : 0), - user_id, title, short_name, thumb, stickers, software)); + => client.CallAsync(new Stickers_CreateStickerSet_ + { + flags = (Stickers_CreateStickerSet_.Flags)((masks ? 0x1 : 0) | (animated ? 0x2 : 0) | (thumb != null ? 0x4 : 0) | (software != null ? 0x8 : 0)), + user_id = user_id, + title = title, + short_name = short_name, + thumb = thumb, + stickers = stickers, + software = software, + }); [TLDef(0xF7760F51)] - public record Stickers_RemoveStickerFromSet_(InputDocument sticker) : IMethod; + public partial class Stickers_RemoveStickerFromSet_ : IMethod + { + public InputDocument sticker; + } /// Remove a sticker from the set where it belongs, bots only. The sticker set must have been created by the bot. See [bots: ✓] Possible codes: 400 (details) /// The sticker to remove public static Task Stickers_RemoveStickerFromSet(this Client client, InputDocument sticker) - => client.CallAsync(new Stickers_RemoveStickerFromSet_(sticker)); + => client.CallAsync(new Stickers_RemoveStickerFromSet_ + { + sticker = sticker, + }); [TLDef(0xFFB6D4CA)] - public record Stickers_ChangeStickerPosition_(InputDocument sticker, int position) : IMethod; + public partial class Stickers_ChangeStickerPosition_ : IMethod + { + public InputDocument sticker; + public int position; + } /// Changes the absolute position of a sticker in the set to which it belongs; for bots only. The sticker set must have been created by the bot See [bots: ✓] Possible codes: 400 (details) /// The sticker /// The new position of the sticker, zero-based public static Task Stickers_ChangeStickerPosition(this Client client, InputDocument sticker, int position) - => client.CallAsync(new Stickers_ChangeStickerPosition_(sticker, position)); + => client.CallAsync(new Stickers_ChangeStickerPosition_ + { + sticker = sticker, + position = position, + }); [TLDef(0x8653FEBE)] - public record Stickers_AddStickerToSet_(InputStickerSet stickerset, InputStickerSetItem sticker) : IMethod; + public partial class Stickers_AddStickerToSet_ : IMethod + { + public InputStickerSet stickerset; + public InputStickerSetItem sticker; + } /// Add a sticker to a stickerset, bots only. The sticker set must have been created by the bot. See [bots: ✓] Possible codes: 400 (details) /// The stickerset /// The sticker public static Task Stickers_AddStickerToSet(this Client client, InputStickerSet stickerset, InputStickerSetItem sticker) - => client.CallAsync(new Stickers_AddStickerToSet_(stickerset, sticker)); + => client.CallAsync(new Stickers_AddStickerToSet_ + { + stickerset = stickerset, + sticker = sticker, + }); [TLDef(0x9A364E30)] - public record Stickers_SetStickerSetThumb_(InputStickerSet stickerset, InputDocument thumb) : IMethod; + public partial class Stickers_SetStickerSetThumb_ : IMethod + { + public InputStickerSet stickerset; + public InputDocument thumb; + } /// Set stickerset thumbnail See [bots: ✓] Possible codes: 400 (details) /// Stickerset /// Thumbnail public static Task Stickers_SetStickerSetThumb(this Client client, InputStickerSet stickerset, InputDocument thumb) - => client.CallAsync(new Stickers_SetStickerSetThumb_(stickerset, thumb)); + => client.CallAsync(new Stickers_SetStickerSetThumb_ + { + stickerset = stickerset, + thumb = thumb, + }); [TLDef(0x284B3639)] - public record Stickers_CheckShortName_(string short_name) : IMethod; + public partial class Stickers_CheckShortName_ : IMethod + { + public string short_name; + } /// Check whether the given short name is available See Possible codes: 400 (details) /// Short name public static Task Stickers_CheckShortName(this Client client, string short_name) - => client.CallAsync(new Stickers_CheckShortName_(short_name)); + => client.CallAsync(new Stickers_CheckShortName_ + { + short_name = short_name, + }); [TLDef(0x4DAFC503)] - public record Stickers_SuggestShortName_(string title) : IMethod; + public partial class Stickers_SuggestShortName_ : IMethod + { + public string title; + } /// Suggests a short name for a given stickerpack name See Possible codes: 400 (details) /// Sticker pack name public static Task Stickers_SuggestShortName(this Client client, string title) - => client.CallAsync(new Stickers_SuggestShortName_(title)); + => client.CallAsync(new Stickers_SuggestShortName_ + { + title = title, + }); [TLDef(0x55451FA9)] - public record Phone_GetCallConfig_() : IMethod; + public partial class Phone_GetCallConfig_ : IMethod { } /// Get phone call configuration to be passed to libtgvoip's shared config See public static Task Phone_GetCallConfig(this Client client) - => client.CallAsync(new Phone_GetCallConfig_()); + => client.CallAsync(new Phone_GetCallConfig_ + { + }); [TLDef(0x42FF96ED)] - public record Phone_RequestCall_(int flags, InputUserBase user_id, int random_id, byte[] g_a_hash, PhoneCallProtocol protocol) : IMethod; + public partial class Phone_RequestCall_ : IMethod + { + public Flags flags; + public InputUserBase user_id; + public int random_id; + public byte[] g_a_hash; + public PhoneCallProtocol protocol; + + [Flags] public enum Flags + { + video = 0x1, + } + } /// Start a telegram phone call See Possible codes: 400,403 (details) /// Whether to start a video call /// Destination of the phone call @@ -15304,36 +18855,83 @@ namespace TL /// Parameter for E2E encryption key exchange » /// Phone call settings public static Task Phone_RequestCall(this Client client, InputUserBase user_id, int random_id, byte[] g_a_hash, PhoneCallProtocol protocol, bool video = false) - => client.CallAsync(new Phone_RequestCall_(video ? 0x1 : 0, user_id, random_id, g_a_hash, protocol)); + => client.CallAsync(new Phone_RequestCall_ + { + flags = (Phone_RequestCall_.Flags)(video ? 0x1 : 0), + user_id = user_id, + random_id = random_id, + g_a_hash = g_a_hash, + protocol = protocol, + }); [TLDef(0x3BD2B4A0)] - public record Phone_AcceptCall_(InputPhoneCall peer, byte[] g_b, PhoneCallProtocol protocol) : IMethod; + public partial class Phone_AcceptCall_ : IMethod + { + public InputPhoneCall peer; + public byte[] g_b; + public PhoneCallProtocol protocol; + } /// Accept incoming call See Possible codes: 400 (details) /// The call to accept /// Parameter for E2E encryption key exchange » /// Phone call settings public static Task Phone_AcceptCall(this Client client, InputPhoneCall peer, byte[] g_b, PhoneCallProtocol protocol) - => client.CallAsync(new Phone_AcceptCall_(peer, g_b, protocol)); + => client.CallAsync(new Phone_AcceptCall_ + { + peer = peer, + g_b = g_b, + protocol = protocol, + }); [TLDef(0x2EFE1722)] - public record Phone_ConfirmCall_(InputPhoneCall peer, byte[] g_a, long key_fingerprint, PhoneCallProtocol protocol) : IMethod; + public partial class Phone_ConfirmCall_ : IMethod + { + public InputPhoneCall peer; + public byte[] g_a; + public long key_fingerprint; + public PhoneCallProtocol protocol; + } /// Complete phone call E2E encryption key exchange » See Possible codes: 400 (details) /// The phone call /// Parameter for E2E encryption key exchange » /// Key fingerprint /// Phone call settings public static Task Phone_ConfirmCall(this Client client, InputPhoneCall peer, byte[] g_a, long key_fingerprint, PhoneCallProtocol protocol) - => client.CallAsync(new Phone_ConfirmCall_(peer, g_a, key_fingerprint, protocol)); + => client.CallAsync(new Phone_ConfirmCall_ + { + peer = peer, + g_a = g_a, + key_fingerprint = key_fingerprint, + protocol = protocol, + }); [TLDef(0x17D54F61)] - public record Phone_ReceivedCall_(InputPhoneCall peer) : IMethod; + public partial class Phone_ReceivedCall_ : IMethod + { + public InputPhoneCall peer; + } /// Optional: notify the server that the user is currently busy in a call: this will automatically refuse all incoming phone calls until the current phone call is ended. See Possible codes: 400 (details) /// The phone call we're currently in public static Task Phone_ReceivedCall(this Client client, InputPhoneCall peer) - => client.CallAsync(new Phone_ReceivedCall_(peer)); + => client.CallAsync(new Phone_ReceivedCall_ + { + peer = peer, + }); [TLDef(0xB2CBC1C0)] - public record Phone_DiscardCall_(int flags, InputPhoneCall peer, int duration, PhoneCallDiscardReason reason, long connection_id) : IMethod; + public partial class Phone_DiscardCall_ : IMethod + { + public Flags flags; + public InputPhoneCall peer; + public int duration; + public PhoneCallDiscardReason reason; + public long connection_id; + + [Flags] public enum Flags + { + video = 0x1, + } + } /// Refuse or end running call See Possible codes: 400 (details) /// Whether this is a video call /// The phone call @@ -15341,47 +18939,123 @@ namespace TL /// Why was the call discarded /// Preferred libtgvoip relay ID public static Task Phone_DiscardCall(this Client client, InputPhoneCall peer, int duration, PhoneCallDiscardReason reason, long connection_id, bool video = false) - => client.CallAsync(new Phone_DiscardCall_(video ? 0x1 : 0, peer, duration, reason, connection_id)); + => client.CallAsync(new Phone_DiscardCall_ + { + flags = (Phone_DiscardCall_.Flags)(video ? 0x1 : 0), + peer = peer, + duration = duration, + reason = reason, + connection_id = connection_id, + }); [TLDef(0x59EAD627)] - public record Phone_SetCallRating_(int flags, InputPhoneCall peer, int rating, string comment) : IMethod; + public partial class Phone_SetCallRating_ : IMethod + { + public Flags flags; + public InputPhoneCall peer; + public int rating; + public string comment; + + [Flags] public enum Flags + { + user_initiative = 0x1, + } + } /// Rate a call See Possible codes: 400 (details) /// Whether the user decided on their own initiative to rate the call /// The call to rate /// Rating in 1-5 stars /// An additional comment public static Task Phone_SetCallRating(this Client client, InputPhoneCall peer, int rating, string comment, bool user_initiative = false) - => client.CallAsync(new Phone_SetCallRating_(user_initiative ? 0x1 : 0, peer, rating, comment)); + => client.CallAsync(new Phone_SetCallRating_ + { + flags = (Phone_SetCallRating_.Flags)(user_initiative ? 0x1 : 0), + peer = peer, + rating = rating, + comment = comment, + }); [TLDef(0x277ADD7E)] - public record Phone_SaveCallDebug_(InputPhoneCall peer, DataJSON debug) : IMethod; + public partial class Phone_SaveCallDebug_ : IMethod + { + public InputPhoneCall peer; + public DataJSON debug; + } /// Send phone call debug data to server See Possible codes: 400 (details) /// Phone call /// Debug statistics obtained from libtgvoip public static Task Phone_SaveCallDebug(this Client client, InputPhoneCall peer, DataJSON debug) - => client.CallAsync(new Phone_SaveCallDebug_(peer, debug)); + => client.CallAsync(new Phone_SaveCallDebug_ + { + peer = peer, + debug = debug, + }); [TLDef(0xFF7A9383)] - public record Phone_SendSignalingData_(InputPhoneCall peer, byte[] data) : IMethod; + public partial class Phone_SendSignalingData_ : IMethod + { + public InputPhoneCall peer; + public byte[] data; + } /// Send VoIP signaling data See /// Phone call /// Signaling payload public static Task Phone_SendSignalingData(this Client client, InputPhoneCall peer, byte[] data) - => client.CallAsync(new Phone_SendSignalingData_(peer, data)); + => client.CallAsync(new Phone_SendSignalingData_ + { + peer = peer, + data = data, + }); [TLDef(0x48CDC6D8)] - public record Phone_CreateGroupCall_(int flags, InputPeer peer, int random_id, [field:IfFlag(0)] string title, [field:IfFlag(1)] DateTime schedule_date) : IMethod; + public partial class Phone_CreateGroupCall_ : IMethod + { + public Flags flags; + public InputPeer peer; + public int random_id; + [IfFlag(0)] public string title; + [IfFlag(1)] public DateTime schedule_date; + + [Flags] public enum Flags + { + /// Field has a value + has_title = 0x1, + /// Field has a value + has_schedule_date = 0x2, + } + } /// Create a group call or livestream See Possible codes: 400 (details) /// Associate the group call or livestream to the provided group/supergroup/channel /// Unique client message ID required to prevent creation of duplicate group calls /// Call title /// For scheduled group call or livestreams, the absolute date when the group call will start public static Task Phone_CreateGroupCall(this Client client, InputPeer peer, int random_id, string title = null, DateTime? schedule_date = null) - => client.CallAsync(new Phone_CreateGroupCall_((title != null ? 0x1 : 0) | (schedule_date != null ? 0x2 : 0), - peer, random_id, title, schedule_date.GetValueOrDefault())); + => client.CallAsync(new Phone_CreateGroupCall_ + { + flags = (Phone_CreateGroupCall_.Flags)((title != null ? 0x1 : 0) | (schedule_date != null ? 0x2 : 0)), + peer = peer, + random_id = random_id, + title = title, + schedule_date = schedule_date.GetValueOrDefault(), + }); [TLDef(0xB132FF7B)] - public record Phone_JoinGroupCall_(int flags, InputGroupCall call, InputPeer join_as, [field:IfFlag(1)] string invite_hash, DataJSON params_) : IMethod; + public partial class Phone_JoinGroupCall_ : IMethod + { + public Flags flags; + public InputGroupCall call; + public InputPeer join_as; + [IfFlag(1)] public string invite_hash; + public DataJSON params_; + + [Flags] public enum Flags + { + muted = 0x1, + /// Field has a value + has_invite_hash = 0x2, + video_stopped = 0x4, + } + } /// Join a group call See Possible codes: 400 (details) /// If set, the user will be muted by default upon joining. /// If set, the user's video will be disabled by default upon joining. @@ -15390,52 +19064,111 @@ namespace TL /// The invitation hash from the invite link: https://t.me/username?voicechat=hash /// WebRTC parameters public static Task Phone_JoinGroupCall(this Client client, InputGroupCall call, InputPeer join_as, DataJSON params_, bool muted = false, bool video_stopped = false, string invite_hash = null) - => client.CallAsync(new Phone_JoinGroupCall_((muted ? 0x1 : 0) | (video_stopped ? 0x4 : 0) | (invite_hash != null ? 0x2 : 0), - call, join_as, invite_hash, params_)); + => client.CallAsync(new Phone_JoinGroupCall_ + { + flags = (Phone_JoinGroupCall_.Flags)((muted ? 0x1 : 0) | (video_stopped ? 0x4 : 0) | (invite_hash != null ? 0x2 : 0)), + call = call, + join_as = join_as, + invite_hash = invite_hash, + params_ = params_, + }); [TLDef(0x500377F9)] - public record Phone_LeaveGroupCall_(InputGroupCall call, int source) : IMethod; + public partial class Phone_LeaveGroupCall_ : IMethod + { + public InputGroupCall call; + public int source; + } /// Leave a group call See /// The group call /// Your source ID public static Task Phone_LeaveGroupCall(this Client client, InputGroupCall call, int source) - => client.CallAsync(new Phone_LeaveGroupCall_(call, source)); + => client.CallAsync(new Phone_LeaveGroupCall_ + { + call = call, + source = source, + }); [TLDef(0x7B393160)] - public record Phone_InviteToGroupCall_(InputGroupCall call, InputUserBase[] users) : IMethod; + public partial class Phone_InviteToGroupCall_ : IMethod + { + public InputGroupCall call; + public InputUserBase[] users; + } /// Invite a set of users to a group call. See Possible codes: 403 (details) /// The group call /// The users to invite. public static Task Phone_InviteToGroupCall(this Client client, InputGroupCall call, InputUserBase[] users) - => client.CallAsync(new Phone_InviteToGroupCall_(call, users)); + => client.CallAsync(new Phone_InviteToGroupCall_ + { + call = call, + users = users, + }); [TLDef(0x7A777135)] - public record Phone_DiscardGroupCall_(InputGroupCall call) : IMethod; + public partial class Phone_DiscardGroupCall_ : IMethod + { + public InputGroupCall call; + } /// Terminate a group call See /// The group call to terminate public static Task Phone_DiscardGroupCall(this Client client, InputGroupCall call) - => client.CallAsync(new Phone_DiscardGroupCall_(call)); + => client.CallAsync(new Phone_DiscardGroupCall_ + { + call = call, + }); [TLDef(0x74BBB43D)] - public record Phone_ToggleGroupCallSettings_(int flags, InputGroupCall call, [field:IfFlag(0)] bool join_muted) : IMethod; + public partial class Phone_ToggleGroupCallSettings_ : IMethod + { + public Flags flags; + public InputGroupCall call; + [IfFlag(0)] public bool join_muted; + + [Flags] public enum Flags + { + /// Field has a value + has_join_muted = 0x1, + reset_invite_hash = 0x2, + } + } /// Change group call settings See Possible codes: 400 (details) /// Invalidate existing invite links /// Group call /// Whether all users will bthat join this group calle muted by default upon joining the group call public static Task Phone_ToggleGroupCallSettings(this Client client, InputGroupCall call, bool reset_invite_hash = false, bool? join_muted = default) - => client.CallAsync(new Phone_ToggleGroupCallSettings_((reset_invite_hash ? 0x2 : 0) | (join_muted != default ? 0x1 : 0), - call, join_muted.GetValueOrDefault())); + => client.CallAsync(new Phone_ToggleGroupCallSettings_ + { + flags = (Phone_ToggleGroupCallSettings_.Flags)((reset_invite_hash ? 0x2 : 0) | (join_muted != default ? 0x1 : 0)), + call = call, + join_muted = join_muted.GetValueOrDefault(), + }); [TLDef(0x041845DB)] - public record Phone_GetGroupCall_(InputGroupCall call, int limit) : IMethod; + public partial class Phone_GetGroupCall_ : IMethod + { + public InputGroupCall call; + public int limit; + } /// Get info about a group call See /// The group call /// Maximum number of results to return, see pagination public static Task Phone_GetGroupCall(this Client client, InputGroupCall call, int limit) - => client.CallAsync(new Phone_GetGroupCall_(call, limit)); + => client.CallAsync(new Phone_GetGroupCall_ + { + call = call, + limit = limit, + }); [TLDef(0xC558D8AB)] - public record Phone_GetGroupParticipants_(InputGroupCall call, InputPeer[] ids, int[] sources, string offset, int limit) : IMethod; + public partial class Phone_GetGroupParticipants_ : IMethod + { + public InputGroupCall call; + public InputPeer[] ids; + public int[] sources; + public string offset; + public int limit; + } /// Get group call participants See /// Group call /// If specified, will fetch group participant info about the specified peers @@ -15443,18 +19176,47 @@ namespace TL /// Offset for results, taken from the next_offset field of , initially an empty string.
Note: if no more results are available, the method call will return an empty next_offset; thus, avoid providing the next_offset returned in if it is empty, to avoid an infinite loop. /// Maximum number of results to return,
see pagination public static Task Phone_GetGroupParticipants(this Client client, InputGroupCall call, InputPeer[] ids, int[] sources, string offset, int limit) - => client.CallAsync(new Phone_GetGroupParticipants_(call, ids, sources, offset, limit)); + => client.CallAsync(new Phone_GetGroupParticipants_ + { + call = call, + ids = ids, + sources = sources, + offset = offset, + limit = limit, + }); [TLDef(0xB59CF977)] - public record Phone_CheckGroupCall_(InputGroupCall call, int[] sources) : IMethod; + public partial class Phone_CheckGroupCall_ : IMethod + { + public InputGroupCall call; + public int[] sources; + } /// Check whether the group call Server Forwarding Unit is currently receiving the streams with the specified WebRTC source IDs See /// Group call /// Source IDs public static Task Phone_CheckGroupCall(this Client client, InputGroupCall call, int[] sources) - => client.CallAsync(new Phone_CheckGroupCall_(call, sources)); + => client.CallAsync(new Phone_CheckGroupCall_ + { + call = call, + sources = sources, + }); [TLDef(0xF128C708)] - public record Phone_ToggleGroupCallRecord_(int flags, InputGroupCall call, [field:IfFlag(1)] string title, [field:IfFlag(2)] bool video_portrait) : IMethod; + public partial class Phone_ToggleGroupCallRecord_ : IMethod + { + public Flags flags; + public InputGroupCall call; + [IfFlag(1)] public string title; + [IfFlag(2)] public bool video_portrait; + + [Flags] public enum Flags + { + start = 0x1, + /// Field has a value + has_title = 0x2, + video = 0x4, + } + } /// Start or stop recording a group call: the recorded audio and video streams will be automatically sent to Saved messages (the chat with ourselves). See /// Whether to start or stop recording /// Whether to also record video streams @@ -15462,11 +19224,43 @@ namespace TL /// Recording title /// If video stream recording is enabled, whether to record in portrait or landscape mode public static Task Phone_ToggleGroupCallRecord(this Client client, InputGroupCall call, bool start = false, bool video = false, string title = null, bool? video_portrait = default) - => client.CallAsync(new Phone_ToggleGroupCallRecord_((start ? 0x1 : 0) | (video ? 0x4 : 0) | (title != null ? 0x2 : 0) | (video_portrait != default ? 0x4 : 0), - call, title, video_portrait.GetValueOrDefault())); + => client.CallAsync(new Phone_ToggleGroupCallRecord_ + { + flags = (Phone_ToggleGroupCallRecord_.Flags)((start ? 0x1 : 0) | (video ? 0x4 : 0) | (title != null ? 0x2 : 0) | (video_portrait != default ? 0x4 : 0)), + call = call, + title = title, + video_portrait = video_portrait.GetValueOrDefault(), + }); [TLDef(0xA5273ABF)] - public record Phone_EditGroupCallParticipant_(int flags, InputGroupCall call, InputPeer participant, [field:IfFlag(0)] bool muted, [field:IfFlag(1)] int volume, [field:IfFlag(2)] bool raise_hand, [field:IfFlag(3)] bool video_stopped, [field:IfFlag(4)] bool video_paused, [field:IfFlag(5)] bool presentation_paused) : IMethod; + public partial class Phone_EditGroupCallParticipant_ : IMethod + { + public Flags flags; + public InputGroupCall call; + public InputPeer participant; + [IfFlag(0)] public bool muted; + [IfFlag(1)] public int volume; + [IfFlag(2)] public bool raise_hand; + [IfFlag(3)] public bool video_stopped; + [IfFlag(4)] public bool video_paused; + [IfFlag(5)] public bool presentation_paused; + + [Flags] public enum Flags + { + /// Field has a value + has_muted = 0x1, + /// Field has a value + has_volume = 0x2, + /// Field has a value + has_raise_hand = 0x4, + /// Field has a value + has_video_stopped = 0x8, + /// Field has a value + has_video_paused = 0x10, + /// Field has a value + has_presentation_paused = 0x20, + } + } /// Edit information about a given group call participant See Possible codes: 400 (details) /// The group call /// The group call participant (can also be the user itself) @@ -15477,151 +19271,328 @@ namespace TL /// Pause or resume the video stream /// Pause or resume the screen sharing stream public static Task Phone_EditGroupCallParticipant(this Client client, InputGroupCall call, InputPeer participant, bool? muted = default, int? volume = null, bool? raise_hand = default, bool? video_stopped = default, bool? video_paused = default, bool? presentation_paused = default) - => client.CallAsync(new Phone_EditGroupCallParticipant_((muted != default ? 0x1 : 0) | (volume != null ? 0x2 : 0) | (raise_hand != default ? 0x4 : 0) | (video_stopped != default ? 0x8 : 0) | (video_paused != default ? 0x10 : 0) | (presentation_paused != default ? 0x20 : 0), - call, participant, muted.GetValueOrDefault(), volume.GetValueOrDefault(), raise_hand.GetValueOrDefault(), video_stopped.GetValueOrDefault(), video_paused.GetValueOrDefault(), presentation_paused.GetValueOrDefault())); + => client.CallAsync(new Phone_EditGroupCallParticipant_ + { + flags = (Phone_EditGroupCallParticipant_.Flags)((muted != default ? 0x1 : 0) | (volume != null ? 0x2 : 0) | (raise_hand != default ? 0x4 : 0) | (video_stopped != default ? 0x8 : 0) | (video_paused != default ? 0x10 : 0) | (presentation_paused != default ? 0x20 : 0)), + call = call, + participant = participant, + muted = muted.GetValueOrDefault(), + volume = volume.GetValueOrDefault(), + raise_hand = raise_hand.GetValueOrDefault(), + video_stopped = video_stopped.GetValueOrDefault(), + video_paused = video_paused.GetValueOrDefault(), + presentation_paused = presentation_paused.GetValueOrDefault(), + }); [TLDef(0x1CA6AC0A)] - public record Phone_EditGroupCallTitle_(InputGroupCall call, string title) : IMethod; + public partial class Phone_EditGroupCallTitle_ : IMethod + { + public InputGroupCall call; + public string title; + } /// Edit the title of a group call or livestream See /// Group call /// New title public static Task Phone_EditGroupCallTitle(this Client client, InputGroupCall call, string title) - => client.CallAsync(new Phone_EditGroupCallTitle_(call, title)); + => client.CallAsync(new Phone_EditGroupCallTitle_ + { + call = call, + title = title, + }); [TLDef(0xEF7C213A)] - public record Phone_GetGroupCallJoinAs_(InputPeer peer) : IMethod; + public partial class Phone_GetGroupCallJoinAs_ : IMethod + { + public InputPeer peer; + } /// Get a list of peers that can be used to join a group call, presenting yourself as a specific user/channel. See /// The dialog whose group call or livestream we're trying to join public static Task Phone_GetGroupCallJoinAs(this Client client, InputPeer peer) - => client.CallAsync(new Phone_GetGroupCallJoinAs_(peer)); + => client.CallAsync(new Phone_GetGroupCallJoinAs_ + { + peer = peer, + }); [TLDef(0xE6AA647F)] - public record Phone_ExportGroupCallInvite_(int flags, InputGroupCall call) : IMethod; + public partial class Phone_ExportGroupCallInvite_ : IMethod + { + public Flags flags; + public InputGroupCall call; + + [Flags] public enum Flags + { + can_self_unmute = 0x1, + } + } /// Get an invite link for a group call or livestream See /// For livestreams, if set, users that join using this link will be able to speak without explicitly requesting permission by (for example by raising their hand). /// The group call public static Task Phone_ExportGroupCallInvite(this Client client, InputGroupCall call, bool can_self_unmute = false) - => client.CallAsync(new Phone_ExportGroupCallInvite_(can_self_unmute ? 0x1 : 0, call)); + => client.CallAsync(new Phone_ExportGroupCallInvite_ + { + flags = (Phone_ExportGroupCallInvite_.Flags)(can_self_unmute ? 0x1 : 0), + call = call, + }); [TLDef(0x219C34E6)] - public record Phone_ToggleGroupCallStartSubscription_(InputGroupCall call, bool subscribed) : IMethod; + public partial class Phone_ToggleGroupCallStartSubscription_ : IMethod + { + public InputGroupCall call; + public bool subscribed; + } /// Subscribe or unsubscribe to a scheduled group call See /// Scheduled group call /// Enable or disable subscription public static Task Phone_ToggleGroupCallStartSubscription(this Client client, InputGroupCall call, bool subscribed) - => client.CallAsync(new Phone_ToggleGroupCallStartSubscription_(call, subscribed)); + => client.CallAsync(new Phone_ToggleGroupCallStartSubscription_ + { + call = call, + subscribed = subscribed, + }); [TLDef(0x5680E342)] - public record Phone_StartScheduledGroupCall_(InputGroupCall call) : IMethod; + public partial class Phone_StartScheduledGroupCall_ : IMethod + { + public InputGroupCall call; + } /// Start a scheduled group call. See /// The scheduled group call public static Task Phone_StartScheduledGroupCall(this Client client, InputGroupCall call) - => client.CallAsync(new Phone_StartScheduledGroupCall_(call)); + => client.CallAsync(new Phone_StartScheduledGroupCall_ + { + call = call, + }); [TLDef(0x575E1F8C)] - public record Phone_SaveDefaultGroupCallJoinAs_(InputPeer peer, InputPeer join_as) : IMethod; + public partial class Phone_SaveDefaultGroupCallJoinAs_ : IMethod + { + public InputPeer peer; + public InputPeer join_as; + } /// Set the default peer that will be used to join a group call in a specific dialog. See /// The dialog /// The default peer that will be used to join group calls in this dialog, presenting yourself as a specific user/channel. public static Task Phone_SaveDefaultGroupCallJoinAs(this Client client, InputPeer peer, InputPeer join_as) - => client.CallAsync(new Phone_SaveDefaultGroupCallJoinAs_(peer, join_as)); + => client.CallAsync(new Phone_SaveDefaultGroupCallJoinAs_ + { + peer = peer, + join_as = join_as, + }); [TLDef(0xCBEA6BC4)] - public record Phone_JoinGroupCallPresentation_(InputGroupCall call, DataJSON params_) : IMethod; + public partial class Phone_JoinGroupCallPresentation_ : IMethod + { + public InputGroupCall call; + public DataJSON params_; + } /// Start screen sharing in a call See Possible codes: 403 (details) /// The group call /// WebRTC parameters public static Task Phone_JoinGroupCallPresentation(this Client client, InputGroupCall call, DataJSON params_) - => client.CallAsync(new Phone_JoinGroupCallPresentation_(call, params_)); + => client.CallAsync(new Phone_JoinGroupCallPresentation_ + { + call = call, + params_ = params_, + }); [TLDef(0x1C50D144)] - public record Phone_LeaveGroupCallPresentation_(InputGroupCall call) : IMethod; + public partial class Phone_LeaveGroupCallPresentation_ : IMethod + { + public InputGroupCall call; + } /// Stop screen sharing in a group call See /// The group call public static Task Phone_LeaveGroupCallPresentation(this Client client, InputGroupCall call) - => client.CallAsync(new Phone_LeaveGroupCallPresentation_(call)); + => client.CallAsync(new Phone_LeaveGroupCallPresentation_ + { + call = call, + }); [TLDef(0xF2F2330A)] - public record Langpack_GetLangPack_(string lang_pack, string lang_code) : IMethod; + public partial class Langpack_GetLangPack_ : IMethod + { + public string lang_pack; + public string lang_code; + } /// Get localization pack strings See Possible codes: 400 (details) /// Language pack name /// Language code public static Task Langpack_GetLangPack(this Client client, string lang_pack, string lang_code) - => client.CallAsync(new Langpack_GetLangPack_(lang_pack, lang_code)); + => client.CallAsync(new Langpack_GetLangPack_ + { + lang_pack = lang_pack, + lang_code = lang_code, + }); [TLDef(0xEFEA3803)] - public record Langpack_GetStrings_(string lang_pack, string lang_code, string[] keys) : IMethod; + public partial class Langpack_GetStrings_ : IMethod + { + public string lang_pack; + public string lang_code; + public string[] keys; + } /// Get strings from a language pack See Possible codes: 400 (details) /// Language pack name /// Language code /// Strings to get public static Task Langpack_GetStrings(this Client client, string lang_pack, string lang_code, string[] keys) - => client.CallAsync(new Langpack_GetStrings_(lang_pack, lang_code, keys)); + => client.CallAsync(new Langpack_GetStrings_ + { + lang_pack = lang_pack, + lang_code = lang_code, + keys = keys, + }); [TLDef(0xCD984AA5)] - public record Langpack_GetDifference_(string lang_pack, string lang_code, int from_version) : IMethod; + public partial class Langpack_GetDifference_ : IMethod + { + public string lang_pack; + public string lang_code; + public int from_version; + } /// Get new strings in languagepack See Possible codes: 400 (details) /// Language pack /// Language code /// Previous localization pack version public static Task Langpack_GetDifference(this Client client, string lang_pack, string lang_code, int from_version) - => client.CallAsync(new Langpack_GetDifference_(lang_pack, lang_code, from_version)); + => client.CallAsync(new Langpack_GetDifference_ + { + lang_pack = lang_pack, + lang_code = lang_code, + from_version = from_version, + }); [TLDef(0x42C6978F)] - public record Langpack_GetLanguages_(string lang_pack) : IMethod; + public partial class Langpack_GetLanguages_ : IMethod + { + public string lang_pack; + } /// Get information about all languages in a localization pack See Possible codes: 400 (details) /// Language pack public static Task Langpack_GetLanguages(this Client client, string lang_pack) - => client.CallAsync(new Langpack_GetLanguages_(lang_pack)); + => client.CallAsync(new Langpack_GetLanguages_ + { + lang_pack = lang_pack, + }); [TLDef(0x6A596502)] - public record Langpack_GetLanguage_(string lang_pack, string lang_code) : IMethod; + public partial class Langpack_GetLanguage_ : IMethod + { + public string lang_pack; + public string lang_code; + } /// Get information about a language in a localization pack See /// Language pack name /// Language code public static Task Langpack_GetLanguage(this Client client, string lang_pack, string lang_code) - => client.CallAsync(new Langpack_GetLanguage_(lang_pack, lang_code)); + => client.CallAsync(new Langpack_GetLanguage_ + { + lang_pack = lang_pack, + lang_code = lang_code, + }); [TLDef(0x6847D0AB)] - public record Folders_EditPeerFolders_(InputFolderPeer[] folder_peers) : IMethod; + public partial class Folders_EditPeerFolders_ : IMethod + { + public InputFolderPeer[] folder_peers; + } /// Edit peers in peer folder See Possible codes: 400 (details) /// New peer list public static Task Folders_EditPeerFolders(this Client client, InputFolderPeer[] folder_peers) - => client.CallAsync(new Folders_EditPeerFolders_(folder_peers)); + => client.CallAsync(new Folders_EditPeerFolders_ + { + folder_peers = folder_peers, + }); [TLDef(0x1C295881)] - public record Folders_DeleteFolder_(int folder_id) : IMethod; + public partial class Folders_DeleteFolder_ : IMethod + { + public int folder_id; + } /// Delete a peer folder See Possible codes: 400 (details) /// Peer folder ID, for more info click here public static Task Folders_DeleteFolder(this Client client, int folder_id) - => client.CallAsync(new Folders_DeleteFolder_(folder_id)); + => client.CallAsync(new Folders_DeleteFolder_ + { + folder_id = folder_id, + }); [TLDef(0xAB42441A)] - public record Stats_GetBroadcastStats_(int flags, InputChannelBase channel) : IMethod; + public partial class Stats_GetBroadcastStats_ : IMethod + { + public Flags flags; + public InputChannelBase channel; + + [Flags] public enum Flags + { + dark = 0x1, + } + } /// Get channel statistics See Possible codes: 400 (details) /// Whether to enable dark theme for graph colors /// The channel public static Task Stats_GetBroadcastStats(this Client client, InputChannelBase channel, bool dark = false) - => client.CallAsync(new Stats_GetBroadcastStats_(dark ? 0x1 : 0, channel)); + => client.CallAsync(new Stats_GetBroadcastStats_ + { + flags = (Stats_GetBroadcastStats_.Flags)(dark ? 0x1 : 0), + channel = channel, + }); [TLDef(0x621D5FA0)] - public record Stats_LoadAsyncGraph_(int flags, string token, [field:IfFlag(0)] long x) : IMethod; + public partial class Stats_LoadAsyncGraph_ : IMethod + { + public Flags flags; + public string token; + [IfFlag(0)] public long x; + + [Flags] public enum Flags + { + /// Field has a value + has_x = 0x1, + } + } /// Load channel statistics graph asynchronously See Possible codes: 400 (details) /// Graph token from constructor /// Zoom value, if required public static Task Stats_LoadAsyncGraph(this Client client, string token, long? x = null) - => client.CallAsync(new Stats_LoadAsyncGraph_(x != null ? 0x1 : 0, token, x.GetValueOrDefault())); + => client.CallAsync(new Stats_LoadAsyncGraph_ + { + flags = (Stats_LoadAsyncGraph_.Flags)(x != null ? 0x1 : 0), + token = token, + x = x.GetValueOrDefault(), + }); [TLDef(0xDCDF8607)] - public record Stats_GetMegagroupStats_(int flags, InputChannelBase channel) : IMethod; + public partial class Stats_GetMegagroupStats_ : IMethod + { + public Flags flags; + public InputChannelBase channel; + + [Flags] public enum Flags + { + dark = 0x1, + } + } /// Get supergroup statistics See Possible codes: 400 (details) /// Whether to enable dark theme for graph colors /// Supergroup ID public static Task Stats_GetMegagroupStats(this Client client, InputChannelBase channel, bool dark = false) - => client.CallAsync(new Stats_GetMegagroupStats_(dark ? 0x1 : 0, channel)); + => client.CallAsync(new Stats_GetMegagroupStats_ + { + flags = (Stats_GetMegagroupStats_.Flags)(dark ? 0x1 : 0), + channel = channel, + }); [TLDef(0x5630281B)] - public record Stats_GetMessagePublicForwards_(InputChannelBase channel, int msg_id, int offset_rate, InputPeer offset_peer, int offset_id, int limit) : IMethod; + public partial class Stats_GetMessagePublicForwards_ : IMethod + { + public InputChannelBase channel; + public int msg_id; + public int offset_rate; + public InputPeer offset_peer; + public int offset_id; + public int limit; + } /// Obtains a list of messages, indicating to which other public channels was a channel message forwarded.
Will return a list of with peer_id equal to the public channel to which this message was forwarded. See Possible codes: 400 (details)
/// Source channel /// Source message ID @@ -15630,15 +19601,38 @@ namespace TL /// Offsets for pagination, for more info click here /// Maximum number of results to return, see pagination public static Task Stats_GetMessagePublicForwards(this Client client, InputChannelBase channel, int msg_id, int offset_rate, InputPeer offset_peer, int offset_id, int limit) - => client.CallAsync(new Stats_GetMessagePublicForwards_(channel, msg_id, offset_rate, offset_peer, offset_id, limit)); + => client.CallAsync(new Stats_GetMessagePublicForwards_ + { + channel = channel, + msg_id = msg_id, + offset_rate = offset_rate, + offset_peer = offset_peer, + offset_id = offset_id, + limit = limit, + }); [TLDef(0xB6E0A3F5)] - public record Stats_GetMessageStats_(int flags, InputChannelBase channel, int msg_id) : IMethod; + public partial class Stats_GetMessageStats_ : IMethod + { + public Flags flags; + public InputChannelBase channel; + public int msg_id; + + [Flags] public enum Flags + { + dark = 0x1, + } + } /// Get message statistics See Possible codes: 400 (details) /// Whether to enable dark theme for graph colors /// Channel ID /// Message ID public static Task Stats_GetMessageStats(this Client client, InputChannelBase channel, int msg_id, bool dark = false) - => client.CallAsync(new Stats_GetMessageStats_(dark ? 0x1 : 0, channel, msg_id)); + => client.CallAsync(new Stats_GetMessageStats_ + { + flags = (Stats_GetMessageStats_.Flags)(dark ? 0x1 : 0), + channel = channel, + msg_id = msg_id, + }); } } diff --git a/src/TL.cs b/src/TL.cs index ab5bf19..779c992 100644 --- a/src/TL.cs +++ b/src/TL.cs @@ -46,7 +46,7 @@ namespace TL if (((ifFlag = field.GetCustomAttribute()) != null) && (flags & (1 << ifFlag.Bit)) == 0) continue; object value = field.GetValue(obj); writer.WriteTLValue(value, field.FieldType); - if (field.Name == "flags" || field.Name == "k__BackingField") flags = (int)value; + if (field.Name == "flags") flags = (int)value; } } @@ -67,7 +67,7 @@ namespace TL if (((ifFlag = field.GetCustomAttribute()) != null) && (flags & (1 << ifFlag.Bit)) == 0) continue; object value = reader.ReadTLValue(field.FieldType); field.SetValue(obj, value); - if (field.Name == "flags" || field.Name == "k__BackingField") flags = (int)value; + if (field.Name == "flags") flags = (int)value; else if (field.Name == "access_hash") reader.Client?.UpdateAccessHash(obj, type, value); } return type == typeof(GzipPacked) ? UnzipPacket((GzipPacked)obj, reader.Client) : (IObject)obj;