diff --git a/README.md b/README.md index d2aadf3..557ce41 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![API Layer](https://img.shields.io/badge/API_Layer-202-blueviolet)](https://corefork.telegram.org/methods) +[![API Layer](https://img.shields.io/badge/API_Layer-203-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 58a7de8..c05334e 100644 --- a/src/TL.Schema.cs +++ b/src/TL.Schema.cs @@ -1204,6 +1204,7 @@ namespace TL has_bot_verification_icon = 0x2000, /// Field has a value has_send_paid_messages_stars = 0x4000, + autotranslation = 0x8000, } /// ID of the channel, see here » for more info @@ -2923,7 +2924,7 @@ namespace TL } } /// See - [TLDef(0xACDFCB81)] + [TLDef(0x2E3AE60E)] public sealed partial class MessageActionStarGiftUnique : MessageAction { public Flags flags; @@ -2933,6 +2934,9 @@ namespace TL [IfFlag(6)] public Peer from_id; [IfFlag(7)] public Peer peer; [IfFlag(7)] public long saved_id; + [IfFlag(8)] public long resale_stars; + [IfFlag(9)] public int can_transfer_at; + [IfFlag(10)] public int can_resell_at; [Flags] public enum Flags : uint { @@ -2944,6 +2948,9 @@ namespace TL refunded = 0x20, has_from_id = 0x40, has_peer = 0x80, + has_resale_stars = 0x100, + has_can_transfer_at = 0x200, + has_can_resell_at = 0x400, } } /// See @@ -12137,6 +12144,12 @@ namespace TL /// The subscriber that extended the subscription. public ChannelParticipantBase new_participant; } + /// See + [TLDef(0xC517F77E)] + public sealed partial class ChannelAdminLogEventActionToggleAutotranslation : ChannelAdminLogEventAction + { + public bool new_value; + } /// Admin log event See [TLDef(0x1FAD68CD)] @@ -14367,7 +14380,7 @@ namespace TL public DateTime expires; } /// MTProxy/Public Service Announcement information See - [TLDef(0x8C39793F)] + [TLDef(0x08A4D87A)] public sealed partial class Help_PromoData : Help_PromoDataBase { /// Extra bits of information, use flags.HasFlag(...) to test for those @@ -14375,15 +14388,18 @@ namespace TL /// Expiry of PSA/MTProxy info public DateTime expires; /// MTProxy/PSA peer - public Peer peer; - /// Chat info - public Dictionary chats; - /// User info - public Dictionary users; + [IfFlag(3)] public Peer peer; /// PSA type [IfFlag(1)] public string psa_type; /// PSA message [IfFlag(2)] public string psa_message; + public string[] pending_suggestions; + public string[] dismissed_suggestions; + [IfFlag(4)] public PendingSuggestion custom_pending_suggestion; + /// Chat info + public Dictionary chats; + /// User info + public Dictionary users; [Flags] public enum Flags : uint { @@ -14393,6 +14409,10 @@ namespace TL has_psa_type = 0x2, /// Field has a value has_psa_message = 0x4, + /// Field has a value + has_peer = 0x8, + /// Field has a value + has_custom_pending_suggestion = 0x10, } /// returns a or for the result public IPeerInfo UserOrChat => peer?.UserOrChat(users, chats); @@ -15976,6 +15996,13 @@ namespace TL public InputUserBase bot; public long stars; } + /// See + [TLDef(0x63CBC38C)] + public sealed partial class InputInvoiceStarGiftResale : InputInvoice + { + public string slug; + public InputPeer to_id; + } /// Exported invoice deep link See [TLDef(0xAED0CBD9)] @@ -19541,6 +19568,7 @@ namespace TL /// Field has a value has_premium_gift_months = 0x100000, business_transfer = 0x200000, + stargift_resale = 0x400000, } } @@ -19909,9 +19937,10 @@ namespace TL public virtual long ID => default; /// For limited-supply gifts: the total number of gifts that was available in the initial supply. public virtual int AvailabilityTotal => default; + public virtual string Title => default; } /// Represents a star gift, see here » for more info. See - [TLDef(0x02CC73C8)] + [TLDef(0xC62ACA28)] public sealed partial class StarGift : StarGiftBase { /// Extra bits of information, use flags.HasFlag(...) to test for those @@ -19926,6 +19955,7 @@ namespace TL [IfFlag(0)] public int availability_remains; /// For limited-supply gifts: the total number of gifts that was available in the initial supply. [IfFlag(0)] public int availability_total; + [IfFlag(4)] public long availability_resale; /// The receiver of this gift may convert it to this many Telegram Stars, instead of displaying it on their profile page.
convert_stars will be equal to stars only if the gift was bought using recently bought Telegram Stars, otherwise it will be less than stars.
public long convert_stars; /// For sold out gifts only: when was the gift first bought. @@ -19933,6 +19963,8 @@ namespace TL /// For sold out gifts only: when was the gift last bought. [IfFlag(1)] public DateTime last_sale_date; [IfFlag(3)] public long upgrade_stars; + [IfFlag(4)] public long resell_min_stars; + [IfFlag(5)] public string title; [Flags] public enum Flags : uint { @@ -19944,15 +19976,20 @@ namespace TL birthday = 0x4, /// Field has a value has_upgrade_stars = 0x8, + /// Fields and have a value + has_availability_resale = 0x10, + /// Field has a value + has_title = 0x20, } /// Identifier of the gift public override long ID => id; /// For limited-supply gifts: the total number of gifts that was available in the initial supply. public override int AvailabilityTotal => availability_total; + public override string Title => title; } ///
See - [TLDef(0x5C62D151)] + [TLDef(0x6411DB89)] public sealed partial class StarGiftUnique : StarGiftBase { public Flags flags; @@ -19967,6 +20004,7 @@ namespace TL public int availability_issued; public int availability_total; [IfFlag(3)] public string gift_address; + [IfFlag(4)] public long resell_stars; [Flags] public enum Flags : uint { @@ -19974,10 +20012,12 @@ namespace TL has_owner_name = 0x2, has_owner_address = 0x4, has_gift_address = 0x8, + has_resell_stars = 0x10, } public override long ID => id; public override int AvailabilityTotal => availability_total; + public override string Title => title; } /// Available gifts ». See @@ -20272,10 +20312,11 @@ namespace TL public int rarity_permille; } /// See - [TLDef(0x94271762)] + [TLDef(0xD93D859C)] public sealed partial class StarGiftAttributeBackdrop : StarGiftAttribute { public string name; + public int backdrop_id; public int center_color; public int edge_color; public int pattern_color; @@ -20336,7 +20377,7 @@ namespace TL } /// See - [TLDef(0x6056DBA5)] + [TLDef(0xDFDA0499)] public sealed partial class SavedStarGift : IObject { public Flags flags; @@ -20350,6 +20391,8 @@ namespace TL [IfFlag(6)] public long upgrade_stars; [IfFlag(7)] public int can_export_at; [IfFlag(8)] public long transfer_stars; + [IfFlag(13)] public int can_transfer_at; + [IfFlag(14)] public int can_resell_at; [Flags] public enum Flags : uint { @@ -20366,6 +20409,8 @@ namespace TL can_upgrade = 0x400, has_saved_id = 0x800, pinned_to_top = 0x1000, + has_can_transfer_at = 0x2000, + has_can_resell_at = 0x4000, } } @@ -20405,6 +20450,12 @@ namespace TL public InputPeer peer; public long saved_id; } + /// See + [TLDef(0x2085C238)] + public sealed partial class InputSavedStarGiftSlug : InputSavedStarGift + { + public string slug; + } /// See [TLDef(0x84AA3A9C)] @@ -20514,4 +20565,74 @@ namespace TL /// returns a or for the given Peer public IPeerInfo UserOrChat(Peer peer) => peer?.UserOrChat(users, chats); } + + /// See + public abstract partial class StarGiftAttributeId : IObject { } + /// See + [TLDef(0x48AAAE3C)] + public sealed partial class StarGiftAttributeIdModel : StarGiftAttributeId + { + public long document_id; + } + /// See + [TLDef(0x4A162433)] + public sealed partial class StarGiftAttributeIdPattern : StarGiftAttributeId + { + public long document_id; + } + /// See + [TLDef(0x1F01C757)] + public sealed partial class StarGiftAttributeIdBackdrop : StarGiftAttributeId + { + public int backdrop_id; + } + + /// See + [TLDef(0x2EB1B658)] + public sealed partial class StarGiftAttributeCounter : IObject + { + public StarGiftAttributeId attribute; + public int count; + } + + /// See + [TLDef(0x947A12DF)] + public sealed partial class Payments_ResaleStarGifts : IObject, IPeerResolver + { + public Flags flags; + public int count; + public StarGiftBase[] gifts; + [IfFlag(0)] public string next_offset; + [IfFlag(1)] public StarGiftAttribute[] attributes; + [IfFlag(1)] public long attributes_hash; + public Dictionary chats; + [IfFlag(2)] public StarGiftAttributeCounter[] counters; + public Dictionary users; + + [Flags] public enum Flags : uint + { + has_next_offset = 0x1, + has_attributes = 0x2, + has_counters = 0x4, + } + /// returns a or for the given Peer + public IPeerInfo UserOrChat(Peer peer) => peer?.UserOrChat(users, chats); + } + + /// See + [TLDef(0xC387C04E)] + public sealed partial class Stories_CanSendStoryCount : IObject + { + public int count_remains; + } + + /// See + [TLDef(0xE7E82E12)] + public sealed partial class PendingSuggestion : IObject + { + public string suggestion; + public TextWithEntities title; + public TextWithEntities description; + public string url; + } } diff --git a/src/TL.SchemaFuncs.cs b/src/TL.SchemaFuncs.cs index 9a50d76..e872cc4 100644 --- a/src/TL.SchemaFuncs.cs +++ b/src/TL.SchemaFuncs.cs @@ -5587,6 +5587,14 @@ namespace TL send_paid_messages_stars = send_paid_messages_stars, }); + /// See + public static Task Channels_ToggleAutotranslation(this Client client, InputChannelBase channel, bool enabled) + => client.Invoke(new Channels_ToggleAutotranslation + { + channel = channel, + enabled = enabled, + }); + /// Sends a custom request; for bots only See [bots: ✓] Possible codes: 400,403 (details) /// The method name /// JSON-serialized method parameters @@ -6367,6 +6375,26 @@ namespace TL purpose = purpose, }); + /// See + public static Task Payments_GetResaleStarGifts(this Client client, long gift_id, string offset, int limit = int.MaxValue, long? attributes_hash = null, StarGiftAttributeId[] attributes = null, bool sort_by_price = false, bool sort_by_num = false) + => client.Invoke(new Payments_GetResaleStarGifts + { + flags = (Payments_GetResaleStarGifts.Flags)((attributes_hash != null ? 0x1 : 0) | (attributes != null ? 0x8 : 0) | (sort_by_price ? 0x2 : 0) | (sort_by_num ? 0x4 : 0)), + attributes_hash = attributes_hash ?? default, + gift_id = gift_id, + attributes = attributes, + offset = offset, + limit = limit, + }); + + /// See + public static Task Payments_UpdateStarGiftPrice(this Client client, InputSavedStarGift stargift, long resell_stars) + => client.Invoke(new Payments_UpdateStarGiftPrice + { + stargift = stargift, + resell_stars = resell_stars, + }); + /// Create a stickerset. See [bots: ✓] Possible codes: 400 (details) /// Whether this is a mask stickerset /// Whether this is a custom emoji stickerset. @@ -7193,7 +7221,7 @@ namespace TL /// Check whether we can post stories as the specified peer. See Possible codes: 400 (details) /// The peer from which we wish to post stories. - public static Task Stories_CanSendStory(this Client client, InputPeer peer) + public static Task Stories_CanSendStory(this Client client, InputPeer peer) => client.Invoke(new Stories_CanSendStory { peer = peer, @@ -12224,6 +12252,13 @@ namespace TL.Methods public long send_paid_messages_stars; } + [TLDef(0x167FC0A1)] + public sealed partial class Channels_ToggleAutotranslation : IMethod + { + public InputChannelBase channel; + public bool enabled; + } + [TLDef(0xAA2769ED)] public sealed partial class Bots_SendCustomRequest : IMethod { @@ -12903,6 +12938,32 @@ namespace TL.Methods public InputStorePaymentPurpose purpose; } + [TLDef(0x7A5FA236)] + public sealed partial class Payments_GetResaleStarGifts : IMethod + { + public Flags flags; + [IfFlag(0)] public long attributes_hash; + public long gift_id; + [IfFlag(3)] public StarGiftAttributeId[] attributes; + public string offset; + public int limit; + + [Flags] public enum Flags : uint + { + has_attributes_hash = 0x1, + sort_by_price = 0x2, + sort_by_num = 0x4, + has_attributes = 0x8, + } + } + + [TLDef(0x3BAEA4E1)] + public sealed partial class Payments_UpdateStarGiftPrice : IMethod + { + public InputSavedStarGift stargift; + public long resell_stars; + } + [TLDef(0x9021AB67)] public sealed partial class Stickers_CreateStickerSet : IMethod { @@ -13604,8 +13665,8 @@ namespace TL.Methods public InputPeer[] peers; } - [TLDef(0xC7DFDFDD)] - public sealed partial class Stories_CanSendStory : IMethod + [TLDef(0x30EB63F0)] + public sealed partial class Stories_CanSendStory : IMethod { public InputPeer peer; } diff --git a/src/TL.Table.cs b/src/TL.Table.cs index 892f37e..8e52198 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 = 202; // fetched 01/05/2025 10:01:40 + public const int Version = 203; // fetched 14/05/2025 16:07:47 internal const int SecretChats = 144; internal const int MTProto2 = 73; internal const uint VectorCtor = 0x1CB5C415; @@ -214,7 +214,7 @@ namespace TL [0x45D5B021] = typeof(MessageActionGiftStars), [0xB00C47A2] = typeof(MessageActionPrizeStars), [0x4717E8A4] = typeof(MessageActionStarGift), - [0xACDFCB81] = typeof(MessageActionStarGiftUnique), + [0x2E3AE60E] = typeof(MessageActionStarGiftUnique), [0xAC1F1FCD] = typeof(MessageActionPaidMessagesRefunded), [0xBCD71419] = typeof(MessageActionPaidMessagesPrice), [0x2FFE2F7A] = typeof(MessageActionConferenceCall), @@ -859,6 +859,7 @@ namespace TL [0x46D840AB] = typeof(ChannelAdminLogEventActionChangeEmojiStickerSet), [0x60A79C79] = typeof(ChannelAdminLogEventActionToggleSignatureProfiles), [0x64642DB3] = typeof(ChannelAdminLogEventActionParticipantSubExtend), + [0xC517F77E] = typeof(ChannelAdminLogEventActionToggleAutotranslation), [0x1FAD68CD] = typeof(ChannelAdminLogEvent), [0xED8AF74D] = typeof(Channels_AdminLogResults), [0xEA107AE4] = typeof(ChannelAdminLogEventsFilter), @@ -1011,7 +1012,7 @@ namespace TL [0x8EA464B6] = typeof(StatsGraph), [0x396CA5FC] = typeof(Stats_BroadcastStats), [0x98F6AC75] = typeof(Help_PromoDataEmpty), - [0x8C39793F] = typeof(Help_PromoData), + [0x08A4D87A] = typeof(Help_PromoData), [0xDE33B094] = typeof(VideoSize), [0xF85C413C] = typeof(VideoSizeEmojiMarkup), [0x0DA082FE] = typeof(VideoSizeStickerMarkup), @@ -1116,6 +1117,7 @@ namespace TL [0x4A5F5BD9] = typeof(InputInvoiceStarGiftTransfer), [0xDABAB2EF] = typeof(InputInvoicePremiumGiftStars), [0xF4997E42] = typeof(InputInvoiceBusinessBotTransferStars), + [0x63CBC38C] = typeof(InputInvoiceStarGiftResale), [0xAED0CBD9] = typeof(Payments_ExportedInvoice), [0xCFB9D957] = typeof(Messages_TranscribedAudio), [0x5334759C] = typeof(Help_PremiumPromo), @@ -1353,8 +1355,8 @@ namespace TL [0x4BA3A95A] = typeof(MessageReactor), [0x94CE852A] = typeof(StarsGiveawayOption), [0x54236209] = typeof(StarsGiveawayWinnersOption), - [0x02CC73C8] = typeof(StarGift), - [0x5C62D151] = typeof(StarGiftUnique), + [0xC62ACA28] = typeof(StarGift), + [0x6411DB89] = typeof(StarGiftUnique), [0xA388A368] = null,//Payments_StarGiftsNotModified [0x901689EA] = typeof(Payments_StarGifts), [0x7903E3D9] = typeof(MessageReportOption), @@ -1375,17 +1377,18 @@ namespace TL [0xF93CD45C] = typeof(BotVerification), [0x39D99013] = typeof(StarGiftAttributeModel), [0x13ACFF19] = typeof(StarGiftAttributePattern), - [0x94271762] = typeof(StarGiftAttributeBackdrop), + [0xD93D859C] = typeof(StarGiftAttributeBackdrop), [0xE0BFF26C] = typeof(StarGiftAttributeOriginalDetails), [0x167BD90B] = typeof(Payments_StarGiftUpgradePreview), [0x62D706B8] = typeof(Users_Users), [0x315A4974] = typeof(Users_UsersSlice), [0xCAA2F60B] = typeof(Payments_UniqueStarGift), [0xB53E8B21] = typeof(Messages_WebPagePreview), - [0x6056DBA5] = typeof(SavedStarGift), + [0xDFDA0499] = typeof(SavedStarGift), [0x95F389B1] = typeof(Payments_SavedStarGifts), [0x69279795] = typeof(InputSavedStarGiftUser), [0xF101AA7F] = typeof(InputSavedStarGiftChat), + [0x2085C238] = typeof(InputSavedStarGiftSlug), [0x84AA3A9C] = typeof(Payments_StarGiftWithdrawalUrl), [0x206AD49E] = null,//PaidReactionPrivacyDefault [0x1F0C1AD9] = typeof(PaidReactionPrivacyAnonymous), @@ -1399,6 +1402,13 @@ namespace TL [0xC69708D3] = typeof(SponsoredPeer), [0xEA32B4B1] = null,//Contacts_SponsoredPeersEmpty [0xEB032884] = typeof(Contacts_SponsoredPeers), + [0x48AAAE3C] = typeof(StarGiftAttributeIdModel), + [0x4A162433] = typeof(StarGiftAttributeIdPattern), + [0x1F01C757] = typeof(StarGiftAttributeIdBackdrop), + [0x2EB1B658] = typeof(StarGiftAttributeCounter), + [0x947A12DF] = typeof(Payments_ResaleStarGifts), + [0xC387C04E] = typeof(Stories_CanSendStoryCount), + [0xE7E82E12] = typeof(PendingSuggestion), // from TL.Secret: [0x6ABD9782] = typeof(Layer143.DecryptedMessageMediaDocument), [0x020DF5D0] = typeof(Layer101.MessageEntityBlockquote), diff --git a/src/WTelegramClient.csproj b/src/WTelegramClient.csproj index a19c731..2a71dd9 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: 202 + Telegram Client API (MTProto) library written 100% in C# and .NET Standard | Latest API layer: 203 Release Notes: $(ReleaseNotes.Replace("|", "%0D%0A").Replace(" - ","%0D%0A- ").Replace(" ", "%0D%0A%0D%0A"))