more optional parameters. Messages_Search<> helper

This commit is contained in:
Wizou 2022-02-13 02:50:10 +01:00
parent 7570732a3f
commit 6646e85e78
5 changed files with 99 additions and 90 deletions

View file

@ -68,18 +68,18 @@ var user = await client.LoginUserIfNeeded();
var random = new Random(); var random = new Random();
// • List all stickerSets the user has added to his account // • List all stickerSets the user has added to his account
var allStickers = await client.Messages_GetAllStickers(0); var allStickers = await client.Messages_GetAllStickers();
foreach (var stickerSet in allStickers.sets) foreach (var stickerSet in allStickers.sets)
Console.WriteLine($"Pack {stickerSet.short_name} contains {stickerSet.count} stickers"); Console.WriteLine($"Pack {stickerSet.short_name} contains {stickerSet.count} stickers");
//if you need details on each: var sticketSetDetails = await client.Messages_GetStickerSet(stickerSet, 0); //if you need details on each: var sticketSetDetails = await client.Messages_GetStickerSet(stickerSet);
// • Send a random sticker from the user's favorites stickers // • Send a random sticker from the user's favorites stickers
var favedStickers = await client.Messages_GetFavedStickers(0); var favedStickers = await client.Messages_GetFavedStickers();
var stickerDoc = favedStickers.stickers[random.Next(favedStickers.stickers.Length)]; var stickerDoc = favedStickers.stickers[random.Next(favedStickers.stickers.Length)];
await client.SendMessageAsync(InputPeer.Self, null, new InputMediaDocument { id = stickerDoc }); await client.SendMessageAsync(InputPeer.Self, null, new InputMediaDocument { id = stickerDoc });
// • Send a specific sticker given the stickerset shortname and emoticon // • Send a specific sticker given the stickerset shortname and emoticon
var friendlyPanda = await client.Messages_GetStickerSet(new InputStickerSetShortName { short_name = "Friendly_Panda" }, 0); var friendlyPanda = await client.Messages_GetStickerSet(new InputStickerSetShortName { short_name = "Friendly_Panda" });
var laughId = friendlyPanda.packs.First(p => p.emoticon == "😂").documents[0]; var laughId = friendlyPanda.packs.First(p => p.emoticon == "😂").documents[0];
var laughDoc = friendlyPanda.documents.First(d => d.ID == laughId); var laughDoc = friendlyPanda.documents.First(d => d.ID == laughId);
await client.SendMessageAsync(InputPeer.Self, null, new InputMediaDocument { id = laughDoc }); await client.SendMessageAsync(InputPeer.Self, null, new InputMediaDocument { id = laughDoc });
@ -118,7 +118,7 @@ await Task.Delay(5000);
```csharp ```csharp
using var client = new WTelegram.Client(Environment.GetEnvironmentVariable); using var client = new WTelegram.Client(Environment.GetEnvironmentVariable);
await client.LoginUserIfNeeded(); await client.LoginUserIfNeeded();
var chats = await client.Messages_GetAllChats(null); var chats = await client.Messages_GetAllChats();
foreach (var (id, chat) in chats.chats) foreach (var (id, chat) in chats.chats)
if (chat.IsActive) if (chat.IsActive)
Console.WriteLine($"{id} : {chat}"); Console.WriteLine($"{id} : {chat}");
@ -138,7 +138,7 @@ but the old `Chat` will be marked with flag [deactivated] and should not be used
```csharp ```csharp
using var client = new WTelegram.Client(Environment.GetEnvironmentVariable); using var client = new WTelegram.Client(Environment.GetEnvironmentVariable);
await client.LoginUserIfNeeded(); await client.LoginUserIfNeeded();
var chats = await client.Messages_GetAllChats(null); var chats = await client.Messages_GetAllChats();
InputPeer peer = chats.chats[1234567890]; // the chat we want InputPeer peer = chats.chats[1234567890]; // the chat we want
DateTime when = DateTime.UtcNow.AddMinutes(3); DateTime when = DateTime.UtcNow.AddMinutes(3);
await client.SendMessageAsync(peer, "This will be posted in 3 minutes", schedule_date: when); await client.SendMessageAsync(peer, "This will be posted in 3 minutes", schedule_date: when);
@ -152,7 +152,7 @@ const string Filepath = @"C:\...\photo.jpg";
using var client = new WTelegram.Client(Environment.GetEnvironmentVariable); using var client = new WTelegram.Client(Environment.GetEnvironmentVariable);
await client.LoginUserIfNeeded(); await client.LoginUserIfNeeded();
var chats = await client.Messages_GetAllChats(null); var chats = await client.Messages_GetAllChats();
InputPeer peer = chats.chats[ChatId]; InputPeer peer = chats.chats[ChatId];
var inputFile = await client.UploadFileAsync(Filepath); var inputFile = await client.UploadFileAsync(Filepath);
await client.SendMediaAsync(peer, "Here is the photo", inputFile); await client.SendMediaAsync(peer, "Here is the photo", inputFile);
@ -162,7 +162,7 @@ await client.SendMediaAsync(peer, "Here is the photo", inputFile);
### Send a grouped media album using photos from various sources ### Send a grouped media album using photos from various sources
```csharp ```csharp
// Photo 1 already on Telegram: latest photo found in the user's Saved Messages // Photo 1 already on Telegram: latest photo found in the user's Saved Messages
var history = await client.Messages_GetHistory(InputPeer.Self, 0, default, 0, 100, 0, 0, 0); var history = await client.Messages_GetHistory(InputPeer.Self);
PhotoBase photoFromTelegram = history.Messages.OfType<Message>().Select(m => m.media).OfType<MessageMediaPhoto>().First().photo; PhotoBase photoFromTelegram = history.Messages.OfType<Message>().Select(m => m.media).OfType<MessageMediaPhoto>().First().photo;
// Photo 2 uploaded now from our computer: // Photo 2 uploaded now from our computer:
var uploadedFile = await client.UploadFileAsync(@"C:\Pictures\flower.jpg"); var uploadedFile = await client.UploadFileAsync(@"C:\Pictures\flower.jpg");
@ -184,7 +184,7 @@ await client.SendAlbumAsync(InputPeer.Self, inputMedias, "My first album");
```csharp ```csharp
using var client = new WTelegram.Client(Environment.GetEnvironmentVariable); using var client = new WTelegram.Client(Environment.GetEnvironmentVariable);
await client.LoginUserIfNeeded(); await client.LoginUserIfNeeded();
var dialogs = await client.Messages_GetDialogs(default, 0, null, 0, 0); var dialogs = await client.Messages_GetDialogs();
while (dialogs.Dialogs.Length != 0) while (dialogs.Dialogs.Length != 0)
{ {
foreach (var dialog in dialogs.Dialogs) foreach (var dialog in dialogs.Dialogs)
@ -196,7 +196,7 @@ while (dialogs.Dialogs.Length != 0)
var lastDialog = dialogs.Dialogs[^1]; var lastDialog = dialogs.Dialogs[^1];
var lastMsg = dialogs.Messages.LastOrDefault(m => m.Peer.ID == lastDialog.Peer.ID && m.ID == lastDialog.TopMessage); var lastMsg = dialogs.Messages.LastOrDefault(m => m.Peer.ID == lastDialog.Peer.ID && m.ID == lastDialog.TopMessage);
var offsetPeer = dialogs.UserOrChat(lastDialog).ToInputPeer(); var offsetPeer = dialogs.UserOrChat(lastDialog).ToInputPeer();
dialogs = await client.Messages_GetDialogs(lastMsg?.Date ?? default, lastDialog.TopMessage, offsetPeer, 500, 0); dialogs = await client.Messages_GetDialogs(lastMsg?.Date ?? default, lastDialog.TopMessage, offsetPeer);
} }
``` ```
@ -218,11 +218,11 @@ For a Channel/Group:
```csharp ```csharp
using var client = new WTelegram.Client(Environment.GetEnvironmentVariable); using var client = new WTelegram.Client(Environment.GetEnvironmentVariable);
await client.LoginUserIfNeeded(); await client.LoginUserIfNeeded();
var chats = await client.Messages_GetAllChats(null); var chats = await client.Messages_GetAllChats();
var channel = (Channel)chats.chats[1234567890]; // the channel we want var channel = (Channel)chats.chats[1234567890]; // the channel we want
for (int offset = 0; ;) for (int offset = 0; ;)
{ {
var participants = await client.Channels_GetParticipants(channel, null, offset, 1000, 0); var participants = await client.Channels_GetParticipants(channel, null, offset);
foreach (var (id, user) in participants.users) foreach (var (id, user) in participants.users)
Console.WriteLine(user); Console.WriteLine(user);
offset += participants.participants.Length; offset += participants.participants.Length;
@ -235,7 +235,7 @@ In this case, you can use this helper method, but it can take several minutes to
```csharp ```csharp
using var client = new WTelegram.Client(Environment.GetEnvironmentVariable); using var client = new WTelegram.Client(Environment.GetEnvironmentVariable);
await client.LoginUserIfNeeded(); await client.LoginUserIfNeeded();
var chats = await client.Messages_GetAllChats(null); var chats = await client.Messages_GetAllChats();
var channel = (Channel)chats.chats[1234567890]; // the channel we want var channel = (Channel)chats.chats[1234567890]; // the channel we want
var participants = await client.Channels_GetAllParticipants(channel); var participants = await client.Channels_GetAllParticipants(channel);
``` ```
@ -255,7 +255,7 @@ if (resolved.Chat is Channel channel)
```csharp ```csharp
using var client = new WTelegram.Client(Environment.GetEnvironmentVariable); using var client = new WTelegram.Client(Environment.GetEnvironmentVariable);
await client.LoginUserIfNeeded(); await client.LoginUserIfNeeded();
var chats = await client.Messages_GetAllChats(null); var chats = await client.Messages_GetAllChats();
var chat = chats.chats[1234567890]; // the target chat var chat = chats.chats[1234567890]; // the target chat
``` ```
After the above code, once you [have obtained](https://github.com/wiz0u/WTelegramClient/blob/master/FAQ.md#access-hash) an `InputUser` or `User`, you can: After the above code, once you [have obtained](https://github.com/wiz0u/WTelegramClient/blob/master/FAQ.md#access-hash) an `InputUser` or `User`, you can:
@ -286,16 +286,16 @@ await client.DeleteChatUser(chat, user);
```csharp ```csharp
using var client = new WTelegram.Client(Environment.GetEnvironmentVariable); using var client = new WTelegram.Client(Environment.GetEnvironmentVariable);
await client.LoginUserIfNeeded(); await client.LoginUserIfNeeded();
var chats = await client.Messages_GetAllChats(null); var chats = await client.Messages_GetAllChats();
InputPeer peer = chats.chats[1234567890]; // the chat we want InputPeer peer = chats.chats[1234567890]; // the chat we want
for (int offset = 0; ;) for (int offset_id = 0; ;)
{ {
var messages = await client.Messages_GetHistory(peer, 0, default, offset, 1000, 0, 0, 0); var messages = await client.Messages_GetHistory(peer, offset_id);
if (messages.Messages.Length == 0) break;
foreach (var msgBase in messages.Messages) foreach (var msgBase in messages.Messages)
if (msgBase is Message msg) if (msgBase is Message msg)
Console.WriteLine(msg.message); Console.WriteLine(msg.message);
offset += messages.Messages.Length; offset_id = messages.Messages[^1].ID;
if (offset >= messages.Count) break;
} }
``` ```
@ -305,7 +305,7 @@ There are two different methods. Here is the simpler one:
```csharp ```csharp
using var client = new WTelegram.Client(Environment.GetEnvironmentVariable); using var client = new WTelegram.Client(Environment.GetEnvironmentVariable);
await client.LoginUserIfNeeded(); await client.LoginUserIfNeeded();
var contacts = await client.Contacts_GetContacts(0); var contacts = await client.Contacts_GetContacts();
foreach (User contact in contacts.users.Values) foreach (User contact in contacts.users.Values)
Console.WriteLine($"{contact} {contact.phone}"); Console.WriteLine($"{contact} {contact.phone}");
``` ```
@ -441,11 +441,11 @@ This code fetches the available reactions in a given chat, and sends the first r
```csharp ```csharp
using var client = new WTelegram.Client(Environment.GetEnvironmentVariable); using var client = new WTelegram.Client(Environment.GetEnvironmentVariable);
await client.LoginUserIfNeeded(); await client.LoginUserIfNeeded();
var chats = await client.Messages_GetAllChats(null); var chats = await client.Messages_GetAllChats();
var chat = chats.chats[1234567890]; // the chat we want var chat = chats.chats[1234567890]; // the chat we want
var full = await client.GetFullChat(chat); var full = await client.GetFullChat(chat);
var reaction = full.full_chat.AvailableReactions[0]; // choose the first available reaction emoji var reaction = full.full_chat.AvailableReactions[0]; // choose the first available reaction emoji
var messages = await client.Messages_Search(chat, null, new InputMessagesFilterPinned(), default, default, 0, 0, 2, 0, 0, 0); var messages = await client.Messages_Search<InputMessagesFilterPinned>(chat, limit: 2);
foreach (var msg in messages.Messages) foreach (var msg in messages.Messages)
await client.Messages_SendReaction(chat, msg.ID, reaction); await client.Messages_SendReaction(chat, msg.ID, reaction);
``` ```

View file

@ -85,7 +85,7 @@ Below is an example of calling the [messages.getAllChats](https://corefork.teleg
```csharp ```csharp
using TL; using TL;
... ...
var chats = await client.Messages_GetAllChats(null); var chats = await client.Messages_GetAllChats();
Console.WriteLine("This user has joined the following:"); Console.WriteLine("This user has joined the following:");
foreach (var (id, chat) in chats.chats) foreach (var (id, chat) in chats.chats)
switch (chat) // example of downcasting to their real classes: switch (chat) // example of downcasting to their real classes:

View file

@ -38,7 +38,7 @@ namespace WTelegram
public int MaxAutoReconnects { get; set; } = 5; public int MaxAutoReconnects { get; set; } = 5;
/// <summary>Number of seconds under which an error 420 FLOOD_WAIT_X will not be raised and your request will instead be auto-retried after the delay</summary> /// <summary>Number of seconds under which an error 420 FLOOD_WAIT_X will not be raised and your request will instead be auto-retried after the delay</summary>
public int FloodRetryThreshold { get; set; } = 60; public int FloodRetryThreshold { get; set; } = 60;
/// <summary>Number of seconds between each keep-alive ping. Increase this if you have a slow connection</summary> /// <summary>Number of seconds between each keep-alive ping. Increase this if you have a slow connection or you're debugging your code</summary>
public int PingInterval { get; set; } = 60; public int PingInterval { get; set; } = 60;
/// <summary>Is this Client instance the main or a secondary DC session</summary> /// <summary>Is this Client instance the main or a secondary DC session</summary>
public bool IsMainDC => (_dcSession?.DataCenter?.id ?? 0) == _session.MainDC; public bool IsMainDC => (_dcSession?.DataCenter?.id ?? 0) == _session.MainDC;
@ -1256,6 +1256,15 @@ namespace WTelegram
} }
} }
/// <summary>Search messages with <see href="https://corefork.telegram.org/type/MessagesFilter">filter</see> and text <para>See <a href="https://corefork.telegram.org/method/messages.search"/></para></summary>
/// <typeparam name="T">See <see cref="MessagesFilter"/> for a list of possible filter types</typeparam>
/// <param name="peer">User or chat, histories with which are searched, or <see langword="null"/> constructor for global search</param>
/// <param name="text">Text search request</param>
/// <param name="offset_id">Only return messages starting from the specified message ID</param>
/// <param name="limit"><a href="https://corefork.telegram.org/api/offsets">Number of results to return</a></param>
public Task<Messages_MessagesBase> Messages_Search<T>(InputPeer peer, string text = null, int offset_id = 0, int limit = int.MaxValue) where T : MessagesFilter, new()
=> this.Messages_Search(peer, text, new T(), offset_id: offset_id, limit: limit);
/// <summary>Helper function to send a media message more easily</summary> /// <summary>Helper function to send a media message more easily</summary>
/// <param name="peer">Destination of message (chat group, channel, user chat, etc..) </param> /// <param name="peer">Destination of message (chat group, channel, user chat, etc..) </param>
/// <param name="caption">Caption for the media <i>(in plain text)</i> or <see langword="null"/></param> /// <param name="caption">Caption for the media <i>(in plain text)</i> or <see langword="null"/></param>

