API Layer 170: access to saved dialogs/history/peer

(no idea what that means)
This commit is contained in:
Wizou 2023-12-31 18:29:36 +01:00
parent 2d7a64fc2d
commit a17f13475d
6 changed files with 283 additions and 26 deletions

2
.github/dev.yml vendored
View file

@ -1,7 +1,7 @@
pr: none
trigger: [ master ]
name: 3.6.2-dev.$(Rev:r)
name: 3.6.3-dev.$(Rev:r)
pool:
vmImage: ubuntu-latest

View file

@ -1,4 +1,4 @@
[![API Layer](https://img.shields.io/badge/API_Layer-169-blueviolet)](https://corefork.telegram.org/methods)
[![API Layer](https://img.shields.io/badge/API_Layer-170-blueviolet)](https://corefork.telegram.org/methods)
[![NuGet version](https://img.shields.io/nuget/v/WTelegramClient?color=00508F)](https://www.nuget.org/packages/WTelegramClient/)
[![NuGet prerelease](https://img.shields.io/nuget/vpre/WTelegramClient?color=C09030&label=dev+nuget)](https://www.nuget.org/packages/WTelegramClient/absoluteLatest)
[![Donate](https://img.shields.io/badge/Help_this_project:-Donate-ff4444)](https://www.buymeacoffee.com/wizou)

View file

@ -1632,7 +1632,7 @@ namespace TL
public override Peer Peer => peer_id;
}
/// <summary>A message <para>See <a href="https://corefork.telegram.org/constructor/message"/></para></summary>
[TLDef(0x38116EE0)]
[TLDef(0x76BEC211)]
public partial class Message : MessageBase
{
/// <summary>Extra bits of information, use <c>flags.HasFlag(...)</c> to test for those</summary>
@ -1643,6 +1643,7 @@ namespace TL
[IfFlag(8)] public Peer from_id;
/// <summary>Peer ID, the chat where this message was sent</summary>
public Peer peer_id;
[IfFlag(28)] public Peer saved_peer_id;
/// <summary>Info about forwarded messages</summary>
[IfFlag(2)] public MessageFwdHeader fwd_from;
/// <summary>ID of the inline bot that generated the message</summary>
@ -1732,6 +1733,8 @@ namespace TL
noforwards = 0x4000000,
/// <summary>If set, any eventual webpage preview will be shown on top of the message instead of at the bottom.</summary>
invert_media = 0x8000000,
/// <summary>Field <see cref="saved_peer_id"/> has a value</summary>
has_saved_peer_id = 0x10000000,
}
/// <summary>ID of the message</summary>
@ -1878,6 +1881,9 @@ namespace TL
spoiler = 0x10,
/// <summary>Field <see cref="alt_document"/> has a value</summary>
has_alt_document = 0x20,
video = 0x40,
round = 0x80,
voice = 0x100,
}
}
/// <summary>Preview of webpage <para>See <a href="https://corefork.telegram.org/constructor/messageMediaWebPage"/></para></summary>
@ -5024,6 +5030,30 @@ namespace TL
public override (long, int, int) GetMBox() => (-1, qts, 1);
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/updateSavedDialogPinned"/></para></summary>
[TLDef(0xAEAF9E74)]
public class UpdateSavedDialogPinned : Update
{
public Flags flags;
public DialogPeerBase peer;
[Flags] public enum Flags : uint
{
pinned = 0x1,
}
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/updatePinnedSavedDialogs"/></para></summary>
[TLDef(0x686C85A6)]
public class UpdatePinnedSavedDialogs : Update
{
public Flags flags;
[IfFlag(0)] public DialogPeerBase[] order;
[Flags] public enum Flags : uint
{
has_order = 0x1,
}
}
/// <summary>Updates state. <para>See <a href="https://corefork.telegram.org/constructor/updates.state"/></para></summary>
[TLDef(0xA56C2A3E)]
@ -8483,7 +8513,7 @@ namespace TL
}
/// <summary>Info about a forwarded message <para>See <a href="https://corefork.telegram.org/constructor/messageFwdHeader"/></para></summary>
[TLDef(0x5F777DCE)]
[TLDef(0x4E4DF4BB)]
public class MessageFwdHeader : IObject
{
/// <summary>Extra bits of information, use <c>flags.HasFlag(...)</c> to test for those</summary>
@ -8502,6 +8532,9 @@ namespace TL
[IfFlag(4)] public Peer saved_from_peer;
/// <summary>Only for messages forwarded to the current user (inputPeerSelf), ID of the message that was forwarded from the original user/channel</summary>
[IfFlag(4)] public int saved_from_msg_id;
[IfFlag(8)] public Peer saved_from_id;
[IfFlag(9)] public string saved_from_name;
[IfFlag(10)] public DateTime saved_date;
/// <summary>PSA type</summary>
[IfFlag(6)] public string psa_type;
@ -8521,6 +8554,13 @@ namespace TL
has_psa_type = 0x40,
/// <summary>Whether this message was <a href="https://corefork.telegram.org/api/import">imported from a foreign chat service, click here for more info »</a></summary>
imported = 0x80,
/// <summary>Field <see cref="saved_from_id"/> has a value</summary>
has_saved_from_id = 0x100,
/// <summary>Field <see cref="saved_from_name"/> has a value</summary>
has_saved_from_name = 0x200,
/// <summary>Field <see cref="saved_date"/> has a value</summary>
has_saved_date = 0x400,
saved_out = 0x800,
}
}
@ -12371,7 +12411,9 @@ namespace TL
public long file_size_max;
/// <summary>Maximum suggested bitrate for <strong>uploading</strong> videos</summary>
public int video_upload_maxbitrate;
/// <summary>A limit, specifying the maximum number of files that should be downloaded in parallel from the same DC, for files smaller than 20MB.</summary>
public int small_queue_active_operations_max;
/// <summary>A limit, specifying the maximum number of files that should be downloaded in parallel from the same DC, for files bigger than 20MB.</summary>
public int large_queue_active_operations_max;
[Flags] public enum Flags : uint
@ -15433,6 +15475,7 @@ namespace TL
inactive = 0x1,
/// <summary>The bot is asking permission to send messages to the user: if the user agrees, set the <c>write_allowed</c> flag when invoking <see cref="SchemaExtensions.Messages_RequestAppWebView">Messages_RequestAppWebView</see>.</summary>
request_write_access = 0x2,
/// <summary>Deprecated flag, can be ignored.</summary>
has_settings = 0x4,
}
}
@ -15987,7 +16030,7 @@ namespace TL
[IfFlag(0)] public int top_msg_id;
/// <summary>Used to reply to messages sent to another chat (specified here), can only be used for non-<c>protected</c> chats and messages.</summary>
[IfFlag(1)] public InputPeer reply_to_peer_id;
/// <summary>Used to quote-reply to only a certain section (specified here) of the original message.</summary>
/// <summary>Used to quote-reply to only a certain section (specified here) of the original message. The maximum UTF-8 length for quotes is specified in the <a href="https://corefork.telegram.org/api/config#quote-length-max">quote_length_max</a> config key.</summary>
[IfFlag(2)] public string quote_text;
/// <summary><a href="https://corefork.telegram.org/api/entities">Message entities for styled text</a> from the <c>quote_text</c> field.</summary>
[IfFlag(3)] public MessageEntity[] quote_entities;
@ -16703,4 +16746,55 @@ namespace TL
/// <summary>returns a <see cref="User"/> or <see cref="ChatBase"/> for the given Peer</summary>
public IPeerInfo UserOrChat(Peer peer) => peer?.UserOrChat(users, chats);
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/savedDialog"/></para></summary>
[TLDef(0xBD87CB6C)]
public class SavedDialog : IObject
{
public Flags flags;
public Peer peer;
public int top_message;
[Flags] public enum Flags : uint
{
pinned = 0x4,
}
}
/// <summary><para>See <a href="https://corefork.telegram.org/type/messages.SavedDialogs"/></para></summary>
public abstract class Messages_SavedDialogsBase : IObject
{
public virtual SavedDialog[] Dialogs { get; }
public virtual MessageBase[] Messages { get; }
public virtual Dictionary<long, ChatBase> Chats { get; }
public virtual Dictionary<long, User> Users { get; }
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/messages.savedDialogs"/></para></summary>
[TLDef(0xF83AE221)]
public class Messages_SavedDialogs : Messages_SavedDialogsBase, IPeerResolver
{
public SavedDialog[] dialogs;
public MessageBase[] messages;
public Dictionary<long, ChatBase> chats;
public Dictionary<long, User> users;
public override SavedDialog[] Dialogs => dialogs;
public override MessageBase[] Messages => messages;
public override Dictionary<long, ChatBase> Chats => chats;
public override Dictionary<long, User> Users => users;
/// <summary>returns a <see cref="User"/> or <see cref="ChatBase"/> for the given Peer</summary>
public IPeerInfo UserOrChat(Peer peer) => peer?.UserOrChat(users, chats);
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/messages.savedDialogsSlice"/></para></summary>
[TLDef(0x44BA9DD9)]
public class Messages_SavedDialogsSlice : Messages_SavedDialogs
{
public int count;
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/messages.savedDialogsNotModified"/></para></summary>
[TLDef(0xC01F6FE8)]
public class Messages_SavedDialogsNotModified : Messages_SavedDialogsBase
{
public int count;
}
}

View file

@ -378,7 +378,7 @@ namespace TL
{
});
/// <summary>Updates user profile. <para>See <a href="https://corefork.telegram.org/method/account.updateProfile"/></para> <para>Possible <see cref="RpcException"/> codes: 400,403 (<a href="https://corefork.telegram.org/method/account.updateProfile#possible-errors">details</a>)</para></summary>
/// <summary>Updates user profile. <para>See <a href="https://corefork.telegram.org/method/account.updateProfile"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/account.updateProfile#possible-errors">details</a>)</para></summary>
/// <param name="first_name">New user first name</param>
/// <param name="last_name">New user last name</param>
/// <param name="about">New bio</param>
@ -391,7 +391,7 @@ namespace TL
about = about,
});
/// <summary>Updates online user status. <para>See <a href="https://corefork.telegram.org/method/account.updateStatus"/></para> <para>Possible <see cref="RpcException"/> codes: 403 (<a href="https://corefork.telegram.org/method/account.updateStatus#possible-errors">details</a>)</para></summary>
/// <summary>Updates online user status. <para>See <a href="https://corefork.telegram.org/method/account.updateStatus"/></para></summary>
/// <param name="offline">If <see langword="true"/> is transmitted, user status will change to <see cref="UserStatusOffline"/>.</param>
public static Task<bool> Account_UpdateStatus(this Client client, bool offline)
=> client.Invoke(new Account_UpdateStatus
@ -1217,7 +1217,7 @@ namespace TL
errors = errors,
});
/// <summary>Get contact by telegram IDs <para>See <a href="https://corefork.telegram.org/method/contacts.getContactIDs"/></para></summary>
/// <summary>Get the telegram IDs of all contacts.<br/>Returns an array of Telegram user IDs for all contacts (0 if a contact does not have an associated Telegram account or have hidden their account using privacy settings). <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>
public static Task<int[]> Contacts_GetContactIDs(this Client client, long hash = default)
=> client.Invoke(new Contacts_GetContactIDs
@ -1225,7 +1225,7 @@ namespace TL
hash = hash,
});
/// <summary>Returns the list of contact statuses. <para>See <a href="https://corefork.telegram.org/method/contacts.getStatuses"/></para></summary>
/// <summary>Use this method to obtain the online statuses of all contacts with an accessible associated Telegram account. <para>See <a href="https://corefork.telegram.org/method/contacts.getStatuses"/></para></summary>
public static Task<ContactStatus[]> Contacts_GetStatuses(this Client client)
=> client.Invoke(new Contacts_GetStatuses
{
@ -1520,13 +1520,14 @@ namespace TL
/// <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="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 = null, 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)
public static Task<Messages_MessagesBase> Messages_Search(this Client client, InputPeer peer, string q, MessagesFilter filter = null, 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, InputPeer saved_peer_id = null)
=> 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) | (saved_peer_id != null ? 0x4 : 0)),
peer = peer,
q = q,
from_id = from_id,
saved_peer_id = saved_peer_id,
top_msg_id = top_msg_id.GetValueOrDefault(),
filter = filter,
min_date = min_date,
@ -2776,11 +2777,12 @@ namespace TL
/// <param name="peer">Peer where to search</param>
/// <param name="top_msg_id">If set, consider only messages within the specified <a href="https://corefork.telegram.org/api/forum#forum-topics">forum topic</a></param>
/// <param name="filters">Search filters</param>
public static Task<Messages_SearchCounter[]> Messages_GetSearchCounters(this Client client, InputPeer peer, MessagesFilter[] filters, int? top_msg_id = null)
public static Task<Messages_SearchCounter[]> Messages_GetSearchCounters(this Client client, InputPeer peer, MessagesFilter[] filters, int? top_msg_id = null, InputPeer saved_peer_id = null)
=> client.Invoke(new Messages_GetSearchCounters
{
flags = (Messages_GetSearchCounters.Flags)(top_msg_id != null ? 0x1 : 0),
flags = (Messages_GetSearchCounters.Flags)((top_msg_id != null ? 0x1 : 0) | (saved_peer_id != null ? 0x4 : 0)),
peer = peer,
saved_peer_id = saved_peer_id,
top_msg_id = top_msg_id.GetValueOrDefault(),
filters = filters,
});
@ -3195,10 +3197,12 @@ namespace TL
/// <param name="filter">Message filter, <see langword="null"/>, <see cref="InputMessagesFilterMyMentions"/> filters are not supported by this method.</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_date"><a href="https://corefork.telegram.org/api/offsets">Offsets for pagination, for more info click here</a></param>
public static Task<Messages_SearchResultsCalendar> Messages_GetSearchResultsCalendar(this Client client, InputPeer peer, MessagesFilter filter = null, int offset_id = default, DateTime offset_date = default)
public static Task<Messages_SearchResultsCalendar> Messages_GetSearchResultsCalendar(this Client client, InputPeer peer, MessagesFilter filter = null, int offset_id = default, DateTime offset_date = default, InputPeer saved_peer_id = null)
=> client.Invoke(new Messages_GetSearchResultsCalendar
{
flags = (Messages_GetSearchResultsCalendar.Flags)(saved_peer_id != null ? 0x4 : 0),
peer = peer,
saved_peer_id = saved_peer_id,
filter = filter,
offset_id = offset_id,
offset_date = offset_date,
@ -3209,10 +3213,12 @@ namespace TL
/// <param name="filter">Message filter, <see langword="null"/>, <see cref="InputMessagesFilterMyMentions"/> filters are not supported by this method.</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>
public static Task<Messages_SearchResultsPositions> Messages_GetSearchResultsPositions(this Client client, InputPeer peer, MessagesFilter filter = null, int offset_id = default, int limit = int.MaxValue)
public static Task<Messages_SearchResultsPositions> Messages_GetSearchResultsPositions(this Client client, InputPeer peer, MessagesFilter filter = null, int offset_id = default, int limit = int.MaxValue, InputPeer saved_peer_id = null)
=> client.Invoke(new Messages_GetSearchResultsPositions
{
flags = (Messages_GetSearchResultsPositions.Flags)(saved_peer_id != null ? 0x4 : 0),
peer = peer,
saved_peer_id = saved_peer_id,
filter = filter,
offset_id = offset_id,
limit = limit,
@ -3252,7 +3258,7 @@ namespace TL
enabled = enabled,
});
/// <summary>Change the default peer that should be used when sending messages to a specific group <para>See <a href="https://corefork.telegram.org/method/messages.saveDefaultSendAs"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/messages.saveDefaultSendAs#possible-errors">details</a>)</para></summary>
/// <summary>Change the default peer that should be used when sending messages, reactions, poll votes to a specific group <para>See <a href="https://corefork.telegram.org/method/messages.saveDefaultSendAs"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/messages.saveDefaultSendAs#possible-errors">details</a>)</para></summary>
/// <param name="peer">Group</param>
/// <param name="send_as">The default peer that should be used when sending messages to the group</param>
public static Task<bool> Messages_SaveDefaultSendAs(this Client client, InputPeer peer, InputPeer send_as)
@ -3419,7 +3425,7 @@ namespace TL
enabled = enabled,
});
/// <summary>Open a <a href="https://corefork.telegram.org/bots/webapps">bot mini app</a>, sending over user information after user confirmation. <para>See <a href="https://corefork.telegram.org/method/messages.requestWebView"/></para></summary>
/// <summary>Open a <a href="https://corefork.telegram.org/bots/webapps">bot mini app</a>, sending over user information after user confirmation. <para>See <a href="https://corefork.telegram.org/method/messages.requestWebView"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/messages.requestWebView#possible-errors">details</a>)</para></summary>
/// <param name="from_bot_menu">Whether the webview was opened by clicking on the bot's <a href="https://corefork.telegram.org/api/bots/menu">menu button »</a>.</param>
/// <param name="silent">Whether the inline message that will be sent by the bot on behalf of the user once the web app interaction is <see cref="Messages_SendWebViewResultMessage">Messages_SendWebViewResultMessage</see> should be sent silently (no notifications for the receivers).</param>
/// <param name="peer">Dialog where the web app is being opened, and where the resulting message will be sent (see the <a href="https://corefork.telegram.org/api/bots/webapps">docs for more info »</a>).</param>
@ -3737,6 +3743,65 @@ namespace TL
hash = hash,
});
/// <summary><para>See <a href="https://corefork.telegram.org/method/messages.getSavedDialogs"/></para></summary>
public static Task<Messages_SavedDialogsBase> Messages_GetSavedDialogs(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)
=> client.Invoke(new Messages_GetSavedDialogs
{
flags = (Messages_GetSavedDialogs.Flags)(exclude_pinned ? 0x1 : 0),
offset_date = offset_date,
offset_id = offset_id,
offset_peer = offset_peer,
limit = limit,
hash = hash,
});
/// <summary><para>See <a href="https://corefork.telegram.org/method/messages.getSavedHistory"/></para></summary>
public static Task<Messages_MessagesBase> Messages_GetSavedHistory(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_GetSavedHistory
{
peer = peer,
offset_id = offset_id,
offset_date = offset_date,
add_offset = add_offset,
limit = limit,
max_id = max_id,
min_id = min_id,
hash = hash,
});
/// <summary><para>See <a href="https://corefork.telegram.org/method/messages.deleteSavedHistory"/></para></summary>
public static Task<Messages_AffectedHistory> Messages_DeleteSavedHistory(this Client client, InputPeer peer, int max_id = default, DateTime? min_date = null, DateTime? max_date = null)
=> client.Invoke(new Messages_DeleteSavedHistory
{
flags = (Messages_DeleteSavedHistory.Flags)((min_date != null ? 0x4 : 0) | (max_date != null ? 0x8 : 0)),
peer = peer,
max_id = max_id,
min_date = min_date.GetValueOrDefault(),
max_date = max_date.GetValueOrDefault(),
});
/// <summary><para>See <a href="https://corefork.telegram.org/method/messages.getPinnedSavedDialogs"/></para></summary>
public static Task<Messages_SavedDialogsBase> Messages_GetPinnedSavedDialogs(this Client client)
=> client.Invoke(new Messages_GetPinnedSavedDialogs
{
});
/// <summary><para>See <a href="https://corefork.telegram.org/method/messages.toggleSavedDialogPin"/></para></summary>
public static Task<bool> Messages_ToggleSavedDialogPin(this Client client, InputDialogPeerBase peer, bool pinned = false)
=> client.Invoke(new Messages_ToggleSavedDialogPin
{
flags = (Messages_ToggleSavedDialogPin.Flags)(pinned ? 0x1 : 0),
peer = peer,
});
/// <summary><para>See <a href="https://corefork.telegram.org/method/messages.reorderPinnedSavedDialogs"/></para></summary>
public static Task<bool> Messages_ReorderPinnedSavedDialogs(this Client client, InputDialogPeerBase[] order, bool force = false)
=> client.Invoke(new Messages_ReorderPinnedSavedDialogs
{
flags = (Messages_ReorderPinnedSavedDialogs.Flags)(force ? 0x1 : 0),
order = order,
});
/// <summary>Returns a current state of updates. <para>See <a href="https://corefork.telegram.org/method/updates.getState"/> [bots: ✓]</para></summary>
public static Task<Updates_State> Updates_GetState(this Client client)
=> client.Invoke(new Updates_GetState
@ -3745,9 +3810,11 @@ namespace TL
/// <summary>Get new <a href="https://corefork.telegram.org/api/updates">updates</a>. <para>See <a href="https://corefork.telegram.org/method/updates.getDifference"/> [bots: ✓]</para> <para>Possible <see cref="RpcException"/> codes: 400,403,500 (<a href="https://corefork.telegram.org/method/updates.getDifference#possible-errors">details</a>)</para></summary>
/// <param name="pts">PTS, see <a href="https://corefork.telegram.org/api/updates">updates</a>.</param>
/// <param name="pts_limit">PTS limit</param>
/// <param name="pts_total_limit">For fast updating: if provided and <c>pts + pts_total_limit &lt; remote pts</c>, <see cref="Updates_DifferenceTooLong"/> will be returned.<br/>Simply tells the server to not return the difference if it is bigger than <c>pts_total_limit</c><br/>If the remote pts is too big (&gt; ~4000000), this field will default to 1000000</param>
/// <param name="date">date, see <a href="https://corefork.telegram.org/api/updates">updates</a>.</param>
/// <param name="qts">QTS, see <a href="https://corefork.telegram.org/api/updates">updates</a>.</param>
/// <param name="qts_limit">QTS limit</param>
public static Task<Updates_DifferenceBase> Updates_GetDifference(this Client client, int pts, DateTime date, int qts, int? pts_total_limit = null, int? pts_limit = null, int? qts_limit = null)
=> client.Invoke(new Updates_GetDifference
{
@ -4295,7 +4362,7 @@ namespace TL
username = username,
});
/// <summary>Join a channel/supergroup <para>See <a href="https://corefork.telegram.org/method/channels.joinChannel"/></para> <para>Possible <see cref="RpcException"/> codes: 400,406,500 (<a href="https://corefork.telegram.org/method/channels.joinChannel#possible-errors">details</a>)</para></summary>
/// <summary>Join a channel/supergroup <para>See <a href="https://corefork.telegram.org/method/channels.joinChannel"/></para> <para>Possible <see cref="RpcException"/> codes: 400,406 (<a href="https://corefork.telegram.org/method/channels.joinChannel#possible-errors">details</a>)</para></summary>
/// <param name="channel">Channel/supergroup to join</param>
public static Task<UpdatesBase> Channels_JoinChannel(this Client client, InputChannelBase channel)
=> client.Invoke(new Channels_JoinChannel
@ -7339,13 +7406,14 @@ namespace TL.Methods
public long hash;
}
[TLDef(0xA0FDA762)]
[TLDef(0xA7B4E929)]
public class Messages_Search : IMethod<Messages_MessagesBase>
{
public Flags flags;
public InputPeer peer;
public string q;
[IfFlag(0)] public InputPeer from_id;
[IfFlag(2)] public InputPeer saved_peer_id;
[IfFlag(1)] public int top_msg_id;
public MessagesFilter filter;
public DateTime min_date;
@ -7361,6 +7429,7 @@ namespace TL.Methods
{
has_from_id = 0x1,
has_top_msg_id = 0x2,
has_saved_peer_id = 0x4,
}
}
@ -8433,17 +8502,19 @@ namespace TL.Methods
public string lang_code;
}
[TLDef(0x00AE7CC1)]
[TLDef(0x1BBCF300)]
public class Messages_GetSearchCounters : IMethod<Messages_SearchCounter[]>
{
public Flags flags;
public InputPeer peer;
[IfFlag(2)] public InputPeer saved_peer_id;
[IfFlag(0)] public int top_msg_id;
public MessagesFilter[] filters;
[Flags] public enum Flags : uint
{
has_top_msg_id = 0x1,
has_saved_peer_id = 0x4,
}
}
@ -8778,22 +8849,36 @@ namespace TL.Methods
public int msg_id;
}
[TLDef(0x49F0BDE9)]
[TLDef(0x6AA3F6BD)]
public class Messages_GetSearchResultsCalendar : IMethod<Messages_SearchResultsCalendar>
{
public Flags flags;
public InputPeer peer;
[IfFlag(2)] public InputPeer saved_peer_id;
public MessagesFilter filter;
public int offset_id;
public DateTime offset_date;
[Flags] public enum Flags : uint
{
has_saved_peer_id = 0x4,
}
}
[TLDef(0x6E9583A3)]
[TLDef(0x9C7F2F10)]
public class Messages_GetSearchResultsPositions : IMethod<Messages_SearchResultsPositions>
{
public Flags flags;
public InputPeer peer;
[IfFlag(2)] public InputPeer saved_peer_id;
public MessagesFilter filter;
public int offset_id;
public int limit;
[Flags] public enum Flags : uint
{
has_saved_peer_id = 0x4,
}
}
[TLDef(0x7FE7E815)]
@ -9233,6 +9318,78 @@ namespace TL.Methods
}
}
[TLDef(0x5381D21A)]
public class Messages_GetSavedDialogs : IMethod<Messages_SavedDialogsBase>
{
public Flags flags;
public DateTime offset_date;
public int offset_id;
public InputPeer offset_peer;
public int limit;
public long hash;
[Flags] public enum Flags : uint
{
exclude_pinned = 0x1,
}
}
[TLDef(0x3D9A414D)]
public class Messages_GetSavedHistory : IMethod<Messages_MessagesBase>
{
public InputPeer peer;
public int offset_id;
public DateTime offset_date;
public int add_offset;
public int limit;
public int max_id;
public int min_id;
public long hash;
}
[TLDef(0x6E98102B)]
public class Messages_DeleteSavedHistory : IMethod<Messages_AffectedHistory>
{
public Flags flags;
public InputPeer peer;
public int max_id;
[IfFlag(2)] public DateTime min_date;
[IfFlag(3)] public DateTime max_date;
[Flags] public enum Flags : uint
{
has_min_date = 0x4,
has_max_date = 0x8,
}
}
[TLDef(0xD63D94E0)]
public class Messages_GetPinnedSavedDialogs : IMethod<Messages_SavedDialogsBase> { }
[TLDef(0xAC81BBDE)]
public class Messages_ToggleSavedDialogPin : IMethod<bool>
{
public Flags flags;
public InputDialogPeerBase peer;
[Flags] public enum Flags : uint
{
pinned = 0x1,
}
}
[TLDef(0x8B716587)]
public class Messages_ReorderPinnedSavedDialogs : IMethod<bool>
{
public Flags flags;
public InputDialogPeerBase[] order;
[Flags] public enum Flags : uint
{
force = 0x1,
}
}
[TLDef(0xEDD4882A)]
public class Updates_GetState : IMethod<Updates_State> { }

