Update to Telegram API layer 223

- New types (e.g., MessageActionNoForwardsToggle, UpdateChatParticipantRank, MessageEntityFormattedDate)
- New methods (e.g., Messages_EditChatCreator, Messages_EditChatParticipantRank).
- Enhanced URL auth and admin methods with new parameters and flags.
- Refactored keyboard button and MediaArea types for improved inheritance.
This commit is contained in:
Wizou 2026-03-03 12:45:45 +01:00
parent 59425a910a
commit f8b0fd48b1
5 changed files with 276 additions and 302 deletions

View file

@ -1,4 +1,4 @@
[![API Layer](https://img.shields.io/badge/API_Layer-222-blueviolet)](https://corefork.telegram.org/methods)
[![API Layer](https://img.shields.io/badge/API_Layer-223-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://buymeacoffee.com/wizou)

File diff suppressed because one or more lines are too long

View file

@ -3291,14 +3291,15 @@ namespace TL
/// <param name="button_id">The ID of the button with the authorization request</param>
/// <param name="url">URL used for <a href="https://corefork.telegram.org/api/url-authorization#link-url-authorization">link URL authorization, click here for more info »</a></param>
/// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/urlAuthResultDefault">urlAuthResultDefault</a></returns>
public static Task<UrlAuthResult> Messages_RequestUrlAuth(this Client client, InputPeer peer = null, int? msg_id = null, int? button_id = null, string url = null)
public static Task<UrlAuthResult> Messages_RequestUrlAuth(this Client client, InputPeer peer = null, int? msg_id = null, int? button_id = null, string url = null, string in_app_origin = null)
=> client.Invoke(new Messages_RequestUrlAuth
{
flags = (Messages_RequestUrlAuth.Flags)((peer != null ? 0x2 : 0) | (msg_id != null ? 0x2 : 0) | (button_id != null ? 0x2 : 0) | (url != null ? 0x4 : 0)),
flags = (Messages_RequestUrlAuth.Flags)((peer != null ? 0x2 : 0) | (msg_id != null ? 0x2 : 0) | (button_id != null ? 0x2 : 0) | (url != null ? 0x4 : 0) | (in_app_origin != null ? 0x8 : 0)),
peer = peer,
msg_id = msg_id ?? default,
button_id = button_id ?? default,
url = url,
in_app_origin = in_app_origin,
});
/// <summary>Use this to accept a Seamless Telegram Login authorization request, for more info <a href="https://corefork.telegram.org/api/url-authorization">click here »</a> <para>See <a href="https://corefork.telegram.org/method/messages.acceptUrlAuth"/></para></summary>
@ -3308,14 +3309,15 @@ namespace TL
/// <param name="button_id">ID of the login button</param>
/// <param name="url">URL used for <a href="https://corefork.telegram.org/api/url-authorization#link-url-authorization">link URL authorization, click here for more info »</a></param>
/// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/urlAuthResultDefault">urlAuthResultDefault</a></returns>
public static Task<UrlAuthResult> Messages_AcceptUrlAuth(this Client client, InputPeer peer = null, int? msg_id = null, int? button_id = null, string url = null, bool write_allowed = false, bool share_phone_number = false)
public static Task<UrlAuthResult> Messages_AcceptUrlAuth(this Client client, InputPeer peer = null, int? msg_id = null, int? button_id = null, string url = null, string match_code = null, bool write_allowed = false, bool share_phone_number = false)
=> client.Invoke(new Messages_AcceptUrlAuth
{
flags = (Messages_AcceptUrlAuth.Flags)((peer != null ? 0x2 : 0) | (msg_id != null ? 0x2 : 0) | (button_id != null ? 0x2 : 0) | (url != null ? 0x4 : 0) | (write_allowed ? 0x1 : 0) | (share_phone_number ? 0x8 : 0)),
flags = (Messages_AcceptUrlAuth.Flags)((peer != null ? 0x2 : 0) | (msg_id != null ? 0x2 : 0) | (button_id != null ? 0x2 : 0) | (url != null ? 0x4 : 0) | (match_code != null ? 0x10 : 0) | (write_allowed ? 0x1 : 0) | (share_phone_number ? 0x8 : 0)),
peer = peer,
msg_id = msg_id ?? default,
button_id = button_id ?? default,
url = url,
match_code = match_code,
});
/// <summary>Should be called after the user hides the <a href="https://corefork.telegram.org/api/action-bar">report spam/add as contact bar</a> of a new chat, effectively prevents the user from executing the actions specified in the <a href="https://corefork.telegram.org/api/action-bar">action bar »</a>. <para>See <a href="https://corefork.telegram.org/method/messages.hidePeerSettingsBar"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/messages.hidePeerSettingsBar#possible-errors">details</a>)</para></summary>
@ -3754,11 +3756,13 @@ namespace TL
/// <summary>Enable or disable <a href="https://telegram.org/blog/protected-content-delete-by-date-and-more">content protection</a> on a channel or chat <para>See <a href="https://corefork.telegram.org/method/messages.toggleNoForwards"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/messages.toggleNoForwards#possible-errors">details</a>)</para></summary>
/// <param name="peer">The chat or channel</param>
/// <param name="enabled">Enable or disable content protection</param>
public static Task<UpdatesBase> Messages_ToggleNoForwards(this Client client, InputPeer peer, bool enabled)
public static Task<UpdatesBase> Messages_ToggleNoForwards(this Client client, InputPeer peer, bool enabled, int? request_msg_id = null)
=> client.Invoke(new Messages_ToggleNoForwards
{
flags = (Messages_ToggleNoForwards.Flags)(request_msg_id != null ? 0x1 : 0),
peer = peer,
enabled = enabled,
request_msg_id = request_msg_id ?? default,
});
/// <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>
@ -4873,6 +4877,46 @@ namespace TL
to_lang = to_lang,
});
/// <summary><para>See <a href="https://corefork.telegram.org/method/messages.editChatCreator"/> [bots: ✓]</para></summary>
public static Task<UpdatesBase> Messages_EditChatCreator(this Client client, InputPeer peer, InputUserBase user_id, InputCheckPasswordSRP password)
=> client.Invoke(new Messages_EditChatCreator
{
peer = peer,
user_id = user_id,
password = password,
});
/// <summary><para>See <a href="https://corefork.telegram.org/method/messages.getFutureChatCreatorAfterLeave"/> [bots: ✓]</para></summary>
public static Task<UserBase> Messages_GetFutureChatCreatorAfterLeave(this Client client, InputPeer peer)
=> client.Invoke(new Messages_GetFutureChatCreatorAfterLeave
{
peer = peer,
});
/// <summary><para>See <a href="https://corefork.telegram.org/method/messages.editChatParticipantRank"/> [bots: ✓]</para></summary>
public static Task<UpdatesBase> Messages_EditChatParticipantRank(this Client client, InputPeer peer, InputPeer participant, string rank)
=> client.Invoke(new Messages_EditChatParticipantRank
{
peer = peer,
participant = participant,
rank = rank,
});
/// <summary><para>See <a href="https://corefork.telegram.org/method/messages.declineUrlAuth"/> [bots: ✓]</para></summary>
public static Task<bool> Messages_DeclineUrlAuth(this Client client, string url)
=> client.Invoke(new Messages_DeclineUrlAuth
{
url = url,
});
/// <summary><para>See <a href="https://corefork.telegram.org/method/messages.checkUrlAuthMatchCode"/> [bots: ✓]</para></summary>
public static Task<bool> Messages_CheckUrlAuthMatchCode(this Client client, string url, string match_code)
=> client.Invoke(new Messages_CheckUrlAuthMatchCode
{
url = url,
match_code = match_code,
});
/// <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
@ -5393,9 +5437,10 @@ namespace TL
/// <param name="user_id">The ID of the user whose admin rights should be modified</param>
/// <param name="admin_rights">The admin rights</param>
/// <param name="rank">Indicates the role (rank) of the admin in the group: just an arbitrary string</param>
public static Task<UpdatesBase> Channels_EditAdmin(this Client client, InputChannelBase channel, InputUserBase user_id, ChatAdminRights admin_rights, string rank)
public static Task<UpdatesBase> Channels_EditAdmin(this Client client, InputChannelBase channel, InputUserBase user_id, ChatAdminRights admin_rights, string rank = null)
=> client.Invoke(new Channels_EditAdmin
{
flags = (Channels_EditAdmin.Flags)(rank != null ? 0x1 : 0),
channel = channel,
user_id = user_id,
admin_rights = admin_rights,
@ -5609,18 +5654,6 @@ namespace TL
group = group,
});
/// <summary>Transfer channel ownership <para>See <a href="https://corefork.telegram.org/method/channels.editCreator"/></para> <para>Possible <see cref="RpcException"/> codes: 400,403 (<a href="https://corefork.telegram.org/method/channels.editCreator#possible-errors">details</a>)</para></summary>
/// <param name="channel">Channel</param>
/// <param name="user_id">New channel owner</param>
/// <param name="password"><a href="https://corefork.telegram.org/api/srp">2FA password</a> of account</param>
public static Task<UpdatesBase> Channels_EditCreator(this Client client, InputChannelBase channel, InputUserBase user_id, InputCheckPasswordSRP password)
=> client.Invoke(new Channels_EditCreator
{
channel = channel,
user_id = user_id,
password = password,
});
/// <summary>Edit location of geogroup, see <a href="https://corefork.telegram.org/api/nearby">here »</a> for more info on geogroups. <para>See <a href="https://corefork.telegram.org/method/channels.editLocation"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/channels.editLocation#possible-errors">details</a>)</para></summary>
/// <param name="channel"><a href="https://corefork.telegram.org/api/channel">Geogroup</a></param>
/// <param name="geo_point">New geolocation</param>
@ -5914,13 +5947,6 @@ namespace TL
tab = tab,
});
/// <summary><para>See <a href="https://corefork.telegram.org/method/channels.getFutureCreatorAfterLeave"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/channels.getFutureCreatorAfterLeave#possible-errors">details</a>)</para></summary>
public static Task<UserBase> Channels_GetFutureCreatorAfterLeave(this Client client, InputChannelBase channel)
=> client.Invoke(new Channels_GetFutureCreatorAfterLeave
{
channel = channel,
});
/// <summary>Sends a custom request; for bots only <para>See <a href="https://corefork.telegram.org/method/bots.sendCustomRequest"/> [bots: ✓ users: ✗]</para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/bots.sendCustomRequest#possible-errors">details</a>)</para></summary>
/// <param name="custom_method">The method name</param>
/// <param name="params_">JSON-serialized method parameters</param>
@ -11058,7 +11084,7 @@ namespace TL.Methods
}
}
[TLDef(0x198FB446)]
[TLDef(0x894CC99C)]
public sealed partial class Messages_RequestUrlAuth : IMethod<UrlAuthResult>
{
public Flags flags;
@ -11066,15 +11092,17 @@ namespace TL.Methods
[IfFlag(1)] public int msg_id;
[IfFlag(1)] public int button_id;
[IfFlag(2)] public string url;
[IfFlag(3)] public string in_app_origin;
[Flags] public enum Flags : uint
{
has_peer = 0x2,
has_url = 0x4,
has_in_app_origin = 0x8,
}
}
[TLDef(0xB12C7125)]
[TLDef(0x67A3F0DE)]
public sealed partial class Messages_AcceptUrlAuth : IMethod<UrlAuthResult>
{
public Flags flags;
@ -11082,6 +11110,7 @@ namespace TL.Methods
[IfFlag(1)] public int msg_id;
[IfFlag(1)] public int button_id;
[IfFlag(2)] public string url;
[IfFlag(4)] public string match_code;
[Flags] public enum Flags : uint
{
@ -11089,6 +11118,7 @@ namespace TL.Methods
has_peer = 0x2,
has_url = 0x4,
share_phone_number = 0x8,
has_match_code = 0x10,
}
}
@ -11452,11 +11482,18 @@ namespace TL.Methods
}
}
[TLDef(0xB11EAFA2)]
[TLDef(0xB2081A35)]
public sealed partial class Messages_ToggleNoForwards : IMethod<UpdatesBase>
{
public Flags flags;
public InputPeer peer;
public bool enabled;
[IfFlag(0)] public int request_msg_id;
[Flags] public enum Flags : uint
{
has_request_msg_id = 0x1,
}
}
[TLDef(0xCCFDDF96)]
@ -12411,6 +12448,41 @@ namespace TL.Methods
}
}
[TLDef(0xF743B857)]
public sealed partial class Messages_EditChatCreator : IMethod<UpdatesBase>
{
public InputPeer peer;
public InputUserBase user_id;
public InputCheckPasswordSRP password;
}
[TLDef(0x3B7D0EA6)]
public sealed partial class Messages_GetFutureChatCreatorAfterLeave : IMethod<UserBase>
{
public InputPeer peer;
}
[TLDef(0xA00F32B0)]
public sealed partial class Messages_EditChatParticipantRank : IMethod<UpdatesBase>
{
public InputPeer peer;
public InputPeer participant;
public string rank;
}
[TLDef(0x35436BBC)]
public sealed partial class Messages_DeclineUrlAuth : IMethod<bool>
{
public string url;
}
[TLDef(0xC9A47B0B)]
public sealed partial class Messages_CheckUrlAuthMatchCode : IMethod<bool>
{
public string url;
public string match_code;
}
[TLDef(0xEDD4882A)]
public sealed partial class Updates_GetState : IMethod<Updates_State> { }
@ -12795,13 +12867,19 @@ namespace TL.Methods
}
}
[TLDef(0xD33C8902)]
[TLDef(0x9A98AD68)]
public sealed partial class Channels_EditAdmin : IMethod<UpdatesBase>
{
public Flags flags;
public InputChannelBase channel;
public InputUserBase user_id;
public ChatAdminRights admin_rights;
public string rank;
[IfFlag(0)] public string rank;
[Flags] public enum Flags : uint
{
has_rank = 0x1,
}
}
[TLDef(0x566DECD0)]
@ -12974,14 +13052,6 @@ namespace TL.Methods
public InputChannelBase group;
}
[TLDef(0x8F38CD1F)]
public sealed partial class Channels_EditCreator : IMethod<UpdatesBase>
{
public InputChannelBase channel;
public InputUserBase user_id;
public InputCheckPasswordSRP password;
}
[TLDef(0x58E63F6D)]
public sealed partial class Channels_EditLocation : IMethod<bool>
{
@ -13219,12 +13289,6 @@ namespace TL.Methods
public ProfileTab tab;
}
[TLDef(0xA00918AF)]
public sealed partial class Channels_GetFutureCreatorAfterLeave : IMethod<UserBase>
{
public InputChannelBase channel;
}
[TLDef(0xAA2769ED)]
public sealed partial class Bots_SendCustomRequest : IMethod<DataJSON>
{

View file

@ -6,7 +6,7 @@ namespace TL
{
public static partial class Layer
{
public const int Version = 222; // fetched 02/06/2026 19:18:24
public const int Version = 223; // fetched 03/02/2026 11:38:17
internal const int SecretChats = 144;
internal const int MTProto2 = 73;
internal const uint VectorCtor = 0x1CB5C415;
@ -145,15 +145,15 @@ namespace TL
[0x17D493D5] = typeof(ChannelForbidden),
[0x2633421B] = typeof(ChatFull),
[0xE4E0B29D] = typeof(ChannelFull),
[0xC02D4007] = typeof(ChatParticipant),
[0xE46BCEE4] = typeof(ChatParticipantCreator),
[0xA0933F5B] = typeof(ChatParticipantAdmin),
[0x38E79FDE] = typeof(ChatParticipant),
[0xE1F867B8] = typeof(ChatParticipantCreator),
[0x0360D5D2] = typeof(ChatParticipantAdmin),
[0x8763D3E1] = typeof(ChatParticipantsForbidden),
[0x3CBC93F8] = typeof(ChatParticipants),
[0x37C1011C] = null,//ChatPhotoEmpty
[0x1C6E1C11] = typeof(ChatPhoto),
[0x90A6CA84] = typeof(MessageEmpty),
[0x9CB490E9] = typeof(Message),
[0x3AE56482] = typeof(Message),
[0x7A800E0A] = typeof(MessageService),
[0x3DED6320] = null,//MessageMediaEmpty
[0x695150D7] = typeof(MessageMediaPhoto),
@ -236,6 +236,8 @@ namespace TL
[0x73ADA76B] = typeof(MessageActionStarGiftPurchaseOfferDeclined),
[0xB07ED085] = typeof(MessageActionNewCreatorPending),
[0xE188503B] = typeof(MessageActionChangeCreator),
[0xBF7D6572] = typeof(MessageActionNoForwardsToggle),
[0x3E2793BA] = typeof(MessageActionNoForwardsRequest),
[0xD58A08C6] = typeof(Dialog),
[0x71BD134C] = typeof(DialogFolder),
[0x2331B22D] = typeof(PhotoEmpty),
@ -453,6 +455,7 @@ namespace TL
[0xDC58F31E] = typeof(UpdateStarGiftAuctionUserState),
[0xFB9C547A] = typeof(UpdateEmojiGameInfo),
[0xAC072444] = typeof(UpdateStarGiftCraftFail),
[0xBD8367B9] = typeof(UpdateChatParticipantRank),
[0xA56C2A3E] = typeof(Updates_State),
[0x5D75A138] = typeof(Updates_DifferenceEmpty),
[0x00F49CA0] = typeof(Updates_Difference),
@ -641,6 +644,7 @@ namespace TL
[0x32CA960F] = typeof(MessageEntitySpoiler),
[0xC8CF05F8] = typeof(MessageEntityCustomEmoji),
[0xF1CCAAAC] = typeof(MessageEntityBlockquote),
[0x904AC7C7] = typeof(MessageEntityFormattedDate),
[0xEE8C1E86] = null,//InputChannelEmpty
[0xF35AEC28] = typeof(InputChannel),
[0x5B934F9D] = typeof(InputChannelFromMessage),
@ -651,11 +655,11 @@ namespace TL
[0x2064674E] = typeof(Updates_ChannelDifference),
[0x94D42EE7] = null,//ChannelMessagesFilterEmpty
[0xCD77D957] = typeof(ChannelMessagesFilter),
[0xCB397619] = typeof(ChannelParticipant),
[0x4F607BEF] = typeof(ChannelParticipantSelf),
[0x1BD54456] = typeof(ChannelParticipant),
[0xA9478A1A] = typeof(ChannelParticipantSelf),
[0x2FE601D3] = typeof(ChannelParticipantCreator),
[0x34C3BB53] = typeof(ChannelParticipantAdmin),
[0x6DF8014E] = typeof(ChannelParticipantBanned),
[0xD5F0AD91] = typeof(ChannelParticipantBanned),
[0x1B03F006] = typeof(ChannelParticipantLeft),
[0xDE3F3C79] = typeof(ChannelParticipantsRecent),
[0xB4608969] = typeof(ChannelParticipantsAdmins),
@ -889,6 +893,7 @@ namespace TL
[0x60A79C79] = typeof(ChannelAdminLogEventActionToggleSignatureProfiles),
[0x64642DB3] = typeof(ChannelAdminLogEventActionParticipantSubExtend),
[0xC517F77E] = typeof(ChannelAdminLogEventActionToggleAutotranslation),
[0x5806B4EC] = typeof(ChannelAdminLogEventActionParticipantEditRank),
[0x1FAD68CD] = typeof(ChannelAdminLogEvent),
[0xED8AF74D] = typeof(Channels_AdminLogResults),
[0xEA107AE4] = typeof(ChannelAdminLogEventsFilter),
@ -1002,7 +1007,7 @@ namespace TL
[0xFBD2C296] = typeof(InputFolderPeer),
[0xE9BAA668] = typeof(FolderPeer),
[0xE844EBFF] = typeof(Messages_SearchCounter),
[0x32FABF1A] = typeof(UrlAuthResultRequest),
[0xF8F8EB1E] = typeof(UrlAuthResultRequest),
[0x623A8FA0] = typeof(UrlAuthResultAccepted),
[0xA9D6DB1F] = null,//UrlAuthResultDefault
[0xBFB5AD8B] = null,//ChannelLocationEmpty

View file

@ -13,8 +13,8 @@
<PackageId>WTelegramClient</PackageId>
<Authors>Wizou</Authors>
<VersionPrefix>0.0.0</VersionPrefix>
<VersionSuffix>layer.222</VersionSuffix>
<Description>Telegram Client API (MTProto) library written 100% in C# and .NET Standard | Latest API layer: 222
<VersionSuffix>layer.223</VersionSuffix>
<Description>Telegram Client API (MTProto) library written 100% in C# and .NET Standard | Latest API layer: 223
Release Notes:
$(ReleaseNotes)</Description>