API Layer 188: Channels_ClickSponsoredMessage, KeyboardButtonCopy, alt_documents

This commit is contained in:
Wizou 2024-09-19 13:34:56 +02:00
parent f0a649c147
commit 6cfa2a4da6
5 changed files with 30 additions and 12 deletions

View file

@ -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 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) [![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) [![Donate](https://img.shields.io/badge/Help_this_project:-Donate-ff4444)](https://buymeacoffee.com/wizou)

View file

@ -1973,7 +1973,7 @@ namespace TL
[TLDef(0x9F84F49E)] [TLDef(0x9F84F49E)]
public sealed partial class MessageMediaUnsupported : MessageMedia { } public sealed partial class MessageMediaUnsupported : MessageMedia { }
/// <summary>Document (video, audio, voice, sticker, any media type except photo) <para>See <a href="https://corefork.telegram.org/constructor/messageMediaDocument"/></para></summary> /// <summary>Document (video, audio, voice, sticker, any media type except photo) <para>See <a href="https://corefork.telegram.org/constructor/messageMediaDocument"/></para></summary>
[TLDef(0x4CF4D72D)] [TLDef(0xDD570BD5)]
public sealed partial class MessageMediaDocument : MessageMedia public sealed partial class MessageMediaDocument : MessageMedia
{ {
/// <summary>Extra bits of information, use <c>flags.HasFlag(...)</c> to test for those</summary> /// <summary>Extra bits of information, use <c>flags.HasFlag(...)</c> to test for those</summary>
@ -1981,7 +1981,7 @@ namespace TL
/// <summary>Attached document</summary> /// <summary>Attached document</summary>
[IfFlag(0)] public DocumentBase document; [IfFlag(0)] public DocumentBase document;
/// <summary>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 <c>document</c>.</summary> /// <summary>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 <c>document</c>.</summary>
[IfFlag(5)] public DocumentBase alt_document; [IfFlag(5)] public DocumentBase[] alt_documents;
/// <summary>Time to live of self-destructing document</summary> /// <summary>Time to live of self-destructing document</summary>
[IfFlag(2)] public int ttl_seconds; [IfFlag(2)] public int ttl_seconds;
@ -1995,8 +1995,8 @@ namespace TL
nopremium = 0x8, nopremium = 0x8,
/// <summary>Whether this media should be hidden behind a spoiler warning</summary> /// <summary>Whether this media should be hidden behind a spoiler warning</summary>
spoiler = 0x10, spoiler = 0x10,
/// <summary>Field <see cref="alt_document"/> has a value</summary> /// <summary>Field <see cref="alt_documents"/> has a value</summary>
has_alt_document = 0x20, has_alt_documents = 0x20,
/// <summary>Whether this is a video.</summary> /// <summary>Whether this is a video.</summary>
video = 0x40, video = 0x40,
/// <summary>Whether this is a round video.</summary> /// <summary>Whether this is a round video.</summary>
@ -6901,7 +6901,7 @@ namespace TL
} }
} }
/// <summary>Defines a video <para>See <a href="https://corefork.telegram.org/constructor/documentAttributeVideo"/></para></summary> /// <summary>Defines a video <para>See <a href="https://corefork.telegram.org/constructor/documentAttributeVideo"/></para></summary>
[TLDef(0x17399FAD)] [TLDef(0x43C57C48)]
public sealed partial class DocumentAttributeVideo : DocumentAttribute public sealed partial class DocumentAttributeVideo : DocumentAttribute
{ {
/// <summary>Extra bits of information, use <c>flags.HasFlag(...)</c> to test for those</summary> /// <summary>Extra bits of information, use <c>flags.HasFlag(...)</c> to test for those</summary>
@ -6916,6 +6916,7 @@ namespace TL
[IfFlag(2)] public int preload_prefix_size; [IfFlag(2)] public int preload_prefix_size;
/// <summary>Floating point UNIX timestamp in seconds, indicating the frame of the video that should be used as static preview and thumbnail.</summary> /// <summary>Floating point UNIX timestamp in seconds, indicating the frame of the video that should be used as static preview and thumbnail.</summary>
[IfFlag(4)] public double video_start_ts; [IfFlag(4)] public double video_start_ts;
[IfFlag(5)] public string video_codec;
[Flags] public enum Flags : uint [Flags] public enum Flags : uint
{ {
@ -6929,6 +6930,8 @@ namespace TL
nosound = 0x8, nosound = 0x8,
/// <summary>Field <see cref="video_start_ts"/> has a value</summary> /// <summary>Field <see cref="video_start_ts"/> has a value</summary>
has_video_start_ts = 0x10, has_video_start_ts = 0x10,
/// <summary>Field <see cref="video_codec"/> has a value</summary>
has_video_codec = 0x20,
} }
} }
/// <summary>Represents an audio file <para>See <a href="https://corefork.telegram.org/constructor/documentAttributeAudio"/></para></summary> /// <summary>Represents an audio file <para>See <a href="https://corefork.telegram.org/constructor/documentAttributeAudio"/></para></summary>
@ -7866,6 +7869,12 @@ namespace TL
/// <summary>Button text</summary> /// <summary>Button text</summary>
public override string Text => text; public override string Text => text;
} }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/keyboardButtonCopy"/></para></summary>
[TLDef(0x75D2698E, inheritBefore = true)]
public sealed partial class KeyboardButtonCopy : KeyboardButton
{
public string copy_text;
}
/// <summary>Inline keyboard row <para>See <a href="https://corefork.telegram.org/constructor/keyboardButtonRow"/></para></summary> /// <summary>Inline keyboard row <para>See <a href="https://corefork.telegram.org/constructor/keyboardButtonRow"/></para></summary>
[TLDef(0x77608B83)] [TLDef(0x77608B83)]