View file

@ -271,11 +271,11 @@ namespace TL
partial class Messages_DialogsSlice { public override int TotalCount => count; } partial class Messages_DialogsSlice { public override int TotalCount => count; }
partial class Messages_DialogsNotModified { public override int TotalCount => count; } partial class Messages_DialogsNotModified { public override int TotalCount => count; }
partial class Messages_MessagesBase { public abstract int Count { get; } } partial class Messages_MessagesBase { public abstract int Count { get; } public abstract int Offset { get; } }
partial class Messages_Messages { public override int Count => messages.Length; } partial class Messages_Messages { public override int Count => messages.Length; public override int Offset => 0; }
partial class Messages_MessagesSlice { public override int Count => count; } partial class Messages_MessagesSlice { public override int Count => count; public override int Offset => offset_id_offset; }
partial class Messages_ChannelMessages { public override int Count => count; } partial class Messages_ChannelMessages { public override int Count => count; public override int Offset => offset_id_offset; }
partial class Messages_MessagesNotModified { public override int Count => count; } partial class Messages_MessagesNotModified { public override int Count => count; public override int Offset => 0; }
partial class Updates_DifferenceBase { public abstract Updates_State State { get; } } partial class Updates_DifferenceBase { public abstract Updates_State State { get; } }
partial class Updates_DifferenceEmpty { public override Updates_State State => null; } partial class Updates_DifferenceEmpty { public override Updates_State State => null; }

View file

