Skip to content

Commit

Permalink
API Layer 188: Channels_ClickSponsoredMessage, KeyboardButtonCopy, al…
Browse files Browse the repository at this point in the history
…t_documents
  • Loading branch information
wiz0u committed Sep 19, 2024
1 parent f0a649c commit 6cfa2a4
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
19 changes: 14 additions & 5 deletions src/TL.Schema.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1973,15 +1973,15 @@ public sealed partial class MessageMediaContact : MessageMedia
[TLDef(0x9F84F49E)]
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>
[TLDef(0x4CF4D72D)]
[TLDef(0xDD570BD5)]
public sealed partial class MessageMediaDocument : MessageMedia
{
/// <summary>Extra bits of information, use <c>flags.HasFlag(...)</c> to test for those</summary>
public Flags flags;
/// <summary>Attached document</summary>
[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>
[IfFlag(5)] public DocumentBase alt_document;
[IfFlag(5)] public DocumentBase[] alt_documents;
/// <summary>Time to live of self-destructing document</summary>
[IfFlag(2)] public int ttl_seconds;

Expand All @@ -1995,8 +1995,8 @@ public sealed partial class MessageMediaDocument : MessageMedia
nopremium = 0x8,
/// <summary>Whether this media should be hidden behind a spoiler warning</summary>
spoiler = 0x10,
/// <summary>Field <see cref="alt_document"/> has a value</summary>
has_alt_document = 0x20,
/// <summary>Field <see cref="alt_documents"/> has a value</summary>
has_alt_documents = 0x20,
/// <summary>Whether this is a video.</summary>
video = 0x40,
/// <summary>Whether this is a round video.</summary>
Expand Down Expand Up @@ -6901,7 +6901,7 @@ public sealed partial class DocumentAttributeSticker : DocumentAttribute
}
}
/// <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
{
/// <summary>Extra bits of information, use <c>flags.HasFlag(...)</c> to test for those</summary>
Expand All @@ -6916,6 +6916,7 @@ public sealed partial class DocumentAttributeVideo : DocumentAttribute
[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>
[IfFlag(4)] public double video_start_ts;
[IfFlag(5)] public string video_codec;

[Flags] public enum Flags : uint
{
Expand All @@ -6929,6 +6930,8 @@ public sealed partial class DocumentAttributeVideo : DocumentAttribute
nosound = 0x8,
/// <summary>Field <see cref="video_start_ts"/> has a value</summary>
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>
Expand Down Expand Up @@ -7866,6 +7869,12 @@ public sealed partial class InputKeyboardButtonRequestPeer : KeyboardButtonBase
/// <summary>Button text</summary>
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>
[TLDef(0x77608B83)]
Expand Down
12 changes: 10 additions & 2 deletions src/TL.SchemaFuncs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5352,9 +5352,10 @@ public static Task<UpdatesBase> Channels_ToggleParticipantsHidden(this Client cl
/// <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="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
{
flags = (Channels_ClickSponsoredMessage.Flags)((media ? 0x1 : 0) | (fullscreen ? 0x2 : 0)),
channel = channel,
random_id = random_id,
});
Expand Down Expand Up @@ -11570,11 +11571,18 @@ public sealed partial class Channels_ToggleParticipantsHidden : IMethod<UpdatesB
public bool enabled;
}

[TLDef(0x18AFBC93)]
[TLDef(0x01445D75)]
public sealed partial class Channels_ClickSponsoredMessage : IMethod<bool>
{
public Flags flags;
public InputChannelBase channel;
public byte[] random_id;

[Flags] public enum Flags : uint
{
media = 0x1,
fullscreen = 0x2,
}
}

[TLDef(0xD8AA3671)]
Expand Down
7 changes: 4 additions & 3 deletions src/TL.Table.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -155,7 +155,7 @@ public static partial class Layer
[0x56E0D474] = typeof(MessageMediaGeo),
[0x70322949] = typeof(MessageMediaContact),
[0x9F84F49E] = typeof(MessageMediaUnsupported),
[0x4CF4D72D] = typeof(MessageMediaDocument),
[0xDD570BD5] = typeof(MessageMediaDocument),
[0xDDF10C3B] = typeof(MessageMediaWebPage),
[0x2EC0533F] = typeof(MessageMediaVenue),
[0xFDB19008] = typeof(MessageMediaGame),
Expand Down Expand Up @@ -513,7 +513,7 @@ public static partial class Layer
[0x6C37C15C] = typeof(DocumentAttributeImageSize),
[0x11B58939] = typeof(DocumentAttributeAnimated),
[0x6319D612] = typeof(DocumentAttributeSticker),
[0x17399FAD] = typeof(DocumentAttributeVideo),
[0x43C57C48] = typeof(DocumentAttributeVideo),
[0x9852F9C6] = typeof(DocumentAttributeAudio),
[0x15590068] = typeof(DocumentAttributeFilename),
[0x9801D2F7] = typeof(DocumentAttributeHasStickers),
Expand Down Expand Up @@ -573,6 +573,7 @@ public static partial class Layer
[0xA0C0505C] = typeof(KeyboardButtonSimpleWebView),
[0x53D7BFD8] = typeof(KeyboardButtonRequestPeer),
[0xC9662D05] = typeof(InputKeyboardButtonRequestPeer),
[0x75D2698E] = typeof(KeyboardButtonCopy),
[0x77608B83] = typeof(KeyboardButtonRow),
[0xA03E5B85] = typeof(ReplyKeyboardHide),
[0x86B40B08] = typeof(ReplyKeyboardForceReply),
Expand Down
2 changes: 1 addition & 1 deletion src/WTelegramClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PackageId>WTelegramClient</PackageId>
<Version>0.0.0</Version>
<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:
$(ReleaseNotes.Replace("|", "%0D%0A").Replace(" - ","%0D%0A- ").Replace(" ", "%0D%0A%0D%0A"))</Description>
Expand Down

0 comments on commit 6cfa2a4

Please sign in to comment.