From 5e66d562df1e4d3fa32b8aa3478f41e4beaf5633 Mon Sep 17 00:00:00 2001 From: Wizou <11647984+wiz0u@users.noreply.github.com> Date: Fri, 20 May 2022 14:04:54 +0200 Subject: [PATCH] Last arg of API methods can be `params` for simplicity --- src/TL.SchemaFuncs.cs | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/TL.SchemaFuncs.cs b/src/TL.SchemaFuncs.cs index e55142b..58738ce 100644 --- a/src/TL.SchemaFuncs.cs +++ b/src/TL.SchemaFuncs.cs @@ -406,7 +406,7 @@ namespace TL /// 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) + public static Task Account_SetPrivacy(this Client client, InputPrivacyKey key, params InputPrivacyRule[] rules) => client.Invoke(new Account_SetPrivacy { key = key, @@ -561,7 +561,7 @@ namespace TL /// 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) + public static Task Account_GetSecureValue(this Client client, params SecureValueType[] types) => client.Invoke(new Account_GetSecureValue { types = types, @@ -579,7 +579,7 @@ namespace TL /// 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) + public static Task Account_DeleteSecureValue(this Client client, params SecureValueType[] types) => client.Invoke(new Account_DeleteSecureValue { types = types, @@ -897,7 +897,7 @@ namespace TL /// Get info about multiple wallpapers See /// Wallpapers to fetch info about - public static Task Account_GetMultiWallPapers(this Client client, InputWallPaperBase[] wallpapers) + public static Task Account_GetMultiWallPapers(this Client client, params InputWallPaperBase[] wallpapers) => client.Invoke(new Account_GetMultiWallPapers { wallpapers = wallpapers, @@ -1000,7 +1000,7 @@ namespace TL /// Returns basic user info according to their identifiers. See [bots: ✓] Possible codes: 400 (details) /// List of user identifiers - public static Task Users_GetUsers(this Client client, InputUserBase[] id) + public static Task Users_GetUsers(this Client client, params InputUserBase[] id) => client.Invoke(new Users_GetUsers { id = id, @@ -1017,7 +1017,7 @@ namespace TL /// 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) + public static Task Users_SetSecureValueErrors(this Client client, InputUserBase id, params SecureValueErrorBase[] errors) => client.Invoke(new Users_SetSecureValueErrors { id = id, @@ -1049,7 +1049,7 @@ namespace TL /// 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) + public static Task Contacts_ImportContacts(this Client client, params InputContact[] contacts) => client.Invoke(new Contacts_ImportContacts { contacts = contacts, @@ -1057,7 +1057,7 @@ namespace TL /// Deletes several contacts from the list. See /// User ID list - public static Task Contacts_DeleteContacts(this Client client, InputUserBase[] id) + public static Task Contacts_DeleteContacts(this Client client, params InputUserBase[] id) => client.Invoke(new Contacts_DeleteContacts { id = id, @@ -1225,7 +1225,7 @@ namespace TL /// This method is only for small private Chat. See Terminology to understand what this means
Search for a similar method name starting with Channels_ if you're dealing with a
Returns the list of messages by their IDs. See
[bots: ✓]
/// Message ID list - public static Task Messages_GetMessages(this Client client, InputMessage[] id) + public static Task Messages_GetMessages(this Client client, params InputMessage[] id) => client.Invoke(new Messages_GetMessages { id = id, @@ -2027,7 +2027,7 @@ namespace TL /// Get dialog info of specified peers See Possible codes: 400 (details) /// Peers - public static Task Messages_GetPeerDialogs(this Client client, InputDialogPeerBase[] peers) + public static Task Messages_GetPeerDialogs(this Client client, params InputDialogPeerBase[] peers) => client.Invoke(new Messages_GetPeerDialogs { peers = peers, @@ -2524,7 +2524,7 @@ namespace TL /// 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) + public static Task Messages_GetSearchCounters(this Client client, InputPeer peer, params MessagesFilter[] filters) => client.Invoke(new Messages_GetSearchCounters { peer = peer, @@ -3261,7 +3261,7 @@ namespace TL /// Deletes profile photos. See /// Input photos to delete - public static Task Photos_DeletePhotos(this Client client, InputPhoto[] id) + public static Task Photos_DeletePhotos(this Client client, params InputPhoto[] id) => client.Invoke(new Photos_DeletePhotos { id = id, @@ -3472,7 +3472,7 @@ namespace TL /// Saves logs of application on the server. See /// List of input events - public static Task Help_SaveAppLog(this Client client, InputAppEvent[] events) + public static Task Help_SaveAppLog(this Client client, params InputAppEvent[] events) => client.Invoke(new Help_SaveAppLog { events = events, @@ -3507,7 +3507,7 @@ namespace TL /// 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) + public static Task Help_EditUserInfo(this Client client, InputUserBase user_id, string message, params MessageEntity[] entities) => client.Invoke(new Help_EditUserInfo { user_id = user_id, @@ -3585,7 +3585,7 @@ namespace TL /// 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) + public static Task Channels_GetMessages(this Client client, InputChannelBase channel, params InputMessage[] id) => client.Invoke(new Channels_GetMessages { channel = channel, @@ -3621,7 +3621,7 @@ namespace TL /// 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) + public static Task Channels_GetChannels(this Client client, params InputChannelBase[] id) => client.Invoke(new Channels_GetChannels { id = id, @@ -3726,7 +3726,7 @@ namespace TL /// 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) + public static Task Channels_InviteToChannel(this Client client, InputChannelBase channel, params InputUserBase[] users) => client.Invoke(new Channels_InviteToChannel { channel = channel, @@ -3979,7 +3979,7 @@ namespace TL /// Command scope /// Language code /// Bot commands - public static Task Bots_SetBotCommands(this Client client, BotCommandScope scope, string lang_code, BotCommand[] commands) + public static Task Bots_SetBotCommands(this Client client, BotCommandScope scope, string lang_code, params BotCommand[] commands) => client.Invoke(new Bots_SetBotCommands { scope = scope, @@ -4350,7 +4350,7 @@ namespace TL /// Invite a set of users to a group call. See Possible codes: 400,403 (details) /// The group call /// The users to invite. - public static Task Phone_InviteToGroupCall(this Client client, InputGroupCall call, InputUserBase[] users) + public static Task Phone_InviteToGroupCall(this Client client, InputGroupCall call, params InputUserBase[] users) => client.Invoke(new Phone_InviteToGroupCall { call = call, @@ -4605,7 +4605,7 @@ namespace TL /// Edit peers in peer folder See Possible codes: 400 (details) /// New peer list - public static Task Folders_EditPeerFolders(this Client client, InputFolderPeer[] folder_peers) + public static Task Folders_EditPeerFolders(this Client client, params InputFolderPeer[] folder_peers) => client.Invoke(new Folders_EditPeerFolders { folder_peers = folder_peers,