Update to Telegram API Layer 220

- Added support for passkey-based authentication with new classes (`Passkey`, `Account_Passkeys`, etc.) and methods (`Auth_InitPasskeyLogin`, `Account_RegisterPasskey`, etc.).
- Added new methods for handling star gift offers and upgrades (`Payments_ResolveStarGiftOffer`, `Payments_SendStarGiftOffer`, etc.).
- Enhanced star gift functionality with new fields (`gift_num`, `upgrade_variants`, etc.), flags, and classes (`MessageActionStarGiftPurchaseOffer`, `StarGiftBackground`, etc.).
- Updated `Messages_ForwardMessages` to include a new `effect` parameter.
This commit is contained in:
Wizou 2025-12-14 20:24:02 +01:00
parent d3ad4789a1
commit 9c839128bb
5 changed files with 360 additions and 34 deletions

View file

@ -1,4 +1,4 @@
[![API Layer](https://img.shields.io/badge/API_Layer-218-blueviolet)](https://corefork.telegram.org/methods)
[![API Layer](https://img.shields.io/badge/API_Layer-220-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)

View file

@ -2988,7 +2988,7 @@ namespace TL
}
}
/// <summary>You received a <a href="https://corefork.telegram.org/api/gifts">gift, see here »</a> for more info. <para>See <a href="https://corefork.telegram.org/constructor/messageActionStarGift"/></para></summary>
[TLDef(0xDB596550)]
[TLDef(0xEA2C31D3)]
public sealed partial class MessageActionStarGift : MessageAction
{
/// <summary>Extra bits of information, use <c>flags.HasFlag(...)</c> to test for those</summary>
@ -3014,6 +3014,7 @@ namespace TL
/// <summary>For <a href="https://corefork.telegram.org/api/gifts#prepaying-for-someone-elses-upgrade">separate upgrades</a>, the identifier of the message with the gift whose upgrade was prepaid (only valid for the receiver of the service message).</summary>
[IfFlag(15)] public int gift_msg_id;
[IfFlag(18)] public Peer to_id;
[IfFlag(19)] public int gift_num;
[Flags] public enum Flags : uint
{
@ -3050,6 +3051,8 @@ namespace TL
auction_acquired = 0x20000,
/// <summary>Field <see cref="to_id"/> has a value</summary>
has_to_id = 0x40000,
/// <summary>Field <see cref="gift_num"/> has a value</summary>
has_gift_num = 0x80000,
}
}
/// <summary>A <a href="https://corefork.telegram.org/api/gifts">gift »</a> was upgraded to a <a href="https://corefork.telegram.org/api/gifts#collectible-gifts">collectible gift »</a>. <para>See <a href="https://corefork.telegram.org/constructor/messageActionStarGiftUnique"/></para></summary>
@ -3107,6 +3110,7 @@ namespace TL
/// <summary>Field <see cref="drop_original_details_stars"/> has a value</summary>
has_drop_original_details_stars = 0x1000,
assigned = 0x2000,
from_offer = 0x4000,
}
}
/// <summary>Sent from peer A to B, indicates that A refunded all <a href="https://corefork.telegram.org/api/stars">stars</a> B previously paid to send messages to A, see <a href="https://corefork.telegram.org/api/paid-messages">here »</a> for more info on paid messages. <para>See <a href="https://corefork.telegram.org/constructor/messageActionPaidMessagesRefunded"/></para></summary>
@ -3252,6 +3256,34 @@ namespace TL
{
public Birthday birthday;
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/messageActionStarGiftPurchaseOffer"/></para></summary>
[TLDef(0x774278D4)]
public sealed partial class MessageActionStarGiftPurchaseOffer : MessageAction
{
public Flags flags;
public StarGiftBase gift;
public StarsAmountBase price;
public DateTime expires_at;
[Flags] public enum Flags : uint
{
accepted = 0x1,
declined = 0x2,
}
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/messageActionStarGiftPurchaseOfferDeclined"/></para></summary>
[TLDef(0x73ADA76B)]
public sealed partial class MessageActionStarGiftPurchaseOfferDeclined : MessageAction
{
public Flags flags;
public StarGiftBase gift;
public StarsAmountBase price;
[Flags] public enum Flags : uint
{
expired = 0x1,
}
}
/// <summary>Chat info. <para>See <a href="https://corefork.telegram.org/type/Dialog"/></para> <para>Derived classes: <see cref="Dialog"/>, <see cref="DialogFolder"/></para></summary>
public abstract partial class DialogBase : IObject
@ -14553,14 +14585,11 @@ namespace TL
public DocumentBase[] icons;
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/webPageAttributeStarGiftAuction"/></para></summary>
[TLDef(0x034986AB)]
[TLDef(0x01C641C2)]
public sealed partial class WebPageAttributeStarGiftAuction : WebPageAttribute
{
public StarGiftBase gift;
public DateTime end_date;
public int center_color;
public int edge_color;
public int text_color;
}
/// <summary>How users voted in a poll <para>See <a href="https://corefork.telegram.org/constructor/messages.votesList"/></para></summary>
@ -20258,6 +20287,7 @@ namespace TL
stargift_drop_original_details = 0x4000000,
phonegroup_message = 0x8000000,
stargift_auction_bid = 0x10000000,
offer = 0x20000000,
}
}
@ -20642,7 +20672,7 @@ namespace TL
public virtual Peer ReleasedBy => default;
}
/// <summary>Represents a <a href="https://corefork.telegram.org/api/gifts">star gift, see here »</a> for more info. <para>See <a href="https://corefork.telegram.org/constructor/starGift"/></para></summary>
[TLDef(0x1B9A4D7F)]
[TLDef(0x313A9547)]
public sealed partial class StarGift : StarGiftBase
{
/// <summary>Extra bits of information, use <c>flags.HasFlag(...)</c> to test for those</summary>
@ -20681,6 +20711,9 @@ namespace TL
[IfFlag(9)] public DateTime locked_until_date;
[IfFlag(11)] public string auction_slug;
[IfFlag(11)] public int gifts_per_round;
[IfFlag(11)] public DateTime auction_start_date;
[IfFlag(12)] public int upgrade_variants;
[IfFlag(13)] public StarGiftBackground background;
[Flags] public enum Flags : uint
{
@ -20706,6 +20739,10 @@ namespace TL
has_locked_until_date = 0x200,
peer_color_available = 0x400,
auction = 0x800,
/// <summary>Field <see cref="upgrade_variants"/> has a value</summary>
has_upgrade_variants = 0x1000,
/// <summary>Field <see cref="background"/> has a value</summary>
has_background = 0x2000,
}
/// <summary>Identifier of the gift</summary>
@ -20718,7 +20755,7 @@ namespace TL
public override Peer ReleasedBy => released_by;
}
/// <summary>Represents a <a href="https://corefork.telegram.org/api/gifts#collectible-gifts">collectible star gift, see here »</a> for more info. <para>See <a href="https://corefork.telegram.org/constructor/starGiftUnique"/></para></summary>
[TLDef(0xB0BF741B)]
[TLDef(0x569D64C9)]
public sealed partial class StarGiftUnique : StarGiftBase
{
/// <summary>Extra bits of information, use <c>flags.HasFlag(...)</c> to test for those</summary>
@ -20755,10 +20792,12 @@ namespace TL
[IfFlag(8)] public long value_amount;
/// <summary>Currency for the gift's price.</summary>
[IfFlag(8)] public string value_currency;
[IfFlag(8)] public long value_usd_amount;
/// <summary>The current chat where the associated <a href="https://corefork.telegram.org/api/themes#chat-themes">chat theme</a> is installed, if any (gift-based themes can only be installed in one chat at a time).</summary>
[IfFlag(10)] public Peer theme_peer;
[IfFlag(11)] public PeerColorBase peer_color;
[IfFlag(12)] public Peer host_id;
[IfFlag(13)] public int offer_min_stars;
[Flags] public enum Flags : uint
{
@ -20778,7 +20817,7 @@ namespace TL
require_premium = 0x40,
/// <summary>Whether the gift can be bought only using Toncoins.</summary>
resale_ton_only = 0x80,
/// <summary>Fields <see cref="value_amount"/> and <see cref="value_currency"/> have a value</summary>
/// <summary>Fields <see cref="value_amount"/>, <see cref="value_currency"/> and <see cref="value_usd_amount"/> have a value</summary>
has_value_amount = 0x100,
/// <summary>A chat theme associated to this gift is available, <a href="https://corefork.telegram.org/api/themes#chat-themes">see here »</a> for more info on how to use it.</summary>
theme_available = 0x200,
@ -20788,6 +20827,8 @@ namespace TL
has_peer_color = 0x800,
/// <summary>Field <see cref="host_id"/> has a value</summary>
has_host_id = 0x1000,
/// <summary>Field <see cref="offer_min_stars"/> has a value</summary>
has_offer_min_stars = 0x2000,
}
/// <summary>Identifier of the collectible gift.</summary>
@ -21228,7 +21269,7 @@ namespace TL
}
/// <summary>Represents a <a href="https://corefork.telegram.org/api/gifts">gift</a> owned by a peer. <para>See <a href="https://corefork.telegram.org/constructor/savedStarGift"/></para></summary>
[TLDef(0x8983A452)]
[TLDef(0xEAD6805E)]
public sealed partial class SavedStarGift : IObject
{
/// <summary>Extra bits of information, use <c>flags.HasFlag(...)</c> to test for those</summary>
@ -21262,6 +21303,7 @@ namespace TL
/// <summary><a href="https://corefork.telegram.org/api/gifts#prepaying-for-someone-elses-upgrade">Hash to prepay for a gift upgrade separately »</a>.</summary>
[IfFlag(16)] public string prepaid_upgrade_hash;
[IfFlag(18)] public long drop_original_details_stars;
[IfFlag(19)] public int gift_num;
[Flags] public enum Flags : uint
{
@ -21303,6 +21345,8 @@ namespace TL
upgrade_separate = 0x20000,
/// <summary>Field <see cref="drop_original_details_stars"/> has a value</summary>
has_drop_original_details_stars = 0x40000,
/// <summary>Field <see cref="gift_num"/> has a value</summary>
has_gift_num = 0x80000,
}
}
@ -21946,7 +21990,6 @@ namespace TL
{
top = 0x1,
my = 0x2,
anonymous = 0x4,
has_peer_id = 0x8,
}
}
@ -21994,7 +22037,7 @@ namespace TL
public virtual DateTime EndDate => default;
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/starGiftAuctionState"/></para></summary>
[TLDef(0x5DB04F4B)]
[TLDef(0x771A4E66)]
public sealed partial class StarGiftAuctionState : StarGiftAuctionStateBase
{
public int version;
@ -22004,20 +22047,32 @@ namespace TL
public AuctionBidLevel[] bid_levels;
public long[] top_bidders;
public DateTime next_round_at;
public int last_gift_num;
public int gifts_left;
public int current_round;
public int total_rounds;
public StarGiftAuctionRound[] rounds;
public override DateTime StartDate => start_date;
public override DateTime EndDate => end_date;
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/starGiftAuctionStateFinished"/></para></summary>
[TLDef(0x7D967C3A)]
[TLDef(0x972DABBF)]
public sealed partial class StarGiftAuctionStateFinished : StarGiftAuctionStateBase
{
public Flags flags;
public DateTime start_date;
public DateTime end_date;
public long average_price;
[IfFlag(0)] public int listed_count;
[IfFlag(1)] public int fragment_listed_count;
[IfFlag(1)] public string fragment_listed_url;
[Flags] public enum Flags : uint
{
has_listed_count = 0x1,
has_fragment_listed_count = 0x2,
}
public override DateTime StartDate => start_date;
public override DateTime EndDate => end_date;
@ -22042,18 +22097,21 @@ namespace TL
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/payments.starGiftAuctionState"/></para></summary>
[TLDef(0x0E98E474)]
public sealed partial class Payments_StarGiftAuctionState : IObject
[TLDef(0x6B39F4EC)]
public sealed partial class Payments_StarGiftAuctionState : IObject, IPeerResolver
{
public StarGiftBase gift;
public StarGiftAuctionStateBase state;
public StarGiftAuctionUserState user_state;
public int timeout;
public Dictionary<long, User> users;
public Dictionary<long, ChatBase> chats;
/// <summary>returns a <see cref="User"/> or <see cref="ChatBase"/> for the given Peer</summary>
public IPeerInfo UserOrChat(Peer peer) => peer?.UserOrChat(users, chats);
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/starGiftAuctionAcquiredGift"/></para></summary>
[TLDef(0xAB60E20B)]
[TLDef(0x42B00348)]
public sealed partial class StarGiftAuctionAcquiredGift : IObject
{
public Flags flags;
@ -22063,11 +22121,13 @@ namespace TL
public int round;
public int pos;
[IfFlag(1)] public TextWithEntities message;
[IfFlag(2)] public int gift_num;
[Flags] public enum Flags : uint
{
name_hidden = 0x1,
has_message = 0x2,
has_gift_num = 0x4,
}
}
@ -22093,11 +22153,14 @@ namespace TL
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/payments.starGiftActiveAuctions"/></para></summary>
/// <remarks>a <see langword="null"/> value means <a href="https://corefork.telegram.org/constructor/payments.starGiftActiveAuctionsNotModified">payments.starGiftActiveAuctionsNotModified</a></remarks>
[TLDef(0x97F187D8)]
public sealed partial class Payments_StarGiftActiveAuctions : IObject
[TLDef(0xAEF6ABBC)]
public sealed partial class Payments_StarGiftActiveAuctions : IObject, IPeerResolver
{
public StarGiftActiveAuctionState[] auctions;
public Dictionary<long, User> users;
public Dictionary<long, ChatBase> chats;
/// <summary>returns a <see cref="User"/> or <see cref="ChatBase"/> for the given Peer</summary>
public IPeerInfo UserOrChat(Peer peer) => peer?.UserOrChat(users, chats);
}
/// <summary><para>See <a href="https://corefork.telegram.org/type/InputStarGiftAuction"/></para></summary>
@ -22114,4 +22177,105 @@ namespace TL
{
public string slug;
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/passkey"/></para></summary>
[TLDef(0x98613EBF)]
public sealed partial class Passkey : IObject
{
public Flags flags;
public string id;
public string name;
public DateTime date;
[IfFlag(0)] public long software_emoji_id;
[IfFlag(1)] public DateTime last_usage_date;
[Flags] public enum Flags : uint
{
has_software_emoji_id = 0x1,
has_last_usage_date = 0x2,
}
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/account.passkeys"/></para></summary>
[TLDef(0xF8E0AA1C)]
public sealed partial class Account_Passkeys : IObject
{
public Passkey[] passkeys;
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/account.passkeyRegistrationOptions"/></para></summary>
[TLDef(0xE16B5CE1)]
public sealed partial class Account_PasskeyRegistrationOptions : IObject
{
public DataJSON options;
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/auth.passkeyLoginOptions"/></para></summary>
[TLDef(0xE2037789)]
public sealed partial class Auth_PasskeyLoginOptions : IObject
{
public DataJSON options;
}
/// <summary><para>See <a href="https://corefork.telegram.org/type/InputPasskeyResponse"/></para></summary>
public abstract partial class InputPasskeyResponse : IObject
{
public DataJSON client_data;
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/inputPasskeyResponseRegister"/></para></summary>
[TLDef(0x3E63935C, inheritBefore = true)]
public sealed partial class InputPasskeyResponseRegister : InputPasskeyResponse
{
public byte[] attestation_data;
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/inputPasskeyResponseLogin"/></para></summary>
[TLDef(0xC31FC14A, inheritBefore = true)]
public sealed partial class InputPasskeyResponseLogin : InputPasskeyResponse
{
public byte[] authenticator_data;
public byte[] signature;
public string user_handle;
}
/// <summary><para>See <a href="https://corefork.telegram.org/type/InputPasskeyCredential"/></para></summary>
public abstract partial class InputPasskeyCredential : IObject { }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/inputPasskeyCredentialPublicKey"/></para></summary>
[TLDef(0x3C27B78F)]
public sealed partial class InputPasskeyCredentialPublicKey : InputPasskeyCredential
{
public string id;
public string raw_id;
public InputPasskeyResponse response;
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/starGiftBackground"/></para></summary>
[TLDef(0xAFF56398)]
public sealed partial class StarGiftBackground : IObject
{
public int center_color;
public int edge_color;
public int text_color;
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/starGiftAuctionRound"/></para></summary>
[TLDef(0x3AAE0528)]
public partial class StarGiftAuctionRound : IObject
{
public int num;
public int duration;
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/starGiftAuctionRoundExtendable"/></para></summary>
[TLDef(0x0AA021E5, inheritBefore = true)]
public sealed partial class StarGiftAuctionRoundExtendable : StarGiftAuctionRound
{
public int extend_top;
public int extend_window;
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/payments.starGiftUpgradeAttributes"/></para></summary>
[TLDef(0x46C6E36F)]
public sealed partial class Payments_StarGiftUpgradeAttributes : IObject
{
public StarGiftAttribute[] attributes;
}
}

View file

@ -396,6 +396,24 @@ namespace TL
form_id = form_id,
});
/// <summary><para>See <a href="https://corefork.telegram.org/method/auth.initPasskeyLogin"/></para></summary>
public static Task<Auth_PasskeyLoginOptions> Auth_InitPasskeyLogin(this Client client, int api_id, string api_hash)
=> client.Invoke(new Auth_InitPasskeyLogin
{
api_id = api_id,
api_hash = api_hash,
});
/// <summary><para>See <a href="https://corefork.telegram.org/method/auth.finishPasskeyLogin"/></para></summary>
public static Task<Auth_AuthorizationBase> Auth_FinishPasskeyLogin(this Client client, InputPasskeyCredential credential, int? from_dc_id = null, long? from_auth_key_id = null)
=> client.Invoke(new Auth_FinishPasskeyLogin
{
flags = (Auth_FinishPasskeyLogin.Flags)((from_dc_id != null ? 0x1 : 0) | (from_auth_key_id != null ? 0x1 : 0)),
credential = credential,
from_dc_id = from_dc_id ?? default,
from_auth_key_id = from_auth_key_id ?? default,
});
/// <summary>Register device to receive <a href="https://corefork.telegram.org/api/push-updates">PUSH notifications</a> <para>See <a href="https://corefork.telegram.org/method/account.registerDevice"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/account.registerDevice#possible-errors">details</a>)</para></summary>
/// <param name="no_muted">Avoid receiving (silent and invisible background) notifications. Useful to save battery.</param>
/// <param name="token_type">Device token type, see <a href="https://corefork.telegram.org/api/push-updates#subscribing-to-notifications">PUSH updates</a> for the possible values.</param>
@ -1510,6 +1528,32 @@ namespace TL
hash = hash,
});
/// <summary><para>See <a href="https://corefork.telegram.org/method/account.initPasskeyRegistration"/></para></summary>
public static Task<Account_PasskeyRegistrationOptions> Account_InitPasskeyRegistration(this Client client)
=> client.Invoke(new Account_InitPasskeyRegistration
{
});
/// <summary><para>See <a href="https://corefork.telegram.org/method/account.registerPasskey"/></para></summary>
public static Task<Passkey> Account_RegisterPasskey(this Client client, InputPasskeyCredential credential)
=> client.Invoke(new Account_RegisterPasskey
{
credential = credential,
});
/// <summary><para>See <a href="https://corefork.telegram.org/method/account.getPasskeys"/></para></summary>
public static Task<Account_Passkeys> Account_GetPasskeys(this Client client)
=> client.Invoke(new Account_GetPasskeys
{
});
/// <summary><para>See <a href="https://corefork.telegram.org/method/account.deletePasskey"/></para></summary>
public static Task<bool> Account_DeletePasskey(this Client client, string id)
=> client.Invoke(new Account_DeletePasskey
{
id = id,
});
/// <summary>Returns basic user info according to their identifiers. <para>See <a href="https://corefork.telegram.org/method/users.getUsers"/> [bots: ✓]</para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/users.getUsers#possible-errors">details</a>)</para></summary>
/// <param name="id">List of user identifiers</param>
public static Task<UserBase[]> Users_GetUsers(this Client client, params InputUserBase[] id)
@ -2089,10 +2133,10 @@ namespace TL
/// <param name="video_timestamp">Start playing the video at the specified timestamp (seconds).</param>
/// <param name="allow_paid_stars">For <a href="https://corefork.telegram.org/api/paid-messages">paid messages »</a>, specifies the amount of <a href="https://corefork.telegram.org/api/stars">Telegram Stars</a> the user has agreed to pay in order to send the message.</param>
/// <param name="suggested_post">Used to <a href="https://corefork.telegram.org/api/suggested-posts">suggest a post to a channel, see here »</a> for more info on the full flow.</param>
public static Task<UpdatesBase> Messages_ForwardMessages(this Client client, InputPeer from_peer, int[] id, long[] random_id, InputPeer to_peer, int? top_msg_id = null, DateTime? schedule_date = null, InputPeer send_as = null, InputQuickReplyShortcutBase quick_reply_shortcut = null, int? video_timestamp = null, long? allow_paid_stars = null, InputReplyTo reply_to = null, SuggestedPost suggested_post = null, int? schedule_repeat_period = null, bool silent = false, bool background = false, bool with_my_score = false, bool drop_author = false, bool drop_media_captions = false, bool noforwards = false, bool allow_paid_floodskip = false)
public static Task<UpdatesBase> Messages_ForwardMessages(this Client client, InputPeer from_peer, int[] id, long[] random_id, InputPeer to_peer, int? top_msg_id = null, DateTime? schedule_date = null, InputPeer send_as = null, InputQuickReplyShortcutBase quick_reply_shortcut = null, long? effect = null, int? video_timestamp = null, long? allow_paid_stars = null, InputReplyTo reply_to = null, SuggestedPost suggested_post = null, int? schedule_repeat_period = null, bool silent = false, bool background = false, bool with_my_score = false, bool drop_author = false, bool drop_media_captions = false, bool noforwards = false, bool allow_paid_floodskip = false)
=> client.Invoke(new Messages_ForwardMessages
{
flags = (Messages_ForwardMessages.Flags)((top_msg_id != null ? 0x200 : 0) | (schedule_date != null ? 0x400 : 0) | (send_as != null ? 0x2000 : 0) | (quick_reply_shortcut != null ? 0x20000 : 0) | (video_timestamp != null ? 0x100000 : 0) | (allow_paid_stars != null ? 0x200000 : 0) | (reply_to != null ? 0x400000 : 0) | (suggested_post != null ? 0x800000 : 0) | (schedule_repeat_period != null ? 0x1000000 : 0) | (silent ? 0x20 : 0) | (background ? 0x40 : 0) | (with_my_score ? 0x100 : 0) | (drop_author ? 0x800 : 0) | (drop_media_captions ? 0x1000 : 0) | (noforwards ? 0x4000 : 0) | (allow_paid_floodskip ? 0x80000 : 0)),
flags = (Messages_ForwardMessages.Flags)((top_msg_id != null ? 0x200 : 0) | (schedule_date != null ? 0x400 : 0) | (send_as != null ? 0x2000 : 0) | (quick_reply_shortcut != null ? 0x20000 : 0) | (effect != null ? 0x40000 : 0) | (video_timestamp != null ? 0x100000 : 0) | (allow_paid_stars != null ? 0x200000 : 0) | (reply_to != null ? 0x400000 : 0) | (suggested_post != null ? 0x800000 : 0) | (schedule_repeat_period != null ? 0x1000000 : 0) | (silent ? 0x20 : 0) | (background ? 0x40 : 0) | (with_my_score ? 0x100 : 0) | (drop_author ? 0x800 : 0) | (drop_media_captions ? 0x1000 : 0) | (noforwards ? 0x4000 : 0) | (allow_paid_floodskip ? 0x80000 : 0)),
from_peer = from_peer,
id = id,
random_id = random_id,
@ -2103,6 +2147,7 @@ namespace TL
schedule_repeat_period = schedule_repeat_period ?? default,
send_as = send_as,
quick_reply_shortcut = quick_reply_shortcut,
effect = effect ?? default,
video_timestamp = video_timestamp ?? default,
allow_paid_stars = allow_paid_stars ?? default,
suggested_post = suggested_post,
@ -6804,6 +6849,34 @@ namespace TL
hash = hash,
});
/// <summary><para>See <a href="https://corefork.telegram.org/method/payments.resolveStarGiftOffer"/></para></summary>
public static Task<UpdatesBase> Payments_ResolveStarGiftOffer(this Client client, int offer_msg_id, bool decline = false)
=> client.Invoke(new Payments_ResolveStarGiftOffer
{
flags = (Payments_ResolveStarGiftOffer.Flags)(decline ? 0x1 : 0),
offer_msg_id = offer_msg_id,
});
/// <summary><para>See <a href="https://corefork.telegram.org/method/payments.sendStarGiftOffer"/></para></summary>
public static Task<UpdatesBase> Payments_SendStarGiftOffer(this Client client, InputPeer peer, string slug, StarsAmountBase price, int duration, long random_id, long? allow_paid_stars = null)
=> client.Invoke(new Payments_SendStarGiftOffer
{
flags = (Payments_SendStarGiftOffer.Flags)(allow_paid_stars != null ? 0x1 : 0),
peer = peer,
slug = slug,
price = price,
duration = duration,
random_id = random_id,
allow_paid_stars = allow_paid_stars ?? default,
});
/// <summary><para>See <a href="https://corefork.telegram.org/method/payments.getStarGiftUpgradeAttributes"/></para></summary>
public static Task<Payments_StarGiftUpgradeAttributes> Payments_GetStarGiftUpgradeAttributes(this Client client, long gift_id)
=> client.Invoke(new Payments_GetStarGiftUpgradeAttributes
{
gift_id = gift_id,
});
/// <summary>Create a stickerset. <para>See <a href="https://corefork.telegram.org/method/stickers.createStickerSet"/> [bots: ✓]</para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/stickers.createStickerSet#possible-errors">details</a>)</para></summary>
/// <param name="masks">Whether this is a mask stickerset</param>
/// <param name="emojis">Whether this is a <a href="https://corefork.telegram.org/api/custom-emoji">custom emoji</a> stickerset.</param>
@ -8489,6 +8562,27 @@ namespace TL.Methods
public long form_id;
}
[TLDef(0x518AD0B7)]
public sealed partial class Auth_InitPasskeyLogin : IMethod<Auth_PasskeyLoginOptions>
{
public int api_id;
public string api_hash;
}
[TLDef(0x9857AD07)]
public sealed partial class Auth_FinishPasskeyLogin : IMethod<Auth_AuthorizationBase>
{
public Flags flags;
public InputPasskeyCredential credential;
[IfFlag(0)] public int from_dc_id;
[IfFlag(0)] public long from_auth_key_id;
[Flags] public enum Flags : uint
{
has_from_dc_id = 0x1,
}
}
[TLDef(0xEC86017A)]
public sealed partial class Account_RegisterDevice : IMethod<bool>
{
@ -9392,6 +9486,24 @@ namespace TL.Methods
public long hash;
}
[TLDef(0x429547E8)]
public sealed partial class Account_InitPasskeyRegistration : IMethod<Account_PasskeyRegistrationOptions> { }
[TLDef(0x55B41FD6)]
public sealed partial class Account_RegisterPasskey : IMethod<Passkey>
{
public InputPasskeyCredential credential;
}
[TLDef(0xEA1F0C52)]
public sealed partial class Account_GetPasskeys : IMethod<Account_Passkeys> { }
[TLDef(0xF5B5563F)]
public sealed partial class Account_DeletePasskey : IMethod<bool>
{
public string id;
}
[TLDef(0x0D91A548)]
public sealed partial class Users_GetUsers : IMethod<UserBase[]>
{
@ -9877,7 +9989,7 @@ namespace TL.Methods
}
}
[TLDef(0x41D41ADE)]
[TLDef(0x13704A7C)]
public sealed partial class Messages_ForwardMessages : IMethod<UpdatesBase>
{
public Flags flags;
@ -9891,6 +10003,7 @@ namespace TL.Methods
[IfFlag(24)] public int schedule_repeat_period;
[IfFlag(13)] public InputPeer send_as;
[IfFlag(17)] public InputQuickReplyShortcutBase quick_reply_shortcut;
[IfFlag(18)] public long effect;
[IfFlag(20)] public int video_timestamp;
[IfFlag(21)] public long allow_paid_stars;
[IfFlag(23)] public SuggestedPost suggested_post;
@ -9907,6 +10020,7 @@ namespace TL.Methods
has_send_as = 0x2000,
noforwards = 0x4000,
has_quick_reply_shortcut = 0x20000,
has_effect = 0x40000,
allow_paid_floodskip = 0x80000,
has_video_timestamp = 0x100000,
has_allow_paid_stars = 0x200000,
@ -13854,6 +13968,41 @@ namespace TL.Methods
public long hash;
}
[TLDef(0xE9CE781C)]
public sealed partial class Payments_ResolveStarGiftOffer : IMethod<UpdatesBase>
{
public Flags flags;
public int offer_msg_id;
[Flags] public enum Flags : uint
{
decline = 0x1,
}
}
[TLDef(0x8FB86B41)]
public sealed partial class Payments_SendStarGiftOffer : IMethod<UpdatesBase>
{
public Flags flags;
public InputPeer peer;
public string slug;
public StarsAmountBase price;
public int duration;
public long random_id;
[IfFlag(0)] public long allow_paid_stars;
[Flags] public enum Flags : uint
{
has_allow_paid_stars = 0x1,
}
}
[TLDef(0x6D038B58)]
public sealed partial class Payments_GetStarGiftUpgradeAttributes : IMethod<Payments_StarGiftUpgradeAttributes>
{
public long gift_id;
}
[TLDef(0x9021AB67)]
public sealed partial class Stickers_CreateStickerSet : IMethod<Messages_StickerSet>
{

View file

@ -6,7 +6,7 @@ namespace TL
{
public static partial class Layer
{
public const int Version = 218; // fetched 11/15/2025 21:06:24
public const int Version = 220; // fetched 12/06/2025 13:11:05
internal const int SecretChats = 144;
internal const int MTProto2 = 73;
internal const uint VectorCtor = 0x1CB5C415;
@ -219,7 +219,7 @@ namespace TL
[0x41B3E202] = typeof(MessageActionPaymentRefunded),
[0x45D5B021] = typeof(MessageActionGiftStars),
[0xB00C47A2] = typeof(MessageActionPrizeStars),
[0xDB596550] = typeof(MessageActionStarGift),
[0xEA2C31D3] = typeof(MessageActionStarGift),
[0x95728543] = typeof(MessageActionStarGiftUnique),
[0xAC1F1FCD] = typeof(MessageActionPaidMessagesRefunded),
[0x84B88578] = typeof(MessageActionPaidMessagesPrice),
@ -231,6 +231,8 @@ namespace TL
[0x69F916F8] = typeof(MessageActionSuggestedPostRefund),
[0xA8A3C699] = typeof(MessageActionGiftTon),
[0x2C8F2A25] = typeof(MessageActionSuggestBirthday),
[0x774278D4] = typeof(MessageActionStarGiftPurchaseOffer),
[0x73ADA76B] = typeof(MessageActionStarGiftPurchaseOfferDeclined),
[0xD58A08C6] = typeof(Dialog),
[0x71BD134C] = typeof(DialogFolder),
[0x2331B22D] = typeof(PhotoEmpty),
@ -1020,7 +1022,7 @@ namespace TL
[0x50CC03D3] = typeof(WebPageAttributeStickerSet),
[0xCF6F6DB8] = typeof(WebPageAttributeUniqueStarGift),
[0x31CAD303] = typeof(WebPageAttributeStarGiftCollection),
[0x034986AB] = typeof(WebPageAttributeStarGiftAuction),
[0x01C641C2] = typeof(WebPageAttributeStarGiftAuction),
[0x4899484E] = typeof(Messages_VotesList),
[0xF568028A] = typeof(BankCardOpenUrl),
[0x3E24E573] = typeof(Payments_BankCardData),
@ -1384,8 +1386,8 @@ namespace TL
[0x4BA3A95A] = typeof(MessageReactor),
[0x94CE852A] = typeof(StarsGiveawayOption),
[0x54236209] = typeof(StarsGiveawayWinnersOption),
[0x1B9A4D7F] = typeof(StarGift),
[0xB0BF741B] = typeof(StarGiftUnique),
[0x313A9547] = typeof(StarGift),
[0x569D64C9] = typeof(StarGiftUnique),
[0xA388A368] = null,//Payments_StarGiftsNotModified
[0x2ED82995] = typeof(Payments_StarGifts),
[0x7903E3D9] = typeof(MessageReportOption),
@ -1414,7 +1416,7 @@ namespace TL
[0x315A4974] = typeof(Users_UsersSlice),
[0x416C56E8] = typeof(Payments_UniqueStarGift),
[0x8C9A88AC] = typeof(Messages_WebPagePreview),
[0x8983A452] = typeof(SavedStarGift),
[0xEAD6805E] = typeof(SavedStarGift),
[0x95F389B1] = typeof(Payments_SavedStarGifts),
[0x69279795] = typeof(InputSavedStarGiftUser),
[0xF101AA7F] = typeof(InputSavedStarGiftChat),
@ -1468,17 +1470,28 @@ namespace TL
[0x711D692D] = typeof(RecentStory),
[0x310240CC] = typeof(AuctionBidLevel),
[0xFE333952] = null,//StarGiftAuctionStateNotModified
[0x5DB04F4B] = typeof(StarGiftAuctionState),
[0x7D967C3A] = typeof(StarGiftAuctionStateFinished),
[0x771A4E66] = typeof(StarGiftAuctionState),
[0x972DABBF] = typeof(StarGiftAuctionStateFinished),
[0x2EEED1C4] = typeof(StarGiftAuctionUserState),
[0x0E98E474] = typeof(Payments_StarGiftAuctionState),
[0xAB60E20B] = typeof(StarGiftAuctionAcquiredGift),
[0x6B39F4EC] = typeof(Payments_StarGiftAuctionState),
[0x42B00348] = typeof(StarGiftAuctionAcquiredGift),
[0x7D5BD1F0] = typeof(Payments_StarGiftAuctionAcquiredGifts),
[0xD31BC45D] = typeof(StarGiftActiveAuctionState),
[0xDB33DAD0] = null,//Payments_StarGiftActiveAuctionsNotModified
[0x97F187D8] = typeof(Payments_StarGiftActiveAuctions),
[0xAEF6ABBC] = typeof(Payments_StarGiftActiveAuctions),
[0x02E16C98] = typeof(InputStarGiftAuction),
[0x7AB58308] = typeof(InputStarGiftAuctionSlug),
[0x98613EBF] = typeof(Passkey),
[0xF8E0AA1C] = typeof(Account_Passkeys),
[0xE16B5CE1] = typeof(Account_PasskeyRegistrationOptions),
[0xE2037789] = typeof(Auth_PasskeyLoginOptions),
[0x3E63935C] = typeof(InputPasskeyResponseRegister),
[0xC31FC14A] = typeof(InputPasskeyResponseLogin),
[0x3C27B78F] = typeof(InputPasskeyCredentialPublicKey),
[0xAFF56398] = typeof(StarGiftBackground),
[0x3AAE0528] = typeof(StarGiftAuctionRound),
[0x0AA021E5] = typeof(StarGiftAuctionRoundExtendable),
[0x46C6E36F] = typeof(Payments_StarGiftUpgradeAttributes),
// from TL.Secret:
[0x6ABD9782] = typeof(Layer143.DecryptedMessageMediaDocument),
[0x020DF5D0] = typeof(Layer101.MessageEntityBlockquote),

View file

@ -13,8 +13,8 @@
<PackageId>WTelegramClient</PackageId>
<Authors>Wizou</Authors>
<VersionPrefix>0.0.0</VersionPrefix>
<VersionSuffix>layer.218</VersionSuffix>
<Description>Telegram Client API (MTProto) library written 100% in C# and .NET Standard | Latest API layer: 218
<VersionSuffix>layer.220</VersionSuffix>
<Description>Telegram Client API (MTProto) library written 100% in C# and .NET Standard | Latest API layer: 220
Release Notes:
$(ReleaseNotes)</Description>