diff --git a/README.md b/README.md index d0baa0d..05aecf3 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/src/TL.Schema.cs b/src/TL.Schema.cs index cd05e81..6f8ea40 100644 --- a/src/TL.Schema.cs +++ b/src/TL.Schema.cs @@ -1689,33 +1689,54 @@ namespace TL { /// Member user ID public virtual long UserId => default; + public virtual string Rank => default; } /// Group member. See - [TLDef(0xC02D4007)] + [TLDef(0x38E79FDE)] public partial class ChatParticipant : ChatParticipantBase { + /// Extra bits of information, use flags.HasFlag(...) to test for those + public Flags flags; /// Member user ID public long user_id; /// ID of the user that added the member to the group public long inviter_id; /// Date added to the group public DateTime date; + [IfFlag(0)] public string rank; + + [Flags] public enum Flags : uint + { + /// Field has a value + has_rank = 0x1, + } /// Member user ID public override long UserId => user_id; + public override string Rank => rank; } /// Represents the creator of the group See - [TLDef(0xE46BCEE4)] + [TLDef(0xE1F867B8)] public sealed partial class ChatParticipantCreator : ChatParticipantBase { + /// Extra bits of information, use flags.HasFlag(...) to test for those + public Flags flags; /// ID of the user that created the group public long user_id; + [IfFlag(0)] public string rank; + + [Flags] public enum Flags : uint + { + /// Field has a value + has_rank = 0x1, + } /// ID of the user that created the group public override long UserId => user_id; + public override string Rank => rank; } /// Chat admin See - [TLDef(0xA0933F5B)] + [TLDef(0x0360D5D2)] public sealed partial class ChatParticipantAdmin : ChatParticipant { } @@ -1827,7 +1848,7 @@ namespace TL public override Peer Peer => peer_id; } /// A message See - [TLDef(0x9CB490E9)] + [TLDef(0x3AE56482)] public sealed partial class Message : MessageBase { /// Extra bits of information, use flags.HasFlag(...) to test for those @@ -1840,6 +1861,7 @@ namespace TL [IfFlag(8)] public Peer from_id; /// Supergroups only, contains the number of boosts this user has given the current supergroup, and should be shown in the UI in the header of the message.
Only present for incoming messages from non-anonymous supergroup members that have boosted the supergroup.
Note that this counter should be locally overridden for non-anonymous outgoing messages, according to the current value of .boosts_applied, to ensure the value is correct even for messages sent by the current user before a supergroup was boosted (or after a boost has expired or the number of boosts has changed); do not update this value for incoming messages from other users, even if their boosts have changed.
[IfFlag(29)] public int from_boosts_applied; + [IfFlag(44)] public string from_rank; /// Peer ID, the chat where this message was sent public Peer peer_id; /// Messages from a saved messages dialog » will have peer= and the saved_peer_id flag set to the ID of the saved dialog.
Messages from a monoforum » will have peer=ID of the monoforum and the saved_peer_id flag set to the ID of a topic.
@@ -1983,6 +2005,8 @@ namespace TL has_schedule_repeat_period = 0x400, /// Field has a value has_summary_from_language = 0x800, + /// Field has a value + has_from_rank = 0x1000, } /// ID of the message @@ -2099,7 +2123,7 @@ namespace TL } /// Attached map. See [TLDef(0x56E0D474)] - public sealed partial class MessageMediaGeo : MessageMedia + public partial class MessageMediaGeo : MessageMedia { /// GeoPoint public GeoPoint geo; @@ -2246,13 +2270,11 @@ namespace TL } } /// Indicates a live geolocation See - [TLDef(0xB940C666)] - public sealed partial class MessageMediaGeoLive : MessageMedia + [TLDef(0xB940C666, inheritAt = 1)] + public sealed partial class MessageMediaGeoLive : MessageMediaGeo { /// Extra bits of information, use flags.HasFlag(...) to test for those public Flags flags; - /// Geolocation - public GeoPoint geo; /// For live locations, a direction in which the location moves, in degrees; 1-360 [IfFlag(0)] public int heading; /// Validity period of provided geolocation @@ -2436,7 +2458,7 @@ namespace TL } } - /// Object describing actions connected to a service message. See Derived classes: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , + /// Object describing actions connected to a service message. See Derived classes: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , /// a value means messageActionEmpty public abstract partial class MessageAction : IObject { } /// Group created See @@ -3326,6 +3348,27 @@ namespace TL { public long new_creator_id; } + /// See + [TLDef(0xBF7D6572)] + public sealed partial class MessageActionNoForwardsToggle : MessageAction + { + public bool prev_value; + public bool new_value; + } + /// See + [TLDef(0x3E2793BA)] + public sealed partial class MessageActionNoForwardsRequest : MessageAction + { + /// Extra bits of information, use flags.HasFlag(...) to test for those + public Flags flags; + public bool prev_value; + public bool new_value; + + [Flags] public enum Flags : uint + { + expired = 0x1, + } + } /// Chat info. See Derived classes: , public abstract partial class DialogBase : IObject @@ -4148,6 +4191,8 @@ namespace TL has_saved_music = 0x200000, /// Field has a value has_note = 0x400000, + noforwards_my_enabled = 0x800000, + noforwards_peer_enabled = 0x1000000, } } @@ -4475,7 +4520,7 @@ namespace TL [TLDef(0x1BB00451)] public sealed partial class InputMessagesFilterPinned : MessagesFilter { } - /// Object contains info on events occurred. See Derived classes: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , + /// Object contains info on events occurred. See Derived classes: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , public abstract partial class Update : IObject { public virtual (long mbox_id, int pts, int pts_count) GetMBox() => default; @@ -4894,25 +4939,15 @@ namespace TL public Messages_StickerSet stickerset; } /// The order of stickersets was changed See - [TLDef(0x0BB2D201)] - public sealed partial class UpdateStickerSetsOrder : Update + [TLDef(0x0BB2D201, inheritAt = 0)] + public sealed partial class UpdateStickerSetsOrder : UpdateStickerSets { - /// Extra bits of information, use flags.HasFlag(...) to test for those - public Flags flags; /// New sticker order by sticker ID public long[] order; - - [Flags] public enum Flags : uint - { - /// Whether the updated stickers are mask stickers - masks = 0x1, - /// Whether the updated stickers are custom emoji stickers - emojis = 0x2, - } } /// Installed stickersets have changed, the client should refetch them as described in the docs. See [TLDef(0x31C24808)] - public sealed partial class UpdateStickerSets : Update + public partial class UpdateStickerSets : Update { /// Extra bits of information, use flags.HasFlag(...) to test for those public Flags flags; @@ -6378,6 +6413,14 @@ namespace TL /// See [TLDef(0xAC072444)] public sealed partial class UpdateStarGiftCraftFail : Update { } + /// See + [TLDef(0xBD8367B9, inheritAt = 0)] + public sealed partial class UpdateChatParticipantRank : UpdateChat + { + public long user_id; + public string rank; + public int version; + } /// Updates state. See [TLDef(0xA56C2A3E)] @@ -8513,7 +8556,7 @@ namespace TL } /// Bot keyboard button See [TLDef(0x7D170CFF)] - public sealed partial class KeyboardButton : KeyboardButtonBase + public partial class KeyboardButton : KeyboardButtonBase { /// Extra bits of information, use flags.HasFlag(...) to test for those public Flags flags; @@ -8532,26 +8575,11 @@ namespace TL public override string Text => text; } /// URL button See - [TLDef(0xD80C25EC)] - public sealed partial class KeyboardButtonUrl : KeyboardButtonBase + [TLDef(0xD80C25EC, inheritAt = 0)] + public sealed partial class KeyboardButtonUrl : KeyboardButton { - /// Extra bits of information, use flags.HasFlag(...) to test for those - public Flags flags; - [IfFlag(10)] public KeyboardButtonStyle style; - /// Button label - public string text; /// URL public string url; - - [Flags] public enum Flags : uint - { - /// Field has a value - has_style = 0x400, - } - - public override KeyboardButtonStyle Style => style; - /// Button label - public override string Text => text; } /// Callback button See [TLDef(0xE62BC960)] @@ -8579,43 +8607,13 @@ namespace TL } /// Button to request a user's phone number See [TLDef(0x417EFD8F)] - public sealed partial class KeyboardButtonRequestPhone : KeyboardButtonBase + public sealed partial class KeyboardButtonRequestPhone : KeyboardButton { - /// Extra bits of information, use flags.HasFlag(...) to test for those - public Flags flags; - [IfFlag(10)] public KeyboardButtonStyle style; - /// Button text - public string text; - - [Flags] public enum Flags : uint - { - /// Field has a value - has_style = 0x400, - } - - public override KeyboardButtonStyle Style => style; - /// Button text - public override string Text => text; } /// Button to request a user's geolocation See [TLDef(0xAA40F94D)] - public sealed partial class KeyboardButtonRequestGeoLocation : KeyboardButtonBase + public sealed partial class KeyboardButtonRequestGeoLocation : KeyboardButton { - /// Extra bits of information, use flags.HasFlag(...) to test for those - public Flags flags; - [IfFlag(10)] public KeyboardButtonStyle style; - /// Button text - public string text; - - [Flags] public enum Flags : uint - { - /// Field has a value - has_style = 0x400, - } - - public override KeyboardButtonStyle Style => style; - /// Button text - public override string Text => text; } /// Button to force a user to switch to inline mode: pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. See [TLDef(0x991399FC)] @@ -8647,71 +8645,24 @@ namespace TL } /// Button to start a game See [TLDef(0x89C590F9)] - public sealed partial class KeyboardButtonGame : KeyboardButtonBase + public sealed partial class KeyboardButtonGame : KeyboardButton { - /// Extra bits of information, use flags.HasFlag(...) to test for those - public Flags flags; - [IfFlag(10)] public KeyboardButtonStyle style; - /// Button text - public string text; - - [Flags] public enum Flags : uint - { - /// Field has a value - has_style = 0x400, - } - - public override KeyboardButtonStyle Style => style; - /// Button text - public override string Text => text; } /// Button to buy a product See [TLDef(0x3FA53905)] - public sealed partial class KeyboardButtonBuy : KeyboardButtonBase + public sealed partial class KeyboardButtonBuy : KeyboardButton { - /// Extra bits of information, use flags.HasFlag(...) to test for those - public Flags flags; - [IfFlag(10)] public KeyboardButtonStyle style; - /// Button text - public string text; - - [Flags] public enum Flags : uint - { - /// Field has a value - has_style = 0x400, - } - - public override KeyboardButtonStyle Style => style; - /// Button text - public override string Text => text; } /// Button to request a user to authorize via URL using Seamless Telegram Login. When the user clicks on such a button, Messages_RequestUrlAuth should be called, providing the button_id and the ID of the container message. The returned object will contain more details about the authorization request (request_write_access if the bot would like to send messages to the user along with the username of the bot which will be used for user authorization). Finally, the user can choose to call Messages_AcceptUrlAuth to get a with the URL to open instead of the url of this constructor, or a , in which case the url of this constructor must be opened, instead. If the user refuses the authorization request but still wants to open the link, the url of this constructor must be used. See - [TLDef(0xF51006F9)] - public sealed partial class KeyboardButtonUrlAuth : KeyboardButtonBase + [TLDef(0xF51006F9, inheritAt = 0)] + public sealed partial class KeyboardButtonUrlAuth : KeyboardButton { - /// Extra bits of information, use flags.HasFlag(...) to test for those - public Flags flags; - [IfFlag(10)] public KeyboardButtonStyle style; - /// Button label - public string text; /// New text of the button in forwarded messages. - [IfFlag(0)] public string fwd_text; + public string fwd_text; /// An HTTP URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in Receiving authorization data.

NOTE: Services must always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization.
public string url; /// ID of the button to pass to Messages_RequestUrlAuth public int button_id; - - [Flags] public enum Flags : uint - { - /// Field has a value - has_fwd_text = 0x1, - /// Field has a value - has_style = 0x400, - } - - public override KeyboardButtonStyle Style => style; - /// Button label - public override string Text => text; } /// Button to request a user to Messages_AcceptUrlAuth via URL using Seamless Telegram Login. See [TLDef(0x68013E72)] @@ -8790,96 +8741,34 @@ namespace TL public override string Text => text; } /// Button that links directly to a user profile See - [TLDef(0xC0FD5D09)] - public sealed partial class KeyboardButtonUserProfile : KeyboardButtonBase + [TLDef(0xC0FD5D09, inheritAt = 0)] + public sealed partial class KeyboardButtonUserProfile : KeyboardButton { - /// Extra bits of information, use flags.HasFlag(...) to test for those - public Flags flags; - [IfFlag(10)] public KeyboardButtonStyle style; - /// Button text - public string text; /// User ID public long user_id; - - [Flags] public enum Flags : uint - { - /// Field has a value - has_style = 0x400, - } - - public override KeyboardButtonStyle Style => style; - /// Button text - public override string Text => text; } /// Button to open a bot mini app using Messages_RequestWebView, sending over user information after user confirmation. See - [TLDef(0xE846B1A0)] - public sealed partial class KeyboardButtonWebView : KeyboardButtonBase + [TLDef(0xE846B1A0, inheritAt = 0)] + public partial class KeyboardButtonWebView : KeyboardButton { - /// Extra bits of information, use flags.HasFlag(...) to test for those - public Flags flags; - [IfFlag(10)] public KeyboardButtonStyle style; - /// Button text - public string text; /// Web app url public string url; - - [Flags] public enum Flags : uint - { - /// Field has a value - has_style = 0x400, - } - - public override KeyboardButtonStyle Style => style; - /// Button text - public override string Text => text; } /// Button to open a bot mini app using Messages_RequestSimpleWebView, without sending user information to the web app. See [TLDef(0xE15C4370)] - public sealed partial class KeyboardButtonSimpleWebView : KeyboardButtonBase + public sealed partial class KeyboardButtonSimpleWebView : KeyboardButtonWebView { - /// Extra bits of information, use flags.HasFlag(...) to test for those - public Flags flags; - [IfFlag(10)] public KeyboardButtonStyle style; - /// Button text - public string text; - /// Web app URL - public string url; - - [Flags] public enum Flags : uint - { - /// Field has a value - has_style = 0x400, - } - - public override KeyboardButtonStyle Style => style; - /// Button text - public override string Text => text; } /// Prompts the user to select and share one or more peers with the bot using Messages_SendBotRequestedPeer See - [TLDef(0x5B0F15F5)] - public sealed partial class KeyboardButtonRequestPeer : KeyboardButtonBase + [TLDef(0x5B0F15F5, inheritAt = 0)] + public sealed partial class KeyboardButtonRequestPeer : KeyboardButton { - /// Extra bits of information, use flags.HasFlag(...) to test for those - public Flags flags; - [IfFlag(10)] public KeyboardButtonStyle style; - /// Button text - public string text; /// Button ID, to be passed to Messages_SendBotRequestedPeer. public int button_id; /// Filtering criteria to use for the peer selection list shown to the user.
The list should display all existing peers of the specified type, and should also offer an option for the user to create and immediately use one or more (up to max_quantity) peers of the specified type, if needed.
public RequestPeerType peer_type; /// Maximum number of peers that can be chosen. public int max_quantity; - - [Flags] public enum Flags : uint - { - /// Field has a value - has_style = 0x400, - } - - public override KeyboardButtonStyle Style => style; - /// Button text - public override string Text => text; } ///
Prompts the user to select and share one or more peers with the bot using Messages_SendBotRequestedPeer. See [TLDef(0x02B78156)] @@ -8914,26 +8803,11 @@ namespace TL public override string Text => text; } /// Clipboard button: when clicked, the attached text must be copied to the clipboard. See - [TLDef(0xBCC4AF10)] - public sealed partial class KeyboardButtonCopy : KeyboardButtonBase + [TLDef(0xBCC4AF10, inheritAt = 0)] + public sealed partial class KeyboardButtonCopy : KeyboardButton { - /// Extra bits of information, use flags.HasFlag(...) to test for those - public Flags flags; - [IfFlag(10)] public KeyboardButtonStyle style; - /// Title of the button - public string text; /// The text that will be copied to the clipboard public string copy_text; - - [Flags] public enum Flags : uint - { - /// Field has a value - has_style = 0x400, - } - - public override KeyboardButtonStyle Style => style; - /// Title of the button - public override string Text => text; } /// Inline keyboard row See @@ -9011,7 +8885,7 @@ namespace TL public KeyboardButtonRow[] rows; } - /// Message entities, representing styled text in a message See Derived classes: , , , , , , , , , , , , , , , , , , , , + /// Message entities, representing styled text in a message See Derived classes: , , , , , , , , , , , , , , , , , , , , , public abstract partial class MessageEntity : IObject { /// Offset of message entity within message (in UTF-16 code units) @@ -9112,6 +8986,24 @@ namespace TL collapsed = 0x1, } } + /// See + [TLDef(0x904AC7C7, inheritAt = 1)] + public sealed partial class MessageEntityFormattedDate : MessageEntity + { + /// Extra bits of information, use flags.HasFlag(...) to test for those + public Flags flags; + public DateTime date; + + [Flags] public enum Flags : uint + { + relative = 0x1, + short_time = 0x2, + long_time = 0x4, + short_date = 0x8, + long_date = 0x10, + day_of_week = 0x20, + } + } /// Represents a channel See Derived classes: , /// a value means inputChannelEmpty @@ -9275,7 +9167,7 @@ namespace TL /// Channel participant See Derived classes: , , , , , public abstract partial class ChannelParticipantBase : IObject { } /// Channel/supergroup participant See - [TLDef(0xCB397619)] + [TLDef(0x1BD54456)] public sealed partial class ChannelParticipant : ChannelParticipantBase { /// Extra bits of information, use flags.HasFlag(...) to test for those @@ -9286,15 +9178,18 @@ namespace TL public DateTime date; /// If set, contains the expiration date of the current Telegram Star subscription period » for the specified participant. [IfFlag(0)] public DateTime subscription_until_date; + [IfFlag(2)] public string rank; [Flags] public enum Flags : uint { /// Field has a value has_subscription_until_date = 0x1, + /// Field has a value + has_rank = 0x4, } } /// Myself See - [TLDef(0x4F607BEF)] + [TLDef(0xA9478A1A)] public sealed partial class ChannelParticipantSelf : ChannelParticipantBase { /// Extra bits of information, use flags.HasFlag(...) to test for those @@ -9307,6 +9202,7 @@ namespace TL public DateTime date; /// If set, contains the expiration date of the current Telegram Star subscription period » for the specified participant. [IfFlag(1)] public DateTime subscription_until_date; + [IfFlag(2)] public string rank; [Flags] public enum Flags : uint { @@ -9314,6 +9210,8 @@ namespace TL via_request = 0x1, /// Field has a value has_subscription_until_date = 0x2, + /// Field has a value + has_rank = 0x4, } } /// Channel/supergroup creator See @@ -9365,7 +9263,7 @@ namespace TL } } /// Banned/kicked user See - [TLDef(0x6DF8014E)] + [TLDef(0xD5F0AD91)] public sealed partial class ChannelParticipantBanned : ChannelParticipantBase { /// Extra bits of information, use flags.HasFlag(...) to test for those @@ -9378,11 +9276,14 @@ namespace TL public DateTime date; /// Banned rights public ChatBannedRights banned_rights; + [IfFlag(2)] public string rank; [Flags] public enum Flags : uint { /// Whether the user has left the group left = 0x1, + /// Field has a value + has_rank = 0x4, } } /// A participant that left the channel/supergroup See @@ -12499,7 +12400,7 @@ namespace TL } } - /// Channel admin log event See Derived classes: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , + /// Channel admin log event See Derived classes: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , public abstract partial class ChannelAdminLogEventAction : IObject { } /// Channel/supergroup title was changed See [TLDef(0xE6DFB825)] @@ -12902,6 +12803,14 @@ namespace TL /// New value of the toggle public bool new_value; } + /// See + [TLDef(0x5806B4EC)] + public sealed partial class ChannelAdminLogEventActionParticipantEditRank : ChannelAdminLogEventAction + { + public long user_id; + public string prev_rank; + public string new_rank; + } /// Admin log event See [TLDef(0x1FAD68CD)] @@ -12978,6 +12887,7 @@ namespace TL forums = 0x20000, /// Telegram Star subscription extension events » sub_extend = 0x40000, + edit_rank = 0x80000, } } @@ -14158,6 +14068,7 @@ namespace TL delete_stories = 0x10000, /// If set, allows the admin to manage the direct messages monoforum » and decline suggested posts ». manage_direct_messages = 0x20000, + manage_ranks = 0x40000, } } @@ -14212,6 +14123,7 @@ namespace TL send_docs = 0x1000000, /// If set, does not allow a user to send text messages in a supergroup/chat. send_plain = 0x2000000, + edit_rank = 0x4000000, } } @@ -14485,7 +14397,7 @@ namespace TL /// a value means urlAuthResultDefault public abstract partial class UrlAuthResult : IObject { } /// Details about the authorization request, for more info click here » See - [TLDef(0x32FABF1A)] + [TLDef(0xF8F8EB1E)] public sealed partial class UrlAuthResultRequest : UrlAuthResult { /// Extra bits of information, use flags.HasFlag(...) to test for those @@ -14498,6 +14410,8 @@ namespace TL [IfFlag(2)] public string platform; [IfFlag(2)] public string ip; [IfFlag(2)] public string region; + [IfFlag(3)] public string[] match_codes; + [IfFlag(4)] public long user_id_hint; [Flags] public enum Flags : uint { @@ -14506,6 +14420,11 @@ namespace TL request_phone_number = 0x2, /// Fields , , and have a value has_browser = 0x4, + /// Field has a value + has_match_codes = 0x8, + /// Field has a value + has_user_id_hint = 0x10, + match_codes_first = 0x20, } } /// Details about an accepted authorization request, for more info click here » See @@ -18581,13 +18500,15 @@ namespace TL } /// Represents a story media area » See Derived classes: , , , , , , , , - public abstract partial class MediaArea : IObject { } - /// Represents a location tag attached to a story, with additional venue information. See - [TLDef(0xBE82DB9C)] - public sealed partial class MediaAreaVenue : MediaArea + public abstract partial class MediaArea : IObject { /// The size and location of the media area corresponding to the location sticker on top of the story media. public MediaAreaCoordinates coordinates; + } + /// Represents a location tag attached to a story, with additional venue information. See + [TLDef(0xBE82DB9C, inheritAt = 0)] + public sealed partial class MediaAreaVenue : MediaArea + { /// Coordinates of the venue public GeoPoint geo; /// Venue name @@ -18602,24 +18523,20 @@ namespace TL public string venue_type; } /// Represents a location tag attached to a story, with additional venue information. See - [TLDef(0xB282217F)] + [TLDef(0xB282217F, inheritAt = 0)] public sealed partial class InputMediaAreaVenue : MediaArea { - /// The size and location of the media area corresponding to the location sticker on top of the story media. - public MediaAreaCoordinates coordinates; /// The query_id from , see here » for more info. public long query_id; /// The id of the chosen result, see here » for more info. public string result_id; } /// Represents a geolocation tag attached to a story. See - [TLDef(0xCAD5452D)] + [TLDef(0xCAD5452D, inheritAt = 1)] public sealed partial class MediaAreaGeoPoint : MediaArea { /// Extra bits of information, use flags.HasFlag(...) to test for those public Flags flags; - /// The size and position of the media area corresponding to the location sticker on top of the story media. - public MediaAreaCoordinates coordinates; /// Coordinates of the geolocation tag. public GeoPoint geo; /// Optional textual representation of the address. @@ -18632,13 +18549,11 @@ namespace TL } } /// Represents a reaction bubble. See - [TLDef(0x14455871)] + [TLDef(0x14455871, inheritAt = 1)] public sealed partial class MediaAreaSuggestedReaction : MediaArea { /// Extra bits of information, use flags.HasFlag(...) to test for those public Flags flags; - /// The coordinates of the media area corresponding to the reaction button. - public MediaAreaCoordinates coordinates; /// The reaction that should be sent when this area is clicked. public Reaction reaction; @@ -18651,42 +18566,34 @@ namespace TL } } /// Represents a channel post. See - [TLDef(0x770416AF)] + [TLDef(0x770416AF, inheritAt = 0)] public sealed partial class MediaAreaChannelPost : MediaArea { - /// The size and location of the media area corresponding to the location sticker on top of the story media. - public MediaAreaCoordinates coordinates; /// The channel that posted the message public long channel_id; /// ID of the channel message public int msg_id; } /// Represents a channel post See - [TLDef(0x2271F2BF)] + [TLDef(0x2271F2BF, inheritAt = 0)] public sealed partial class InputMediaAreaChannelPost : MediaArea { - /// The size and location of the media area corresponding to the location sticker on top of the story media. - public MediaAreaCoordinates coordinates; /// The channel that posted the message public InputChannelBase channel; /// ID of the channel message public int msg_id; } /// Represents a URL media area. See - [TLDef(0x37381085)] + [TLDef(0x37381085, inheritAt = 0)] public sealed partial class MediaAreaUrl : MediaArea { - /// The size and location of the media area corresponding to the URL button on top of the story media. - public MediaAreaCoordinates coordinates; /// URL to open when clicked. public string url; } /// Represents a weather widget ». See - [TLDef(0x49A6549C)] + [TLDef(0x49A6549C, inheritAt = 0)] public sealed partial class MediaAreaWeather : MediaArea { - /// The size and location of the media area corresponding to the widget on top of the story media. - public MediaAreaCoordinates coordinates; /// Weather emoji, should be rendered as an animated emoji. public string emoji; /// Temperature in degrees Celsius. @@ -18695,11 +18602,9 @@ namespace TL public int color; } /// Represents a collectible gift ». See - [TLDef(0x5787686D)] + [TLDef(0x5787686D, inheritAt = 0)] public sealed partial class MediaAreaStarGift : MediaArea { - /// Coordinates of the media area. - public MediaAreaCoordinates coordinates; /// slug from .slug, that can be resolved as specified here ». public string slug; } diff --git a/src/TL.SchemaFuncs.cs b/src/TL.SchemaFuncs.cs index 72fb740..985dec3 100644 --- a/src/TL.SchemaFuncs.cs +++ b/src/TL.SchemaFuncs.cs @@ -3291,14 +3291,15 @@ namespace TL /// The ID of the button with the authorization request /// URL used for link URL authorization, click here for more info » /// a null value means urlAuthResultDefault - public static Task Messages_RequestUrlAuth(this Client client, InputPeer peer = null, int? msg_id = null, int? button_id = null, string url = null) + public static Task 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, }); /// Use this to accept a Seamless Telegram Login authorization request, for more info click here » See @@ -3308,14 +3309,15 @@ namespace TL /// ID of the login button /// URL used for link URL authorization, click here for more info » /// a null value means urlAuthResultDefault - public static Task 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 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, }); /// Should be called after the user hides the report spam/add as contact bar of a new chat, effectively prevents the user from executing the actions specified in the action bar ». See Possible codes: 400 (details) @@ -3754,11 +3756,13 @@ namespace TL /// Enable or disable content protection on a channel or chat See Possible codes: 400 (details) /// The chat or channel /// Enable or disable content protection - public static Task Messages_ToggleNoForwards(this Client client, InputPeer peer, bool enabled) + public static Task 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, }); /// Change the default peer that should be used when sending messages, reactions, poll votes to a specific group See Possible codes: 400 (details) @@ -4873,6 +4877,46 @@ namespace TL to_lang = to_lang, }); + /// See [bots: ✓] + public static Task 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, + }); + + /// See [bots: ✓] + public static Task Messages_GetFutureChatCreatorAfterLeave(this Client client, InputPeer peer) + => client.Invoke(new Messages_GetFutureChatCreatorAfterLeave + { + peer = peer, + }); + + /// See [bots: ✓] + public static Task Messages_EditChatParticipantRank(this Client client, InputPeer peer, InputPeer participant, string rank) + => client.Invoke(new Messages_EditChatParticipantRank + { + peer = peer, + participant = participant, + rank = rank, + }); + + /// See [bots: ✓] + public static Task Messages_DeclineUrlAuth(this Client client, string url) + => client.Invoke(new Messages_DeclineUrlAuth + { + url = url, + }); + + /// See [bots: ✓] + public static Task Messages_CheckUrlAuthMatchCode(this Client client, string url, string match_code) + => client.Invoke(new Messages_CheckUrlAuthMatchCode + { + url = url, + match_code = match_code, + }); + /// Returns a current state of updates. See [bots: ✓] public static Task Updates_GetState(this Client client) => client.Invoke(new Updates_GetState @@ -5393,9 +5437,10 @@ namespace TL /// The ID of the user whose admin rights should be modified /// The admin rights /// Indicates the role (rank) of the admin in the group: just an arbitrary string - public static Task Channels_EditAdmin(this Client client, InputChannelBase channel, InputUserBase user_id, ChatAdminRights admin_rights, string rank) + public static Task 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, }); - /// Transfer channel ownership See Possible codes: 400,403 (details) - /// Channel - /// New channel owner - /// 2FA password of account - public static Task Channels_EditCreator(this Client client, InputChannelBase channel, InputUserBase user_id, InputCheckPasswordSRP password) - => client.Invoke(new Channels_EditCreator - { - channel = channel, - user_id = user_id, - password = password, - }); - /// Edit location of geogroup, see here » for more info on geogroups. See Possible codes: 400 (details) /// Geogroup /// New geolocation @@ -5914,13 +5947,6 @@ namespace TL tab = tab, }); - /// See Possible codes: 400 (details) - public static Task Channels_GetFutureCreatorAfterLeave(this Client client, InputChannelBase channel) - => client.Invoke(new Channels_GetFutureCreatorAfterLeave - { - channel = channel, - }); - /// Sends a custom request; for bots only See [bots: ✓ users: ✗] Possible codes: 400 (details) /// The method name /// JSON-serialized method parameters @@ -11058,7 +11084,7 @@ namespace TL.Methods } } - [TLDef(0x198FB446)] + [TLDef(0x894CC99C)] public sealed partial class Messages_RequestUrlAuth : IMethod { 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 { 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 { + 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 + { + public InputPeer peer; + public InputUserBase user_id; + public InputCheckPasswordSRP password; + } + + [TLDef(0x3B7D0EA6)] + public sealed partial class Messages_GetFutureChatCreatorAfterLeave : IMethod + { + public InputPeer peer; + } + + [TLDef(0xA00F32B0)] + public sealed partial class Messages_EditChatParticipantRank : IMethod + { + public InputPeer peer; + public InputPeer participant; + public string rank; + } + + [TLDef(0x35436BBC)] + public sealed partial class Messages_DeclineUrlAuth : IMethod + { + public string url; + } + + [TLDef(0xC9A47B0B)] + public sealed partial class Messages_CheckUrlAuthMatchCode : IMethod + { + public string url; + public string match_code; + } + [TLDef(0xEDD4882A)] public sealed partial class Updates_GetState : IMethod { } @@ -12795,13 +12867,19 @@ namespace TL.Methods } } - [TLDef(0xD33C8902)] + [TLDef(0x9A98AD68)] public sealed partial class Channels_EditAdmin : IMethod { + 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 - { - public InputChannelBase channel; - public InputUserBase user_id; - public InputCheckPasswordSRP password; - } - [TLDef(0x58E63F6D)] public sealed partial class Channels_EditLocation : IMethod { @@ -13219,12 +13289,6 @@ namespace TL.Methods public ProfileTab tab; } - [TLDef(0xA00918AF)] - public sealed partial class Channels_GetFutureCreatorAfterLeave : IMethod - { - public InputChannelBase channel; - } - [TLDef(0xAA2769ED)] public sealed partial class Bots_SendCustomRequest : IMethod { diff --git a/src/TL.Table.cs b/src/TL.Table.cs index 58c89c4..a26fd62 100644 --- a/src/TL.Table.cs +++ b/src/TL.Table.cs @@ -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 diff --git a/src/WTelegramClient.csproj b/src/WTelegramClient.csproj index aef2b5c..bd1d6c3 100644 --- a/src/WTelegramClient.csproj +++ b/src/WTelegramClient.csproj @@ -13,8 +13,8 @@ WTelegramClient Wizou 0.0.0 - layer.222 - Telegram Client API (MTProto) library written 100% in C# and .NET Standard | Latest API layer: 222 + layer.223 + Telegram Client API (MTProto) library written 100% in C# and .NET Standard | Latest API layer: 223 Release Notes: $(ReleaseNotes)