From 6cfa2a4da6e82831b5b30fa1cb7ed10e1363c660 Mon Sep 17 00:00:00 2001 From: Wizou <11647984+wiz0u@users.noreply.github.com> Date: Thu, 19 Sep 2024 13:34:56 +0200 Subject: [PATCH] API Layer 188: Channels_ClickSponsoredMessage, KeyboardButtonCopy, alt_documents --- README.md | 2 +- src/TL.Schema.cs | 19 ++++++++++++++----- src/TL.SchemaFuncs.cs | 12 ++++++++++-- src/TL.Table.cs | 7 ++++--- src/WTelegramClient.csproj | 2 +- 5 files changed, 30 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index e8c37d0..4cb2c01 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![API Layer](https://img.shields.io/badge/API_Layer-187-blueviolet)](https://corefork.telegram.org/methods) +[![API Layer](https://img.shields.io/badge/API_Layer-188-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 f5e93e8..bd4506f 100644 --- a/src/TL.Schema.cs +++ b/src/TL.Schema.cs @@ -1973,7 +1973,7 @@ namespace TL [TLDef(0x9F84F49E)] public sealed partial class MessageMediaUnsupported : MessageMedia { } /// Document (video, audio, voice, sticker, any media type except photo) See - [TLDef(0x4CF4D72D)] + [TLDef(0xDD570BD5)] public sealed partial class MessageMediaDocument : MessageMedia { /// Extra bits of information, use flags.HasFlag(...) to test for those @@ -1981,7 +1981,7 @@ namespace TL /// Attached document [IfFlag(0)] public DocumentBase document; /// Currently only used for story videos, may contain an alternative version of the story video, explicitly encoded using H.264 (in MPEG4 transport) at a lower resolution than document. - [IfFlag(5)] public DocumentBase alt_document; + [IfFlag(5)] public DocumentBase[] alt_documents; /// Time to live of self-destructing document [IfFlag(2)] public int ttl_seconds; @@ -1995,8 +1995,8 @@ namespace TL nopremium = 0x8, /// Whether this media should be hidden behind a spoiler warning spoiler = 0x10, - /// Field has a value - has_alt_document = 0x20, + /// Field has a value + has_alt_documents = 0x20, /// Whether this is a video. video = 0x40, /// Whether this is a round video. @@ -6901,7 +6901,7 @@ namespace TL } } /// Defines a video See - [TLDef(0x17399FAD)] + [TLDef(0x43C57C48)] public sealed partial class DocumentAttributeVideo : DocumentAttribute { /// Extra bits of information, use flags.HasFlag(...) to test for those @@ -6916,6 +6916,7 @@ namespace TL [IfFlag(2)] public int preload_prefix_size; /// Floating point UNIX timestamp in seconds, indicating the frame of the video that should be used as static preview and thumbnail. [IfFlag(4)] public double video_start_ts; + [IfFlag(5)] public string video_codec; [Flags] public enum Flags : uint { @@ -6929,6 +6930,8 @@ namespace TL nosound = 0x8, /// Field has a value has_video_start_ts = 0x10, + /// Field has a value + has_video_codec = 0x20, } } /// Represents an audio file See @@ -7866,6 +7869,12 @@ namespace TL /// Button text public override string Text => text; } + /// See + [TLDef(0x75D2698E, inheritBefore = true)] + public sealed partial class KeyboardButtonCopy : KeyboardButton + { + public string copy_text; + } /// Inline keyboard row See [TLDef(0x77608B83)] diff --git a/src/TL.SchemaFuncs.cs b/src/TL.SchemaFuncs.cs index 8ebca1f..9939bdb 100644 --- a/src/TL.SchemaFuncs.cs +++ b/src/TL.SchemaFuncs.cs @@ -5352,9 +5352,10 @@ namespace TL /// Informs the server that the user has either: See Possible codes: 400 (details) /// Channel where the sponsored message was posted /// Message ID - public static Task Channels_ClickSponsoredMessage(this Client client, InputChannelBase channel, byte[] random_id) + public static Task Channels_ClickSponsoredMessage(this Client client, InputChannelBase channel, byte[] random_id, bool media = false, bool fullscreen = false) => client.Invoke(new Channels_ClickSponsoredMessage { + flags = (Channels_ClickSponsoredMessage.Flags)((media ? 0x1 : 0) | (fullscreen ? 0x2 : 0)), channel = channel, random_id = random_id, }); @@ -11570,11 +11571,18 @@ namespace TL.Methods public bool enabled; } - [TLDef(0x18AFBC93)] + [TLDef(0x01445D75)] public sealed partial class Channels_ClickSponsoredMessage : IMethod { + public Flags flags; public InputChannelBase channel; public byte[] random_id; + + [Flags] public enum Flags : uint + { + media = 0x1, + fullscreen = 0x2, + } } [TLDef(0xD8AA3671)] diff --git a/src/TL.Table.cs b/src/TL.Table.cs index 7ceea1f..61ac1cc 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 = 187; // fetched 07/09/2024 00:00:28 + public const int Version = 188; // fetched 19/09/2024 11:16:22 internal const int SecretChats = 144; internal const int MTProto2 = 73; internal const uint VectorCtor = 0x1CB5C415; @@ -155,7 +155,7 @@ namespace TL [0x56E0D474] = typeof(MessageMediaGeo), [0x70322949] = typeof(MessageMediaContact), [0x9F84F49E] = typeof(MessageMediaUnsupported), - [0x4CF4D72D] = typeof(MessageMediaDocument), + [0xDD570BD5] = typeof(MessageMediaDocument), [0xDDF10C3B] = typeof(MessageMediaWebPage), [0x2EC0533F] = typeof(MessageMediaVenue), [0xFDB19008] = typeof(MessageMediaGame), @@ -513,7 +513,7 @@ namespace TL [0x6C37C15C] = typeof(DocumentAttributeImageSize), [0x11B58939] = typeof(DocumentAttributeAnimated), [0x6319D612] = typeof(DocumentAttributeSticker), - [0x17399FAD] = typeof(DocumentAttributeVideo), + [0x43C57C48] = typeof(DocumentAttributeVideo), [0x9852F9C6] = typeof(DocumentAttributeAudio), [0x15590068] = typeof(DocumentAttributeFilename), [0x9801D2F7] = typeof(DocumentAttributeHasStickers), @@ -573,6 +573,7 @@ namespace TL [0xA0C0505C] = typeof(KeyboardButtonSimpleWebView), [0x53D7BFD8] = typeof(KeyboardButtonRequestPeer), [0xC9662D05] = typeof(InputKeyboardButtonRequestPeer), + [0x75D2698E] = typeof(KeyboardButtonCopy), [0x77608B83] = typeof(KeyboardButtonRow), [0xA03E5B85] = typeof(ReplyKeyboardHide), [0x86B40B08] = typeof(ReplyKeyboardForceReply), diff --git a/src/WTelegramClient.csproj b/src/WTelegramClient.csproj index 5aa756e..c8fd8b3 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: 187 + Telegram Client API (MTProto) library written 100% in C# and .NET Standard | Latest API layer: 188 Release Notes: $(ReleaseNotes.Replace("|", "%0D%0A").Replace(" - ","%0D%0A- ").Replace(" ", "%0D%0A%0D%0A"))