From 4875f75774fcf073941953d72b92db1caa04b90c Mon Sep 17 00:00:00 2001 From: Wizou <11647984+wiz0u@users.noreply.github.com> Date: Fri, 31 Oct 2025 00:27:32 +0100 Subject: [PATCH] API Layer 216: topics methods/updates moved to prefix Messages_* (to support topics for bots), contact notes, groupcall comments, profile color, stargifts stuff --- README.md | 2 +- src/Client.Helpers.cs | 8 +- src/TL.Schema.cs | 264 ++++++++++++++----- src/TL.SchemaFuncs.cs | 515 +++++++++++++++++++++---------------- src/TL.Table.cs | 39 +-- src/WTelegramClient.csproj | 4 +- 6 files changed, 537 insertions(+), 295 deletions(-) diff --git a/README.md b/README.md index 5bf0849..895eedf 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![API Layer](https://img.shields.io/badge/API_Layer-214-blueviolet)](https://corefork.telegram.org/methods) +[![API Layer](https://img.shields.io/badge/API_Layer-216-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/Client.Helpers.cs b/src/Client.Helpers.cs index e205579..6faa509 100644 --- a/src/Client.Helpers.cs +++ b/src/Client.Helpers.cs @@ -640,18 +640,18 @@ namespace WTelegram } /// Helper simplified method: Get all topics of a forum See Possible codes: 400 (details) - /// Supergroup + /// Supergroup or Bot peer /// Search query - public async Task Channels_GetAllForumTopics(InputChannelBase channel, string q = null) + public async Task Channels_GetAllForumTopics(InputPeer peer, string q = null) { - var result = await this.Channels_GetForumTopics(channel, offset_date: DateTime.MaxValue, q: q); + var result = await this.Messages_GetForumTopics(peer, offset_date: DateTime.MaxValue, q: q); if (result.topics.Length < result.count) { var topics = result.topics.ToList(); var messages = result.messages.ToList(); while (true) { - var more_topics = await this.Channels_GetForumTopics(channel, messages[^1].Date, messages[^1].ID, topics[^1].ID); + var more_topics = await this.Messages_GetForumTopics(peer, messages[^1].Date, messages[^1].ID, topics[^1].ID); if (more_topics.topics.Length == 0) break; topics.AddRange(more_topics.topics); messages.AddRange(more_topics.messages); diff --git a/src/TL.Schema.cs b/src/TL.Schema.cs index 16411b9..45807d0 100644 --- a/src/TL.Schema.cs +++ b/src/TL.Schema.cs @@ -819,9 +819,9 @@ namespace TL /// ID of the maximum read story.
When updating the local peer database, do not apply changes to this field if the min flag of the incoming constructor is set.
[IfFlag(37)] public int stories_max_id; /// The user's accent color. - [IfFlag(40)] public PeerColor color; + [IfFlag(40)] public PeerColorBase color; /// The user's profile color. - [IfFlag(41)] public PeerColor profile_color; + [IfFlag(41)] public PeerColorBase profile_color; /// Monthly Active Users (MAU) of this bot (may be absent for small bots). [IfFlag(44)] public int bot_active_users; /// Describes a bot verification icon ». @@ -919,6 +919,7 @@ namespace TL has_bot_verification_icon = 0x4000, /// Field has a value has_send_paid_messages_stars = 0x8000, + bot_forum_view = 0x10000, } } @@ -1123,9 +1124,9 @@ namespace TL /// ID of the maximum read story. [IfFlag(36)] public int stories_max_id; /// The channel's accent color. - [IfFlag(39)] public PeerColor color; + [IfFlag(39)] public PeerColorBase color; /// The channel's profile color. - [IfFlag(40)] public PeerColor profile_color; + [IfFlag(40)] public PeerColorBase profile_color; /// Emoji status [IfFlag(41)] public EmojiStatusBase emoji_status; /// Boost level.
Changes to this flag should invalidate the local cache for this channel/supergroup ID, see here » for more info.
@@ -2744,6 +2745,7 @@ namespace TL { /// Field has a value has_icon_emoji_id = 0x1, + title_missing = 0x2, } } /// Forum topic information was edited. See @@ -2988,7 +2990,7 @@ namespace TL [IfFlag(12)] public long saved_id; /// Hash to prepay for a gift upgrade separately ». [IfFlag(14)] public string prepaid_upgrade_hash; - /// For separate upgrades, the identifier of the message with the gift whose upgrade was prepaid (valid for everyone, since all messages across all private chats with users share the same message ID sequence, and for channels the service message will already be sent to the channel, that will contain the service message with the original gift). + /// For separate upgrades, the identifier of the message with the gift whose upgrade was prepaid (only valid for the receiver of the service message). [IfFlag(15)] public int gift_msg_id; [Flags] public enum Flags : uint @@ -3026,7 +3028,7 @@ namespace TL } } /// A gift » was upgraded to a collectible gift ». See - [TLDef(0x34F762F3)] + [TLDef(0x95728543)] public sealed partial class MessageActionStarGiftUnique : MessageAction { /// Extra bits of information, use flags.HasFlag(...) to test for those @@ -3049,6 +3051,7 @@ namespace TL [IfFlag(9)] public DateTime can_transfer_at; /// If set, indicates that the current gift can't be resold » yet: the owner will be able to put it up for sale at the specified unixtime. [IfFlag(10)] public DateTime can_resell_at; + [IfFlag(12)] public long drop_original_details_stars; [Flags] public enum Flags : uint { @@ -3076,6 +3079,9 @@ namespace TL has_can_resell_at = 0x400, /// The sender has pre-paid for the upgrade of this gift to a collectible gift. prepaid_upgrade = 0x800, + /// Field has a value + has_drop_original_details_stars = 0x1000, + assigned = 0x2000, } } /// Sent from peer A to B, indicates that A refunded all stars B previously paid to send messages to A, see here » for more info on paid messages. See @@ -3215,6 +3221,12 @@ namespace TL has_transaction_id = 0x1, } } + /// See + [TLDef(0x2C8F2A25)] + public sealed partial class MessageActionSuggestBirthday : MessageAction + { + public Birthday birthday; + } /// Chat info. See Derived classes: , public abstract partial class DialogBase : IObject @@ -3495,7 +3507,7 @@ namespace TL public Auth_AuthorizationBase authorization; } /// Official apps may receive this constructor, indicating that due to the high cost of SMS verification codes for the user's country/provider, the user must purchase a Telegram Premium subscription in order to proceed with the login/signup. See - [TLDef(0xD7A2FCF9)] + [TLDef(0xE0955A3C)] public sealed partial class Auth_SentCodePaymentRequired : Auth_SentCodeBase { /// Store identifier of the Telegram Premium subscription. @@ -3506,6 +3518,8 @@ namespace TL public string support_email_address; /// The mandatory subject for the email. public string support_email_subject; + public string currency; + public long amount; } /// Object contains info on user authorization. See Derived classes: , @@ -3852,7 +3866,7 @@ namespace TL } /// Extended user info See - [TLDef(0xC577B5AD)] + [TLDef(0xA02BC13E)] public sealed partial class UserFull : IObject { /// Extra bits of information, use flags.HasFlag(...) to test for those @@ -3931,6 +3945,7 @@ namespace TL [IfFlag(52)] public ProfileTab main_tab; /// The first song on the music tab of the profile, see here » for more info on the music profile tab. [IfFlag(53)] public DocumentBase saved_music; + [IfFlag(54)] public TextWithEntities note; [Flags] public enum Flags : uint { @@ -4032,6 +4047,8 @@ namespace TL has_main_tab = 0x100000, /// Field has a value has_saved_music = 0x200000, + /// Field has a value + has_note = 0x400000, } } @@ -4165,15 +4182,17 @@ namespace TL { /// List of messages public virtual MessageBase[] Messages => default; + public virtual ForumTopicBase[] Topics => default; /// returns a or for the given Peer public abstract IPeerInfo UserOrChat(Peer peer); } /// Full list of messages with auxiliary data. See - [TLDef(0x8C718E87)] + [TLDef(0x1D73E7EA)] public partial class Messages_Messages : Messages_MessagesBase, IPeerResolver { /// List of messages public MessageBase[] messages; + public ForumTopicBase[] topics; /// List of chats mentioned in dialogs public Dictionary chats; /// List of users mentioned in messages and chats @@ -4181,11 +4200,12 @@ namespace TL /// List of messages public override MessageBase[] Messages => messages; + public override ForumTopicBase[] Topics => topics; /// returns a or for the given Peer public override IPeerInfo UserOrChat(Peer peer) => peer?.UserOrChat(users, chats); } /// Incomplete list of messages and auxiliary data. See - [TLDef(0x762B263D)] + [TLDef(0x5F206716)] public sealed partial class Messages_MessagesSlice : Messages_Messages, IPeerResolver { /// Extra bits of information, use flags.HasFlag(...) to test for those @@ -4242,6 +4262,8 @@ namespace TL /// Found messages public override MessageBase[] Messages => messages; + /// Forum topic information + public override ForumTopicBase[] Topics => topics; /// returns a or for the given Peer public override IPeerInfo UserOrChat(Peer peer) => peer?.UserOrChat(users, chats); } @@ -4358,6 +4380,7 @@ namespace TL public abstract partial class Update : IObject { public virtual (long mbox_id, int pts, int pts_count) GetMBox() => default; + public virtual void SetPTS(int new_pts, int new_pts_count) { } } /// New message in a private chat or in a basic group. See [TLDef(0x1F2B0AFD)] @@ -4371,6 +4394,7 @@ namespace TL public int pts_count; public override (long, int, int) GetMBox() => (0, pts, pts_count); + public override void SetPTS(int new_pts, int new_pts_count) => (pts, pts_count) = (new_pts, new_pts_count); } /// Sent message with random_id client identifier was assigned an identifier. See [TLDef(0x4E90BFD6)] @@ -4393,13 +4417,24 @@ namespace TL public int pts_count; public override (long, int, int) GetMBox() => (0, pts, pts_count); + public override void SetPTS(int new_pts, int new_pts_count) => (pts, pts_count) = (new_pts, new_pts_count); } /// The user is preparing a message; typing, recording, uploading, etc. This update is valid for 6 seconds. If no further updates of this kind are received after 6 seconds, it should be considered that the user stopped doing whatever they were doing See - [TLDef(0xC01E857F, inheritBefore = true)] - public sealed partial class UpdateUserTyping : UpdateUser + [TLDef(0x2A17BF5C)] + public sealed partial class UpdateUserTyping : Update { + public Flags flags; + /// User id + public long user_id; + [IfFlag(0)] public int top_msg_id; /// Action type public SendMessageAction action; + + [Flags] public enum Flags : uint + { + /// Field has a value + has_top_msg_id = 0x1, + } } /// The user is preparing a message in a group; typing, recording, uploading, etc. This update is valid for 6 seconds. If no further updates of this kind are received after 6 seconds, it should be considered that the user stopped doing whatever they were doing See [TLDef(0x83487AF0, inheritBefore = true)] @@ -4466,6 +4501,7 @@ namespace TL public int qts; public override (long, int, int) GetMBox() => (-1, qts, 1); + public override void SetPTS(int new_qts, int _) => qts = new_qts; } /// Interlocutor is typing a message in an encrypted chat. Update period is 6 second. If upon this time there is no repeated update, it shall be considered that the interlocutor stopped typing. See [TLDef(0x1710F156)] @@ -4576,7 +4612,7 @@ namespace TL public string phone; } /// Incoming messages were read See - [TLDef(0x9C974FDF)] + [TLDef(0x9E84BC99)] public sealed partial class UpdateReadHistoryInbox : Update { /// Extra bits of information, use flags.HasFlag(...) to test for those @@ -4585,6 +4621,7 @@ namespace TL [IfFlag(0)] public int folder_id; /// Peer public Peer peer; + [IfFlag(1)] public int top_msg_id; /// Maximum ID of messages read public int max_id; /// Number of messages that are still unread @@ -4598,9 +4635,12 @@ namespace TL { /// Field has a value has_folder_id = 0x1, + /// Field has a value + has_top_msg_id = 0x2, } public override (long, int, int) GetMBox() => (0, pts, pts_count); + public override void SetPTS(int new_pts, int new_pts_count) => (pts, pts_count) = (new_pts, new_pts_count); } /// Outgoing messages were read See [TLDef(0x2F2F21BF)] @@ -4616,6 +4656,7 @@ namespace TL public int pts_count; public override (long, int, int) GetMBox() => (0, pts, pts_count); + public override void SetPTS(int new_pts, int new_pts_count) => (pts, pts_count) = (new_pts, new_pts_count); } /// An instant view webpage preview was generated See [TLDef(0x7F891213)] @@ -4629,6 +4670,7 @@ namespace TL public int pts_count; public override (long, int, int) GetMBox() => (0, pts, pts_count); + public override void SetPTS(int new_pts, int new_pts_count) => (pts, pts_count) = (new_pts, new_pts_count); } /// Contents of messages in the common message box were read (emitted specifically for messages like voice messages or video, only once the media is watched and marked as read using Messages_ReadMessageContents). See [TLDef(0xF8227181)] @@ -4652,6 +4694,7 @@ namespace TL } public override (long, int, int) GetMBox() => (0, pts, pts_count); + public override void SetPTS(int new_pts, int new_pts_count) => (pts, pts_count) = (new_pts, new_pts_count); } /// There are new updates in the specified channel, the client must fetch them.
If the difference is too long or if the channel isn't currently in the states, start fetching from the specified pts. See
[TLDef(0x108D941F)] @@ -4671,6 +4714,7 @@ namespace TL } public override (long, int, int) GetMBox() => (channel_id, pts, 0); + public override void SetPTS(int new_pts, int _) => pts = new_pts; } /// Channel/supergroup ( and/or ) information was updated. See [TLDef(0x635B4C09)] @@ -4684,6 +4728,7 @@ namespace TL public sealed partial class UpdateNewChannelMessage : UpdateNewMessage { public override (long, int, int) GetMBox() => (message.Peer is PeerChannel pc ? pc.channel_id : 0, pts, pts_count); + public override void SetPTS(int new_pts, int new_pts_count) => (pts, pts_count) = (new_pts, new_pts_count); } /// Incoming messages in a channel/supergroup were read See [TLDef(0x922E6E10)] @@ -4709,6 +4754,7 @@ namespace TL } public override (long, int, int) GetMBox() => (channel_id, pts, 0); + public override void SetPTS(int new_pts, int _) => pts = new_pts; } /// Some messages in a supergroup/channel were deleted See [TLDef(0xC32D5B12)] @@ -4718,6 +4764,7 @@ namespace TL public long channel_id; public override (long, int, int) GetMBox() => (channel_id, pts, pts_count); + public override void SetPTS(int new_pts, int new_pts_count) => (pts, pts_count) = (new_pts, new_pts_count); } /// The view counter of a message in a channel has changed See [TLDef(0xF226AC08, inheritBefore = true)] @@ -4838,6 +4885,7 @@ namespace TL public sealed partial class UpdateEditChannelMessage : UpdateEditMessage { public override (long, int, int) GetMBox() => (message.Peer is PeerChannel pc ? pc.channel_id : 0, pts, pts_count); + public override void SetPTS(int new_pts, int new_pts_count) => (pts, pts_count) = (new_pts, new_pts_count); } /// A callback button was pressed, and the button data was sent to the bot that created the button See [TLDef(0xB9CFC48D)] @@ -4880,6 +4928,7 @@ namespace TL public int pts_count; public override (long, int, int) GetMBox() => (0, pts, pts_count); + public override void SetPTS(int new_pts, int new_pts_count) => (pts, pts_count) = (new_pts, new_pts_count); } /// This notification is received by bots when a button is pressed See [TLDef(0x691E9052)] @@ -4960,6 +5009,7 @@ namespace TL public long channel_id; public override (long, int, int) GetMBox() => (channel_id, pts, pts_count); + public override void SetPTS(int new_pts, int new_pts_count) => (pts, pts_count) = (new_pts, new_pts_count); } /// A dialog was pinned/unpinned See [TLDef(0x6E6FE51C)] @@ -5177,6 +5227,7 @@ namespace TL public int pts_count; public override (long, int, int) GetMBox() => (0, pts, pts_count); + public override void SetPTS(int new_pts, int new_pts_count) => (pts, pts_count) = (new_pts, new_pts_count); } /// Settings of a certain peer have changed See [TLDef(0x6A7E7366)] @@ -5253,6 +5304,7 @@ namespace TL public int qts; public override (long, int, int) GetMBox() => (-1, qts, 1); + public override void SetPTS(int new_qts, int _) => qts = new_qts; } /// A new folder was added See [TLDef(0x26FFDE7D)] @@ -5393,6 +5445,7 @@ namespace TL } public override (long, int, int) GetMBox() => (0, pts, pts_count); + public override void SetPTS(int new_pts, int new_pts_count) => (pts, pts_count) = (new_pts, new_pts_count); } /// Messages were pinned/unpinned in a channel/supergroup See [TLDef(0x5BB98608)] @@ -5416,6 +5469,7 @@ namespace TL } public override (long, int, int) GetMBox() => (channel_id, pts, pts_count); + public override void SetPTS(int new_pts, int new_pts_count) => (pts, pts_count) = (new_pts, new_pts_count); } /// Chat ( and/or ) information was updated. See [TLDef(0xF89A6A4E)] @@ -5503,6 +5557,7 @@ namespace TL } public override (long, int, int) GetMBox() => (-1, qts, 1); + public override void SetPTS(int new_qts, int _) => qts = new_qts; } /// A participant has left, joined, was banned or admined in a channel or supergroup. See [TLDef(0x985D3ABB)] @@ -5540,6 +5595,7 @@ namespace TL } public override (long, int, int) GetMBox() => (-1, qts, 1); + public override void SetPTS(int new_qts, int _) => qts = new_qts; } /// A bot was stopped or re-started. See [TLDef(0xC4870A49)] @@ -5555,6 +5611,7 @@ namespace TL public int qts; public override (long, int, int) GetMBox() => (-1, qts, 1); + public override void SetPTS(int new_qts, int _) => qts = new_qts; } /// New WebRTC parameters See [TLDef(0x0B783982)] @@ -5611,6 +5668,7 @@ namespace TL public int qts; public override (long, int, int) GetMBox() => (-1, qts, 1); + public override void SetPTS(int new_qts, int _) => qts = new_qts; } /// New message reactions » are available See [TLDef(0x1E297BFA)] @@ -5724,40 +5782,6 @@ namespace TL /// Revealed media, contains only s. public MessageExtendedMediaBase[] extended_media; } - /// A forum topic » was pinned or unpinned. See - [TLDef(0x192EFBE3)] - public sealed partial class UpdateChannelPinnedTopic : Update - { - /// Extra bits of information, use flags.HasFlag(...) to test for those - public Flags flags; - /// The forum ID - public long channel_id; - /// The topic ID - public int topic_id; - - [Flags] public enum Flags : uint - { - /// Whether the topic was pinned or unpinned - pinned = 0x1, - } - } - /// The pinned topics of a forum have changed. See - [TLDef(0xFE198602)] - public sealed partial class UpdateChannelPinnedTopics : Update - { - /// Extra bits of information, use flags.HasFlag(...) to test for those - public Flags flags; - /// Forum ID. - public long channel_id; - /// Ordered list containing the IDs of all pinned topics. - [IfFlag(0)] public int[] order; - - [Flags] public enum Flags : uint - { - /// Field has a value - has_order = 0x1, - } - } /// User ( and/or ) information was updated. See [TLDef(0x20529438)] public partial class UpdateUser : Update @@ -5825,6 +5849,7 @@ namespace TL public int qts; public override (long, int, int) GetMBox() => (-1, qts, 1); + public override void SetPTS(int new_qts, int _) => qts = new_qts; } /// Users may also choose to display messages from all topics as if they were sent to a normal group, using a "View as messages" setting in the local client.
This setting only affects the current account, and is synced to other logged in sessions using the Channels_ToggleViewForumAsMessages method; invoking this method will update the value of the view_forum_as_messages flag of or and emit an . See
[TLDef(0x07B68920, inheritBefore = true)] @@ -5872,6 +5897,7 @@ namespace TL public int qts; public override (long, int, int) GetMBox() => (-1, qts, 1); + public override void SetPTS(int new_qts, int _) => qts = new_qts; } /// Bots only: the number of reactions on a message with anonymous reactions has changed. See [TLDef(0x09CB7759)] @@ -5889,6 +5915,7 @@ namespace TL public int qts; public override (long, int, int) GetMBox() => (-1, qts, 1); + public override void SetPTS(int new_qts, int _) => qts = new_qts; } /// A saved message dialog was pinned/unpinned See [TLDef(0xAEAF9E74)] @@ -5975,6 +6002,7 @@ namespace TL public int qts; public override (long, int, int) GetMBox() => (-1, qts, 1); + public override void SetPTS(int new_qts, int _) => qts = new_qts; } /// A message was received via a connected business chat ». See [TLDef(0x9DDB347C)] @@ -5998,6 +6026,7 @@ namespace TL } public override (long, int, int) GetMBox() => (-1, qts, 1); + public override void SetPTS(int new_qts, int _) => qts = new_qts; } /// A message was edited in a connected business chat ». See [TLDef(0x07DF587C)] @@ -6021,6 +6050,7 @@ namespace TL } public override (long, int, int) GetMBox() => (-1, qts, 1); + public override void SetPTS(int new_qts, int _) => qts = new_qts; } /// A message was deleted in a connected business chat ». See [TLDef(0xA02A982E)] @@ -6036,6 +6066,7 @@ namespace TL public int qts; public override (long, int, int) GetMBox() => (-1, qts, 1); + public override void SetPTS(int new_qts, int _) => qts = new_qts; } /// Represents a new reaction to a story. See [TLDef(0x1824E40B)] @@ -6105,6 +6136,7 @@ namespace TL public int qts; public override (long, int, int) GetMBox() => (-1, qts, 1); + public override void SetPTS(int new_qts, int _) => qts = new_qts; } /// Contains the current default paid reaction privacy, see here » for more info. See [TLDef(0x8B725FCE)] @@ -6172,6 +6204,49 @@ namespace TL exception = 0x1, } } + /// See + [TLDef(0x78C314E0)] + public sealed partial class UpdateGroupCallMessage : Update + { + public InputGroupCallBase call; + public Peer from_id; + public long random_id; + public TextWithEntities message; + } + /// See + [TLDef(0xC957A766)] + public sealed partial class UpdateGroupCallEncryptedMessage : Update + { + public InputGroupCallBase call; + public Peer from_id; + public byte[] encrypted_message; + } + /// See + [TLDef(0x683B2C52)] + public sealed partial class UpdatePinnedForumTopic : Update + { + public Flags flags; + public Peer peer; + public int topic_id; + + [Flags] public enum Flags : uint + { + pinned = 0x1, + } + } + /// See + [TLDef(0xDEF143D0)] + public sealed partial class UpdatePinnedForumTopics : Update + { + public Flags flags; + public Peer peer; + [IfFlag(0)] public int[] order; + + [Flags] public enum Flags : uint + { + has_order = 0x1, + } + } /// Updates state. See [TLDef(0xA56C2A3E)] @@ -7270,6 +7345,13 @@ namespace TL /// Emoji public string emoticon; } + /// See + [TLDef(0x376D975C)] + public sealed partial class SendMessageTextDraftAction : SendMessageAction + { + public long random_id; + public TextWithEntities text; + } /// Users found by name substring and auxiliary data. See [TLDef(0xB3134D9D)] @@ -12436,9 +12518,9 @@ namespace TL public partial class ChannelAdminLogEventActionChangePeerColor : ChannelAdminLogEventAction { /// Previous accent palette - public PeerColor prev_value; + public PeerColorBase prev_value; /// New accent palette - public PeerColor new_value; + public PeerColorBase new_value; } /// The profile accent color was changed See [TLDef(0x5E477B25)] @@ -15253,6 +15335,9 @@ namespace TL creator = 0x8000, /// Field has a value has_invite_link = 0x10000, + messages_enabled = 0x20000, + can_change_messages_enabled = 0x40000, + min = 0x80000, } /// Group call ID @@ -15694,7 +15779,7 @@ namespace TL /// Available chat themes See /// a value means account.chatThemesNotModified - [TLDef(0x16484857)] + [TLDef(0xBE098173)] public sealed partial class Account_ChatThemes : IObject, IPeerResolver { /// Extra bits of information, use flags.HasFlag(...) to test for those @@ -15708,7 +15793,7 @@ namespace TL /// Users mentioned in the themes field. public Dictionary users; /// Next offset for pagination. - [IfFlag(0)] public int next_offset; + [IfFlag(0)] public string next_offset; [Flags] public enum Flags : uint { @@ -15740,7 +15825,7 @@ namespace TL /// If set, contains some media. [IfFlag(14)] public MessageMedia media; /// If set, the sponsored message should use the message accent color » specified in color. - [IfFlag(13)] public PeerColor color; + [IfFlag(13)] public PeerColorBase color; /// Label of the sponsored message button. public string button_text; /// If set, contains additional information about the sponsor to be shown along with the message. @@ -16456,6 +16541,18 @@ namespace TL /// The upgrade hash from .prepaid_upgrade_hash or .prepaid_upgrade_hash. public string hash; } + /// See + [TLDef(0x3E77F614)] + public sealed partial class InputInvoicePremiumAuthCode : InputInvoice + { + public InputStorePaymentPurpose purpose; + } + /// See + [TLDef(0x0923D8D1)] + public sealed partial class InputInvoiceStarGiftDropOriginalDetails : InputInvoice + { + public InputSavedStarGift stargift; + } /// Exported invoice deep link See [TLDef(0xAED0CBD9)] @@ -17040,7 +17137,7 @@ namespace TL public override int ID => id; } /// Represents a forum topic. See - [TLDef(0x71701DA9)] + [TLDef(0xCDFF0ECA)] public sealed partial class ForumTopic : ForumTopicBase { /// Extra bits of information, use flags.HasFlag(...) to test for those @@ -17049,6 +17146,7 @@ namespace TL public int id; /// Topic creation date public DateTime date; + public Peer peer; /// Topic title public string title; /// If no custom emoji icon is specified, specifies the color of the fallback topic icon (RGB), one of 0x6FB9F0, 0xFFD67E, 0xCB86DB, 0x8EEE98, 0xFF93B2, or 0xFB6F5F. @@ -17090,6 +17188,7 @@ namespace TL short_ = 0x20, /// Whether the topic is hidden (only valid for the "General" topic, id=1) hidden = 0x40, + title_missing = 0x80, } /// Topic ID @@ -18709,9 +18808,11 @@ namespace TL public IPeerInfo UserOrChat(Peer peer) => peer?.UserOrChat(users, chats); } + /// Represents a color palette ». See Derived classes: + public abstract partial class PeerColorBase : IObject { } /// Represents a color palette ». See [TLDef(0xB54B5ACF)] - public sealed partial class PeerColor : IObject + public sealed partial class PeerColor : PeerColorBase { /// Extra bits of information, use flags.HasFlag(...) to test for those public Flags flags; @@ -18728,6 +18829,31 @@ namespace TL has_background_emoji_id = 0x2, } } + /// See + [TLDef(0xB9C0639A)] + public sealed partial class PeerColorCollectible : PeerColorBase + { + public Flags flags; + public long collectible_id; + public long gift_emoji_id; + public long background_emoji_id; + public int accent_color; + public int[] colors; + [IfFlag(0)] public int dark_accent_color; + [IfFlag(1)] public int[] dark_colors; + + [Flags] public enum Flags : uint + { + has_dark_accent_color = 0x1, + has_dark_colors = 0x2, + } + } + /// See + [TLDef(0xB8EA86A9)] + public sealed partial class InputPeerColorCollectible : PeerColorBase + { + public long collectible_id; + } /// Contains info about a color palette ». See Derived classes: , public abstract partial class Help_PeerColorSetBase : IObject { } @@ -20044,6 +20170,7 @@ namespace TL posts_search = 0x1000000, /// Represents payment for a separate prepaid upgrade of a gift. stargift_prepaid_upgrade = 0x2000000, + stargift_drop_original_details = 0x4000000, } } @@ -20488,6 +20615,7 @@ namespace TL limited_per_user = 0x100, /// Field has a value has_locked_until_date = 0x200, + peer_color_available = 0x400, } /// Identifier of the gift @@ -20500,7 +20628,7 @@ namespace TL public override Peer ReleasedBy => released_by; } /// Represents a collectible star gift, see here » for more info. See - [TLDef(0x1BEFE865)] + [TLDef(0xB0BF741B)] public sealed partial class StarGiftUnique : StarGiftBase { /// Extra bits of information, use flags.HasFlag(...) to test for those @@ -20539,6 +20667,8 @@ namespace TL [IfFlag(8)] public string value_currency; /// The current chat where the associated chat theme is installed, if any (gift-based themes can only be installed in one chat at a time). [IfFlag(10)] public Peer theme_peer; + [IfFlag(11)] public PeerColorBase peer_color; + [IfFlag(12)] public Peer host_id; [Flags] public enum Flags : uint { @@ -20564,6 +20694,10 @@ namespace TL theme_available = 0x200, /// Field has a value has_theme_peer = 0x400, + /// Field has a value + has_peer_color = 0x800, + /// Field has a value + has_host_id = 0x1000, } /// Identifier of the collectible gift. @@ -20951,11 +21085,13 @@ namespace TL } /// A preview of the possible attributes (chosen randomly) a gift » can receive after upgrading it to a collectible gift », see here » for more info. See - [TLDef(0x167BD90B)] + [TLDef(0x3DE1DFED)] public sealed partial class Payments_StarGiftUpgradePreview : IObject { /// Possible gift attributes public StarGiftAttribute[] sample_attributes; + public StarGiftUpgradePrice[] prices; + public StarGiftUpgradePrice[] next_prices; } /// Describes a list of users (or bots). See @@ -21002,7 +21138,7 @@ namespace TL } /// Represents a gift owned by a peer. See - [TLDef(0x19A9B572)] + [TLDef(0x8983A452)] public sealed partial class SavedStarGift : IObject { /// Extra bits of information, use flags.HasFlag(...) to test for those @@ -21035,6 +21171,7 @@ namespace TL [IfFlag(15)] public int[] collection_id; /// Hash to prepay for a gift upgrade separately ». [IfFlag(16)] public string prepaid_upgrade_hash; + [IfFlag(18)] public long drop_original_details_stars; [Flags] public enum Flags : uint { @@ -21074,6 +21211,8 @@ namespace TL has_prepaid_upgrade_hash = 0x10000, /// If set, someone already separately pre-paid for the upgrade of this gift. upgrade_separate = 0x20000, + /// Field has a value + has_drop_original_details_stars = 0x40000, } } @@ -21322,12 +21461,13 @@ namespace TL public StarGiftBase[] gifts; /// Offset for pagination, pass this to Payments_GetResaleStarGifts.offset to fetch the next results. [IfFlag(0)] public string next_offset; - /// Possible gift attributes. + /// Possible gift attributes, only set if Payments_GetResaleStarGifts.attributes_hash is set (on the first call, it must be equal to 0). [IfFlag(1)] public StarGiftAttribute[] attributes; /// Hash of the attributes field, pass this to Payments_GetResaleStarGifts.attributes_hash to avoid returning any attributes (flag not set) if they haven't changed. [IfFlag(1)] public long attributes_hash; /// Chats mentioned in the attributes. public Dictionary chats; + /// Indicates the total number of gifts that have a specific attribute, only set if Payments_GetResaleStarGifts.offset is empty (since this field is not related to the current result page but to all of them, it's only returned on the first page). [IfFlag(2)] public StarGiftAttributeCounter[] counters; /// Users mentioned in the attributes. public Dictionary users; @@ -21676,4 +21816,12 @@ namespace TL /// The slug from .slug. public string slug; } + + /// See + [TLDef(0x99EA331D)] + public sealed partial class StarGiftUpgradePrice : IObject + { + public DateTime date; + public long upgrade_stars; + } } diff --git a/src/TL.SchemaFuncs.cs b/src/TL.SchemaFuncs.cs index ce2d58b..95c6790 100644 --- a/src/TL.SchemaFuncs.cs +++ b/src/TL.SchemaFuncs.cs @@ -387,6 +387,15 @@ namespace TL mnc = mnc, }); + /// See + public static Task Auth_CheckPaidAuth(this Client client, string phone_number, string phone_code_hash, long form_id) + => client.Invoke(new Auth_CheckPaidAuth + { + phone_number = phone_number, + phone_code_hash = phone_code_hash, + form_id = form_id, + }); + /// Register device to receive PUSH notifications See Possible codes: 400 (details) /// Avoid receiving (silent and invisible background) notifications. Useful to save battery. /// Device token type, see PUSH updates for the possible values. @@ -1220,13 +1229,11 @@ namespace TL /// Update the accent color and background custom emoji » of the current account. See Possible codes: 400,403 (details) /// Whether to change the accent color emoji pattern of the profile page; otherwise, the accent color and emoji pattern of messages will be changed. /// ID of the accent color palette » to use (not RGB24, see here » for more info). - /// Custom emoji ID used in the accent color pattern. - public static Task Account_UpdateColor(this Client client, long? background_emoji_id = null, int? color = null, bool for_profile = false) + public static Task Account_UpdateColor(this Client client, PeerColorBase color = null, bool for_profile = false) => client.Invoke(new Account_UpdateColor { - flags = (Account_UpdateColor.Flags)((background_emoji_id != null ? 0x1 : 0) | (color != null ? 0x4 : 0) | (for_profile ? 0x2 : 0)), - color = color ?? default, - background_emoji_id = background_emoji_id ?? default, + flags = (Account_UpdateColor.Flags)((color != null ? 0x4 : 0) | (for_profile ? 0x2 : 0)), + color = color, }); /// Get a set of suggested custom emoji stickers that can be used in an accent color pattern. See @@ -1495,7 +1502,7 @@ namespace TL /// Maximum number of results to return, see pagination /// Hash from a previously returned , to avoid returning any result if the theme list hasn't changed. /// a null value means account.chatThemesNotModified - public static Task Account_GetUniqueGiftChatThemes(this Client client, int offset = default, int limit = int.MaxValue, long hash = default) + public static Task Account_GetUniqueGiftChatThemes(this Client client, string offset, int limit = int.MaxValue, long hash = default) => client.Invoke(new Account_GetUniqueGiftChatThemes { offset = offset, @@ -1561,6 +1568,14 @@ namespace TL documents = documents, }); + /// See + public static Task Users_SuggestBirthday(this Client client, InputUserBase id, Birthday birthday) + => client.Invoke(new Users_SuggestBirthday + { + id = id, + birthday = birthday, + }); + /// Get the telegram IDs of all contacts.
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). See
/// Hash used for caching, for more info click here public static Task Contacts_GetContactIDs(this Client client, long hash = default) @@ -1720,14 +1735,15 @@ namespace TL /// First name /// Last name /// User's phone number, may be omitted to simply add the user to the contact list, without a phone number. - public static Task Contacts_AddContact(this Client client, InputUserBase id, string first_name, string last_name, string phone, bool add_phone_privacy_exception = false) + public static Task Contacts_AddContact(this Client client, InputUserBase id, string first_name, string last_name, string phone, TextWithEntities note = null, bool add_phone_privacy_exception = false) => client.Invoke(new Contacts_AddContact { - flags = (Contacts_AddContact.Flags)(add_phone_privacy_exception ? 0x1 : 0), + flags = (Contacts_AddContact.Flags)((note != null ? 0x2 : 0) | (add_phone_privacy_exception ? 0x1 : 0)), id = id, first_name = first_name, last_name = last_name, phone = phone, + note = note, }); /// If the add contact action bar is active, add that user as contact See Possible codes: 400 (details) @@ -1819,6 +1835,14 @@ namespace TL q = q, }); + /// See + public static Task Contacts_UpdateContactNote(this Client client, InputUserBase id, TextWithEntities note) + => client.Invoke(new Contacts_UpdateContactNote + { + id = id, + note = note, + }); + /// This method is only for basic Chat. See Terminology in the README to understand what this means
Search for a similar method name starting with Channels_ if you're dealing with a
Returns the list of messages by their IDs. See
[bots: ✓]
/// Message ID list public static Task Messages_GetMessages(this Client client, params InputMessage[] id) @@ -4490,7 +4514,7 @@ namespace TL /// The channel /// The message to react to /// The number of stars to send (each will increment the reaction counter by one). - /// Unique client message ID required to prevent message resending.
Note: this argument must be composed of a 64-bit integer where the first 32 bits are random, and the remaining 32 bits are equal to the current unixtime, i.e. uint64_t random_id = (time() << 32) | ((uint64_t)random_uint32_t()): this differs from the random_id format of all other methods in the API, which just take 64 random bits. You can use + /// Unique client message ID required to prevent message resending.
Note: this argument must be composed of a 64-bit integer where the lower 32 bits are random, and the higher 32 bits are equal to the current unixtime, i.e. uint64_t random_id = (time() << 32) | ((uint64_t)random_uint32_t()): this differs from the random_id format of all other methods in the API, which just take 64 random bits. You can use /// Each post with star reactions has a leaderboard with the top senders, but users can opt out of appearing there if they prefer more privacy. Not populating this field will use the default reaction privacy, stored on the server and synced to clients using (see here for more info). public static Task Messages_SendPaidReaction(this Client client, InputPeer peer, int msg_id, int count, long random_id, PaidReactionPrivacy private_ = null) => client.Invoke(new Messages_SendPaidReaction @@ -4682,6 +4706,108 @@ namespace TL reject_comment = reject_comment, }); + /// Get topics of a forum See Possible codes: 400 (details) + /// Peer + /// Search query + /// Offsets for pagination, for more info click here, date of the last message of the last found topic. Use 0 or any date in the future to get results from the last topic. + /// Offsets for pagination, for more info click here, ID of the last message of the last found topic (or initially 0). + /// Offsets for pagination, for more info click here, ID of the last found topic (or initially 0). + /// Maximum number of results to return, see pagination. For optimal performance, the number of returned topics is chosen by the server and can be smaller than the specified limit. + public static Task Messages_GetForumTopics(this Client client, InputPeer peer, DateTime offset_date = default, int offset_id = default, int offset_topic = default, int limit = int.MaxValue, string q = null) + => client.Invoke(new Messages_GetForumTopics + { + flags = (Messages_GetForumTopics.Flags)(q != null ? 0x1 : 0), + peer = peer, + q = q, + offset_date = offset_date, + offset_id = offset_id, + offset_topic = offset_topic, + limit = limit, + }); + + /// Get forum topics by their ID See Possible codes: 400 (details) + /// Peer + /// Topic IDs + public static Task Messages_GetForumTopicsByID(this Client client, InputPeer peer, params int[] topics) + => client.Invoke(new Messages_GetForumTopicsByID + { + peer = peer, + topics = topics, + }); + + /// Edit forum topic; requires manage_topics rights. See [bots: ✓] Possible codes: 400,403 (details) + /// Peer + /// Topic ID + /// If present, will update the topic title (maximum UTF-8 length: 128). + /// If present, updates the custom emoji used as topic icon. Telegram Premium users can use any custom emoji, other users can only use the custom emojis contained in the emoji pack. Pass 0 to switch to the fallback topic icon. + /// If present, will update the open/closed status of the topic. + /// If present, will hide/unhide the topic (only valid for the "General" topic, id=1). + public static Task Messages_EditForumTopic(this Client client, InputPeer peer, int topic_id, string title = null, long? icon_emoji_id = null, bool? closed = default, bool? hidden = default) + => client.Invoke(new Messages_EditForumTopic + { + flags = (Messages_EditForumTopic.Flags)((title != null ? 0x1 : 0) | (icon_emoji_id != null ? 0x2 : 0) | (closed != default ? 0x4 : 0) | (hidden != default ? 0x8 : 0)), + peer = peer, + topic_id = topic_id, + title = title, + icon_emoji_id = icon_emoji_id ?? default, + closed = closed ?? default, + hidden = hidden ?? default, + }); + + /// Pin or unpin forum topics See Possible codes: 400 (details) + /// Peer + /// Forum topic ID + /// Whether to pin or unpin the topic + public static Task Messages_UpdatePinnedForumTopic(this Client client, InputPeer peer, int topic_id, bool pinned) + => client.Invoke(new Messages_UpdatePinnedForumTopic + { + peer = peer, + topic_id = topic_id, + pinned = pinned, + }); + + /// Reorder pinned forum topics See Possible codes: 400 (details) + /// If not set, the order of only the topics present both server-side and in order will be changed (i.e. mentioning topics not pinned server-side in order will not pin them, and not mentioning topics pinned server-side will not unpin them).
If set, the entire server-side pinned topic list will be replaced with order (i.e. mentioning topics not pinned server-side in order will pin them, and not mentioning topics pinned server-side will unpin them) + /// Peer + /// Topic IDs » + public static Task Messages_ReorderPinnedForumTopics(this Client client, InputPeer peer, int[] order, bool force = false) + => client.Invoke(new Messages_ReorderPinnedForumTopics + { + flags = (Messages_ReorderPinnedForumTopics.Flags)(force ? 0x1 : 0), + peer = peer, + order = order, + }); + + /// Create a forum topic; requires manage_topics rights. See [bots: ✓] Possible codes: 400,403 (details) + /// Peer + /// Topic title (maximum UTF-8 length: 128) + /// If no custom emoji icon is specified, specifies the color of the fallback topic icon (RGB), one of 0x6FB9F0, 0xFFD67E, 0xCB86DB, 0x8EEE98, 0xFF93B2, or 0xFB6F5F. + /// ID of the custom emoji used as topic icon. Telegram Premium users can use any custom emoji, other users can only use the custom emojis contained in the emoji pack. + /// Unique client message ID to prevent duplicate sending of the same event You can use + /// Create the topic as the specified peer + public static Task Messages_CreateForumTopic(this Client client, InputPeer peer, string title, long random_id, int? icon_color = null, InputPeer send_as = null, long? icon_emoji_id = null, bool title_missing = false) + => client.Invoke(new Messages_CreateForumTopic + { + flags = (Messages_CreateForumTopic.Flags)((icon_color != null ? 0x1 : 0) | (send_as != null ? 0x4 : 0) | (icon_emoji_id != null ? 0x8 : 0) | (title_missing ? 0x10 : 0)), + peer = peer, + title = title, + icon_color = icon_color ?? default, + icon_emoji_id = icon_emoji_id ?? default, + random_id = random_id, + send_as = send_as, + }); + + /// See + /// Delete message history of a forum topic See [bots: ✓] Possible codes: 400,403 (details) + /// Peer + /// Topic ID + public static Task Messages_DeleteTopicHistory(this Client client, InputPeer peer, int top_msg_id) + => client.InvokeAffected(new Messages_DeleteTopicHistory + { + peer = peer, + top_msg_id = top_msg_id, + }, peer is InputPeerChannel ipc ? ipc.channel_id : 0); + /// Returns a current state of updates. See [bots: ✓] public static Task Updates_GetState(this Client client) => client.Invoke(new Updates_GetState @@ -5548,107 +5674,6 @@ namespace TL tabs = tabs, }); - /// Create a forum topic; requires manage_topics rights. See [bots: ✓] Possible codes: 400,403 (details) - /// The forum - /// Topic title (maximum UTF-8 length: 128) - /// If no custom emoji icon is specified, specifies the color of the fallback topic icon (RGB), one of 0x6FB9F0, 0xFFD67E, 0xCB86DB, 0x8EEE98, 0xFF93B2, or 0xFB6F5F. - /// ID of the custom emoji used as topic icon. Telegram Premium users can use any custom emoji, other users can only use the custom emojis contained in the emoji pack. - /// Unique client message ID to prevent duplicate sending of the same event You can use - /// Create the topic as the specified peer - public static Task Channels_CreateForumTopic(this Client client, InputChannelBase channel, string title, long random_id, int? icon_color = null, InputPeer send_as = null, long? icon_emoji_id = null) - => client.Invoke(new Channels_CreateForumTopic - { - flags = (Channels_CreateForumTopic.Flags)((icon_color != null ? 0x1 : 0) | (send_as != null ? 0x4 : 0) | (icon_emoji_id != null ? 0x8 : 0)), - channel = channel, - title = title, - icon_color = icon_color ?? default, - icon_emoji_id = icon_emoji_id ?? default, - random_id = random_id, - send_as = send_as, - }); - - /// Get topics of a forum See Possible codes: 400 (details) - /// Supergroup - /// Search query - /// Offsets for pagination, for more info click here, date of the last message of the last found topic. Use 0 or any date in the future to get results from the last topic. - /// Offsets for pagination, for more info click here, ID of the last message of the last found topic (or initially 0). - /// Offsets for pagination, for more info click here, ID of the last found topic (or initially 0). - /// Maximum number of results to return, see pagination. For optimal performance, the number of returned topics is chosen by the server and can be smaller than the specified limit. - public static Task Channels_GetForumTopics(this Client client, InputChannelBase channel, DateTime offset_date = default, int offset_id = default, int offset_topic = default, int limit = int.MaxValue, string q = null) - => client.Invoke(new Channels_GetForumTopics - { - flags = (Channels_GetForumTopics.Flags)(q != null ? 0x1 : 0), - channel = channel, - q = q, - offset_date = offset_date, - offset_id = offset_id, - offset_topic = offset_topic, - limit = limit, - }); - - /// Get forum topics by their ID See Possible codes: 400 (details) - /// Forum - /// Topic IDs - public static Task Channels_GetForumTopicsByID(this Client client, InputChannelBase channel, params int[] topics) - => client.Invoke(new Channels_GetForumTopicsByID - { - channel = channel, - topics = topics, - }); - - /// Edit forum topic; requires manage_topics rights. See [bots: ✓] Possible codes: 400,403 (details) - /// Supergroup - /// Topic ID - /// If present, will update the topic title (maximum UTF-8 length: 128). - /// If present, updates the custom emoji used as topic icon. Telegram Premium users can use any custom emoji, other users can only use the custom emojis contained in the emoji pack. Pass 0 to switch to the fallback topic icon. - /// If present, will update the open/closed status of the topic. - /// If present, will hide/unhide the topic (only valid for the "General" topic, id=1). - public static Task Channels_EditForumTopic(this Client client, InputChannelBase channel, int topic_id, string title = null, long? icon_emoji_id = null, bool? closed = default, bool? hidden = default) - => client.Invoke(new Channels_EditForumTopic - { - flags = (Channels_EditForumTopic.Flags)((title != null ? 0x1 : 0) | (icon_emoji_id != null ? 0x2 : 0) | (closed != default ? 0x4 : 0) | (hidden != default ? 0x8 : 0)), - channel = channel, - topic_id = topic_id, - title = title, - icon_emoji_id = icon_emoji_id ?? default, - closed = closed ?? default, - hidden = hidden ?? default, - }); - - /// Pin or unpin forum topics See Possible codes: 400 (details) - /// Supergroup ID - /// Forum topic ID - /// Whether to pin or unpin the topic - public static Task Channels_UpdatePinnedForumTopic(this Client client, InputChannelBase channel, int topic_id, bool pinned) - => client.Invoke(new Channels_UpdatePinnedForumTopic - { - channel = channel, - topic_id = topic_id, - pinned = pinned, - }); - - /// Delete message history of a forum topic See [bots: ✓] Possible codes: 400,403 (details) - /// Forum - /// Topic ID - public static Task Channels_DeleteTopicHistory(this Client client, InputChannelBase channel, int top_msg_id) - => client.InvokeAffected(new Channels_DeleteTopicHistory - { - channel = channel, - top_msg_id = top_msg_id, - }, channel.ChannelId); - - /// Reorder pinned forum topics See Possible codes: 400 (details) - /// If not set, the order of only the topics present both server-side and in order will be changed (i.e. mentioning topics not pinned server-side in order will not pin them, and not mentioning topics pinned server-side will not unpin them).
If set, the entire server-side pinned topic list will be replaced with order (i.e. mentioning topics not pinned server-side in order will pin them, and not mentioning topics pinned server-side will unpin them) - /// Supergroup ID - /// Topic IDs » - public static Task Channels_ReorderPinnedForumTopics(this Client client, InputChannelBase channel, int[] order, bool force = false) - => client.Invoke(new Channels_ReorderPinnedForumTopics - { - flags = (Channels_ReorderPinnedForumTopics.Flags)(force ? 0x1 : 0), - channel = channel, - order = order, - }); - /// Enable or disable the native antispam system. See Possible codes: 400 (details) /// Supergroup ID. The specified supergroup must have at least telegram_antispam_group_size_min members to enable antispam functionality, as specified by the client configuration parameters. /// Enable or disable the native antispam system. @@ -6589,10 +6614,10 @@ namespace TL /// Only returns gifts within the specified collection ». /// Offset for pagination. /// Maximum number of results to return, see pagination - public static Task Payments_GetSavedStarGifts(this Client client, InputPeer peer, string offset, int limit = int.MaxValue, int? collection_id = null, bool exclude_unsaved = false, bool exclude_saved = false, bool exclude_unlimited = false, bool exclude_unique = false, bool sort_by_value = false, bool exclude_upgradable = false, bool exclude_unupgradable = false) + public static Task Payments_GetSavedStarGifts(this Client client, InputPeer peer, string offset, int limit = int.MaxValue, int? collection_id = null, bool exclude_unsaved = false, bool exclude_saved = false, bool exclude_unlimited = false, bool exclude_unique = false, bool sort_by_value = false, bool exclude_upgradable = false, bool exclude_unupgradable = false, bool peer_color_available = false, bool exclude_hosted = false) => client.Invoke(new Payments_GetSavedStarGifts { - flags = (Payments_GetSavedStarGifts.Flags)((collection_id != null ? 0x40 : 0) | (exclude_unsaved ? 0x1 : 0) | (exclude_saved ? 0x2 : 0) | (exclude_unlimited ? 0x4 : 0) | (exclude_unique ? 0x10 : 0) | (sort_by_value ? 0x20 : 0) | (exclude_upgradable ? 0x80 : 0) | (exclude_unupgradable ? 0x100 : 0)), + flags = (Payments_GetSavedStarGifts.Flags)((collection_id != null ? 0x40 : 0) | (exclude_unsaved ? 0x1 : 0) | (exclude_saved ? 0x2 : 0) | (exclude_unlimited ? 0x4 : 0) | (exclude_unique ? 0x10 : 0) | (sort_by_value ? 0x20 : 0) | (exclude_upgradable ? 0x80 : 0) | (exclude_unupgradable ? 0x100 : 0) | (peer_color_available ? 0x200 : 0) | (exclude_hosted ? 0x400 : 0)), peer = peer, collection_id = collection_id ?? default, offset = offset, @@ -6648,10 +6673,10 @@ namespace TL /// Get collectible gifts of a specific type currently on resale, see here » for more info. See Possible codes: 400 (details) /// Sort gifts by price (ascending). /// Sort gifts by number (ascending). - /// If a previous call to the method was made and .attributes_hash was set, pass it here to avoid returning any results if they haven't changed. + /// If a previous call to the method was made and .attributes_hash was set, pass it here to avoid returning any results if they haven't changed.
Otherwise, set this flag and pass 0 to return .attributes_hash and .attributes, these two fields will not be set if this flag is not set. /// Mandatory identifier of the base gift from which the collectible gift was upgraded. /// Optionally filter gifts with the specified attributes. If no attributes of a specific type are specified, all attributes of that type are allowed. - /// Offset for pagination. + /// Offset for pagination. If not equal to an empty string, .counters will not be set to avoid returning the counters every time a new page is fetched. /// Maximum number of results to return, see pagination public static Task Payments_GetResaleStarGifts(this Client client, long gift_id, string offset, int limit = int.MaxValue, long? attributes_hash = null, StarGiftAttributeId[] attributes = null, bool sort_by_price = false, bool sort_by_num = false) => client.Invoke(new Payments_GetResaleStarGifts @@ -7057,12 +7082,13 @@ namespace TL /// Invalidate existing invite links /// Group call /// Whether all users will that join this group call are muted by default upon joining the group call - public static Task Phone_ToggleGroupCallSettings(this Client client, InputGroupCallBase call, bool? join_muted = default, bool reset_invite_hash = false) + public static Task Phone_ToggleGroupCallSettings(this Client client, InputGroupCallBase call, bool? join_muted = default, bool? messages_enabled = default, bool reset_invite_hash = false) => client.Invoke(new Phone_ToggleGroupCallSettings { - flags = (Phone_ToggleGroupCallSettings.Flags)((join_muted != default ? 0x1 : 0) | (reset_invite_hash ? 0x2 : 0)), + flags = (Phone_ToggleGroupCallSettings.Flags)((join_muted != default ? 0x1 : 0) | (messages_enabled != default ? 0x4 : 0) | (reset_invite_hash ? 0x2 : 0)), call = call, join_muted = join_muted ?? default, + messages_enabled = messages_enabled ?? default, }); /// Get info about a group call See Possible codes: 400,403 (details) @@ -7318,6 +7344,23 @@ namespace TL limit = limit, }); + /// See + public static Task Phone_SendGroupCallMessage(this Client client, InputGroupCallBase call, long random_id, TextWithEntities message) + => client.Invoke(new Phone_SendGroupCallMessage + { + call = call, + random_id = random_id, + message = message, + }); + + /// See + public static Task Phone_SendGroupCallEncryptedMessage(this Client client, InputGroupCallBase call, byte[] encrypted_message) + => client.Invoke(new Phone_SendGroupCallEncryptedMessage + { + call = call, + encrypted_message = encrypted_message, + }); + /// Get localization pack strings See Possible codes: 400 (details) /// Platform identifier (i.e. android, tdesktop, etc). /// Either an ISO 639-1 language code or a language pack name obtained from a language pack link. @@ -8359,6 +8402,14 @@ namespace TL.Methods public string mnc; } + [TLDef(0x56E59F9C)] + public sealed partial class Auth_CheckPaidAuth : IMethod + { + public string phone_number; + public string phone_code_hash; + public long form_id; + } + [TLDef(0xEC86017A)] public sealed partial class Account_RegisterDevice : IMethod { @@ -9003,16 +9054,14 @@ namespace TL.Methods public string[] codes; } - [TLDef(0x7CEFA15D)] + [TLDef(0x684D214E)] public sealed partial class Account_UpdateColor : IMethod { public Flags flags; - [IfFlag(2)] public int color; - [IfFlag(0)] public long background_emoji_id; + [IfFlag(2)] public PeerColorBase color; [Flags] public enum Flags : uint { - has_background_emoji_id = 0x1, for_profile = 0x2, has_color = 0x4, } @@ -9256,10 +9305,10 @@ namespace TL.Methods public long hash; } - [TLDef(0xFE74EF9F)] + [TLDef(0xE42CE9C9)] public sealed partial class Account_GetUniqueGiftChatThemes : IMethod { - public int offset; + public string offset; public int limit; public long hash; } @@ -9305,6 +9354,13 @@ namespace TL.Methods public InputDocument[] documents; } + [TLDef(0xFC533372)] + public sealed partial class Users_SuggestBirthday : IMethod + { + public InputUserBase id; + public Birthday birthday; + } + [TLDef(0x7ADC669D)] public sealed partial class Contacts_GetContactIDs : IMethod { @@ -9436,7 +9492,7 @@ namespace TL.Methods public bool enabled; } - [TLDef(0xE8F463D0)] + [TLDef(0xD9BA2E54)] public sealed partial class Contacts_AddContact : IMethod { public Flags flags; @@ -9444,10 +9500,12 @@ namespace TL.Methods public string first_name; public string last_name; public string phone; + [IfFlag(1)] public TextWithEntities note; [Flags] public enum Flags : uint { add_phone_privacy_exception = 0x1, + has_note = 0x2, } } @@ -9528,6 +9586,13 @@ namespace TL.Methods public string q; } + [TLDef(0x139F63FB)] + public sealed partial class Contacts_UpdateContactNote : IMethod + { + public InputUserBase id; + public TextWithEntities note; + } + [TLDef(0x63C66506)] public sealed partial class Messages_GetMessages : IMethod { @@ -11991,6 +12056,98 @@ namespace TL.Methods } } + [TLDef(0x3BA47BFF)] + public sealed partial class Messages_GetForumTopics : IMethod + { + public Flags flags; + public InputPeer peer; + [IfFlag(0)] public string q; + public DateTime offset_date; + public int offset_id; + public int offset_topic; + public int limit; + + [Flags] public enum Flags : uint + { + has_q = 0x1, + } + } + + [TLDef(0xAF0A4A08)] + public sealed partial class Messages_GetForumTopicsByID : IMethod + { + public InputPeer peer; + public int[] topics; + } + + [TLDef(0xCECC1134)] + public sealed partial class Messages_EditForumTopic : IMethod + { + public Flags flags; + public InputPeer peer; + public int topic_id; + [IfFlag(0)] public string title; + [IfFlag(1)] public long icon_emoji_id; + [IfFlag(2)] public bool closed; + [IfFlag(3)] public bool hidden; + + [Flags] public enum Flags : uint + { + has_title = 0x1, + has_icon_emoji_id = 0x2, + has_closed = 0x4, + has_hidden = 0x8, + } + } + + [TLDef(0x175DF251)] + public sealed partial class Messages_UpdatePinnedForumTopic : IMethod + { + public InputPeer peer; + public int topic_id; + public bool pinned; + } + + [TLDef(0x0E7841F0)] + public sealed partial class Messages_ReorderPinnedForumTopics : IMethod + { + public Flags flags; + public InputPeer peer; + public int[] order; + + [Flags] public enum Flags : uint + { + force = 0x1, + } + } + + [TLDef(0x2F98C3D5)] + public sealed partial class Messages_CreateForumTopic : IMethod + { + public Flags flags; + public InputPeer peer; + public string title; + [IfFlag(0)] public int icon_color; + [IfFlag(3)] public long icon_emoji_id; + public long random_id; + [IfFlag(2)] public InputPeer send_as; + + [Flags] public enum Flags : uint + { + has_icon_color = 0x1, + has_send_as = 0x4, + has_icon_emoji_id = 0x8, + title_missing = 0x10, + } + } + + [TLDef(0xD2816F10)] + public sealed partial class Messages_DeleteTopicHistory : IMethod + { + public InputPeer peer; + public int top_msg_id; + } + [TLDef(0xEDD4882A)] public sealed partial class Updates_GetState : IMethod { } @@ -12648,97 +12805,6 @@ namespace TL.Methods public bool tabs; } - [TLDef(0xF40C0224)] - public sealed partial class Channels_CreateForumTopic : IMethod - { - public Flags flags; - public InputChannelBase channel; - public string title; - [IfFlag(0)] public int icon_color; - [IfFlag(3)] public long icon_emoji_id; - public long random_id; - [IfFlag(2)] public InputPeer send_as; - - [Flags] public enum Flags : uint - { - has_icon_color = 0x1, - has_send_as = 0x4, - has_icon_emoji_id = 0x8, - } - } - - [TLDef(0x0DE560D1)] - public sealed partial class Channels_GetForumTopics : IMethod - { - public Flags flags; - public InputChannelBase channel; - [IfFlag(0)] public string q; - public DateTime offset_date; - public int offset_id; - public int offset_topic; - public int limit; - - [Flags] public enum Flags : uint - { - has_q = 0x1, - } - } - - [TLDef(0xB0831EB9)] - public sealed partial class Channels_GetForumTopicsByID : IMethod - { - public InputChannelBase channel; - public int[] topics; - } - - [TLDef(0xF4DFA185)] - public sealed partial class Channels_EditForumTopic : IMethod - { - public Flags flags; - public InputChannelBase channel; - public int topic_id; - [IfFlag(0)] public string title; - [IfFlag(1)] public long icon_emoji_id; - [IfFlag(2)] public bool closed; - [IfFlag(3)] public bool hidden; - - [Flags] public enum Flags : uint - { - has_title = 0x1, - has_icon_emoji_id = 0x2, - has_closed = 0x4, - has_hidden = 0x8, - } - } - - [TLDef(0x6C2D9026)] - public sealed partial class Channels_UpdatePinnedForumTopic : IMethod - { - public InputChannelBase channel; - public int topic_id; - public bool pinned; - } - - [TLDef(0x34435F2D)] - public sealed partial class Channels_DeleteTopicHistory : IMethod - { - public InputChannelBase channel; - public int top_msg_id; - } - - [TLDef(0x2950A18F)] - public sealed partial class Channels_ReorderPinnedForumTopics : IMethod - { - public Flags flags; - public InputChannelBase channel; - public int[] order; - - [Flags] public enum Flags : uint - { - force = 0x1, - } - } - [TLDef(0x68F3E4EB)] public sealed partial class Channels_ToggleAntiSpam : IMethod { @@ -13551,6 +13617,8 @@ namespace TL.Methods has_collection_id = 0x40, exclude_upgradable = 0x80, exclude_unupgradable = 0x100, + peer_color_available = 0x200, + exclude_hosted = 0x400, } } @@ -13925,17 +13993,19 @@ namespace TL.Methods public InputGroupCallBase call; } - [TLDef(0x74BBB43D)] + [TLDef(0xE9723804)] public sealed partial class Phone_ToggleGroupCallSettings : IMethod { public Flags flags; public InputGroupCallBase call; [IfFlag(0)] public bool join_muted; + [IfFlag(2)] public bool messages_enabled; [Flags] public enum Flags : uint { has_join_muted = 0x1, reset_invite_hash = 0x2, + has_messages_enabled = 0x4, } } @@ -14148,6 +14218,21 @@ namespace TL.Methods public int limit; } + [TLDef(0x87893014)] + public sealed partial class Phone_SendGroupCallMessage : IMethod + { + public InputGroupCallBase call; + public long random_id; + public TextWithEntities message; + } + + [TLDef(0xE5AFA56D)] + public sealed partial class Phone_SendGroupCallEncryptedMessage : IMethod + { + public InputGroupCallBase call; + public byte[] encrypted_message; + } + [TLDef(0xF2F2330A)] public sealed partial class Langpack_GetLangPack : IMethod { diff --git a/src/TL.Table.cs b/src/TL.Table.cs index 00b0355..dec7eeb 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 = 214; // fetched 01/09/2025 11:20:56 + public const int Version = 216; // fetched 10/10/2025 20:01:17 internal const int SecretChats = 144; internal const int MTProto2 = 73; internal const uint VectorCtor = 0x1CB5C415; @@ -216,7 +216,7 @@ namespace TL [0x45D5B021] = typeof(MessageActionGiftStars), [0xB00C47A2] = typeof(MessageActionPrizeStars), [0xF24DE7FA] = typeof(MessageActionStarGift), - [0x34F762F3] = typeof(MessageActionStarGiftUnique), + [0x95728543] = typeof(MessageActionStarGiftUnique), [0xAC1F1FCD] = typeof(MessageActionPaidMessagesRefunded), [0x84B88578] = typeof(MessageActionPaidMessagesPrice), [0x2FFE2F7A] = typeof(MessageActionConferenceCall), @@ -226,6 +226,7 @@ namespace TL [0x95DDCF69] = typeof(MessageActionSuggestedPostSuccess), [0x69F916F8] = typeof(MessageActionSuggestedPostRefund), [0xA8A3C699] = typeof(MessageActionGiftTon), + [0x2C8F2A25] = typeof(MessageActionSuggestBirthday), [0xD58A08C6] = typeof(Dialog), [0x71BD134C] = typeof(DialogFolder), [0x2331B22D] = typeof(PhotoEmpty), @@ -240,7 +241,7 @@ namespace TL [0xB2A2F663] = typeof(GeoPoint), [0x5E002502] = typeof(Auth_SentCode), [0x2390FE44] = typeof(Auth_SentCodeSuccess), - [0xD7A2FCF9] = typeof(Auth_SentCodePaymentRequired), + [0xE0955A3C] = typeof(Auth_SentCodePaymentRequired), [0x2EA2C0D4] = typeof(Auth_Authorization), [0x44747E9A] = typeof(Auth_AuthorizationSignUpRequired), [0xB434E2B8] = typeof(Auth_ExportedAuthorization), @@ -254,7 +255,7 @@ namespace TL [0xF47741F7] = typeof(PeerSettings), [0xA437C3ED] = typeof(WallPaper), [0xE0804116] = typeof(WallPaperNoFile), - [0xC577B5AD] = typeof(UserFull), + [0xA02BC13E] = typeof(UserFull), [0x145ADE0B] = typeof(Contact), [0xC13E3C50] = typeof(ImportedContact), [0x16D9703B] = typeof(ContactStatus), @@ -266,8 +267,8 @@ namespace TL [0x15BA6C40] = typeof(Messages_Dialogs), [0x71E094F3] = typeof(Messages_DialogsSlice), [0xF0E3E596] = typeof(Messages_DialogsNotModified), - [0x8C718E87] = typeof(Messages_Messages), - [0x762B263D] = typeof(Messages_MessagesSlice), + [0x1D73E7EA] = typeof(Messages_Messages), + [0x5F206716] = typeof(Messages_MessagesSlice), [0xC776BA4E] = typeof(Messages_ChannelMessages), [0x74535F21] = typeof(Messages_MessagesNotModified), [0x64FF9FD5] = typeof(Messages_Chats), @@ -294,7 +295,7 @@ namespace TL [0x1F2B0AFD] = typeof(UpdateNewMessage), [0x4E90BFD6] = typeof(UpdateMessageID), [0xA20DB0E5] = typeof(UpdateDeleteMessages), - [0xC01E857F] = typeof(UpdateUserTyping), + [0x2A17BF5C] = typeof(UpdateUserTyping), [0x83487AF0] = typeof(UpdateChatUserTyping), [0x07761198] = typeof(UpdateChatParticipants), [0xE5BDF8DE] = typeof(UpdateUserStatus), @@ -311,7 +312,7 @@ namespace TL [0xEBE46819] = typeof(UpdateServiceNotification), [0xEE3B272A] = typeof(UpdatePrivacy), [0x05492A13] = typeof(UpdateUserPhone), - [0x9C974FDF] = typeof(UpdateReadHistoryInbox), + [0x9E84BC99] = typeof(UpdateReadHistoryInbox), [0x2F2F21BF] = typeof(UpdateReadHistoryOutbox), [0x7F891213] = typeof(UpdateWebPage), [0xF8227181] = typeof(UpdateReadMessagesContents), @@ -398,8 +399,6 @@ namespace TL [0x6F7863F4] = typeof(UpdateRecentReactions), [0x86FCCF85] = typeof(UpdateMoveStickerSetToTop), [0xD5A41724] = typeof(UpdateMessageExtendedMedia), - [0x192EFBE3] = typeof(UpdateChannelPinnedTopic), - [0xFE198602] = typeof(UpdateChannelPinnedTopics), [0x20529438] = typeof(UpdateUser), [0xEC05B097] = typeof(UpdateAutoSaveSettings), [0x75B3B798] = typeof(UpdateStory), @@ -436,6 +435,10 @@ namespace TL [0x77B0E372] = typeof(UpdateReadMonoForumInbox), [0xA4A79376] = typeof(UpdateReadMonoForumOutbox), [0x9F812B08] = typeof(UpdateMonoForumNoPaidException), + [0x78C314E0] = typeof(UpdateGroupCallMessage), + [0xC957A766] = typeof(UpdateGroupCallEncryptedMessage), + [0x683B2C52] = typeof(UpdatePinnedForumTopic), + [0xDEF143D0] = typeof(UpdatePinnedForumTopics), [0xA56C2A3E] = typeof(Updates_State), [0x5D75A138] = typeof(Updates_DifferenceEmpty), [0x00F49CA0] = typeof(Updates_Difference), @@ -505,6 +508,7 @@ namespace TL [0xB05AC6B1] = typeof(SendMessageChooseStickerAction), [0x25972BCB] = typeof(SendMessageEmojiInteraction), [0xB665902E] = typeof(SendMessageEmojiInteractionSeen), + [0x376D975C] = typeof(SendMessageTextDraftAction), [0xB3134D9D] = typeof(Contacts_Found), [0x0D09E07B] = typeof(InputPrivacyValueAllowContacts), [0x184B35CE] = typeof(InputPrivacyValueAllowAll), @@ -1082,7 +1086,7 @@ namespace TL [0xC3DFFC04] = typeof(ChatTheme), [0x3458F9C8] = typeof(ChatThemeUniqueGift), [0xE011E1C4] = null,//Account_ChatThemesNotModified - [0x16484857] = typeof(Account_ChatThemes), + [0xBE098173] = typeof(Account_ChatThemes), [0x7DBF8673] = typeof(SponsoredMessage), [0xFFDA656D] = typeof(Messages_SponsoredMessages), [0x1839490F] = null,//Messages_SponsoredMessagesEmpty @@ -1135,6 +1139,8 @@ namespace TL [0xF4997E42] = typeof(InputInvoiceBusinessBotTransferStars), [0xC39F5324] = typeof(InputInvoiceStarGiftResale), [0x9A0B48B8] = typeof(InputInvoiceStarGiftPrepaidUpgrade), + [0x3E77F614] = typeof(InputInvoicePremiumAuthCode), + [0x0923D8D1] = typeof(InputInvoiceStarGiftDropOriginalDetails), [0xAED0CBD9] = typeof(Payments_ExportedInvoice), [0xCFB9D957] = typeof(Messages_TranscribedAudio), [0x5334759C] = typeof(Help_PremiumPromo), @@ -1177,7 +1183,7 @@ namespace TL [0xFCFEB29C] = typeof(StickerKeyword), [0xB4073647] = typeof(Username), [0x023F109B] = typeof(ForumTopicDeleted), - [0x71701DA9] = typeof(ForumTopic), + [0xCDFF0ECA] = typeof(ForumTopic), [0x367617D3] = typeof(Messages_ForumTopics), [0x43B46B20] = typeof(DefaultHistoryTTL), [0x41BF109B] = typeof(ExportedContactToken), @@ -1265,6 +1271,8 @@ namespace TL [0xEDF3ADD0] = typeof(PublicForwardStory), [0x93037E20] = typeof(Stats_PublicForwards), [0xB54B5ACF] = typeof(PeerColor), + [0xB9C0639A] = typeof(PeerColorCollectible), + [0xB8EA86A9] = typeof(InputPeerColorCollectible), [0x26219A58] = typeof(Help_PeerColorSet), [0x767D61EB] = typeof(Help_PeerColorProfileSet), [0xADEC6EBE] = typeof(Help_PeerColorOption), @@ -1368,7 +1376,7 @@ namespace TL [0x94CE852A] = typeof(StarsGiveawayOption), [0x54236209] = typeof(StarsGiveawayWinnersOption), [0x80AC53C3] = typeof(StarGift), - [0x1BEFE865] = typeof(StarGiftUnique), + [0xB0BF741B] = typeof(StarGiftUnique), [0xA388A368] = null,//Payments_StarGiftsNotModified [0x2ED82995] = typeof(Payments_StarGifts), [0x7903E3D9] = typeof(MessageReportOption), @@ -1392,12 +1400,12 @@ namespace TL [0x13ACFF19] = typeof(StarGiftAttributePattern), [0xD93D859C] = typeof(StarGiftAttributeBackdrop), [0xE0BFF26C] = typeof(StarGiftAttributeOriginalDetails), - [0x167BD90B] = typeof(Payments_StarGiftUpgradePreview), + [0x3DE1DFED] = typeof(Payments_StarGiftUpgradePreview), [0x62D706B8] = typeof(Users_Users), [0x315A4974] = typeof(Users_UsersSlice), [0x416C56E8] = typeof(Payments_UniqueStarGift), [0x8C9A88AC] = typeof(Messages_WebPagePreview), - [0x19A9B572] = typeof(SavedStarGift), + [0x8983A452] = typeof(SavedStarGift), [0x95F389B1] = typeof(Payments_SavedStarGifts), [0x69279795] = typeof(InputSavedStarGiftUser), [0xF101AA7F] = typeof(InputSavedStarGiftChat), @@ -1444,6 +1452,7 @@ namespace TL [0x83268483] = null,//InputChatThemeEmpty [0xC93DE95C] = typeof(InputChatTheme), [0x87E5DFE4] = typeof(InputChatThemeUniqueGift), + [0x99EA331D] = typeof(StarGiftUpgradePrice), // from TL.Secret: [0x6ABD9782] = typeof(Layer143.DecryptedMessageMediaDocument), [0x020DF5D0] = typeof(Layer101.MessageEntityBlockquote), diff --git a/src/WTelegramClient.csproj b/src/WTelegramClient.csproj index 6fd580b..906cc13 100644 --- a/src/WTelegramClient.csproj +++ b/src/WTelegramClient.csproj @@ -13,8 +13,8 @@ WTelegramClient Wizou 0.0.0 - layer.214 - Telegram Client API (MTProto) library written 100% in C# and .NET Standard | Latest API layer: 214 + layer.216 + Telegram Client API (MTProto) library written 100% in C# and .NET Standard | Latest API layer: 216 Release Notes: $(ReleaseNotes.Replace("|", "%0D%0A").Replace(" - ","%0D%0A- ").Replace(" ", "%0D%0A%0D%0A"))