View file

@ -6,7 +6,7 @@ namespace TL
{
public static class Layer
{
public const int Version = 169; // fetched 23/12/2023 19:20:07
public const int Version = 170; // fetched 31/12/2023 17:22:50
internal const int SecretChats = 144;
internal const int MTProto2 = 73;
internal const uint VectorCtor = 0x1CB5C415;
@ -145,7 +145,7 @@ namespace TL
[0x37C1011C] = null,//ChatPhotoEmpty
[0x1C6E1C11] = typeof(ChatPhoto),
[0x90A6CA84] = typeof(MessageEmpty),
[0x38116EE0] = typeof(Message),
[0x76BEC211] = typeof(Message),
[0x2B085862] = typeof(MessageService),
[0x3DED6320] = null,//MessageMediaEmpty
[0x695150D7] = typeof(MessageMediaPhoto),
@ -390,6 +390,8 @@ namespace TL
[0xAE3F101D] = typeof(UpdatePeerWallpaper),
[0xAC21D3CE] = typeof(UpdateBotMessageReaction),
[0x09CB7759] = typeof(UpdateBotMessageReactions),
[0xAEAF9E74] = typeof(UpdateSavedDialogPinned),
[0x686C85A6] = typeof(UpdatePinnedSavedDialogs),
[0xA56C2A3E] = typeof(Updates_State),
[0x5D75A138] = typeof(Updates_DifferenceEmpty),
[0x00F49CA0] = typeof(Updates_Difference),
@ -621,7 +623,7 @@ namespace TL
[0x17DB940B] = typeof(BotInlineMediaResult),
[0xE021F2F6] = typeof(Messages_BotResults),
[0x5DAB1AF4] = typeof(ExportedMessageLink),
[0x5F777DCE] = typeof(MessageFwdHeader),
[0x4E4DF4BB] = typeof(MessageFwdHeader),
[0x3DBB5986] = typeof(Auth_SentCodeTypeApp),
[0xC000BBA2] = typeof(Auth_SentCodeTypeSms),
[0x5353E5A7] = typeof(Auth_SentCodeTypeCall),
@ -1178,6 +1180,10 @@ namespace TL
[0xBBAB2643] = typeof(StoryReactionPublicForward),
[0xCFCD0F13] = typeof(StoryReactionPublicRepost),
[0xAA5F789C] = typeof(Stories_StoryReactionsList),
[0xBD87CB6C] = typeof(SavedDialog),
[0xF83AE221] = typeof(Messages_SavedDialogs),
[0x44BA9DD9] = typeof(Messages_SavedDialogsSlice),
[0xC01F6FE8] = typeof(Messages_SavedDialogsNotModified),
// from TL.Secret:
[0x6ABD9782] = typeof(Layer143.DecryptedMessageMediaDocument),
[0x91CC4674] = typeof(Layer73.DecryptedMessage),

View file

@ -13,7 +13,7 @@
<PackageId>WTelegramClient</PackageId>
<Version>0.0.0</Version>
<Authors>Wizou</Authors>
<Description>Telegram Client API (MTProto) library written 100% in C# and .NET Standard | Latest API layer: 169&#10;&#10;Release Notes:&#10;$(ReleaseNotes.Replace("|", "%0D%0A").Replace(" - ","%0D%0A- ").Replace(" ", "%0D%0A%0D%0A"))</Description>
<Description>Telegram Client API (MTProto) library written 100% in C# and .NET Standard | Latest API layer: 170&#10;&#10;Release Notes:&#10;$(ReleaseNotes.Replace("|", "%0D%0A").Replace(" - ","%0D%0A- ").Replace(" ", "%0D%0A%0D%0A"))</Description>
<Copyright>Copyright © Olivier Marcoux 2021-2023</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/wiz0u/WTelegramClient</PackageProjectUrl>