View file

@ -5352,9 +5352,10 @@ namespace TL
/// <summary>Informs the server that the user has either: <para>See <a href="https://corefork.telegram.org/method/channels.clickSponsoredMessage"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/channels.clickSponsoredMessage#possible-errors">details</a>)</para></summary> /// <summary>Informs the server that the user has either: <para>See <a href="https://corefork.telegram.org/method/channels.clickSponsoredMessage"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/channels.clickSponsoredMessage#possible-errors">details</a>)</para></summary>
/// <param name="channel">Channel where the sponsored message was posted</param> /// <param name="channel">Channel where the sponsored message was posted</param>
/// <param name="random_id">Message ID</param> /// <param name="random_id">Message ID</param>
public static Task<bool> Channels_ClickSponsoredMessage(this Client client, InputChannelBase channel, byte[] random_id) public static Task<bool> Channels_ClickSponsoredMessage(this Client client, InputChannelBase channel, byte[] random_id, bool media = false, bool fullscreen = false)
=> client.Invoke(new Channels_ClickSponsoredMessage => client.Invoke(new Channels_ClickSponsoredMessage
{ {
flags = (Channels_ClickSponsoredMessage.Flags)((media ? 0x1 : 0) | (fullscreen ? 0x2 : 0)),
channel = channel, channel = channel,
random_id = random_id, random_id = random_id,
}); });
@ -11570,11 +11571,18 @@ namespace TL.Methods
public bool enabled; public bool enabled;
} }
[TLDef(0x18AFBC93)] [TLDef(0x01445D75)]
public sealed partial class Channels_ClickSponsoredMessage : IMethod<bool> public sealed partial class Channels_ClickSponsoredMessage : IMethod<bool>
{ {
public Flags flags;
public InputChannelBase channel; public InputChannelBase channel;
public byte[] random_id; public byte[] random_id;
[Flags] public enum Flags : uint
{
media = 0x1,
fullscreen = 0x2,
}
} }
[TLDef(0xD8AA3671)] [TLDef(0xD8AA3671)]

View file

