Compare commits

...

2 commits

Author SHA1 Message Date
Wizou d9e4b7cc0f CollectUsersChats: don't update usernames from min info
Some checks failed
Dev build / build (push) Has been cancelled
(thx @riniba)
2025-08-01 00:17:12 +02:00
Wizou 30a982b0ac API Layer 210: user's Stars Rating, StarGift collections management & more characteristics...
(that might not be the most recent layer. check https://patreon.com/wizou for the latest layers)
2025-07-25 17:01:58 +02:00
6 changed files with 189 additions and 21 deletions

View file

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

@ -29,7 +29,9 @@ namespace TL
if (!user.flags.HasFlag(User.Flags.min) || !_users.TryGetValue(user.id, out var prevUser) || prevUser.flags.HasFlag(User.Flags.min)) if (!user.flags.HasFlag(User.Flags.min) || !_users.TryGetValue(user.id, out var prevUser) || prevUser.flags.HasFlag(User.Flags.min))
_users[user.id] = user; _users[user.id] = user;
else else
{ // update previously full user from min user: { // update previously full user from min user:
// see https://github.com/tdlib/td/blob/master/td/telegram/UserManager.cpp#L2689
// and https://github.com/telegramdesktop/tdesktop/blob/dev/Telegram/SourceFiles/data/data_session.cpp#L515
const User.Flags updated_flags = (User.Flags)0x5DAFE000; const User.Flags updated_flags = (User.Flags)0x5DAFE000;
const User.Flags2 updated_flags2 = (User.Flags2)0x711; const User.Flags2 updated_flags2 = (User.Flags2)0x711;
// tdlib updated flags: deleted | bot | bot_chat_history | bot_nochats | verified | bot_inline_geo // tdlib updated flags: deleted | bot | bot_chat_history | bot_nochats | verified | bot_inline_geo
@ -53,7 +55,7 @@ namespace TL
if (user.lang_code != null) if (user.lang_code != null)
prevUser.lang_code = user.lang_code; // tdlib: updated if present ; tdesktop: ignored prevUser.lang_code = user.lang_code; // tdlib: updated if present ; tdesktop: ignored
prevUser.emoji_status = user.emoji_status; // tdlib/tdesktop: updated prevUser.emoji_status = user.emoji_status; // tdlib/tdesktop: updated
prevUser.usernames = user.usernames; // tdlib: not updated ; tdesktop: updated //prevUser.usernames = user.usernames; // tdlib/tdesktop: not updated
if (user.stories_max_id > 0) if (user.stories_max_id > 0)
prevUser.stories_max_id = user.stories_max_id; // tdlib: updated if > 0 ; tdesktop: not updated prevUser.stories_max_id = user.stories_max_id; // tdlib: updated if > 0 ; tdesktop: not updated
prevUser.color = user.color; // tdlib/tdesktop: updated prevUser.color = user.color; // tdlib/tdesktop: updated

View file

@ -898,7 +898,7 @@ namespace TL
has_color = 0x100, has_color = 0x100,
/// <summary>Field <see cref="profile_color"/> has a value</summary> /// <summary>Field <see cref="profile_color"/> has a value</summary>
has_profile_color = 0x200, has_profile_color = 0x200,
/// <summary>If set, we can only write to this user if they have already sent some messages to us, if we are subscribed to <a href="https://corefork.telegram.org/api/premium">Telegram Premium</a>, or if they're a mutual contact (<see cref="User"/>.<c>mutual_contact</c>). <br/>All the secondary conditions listed above must be checked separately to verify whether we can still write to the user, even if this flag is set (i.e. a mutual contact will have this flag set even if we can still write to them, and so on...); to avoid doing these extra checks if we haven't yet cached all the required information (for example while displaying the chat list in the sharing UI) the <see cref="SchemaExtensions.Users_GetIsPremiumRequiredToContact">Users_GetIsPremiumRequiredToContact</see> method may be invoked instead, passing the list of users currently visible in the UI, returning a list of booleans that directly specify whether we can or cannot write to each user; alternatively, the <see cref="UserFull"/>.<c>contact_require_premium</c> flag contains the same (fully checked, i.e. it's not just a copy of this flag) info returned by <see cref="SchemaExtensions.Users_GetIsPremiumRequiredToContact">Users_GetIsPremiumRequiredToContact</see>. <br/>To set this flag for ourselves invoke <see cref="SchemaExtensions.Account_SetGlobalPrivacySettings">Account_SetGlobalPrivacySettings</see>, setting the <c>settings.new_noncontact_peers_require_premium</c> flag.</summary> /// <summary>See <a href="https://corefork.telegram.org/api/privacy#require-premium-for-new-non-contact-users">here for more info on this flag »</a>.</summary>
contact_require_premium = 0x400, contact_require_premium = 0x400,
/// <summary>Whether this bot can be <a href="https://corefork.telegram.org/api/business#connected-bots">connected to a user as specified here »</a>.</summary> /// <summary>Whether this bot can be <a href="https://corefork.telegram.org/api/business#connected-bots">connected to a user as specified here »</a>.</summary>
bot_business = 0x800, bot_business = 0x800,
@ -3742,7 +3742,7 @@ namespace TL
} }
/// <summary>Extended user info <para>See <a href="https://corefork.telegram.org/constructor/userFull"/></para></summary> /// <summary>Extended user info <para>See <a href="https://corefork.telegram.org/constructor/userFull"/></para></summary>
[TLDef(0x99E78045)] [TLDef(0x29DE80BE)]
public sealed partial class UserFull : IObject public sealed partial class UserFull : IObject
{ {
/// <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>
@ -3808,6 +3808,7 @@ namespace TL
[IfFlag(44)] public BotVerification bot_verification; [IfFlag(44)] public BotVerification bot_verification;
[IfFlag(46)] public long send_paid_messages_stars; [IfFlag(46)] public long send_paid_messages_stars;
[IfFlag(47)] public DisallowedGiftsSettings disallowed_gifts; [IfFlag(47)] public DisallowedGiftsSettings disallowed_gifts;
[IfFlag(49)] public StarsRating stars_rating;
[Flags] public enum Flags : uint [Flags] public enum Flags : uint
{ {
@ -3900,6 +3901,8 @@ namespace TL
/// <summary>Field <see cref="disallowed_gifts"/> has a value</summary> /// <summary>Field <see cref="disallowed_gifts"/> has a value</summary>
has_disallowed_gifts = 0x8000, has_disallowed_gifts = 0x8000,
display_gifts_button = 0x10000, display_gifts_button = 0x10000,
/// <summary>Field <see cref="stars_rating"/> has a value</summary>
has_stars_rating = 0x20000,
} }
} }
@ -14719,6 +14722,7 @@ namespace TL
{ {
/// <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>
public Flags flags; public Flags flags;
/// <summary>If configured, specifies the number of <a href="https://corefork.telegram.org/api/stars">stars</a> users must pay us to send us a message, see <a href="https://corefork.telegram.org/api/paid-messages">here »</a> for more info on paid messages.</summary>
[IfFlag(5)] public long noncontact_peers_paid_stars; [IfFlag(5)] public long noncontact_peers_paid_stars;
[IfFlag(6)] public DisallowedGiftsSettings disallowed_gifts; [IfFlag(6)] public DisallowedGiftsSettings disallowed_gifts;
@ -14732,7 +14736,7 @@ namespace TL
keep_archived_folders = 0x4, keep_archived_folders = 0x4,
/// <summary>If this flag is set, the <see cref="InputPrivacyKey.StatusTimestamp"/> key will also apply to the ability to use <see cref="SchemaExtensions.Messages_GetOutboxReadDate">Messages_GetOutboxReadDate</see> on messages sent to us. <br/>Meaning, users that cannot see <em>our</em> exact last online date due to the current value of the <see cref="InputPrivacyKey.StatusTimestamp"/> key will receive a <c>403 USER_PRIVACY_RESTRICTED</c> error when invoking <see cref="SchemaExtensions.Messages_GetOutboxReadDate">Messages_GetOutboxReadDate</see> to fetch the exact read date of a message they sent to us. <br/>The <see cref="UserFull"/>.<c>read_dates_private</c> flag will be set for users that have this flag enabled.</summary> /// <summary>If this flag is set, the <see cref="InputPrivacyKey.StatusTimestamp"/> key will also apply to the ability to use <see cref="SchemaExtensions.Messages_GetOutboxReadDate">Messages_GetOutboxReadDate</see> on messages sent to us. <br/>Meaning, users that cannot see <em>our</em> exact last online date due to the current value of the <see cref="InputPrivacyKey.StatusTimestamp"/> key will receive a <c>403 USER_PRIVACY_RESTRICTED</c> error when invoking <see cref="SchemaExtensions.Messages_GetOutboxReadDate">Messages_GetOutboxReadDate</see> to fetch the exact read date of a message they sent to us. <br/>The <see cref="UserFull"/>.<c>read_dates_private</c> flag will be set for users that have this flag enabled.</summary>
hide_read_marks = 0x8, hide_read_marks = 0x8,
/// <summary>If set, only users that have a premium account, are in our contact list, or already have a private chat with us can write to us; a <c>403 PRIVACY_PREMIUM_REQUIRED</c> error will be emitted otherwise. <br/>The <see cref="UserFull"/>.<c>contact_require_premium</c> flag will be set for users that have this flag enabled. <br/>To check whether we can write to a user with this flag enabled, if we haven't yet cached all the required information (for example we don't have the <see cref="UserFull"/> or history of all users while displaying the chat list in the sharing UI) the <see cref="SchemaExtensions.Users_GetIsPremiumRequiredToContact">Users_GetIsPremiumRequiredToContact</see> method may be invoked, passing the list of users currently visible in the UI, returning a list of booleans that directly specify whether we can or cannot write to each user. <br/>This option may be enabled by both non-<a href="https://corefork.telegram.org/api/premium">Premium</a> and <a href="https://corefork.telegram.org/api/premium">Premium</a> users only if the <a href="https://corefork.telegram.org/api/config#new-noncontact-peers-require-premium-without-ownpremium">new_noncontact_peers_require_premium_without_ownpremium client configuration flag »</a> is equal to true, otherwise it may be enabled only by <a href="https://corefork.telegram.org/api/premium">Premium</a> users and non-Premium users will receive a <c>PREMIUM_ACCOUNT_REQUIRED</c> error when trying to enable this flag.</summary> /// <summary>See <a href="https://corefork.telegram.org/api/privacy#require-premium-for-new-non-contact-users">here for more info on this flag »</a>.</summary>
new_noncontact_peers_require_premium = 0x10, new_noncontact_peers_require_premium = 0x10,
/// <summary>Field <see cref="noncontact_peers_paid_stars"/> has a value</summary> /// <summary>Field <see cref="noncontact_peers_paid_stars"/> has a value</summary>
has_noncontact_peers_paid_stars = 0x20, has_noncontact_peers_paid_stars = 0x20,
@ -20094,7 +20098,7 @@ namespace TL
public virtual Peer ReleasedBy => default; 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> /// <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(0x7F853C12)] [TLDef(0x00BCFF5B)]
public sealed partial class StarGift : StarGiftBase public sealed partial class StarGift : StarGiftBase
{ {
/// <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>
@ -20120,6 +20124,8 @@ namespace TL
[IfFlag(4)] public long resell_min_stars; [IfFlag(4)] public long resell_min_stars;
[IfFlag(5)] public string title; [IfFlag(5)] public string title;
[IfFlag(6)] public Peer released_by; [IfFlag(6)] public Peer released_by;
[IfFlag(8)] public int per_user_total;
[IfFlag(8)] public int per_user_remains;
[Flags] public enum Flags : uint [Flags] public enum Flags : uint
{ {
@ -20137,6 +20143,8 @@ namespace TL
has_title = 0x20, has_title = 0x20,
/// <summary>Field <see cref="released_by"/> has a value</summary> /// <summary>Field <see cref="released_by"/> has a value</summary>
has_released_by = 0x40, has_released_by = 0x40,
require_premium = 0x80,
limited_per_user = 0x100,
} }
/// <summary>Identifier of the gift</summary> /// <summary>Identifier of the gift</summary>
@ -20180,6 +20188,7 @@ namespace TL
has_resell_stars = 0x10, has_resell_stars = 0x10,
/// <summary>Field <see cref="released_by"/> has a value</summary> /// <summary>Field <see cref="released_by"/> has a value</summary>
has_released_by = 0x20, has_released_by = 0x20,
require_premium = 0x40,
} }
public override long ID => id; public override long ID => id;
@ -20571,7 +20580,7 @@ namespace TL
} }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/savedStarGift"/></para></summary> /// <summary><para>See <a href="https://corefork.telegram.org/constructor/savedStarGift"/></para></summary>
[TLDef(0xDFDA0499)] [TLDef(0x1EA646DF)]
public sealed partial class SavedStarGift : IObject public sealed partial class SavedStarGift : IObject
{ {
/// <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>
@ -20588,6 +20597,7 @@ namespace TL
[IfFlag(8)] public long transfer_stars; [IfFlag(8)] public long transfer_stars;
[IfFlag(13)] public DateTime can_transfer_at; [IfFlag(13)] public DateTime can_transfer_at;
[IfFlag(14)] public DateTime can_resell_at; [IfFlag(14)] public DateTime can_resell_at;
[IfFlag(15)] public int[] collection_id;
[Flags] public enum Flags : uint [Flags] public enum Flags : uint
{ {
@ -20616,6 +20626,8 @@ namespace TL
has_can_transfer_at = 0x2000, has_can_transfer_at = 0x2000,
/// <summary>Field <see cref="can_resell_at"/> has a value</summary> /// <summary>Field <see cref="can_resell_at"/> has a value</summary>
has_can_resell_at = 0x4000, has_can_resell_at = 0x4000,
/// <summary>Field <see cref="collection_id"/> has a value</summary>
has_collection_id = 0x8000,
} }
} }
@ -20905,4 +20917,45 @@ namespace TL
has_price = 0x8, has_price = 0x8,
} }
} }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/starsRating"/></para></summary>
[TLDef(0x1B0E4F07)]
public sealed partial class StarsRating : IObject
{
public Flags flags;
public int level;
public long current_level_stars;
public long stars;
[IfFlag(0)] public long next_level_stars;
[Flags] public enum Flags : uint
{
has_next_level_stars = 0x1,
}
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/starGiftCollection"/></para></summary>
[TLDef(0x9D6B13B0)]
public sealed partial class StarGiftCollection : IObject
{
public Flags flags;
public int collection_id;
public string title;
[IfFlag(0)] public DocumentBase icon;
public int gifts_count;
public long hash;
[Flags] public enum Flags : uint
{
has_icon = 0x1,
}
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/payments.starGiftCollections"/></para></summary>
/// <remarks>a <see langword="null"/> value means <a href="https://corefork.telegram.org/constructor/payments.starGiftCollectionsNotModified">payments.starGiftCollectionsNotModified</a></remarks>
[TLDef(0x8A2932F3)]
public sealed partial class Payments_StarGiftCollections : IObject
{
public StarGiftCollection[] collections;
}
} }

