Upgrade to layer 146: Invoice extended media

This commit is contained in:
Wizou 2022-09-14 18:33:33 +02:00
parent 1ed10d99af
commit faf8ab3fd0
4 changed files with 64 additions and 6 deletions

View file

@ -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)

View file

@ -351,7 +351,7 @@ namespace TL
public InputGame id;
}
/// <summary>Generated invoice of a <a href="https://corefork.telegram.org/bots/payments">bot payment</a> <para>See <a href="https://corefork.telegram.org/constructor/inputMediaInvoice"/></para></summary>
[TLDef(0xD9799874)]
[TLDef(0x8EB5A6D5)]
public class InputMediaInvoice : InputMedia
{
/// <summary>Flags, see <a href="https://corefork.telegram.org/mtproto/TL-combinators#conditional-fields">TL conditional fields</a></summary>
@ -372,6 +372,7 @@ namespace TL
public DataJSON provider_data;
/// <summary>Unique <a href="https://corefork.telegram.org/api/links#bot-links">bot deep links start parameter</a>. If present, forwarded copies of the sent message will have a URL button with a <a href="https://corefork.telegram.org/api/links#bot-links">deep link</a> 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.</summary>
[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,
/// <summary>Field <see cref="start_param"/> has a value</summary>
has_start_param = 0x2,
/// <summary>Field <see cref="extended_media"/> has a value</summary>
has_extended_media = 0x4,
}
}
/// <summary><a href="https://corefork.telegram.org/api/live-location">Live geolocation</a> <para>See <a href="https://corefork.telegram.org/constructor/inputMediaGeoLive"/></para></summary>
@ -1771,7 +1774,7 @@ namespace TL
public Game game;
}
/// <summary>Invoice <para>See <a href="https://corefork.telegram.org/constructor/messageMediaInvoice"/></para></summary>
[TLDef(0x84551347)]
[TLDef(0xF6A548D3)]
public class MessageMediaInvoice : MessageMedia
{
/// <summary>Flags, see <a href="https://corefork.telegram.org/mtproto/TL-combinators#conditional-fields">TL conditional fields</a></summary>
@ -1790,6 +1793,7 @@ namespace TL
public long total_amount;
/// <summary>Unique bot deep-linking parameter that can be used to generate this invoice</summary>
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,
/// <summary>Whether this is an example invoice</summary>
test = 0x8,
/// <summary>Field <see cref="extended_media"/> has a value</summary>
has_extended_media = 0x10,
}
}
/// <summary>Indicates a <a href="https://corefork.telegram.org/api/live-location">live geolocation</a> <para>See <a href="https://corefork.telegram.org/constructor/messageMediaGeoLive"/></para></summary>
@ -4272,6 +4278,14 @@ namespace TL
emojis = 0x2,
}
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/updateMessageExtendedMedia"/></para></summary>
[TLDef(0x5A73A98C)]
public class UpdateMessageExtendedMedia : Update
{
public Peer peer;
public int msg_id;
public MessageExtendedMediaBase extended_media;
}
/// <summary>Updates state. <para>See <a href="https://corefork.telegram.org/constructor/updates.state"/></para></summary>
[TLDef(0xA56C2A3E)]
@ -13569,4 +13583,30 @@ namespace TL
premium_required = 0x1,
}
}
/// <summary><para>See <a href="https://corefork.telegram.org/type/MessageExtendedMedia"/></para></summary>
public abstract class MessageExtendedMediaBase : IObject { }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/messageExtendedMediaPreview"/></para></summary>
[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,
}
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/messageExtendedMedia"/></para></summary>
[TLDef(0xEE479C64)]
public class MessageExtendedMedia : MessageExtendedMediaBase
{
public MessageMedia media;
}
}

View file

@ -3356,6 +3356,14 @@ namespace TL
{
});
/// <summary><para>See <a href="https://corefork.telegram.org/method/messages.getExtendedMedia"/></para></summary>
public static Task<UpdatesBase> Messages_GetExtendedMedia(this Client client, InputPeer peer, params int[] id)
=> client.Invoke(new Messages_GetExtendedMedia
{
peer = peer,
id = id,
});
/// <summary>Returns a current state of updates. <para>See <a href="https://corefork.telegram.org/method/updates.getState"/> [bots: ✓]</para></summary>
public static Task<Updates_State> Updates_GetState(this Client client)
=> client.Invoke(new Updates_GetState
@ -7616,6 +7624,13 @@ namespace TL.Methods
[TLDef(0x9DFEEFB4)]
public class Messages_ClearRecentReactions : IMethod<bool> { }
[TLDef(0x84F80814)]
public class Messages_GetExtendedMedia : IMethod<UpdatesBase>
{
public InputPeer peer;
public int[] id;
}
[TLDef(0xEDD4882A)]
public class Updates_GetState : IMethod<Updates_State> { }

View file

@ -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),