From 288bf7ccf71bf4f1cfbbc6d2239083496f956ff9 Mon Sep 17 00:00:00 2001 From: Wizou <11647984+wiz0u@users.noreply.github.com> Date: Sun, 18 Feb 2024 17:00:49 +0100 Subject: [PATCH] API Layer 174: Group boosts & emoji set --- .github/dev.yml | 2 +- README.md | 2 +- src/TL.Schema.cs | 71 ++++++++++++++++++++++++++------------ src/TL.SchemaFuncs.cs | 56 +++++++++++++++++++++++------- src/TL.Table.cs | 16 +++++---- src/WTelegramClient.csproj | 4 +-- 6 files changed, 104 insertions(+), 47 deletions(-) diff --git a/.github/dev.yml b/.github/dev.yml index eb3a62f..1884efe 100644 --- a/.github/dev.yml +++ b/.github/dev.yml @@ -1,7 +1,7 @@ pr: none trigger: [ master ] -name: 3.6.6-dev.$(Rev:r) +name: 3.6.7-dev.$(Rev:r) pool: vmImage: ubuntu-latest diff --git a/README.md b/README.md index f987c28..453c103 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![API Layer](https://img.shields.io/badge/API_Layer-173-blueviolet)](https://corefork.telegram.org/methods) +[![API Layer](https://img.shields.io/badge/API_Layer-174-blueviolet)](https://corefork.telegram.org/methods) [![NuGet version](https://img.shields.io/nuget/v/WTelegramClient?color=00508F)](https://www.nuget.org/packages/WTelegramClient/) [![NuGet prerelease](https://img.shields.io/nuget/vpre/WTelegramClient?color=C09030&label=dev+nuget)](https://www.nuget.org/packages/WTelegramClient/absoluteLatest) [![Donate](https://img.shields.io/badge/Help_this_project:-Donate-ff4444)](https://www.buymeacoffee.com/wizou) diff --git a/src/TL.Schema.cs b/src/TL.Schema.cs index 4705bc2..045905a 100644 --- a/src/TL.Schema.cs +++ b/src/TL.Schema.cs @@ -1322,7 +1322,7 @@ namespace TL public override ChatReactions AvailableReactions => available_reactions; } /// Full info about a channel, supergroup or gigagroup. See - [TLDef(0x0F2BCB6F)] + [TLDef(0x44C054A7)] public partial class ChannelFull : ChatFullBase { /// Extra bits of information, use flags.HasFlag(...) to test for those @@ -1403,6 +1403,9 @@ namespace TL [IfFlag(36)] public PeerStories stories; /// Wallpaper [IfFlag(39)] public WallPaperBase wallpaper; + [IfFlag(40)] public int boosts_applied; + [IfFlag(41)] public int boosts_unrestrict; + [IfFlag(42)] public StickerSet emojiset; [Flags] public enum Flags : uint { @@ -1488,6 +1491,12 @@ namespace TL view_forum_as_messages = 0x40, /// Field has a value has_wallpaper = 0x80, + /// Field has a value + has_boosts_applied = 0x100, + /// Field has a value + has_boosts_unrestrict = 0x200, + /// Field has a value + has_emojiset = 0x400, } /// ID of the channel @@ -1661,7 +1670,7 @@ namespace TL public override Peer Peer => peer_id; } /// A message See - [TLDef(0x76BEC211)] + [TLDef(0x1E4C8A69)] public partial class Message : MessageBase { /// Extra bits of information, use flags.HasFlag(...) to test for those @@ -1670,6 +1679,7 @@ namespace TL public int id; /// ID of the sender of the message [IfFlag(8)] public Peer from_id; + [IfFlag(29)] public int from_boosts_applied; /// Peer ID, the chat where this message was sent public Peer peer_id; /// Messages fetched from a saved messages dialog » will have peer= and the saved_peer_id flag set to the ID of the saved dialog.
@@ -1765,6 +1775,8 @@ namespace TL invert_media = 0x8000000, /// Field has a value has_saved_peer_id = 0x10000000, + /// Field has a value + has_from_boosts_applied = 0x20000000, } /// ID of the message @@ -2583,6 +2595,12 @@ namespace TL /// Number of undistributed prizes public int unclaimed_count; } + /// See + [TLDef(0xCC02AA6D)] + public class MessageActionBoostApply : MessageAction + { + public int boosts; + } /// Chat info. See Derived classes: , public abstract class DialogBase : IObject @@ -8611,11 +8629,11 @@ namespace TL [IfFlag(4)] public Peer saved_from_peer; /// Only for messages forwarded to saved messages », contains the original ID of the message in saved_from_peer. [IfFlag(4)] public int saved_from_msg_id; - /// Only for forwarded messages reforwarded to saved messages », contains the sender of the original message (i.e. if user A sends a message, then user B forwards it somewhere, then user C saves it to saved messages, this field will contain the ID of user A and from_id will contain the ID of user B). + /// Only for forwarded messages reforwarded to saved messages », contains the sender of the original message (i.e. if user A sends a message, then user B forwards it somewhere, then user C saves it to saved messages, this field will contain the ID of user B and from_id will contain the ID of user A). [IfFlag(8)] public Peer saved_from_id; - /// Only for forwarded messages from users with forward privacy enabled reforwarded to saved messages », contains the sender of the original message (i.e. if user A (fwd privacy enabled) sends a message, then user B forwards it somewhere, then user C saves it to saved messages, this field will contain the name of user A and from_id will contain the ID of user B). + /// Only for forwarded messages from users with forward privacy enabled, sent by users with forward privacy enabled, reforwarded to saved messages », contains the sender of the original message (i.e. if user A (fwd privacy enabled) sends a message, then user B (fwd privacy enabled) forwards it somewhere, then user C saves it to saved messages, this field will contain the name of user B and from_name will contain the name of user A). [IfFlag(9)] public string saved_from_name; - /// Only for forwarded messages reforwarded to saved messages », indicates when was the original message sent (i.e. if user A sends a message @ unixtime 1, then user B forwards it somewhere @ unixtime 2, then user C saves it to saved messages @ unixtime 3, this field will contain 1, date will contain 2 and the date of the containing will contain 3). + /// Only for forwarded messages reforwarded to saved messages », indicates when was the original message sent (i.e. if user A sends a message @ unixtime 1, then user B forwards it somewhere @ unixtime 2, then user C saves it to saved messages @ unixtime 3, this field will contain 2, date will contain 1 and the date of the containing will contain 3). [IfFlag(10)] public DateTime saved_date; /// PSA type [IfFlag(6)] public string psa_type; @@ -11067,6 +11085,9 @@ namespace TL /// New emoji status public EmojiStatus new_value; } + /// See + [TLDef(0x46D840AB)] + public class ChannelAdminLogEventActionChangeEmojiStickerSet : ChannelAdminLogEventActionChangeStickerSet { } /// Admin log event See [TLDef(0x1FAD68CD)] @@ -13608,11 +13629,10 @@ namespace TL } } /// Represents a reply to a story See - [TLDef(0x9C98BFC1)] + [TLDef(0x0E5AF939)] public class MessageReplyStoryHeader : MessageReplyHeaderBase { - /// ID of the user that posted a story - public long user_id; + public Peer peer; /// Story ID public int story_id; } @@ -15503,28 +15523,28 @@ namespace TL public JsonObject config; } - /// Used to fetch information about a named Mini App See Derived classes: , + /// Used to fetch information about a direct link Mini App See Derived classes: , public abstract class InputBotApp : IObject { } - /// Used to fetch information about a named Mini App by its ID See + /// Used to fetch information about a direct link Mini App by its ID See [TLDef(0xA920BD7A)] public class InputBotAppID : InputBotApp { - /// named Mini App ID. + /// direct link Mini App ID. public long id; /// REQUIRED FIELD. See how to obtain it
Access hash, obtained from the .
public long access_hash; } - /// Used to fetch information about a named Mini App by its short name See + /// Used to fetch information about a direct link Mini App by its short name See [TLDef(0x908C0407)] public class InputBotAppShortName : InputBotApp { /// ID of the bot that owns the bot mini app public InputUserBase bot_id; - /// Short name, obtained from a named Mini App deep link + /// Short name, obtained from a Direct Mini App deep link public string short_name; } - /// Contains information about a named Mini App. See + /// Contains information about a direct link Mini App. See /// a value means botAppNotModified [TLDef(0x95FCD1D6)] public class BotApp : IObject @@ -15535,7 +15555,7 @@ namespace TL public long id; /// bot mini app access hash public long access_hash; - /// bot mini app short name, used to generate named Mini App deep links. + /// bot mini app short name, used to generate Direct Mini App deep links. public string short_name; /// bot mini app title. public string title; @@ -15555,7 +15575,7 @@ namespace TL } } - /// Contains information about a named Mini App See + /// Contains information about a direct link Mini App See [TLDef(0xEB50ADF5)] public class Messages_BotApp : IObject { @@ -15575,9 +15595,9 @@ namespace TL } } - /// Contains the link that must be used to open a named Mini App. See Derived classes: + /// Contains the link that must be used to open a direct link Mini App. See Derived classes: public abstract class AppWebViewResult : IObject { } - /// Contains the link that must be used to open a named Mini App. See + /// Contains the link that must be used to open a direct link Mini App. See [TLDef(0x3C1B4F0D)] public class AppWebViewResultUrl : AppWebViewResult { @@ -15890,7 +15910,7 @@ namespace TL public override int ID => id; } /// Represents a story. See - [TLDef(0xAF6365A1)] + [TLDef(0x79B26A24)] public class StoryItem : StoryItemBase { /// Extra bits of information, use flags.HasFlag(...) to test for those @@ -15899,6 +15919,7 @@ namespace TL public int id; /// When was the story posted. public DateTime date; + [IfFlag(18)] public Peer from_id; /// For reposted stories », contains info about the original story. [IfFlag(17)] public StoryFwdHeader fwd_from; /// When does the story expire. @@ -15952,6 +15973,8 @@ namespace TL out_ = 0x10000, /// Field has a value has_fwd_from = 0x20000, + /// Field has a value + has_from_id = 0x40000, } /// ID of the story. @@ -16159,11 +16182,10 @@ namespace TL } } /// Reply to a story. See - [TLDef(0x15B0F283)] + [TLDef(0x5881323A)] public class InputReplyToStory : InputReplyTo { - /// ID of the user that posted the story. - public InputUserBase user_id; + public InputPeer peer; /// ID of the story to reply to. public int story_id; } @@ -16780,7 +16802,7 @@ namespace TL } /// Contains info about a color palette ». See - [TLDef(0xEF8430AB)] + [TLDef(0xADEC6EBE)] public class Help_PeerColorOption : IObject { /// Extra bits of information, use flags.HasFlag(...) to test for those @@ -16793,6 +16815,7 @@ namespace TL [IfFlag(2)] public Help_PeerColorSetBase dark_colors; /// Channels can use this palette only after reaching at least the boost level specified in this field. [IfFlag(3)] public int channel_min_level; + [IfFlag(4)] public int group_min_level; [Flags] public enum Flags : uint { @@ -16804,6 +16827,8 @@ namespace TL has_dark_colors = 0x4, /// Field has a value has_channel_min_level = 0x8, + /// Field has a value + has_group_min_level = 0x10, } } diff --git a/src/TL.SchemaFuncs.cs b/src/TL.SchemaFuncs.cs index 9dd8160..dbbc531 100644 --- a/src/TL.SchemaFuncs.cs +++ b/src/TL.SchemaFuncs.cs @@ -642,7 +642,7 @@ namespace TL public_key = public_key, }); - /// Sends a Telegram Passport authorization form, effectively sharing data with the service See + /// Sends a Telegram Passport authorization form, effectively sharing data with the service See Possible codes: 400 (details) /// Bot ID /// Telegram Passport element types requested by the service /// Service's public key @@ -1235,7 +1235,7 @@ namespace TL hash = hash, }); - /// Use this method to obtain the online statuses of all contacts with an accessible associated Telegram account. See + /// Use this method to obtain the online statuses of all contacts with an accessible Telegram account. See public static Task Contacts_GetStatuses(this Client client) => client.Invoke(new Contacts_GetStatuses { @@ -3625,7 +3625,7 @@ namespace TL id = id, }); - /// Changes the default value of the Time-To-Live setting, applied to all new chats. See [bots: ✓] + /// Changes the default value of the Time-To-Live setting, applied to all new chats. See [bots: ✓] Possible codes: 400 (details) /// The new default Time-To-Live of all messages sent in new chats. public static Task Messages_SetDefaultHistoryTTL(this Client client, int period) => client.Invoke(new Messages_SetDefaultHistoryTTL @@ -3701,8 +3701,8 @@ namespace TL peer = peer, }); - /// Obtain information about a named Mini App See Possible codes: 400 (details) - /// Bot app information obtained from a named Mini App deep link ». + /// Obtain information about a direct link Mini App See Possible codes: 400 (details) + /// Bot app information obtained from a Direct Mini App deep link ». /// Hash for pagination, for more info click here public static Task Messages_GetBotApp(this Client client, InputBotApp app, long hash = default) => client.Invoke(new Messages_GetBotApp @@ -3711,11 +3711,11 @@ namespace TL hash = hash, }); - /// Open a bot mini app from a named Mini App deep link, sending over user information after user confirmation. See Possible codes: 400 (details) - /// Set this flag if the bot is asking permission to send messages to the user as specified in the named Mini App deep link docs, and the user agreed. + /// Open a bot mini app from a direct Mini App deep link, sending over user information after user confirmation. See Possible codes: 400 (details) + /// Set this flag if the bot is asking permission to send messages to the user as specified in the direct Mini App deep link docs, and the user agreed. /// If the client has clicked on the link in a Telegram chat, pass the chat's peer information; otherwise pass the bot's peer information, instead. - /// The app obtained by invoking Messages_GetBotApp as specified in the named Mini App deep link docs. - /// If the startapp query string parameter is present in the named Mini App deep link, pass it to start_param. + /// The app obtained by invoking Messages_GetBotApp as specified in the direct Mini App deep link docs. + /// If the startapp query string parameter is present in the direct Mini App deep link, pass it to start_param. /// Theme parameters » /// Short name of the application; 0-64 English letters, digits, and underscores public static Task Messages_RequestAppWebView(this Client client, InputPeer peer, InputBotApp app, string platform, string start_param = null, DataJSON theme_params = null, bool write_allowed = false) @@ -4812,7 +4812,7 @@ namespace TL hidden = hidden.GetValueOrDefault(), }); - /// Pin or unpin forum topics See [bots: ✓] + /// Pin or unpin forum topics See [bots: ✓] Possible codes: 400 (details) /// Supergroup ID /// Forum topic ID /// Whether to pin or unpin the topic @@ -4928,6 +4928,22 @@ namespace TL emoji_status = emoji_status, }); + /// See + public static Task Channels_SetBoostsToUnblockRestrictions(this Client client, InputChannelBase channel, int boosts) + => client.Invoke(new Channels_SetBoostsToUnblockRestrictions + { + channel = channel, + boosts = boosts, + }); + + /// See + public static Task Channels_SetEmojiStickers(this Client client, InputChannelBase channel, InputStickerSet stickerset) + => client.Invoke(new Channels_SetEmojiStickers + { + channel = channel, + stickerset = stickerset, + }); + /// Sends a custom request; for bots only See [bots: ✓] Possible codes: 400,403 (details) /// The method name /// JSON-serialized method parameters @@ -5941,7 +5957,7 @@ namespace TL chatlist = chatlist, }); - /// Join channels and supergroups recently added to a chat folder deep link ». See [bots: ✓] + /// Join channels and supergroups recently added to a chat folder deep link ». See [bots: ✓] Possible codes: 400 (details) /// The folder /// List of new chats to join, fetched using Chatlists_GetChatlistUpdates and filtered as specified in the documentation ». public static Task Chatlists_JoinChatlistUpdates(this Client client, InputChatlist chatlist, params InputPeer[] peers) @@ -5951,7 +5967,7 @@ namespace TL peers = peers, }); - /// Dismiss new pending peers recently added to a chat folder deep link ». See [bots: ✓] + /// Dismiss new pending peers recently added to a chat folder deep link ». See [bots: ✓] Possible codes: 400 (details) /// The folder public static Task Chatlists_HideChatlistUpdates(this Client client, InputChatlist chatlist) => client.Invoke(new Chatlists_HideChatlistUpdates @@ -5959,7 +5975,7 @@ namespace TL chatlist = chatlist, }); - /// Returns identifiers of pinned or always included chats from a chat folder imported using a chat folder deep link », which are suggested to be left when the chat folder is deleted. See [bots: ✓] + /// Returns identifiers of pinned or always included chats from a chat folder imported using a chat folder deep link », which are suggested to be left when the chat folder is deleted. See [bots: ✓] Possible codes: 400 (details) /// Folder ID public static Task Chatlists_GetLeaveChatlistSuggestions(this Client client, InputChatlist chatlist) => client.Invoke(new Chatlists_GetLeaveChatlistSuggestions @@ -10332,6 +10348,20 @@ namespace TL.Methods public EmojiStatus emoji_status; } + [TLDef(0xAD399CEE)] + public class Channels_SetBoostsToUnblockRestrictions : IMethod + { + public InputChannelBase channel; + public int boosts; + } + + [TLDef(0x3CD930B7)] + public class Channels_SetEmojiStickers : IMethod + { + public InputChannelBase channel; + public InputStickerSet stickerset; + } + [TLDef(0xAA2769ED)] public class Bots_SendCustomRequest : IMethod { diff --git a/src/TL.Table.cs b/src/TL.Table.cs index 29cd3e4..6f7bf7b 100644 --- a/src/TL.Table.cs +++ b/src/TL.Table.cs @@ -6,7 +6,7 @@ namespace TL { public static class Layer { - public const int Version = 173; // fetched 01/02/2024 20:25:01 + public const int Version = 174; // fetched 18/02/2024 15:53:49 internal const int SecretChats = 144; internal const int MTProto2 = 73; internal const uint VectorCtor = 0x1CB5C415; @@ -136,7 +136,7 @@ namespace TL [0x0AADFC8F] = typeof(Channel), [0x17D493D5] = typeof(ChannelForbidden), [0xC9D31138] = typeof(ChatFull), - [0x0F2BCB6F] = typeof(ChannelFull), + [0x44C054A7] = typeof(ChannelFull), [0xC02D4007] = typeof(ChatParticipant), [0xE46BCEE4] = typeof(ChatParticipantCreator), [0xA0933F5B] = typeof(ChatParticipantAdmin), @@ -145,7 +145,7 @@ namespace TL [0x37C1011C] = null,//ChatPhotoEmpty [0x1C6E1C11] = typeof(ChatPhoto), [0x90A6CA84] = typeof(MessageEmpty), - [0x76BEC211] = typeof(Message), + [0x1E4C8A69] = typeof(Message), [0x2B085862] = typeof(MessageService), [0x3DED6320] = null,//MessageMediaEmpty [0x695150D7] = typeof(MessageMediaPhoto), @@ -204,6 +204,7 @@ namespace TL [0x678C2E09] = typeof(MessageActionGiftCode), [0x332BA9ED] = typeof(MessageActionGiveawayLaunch), [0x2A9FADC5] = typeof(MessageActionGiveawayResults), + [0xCC02AA6D] = typeof(MessageActionBoostApply), [0xD58A08C6] = typeof(Dialog), [0x71BD134C] = typeof(DialogFolder), [0x2331B22D] = typeof(PhotoEmpty), @@ -805,6 +806,7 @@ namespace TL [0x5E477B25] = typeof(ChannelAdminLogEventActionChangeProfilePeerColor), [0x31BB5D52] = typeof(ChannelAdminLogEventActionChangeWallpaper), [0x3EA9FEB1] = typeof(ChannelAdminLogEventActionChangeEmojiStatus), + [0x46D840AB] = typeof(ChannelAdminLogEventActionChangeEmojiStickerSet), [0x1FAD68CD] = typeof(ChannelAdminLogEvent), [0xED8AF74D] = typeof(Channels_AdminLogResults), [0xEA107AE4] = typeof(ChannelAdminLogEventsFilter), @@ -972,7 +974,7 @@ namespace TL [0xB6C4F543] = typeof(Messages_MessageViews), [0xA6341782] = typeof(Messages_DiscussionMessage), [0xAFBC09DB] = typeof(MessageReplyHeader), - [0x9C98BFC1] = typeof(MessageReplyStoryHeader), + [0x0E5AF939] = typeof(MessageReplyStoryHeader), [0x83D60FC2] = typeof(MessageReplies), [0xE8FD8014] = typeof(PeerBlocked), [0x7FE91C14] = typeof(Stats_MessageStats), @@ -1131,7 +1133,7 @@ namespace TL [0x8D595CD6] = typeof(StoryViews), [0x51E6EE4F] = typeof(StoryItemDeleted), [0xFFADC913] = typeof(StoryItemSkipped), - [0xAF6365A1] = typeof(StoryItem), + [0x79B26A24] = typeof(StoryItem), [0x1158FE3E] = typeof(Stories_AllStoriesNotModified), [0x6EFC5E81] = typeof(Stories_AllStories), [0x5DD8C3C8] = typeof(Stories_Stories), @@ -1141,7 +1143,7 @@ namespace TL [0x59D78FC5] = typeof(Stories_StoryViewsList), [0xDE9EED1D] = typeof(Stories_StoryViews), [0x22C0F6D5] = typeof(InputReplyToMessage), - [0x15B0F283] = typeof(InputReplyToStory), + [0x5881323A] = typeof(InputReplyToStory), [0x3FC9053B] = typeof(ExportedStoryLink), [0x712E27FD] = typeof(StoriesStealthMode), [0x03D1EA4E] = typeof(MediaAreaCoordinates), @@ -1174,7 +1176,7 @@ namespace TL [0xB54B5ACF] = typeof(PeerColor), [0x26219A58] = typeof(Help_PeerColorSet), [0x767D61EB] = typeof(Help_PeerColorProfileSet), - [0xEF8430AB] = typeof(Help_PeerColorOption), + [0xADEC6EBE] = typeof(Help_PeerColorOption), [0x2BA1F5CE] = null,//Help_PeerColorsNotModified [0x00F8ED08] = typeof(Help_PeerColors), [0x6090D6D5] = typeof(StoryReaction), diff --git a/src/WTelegramClient.csproj b/src/WTelegramClient.csproj index 22c7c65..bead803 100644 --- a/src/WTelegramClient.csproj +++ b/src/WTelegramClient.csproj @@ -13,7 +13,7 @@ WTelegramClient 0.0.0 Wizou - Telegram Client API (MTProto) library written 100% in C# and .NET Standard | Latest API layer: 173 Release Notes: $(ReleaseNotes.Replace("|", "%0D%0A").Replace(" - ","%0D%0A- ").Replace(" ", "%0D%0A%0D%0A")) + Telegram Client API (MTProto) library written 100% in C# and .NET Standard | Latest API layer: 174 Release Notes: $(ReleaseNotes.Replace("|", "%0D%0A").Replace(" - ","%0D%0A- ").Replace(" ", "%0D%0A%0D%0A")) Copyright © Olivier Marcoux 2021-2024 MIT https://github.com/wiz0u/WTelegramClient @@ -21,7 +21,7 @@ true https://github.com/wiz0u/WTelegramClient.git git - Telegram;MTProto;Client;Api;UserBot;TLSharp + Telegram;MTProto;Client;Api;UserBot README.md $(ReleaseNotes.Replace("|", "%0D%0A").Replace(" - ","%0D%0A- ").Replace(" ", "%0D%0A%0D%0A")) 0419;1573;1591;NETSDK1138