From faf8ab3fd035401131dbdd09ab61525a5752e311 Mon Sep 17 00:00:00 2001 From: Wizou <11647984+wiz0u@users.noreply.github.com> Date: Wed, 14 Sep 2022 18:33:33 +0200 Subject: [PATCH] Upgrade to layer 146: Invoice extended media --- README.md | 2 +- src/TL.Schema.cs | 44 +++++++++++++++++++++++++++++++++++++++++-- src/TL.SchemaFuncs.cs | 15 +++++++++++++++ src/TL.Table.cs | 9 ++++++--- 4 files changed, 64 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 0bb1169..ef494fb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ [![NuGet version](https://img.shields.io/nuget/v/WTelegramClient)](https://www.nuget.org/packages/WTelegramClient/) [![Build Status](https://img.shields.io/azure-devops/build/wiz0u/WTelegramClient/7)](https://dev.azure.com/wiz0u/WTelegramClient/_build?definitionId=7) -[![API Layer](https://img.shields.io/badge/API_Layer-145-blueviolet)](https://corefork.telegram.org/methods) +[![API Layer](https://img.shields.io/badge/API_Layer-146-blueviolet)](https://corefork.telegram.org/methods) [![dev nuget](https://img.shields.io/badge/dynamic/json?color=ffc040&label=dev%20nuget&query=%24.versions%5B0%5D&url=https%3A%2F%2Fpkgs.dev.azure.com%2Fwiz0u%2F81bd92b7-0bb9-4701-b426-09090b27e037%2F_packaging%2F46ce0497-7803-4bd4-8c6c-030583e7c371%2Fnuget%2Fv3%2Fflat2%2Fwtelegramclient%2Findex.json)](https://dev.azure.com/wiz0u/WTelegramClient/_artifacts/feed/WTelegramClient/NuGet/WTelegramClient) [![Support Chat](https://img.shields.io/badge/Chat_with_us-on_Telegram-0088cc)](https://t.me/WTelegramClient) [![Donate](https://img.shields.io/badge/Help_this_project:-Donate-ff4444)](http://t.me/WTelegramBot?start=donate) diff --git a/src/TL.Schema.cs b/src/TL.Schema.cs index 4b46231..5a5e58a 100644 --- a/src/TL.Schema.cs +++ b/src/TL.Schema.cs @@ -351,7 +351,7 @@ namespace TL public InputGame id; } /// Generated invoice of a bot payment See - [TLDef(0xD9799874)] + [TLDef(0x8EB5A6D5)] public class InputMediaInvoice : InputMedia { /// Flags, see TL conditional fields @@ -372,6 +372,7 @@ namespace TL public DataJSON provider_data; /// Unique bot deep links start parameter. If present, forwarded copies of the sent message will have a URL button with a deep link to the bot (instead of a Pay button), with the value used as the start parameter. If absent, forwarded copies of the sent message will have a Pay button, allowing multiple users to pay directly from the forwarded message, using the same invoice. [IfFlag(1)] public string start_param; + [IfFlag(2)] public InputMedia extended_media; [Flags] public enum Flags : uint { @@ -379,6 +380,8 @@ namespace TL has_photo = 0x1, /// Field has a value has_start_param = 0x2, + /// Field has a value + has_extended_media = 0x4, } } /// Live geolocation See @@ -1771,7 +1774,7 @@ namespace TL public Game game; } /// Invoice See - [TLDef(0x84551347)] + [TLDef(0xF6A548D3)] public class MessageMediaInvoice : MessageMedia { /// Flags, see TL conditional fields @@ -1790,6 +1793,7 @@ namespace TL public long total_amount; /// Unique bot deep-linking parameter that can be used to generate this invoice public string start_param; + [IfFlag(4)] public MessageExtendedMediaBase extended_media; [Flags] public enum Flags : uint { @@ -1801,6 +1805,8 @@ namespace TL has_receipt_msg_id = 0x4, /// Whether this is an example invoice test = 0x8, + /// Field has a value + has_extended_media = 0x10, } } /// Indicates a live geolocation See @@ -4272,6 +4278,14 @@ namespace TL emojis = 0x2, } } + /// See + [TLDef(0x5A73A98C)] + public class UpdateMessageExtendedMedia : Update + { + public Peer peer; + public int msg_id; + public MessageExtendedMediaBase extended_media; + } /// Updates state. See [TLDef(0xA56C2A3E)] @@ -13569,4 +13583,30 @@ namespace TL premium_required = 0x1, } } + + /// See + public abstract class MessageExtendedMediaBase : IObject { } + /// See + [TLDef(0xAD628CC8)] + public class MessageExtendedMediaPreview : MessageExtendedMediaBase + { + public Flags flags; + [IfFlag(0)] public int w; + [IfFlag(0)] public int h; + [IfFlag(1)] public PhotoSizeBase thumb; + [IfFlag(2)] public int video_duration; + + [Flags] public enum Flags : uint + { + has_w = 0x1, + has_thumb = 0x2, + has_video_duration = 0x4, + } + } + /// See + [TLDef(0xEE479C64)] + public class MessageExtendedMedia : MessageExtendedMediaBase + { + public MessageMedia media; + } } diff --git a/src/TL.SchemaFuncs.cs b/src/TL.SchemaFuncs.cs index 86fded4..9334043 100644 --- a/src/TL.SchemaFuncs.cs +++ b/src/TL.SchemaFuncs.cs @@ -3356,6 +3356,14 @@ namespace TL { }); + /// See + public static Task Messages_GetExtendedMedia(this Client client, InputPeer peer, params int[] id) + => client.Invoke(new Messages_GetExtendedMedia + { + peer = peer, + id = id, + }); + /// Returns a current state of updates. See [bots: ✓] public static Task Updates_GetState(this Client client) => client.Invoke(new Updates_GetState @@ -7616,6 +7624,13 @@ namespace TL.Methods [TLDef(0x9DFEEFB4)] public class Messages_ClearRecentReactions : IMethod { } + [TLDef(0x84F80814)] + public class Messages_GetExtendedMedia : IMethod + { + public InputPeer peer; + public int[] id; + } + [TLDef(0xEDD4882A)] public class Updates_GetState : IMethod { } diff --git a/src/TL.Table.cs b/src/TL.Table.cs index fba7357..df81f71 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 = 145; // fetched 02/09/2022 20:50:42 + public const int Version = 146; // fetched 14/09/2022 16:18:39 internal const uint VectorCtor = 0x1CB5C415; internal const uint NullCtor = 0x56730BCC; internal const uint RpcResultCtor = 0xF35C6D01; @@ -91,7 +91,7 @@ namespace TL [0xE5BBFE1A] = typeof(InputMediaPhotoExternal), [0xFB52DC99] = typeof(InputMediaDocumentExternal), [0xD33F43F3] = typeof(InputMediaGame), - [0xD9799874] = typeof(InputMediaInvoice), + [0x8EB5A6D5] = typeof(InputMediaInvoice), [0x971FA843] = typeof(InputMediaGeoLive), [0x0F94E5F1] = typeof(InputMediaPoll), [0xE66FBF7B] = typeof(InputMediaDice), @@ -151,7 +151,7 @@ namespace TL [0xA32DD600] = typeof(MessageMediaWebPage), [0x2EC0533F] = typeof(MessageMediaVenue), [0xFDB19008] = typeof(MessageMediaGame), - [0x84551347] = typeof(MessageMediaInvoice), + [0xF6A548D3] = typeof(MessageMediaInvoice), [0xB940C666] = typeof(MessageMediaGeoLive), [0x4BD6E798] = typeof(MessageMediaPoll), [0x3F7EE58B] = typeof(MessageMediaDice), @@ -356,6 +356,7 @@ namespace TL [0x30F443DB] = typeof(UpdateRecentEmojiStatuses), [0x6F7863F4] = typeof(UpdateRecentReactions), [0x86FCCF85] = typeof(UpdateMoveStickerSetToTop), + [0x5A73A98C] = typeof(UpdateMessageExtendedMedia), [0xA56C2A3E] = typeof(Updates_State), [0x5D75A138] = typeof(Updates_DifferenceEmpty), [0x00F49CA0] = typeof(Updates_Difference), @@ -1022,6 +1023,8 @@ namespace TL [0xE1BB0D61] = typeof(Account_EmailVerifiedLogin), [0xB6F11EBE] = typeof(PremiumSubscriptionOption), [0xB81C7034] = typeof(SendAsPeer), + [0xAD628CC8] = typeof(MessageExtendedMediaPreview), + [0xEE479C64] = typeof(MessageExtendedMedia), // from TL.Secret: [0xBB718624] = typeof(Layer66.SendMessageUploadRoundAction), [0xE50511D8] = typeof(Layer45.DecryptedMessageMediaWebPage),