@ -6,7 +6,7 @@ namespace TL
{ {
public static partial class Layer 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 SecretChats = 144;
internal const int MTProto2 = 73; internal const int MTProto2 = 73;
internal const uint VectorCtor = 0x1CB5C415; internal const uint VectorCtor = 0x1CB5C415;
@ -155,7 +155,7 @@ namespace TL
[0x56E0D474] = typeof(MessageMediaGeo), [0x56E0D474] = typeof(MessageMediaGeo),
[0x70322949] = typeof(MessageMediaContact), [0x70322949] = typeof(MessageMediaContact),
[0x9F84F49E] = typeof(MessageMediaUnsupported), [0x9F84F49E] = typeof(MessageMediaUnsupported),
[0x4CF4D72D] = typeof(MessageMediaDocument), [0xDD570BD5] = typeof(MessageMediaDocument),
[0xDDF10C3B] = typeof(MessageMediaWebPage), [0xDDF10C3B] = typeof(MessageMediaWebPage),
[0x2EC0533F] = typeof(MessageMediaVenue), [0x2EC0533F] = typeof(MessageMediaVenue),
[0xFDB19008] = typeof(MessageMediaGame), [0xFDB19008] = typeof(MessageMediaGame),
@ -513,7 +513,7 @@ namespace TL
[0x6C37C15C] = typeof(DocumentAttributeImageSize), [0x6C37C15C] = typeof(DocumentAttributeImageSize),
[0x11B58939] = typeof(DocumentAttributeAnimated), [0x11B58939] = typeof(DocumentAttributeAnimated),
[0x6319D612] = typeof(DocumentAttributeSticker), [0x6319D612] = typeof(DocumentAttributeSticker),
[0x17399FAD] = typeof(DocumentAttributeVideo), [0x43C57C48] = typeof(DocumentAttributeVideo),
[0x9852F9C6] = typeof(DocumentAttributeAudio), [0x9852F9C6] = typeof(DocumentAttributeAudio),
[0x15590068] = typeof(DocumentAttributeFilename), [0x15590068] = typeof(DocumentAttributeFilename),
[0x9801D2F7] = typeof(DocumentAttributeHasStickers), [0x9801D2F7] = typeof(DocumentAttributeHasStickers),
@ -573,6 +573,7 @@ namespace TL
[0xA0C0505C] = typeof(KeyboardButtonSimpleWebView), [0xA0C0505C] = typeof(KeyboardButtonSimpleWebView),
[0x53D7BFD8] = typeof(KeyboardButtonRequestPeer), [0x53D7BFD8] = typeof(KeyboardButtonRequestPeer),
[0xC9662D05] = typeof(InputKeyboardButtonRequestPeer), [0xC9662D05] = typeof(InputKeyboardButtonRequestPeer),
[0x75D2698E] = typeof(KeyboardButtonCopy),
[0x77608B83] = typeof(KeyboardButtonRow), [0x77608B83] = typeof(KeyboardButtonRow),
[0xA03E5B85] = typeof(ReplyKeyboardHide), [0xA03E5B85] = typeof(ReplyKeyboardHide),
[0x86B40B08] = typeof(ReplyKeyboardForceReply), [0x86B40B08] = typeof(ReplyKeyboardForceReply),

View file

@ -13,7 +13,7 @@
<PackageId>WTelegramClient</PackageId> <PackageId>WTelegramClient</PackageId>
<Version>0.0.0</Version> <Version>0.0.0</Version>
<Authors>Wizou</Authors> <Authors>Wizou</Authors>
<Description>Telegram Client API (MTProto) library written 100% in C# and .NET Standard | Latest API layer: 187 <Description>Telegram Client API (MTProto) library written 100% in C# and .NET Standard | Latest API layer: 188
Release Notes: Release Notes:
$(ReleaseNotes.Replace("|", "%0D%0A").Replace(" - ","%0D%0A- ").Replace(" ", "%0D%0A%0D%0A"))</Description> $(ReleaseNotes.Replace("|", "%0D%0A").Replace(" - ","%0D%0A- ").Replace(" ", "%0D%0A%0D%0A"))</Description>