View file

@ -1433,7 +1433,9 @@ namespace TL
hash = hash, hash = hash,
}); });
/// <summary><para>See <a href="https://corefork.telegram.org/method/account.getPaidMessagesRevenue"/> [bots: ✓]</para></summary> /// <summary>Get the number of stars we have received from the specified user thanks to <a href="https://corefork.telegram.org/api/paid-messages">paid messages »</a>; the received amount will be equal to the sent amount multiplied by <a href="https://corefork.telegram.org/api/config#stars-paid-message-commission-permille">stars_paid_message_commission_permille</a> divided by 1000. <para>See <a href="https://corefork.telegram.org/method/account.getPaidMessagesRevenue"/> [bots: ✓]</para></summary>
/// <param name="parent_peer">If set, can contain the ID of a <a href="https://corefork.telegram.org/api/forum#monoforums">monoforum (channel direct messages)</a> to obtain the number of stars the user has spent to send us direct messages via the channel.</param>
/// <param name="user_id">The user that paid to send us messages.</param>
public static Task<Account_PaidMessagesRevenue> Account_GetPaidMessagesRevenue(this Client client, InputUserBase user_id, InputPeer parent_peer = null) public static Task<Account_PaidMessagesRevenue> Account_GetPaidMessagesRevenue(this Client client, InputUserBase user_id, InputPeer parent_peer = null)
=> client.Invoke(new Account_GetPaidMessagesRevenue => client.Invoke(new Account_GetPaidMessagesRevenue
{ {
@ -1442,7 +1444,11 @@ namespace TL
user_id = user_id, user_id = user_id,
}); });
/// <summary><para>See <a href="https://corefork.telegram.org/method/account.toggleNoPaidMessagesException"/> [bots: ✓]</para></summary> /// <summary>Allow a user to send us messages without paying if <a href="https://corefork.telegram.org/api/paid-messages">paid messages »</a> are enabled. <para>See <a href="https://corefork.telegram.org/method/account.toggleNoPaidMessagesException"/> [bots: ✓]</para></summary>
/// <param name="refund_charged">If set and <c>require_payment</c> is not set, refunds the amounts the user has already paid us to send us messages (directly or via a monoforum).</param>
/// <param name="require_payment">Allow or disallow a user to send us messages without paying.</param>
/// <param name="parent_peer">If set, applies the setting within the <a href="https://corefork.telegram.org/api/forum#monoforums">monoforum aka direct messages »</a> (pass the ID of the monoforum, <strong>not</strong> the ID of the associated channel).</param>
/// <param name="user_id">The user to exempt or unexempt.</param>
public static Task<bool> Account_ToggleNoPaidMessagesException(this Client client, InputUserBase user_id, InputPeer parent_peer = null, bool refund_charged = false, bool require_payment = false) public static Task<bool> Account_ToggleNoPaidMessagesException(this Client client, InputUserBase user_id, InputPeer parent_peer = null, bool refund_charged = false, bool require_payment = false)
=> client.Invoke(new Account_ToggleNoPaidMessagesException => client.Invoke(new Account_ToggleNoPaidMessagesException
{ {
@ -4659,7 +4665,7 @@ namespace TL
/// <summary>Upload a custom profile picture for a contact, or suggest a new profile picture to a contact. <para>See <a href="https://corefork.telegram.org/method/photos.uploadContactProfilePhoto"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/photos.uploadContactProfilePhoto#possible-errors">details</a>)</para></summary> /// <summary>Upload a custom profile picture for a contact, or suggest a new profile picture to a contact. <para>See <a href="https://corefork.telegram.org/method/photos.uploadContactProfilePhoto"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/photos.uploadContactProfilePhoto#possible-errors">details</a>)</para></summary>
/// <param name="suggest">If set, will send a <see cref="MessageActionSuggestProfilePhoto"/> service message to <c>user_id</c>, suggesting them to use the specified profile picture; otherwise, will set a personal profile picture for the user (only visible to the current user).</param> /// <param name="suggest">If set, will send a <see cref="MessageActionSuggestProfilePhoto"/> service message to <c>user_id</c>, suggesting them to use the specified profile picture; otherwise, will set a personal profile picture for the user (only visible to the current user).</param>
/// <param name="save">If set, removes a previously set personal profile picture (does not affect suggested profile pictures, to remove them simply deleted the <see cref="MessageActionSuggestProfilePhoto"/> service message with <see cref="Messages_DeleteMessages">Messages_DeleteMessages</see>).</param> /// <param name="save">If set, removes a previously set personal profile picture (does not affect suggested profile pictures, to remove them simply delete the <see cref="MessageActionSuggestProfilePhoto"/> service message with <see cref="Messages_DeleteMessages">Messages_DeleteMessages</see>).</param>
/// <param name="user_id">The contact</param> /// <param name="user_id">The contact</param>
/// <param name="file">Profile photo</param> /// <param name="file">Profile photo</param>
/// <param name="video"><a href="https://corefork.telegram.org/api/files#animated-profile-pictures">Animated profile picture</a> video</param> /// <param name="video"><a href="https://corefork.telegram.org/api/files#animated-profile-pictures">Animated profile picture</a> video</param>
@ -5648,7 +5654,10 @@ namespace TL
limit = limit, limit = limit,
}); });
/// <summary><para>See <a href="https://corefork.telegram.org/method/channels.updatePaidMessagesPrice"/> [bots: ✓]</para></summary> /// <summary>Enable or disable <a href="https://corefork.telegram.org/api/paid-messages">paid messages »</a> in this <a href="https://corefork.telegram.org/api/channel">supergroup</a> or <a href="https://corefork.telegram.org/api/forum#monoforums">monoforum</a>. <para>See <a href="https://corefork.telegram.org/method/channels.updatePaidMessagesPrice"/> [bots: ✓]</para></summary>
/// <param name="broadcast_messages_allowed">Only usable for channels, enables or disables the associated <a href="https://corefork.telegram.org/api/forum#monoforums">monoforum aka direct messages</a>.</param>
/// <param name="channel">Pass the supergroup ID for supergroups and the ID of the <a href="https://corefork.telegram.org/api/channel">channel</a> to modify the setting in the associated monoforum.</param>
/// <param name="send_paid_messages_stars">Specifies the required amount of <a href="https://corefork.telegram.org/api/stars">Telegram Stars</a> users must pay to send messages to the supergroup or monoforum.</param>
public static Task<UpdatesBase> Channels_UpdatePaidMessagesPrice(this Client client, InputChannelBase channel, long send_paid_messages_stars, bool broadcast_messages_allowed = false) public static Task<UpdatesBase> Channels_UpdatePaidMessagesPrice(this Client client, InputChannelBase channel, long send_paid_messages_stars, bool broadcast_messages_allowed = false)
=> client.Invoke(new Channels_UpdatePaidMessagesPrice => client.Invoke(new Channels_UpdatePaidMessagesPrice
{ {
@ -6409,11 +6418,12 @@ namespace TL
/// <summary><para>See <a href="https://corefork.telegram.org/method/payments.getSavedStarGifts"/> [bots: ✓]</para></summary> /// <summary><para>See <a href="https://corefork.telegram.org/method/payments.getSavedStarGifts"/> [bots: ✓]</para></summary>
/// <param name="limit">Maximum number of results to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param> /// <param name="limit">Maximum number of results to return, <a href="https://corefork.telegram.org/api/offsets">see pagination</a></param>
public static Task<Payments_SavedStarGifts> Payments_GetSavedStarGifts(this Client client, InputPeer peer, string offset, int limit = int.MaxValue, bool exclude_unsaved = false, bool exclude_saved = false, bool exclude_unlimited = false, bool exclude_limited = false, bool exclude_unique = false, bool sort_by_value = false) public static Task<Payments_SavedStarGifts> Payments_GetSavedStarGifts(this Client client, InputPeer peer, string offset, int limit = int.MaxValue, int? collection_id = null, bool exclude_unsaved = false, bool exclude_saved = false, bool exclude_unlimited = false, bool exclude_limited = false, bool exclude_unique = false, bool sort_by_value = false)
=> client.Invoke(new Payments_GetSavedStarGifts => client.Invoke(new Payments_GetSavedStarGifts
{ {
flags = (Payments_GetSavedStarGifts.Flags)((exclude_unsaved ? 0x1 : 0) | (exclude_saved ? 0x2 : 0) | (exclude_unlimited ? 0x4 : 0) | (exclude_limited ? 0x8 : 0) | (exclude_unique ? 0x10 : 0) | (sort_by_value ? 0x20 : 0)), flags = (Payments_GetSavedStarGifts.Flags)((collection_id != null ? 0x40 : 0) | (exclude_unsaved ? 0x1 : 0) | (exclude_saved ? 0x2 : 0) | (exclude_unlimited ? 0x4 : 0) | (exclude_limited ? 0x8 : 0) | (exclude_unique ? 0x10 : 0) | (sort_by_value ? 0x20 : 0)),
peer = peer, peer = peer,
collection_id = collection_id ?? default,
offset = offset, offset = offset,
limit = limit, limit = limit,
}); });
@ -6477,6 +6487,53 @@ namespace TL
resell_stars = resell_stars, resell_stars = resell_stars,
}); });
/// <summary><para>See <a href="https://corefork.telegram.org/method/payments.createStarGiftCollection"/></para></summary>
public static Task<StarGiftCollection> Payments_CreateStarGiftCollection(this Client client, InputPeer peer, string title, params InputSavedStarGift[] stargift)
=> client.Invoke(new Payments_CreateStarGiftCollection
{
peer = peer,
title = title,
stargift = stargift,
});
/// <summary><para>See <a href="https://corefork.telegram.org/method/payments.updateStarGiftCollection"/></para></summary>
public static Task<StarGiftCollection> Payments_UpdateStarGiftCollection(this Client client, InputPeer peer, int collection_id, string title = null, InputSavedStarGift[] delete_stargift = null, InputSavedStarGift[] add_stargift = null, InputSavedStarGift[] order = null)
=> client.Invoke(new Payments_UpdateStarGiftCollection
{
flags = (Payments_UpdateStarGiftCollection.Flags)((title != null ? 0x1 : 0) | (delete_stargift != null ? 0x2 : 0) | (add_stargift != null ? 0x4 : 0) | (order != null ? 0x8 : 0)),
peer = peer,
collection_id = collection_id,
title = title,
delete_stargift = delete_stargift,
add_stargift = add_stargift,
order = order,
});
/// <summary><para>See <a href="https://corefork.telegram.org/method/payments.reorderStarGiftCollections"/></para></summary>
public static Task<bool> Payments_ReorderStarGiftCollections(this Client client, InputPeer peer, params int[] order)
=> client.Invoke(new Payments_ReorderStarGiftCollections
{
peer = peer,
order = order,
});
/// <summary><para>See <a href="https://corefork.telegram.org/method/payments.deleteStarGiftCollection"/></para></summary>
public static Task<bool> Payments_DeleteStarGiftCollection(this Client client, InputPeer peer, int collection_id)
=> client.Invoke(new Payments_DeleteStarGiftCollection
{
peer = peer,
collection_id = collection_id,
});
/// <summary><para>See <a href="https://corefork.telegram.org/method/payments.getStarGiftCollections"/></para></summary>
/// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/payments.starGiftCollectionsNotModified">payments.starGiftCollectionsNotModified</a></returns>
public static Task<Payments_StarGiftCollections> Payments_GetStarGiftCollections(this Client client, InputPeer peer, long hash = default)
=> client.Invoke(new Payments_GetStarGiftCollections
{
peer = peer,
hash = hash,
});
/// <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> /// <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="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> /// <param name="emojis">Whether this is a <a href="https://corefork.telegram.org/api/custom-emoji">custom emoji</a> stickerset.</param>
@ -13077,11 +13134,12 @@ namespace TL.Methods
public string slug; public string slug;
} }
[TLDef(0x23830DE9)] [TLDef(0xA319E569)]
public sealed partial class Payments_GetSavedStarGifts : IMethod<Payments_SavedStarGifts> public sealed partial class Payments_GetSavedStarGifts : IMethod<Payments_SavedStarGifts>
{ {
public Flags flags; public Flags flags;
public InputPeer peer; public InputPeer peer;
[IfFlag(6)] public int collection_id;
public string offset; public string offset;
public int limit; public int limit;
@ -13093,6 +13151,7 @@ namespace TL.Methods
exclude_limited = 0x8, exclude_limited = 0x8,
exclude_unique = 0x10, exclude_unique = 0x10,
sort_by_value = 0x20, sort_by_value = 0x20,
has_collection_id = 0x40,
} }
} }
@ -13160,6 +13219,55 @@ namespace TL.Methods
public long resell_stars; public long resell_stars;
} }
[TLDef(0x1F4A0E87)]
public sealed partial class Payments_CreateStarGiftCollection : IMethod<StarGiftCollection>
{
public InputPeer peer;
public string title;
public InputSavedStarGift[] stargift;
}
[TLDef(0x4FDDBEE7)]
public sealed partial class Payments_UpdateStarGiftCollection : IMethod<StarGiftCollection>
{
public Flags flags;
public InputPeer peer;
public int collection_id;
[IfFlag(0)] public string title;
[IfFlag(1)] public InputSavedStarGift[] delete_stargift;
[IfFlag(2)] public InputSavedStarGift[] add_stargift;
[IfFlag(3)] public InputSavedStarGift[] order;
[Flags] public enum Flags : uint
{
has_title = 0x1,
has_delete_stargift = 0x2,
has_add_stargift = 0x4,
has_order = 0x8,
}
}
[TLDef(0xC32AF4CC)]
public sealed partial class Payments_ReorderStarGiftCollections : IMethod<bool>
{
public InputPeer peer;
public int[] order;
}
[TLDef(0xAD5648E8)]
public sealed partial class Payments_DeleteStarGiftCollection : IMethod<bool>
{
public InputPeer peer;
public int collection_id;
}
[TLDef(0x981B91DD)]
public sealed partial class Payments_GetStarGiftCollections : IMethod<Payments_StarGiftCollections>
{
public InputPeer peer;
public long hash;
}
[TLDef(0x9021AB67)] [TLDef(0x9021AB67)]
public sealed partial class Stickers_CreateStickerSet : IMethod<Messages_StickerSet> public sealed partial class Stickers_CreateStickerSet : IMethod<Messages_StickerSet>
{ {

View file

@ -6,7 +6,7 @@ namespace TL
{ {
public static partial class Layer public static partial class Layer
{ {
public const int Version = 209; // fetched 14/07/2025 20:10:02 public const int Version = 210; // fetched 25/07/2025 14:54:33
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;
@ -254,7 +254,7 @@ namespace TL
[0xF47741F7] = typeof(PeerSettings), [0xF47741F7] = typeof(PeerSettings),
[0xA437C3ED] = typeof(WallPaper), [0xA437C3ED] = typeof(WallPaper),
[0xE0804116] = typeof(WallPaperNoFile), [0xE0804116] = typeof(WallPaperNoFile),
[0x99E78045] = typeof(UserFull), [0x29DE80BE] = typeof(UserFull),
[0x145ADE0B] = typeof(Contact), [0x145ADE0B] = typeof(Contact),
[0xC13E3C50] = typeof(ImportedContact), [0xC13E3C50] = typeof(ImportedContact),
[0x16D9703B] = typeof(ContactStatus), [0x16D9703B] = typeof(ContactStatus),
@ -1361,7 +1361,7 @@ namespace TL
[0x4BA3A95A] = typeof(MessageReactor), [0x4BA3A95A] = typeof(MessageReactor),
[0x94CE852A] = typeof(StarsGiveawayOption), [0x94CE852A] = typeof(StarsGiveawayOption),
[0x54236209] = typeof(StarsGiveawayWinnersOption), [0x54236209] = typeof(StarsGiveawayWinnersOption),
[0x7F853C12] = typeof(StarGift), [0x00BCFF5B] = typeof(StarGift),
[0xF63778AE] = typeof(StarGiftUnique), [0xF63778AE] = typeof(StarGiftUnique),
[0xA388A368] = null,//Payments_StarGiftsNotModified [0xA388A368] = null,//Payments_StarGiftsNotModified
[0x2ED82995] = typeof(Payments_StarGifts), [0x2ED82995] = typeof(Payments_StarGifts),
@ -1391,7 +1391,7 @@ namespace TL
[0x315A4974] = typeof(Users_UsersSlice), [0x315A4974] = typeof(Users_UsersSlice),
[0xCAA2F60B] = typeof(Payments_UniqueStarGift), [0xCAA2F60B] = typeof(Payments_UniqueStarGift),
[0xB53E8B21] = typeof(Messages_WebPagePreview), [0xB53E8B21] = typeof(Messages_WebPagePreview),
[0xDFDA0499] = typeof(SavedStarGift), [0x1EA646DF] = typeof(SavedStarGift),
[0x95F389B1] = typeof(Payments_SavedStarGifts), [0x95F389B1] = typeof(Payments_SavedStarGifts),
[0x69279795] = typeof(InputSavedStarGiftUser), [0x69279795] = typeof(InputSavedStarGiftUser),
[0xF101AA7F] = typeof(InputSavedStarGiftChat), [0xF101AA7F] = typeof(InputSavedStarGiftChat),
@ -1420,6 +1420,10 @@ namespace TL
[0x49B92A26] = typeof(TodoList), [0x49B92A26] = typeof(TodoList),
[0x4CC120B7] = typeof(TodoCompletion), [0x4CC120B7] = typeof(TodoCompletion),
[0x0E8E37E5] = typeof(SuggestedPost), [0x0E8E37E5] = typeof(SuggestedPost),
[0x1B0E4F07] = typeof(StarsRating),
[0x9D6B13B0] = typeof(StarGiftCollection),
[0xA0BA4F17] = null,//Payments_StarGiftCollectionsNotModified
[0x8A2932F3] = typeof(Payments_StarGiftCollections),
// from TL.Secret: // from TL.Secret:
[0x6ABD9782] = typeof(Layer143.DecryptedMessageMediaDocument), [0x6ABD9782] = typeof(Layer143.DecryptedMessageMediaDocument),
[0x020DF5D0] = typeof(Layer101.MessageEntityBlockquote), [0x020DF5D0] = typeof(Layer101.MessageEntityBlockquote),
@ -1553,6 +1557,7 @@ namespace TL
[typeof(PaidReactionPrivacy)] = 0x206AD49E, //paidReactionPrivacyDefault [typeof(PaidReactionPrivacy)] = 0x206AD49E, //paidReactionPrivacyDefault
[typeof(RequirementToContact)] = 0x050A9839, //requirementToContactEmpty [typeof(RequirementToContact)] = 0x050A9839, //requirementToContactEmpty
[typeof(Contacts_SponsoredPeers)] = 0xEA32B4B1, //contacts.sponsoredPeersEmpty [typeof(Contacts_SponsoredPeers)] = 0xEA32B4B1, //contacts.sponsoredPeersEmpty
[typeof(Payments_StarGiftCollections)] = 0xA0BA4F17, //payments.starGiftCollectionsNotModified
[typeof(DecryptedMessageMedia)] = 0x089F5C4A, //decryptedMessageMediaEmpty [typeof(DecryptedMessageMedia)] = 0x089F5C4A, //decryptedMessageMediaEmpty
}; };
} }

View file

@ -13,8 +13,8 @@
<PackageId>WTelegramClient</PackageId> <PackageId>WTelegramClient</PackageId>
<Authors>Wizou</Authors> <Authors>Wizou</Authors>
<VersionPrefix>0.0.0</VersionPrefix> <VersionPrefix>0.0.0</VersionPrefix>
<VersionSuffix>layer.209</VersionSuffix> <VersionSuffix>layer.210</VersionSuffix>
<Description>Telegram Client API (MTProto) library written 100% in C# and .NET Standard | Latest API layer: 209 <Description>Telegram Client API (MTProto) library written 100% in C# and .NET Standard | Latest API layer: 210
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>