@ -12806,7 +12806,7 @@ namespace TL
/// <summary>Delete all temporary authorization keys <strong>except for</strong> the ones specified <para>See <a href="https://corefork.telegram.org/method/auth.dropTempAuthKeys"/> [bots: ✓]</para></summary> /// <summary>Delete all temporary authorization keys <strong>except for</strong> the ones specified <para>See <a href="https://corefork.telegram.org/method/auth.dropTempAuthKeys"/> [bots: ✓]</para></summary>
/// <param name="except_auth_keys">The auth keys that <strong>shouldn't</strong> be dropped.</param> /// <param name="except_auth_keys">The auth keys that <strong>shouldn't</strong> be dropped.</param>
public static Task<bool> Auth_DropTempAuthKeys(this Client client, long[] except_auth_keys) public static Task<bool> Auth_DropTempAuthKeys(this Client client, long[] except_auth_keys = null)
=> client.Invoke(new Auth_DropTempAuthKeys => client.Invoke(new Auth_DropTempAuthKeys
{ {
except_auth_keys = except_auth_keys, except_auth_keys = except_auth_keys,
@ -12816,7 +12816,7 @@ namespace TL
/// <param name="api_id">Application identifier (see. <a href="https://corefork.telegram.org/myapp">App configuration</a>)</param> /// <param name="api_id">Application identifier (see. <a href="https://corefork.telegram.org/myapp">App configuration</a>)</param>
/// <param name="api_hash">Application identifier hash (see. <a href="https://corefork.telegram.org/myapp">App configuration</a>)</param> /// <param name="api_hash">Application identifier hash (see. <a href="https://corefork.telegram.org/myapp">App configuration</a>)</param>
/// <param name="except_ids">List of already logged-in user IDs, to prevent logging in twice with the same user</param> /// <param name="except_ids">List of already logged-in user IDs, to prevent logging in twice with the same user</param>
public static Task<Auth_LoginTokenBase> Auth_ExportLoginToken(this Client client, int api_id, string api_hash, long[] except_ids) public static Task<Auth_LoginTokenBase> Auth_ExportLoginToken(this Client client, int api_id, string api_hash, long[] except_ids = null)
=> client.Invoke(new Auth_ExportLoginToken => client.Invoke(new Auth_ExportLoginToken
{ {
api_id = api_id, api_id = api_id,
@ -12926,7 +12926,7 @@ namespace TL
/// <summary>Returns a list of available wallpapers. <para>See <a href="https://corefork.telegram.org/method/account.getWallPapers"/></para></summary> /// <summary>Returns a list of available wallpapers. <para>See <a href="https://corefork.telegram.org/method/account.getWallPapers"/></para></summary>
/// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param> /// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param>
/// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/account.wallPapersNotModified">account.wallPapersNotModified</a></returns> /// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/account.wallPapersNotModified">account.wallPapersNotModified</a></returns>
public static Task<Account_WallPapers> Account_GetWallPapers(this Client client, long hash) public static Task<Account_WallPapers> Account_GetWallPapers(this Client client, long hash = default)
=> client.Invoke(new Account_GetWallPapers => client.Invoke(new Account_GetWallPapers
{ {
hash = hash, hash = hash,
@ -13438,7 +13438,7 @@ namespace TL
/// <param name="format">Theme format, a string that identifies the theming engines supported by the client</param> /// <param name="format">Theme format, a string that identifies the theming engines supported by the client</param>
/// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param> /// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param>
/// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/account.themesNotModified">account.themesNotModified</a></returns> /// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/account.themesNotModified">account.themesNotModified</a></returns>
public static Task<Account_Themes> Account_GetThemes(this Client client, string format, long hash) public static Task<Account_Themes> Account_GetThemes(this Client client, string format, long hash = default)
=> client.Invoke(new Account_GetThemes => client.Invoke(new Account_GetThemes
{ {
format = format, format = format,
@ -13510,7 +13510,7 @@ namespace TL
/// <summary>Get all available chat themes <para>See <a href="https://corefork.telegram.org/method/account.getChatThemes"/></para></summary> /// <summary>Get all available chat themes <para>See <a href="https://corefork.telegram.org/method/account.getChatThemes"/></para></summary>
/// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param> /// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param>
/// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/account.themesNotModified">account.themesNotModified</a></returns> /// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/account.themesNotModified">account.themesNotModified</a></returns>
public static Task<Account_Themes> Account_GetChatThemes(this Client client, long hash) public static Task<Account_Themes> Account_GetChatThemes(this Client client, long hash = default)
=> client.Invoke(new Account_GetChatThemes => client.Invoke(new Account_GetChatThemes
{ {
hash = hash, hash = hash,
@ -13561,7 +13561,7 @@ namespace TL
/// <summary>Get contact by telegram IDs <para>See <a href="https://corefork.telegram.org/method/contacts.getContactIDs"/></para></summary> /// <summary>Get contact by telegram IDs <para>See <a href="https://corefork.telegram.org/method/contacts.getContactIDs"/></para></summary>
/// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param> /// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param>
public static Task<int[]> Contacts_GetContactIDs(this Client client, long hash) public static Task<int[]> Contacts_GetContactIDs(this Client client, long hash = default)
=> client.Invoke(new Contacts_GetContactIDs => client.Invoke(new Contacts_GetContactIDs
{ {
hash = hash, hash = hash,
@ -13576,7 +13576,7 @@ namespace TL
/// <summary>Returns the current user's contact list. <para>See <a href="https://corefork.telegram.org/method/contacts.getContacts"/></para></summary> /// <summary>Returns the current user's contact list. <para>See <a href="https://corefork.telegram.org/method/contacts.getContacts"/></para></summary>
/// <param name="hash">If there already is a full contact list on the client, a <a href="https://corefork.telegram.org/api/offsets#hash-generation">hash</a> of a the list of contact IDs in ascending order may be passed in this parameter. If the contact set was not changed, <see langword="null"/> will be returned.</param> /// <param name="hash">If there already is a full contact list on the client, a <a href="https://corefork.telegram.org/api/offsets#hash-generation">hash</a> of a the list of contact IDs in ascending order may be passed in this parameter. If the contact set was not changed, <see langword="null"/> will be returned.</param>
/// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/contacts.contactsNotModified">contacts.contactsNotModified</a></returns> /// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/contacts.contactsNotModified">contacts.contactsNotModified</a></returns>
public static Task<Contacts_Contacts> Contacts_GetContacts(this Client client, long hash) public static Task<Contacts_Contacts> Contacts_GetContacts(this Client client, long hash = default)
=> client.Invoke(new Contacts_GetContacts => client.Invoke(new Contacts_GetContacts
{ {
hash = hash, hash = hash,
@ -13625,7 +13625,7 @@ namespace TL
/// <summary>Returns the list of blocked users. <para>See <a href="https://corefork.telegram.org/method/contacts.getBlocked"/></para></summary> /// <summary>Returns the list of blocked users. <para>See <a href="https://corefork.telegram.org/method/contacts.getBlocked"/></para></summary>
/// <param name="offset">The number of list elements to be skipped</param> /// <param name="offset">The number of list elements to be skipped</param>
/// <param name="limit">The number of list elements to be returned</param> /// <param name="limit">The number of list elements to be returned</param>
public static Task<Contacts_Blocked> Contacts_GetBlocked(this Client client, int offset, int limit) public static Task<Contacts_Blocked> Contacts_GetBlocked(this Client client, int offset = default, int limit = int.MaxValue)
=> client.Invoke(new Contacts_GetBlocked => client.Invoke(new Contacts_GetBlocked
{ {
offset = offset, offset = offset,
@ -13635,7 +13635,7 @@ namespace TL
/// <summary>Returns users found by username substring. <para>See <a href="https://corefork.telegram.org/method/contacts.search"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/contacts.search#possible-errors">details</a>)</para></summary> /// <summary>Returns users found by username substring. <para>See <a href="https://corefork.telegram.org/method/contacts.search"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/contacts.search#possible-errors">details</a>)</para></summary>
/// <param name="q">Target substring</param> /// <param name="q">Target substring</param>
/// <param name="limit">Maximum number of users to be returned</param> /// <param name="limit">Maximum number of users to be returned</param>
public static Task<Contacts_Found> Contacts_Search(this Client client, string q, int limit) public static Task<Contacts_Found> Contacts_Search(this Client client, string q, int limit = int.MaxValue)
=> client.Invoke(new Contacts_Search => client.Invoke(new Contacts_Search
{ {
q = q, q = q,
@ -13663,7 +13663,7 @@ namespace TL
/// <param name="limit">Maximum number of results to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param> /// <param name="limit">Maximum number of results to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param>
/// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param> /// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param>
/// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/contacts.topPeersNotModified">contacts.topPeersNotModified</a></returns> /// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/contacts.topPeersNotModified">contacts.topPeersNotModified</a></returns>
public static Task<Contacts_TopPeersBase> 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) public static Task<Contacts_TopPeersBase> Contacts_GetTopPeers(this Client client, int offset = default, int limit = int.MaxValue, long hash = default, 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.Invoke(new Contacts_GetTopPeers => client.Invoke(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)), 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)),
@ -13766,7 +13766,7 @@ namespace TL
/// <param name="offset_peer"><a href="https://corefork.telegram.org/api/offsets">Offset peer for pagination</a></param> /// <param name="offset_peer"><a href="https://corefork.telegram.org/api/offsets">Offset peer for pagination</a></param>
/// <param name="limit">Number of list elements to be returned</param> /// <param name="limit">Number of list elements to be returned</param>
/// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param> /// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param>
public static Task<Messages_DialogsBase> 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) public static Task<Messages_DialogsBase> Messages_GetDialogs(this Client client, DateTime offset_date = default, int offset_id = default, InputPeer offset_peer = null, int limit = int.MaxValue, long hash = default, bool exclude_pinned = false, int? folder_id = null)
=> client.Invoke(new Messages_GetDialogs => client.Invoke(new Messages_GetDialogs
{ {
flags = (Messages_GetDialogs.Flags)((exclude_pinned ? 0x1 : 0) | (folder_id != null ? 0x2 : 0)), flags = (Messages_GetDialogs.Flags)((exclude_pinned ? 0x1 : 0) | (folder_id != null ? 0x2 : 0)),
@ -13787,7 +13787,7 @@ namespace TL
/// <param name="max_id">If a positive value was transferred, the method will return only messages with IDs less than <strong>max_id</strong></param> /// <param name="max_id">If a positive value was transferred, the method will return only messages with IDs less than <strong>max_id</strong></param>
/// <param name="min_id">If a positive value was transferred, the method will return only messages with IDs more than <strong>min_id</strong></param> /// <param name="min_id">If a positive value was transferred, the method will return only messages with IDs more than <strong>min_id</strong></param>
/// <param name="hash"><a href="https://corefork.telegram.org/api/offsets">Result hash</a></param> /// <param name="hash"><a href="https://corefork.telegram.org/api/offsets">Result hash</a></param>
public static Task<Messages_MessagesBase> 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) public static Task<Messages_MessagesBase> Messages_GetHistory(this Client client, InputPeer peer, int offset_id = default, DateTime offset_date = default, int add_offset = default, int limit = int.MaxValue, int max_id = default, int min_id = default, long hash = default)
=> client.Invoke(new Messages_GetHistory => client.Invoke(new Messages_GetHistory
{ {
peer = peer, peer = peer,
@ -13814,7 +13814,7 @@ namespace TL
/// <param name="max_id"><a href="https://corefork.telegram.org/api/offsets">Maximum message ID to return</a></param> /// <param name="max_id"><a href="https://corefork.telegram.org/api/offsets">Maximum message ID to return</a></param>
/// <param name="min_id"><a href="https://corefork.telegram.org/api/offsets">Minimum message ID to return</a></param> /// <param name="min_id"><a href="https://corefork.telegram.org/api/offsets">Minimum message ID to return</a></param>
/// <param name="hash"><a href="https://corefork.telegram.org/api/offsets">Hash</a></param> /// <param name="hash"><a href="https://corefork.telegram.org/api/offsets">Hash</a></param>
public static Task<Messages_MessagesBase> 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) public static Task<Messages_MessagesBase> Messages_Search(this Client client, InputPeer peer, string q, MessagesFilter filter, DateTime min_date = default, DateTime max_date = default, int offset_id = default, int add_offset = default, int limit = int.MaxValue, int max_id = default, int min_id = default, long hash = default, InputPeer from_id = null, int? top_msg_id = null)
=> client.Invoke(new Messages_Search => client.Invoke(new Messages_Search
{ {
flags = (Messages_Search.Flags)((from_id != null ? 0x1 : 0) | (top_msg_id != null ? 0x2 : 0)), flags = (Messages_Search.Flags)((from_id != null ? 0x1 : 0) | (top_msg_id != null ? 0x2 : 0)),
@ -13836,7 +13836,7 @@ namespace TL
/// <summary>Marks message history as read. <para>See <a href="https://corefork.telegram.org/method/messages.readHistory"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/messages.readHistory#possible-errors">details</a>)</para></summary> /// <summary>Marks message history as read. <para>See <a href="https://corefork.telegram.org/method/messages.readHistory"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/messages.readHistory#possible-errors">details</a>)</para></summary>
/// <param name="peer">Target user or group</param> /// <param name="peer">Target user or group</param>
/// <param name="max_id">If a positive value is passed, only messages with identifiers less or equal than the given one will be read</param> /// <param name="max_id">If a positive value is passed, only messages with identifiers less or equal than the given one will be read</param>
public static Task<Messages_AffectedMessages> Messages_ReadHistory(this Client client, InputPeer peer, int max_id) public static Task<Messages_AffectedMessages> Messages_ReadHistory(this Client client, InputPeer peer, int max_id = default)
=> client.Invoke(new Messages_ReadHistory => client.Invoke(new Messages_ReadHistory
{ {
peer = peer, peer = peer,
@ -13848,7 +13848,7 @@ namespace TL
/// <param name="revoke">Whether to delete the message history for all chat participants</param> /// <param name="revoke">Whether to delete the message history for all chat participants</param>
/// <param name="peer">User or chat, communication history of which will be deleted</param> /// <param name="peer">User or chat, communication history of which will be deleted</param>
/// <param name="max_id">Maximum ID of message to delete</param> /// <param name="max_id">Maximum ID of message to delete</param>
public static Task<Messages_AffectedHistory> 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) public static Task<Messages_AffectedHistory> Messages_DeleteHistory(this Client client, InputPeer peer, int max_id = default, bool just_clear = false, bool revoke = false, DateTime? min_date = null, DateTime? max_date = null)
=> client.Invoke(new Messages_DeleteHistory => client.Invoke(new Messages_DeleteHistory
{ {
flags = (Messages_DeleteHistory.Flags)((just_clear ? 0x1 : 0) | (revoke ? 0x2 : 0) | (min_date != null ? 0x4 : 0) | (max_date != null ? 0x8 : 0)), flags = (Messages_DeleteHistory.Flags)((just_clear ? 0x1 : 0) | (revoke ? 0x2 : 0) | (min_date != null ? 0x4 : 0) | (max_date != null ? 0x8 : 0)),
@ -13870,7 +13870,7 @@ namespace TL
/// <summary><para>⚠ <b>This method is only for small private Chat</b>. See <see href="https://github.com/wiz0u/WTelegramClient/blob/master/README.md#terminology">Terminology</see> to understand what this means<br/>Search for a similar method name starting with <c>Channels_</c> if you're dealing with a <see cref="Channel"/></para> Confirms receipt of messages by a client, cancels PUSH-notification sending. <para>See <a href="https://corefork.telegram.org/method/messages.receivedMessages"/></para></summary> /// <summary><para>⚠ <b>This method is only for small private Chat</b>. See <see href="https://github.com/wiz0u/WTelegramClient/blob/master/README.md#terminology">Terminology</see> to understand what this means<br/>Search for a similar method name starting with <c>Channels_</c> if you're dealing with a <see cref="Channel"/></para> Confirms receipt of messages by a client, cancels PUSH-notification sending. <para>See <a href="https://corefork.telegram.org/method/messages.receivedMessages"/></para></summary>
/// <param name="max_id">Maximum message ID available in a client.</param> /// <param name="max_id">Maximum message ID available in a client.</param>
public static Task<ReceivedNotifyMessage[]> Messages_ReceivedMessages(this Client client, int max_id) public static Task<ReceivedNotifyMessage[]> Messages_ReceivedMessages(this Client client, int max_id = default)
=> client.Invoke(new Messages_ReceivedMessages => client.Invoke(new Messages_ReceivedMessages
{ {
max_id = max_id, max_id = max_id,
@ -14122,7 +14122,7 @@ namespace TL
/// <summary>Marks message history within a secret chat as read. <para>See <a href="https://corefork.telegram.org/method/messages.readEncryptedHistory"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/messages.readEncryptedHistory#possible-errors">details</a>)</para></summary> /// <summary>Marks message history within a secret chat as read. <para>See <a href="https://corefork.telegram.org/method/messages.readEncryptedHistory"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/messages.readEncryptedHistory#possible-errors">details</a>)</para></summary>
/// <param name="peer">Secret chat ID</param> /// <param name="peer">Secret chat ID</param>
/// <param name="max_date">Maximum date value for received messages in history</param> /// <param name="max_date">Maximum date value for received messages in history</param>
public static Task<bool> Messages_ReadEncryptedHistory(this Client client, InputEncryptedChat peer, DateTime max_date) public static Task<bool> Messages_ReadEncryptedHistory(this Client client, InputEncryptedChat peer, DateTime max_date = default)
=> client.Invoke(new Messages_ReadEncryptedHistory => client.Invoke(new Messages_ReadEncryptedHistory
{ {
peer = peer, peer = peer,
@ -14199,7 +14199,7 @@ namespace TL
/// <param name="emoticon">The emoji</param> /// <param name="emoticon">The emoji</param>
/// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param> /// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param>
/// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/messages.stickersNotModified">messages.stickersNotModified</a></returns> /// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/messages.stickersNotModified">messages.stickersNotModified</a></returns>
public static Task<Messages_Stickers> Messages_GetStickers(this Client client, string emoticon, long hash) public static Task<Messages_Stickers> Messages_GetStickers(this Client client, string emoticon, long hash = default)
=> client.Invoke(new Messages_GetStickers => client.Invoke(new Messages_GetStickers
{ {
emoticon = emoticon, emoticon = emoticon,
@ -14209,7 +14209,7 @@ namespace TL
/// <summary>Get all installed stickers <para>See <a href="https://corefork.telegram.org/method/messages.getAllStickers"/></para></summary> /// <summary>Get all installed stickers <para>See <a href="https://corefork.telegram.org/method/messages.getAllStickers"/></para></summary>
/// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param> /// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param>
/// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/messages.allStickersNotModified">messages.allStickersNotModified</a></returns> /// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/messages.allStickersNotModified">messages.allStickersNotModified</a></returns>
public static Task<Messages_AllStickers> Messages_GetAllStickers(this Client client, long hash) public static Task<Messages_AllStickers> Messages_GetAllStickers(this Client client, long hash = default)
=> client.Invoke(new Messages_GetAllStickers => client.Invoke(new Messages_GetAllStickers
{ {
hash = hash, hash = hash,
@ -14261,7 +14261,7 @@ namespace TL
/// <summary>Get info about a stickerset <para>See <a href="https://corefork.telegram.org/method/messages.getStickerSet"/> [bots: ✓]</para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/messages.getStickerSet#possible-errors">details</a>)</para></summary> /// <summary>Get info about a stickerset <para>See <a href="https://corefork.telegram.org/method/messages.getStickerSet"/> [bots: ✓]</para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/messages.getStickerSet#possible-errors">details</a>)</para></summary>
/// <param name="stickerset">Stickerset</param> /// <param name="stickerset">Stickerset</param>
/// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/messages.stickerSetNotModified">messages.stickerSetNotModified</a></returns> /// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/messages.stickerSetNotModified">messages.stickerSetNotModified</a></returns>
public static Task<Messages_StickerSet> Messages_GetStickerSet(this Client client, InputStickerSet stickerset, int hash) public static Task<Messages_StickerSet> Messages_GetStickerSet(this Client client, InputStickerSet stickerset, int hash = default)
=> client.Invoke(new Messages_GetStickerSet => client.Invoke(new Messages_GetStickerSet
{ {
stickerset = stickerset, stickerset = stickerset,
@ -14342,7 +14342,7 @@ namespace TL
/// <param name="offset_peer"><a href="https://corefork.telegram.org/api/offsets">Offsets for pagination, for more info click here</a></param> /// <param name="offset_peer"><a href="https://corefork.telegram.org/api/offsets">Offsets for pagination, for more info click here</a></param>
/// <param name="offset_id"><a href="https://corefork.telegram.org/api/offsets">Offsets for pagination, for more info click here</a></param> /// <param name="offset_id"><a href="https://corefork.telegram.org/api/offsets">Offsets for pagination, for more info click here</a></param>
/// <param name="limit"><a href="https://corefork.telegram.org/api/offsets">Offsets for pagination, for more info click here</a></param> /// <param name="limit"><a href="https://corefork.telegram.org/api/offsets">Offsets for pagination, for more info click here</a></param>
public static Task<Messages_MessagesBase> 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) public static Task<Messages_MessagesBase> Messages_SearchGlobal(this Client client, string q, MessagesFilter filter, DateTime min_date = default, DateTime max_date = default, int offset_rate = default, InputPeer offset_peer = null, int offset_id = default, int limit = int.MaxValue, int? folder_id = null)
=> client.Invoke(new Messages_SearchGlobal => client.Invoke(new Messages_SearchGlobal
{ {
flags = (Messages_SearchGlobal.Flags)(folder_id != null ? 0x1 : 0), flags = (Messages_SearchGlobal.Flags)(folder_id != null ? 0x1 : 0),
@ -14382,7 +14382,7 @@ namespace TL
/// <summary>Get saved GIFs <para>See <a href="https://corefork.telegram.org/method/messages.getSavedGifs"/></para></summary> /// <summary>Get saved GIFs <para>See <a href="https://corefork.telegram.org/method/messages.getSavedGifs"/></para></summary>
/// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param> /// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param>
/// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/messages.savedGifsNotModified">messages.savedGifsNotModified</a></returns> /// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/messages.savedGifsNotModified">messages.savedGifsNotModified</a></returns>
public static Task<Messages_SavedGifs> Messages_GetSavedGifs(this Client client, long hash) public static Task<Messages_SavedGifs> Messages_GetSavedGifs(this Client client, long hash = default)
=> client.Invoke(new Messages_GetSavedGifs => client.Invoke(new Messages_GetSavedGifs
{ {
hash = hash, hash = hash,
@ -14572,7 +14572,7 @@ namespace TL
/// <summary>Get featured stickers <para>See <a href="https://corefork.telegram.org/method/messages.getFeaturedStickers"/></para></summary> /// <summary>Get featured stickers <para>See <a href="https://corefork.telegram.org/method/messages.getFeaturedStickers"/></para></summary>
/// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param> /// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param>
public static Task<Messages_FeaturedStickersBase> Messages_GetFeaturedStickers(this Client client, long hash) public static Task<Messages_FeaturedStickersBase> Messages_GetFeaturedStickers(this Client client, long hash = default)
=> client.Invoke(new Messages_GetFeaturedStickers => client.Invoke(new Messages_GetFeaturedStickers
{ {
hash = hash, hash = hash,
@ -14590,7 +14590,7 @@ namespace TL
/// <param name="attached">Get stickers recently attached to photo or video files</param> /// <param name="attached">Get stickers recently attached to photo or video files</param>
/// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param> /// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param>
/// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/messages.recentStickersNotModified">messages.recentStickersNotModified</a></returns> /// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/messages.recentStickersNotModified">messages.recentStickersNotModified</a></returns>
public static Task<Messages_RecentStickers> Messages_GetRecentStickers(this Client client, long hash, bool attached = false) public static Task<Messages_RecentStickers> Messages_GetRecentStickers(this Client client, long hash = default, bool attached = false)
=> client.Invoke(new Messages_GetRecentStickers => client.Invoke(new Messages_GetRecentStickers
{ {
flags = (Messages_GetRecentStickers.Flags)(attached ? 0x1 : 0), flags = (Messages_GetRecentStickers.Flags)(attached ? 0x1 : 0),
@ -14621,7 +14621,7 @@ namespace TL
/// <param name="masks">Get mask stickers</param> /// <param name="masks">Get mask stickers</param>
/// <param name="offset_id"><a href="https://corefork.telegram.org/api/offsets">Offsets for pagination, for more info click here</a></param> /// <param name="offset_id"><a href="https://corefork.telegram.org/api/offsets">Offsets for pagination, for more info click here</a></param>
/// <param name="limit">Maximum number of results to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param> /// <param name="limit">Maximum number of results to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param>
public static Task<Messages_ArchivedStickers> Messages_GetArchivedStickers(this Client client, long offset_id, int limit, bool masks = false) public static Task<Messages_ArchivedStickers> Messages_GetArchivedStickers(this Client client, long offset_id = default, int limit = int.MaxValue, bool masks = false)
=> client.Invoke(new Messages_GetArchivedStickers => client.Invoke(new Messages_GetArchivedStickers
{ {
flags = (Messages_GetArchivedStickers.Flags)(masks ? 0x1 : 0), flags = (Messages_GetArchivedStickers.Flags)(masks ? 0x1 : 0),
@ -14632,7 +14632,7 @@ namespace TL
/// <summary>Get installed mask stickers <para>See <a href="https://corefork.telegram.org/method/messages.getMaskStickers"/></para></summary> /// <summary>Get installed mask stickers <para>See <a href="https://corefork.telegram.org/method/messages.getMaskStickers"/></para></summary>
/// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param> /// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param>
/// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/messages.allStickersNotModified">messages.allStickersNotModified</a></returns> /// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/messages.allStickersNotModified">messages.allStickersNotModified</a></returns>
public static Task<Messages_AllStickers> Messages_GetMaskStickers(this Client client, long hash) public static Task<Messages_AllStickers> Messages_GetMaskStickers(this Client client, long hash = default)
=> client.Invoke(new Messages_GetMaskStickers => client.Invoke(new Messages_GetMaskStickers
{ {
hash = hash, hash = hash,
@ -14704,7 +14704,7 @@ namespace TL
/// <param name="user_id">User ID</param> /// <param name="user_id">User ID</param>
/// <param name="max_id">Maximum ID of chat to return (see <a href="https://corefork.telegram.org/api/offsets">pagination</a>)</param> /// <param name="max_id">Maximum ID of chat to return (see <a href="https://corefork.telegram.org/api/offsets">pagination</a>)</param>
/// <param name="limit">Maximum number of results to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param> /// <param name="limit">Maximum number of results to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param>
public static Task<Messages_Chats> Messages_GetCommonChats(this Client client, InputUserBase user_id, long max_id, int limit) public static Task<Messages_Chats> Messages_GetCommonChats(this Client client, InputUserBase user_id, long max_id = default, int limit = int.MaxValue)
=> client.Invoke(new Messages_GetCommonChats => client.Invoke(new Messages_GetCommonChats
{ {
user_id = user_id, user_id = user_id,
@ -14714,7 +14714,7 @@ namespace TL
/// <summary>Get all chats, channels and supergroups <para>See <a href="https://corefork.telegram.org/method/messages.getAllChats"/></para></summary> /// <summary>Get all chats, channels and supergroups <para>See <a href="https://corefork.telegram.org/method/messages.getAllChats"/></para></summary>
/// <param name="except_ids">Except these chats/channels/supergroups</param> /// <param name="except_ids">Except these chats/channels/supergroups</param>
public static Task<Messages_Chats> Messages_GetAllChats(this Client client, long[] except_ids) public static Task<Messages_Chats> Messages_GetAllChats(this Client client, long[] except_ids = null)
=> client.Invoke(new Messages_GetAllChats => client.Invoke(new Messages_GetAllChats
{ {
except_ids = except_ids, except_ids = except_ids,
@ -14723,7 +14723,7 @@ namespace TL
/// <summary>Get <a href="https://instantview.telegram.org">instant view</a> page <para>See <a href="https://corefork.telegram.org/method/messages.getWebPage"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/messages.getWebPage#possible-errors">details</a>)</para></summary> /// <summary>Get <a href="https://instantview.telegram.org">instant view</a> page <para>See <a href="https://corefork.telegram.org/method/messages.getWebPage"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/messages.getWebPage#possible-errors">details</a>)</para></summary>
/// <param name="url">URL of IV page to fetch</param> /// <param name="url">URL of IV page to fetch</param>
/// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param> /// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param>
public static Task<WebPageBase> Messages_GetWebPage(this Client client, string url, int hash) public static Task<WebPageBase> Messages_GetWebPage(this Client client, string url, int hash = default)
=> client.Invoke(new Messages_GetWebPage => client.Invoke(new Messages_GetWebPage
{ {
url = url, url = url,
@ -14811,7 +14811,7 @@ namespace TL
/// <summary>Get faved stickers <para>See <a href="https://corefork.telegram.org/method/messages.getFavedStickers"/></para></summary> /// <summary>Get faved stickers <para>See <a href="https://corefork.telegram.org/method/messages.getFavedStickers"/></para></summary>
/// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param> /// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param>
/// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/messages.favedStickersNotModified">messages.favedStickersNotModified</a></returns> /// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/messages.favedStickersNotModified">messages.favedStickersNotModified</a></returns>
public static Task<Messages_FavedStickers> Messages_GetFavedStickers(this Client client, long hash) public static Task<Messages_FavedStickers> Messages_GetFavedStickers(this Client client, long hash = default)
=> client.Invoke(new Messages_GetFavedStickers => client.Invoke(new Messages_GetFavedStickers
{ {
hash = hash, hash = hash,
@ -14834,7 +14834,7 @@ namespace TL
/// <param name="limit">Maximum number of results to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param> /// <param name="limit">Maximum number of results to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param>
/// <param name="max_id">Maximum message ID to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param> /// <param name="max_id">Maximum message ID to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param>
/// <param name="min_id">Minimum message ID to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param> /// <param name="min_id">Minimum message ID to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param>
public static Task<Messages_MessagesBase> Messages_GetUnreadMentions(this Client client, InputPeer peer, int offset_id, int add_offset, int limit, int max_id, int min_id) public static Task<Messages_MessagesBase> Messages_GetUnreadMentions(this Client client, InputPeer peer, int offset_id = default, int add_offset = default, int limit = int.MaxValue, int max_id = default, int min_id = default)
=> client.Invoke(new Messages_GetUnreadMentions => client.Invoke(new Messages_GetUnreadMentions
{ {
peer = peer, peer = peer,
@ -14857,7 +14857,7 @@ namespace TL
/// <param name="peer">User</param> /// <param name="peer">User</param>
/// <param name="limit">Maximum number of results to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param> /// <param name="limit">Maximum number of results to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param>
/// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param> /// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param>
public static Task<Messages_MessagesBase> Messages_GetRecentLocations(this Client client, InputPeer peer, int limit, long hash) public static Task<Messages_MessagesBase> Messages_GetRecentLocations(this Client client, InputPeer peer, int limit = int.MaxValue, long hash = default)
=> client.Invoke(new Messages_GetRecentLocations => client.Invoke(new Messages_GetRecentLocations
{ {
peer = peer, peer = peer,
@ -14900,7 +14900,7 @@ namespace TL
/// <param name="q">Query string</param> /// <param name="q">Query string</param>
/// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param> /// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param>
/// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/messages.foundStickerSetsNotModified">messages.foundStickerSetsNotModified</a></returns> /// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/messages.foundStickerSetsNotModified">messages.foundStickerSetsNotModified</a></returns>
public static Task<Messages_FoundStickerSets> Messages_SearchStickerSets(this Client client, string q, long hash, bool exclude_featured = false) public static Task<Messages_FoundStickerSets> Messages_SearchStickerSets(this Client client, string q, long hash = default, bool exclude_featured = false)
=> client.Invoke(new Messages_SearchStickerSets => client.Invoke(new Messages_SearchStickerSets
{ {
flags = (Messages_SearchStickerSets.Flags)(exclude_featured ? 0x1 : 0), flags = (Messages_SearchStickerSets.Flags)(exclude_featured ? 0x1 : 0),
@ -15086,7 +15086,7 @@ namespace TL
/// <summary>Get scheduled messages <para>See <a href="https://corefork.telegram.org/method/messages.getScheduledHistory"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/messages.getScheduledHistory#possible-errors">details</a>)</para></summary> /// <summary>Get scheduled messages <para>See <a href="https://corefork.telegram.org/method/messages.getScheduledHistory"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/messages.getScheduledHistory#possible-errors">details</a>)</para></summary>
/// <param name="peer">Peer</param> /// <param name="peer">Peer</param>
/// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param> /// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param>
public static Task<Messages_MessagesBase> Messages_GetScheduledHistory(this Client client, InputPeer peer, long hash) public static Task<Messages_MessagesBase> Messages_GetScheduledHistory(this Client client, InputPeer peer, long hash = default)
=> client.Invoke(new Messages_GetScheduledHistory => client.Invoke(new Messages_GetScheduledHistory
{ {
peer = peer, peer = peer,
@ -15129,7 +15129,7 @@ namespace TL
/// <param name="option">Get only results for the specified poll <c>option</c></param> /// <param name="option">Get only results for the specified poll <c>option</c></param>
/// <param name="offset">Offset for results, taken from the <c>next_offset</c> field of <see cref="Messages_VotesList"/>, initially an empty string. <br/>Note: if no more results are available, the method call will return an empty <c>next_offset</c>; thus, avoid providing the <c>next_offset</c> returned in <see cref="Messages_VotesList"/> if it is empty, to avoid an infinite loop.</param> /// <param name="offset">Offset for results, taken from the <c>next_offset</c> field of <see cref="Messages_VotesList"/>, initially an empty string. <br/>Note: if no more results are available, the method call will return an empty <c>next_offset</c>; thus, avoid providing the <c>next_offset</c> returned in <see cref="Messages_VotesList"/> if it is empty, to avoid an infinite loop.</param>
/// <param name="limit">Number of results to return</param> /// <param name="limit">Number of results to return</param>
public static Task<Messages_VotesList> Messages_GetPollVotes(this Client client, InputPeer peer, int id, int limit, byte[] option = null, string offset = null) public static Task<Messages_VotesList> Messages_GetPollVotes(this Client client, InputPeer peer, int id, int limit = int.MaxValue, byte[] option = null, string offset = null)
=> client.Invoke(new Messages_GetPollVotes => client.Invoke(new Messages_GetPollVotes
{ {
flags = (Messages_GetPollVotes.Flags)((option != null ? 0x1 : 0) | (offset != null ? 0x2 : 0)), flags = (Messages_GetPollVotes.Flags)((option != null ? 0x1 : 0) | (offset != null ? 0x2 : 0)),
@ -15187,7 +15187,7 @@ namespace TL
/// <param name="offset">Offset</param> /// <param name="offset">Offset</param>
/// <param name="limit">Maximum number of results to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param> /// <param name="limit">Maximum number of results to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param>
/// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param> /// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param>
public static Task<Messages_FeaturedStickersBase> Messages_GetOldFeaturedStickers(this Client client, int offset, int limit, long hash) public static Task<Messages_FeaturedStickersBase> Messages_GetOldFeaturedStickers(this Client client, int offset = default, int limit = int.MaxValue, long hash = default)
=> client.Invoke(new Messages_GetOldFeaturedStickers => client.Invoke(new Messages_GetOldFeaturedStickers
{ {
offset = offset, offset = offset,
@ -15205,7 +15205,7 @@ namespace TL
/// <param name="max_id">If a positive value was transferred, the method will return only messages with ID smaller than max_id</param> /// <param name="max_id">If a positive value was transferred, the method will return only messages with ID smaller than max_id</param>
/// <param name="min_id">If a positive value was transferred, the method will return only messages with ID bigger than min_id</param> /// <param name="min_id">If a positive value was transferred, the method will return only messages with ID bigger than min_id</param>
/// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param> /// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param>
public static Task<Messages_MessagesBase> 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) public static Task<Messages_MessagesBase> Messages_GetReplies(this Client client, InputPeer peer, int msg_id, int offset_id = default, DateTime offset_date = default, int add_offset = default, int limit = int.MaxValue, int max_id = default, int min_id = default, long hash = default)
=> client.Invoke(new Messages_GetReplies => client.Invoke(new Messages_GetReplies
{ {
peer = peer, peer = peer,
@ -15317,7 +15317,7 @@ namespace TL
/// <param name="offset_date"><a href="https://corefork.telegram.org/api/offsets">Offsets for pagination, for more info click here</a></param> /// <param name="offset_date"><a href="https://corefork.telegram.org/api/offsets">Offsets for pagination, for more info click here</a></param>
/// <param name="offset_link"><a href="https://corefork.telegram.org/api/offsets">Offsets for pagination, for more info click here</a></param> /// <param name="offset_link"><a href="https://corefork.telegram.org/api/offsets">Offsets for pagination, for more info click here</a></param>
/// <param name="limit">Maximum number of results to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param> /// <param name="limit">Maximum number of results to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param>
public static Task<Messages_ExportedChatInvites> Messages_GetExportedChatInvites(this Client client, InputPeer peer, InputUserBase admin_id, int limit, bool revoked = false, DateTime? offset_date = null, string offset_link = null) public static Task<Messages_ExportedChatInvites> Messages_GetExportedChatInvites(this Client client, InputPeer peer, InputUserBase admin_id, int limit = int.MaxValue, bool revoked = false, DateTime? offset_date = null, string offset_link = null)
=> client.Invoke(new Messages_GetExportedChatInvites => client.Invoke(new Messages_GetExportedChatInvites
{ {
flags = (Messages_GetExportedChatInvites.Flags)((revoked ? 0x8 : 0) | (offset_date != null ? 0x4 : 0) | (offset_link != null ? 0x4 : 0)), flags = (Messages_GetExportedChatInvites.Flags)((revoked ? 0x8 : 0) | (offset_date != null ? 0x4 : 0) | (offset_link != null ? 0x4 : 0)),
@ -15390,7 +15390,7 @@ namespace TL
/// <param name="offset_date"><a href="https://corefork.telegram.org/api/offsets">Offsets for pagination, for more info click here</a></param> /// <param name="offset_date"><a href="https://corefork.telegram.org/api/offsets">Offsets for pagination, for more info click here</a></param>
/// <param name="offset_user">User ID for <a href="https://corefork.telegram.org/api/offsets">pagination</a></param> /// <param name="offset_user">User ID for <a href="https://corefork.telegram.org/api/offsets">pagination</a></param>
/// <param name="limit">Maximum number of results to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param> /// <param name="limit">Maximum number of results to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param>
public static Task<Messages_ChatInviteImporters> Messages_GetChatInviteImporters(this Client client, InputPeer peer, DateTime offset_date, InputUserBase offset_user, int limit, bool requested = false, string link = null, string q = null) public static Task<Messages_ChatInviteImporters> Messages_GetChatInviteImporters(this Client client, InputPeer peer, DateTime offset_date = default, InputUserBase offset_user = null, int limit = int.MaxValue, bool requested = false, string link = null, string q = null)
=> client.Invoke(new Messages_GetChatInviteImporters => client.Invoke(new Messages_GetChatInviteImporters
{ {
flags = (Messages_GetChatInviteImporters.Flags)((requested ? 0x1 : 0) | (link != null ? 0x2 : 0) | (q != null ? 0x4 : 0)), flags = (Messages_GetChatInviteImporters.Flags)((requested ? 0x1 : 0) | (link != null ? 0x2 : 0) | (q != null ? 0x4 : 0)),
@ -15441,7 +15441,7 @@ namespace TL
}); });
/// <summary><para>See <a href="https://corefork.telegram.org/method/messages.getSearchResultsCalendar"/></para></summary> /// <summary><para>See <a href="https://corefork.telegram.org/method/messages.getSearchResultsCalendar"/></para></summary>
public static Task<Messages_SearchResultsCalendar> Messages_GetSearchResultsCalendar(this Client client, InputPeer peer, MessagesFilter filter, int offset_id, DateTime offset_date) public static Task<Messages_SearchResultsCalendar> Messages_GetSearchResultsCalendar(this Client client, InputPeer peer, MessagesFilter filter, int offset_id = default, DateTime offset_date = default)
=> client.Invoke(new Messages_GetSearchResultsCalendar => client.Invoke(new Messages_GetSearchResultsCalendar
{ {
peer = peer, peer = peer,
@ -15451,7 +15451,7 @@ namespace TL
}); });
/// <summary><para>See <a href="https://corefork.telegram.org/method/messages.getSearchResultsPositions"/></para></summary> /// <summary><para>See <a href="https://corefork.telegram.org/method/messages.getSearchResultsPositions"/></para></summary>
public static Task<Messages_SearchResultsPositions> Messages_GetSearchResultsPositions(this Client client, InputPeer peer, MessagesFilter filter, int offset_id, int limit) public static Task<Messages_SearchResultsPositions> Messages_GetSearchResultsPositions(this Client client, InputPeer peer, MessagesFilter filter, int offset_id = default, int limit = int.MaxValue)
=> client.Invoke(new Messages_GetSearchResultsPositions => client.Invoke(new Messages_GetSearchResultsPositions
{ {
peer = peer, peer = peer,
@ -15523,7 +15523,7 @@ namespace TL
/// <param name="reaction">Get only reactions of this type (UTF8 emoji)</param> /// <param name="reaction">Get only reactions of this type (UTF8 emoji)</param>
/// <param name="offset">Offset (typically taken from the <c>next_offset</c> field of the returned <see cref="Messages_MessageReactionsList"/>)</param> /// <param name="offset">Offset (typically taken from the <c>next_offset</c> field of the returned <see cref="Messages_MessageReactionsList"/>)</param>
/// <param name="limit">Maximum number of results to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param> /// <param name="limit">Maximum number of results to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param>
public static Task<Messages_MessageReactionsList> Messages_GetMessageReactionsList(this Client client, InputPeer peer, int id, int limit, string reaction = null, string offset = null) public static Task<Messages_MessageReactionsList> Messages_GetMessageReactionsList(this Client client, InputPeer peer, int id, int limit = int.MaxValue, string reaction = null, string offset = null)
=> client.Invoke(new Messages_GetMessageReactionsList => client.Invoke(new Messages_GetMessageReactionsList
{ {
flags = (Messages_GetMessageReactionsList.Flags)((reaction != null ? 0x1 : 0) | (offset != null ? 0x2 : 0)), flags = (Messages_GetMessageReactionsList.Flags)((reaction != null ? 0x1 : 0) | (offset != null ? 0x2 : 0)),
@ -15544,7 +15544,7 @@ namespace TL
/// <summary><para>See <a href="https://corefork.telegram.org/method/messages.getAvailableReactions"/></para></summary> /// <summary><para>See <a href="https://corefork.telegram.org/method/messages.getAvailableReactions"/></para></summary>
/// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/messages.availableReactionsNotModified">messages.availableReactionsNotModified</a></returns> /// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/messages.availableReactionsNotModified">messages.availableReactionsNotModified</a></returns>
public static Task<Messages_AvailableReactions> Messages_GetAvailableReactions(this Client client, int hash) public static Task<Messages_AvailableReactions> Messages_GetAvailableReactions(this Client client, int hash = default)
=> client.Invoke(new Messages_GetAvailableReactions => client.Invoke(new Messages_GetAvailableReactions
{ {
hash = hash, hash = hash,
@ -15570,7 +15570,7 @@ namespace TL
}); });
/// <summary><para>See <a href="https://corefork.telegram.org/method/messages.getUnreadReactions"/></para></summary> /// <summary><para>See <a href="https://corefork.telegram.org/method/messages.getUnreadReactions"/></para></summary>
public static Task<Messages_MessagesBase> Messages_GetUnreadReactions(this Client client, InputPeer peer, int offset_id, int add_offset, int limit, int max_id, int min_id) public static Task<Messages_MessagesBase> Messages_GetUnreadReactions(this Client client, InputPeer peer, int offset_id = default, int add_offset = default, int limit = int.MaxValue, int max_id = default, int min_id = default)
=> client.Invoke(new Messages_GetUnreadReactions => client.Invoke(new Messages_GetUnreadReactions
{ {
peer = peer, peer = peer,
@ -15615,7 +15615,7 @@ namespace TL
/// <param name="filter">Messsage filter</param> /// <param name="filter">Messsage filter</param>
/// <param name="pts">Persistent timestamp (see <a href="https://corefork.telegram.org/api/updates">updates</a>)</param> /// <param name="pts">Persistent timestamp (see <a href="https://corefork.telegram.org/api/updates">updates</a>)</param>
/// <param name="limit">How many updates to fetch, max <c>100000</c><br/>Ordinary (non-bot) users are supposed to pass <c>10-100</c></param> /// <param name="limit">How many updates to fetch, max <c>100000</c><br/>Ordinary (non-bot) users are supposed to pass <c>10-100</c></param>
public static Task<Updates_ChannelDifferenceBase> Updates_GetChannelDifference(this Client client, InputChannelBase channel, ChannelMessagesFilter filter, int pts, int limit, bool force = false) public static Task<Updates_ChannelDifferenceBase> Updates_GetChannelDifference(this Client client, InputChannelBase channel, ChannelMessagesFilter filter, int pts, int limit = int.MaxValue, bool force = false)
=> client.Invoke(new Updates_GetChannelDifference => client.Invoke(new Updates_GetChannelDifference
{ {
flags = (Updates_GetChannelDifference.Flags)(force ? 0x1 : 0), flags = (Updates_GetChannelDifference.Flags)(force ? 0x1 : 0),
@ -15659,7 +15659,7 @@ namespace TL
/// <param name="offset">Number of list elements to be skipped</param> /// <param name="offset">Number of list elements to be skipped</param>
/// <param name="max_id">If a positive value was transferred, the method will return only photos with IDs less than the set one</param> /// <param name="max_id">If a positive value was transferred, the method will return only photos with IDs less than the set one</param>
/// <param name="limit">Number of list elements to be returned</param> /// <param name="limit">Number of list elements to be returned</param>
public static Task<Photos_Photos> Photos_GetUserPhotos(this Client client, InputUserBase user_id, int offset, long max_id, int limit) public static Task<Photos_Photos> Photos_GetUserPhotos(this Client client, InputUserBase user_id, int offset = default, long max_id = default, int limit = int.MaxValue)
=> client.Invoke(new Photos_GetUserPhotos => client.Invoke(new Photos_GetUserPhotos
{ {
user_id = user_id, user_id = user_id,
@ -15686,7 +15686,7 @@ namespace TL
/// <param name="location">File location</param> /// <param name="location">File location</param>
/// <param name="offset">Number of bytes to be skipped</param> /// <param name="offset">Number of bytes to be skipped</param>
/// <param name="limit">Number of bytes to be returned</param> /// <param name="limit">Number of bytes to be returned</param>
public static Task<Upload_FileBase> Upload_GetFile(this Client client, InputFileLocationBase location, int offset, int limit, bool precise = false, bool cdn_supported = false) public static Task<Upload_FileBase> Upload_GetFile(this Client client, InputFileLocationBase location, int offset = default, int limit = int.MaxValue, bool precise = false, bool cdn_supported = false)
=> client.Invoke(new Upload_GetFile => client.Invoke(new Upload_GetFile
{ {
flags = (Upload_GetFile.Flags)((precise ? 0x1 : 0) | (cdn_supported ? 0x2 : 0)), flags = (Upload_GetFile.Flags)((precise ? 0x1 : 0) | (cdn_supported ? 0x2 : 0)),
@ -15713,7 +15713,7 @@ namespace TL
/// <param name="location">The file to download</param> /// <param name="location">The file to download</param>
/// <param name="offset">Number of bytes to be skipped</param> /// <param name="offset">Number of bytes to be skipped</param>
/// <param name="limit">Number of bytes to be returned</param> /// <param name="limit">Number of bytes to be returned</param>
public static Task<Upload_WebFile> Upload_GetWebFile(this Client client, InputWebFileLocationBase location, int offset, int limit) public static Task<Upload_WebFile> Upload_GetWebFile(this Client client, InputWebFileLocationBase location, int offset = default, int limit = int.MaxValue)
=> client.Invoke(new Upload_GetWebFile => client.Invoke(new Upload_GetWebFile
{ {
location = location, location = location,
@ -15725,7 +15725,7 @@ namespace TL
/// <param name="file_token">File token</param> /// <param name="file_token">File token</param>
/// <param name="offset">Offset of chunk to download</param> /// <param name="offset">Offset of chunk to download</param>
/// <param name="limit">Length of chunk to download</param> /// <param name="limit">Length of chunk to download</param>
public static Task<Upload_CdnFileBase> Upload_GetCdnFile(this Client client, byte[] file_token, int offset, int limit) public static Task<Upload_CdnFileBase> Upload_GetCdnFile(this Client client, byte[] file_token, int offset = default, int limit = int.MaxValue)
=> client.Invoke(new Upload_GetCdnFile => client.Invoke(new Upload_GetCdnFile
{ {
file_token = file_token, file_token = file_token,
@ -15746,7 +15746,7 @@ namespace TL
/// <summary>Get SHA256 hashes for verifying downloaded <a href="https://corefork.telegram.org/cdn">CDN</a> files <para>See <a href="https://corefork.telegram.org/method/upload.getCdnFileHashes"/> [bots: ✓]</para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/upload.getCdnFileHashes#possible-errors">details</a>)</para></summary> /// <summary>Get SHA256 hashes for verifying downloaded <a href="https://corefork.telegram.org/cdn">CDN</a> files <para>See <a href="https://corefork.telegram.org/method/upload.getCdnFileHashes"/> [bots: ✓]</para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/upload.getCdnFileHashes#possible-errors">details</a>)</para></summary>
/// <param name="file_token">File</param> /// <param name="file_token">File</param>
/// <param name="offset">Offset from which to start getting hashes</param> /// <param name="offset">Offset from which to start getting hashes</param>
public static Task<FileHash[]> Upload_GetCdnFileHashes(this Client client, byte[] file_token, int offset) public static Task<FileHash[]> Upload_GetCdnFileHashes(this Client client, byte[] file_token, int offset = default)
=> client.Invoke(new Upload_GetCdnFileHashes => client.Invoke(new Upload_GetCdnFileHashes
{ {
file_token = file_token, file_token = file_token,
@ -15756,7 +15756,7 @@ namespace TL
/// <summary>Get SHA256 hashes for verifying downloaded files <para>See <a href="https://corefork.telegram.org/method/upload.getFileHashes"/> [bots: ✓]</para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/upload.getFileHashes#possible-errors">details</a>)</para></summary> /// <summary>Get SHA256 hashes for verifying downloaded files <para>See <a href="https://corefork.telegram.org/method/upload.getFileHashes"/> [bots: ✓]</para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/upload.getFileHashes#possible-errors">details</a>)</para></summary>
/// <param name="location">File</param> /// <param name="location">File</param>
/// <param name="offset">Offset from which to get file hashes</param> /// <param name="offset">Offset from which to get file hashes</param>
public static Task<FileHash[]> Upload_GetFileHashes(this Client client, InputFileLocationBase location, int offset) public static Task<FileHash[]> Upload_GetFileHashes(this Client client, InputFileLocationBase location, int offset = default)
=> client.Invoke(new Upload_GetFileHashes => client.Invoke(new Upload_GetFileHashes
{ {
location = location, location = location,
@ -15868,7 +15868,7 @@ namespace TL
/// <summary>Get <a href="https://corefork.telegram.org/passport">passport</a> configuration <para>See <a href="https://corefork.telegram.org/method/help.getPassportConfig"/></para></summary> /// <summary>Get <a href="https://corefork.telegram.org/passport">passport</a> configuration <para>See <a href="https://corefork.telegram.org/method/help.getPassportConfig"/></para></summary>
/// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param> /// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param>
/// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/help.passportConfigNotModified">help.passportConfigNotModified</a></returns> /// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/help.passportConfigNotModified">help.passportConfigNotModified</a></returns>
public static Task<Help_PassportConfig> Help_GetPassportConfig(this Client client, int hash) public static Task<Help_PassportConfig> Help_GetPassportConfig(this Client client, int hash = default)
=> client.Invoke(new Help_GetPassportConfig => client.Invoke(new Help_GetPassportConfig
{ {
hash = hash, hash = hash,
@ -15930,7 +15930,7 @@ namespace TL
/// <param name="lang_code">Language code of the current user</param> /// <param name="lang_code">Language code of the current user</param>
/// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param> /// <param name="hash"><a href="https://corefork.telegram.org/api/offsets#hash-generation">Hash for pagination, for more info click here</a></param>
/// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/help.countriesListNotModified">help.countriesListNotModified</a></returns> /// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/help.countriesListNotModified">help.countriesListNotModified</a></returns>
public static Task<Help_CountriesList> Help_GetCountriesList(this Client client, string lang_code, int hash) public static Task<Help_CountriesList> Help_GetCountriesList(this Client client, string lang_code, int hash = default)
=> client.Invoke(new Help_GetCountriesList => client.Invoke(new Help_GetCountriesList
{ {
lang_code = lang_code, lang_code = lang_code,
@ -15940,7 +15940,7 @@ namespace TL
/// <summary>Mark <a href="https://corefork.telegram.org/api/channel">channel/supergroup</a> history as read <para>See <a href="https://corefork.telegram.org/method/channels.readHistory"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/channels.readHistory#possible-errors">details</a>)</para></summary> /// <summary>Mark <a href="https://corefork.telegram.org/api/channel">channel/supergroup</a> history as read <para>See <a href="https://corefork.telegram.org/method/channels.readHistory"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/channels.readHistory#possible-errors">details</a>)</para></summary>
/// <param name="channel"><a href="https://corefork.telegram.org/api/channel">Channel/supergroup</a></param> /// <param name="channel"><a href="https://corefork.telegram.org/api/channel">Channel/supergroup</a></param>
/// <param name="max_id">ID of message up to which messages should be marked as read</param> /// <param name="max_id">ID of message up to which messages should be marked as read</param>
public static Task<bool> Channels_ReadHistory(this Client client, InputChannelBase channel, int max_id) public static Task<bool> Channels_ReadHistory(this Client client, InputChannelBase channel, int max_id = default)
=> client.Invoke(new Channels_ReadHistory => client.Invoke(new Channels_ReadHistory
{ {
channel = channel, channel = channel,
@ -15985,7 +15985,7 @@ namespace TL
/// <param name="limit"><a href="https://corefork.telegram.org/api/offsets">Limit</a></param> /// <param name="limit"><a href="https://corefork.telegram.org/api/offsets">Limit</a></param>
/// <param name="hash"><a href="https://corefork.telegram.org/api/offsets">Hash</a></param> /// <param name="hash"><a href="https://corefork.telegram.org/api/offsets">Hash</a></param>
/// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/channels.channelParticipantsNotModified">channels.channelParticipantsNotModified</a></returns> /// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/channels.channelParticipantsNotModified">channels.channelParticipantsNotModified</a></returns>
public static Task<Channels_ChannelParticipants> Channels_GetParticipants(this Client client, InputChannelBase channel, ChannelParticipantsFilter filter, int offset, int limit, long hash) public static Task<Channels_ChannelParticipants> Channels_GetParticipants(this Client client, InputChannelBase channel, ChannelParticipantsFilter filter, int offset = default, int limit = int.MaxValue, long hash = default)
=> client.Invoke(new Channels_GetParticipants => client.Invoke(new Channels_GetParticipants
{ {
channel = channel, channel = channel,
@ -16179,7 +16179,7 @@ namespace TL
/// <param name="max_id">Maximum ID of message to return (see <a href="https://corefork.telegram.org/api/offsets">pagination</a>)</param> /// <param name="max_id">Maximum ID of message to return (see <a href="https://corefork.telegram.org/api/offsets">pagination</a>)</param>
/// <param name="min_id">Minimum ID of message to return (see <a href="https://corefork.telegram.org/api/offsets">pagination</a>)</param> /// <param name="min_id">Minimum ID of message to return (see <a href="https://corefork.telegram.org/api/offsets">pagination</a>)</param>
/// <param name="limit">Maximum number of results to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param> /// <param name="limit">Maximum number of results to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param>
public static Task<Channels_AdminLogResults> Channels_GetAdminLog(this Client client, InputChannelBase channel, string q, long max_id, long min_id, int limit, ChannelAdminLogEventsFilter events_filter = null, InputUserBase[] admins = null) public static Task<Channels_AdminLogResults> Channels_GetAdminLog(this Client client, InputChannelBase channel, string q, long max_id = default, long min_id = default, int limit = int.MaxValue, ChannelAdminLogEventsFilter events_filter = null, InputUserBase[] admins = null)
=> client.Invoke(new Channels_GetAdminLog => client.Invoke(new Channels_GetAdminLog
{ {
flags = (Channels_GetAdminLog.Flags)((events_filter != null ? 0x1 : 0) | (admins != null ? 0x2 : 0)), flags = (Channels_GetAdminLog.Flags)((events_filter != null ? 0x1 : 0) | (admins != null ? 0x2 : 0)),
@ -16215,7 +16215,7 @@ namespace TL
/// <summary>Delete the history of a <a href="https://corefork.telegram.org/api/channel">supergroup</a> <para>See <a href="https://corefork.telegram.org/method/channels.deleteHistory"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/channels.deleteHistory#possible-errors">details</a>)</para></summary> /// <summary>Delete the history of a <a href="https://corefork.telegram.org/api/channel">supergroup</a> <para>See <a href="https://corefork.telegram.org/method/channels.deleteHistory"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/channels.deleteHistory#possible-errors">details</a>)</para></summary>
/// <param name="channel"><a href="https://corefork.telegram.org/api/channel">Supergroup</a> whose history must be deleted</param> /// <param name="channel"><a href="https://corefork.telegram.org/api/channel">Supergroup</a> whose history must be deleted</param>
/// <param name="max_id">ID of message <strong>up to which</strong> the history must be deleted</param> /// <param name="max_id">ID of message <strong>up to which</strong> the history must be deleted</param>
public static Task<bool> Channels_DeleteHistory(this Client client, InputChannelBase channel, int max_id) public static Task<bool> Channels_DeleteHistory(this Client client, InputChannelBase channel, int max_id = default)
=> client.Invoke(new Channels_DeleteHistory => client.Invoke(new Channels_DeleteHistory
{ {
channel = channel, channel = channel,
@ -16234,7 +16234,7 @@ namespace TL
/// <summary>Get a list of <a href="https://corefork.telegram.org/api/channel">channels/supergroups</a> we left <para>See <a href="https://corefork.telegram.org/method/channels.getLeftChannels"/></para> <para>Possible <see cref="RpcException"/> codes: 403 (<a href="https://corefork.telegram.org/method/channels.getLeftChannels#possible-errors">details</a>)</para></summary> /// <summary>Get a list of <a href="https://corefork.telegram.org/api/channel">channels/supergroups</a> we left <para>See <a href="https://corefork.telegram.org/method/channels.getLeftChannels"/></para> <para>Possible <see cref="RpcException"/> codes: 403 (<a href="https://corefork.telegram.org/method/channels.getLeftChannels#possible-errors">details</a>)</para></summary>
/// <param name="offset">Offset for <a href="https://corefork.telegram.org/api/offsets">pagination</a></param> /// <param name="offset">Offset for <a href="https://corefork.telegram.org/api/offsets">pagination</a></param>
public static Task<Messages_Chats> Channels_GetLeftChannels(this Client client, int offset) public static Task<Messages_Chats> Channels_GetLeftChannels(this Client client, int offset = default)
=> client.Invoke(new Channels_GetLeftChannels => client.Invoke(new Channels_GetLeftChannels
{ {
offset = offset, offset = offset,
@ -16731,7 +16731,7 @@ namespace TL
/// <summary>Get info about a group call <para>See <a href="https://corefork.telegram.org/method/phone.getGroupCall"/></para></summary> /// <summary>Get info about a group call <para>See <a href="https://corefork.telegram.org/method/phone.getGroupCall"/></para></summary>
/// <param name="call">The group call</param> /// <param name="call">The group call</param>
/// <param name="limit">Maximum number of results to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param> /// <param name="limit">Maximum number of results to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param>
public static Task<Phone_GroupCall> Phone_GetGroupCall(this Client client, InputGroupCall call, int limit) public static Task<Phone_GroupCall> Phone_GetGroupCall(this Client client, InputGroupCall call, int limit = int.MaxValue)
=> client.Invoke(new Phone_GetGroupCall => client.Invoke(new Phone_GetGroupCall
{ {
call = call, call = call,
@ -16744,7 +16744,7 @@ namespace TL
/// <param name="sources">If specified, will fetch group participant info about the specified WebRTC source IDs</param> /// <param name="sources">If specified, will fetch group participant info about the specified WebRTC source IDs</param>
/// <param name="offset">Offset for results, taken from the <c>next_offset</c> field of <see cref="Phone_GroupParticipants"/>, initially an empty string. <br/>Note: if no more results are available, the method call will return an empty <c>next_offset</c>; thus, avoid providing the <c>next_offset</c> returned in <see cref="Phone_GroupParticipants"/> if it is empty, to avoid an infinite loop.</param> /// <param name="offset">Offset for results, taken from the <c>next_offset</c> field of <see cref="Phone_GroupParticipants"/>, initially an empty string. <br/>Note: if no more results are available, the method call will return an empty <c>next_offset</c>; thus, avoid providing the <c>next_offset</c> returned in <see cref="Phone_GroupParticipants"/> if it is empty, to avoid an infinite loop.</param>
/// <param name="limit">Maximum number of results to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param> /// <param name="limit">Maximum number of results to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param>
public static Task<Phone_GroupParticipants> Phone_GetGroupParticipants(this Client client, InputGroupCall call, InputPeer[] ids, int[] sources, string offset, int limit) public static Task<Phone_GroupParticipants> Phone_GetGroupParticipants(this Client client, InputGroupCall call, InputPeer[] ids, int[] sources, string offset, int limit = int.MaxValue)
=> client.Invoke(new Phone_GetGroupParticipants => client.Invoke(new Phone_GetGroupParticipants
{ {
call = call, call = call,
@ -16982,7 +16982,7 @@ namespace TL
/// <param name="offset_peer"><a href="https://corefork.telegram.org/api/offsets">Offsets for pagination, for more info click here</a></param> /// <param name="offset_peer"><a href="https://corefork.telegram.org/api/offsets">Offsets for pagination, for more info click here</a></param>
/// <param name="offset_id"><a href="https://corefork.telegram.org/api/offsets">Offsets for pagination, for more info click here</a></param> /// <param name="offset_id"><a href="https://corefork.telegram.org/api/offsets">Offsets for pagination, for more info click here</a></param>
/// <param name="limit">Maximum number of results to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param> /// <param name="limit">Maximum number of results to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param>
public static Task<Messages_MessagesBase> Stats_GetMessagePublicForwards(this Client client, InputChannelBase channel, int msg_id, int offset_rate, InputPeer offset_peer, int offset_id, int limit) public static Task<Messages_MessagesBase> Stats_GetMessagePublicForwards(this Client client, InputChannelBase channel, int msg_id, int offset_rate = default, InputPeer offset_peer = null, int offset_id = default, int limit = int.MaxValue)
=> client.Invoke(new Stats_GetMessagePublicForwards => client.Invoke(new Stats_GetMessagePublicForwards
{ {
channel = channel, channel = channel,