diff --git a/.github/dev.yml b/.github/dev.yml index fefd177..e8a3729 100644 --- a/.github/dev.yml +++ b/.github/dev.yml @@ -1,7 +1,7 @@ pr: none trigger: [ master ] -name: 4.2.9-dev.$(Rev:r) +name: 4.3.1-dev.$(Rev:r) pool: vmImage: ubuntu-latest diff --git a/.github/release.yml b/.github/release.yml index de79b3b..e4ca17f 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -1,7 +1,7 @@ pr: none trigger: none -name: 4.2.$(Rev:r) +name: 4.3.$(Rev:r) pool: vmImage: ubuntu-latest diff --git a/README.md b/README.md index d43c617..12f7892 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![API Layer](https://img.shields.io/badge/API_Layer-198-blueviolet)](https://corefork.telegram.org/methods) +[![API Layer](https://img.shields.io/badge/API_Layer-199-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 749dd20..3d612af 100644 --- a/src/TL.Schema.cs +++ b/src/TL.Schema.cs @@ -257,7 +257,7 @@ namespace TL has_ttl_seconds = 0x2, /// Field has a value has_thumb = 0x4, - /// Whether the specified document is a video file with no audio tracks (a GIF animation (even as MPEG4), for example) + /// Whether to send the file as a video even if it doesn't have an audio track (i.e. if set, the attribute will not be set even for videos without audio) nosound_video = 0x8, /// Force the media file to be uploaded as document force_file = 0x10, @@ -5756,11 +5756,11 @@ namespace TL public override (long, int, int) GetMBox() => (-1, qts, 1); } /// Contains the current default paid reaction privacy, see here » for more info. See - [TLDef(0x51CA7AEC)] + [TLDef(0x8B725FCE)] public sealed partial class UpdatePaidReactionPrivacy : Update { /// Whether paid reaction privacy is enabled or disabled. - public bool private_; + public PaidReactionPrivacy private_; } /// Updates state. See @@ -7118,7 +7118,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; - /// Codec used for the video, i.e. "h264", "h265", or "av1" + /// Codec used for the video, i.e. “h264”, “h265”, or “av1” [IfFlag(5)] public string video_codec; [Flags] public enum Flags : uint @@ -7129,7 +7129,7 @@ namespace TL supports_streaming = 0x2, /// Field has a value has_preload_prefix_size = 0x4, - /// Whether the specified document is a video file with no audio tracks (a GIF animation (even as MPEG4), for example) + /// Whether the specified document is a video file with no audio tracks nosound = 0x8, /// Field has a value has_video_start_ts = 0x10, @@ -7361,6 +7361,7 @@ namespace TL has_attributes = 0x1000, /// Whether the size of the media in the preview can be changed. has_large_media = 0x2000, + video_cover_photo = 0x4000, } /// Preview ID @@ -19842,7 +19843,7 @@ namespace TL public override int AvailabilityTotal => availability_total; } /// See - [TLDef(0xF2FE7E4A)] + [TLDef(0x5C62D151)] public sealed partial class StarGiftUnique : StarGiftBase { public Flags flags; @@ -19856,12 +19857,14 @@ namespace TL public StarGiftAttribute[] attributes; public int availability_issued; public int availability_total; + [IfFlag(3)] public string gift_address; [Flags] public enum Flags : uint { has_owner_id = 0x1, has_owner_name = 0x2, has_owner_address = 0x4, + has_gift_address = 0x8, } public override long ID => id; @@ -20299,4 +20302,17 @@ namespace TL { public string url; } + + /// See + /// a value means paidReactionPrivacyDefault + public abstract partial class PaidReactionPrivacy : IObject { } + /// See + [TLDef(0x1F0C1AD9)] + public sealed partial class PaidReactionPrivacyAnonymous : PaidReactionPrivacy { } + /// See + [TLDef(0xDC6CFCF0)] + public sealed partial class PaidReactionPrivacyPeer : PaidReactionPrivacy + { + public InputPeer peer; + } } diff --git a/src/TL.SchemaFuncs.cs b/src/TL.SchemaFuncs.cs index 5f025de..296b6c7 100644 --- a/src/TL.SchemaFuncs.cs +++ b/src/TL.SchemaFuncs.cs @@ -126,6 +126,14 @@ namespace TL query = query, }); + /// See + public static Task InvokeWithReCaptcha(this Client client, string token, IMethod query) + => client.Invoke(new InvokeWithReCaptcha + { + token = token, + query = query, + }); + /// Send the verification code for login See Possible codes: 400,406,500 (details) /// Phone number in international format /// Application identifier (see App configuration) @@ -4336,28 +4344,28 @@ namespace TL platform = platform, }); - /// Sends one or more paid Telegram Star reactions », transferring Telegram Stars » to a channel's balance. See Possible codes: 400 (details) + /// Sends one or more paid Telegram Star reactions », transferring Telegram Stars » to a channel's balance. See Possible codes: 400 (details) /// The channel /// The message to react to /// The number of stars to send (each will increment the reaction counter by one). /// Unique client message ID required to prevent message resending You can use - /// Each post with star reactions has a leaderboard with the top senders, but users can opt out of appearing there if they prefer more privacy.
If the user explicitly chose to make their paid reaction(s) private, pass to Messages_SendPaidReaction.private.
If the user explicitly chose to make their paid reaction(s) private, pass to Messages_SendPaidReaction.private.
If the user did not make any explicit choice about the privacy of their paid reaction(s) (i.e. when reacting by clicking on an existing star reaction on a message), do not populate the Messages_SendPaidReaction.private flag. - public static Task Messages_SendPaidReaction(this Client client, InputPeer peer, int msg_id, int count, long random_id, bool? private_ = default) + /// Each post with star reactions has a leaderboard with the top senders, but users can opt out of appearing there if they prefer more privacy.
If the user explicitly chose to make their paid reaction(s) private, pass to Messages_SendPaidReaction.private.
If the user explicitly chose to make their paid reaction(s) not private, pass to Messages_SendPaidReaction.private.
If the user did not make any explicit choice about the privacy of their paid reaction(s) (i.e. when reacting by clicking on an existing star reaction on a message), do not populate the Messages_SendPaidReaction.private flag. + public static Task Messages_SendPaidReaction(this Client client, InputPeer peer, int msg_id, int count, long random_id, PaidReactionPrivacy private_ = null) => client.Invoke(new Messages_SendPaidReaction { - flags = (Messages_SendPaidReaction.Flags)(private_ != default ? 0x1 : 0), + flags = (Messages_SendPaidReaction.Flags)(private_ != null ? 0x1 : 0), peer = peer, msg_id = msg_id, count = count, random_id = random_id, - private_ = private_ ?? default, + private_ = private_, }); /// Changes the privacy of already sent paid reactions on a specific message. See Possible codes: 400 (details) /// The channel /// The ID of the message to which we sent the paid reactions /// If true, makes the current anonymous in the top sender leaderboard for this message; otherwise, does the opposite. - public static Task Messages_TogglePaidReactionPrivacy(this Client client, InputPeer peer, int msg_id, bool private_) + public static Task Messages_TogglePaidReactionPrivacy(this Client client, InputPeer peer, int msg_id, PaidReactionPrivacy private_) => client.Invoke(new Messages_TogglePaidReactionPrivacy { peer = peer, @@ -5253,9 +5261,10 @@ namespace TL /// Obtains a list of peers that can be used to send messages in a specific group See Possible codes: 400 (details) /// The group where we intend to send messages - public static Task Channels_GetSendAs(this Client client, InputPeer peer) + public static Task Channels_GetSendAs(this Client client, InputPeer peer, bool for_paid_reactions = false) => client.Invoke(new Channels_GetSendAs { + flags = (Channels_GetSendAs.Flags)(for_paid_reactions ? 0x1 : 0), peer = peer, }); @@ -7612,6 +7621,13 @@ namespace TL.Methods public IMethod query; } + [TLDef(0xADBB0F94)] + public sealed partial class InvokeWithReCaptcha : IMethod + { + public string token; + public IMethod query; + } + [TLDef(0xA677244F)] public sealed partial class Auth_SendCode : IMethod { @@ -11132,7 +11148,7 @@ namespace TL.Methods } } - [TLDef(0x9DD6A67B)] + [TLDef(0x58BBCB50)] public sealed partial class Messages_SendPaidReaction : IMethod { public Flags flags; @@ -11140,7 +11156,7 @@ namespace TL.Methods public int msg_id; public int count; public long random_id; - [IfFlag(0)] public bool private_; + [IfFlag(0)] public PaidReactionPrivacy private_; [Flags] public enum Flags : uint { @@ -11148,12 +11164,12 @@ namespace TL.Methods } } - [TLDef(0x849AD397)] + [TLDef(0x435885B5)] public sealed partial class Messages_TogglePaidReactionPrivacy : IMethod { public InputPeer peer; public int msg_id; - public bool private_; + public PaidReactionPrivacy private_; } [TLDef(0x472455AA)] @@ -11840,10 +11856,16 @@ namespace TL.Methods public InputChannelBase channel; } - [TLDef(0x0DC770EE)] + [TLDef(0xE785A43F)] public sealed partial class Channels_GetSendAs : IMethod { + public Flags flags; public InputPeer peer; + + [Flags] public enum Flags : uint + { + for_paid_reactions = 0x1, + } } [TLDef(0x367544DB)] diff --git a/src/TL.Table.cs b/src/TL.Table.cs index b3f254a..742ecad 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 = 198; // fetched 22/01/2025 22:22:20 + public const int Version = 199; // fetched 13/02/2025 13:06:03 internal const int SecretChats = 144; internal const int MTProto2 = 73; internal const uint VectorCtor = 0x1CB5C415; @@ -419,7 +419,7 @@ namespace TL [0x1EA2FDA7] = typeof(UpdateBusinessBotCallbackQuery), [0xA584B019] = typeof(UpdateStarsRevenueStatus), [0x283BD312] = typeof(UpdateBotPurchasedPaidMedia), - [0x51CA7AEC] = typeof(UpdatePaidReactionPrivacy), + [0x8B725FCE] = typeof(UpdatePaidReactionPrivacy), [0xA56C2A3E] = typeof(Updates_State), [0x5D75A138] = typeof(Updates_DifferenceEmpty), [0x00F49CA0] = typeof(Updates_Difference), @@ -1344,7 +1344,7 @@ namespace TL [0x94CE852A] = typeof(StarsGiveawayOption), [0x54236209] = typeof(StarsGiveawayWinnersOption), [0x02CC73C8] = typeof(StarGift), - [0xF2FE7E4A] = typeof(StarGiftUnique), + [0x5C62D151] = typeof(StarGiftUnique), [0xA388A368] = null,//Payments_StarGiftsNotModified [0x901689EA] = typeof(Payments_StarGifts), [0x7903E3D9] = typeof(MessageReportOption), @@ -1377,6 +1377,9 @@ namespace TL [0x69279795] = typeof(InputSavedStarGiftUser), [0xF101AA7F] = typeof(InputSavedStarGiftChat), [0x84AA3A9C] = typeof(Payments_StarGiftWithdrawalUrl), + [0x206AD49E] = null,//PaidReactionPrivacyDefault + [0x1F0C1AD9] = typeof(PaidReactionPrivacyAnonymous), + [0xDC6CFCF0] = typeof(PaidReactionPrivacyPeer), // from TL.Secret: [0x6ABD9782] = typeof(Layer143.DecryptedMessageMediaDocument), [0x020DF5D0] = typeof(Layer101.MessageEntityBlockquote), @@ -1507,6 +1510,7 @@ namespace TL [typeof(Messages_QuickReplies)] = 0x5F91EB5B, //messages.quickRepliesNotModified [typeof(Messages_AvailableEffects)] = 0xD1ED9A5B, //messages.availableEffectsNotModified [typeof(Payments_StarGifts)] = 0xA388A368, //payments.starGiftsNotModified + [typeof(PaidReactionPrivacy)] = 0x206AD49E, //paidReactionPrivacyDefault [typeof(DecryptedMessageMedia)] = 0x089F5C4A, //decryptedMessageMediaEmpty }; } diff --git a/src/WTelegramClient.csproj b/src/WTelegramClient.csproj index 5cd6031..79692c1 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: 198 + Telegram Client API (MTProto) library written 100% in C# and .NET Standard | Latest API layer: 199 Release Notes: $(ReleaseNotes.Replace("|", "%0D%0A").Replace(" - ","%0D%0A- ").Replace(" ", "%0D%0A%0D%0A"))