API Layer 178: mostly reactions & sponsored stuff

This commit is contained in:
Wizou 2024-04-24 17:42:46 +02:00
parent 69f9e0c418
commit 4381781af8
7 changed files with 168 additions and 73 deletions

View file

@ -1,4 +1,4 @@
[![API Layer](https://img.shields.io/badge/API_Layer-177-blueviolet)](https://corefork.telegram.org/methods) [![API Layer](https://img.shields.io/badge/API_Layer-178-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://www.buymeacoffee.com/wizou) [![Donate](https://img.shields.io/badge/Help_this_project:-Donate-ff4444)](https://www.buymeacoffee.com/wizou)
@ -203,3 +203,5 @@ If you read all this ReadMe, the [Frequently Asked Questions](https://wiz0u.gith
the [Examples codes](https://wiz0u.github.io/WTelegramClient/EXAMPLES) and still have questions, feedback is welcome in our Telegram group [@WTelegramClient](https://t.me/WTelegramClient) the [Examples codes](https://wiz0u.github.io/WTelegramClient/EXAMPLES) and still have questions, feedback is welcome in our Telegram group [@WTelegramClient](https://t.me/WTelegramClient)
If you like this library, you can [buy me a coffee](https://www.buymeacoffee.com/wizou) ❤ This will help the project keep going. If you like this library, you can [buy me a coffee](https://www.buymeacoffee.com/wizou) ❤ This will help the project keep going.
© 2024 Olivier Marcoux

View file

@ -5,7 +5,7 @@ using Client = WTelegram.Client;
namespace TL namespace TL
{ {
#pragma warning disable IDE1006 #pragma warning disable IDE1006, CS1574
[TLDef(0x05162463)] //resPQ#05162463 nonce:int128 server_nonce:int128 pq:bytes server_public_key_fingerprints:Vector<long> = ResPQ [TLDef(0x05162463)] //resPQ#05162463 nonce:int128 server_nonce:int128 pq:bytes server_public_key_fingerprints:Vector<long> = ResPQ
public sealed partial class ResPQ : IObject public sealed partial class ResPQ : IObject
{ {

View file

@ -3,7 +3,7 @@ using System.Collections.Generic;
namespace TL namespace TL
{ {
#pragma warning disable IDE1006 #pragma warning disable IDE1006, CS1574
/// <summary>Boolean type. <para>See <a href="https://corefork.telegram.org/type/Bool"/></para></summary> /// <summary>Boolean type. <para>See <a href="https://corefork.telegram.org/type/Bool"/></para></summary>
public enum Bool : uint public enum Bool : uint
{ {
@ -1219,9 +1219,10 @@ namespace TL
public virtual long[] RecentRequesters => default; public virtual long[] RecentRequesters => default;
/// <summary>Allowed <a href="https://corefork.telegram.org/api/reactions">message reactions »</a></summary> /// <summary>Allowed <a href="https://corefork.telegram.org/api/reactions">message reactions »</a></summary>
public virtual ChatReactions AvailableReactions => default; public virtual ChatReactions AvailableReactions => default;
public virtual int ReactionsLimit => default;
} }
/// <summary>Full info about a <a href="https://corefork.telegram.org/api/channel#basic-groups">basic group</a>. <para>See <a href="https://corefork.telegram.org/constructor/chatFull"/></para></summary> /// <summary>Full info about a <a href="https://corefork.telegram.org/api/channel#basic-groups">basic group</a>. <para>See <a href="https://corefork.telegram.org/constructor/chatFull"/></para></summary>
[TLDef(0xC9D31138)] [TLDef(0x2633421B)]
public sealed partial class ChatFull : ChatFullBase public sealed partial class ChatFull : ChatFullBase
{ {
/// <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>
@ -1258,6 +1259,7 @@ namespace TL
[IfFlag(17)] public long[] recent_requesters; [IfFlag(17)] public long[] recent_requesters;
/// <summary>Allowed <a href="https://corefork.telegram.org/api/reactions">message reactions »</a></summary> /// <summary>Allowed <a href="https://corefork.telegram.org/api/reactions">message reactions »</a></summary>
[IfFlag(18)] public ChatReactions available_reactions; [IfFlag(18)] public ChatReactions available_reactions;
[IfFlag(20)] public int reactions_limit;
[Flags] public enum Flags : uint [Flags] public enum Flags : uint
{ {
@ -1289,6 +1291,8 @@ namespace TL
has_available_reactions = 0x40000, has_available_reactions = 0x40000,
/// <summary>Whether the <a href="https://corefork.telegram.org/api/translation">real-time chat translation popup</a> should be hidden.</summary> /// <summary>Whether the <a href="https://corefork.telegram.org/api/translation">real-time chat translation popup</a> should be hidden.</summary>
translations_disabled = 0x80000, translations_disabled = 0x80000,
/// <summary>Field <see cref="reactions_limit"/> has a value</summary>
has_reactions_limit = 0x100000,
} }
/// <summary>ID of the chat</summary> /// <summary>ID of the chat</summary>
@ -1321,9 +1325,10 @@ namespace TL
public override long[] RecentRequesters => recent_requesters; public override long[] RecentRequesters => recent_requesters;
/// <summary>Allowed <a href="https://corefork.telegram.org/api/reactions">message reactions »</a></summary> /// <summary>Allowed <a href="https://corefork.telegram.org/api/reactions">message reactions »</a></summary>
public override ChatReactions AvailableReactions => available_reactions; public override ChatReactions AvailableReactions => available_reactions;
public override int ReactionsLimit => reactions_limit;
} }
/// <summary>Full info about a <a href="https://corefork.telegram.org/api/channel#channels">channel</a>, <a href="https://corefork.telegram.org/api/channel#supergroups">supergroup</a> or <a href="https://corefork.telegram.org/api/channel#gigagroups">gigagroup</a>. <para>See <a href="https://corefork.telegram.org/constructor/channelFull"/></para></summary> /// <summary>Full info about a <a href="https://corefork.telegram.org/api/channel#channels">channel</a>, <a href="https://corefork.telegram.org/api/channel#supergroups">supergroup</a> or <a href="https://corefork.telegram.org/api/channel#gigagroups">gigagroup</a>. <para>See <a href="https://corefork.telegram.org/constructor/channelFull"/></para></summary>
[TLDef(0x44C054A7)] [TLDef(0xBBAB348D)]
public sealed partial class ChannelFull : ChatFullBase public sealed partial class ChannelFull : ChatFullBase
{ {
/// <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>
@ -1400,6 +1405,7 @@ namespace TL
[IfFlag(29)] public Peer default_send_as; [IfFlag(29)] public Peer default_send_as;
/// <summary>Allowed <a href="https://corefork.telegram.org/api/reactions">message reactions »</a></summary> /// <summary>Allowed <a href="https://corefork.telegram.org/api/reactions">message reactions »</a></summary>
[IfFlag(30)] public ChatReactions available_reactions; [IfFlag(30)] public ChatReactions available_reactions;
[IfFlag(45)] public int reactions_limit;
/// <summary>Channel <a href="https://corefork.telegram.org/api/stories">stories</a></summary> /// <summary>Channel <a href="https://corefork.telegram.org/api/stories">stories</a></summary>
[IfFlag(36)] public PeerStories stories; [IfFlag(36)] public PeerStories stories;
/// <summary><a href="https://corefork.telegram.org/api/wallpapers">Wallpaper</a></summary> /// <summary><a href="https://corefork.telegram.org/api/wallpapers">Wallpaper</a></summary>
@ -1500,6 +1506,8 @@ namespace TL
has_emojiset = 0x400, has_emojiset = 0x400,
restricted_sponsored = 0x800, restricted_sponsored = 0x800,
can_view_revenue = 0x1000, can_view_revenue = 0x1000,
/// <summary>Field <see cref="reactions_limit"/> has a value</summary>
has_reactions_limit = 0x2000,
} }
/// <summary>ID of the channel</summary> /// <summary>ID of the channel</summary>
@ -1532,6 +1540,7 @@ namespace TL
public override long[] RecentRequesters => recent_requesters; public override long[] RecentRequesters => recent_requesters;
/// <summary>Allowed <a href="https://corefork.telegram.org/api/reactions">message reactions »</a></summary> /// <summary>Allowed <a href="https://corefork.telegram.org/api/reactions">message reactions »</a></summary>
public override ChatReactions AvailableReactions => available_reactions; public override ChatReactions AvailableReactions => available_reactions;
public override int ReactionsLimit => reactions_limit;
} }
/// <summary>Details of a group member. <para>See <a href="https://corefork.telegram.org/type/ChatParticipant"/></para> <para>Derived classes: <see cref="ChatParticipant"/>, <see cref="ChatParticipantCreator"/>, <see cref="ChatParticipantAdmin"/></para></summary> /// <summary>Details of a group member. <para>See <a href="https://corefork.telegram.org/type/ChatParticipant"/></para> <para>Derived classes: <see cref="ChatParticipant"/>, <see cref="ChatParticipantCreator"/>, <see cref="ChatParticipantAdmin"/></para></summary>
@ -3350,6 +3359,7 @@ namespace TL
has_birthday = 0x20, has_birthday = 0x20,
/// <summary>Fields <see cref="personal_channel_id"/> and <see cref="personal_channel_message"/> have a value</summary> /// <summary>Fields <see cref="personal_channel_id"/> and <see cref="personal_channel_message"/> have a value</summary>
has_personal_channel_id = 0x40, has_personal_channel_id = 0x40,
sponsored_enabled = 0x80,
} }
} }
@ -5283,6 +5293,14 @@ namespace TL
public override (long, int, int) GetMBox() => (-1, qts, 1); public override (long, int, int) GetMBox() => (-1, qts, 1);
} }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/updateNewStoryReaction"/></para></summary>
[TLDef(0x1824E40B)]
public sealed partial class UpdateNewStoryReaction : Update
{
public int story_id;
public Peer peer;
public Reaction reaction;
}
/// <summary>Updates state. <para>See <a href="https://corefork.telegram.org/constructor/updates.state"/></para></summary> /// <summary>Updates state. <para>See <a href="https://corefork.telegram.org/constructor/updates.state"/></para></summary>
[TLDef(0xA56C2A3E)] [TLDef(0xA56C2A3E)]
@ -12626,6 +12644,7 @@ namespace TL
allow_firebase = 0x80, allow_firebase = 0x80,
/// <summary>Fields <see cref="token"/> and <see cref="app_sandbox"/> have a value</summary> /// <summary>Fields <see cref="token"/> and <see cref="app_sandbox"/> have a value</summary>
has_token = 0x100, has_token = 0x100,
unknown_number = 0x200,
} }
} }
@ -13153,6 +13172,19 @@ namespace TL
has_story = 0x1, has_story = 0x1,
} }
} }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/webPageAttributeStickerSet"/></para></summary>
[TLDef(0x50CC03D3)]
public sealed partial class WebPageAttributeStickerSet : WebPageAttribute
{
public Flags flags;
public DocumentBase[] stickers;
[Flags] public enum Flags : uint
{
emojis = 0x1,
text_color = 0x2,
}
}
/// <summary>How users voted in a poll <para>See <a href="https://corefork.telegram.org/constructor/messages.votesList"/></para></summary> /// <summary>How users voted in a poll <para>See <a href="https://corefork.telegram.org/constructor/messages.votesList"/></para></summary>
[TLDef(0x4899484E)] [TLDef(0x4899484E)]
@ -14345,33 +14377,23 @@ namespace TL
public sealed partial class Account_ResetPasswordOk : Account_ResetPasswordResult { } public sealed partial class Account_ResetPasswordOk : Account_ResetPasswordResult { }
/// <summary>A <a href="https://corefork.telegram.org/api/sponsored-messages">sponsored message</a>. <para>See <a href="https://corefork.telegram.org/constructor/sponsoredMessage"/></para></summary> /// <summary>A <a href="https://corefork.telegram.org/api/sponsored-messages">sponsored message</a>. <para>See <a href="https://corefork.telegram.org/constructor/sponsoredMessage"/></para></summary>
[TLDef(0xED5383F7)] [TLDef(0xBDEDF566)]
public sealed partial class SponsoredMessage : IObject public sealed partial class SponsoredMessage : 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>
public Flags flags; public Flags flags;
/// <summary>Message ID</summary> /// <summary>Message ID</summary>
public byte[] random_id; public byte[] random_id;
/// <summary>ID of the sender of the message</summary> public string url;
[IfFlag(3)] public Peer from_id; public string title;
/// <summary>Information about the chat invite hash specified in <c>chat_invite_hash</c></summary>
[IfFlag(4)] public ChatInviteBase chat_invite;
/// <summary>Chat invite</summary>
[IfFlag(4)] public string chat_invite_hash;
/// <summary>Optional link to a channel post if <c>from_id</c> points to a channel</summary>
[IfFlag(2)] public int channel_post;
/// <summary>Parameter for the bot start message if the sponsored chat is a chat with a bot.</summary>
[IfFlag(0)] public string start_param;
/// <summary>Sponsored website</summary>
[IfFlag(9)] public SponsoredWebPage webpage;
/// <summary><a href="https://corefork.telegram.org/api/bots/webapps">Mini App »</a> to open when the sponsored message is clicked.</summary>
[IfFlag(10)] public BotApp app;
/// <summary>Sponsored message</summary> /// <summary>Sponsored message</summary>
public string message; public string message;
/// <summary><a href="https://corefork.telegram.org/api/entities">Message entities for styled text</a></summary> /// <summary><a href="https://corefork.telegram.org/api/entities">Message entities for styled text</a></summary>
[IfFlag(1)] public MessageEntity[] entities; [IfFlag(1)] public MessageEntity[] entities;
[IfFlag(6)] public PhotoBase photo;
[IfFlag(13)] public PeerColor color;
/// <summary>Text of the sponsored message button.</summary> /// <summary>Text of the sponsored message button.</summary>
[IfFlag(11)] public string button_text; public string button_text;
/// <summary>If set, contains additional information about the sponsor to be shown along with the message.</summary> /// <summary>If set, contains additional information about the sponsor to be shown along with the message.</summary>
[IfFlag(7)] public string sponsor_info; [IfFlag(7)] public string sponsor_info;
/// <summary>If set, contains additional information about the sponsored message to be shown along with the message.</summary> /// <summary>If set, contains additional information about the sponsored message to be shown along with the message.</summary>
@ -14379,31 +14401,19 @@ namespace TL
[Flags] public enum Flags : uint [Flags] public enum Flags : uint
{ {
/// <summary>Field <see cref="start_param"/> has a value</summary>
has_start_param = 0x1,
/// <summary>Field <see cref="entities"/> has a value</summary> /// <summary>Field <see cref="entities"/> has a value</summary>
has_entities = 0x2, has_entities = 0x2,
/// <summary>Field <see cref="channel_post"/> has a value</summary>
has_channel_post = 0x4,
/// <summary>Field <see cref="from_id"/> has a value</summary>
has_from_id = 0x8,
/// <summary>Fields <see cref="chat_invite"/> and <see cref="chat_invite_hash"/> have a value</summary>
has_chat_invite = 0x10,
/// <summary>Whether the message needs to be labeled as "recommended" instead of "sponsored"</summary> /// <summary>Whether the message needs to be labeled as "recommended" instead of "sponsored"</summary>
recommended = 0x20, recommended = 0x20,
/// <summary>Whether a profile photo bubble should be displayed for this message, like for messages sent in groups. The photo shown in the bubble is obtained either from the peer contained in <c>from_id</c>, or from <c>chat_invite</c>.</summary> /// <summary>Field <see cref="photo"/> has a value</summary>
show_peer_photo = 0x40, has_photo = 0x40,
/// <summary>Field <see cref="sponsor_info"/> has a value</summary> /// <summary>Field <see cref="sponsor_info"/> has a value</summary>
has_sponsor_info = 0x80, has_sponsor_info = 0x80,
/// <summary>Field <see cref="additional_info"/> has a value</summary> /// <summary>Field <see cref="additional_info"/> has a value</summary>
has_additional_info = 0x100, has_additional_info = 0x100,
/// <summary>Field <see cref="webpage"/> has a value</summary>
has_webpage = 0x200,
/// <summary>Field <see cref="app"/> has a value</summary>
has_app = 0x400,
/// <summary>Field <see cref="button_text"/> has a value</summary>
has_button_text = 0x800,
can_report = 0x1000, can_report = 0x1000,
/// <summary>Field <see cref="color"/> has a value</summary>
has_color = 0x2000,
} }
} }
@ -15986,26 +15996,6 @@ namespace TL
public override DateTime Date => date; public override DateTime Date => date;
} }
/// <summary>Represents a sponsored website. <para>See <a href="https://corefork.telegram.org/constructor/sponsoredWebPage"/></para></summary>
[TLDef(0x3DB8EC63)]
public sealed partial class SponsoredWebPage : IObject
{
/// <summary>Extra bits of information, use <c>flags.HasFlag(...)</c> to test for those</summary>
public Flags flags;
/// <summary>Web page URL.</summary>
public string url;
/// <summary>Website name.</summary>
public string site_name;
/// <summary>Optional image preview.</summary>
[IfFlag(0)] public PhotoBase photo;
[Flags] public enum Flags : uint
{
/// <summary>Field <see cref="photo"/> has a value</summary>
has_photo = 0x1,
}
}
/// <summary>Aggregated view and reaction information of a <a href="https://corefork.telegram.org/api/stories">story</a>. <para>See <a href="https://corefork.telegram.org/constructor/storyViews"/></para></summary> /// <summary>Aggregated view and reaction information of a <a href="https://corefork.telegram.org/api/stories">story</a>. <para>See <a href="https://corefork.telegram.org/constructor/storyViews"/></para></summary>
[TLDef(0x8D595CD6)] [TLDef(0x8D595CD6)]
public sealed partial class StoryViews : IObject public sealed partial class StoryViews : IObject
@ -16194,17 +16184,25 @@ namespace TL
} }
/// <summary>List of <a href="https://corefork.telegram.org/api/stories#pinned-or-archived-stories">stories</a> <para>See <a href="https://corefork.telegram.org/constructor/stories.stories"/></para></summary> /// <summary>List of <a href="https://corefork.telegram.org/api/stories#pinned-or-archived-stories">stories</a> <para>See <a href="https://corefork.telegram.org/constructor/stories.stories"/></para></summary>
[TLDef(0x5DD8C3C8)] [TLDef(0x63C3DD0A)]
public sealed partial class Stories_Stories : IObject, IPeerResolver public sealed partial class Stories_Stories : IObject, IPeerResolver
{ {
public Flags flags;
/// <summary>Total number of stories that can be fetched</summary> /// <summary>Total number of stories that can be fetched</summary>
public int count; public int count;
/// <summary>Stories</summary> /// <summary>Stories</summary>
public StoryItemBase[] stories; public StoryItemBase[] stories;
[IfFlag(0)] public int[] pinned_to_top;
/// <summary>Mentioned chats</summary> /// <summary>Mentioned chats</summary>
public Dictionary<long, ChatBase> chats; public Dictionary<long, ChatBase> chats;
/// <summary>Mentioned users</summary> /// <summary>Mentioned users</summary>
public Dictionary<long, User> users; public Dictionary<long, User> users;
[Flags] public enum Flags : uint
{
/// <summary>Field <see cref="pinned_to_top"/> has a value</summary>
has_pinned_to_top = 0x1,
}
/// <summary>returns a <see cref="User"/> or <see cref="ChatBase"/> for the given Peer</summary> /// <summary>returns a <see cref="User"/> or <see cref="ChatBase"/> for the given Peer</summary>
public IPeerInfo UserOrChat(Peer peer) => peer?.UserOrChat(users, chats); public IPeerInfo UserOrChat(Peer peer) => peer?.UserOrChat(users, chats);
} }
@ -17811,4 +17809,30 @@ namespace TL
public int count; public int count;
public BroadcastRevenueTransaction[] transactions; public BroadcastRevenueTransaction[] transactions;
} }
/// <summary><para>See <a href="https://corefork.telegram.org/type/ReactionNotificationsFrom"/></para></summary>
public enum ReactionNotificationsFrom : uint
{
///<summary>See <a href="https://corefork.telegram.org/constructor/reactionNotificationsFromContacts"/></summary>
Contacts = 0xBAC3A61A,
///<summary>See <a href="https://corefork.telegram.org/constructor/reactionNotificationsFromAll"/></summary>
All = 0x4B9E22A0,
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/reactionsNotifySettings"/></para></summary>
[TLDef(0x56E34970)]
public sealed partial class ReactionsNotifySettings : IObject
{
public Flags flags;
[IfFlag(0)] public ReactionNotificationsFrom messages_notify_from;
[IfFlag(1)] public ReactionNotificationsFrom stories_notify_from;
public NotificationSound sound;
public bool show_previews;
[Flags] public enum Flags : uint
{
has_messages_notify_from = 0x1,
has_stories_notify_from = 0x2,
}
}
} }

View file

@ -1330,6 +1330,26 @@ namespace TL
channel = channel, channel = channel,
}); });
/// <summary><para>See <a href="https://corefork.telegram.org/method/account.toggleSponsoredMessages"/></para></summary>
public static Task<bool> Account_ToggleSponsoredMessages(this Client client, bool enabled)
=> client.Invoke(new Account_ToggleSponsoredMessages
{
enabled = enabled,
});
/// <summary><para>See <a href="https://corefork.telegram.org/method/account.getReactionsNotifySettings"/></para></summary>
public static Task<ReactionsNotifySettings> Account_GetReactionsNotifySettings(this Client client)
=> client.Invoke(new Account_GetReactionsNotifySettings
{
});
/// <summary><para>See <a href="https://corefork.telegram.org/method/account.setReactionsNotifySettings"/></para></summary>
public static Task<ReactionsNotifySettings> Account_SetReactionsNotifySettings(this Client client, ReactionsNotifySettings settings)
=> client.Invoke(new Account_SetReactionsNotifySettings
{
settings = settings,
});
/// <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> /// <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> /// <param name="id">List of user identifiers</param>
public static Task<UserBase[]> Users_GetUsers(this Client client, params InputUserBase[] id) public static Task<UserBase[]> Users_GetUsers(this Client client, params InputUserBase[] id)
@ -2226,10 +2246,10 @@ namespace TL
/// <param name="offset_peer"><a href="https://corefork.telegram.org/api/offsets">Offsets for pagination, for more info click here</a></param> /// <param name="offset_peer"><a href="https://corefork.telegram.org/api/offsets">Offsets for pagination, for more info click here</a></param>
/// <param name="offset_id"><a href="https://corefork.telegram.org/api/offsets">Offsets for pagination, for more info click here</a></param> /// <param name="offset_id"><a href="https://corefork.telegram.org/api/offsets">Offsets for pagination, for more info click here</a></param>
/// <param name="limit"><a href="https://corefork.telegram.org/api/offsets">Offsets for pagination, for more info click here</a></param> /// <param name="limit"><a href="https://corefork.telegram.org/api/offsets">Offsets for pagination, for more info click here</a></param>
public static Task<Messages_MessagesBase> Messages_SearchGlobal(this Client client, string q, MessagesFilter filter = null, DateTime min_date = default, DateTime max_date = default, int offset_rate = default, InputPeer offset_peer = null, int offset_id = default, int limit = int.MaxValue, int? folder_id = null) public static Task<Messages_MessagesBase> Messages_SearchGlobal(this Client client, string q, MessagesFilter filter = null, DateTime min_date = default, DateTime max_date = default, int offset_rate = default, InputPeer offset_peer = null, int offset_id = default, int limit = int.MaxValue, int? folder_id = null, bool broadcasts_only = false)
=> client.Invoke(new Messages_SearchGlobal => client.Invoke(new Messages_SearchGlobal
{ {
flags = (Messages_SearchGlobal.Flags)(folder_id != null ? 0x1 : 0), flags = (Messages_SearchGlobal.Flags)((folder_id != null ? 0x1 : 0) | (broadcasts_only ? 0x2 : 0)),
folder_id = folder_id.GetValueOrDefault(), folder_id = folder_id.GetValueOrDefault(),
q = q, q = q,
filter = filter, filter = filter,
@ -3478,11 +3498,13 @@ namespace TL
/// <summary>Change the set of <a href="https://corefork.telegram.org/api/reactions">message reactions »</a> that can be used in a certain group, supergroup or channel <para>See <a href="https://corefork.telegram.org/method/messages.setChatAvailableReactions"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/messages.setChatAvailableReactions#possible-errors">details</a>)</para></summary> /// <summary>Change the set of <a href="https://corefork.telegram.org/api/reactions">message reactions »</a> that can be used in a certain group, supergroup or channel <para>See <a href="https://corefork.telegram.org/method/messages.setChatAvailableReactions"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/messages.setChatAvailableReactions#possible-errors">details</a>)</para></summary>
/// <param name="peer">Group where to apply changes</param> /// <param name="peer">Group where to apply changes</param>
/// <param name="available_reactions">Allowed reaction emojis</param> /// <param name="available_reactions">Allowed reaction emojis</param>
public static Task<UpdatesBase> Messages_SetChatAvailableReactions(this Client client, InputPeer peer, ChatReactions available_reactions) public static Task<UpdatesBase> Messages_SetChatAvailableReactions(this Client client, InputPeer peer, ChatReactions available_reactions, int? reactions_limit = null)
=> client.Invoke(new Messages_SetChatAvailableReactions => client.Invoke(new Messages_SetChatAvailableReactions
{ {
flags = (Messages_SetChatAvailableReactions.Flags)(reactions_limit != null ? 0x1 : 0),
peer = peer, peer = peer,
available_reactions = available_reactions, available_reactions = available_reactions,
reactions_limit = reactions_limit.GetValueOrDefault(),
}); });
/// <summary>Obtain available <a href="https://corefork.telegram.org/api/reactions">message reactions »</a> <para>See <a href="https://corefork.telegram.org/method/messages.getAvailableReactions"/></para></summary> /// <summary>Obtain available <a href="https://corefork.telegram.org/api/reactions">message reactions »</a> <para>See <a href="https://corefork.telegram.org/method/messages.getAvailableReactions"/></para></summary>
@ -5150,9 +5172,10 @@ namespace TL
/// <summary>Obtain a list of similarly themed public channels, selected based on similarities in their <strong>subscriber bases</strong>. <para>See <a href="https://corefork.telegram.org/method/channels.getChannelRecommendations"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/channels.getChannelRecommendations#possible-errors">details</a>)</para></summary> /// <summary>Obtain a list of similarly themed public channels, selected based on similarities in their <strong>subscriber bases</strong>. <para>See <a href="https://corefork.telegram.org/method/channels.getChannelRecommendations"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/channels.getChannelRecommendations#possible-errors">details</a>)</para></summary>
/// <param name="channel">The method will return channels related to the passed <c>channel</c>.</param> /// <param name="channel">The method will return channels related to the passed <c>channel</c>.</param>
public static Task<Messages_Chats> Channels_GetChannelRecommendations(this Client client, InputChannelBase channel) public static Task<Messages_Chats> Channels_GetChannelRecommendations(this Client client, InputChannelBase channel = null)
=> client.Invoke(new Channels_GetChannelRecommendations => client.Invoke(new Channels_GetChannelRecommendations
{ {
flags = (Channels_GetChannelRecommendations.Flags)(channel != null ? 0x1 : 0),
channel = channel, channel = channel,
}); });
@ -6567,6 +6590,14 @@ namespace TL
limit = limit, limit = limit,
}); });
/// <summary><para>See <a href="https://corefork.telegram.org/method/stories.togglePinnedToTop"/></para></summary>
public static Task<bool> Stories_TogglePinnedToTop(this Client client, InputPeer peer, params int[] id)
=> client.Invoke(new Stories_TogglePinnedToTop
{
peer = peer,
id = id,
});
/// <summary>Obtains info about the boosts that were applied to a certain channel (admins only) <para>See <a href="https://corefork.telegram.org/method/premium.getBoostsList"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/premium.getBoostsList#possible-errors">details</a>)</para></summary> /// <summary>Obtains info about the boosts that were applied to a certain channel (admins only) <para>See <a href="https://corefork.telegram.org/method/premium.getBoostsList"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/premium.getBoostsList#possible-errors">details</a>)</para></summary>
/// <param name="gifts">Whether to return only info about boosts received from <a href="https://corefork.telegram.org/api/giveaways">gift codes and giveaways created by the channel »</a></param> /// <param name="gifts">Whether to return only info about boosts received from <a href="https://corefork.telegram.org/api/giveaways">gift codes and giveaways created by the channel »</a></param>
/// <param name="peer">The channel</param> /// <param name="peer">The channel</param>
@ -7742,6 +7773,21 @@ namespace TL.Methods
public InputChannelBase channel; public InputChannelBase channel;
} }
[TLDef(0xB9D9A38D)]
public sealed partial class Account_ToggleSponsoredMessages : IMethod<bool>
{
public bool enabled;
}
[TLDef(0x06DD654C)]
public sealed partial class Account_GetReactionsNotifySettings : IMethod<ReactionsNotifySettings> { }
[TLDef(0x316CE548)]
public sealed partial class Account_SetReactionsNotifySettings : IMethod<ReactionsNotifySettings>
{
public ReactionsNotifySettings settings;
}
[TLDef(0x0D91A548)] [TLDef(0x0D91A548)]
public sealed partial class Users_GetUsers : IMethod<UserBase[]> public sealed partial class Users_GetUsers : IMethod<UserBase[]>
{ {
@ -8502,6 +8548,7 @@ namespace TL.Methods
[Flags] public enum Flags : uint [Flags] public enum Flags : uint
{ {
has_folder_id = 0x1, has_folder_id = 0x1,
broadcasts_only = 0x2,
} }
} }
@ -9590,11 +9637,18 @@ namespace TL.Methods
} }
} }
[TLDef(0xFEB16771)] [TLDef(0x5A150BD4)]
public sealed partial class Messages_SetChatAvailableReactions : IMethod<UpdatesBase> public sealed partial class Messages_SetChatAvailableReactions : IMethod<UpdatesBase>
{ {
public Flags flags;
public InputPeer peer; public InputPeer peer;
public ChatReactions available_reactions; public ChatReactions available_reactions;
[IfFlag(0)] public int reactions_limit;
[Flags] public enum Flags : uint
{
has_reactions_limit = 0x1,
}
} }
[TLDef(0x18DEA0AC)] [TLDef(0x18DEA0AC)]
@ -10930,10 +10984,16 @@ namespace TL.Methods
public bool enabled; public bool enabled;
} }
[TLDef(0x83B70D97)] [TLDef(0x25A71742)]
public sealed partial class Channels_GetChannelRecommendations : IMethod<Messages_Chats> public sealed partial class Channels_GetChannelRecommendations : IMethod<Messages_Chats>
{ {
public InputChannelBase channel; public Flags flags;
[IfFlag(0)] public InputChannelBase channel;
[Flags] public enum Flags : uint
{
has_channel = 0x1,
}
} }
[TLDef(0xF0D3E6A8)] [TLDef(0xF0D3E6A8)]
@ -12107,6 +12167,13 @@ namespace TL.Methods
} }
} }
[TLDef(0x0B297E9B)]
public sealed partial class Stories_TogglePinnedToTop : IMethod<bool>
{
public InputPeer peer;
public int[] id;
}
[TLDef(0x60F67660)] [TLDef(0x60F67660)]
public sealed partial class Premium_GetBoostsList : IMethod<Premium_BoostsList> public sealed partial class Premium_GetBoostsList : IMethod<Premium_BoostsList>
{ {

View file

@ -2,7 +2,7 @@
namespace TL namespace TL
{ {
#pragma warning disable IDE1006 #pragma warning disable IDE1006, CS1574
/// <summary>Object describes the contents of an encrypted message. <para>See <a href="https://corefork.telegram.org/type/DecryptedMessage"/></para></summary> /// <summary>Object describes the contents of an encrypted message. <para>See <a href="https://corefork.telegram.org/type/DecryptedMessage"/></para></summary>
public abstract partial class DecryptedMessageBase : IObject public abstract partial class DecryptedMessageBase : IObject
{ {

View file

@ -6,7 +6,7 @@ namespace TL
{ {
public static partial class Layer public static partial class Layer
{ {
public const int Version = 177; // fetched 03/04/2024 02:27:33 public const int Version = 178; // fetched 24/04/2024 15:26:10
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;
@ -136,8 +136,8 @@ namespace TL
[0x6592A1A7] = typeof(ChatForbidden), [0x6592A1A7] = typeof(ChatForbidden),
[0x0AADFC8F] = typeof(Channel), [0x0AADFC8F] = typeof(Channel),
[0x17D493D5] = typeof(ChannelForbidden), [0x17D493D5] = typeof(ChannelForbidden),
[0xC9D31138] = typeof(ChatFull), [0x2633421B] = typeof(ChatFull),
[0x44C054A7] = typeof(ChannelFull), [0xBBAB348D] = typeof(ChannelFull),
[0xC02D4007] = typeof(ChatParticipant), [0xC02D4007] = typeof(ChatParticipant),
[0xE46BCEE4] = typeof(ChatParticipantCreator), [0xE46BCEE4] = typeof(ChatParticipantCreator),
[0xA0933F5B] = typeof(ChatParticipantAdmin), [0xA0933F5B] = typeof(ChatParticipantAdmin),
@ -405,6 +405,7 @@ namespace TL
[0x9DDB347C] = typeof(UpdateBotNewBusinessMessage), [0x9DDB347C] = typeof(UpdateBotNewBusinessMessage),
[0x07DF587C] = typeof(UpdateBotEditBusinessMessage), [0x07DF587C] = typeof(UpdateBotEditBusinessMessage),
[0xA02A982E] = typeof(UpdateBotDeleteBusinessMessage), [0xA02A982E] = typeof(UpdateBotDeleteBusinessMessage),
[0x1824E40B] = typeof(UpdateNewStoryReaction),
[0xA56C2A3E] = typeof(Updates_State), [0xA56C2A3E] = typeof(Updates_State),
[0x5D75A138] = typeof(Updates_DifferenceEmpty), [0x5D75A138] = typeof(Updates_DifferenceEmpty),
[0x00F49CA0] = typeof(Updates_Difference), [0x00F49CA0] = typeof(Updates_Difference),
@ -956,6 +957,7 @@ namespace TL
[0xFA58B6D4] = typeof(ThemeSettings), [0xFA58B6D4] = typeof(ThemeSettings),
[0x54B56617] = typeof(WebPageAttributeTheme), [0x54B56617] = typeof(WebPageAttributeTheme),
[0x2E94C3E7] = typeof(WebPageAttributeStory), [0x2E94C3E7] = typeof(WebPageAttributeStory),
[0x50CC03D3] = typeof(WebPageAttributeStickerSet),
[0x4899484E] = typeof(Messages_VotesList), [0x4899484E] = typeof(Messages_VotesList),
[0xF568028A] = typeof(BankCardOpenUrl), [0xF568028A] = typeof(BankCardOpenUrl),
[0x3E24E573] = typeof(Payments_BankCardData), [0x3E24E573] = typeof(Payments_BankCardData),
@ -1024,7 +1026,7 @@ namespace TL
[0xE3779861] = typeof(Account_ResetPasswordFailedWait), [0xE3779861] = typeof(Account_ResetPasswordFailedWait),
[0xE9EFFC7D] = typeof(Account_ResetPasswordRequestedWait), [0xE9EFFC7D] = typeof(Account_ResetPasswordRequestedWait),
[0xE926D63E] = typeof(Account_ResetPasswordOk), [0xE926D63E] = typeof(Account_ResetPasswordOk),
[0xED5383F7] = typeof(SponsoredMessage), [0xBDEDF566] = typeof(SponsoredMessage),
[0xC9EE1D87] = typeof(Messages_SponsoredMessages), [0xC9EE1D87] = typeof(Messages_SponsoredMessages),
[0x1839490F] = null,//Messages_SponsoredMessagesEmpty [0x1839490F] = null,//Messages_SponsoredMessagesEmpty
[0xC9B0539F] = typeof(SearchResultsCalendarPeriod), [0xC9B0539F] = typeof(SearchResultsCalendarPeriod),
@ -1143,14 +1145,13 @@ namespace TL
[0xB6CC2D5C] = typeof(MessagePeerVote), [0xB6CC2D5C] = typeof(MessagePeerVote),
[0x74CDA504] = typeof(MessagePeerVoteInputOption), [0x74CDA504] = typeof(MessagePeerVoteInputOption),
[0x4628F6E6] = typeof(MessagePeerVoteMultiple), [0x4628F6E6] = typeof(MessagePeerVoteMultiple),
[0x3DB8EC63] = typeof(SponsoredWebPage),
[0x8D595CD6] = typeof(StoryViews), [0x8D595CD6] = typeof(StoryViews),
[0x51E6EE4F] = typeof(StoryItemDeleted), [0x51E6EE4F] = typeof(StoryItemDeleted),
[0xFFADC913] = typeof(StoryItemSkipped), [0xFFADC913] = typeof(StoryItemSkipped),
[0x79B26A24] = typeof(StoryItem), [0x79B26A24] = typeof(StoryItem),
[0x1158FE3E] = typeof(Stories_AllStoriesNotModified), [0x1158FE3E] = typeof(Stories_AllStoriesNotModified),
[0x6EFC5E81] = typeof(Stories_AllStories), [0x6EFC5E81] = typeof(Stories_AllStories),
[0x5DD8C3C8] = typeof(Stories_Stories), [0x63C3DD0A] = typeof(Stories_Stories),
[0xB0BDEAC5] = typeof(StoryView), [0xB0BDEAC5] = typeof(StoryView),
[0x9083670B] = typeof(StoryViewPublicForward), [0x9083670B] = typeof(StoryViewPublicForward),
[0xBD74CF49] = typeof(StoryViewPublicRepost), [0xBD74CF49] = typeof(StoryViewPublicRepost),
@ -1262,6 +1263,7 @@ namespace TL
[0x5A590978] = typeof(BroadcastRevenueTransactionWithdrawal), [0x5A590978] = typeof(BroadcastRevenueTransactionWithdrawal),
[0x42D30D2E] = typeof(BroadcastRevenueTransactionRefund), [0x42D30D2E] = typeof(BroadcastRevenueTransactionRefund),
[0x87158466] = typeof(Stats_BroadcastRevenueTransactions), [0x87158466] = typeof(Stats_BroadcastRevenueTransactions),
[0x56E34970] = typeof(ReactionsNotifySettings),
// from TL.Secret: // from TL.Secret:
[0x6ABD9782] = typeof(Layer143.DecryptedMessageMediaDocument), [0x6ABD9782] = typeof(Layer143.DecryptedMessageMediaDocument),
[0x91CC4674] = typeof(Layer73.DecryptedMessage), [0x91CC4674] = typeof(Layer73.DecryptedMessage),

View file

@ -13,7 +13,7 @@
<PackageId>WTelegramClient</PackageId> <PackageId>WTelegramClient</PackageId>
<Version>0.0.0</Version> <Version>0.0.0</Version>
<Authors>Wizou</Authors> <Authors>Wizou</Authors>
<Description>Telegram Client API (MTProto) library written 100% in C# and .NET Standard | Latest API layer: 177&#10;&#10;Release Notes:&#10;$(ReleaseNotes.Replace("|", "%0D%0A").Replace(" - ","%0D%0A- ").Replace(" ", "%0D%0A%0D%0A"))</Description> <Description>Telegram Client API (MTProto) library written 100% in C# and .NET Standard | Latest API layer: 178&#10;&#10;Release Notes:&#10;$(ReleaseNotes.Replace("|", "%0D%0A").Replace(" - ","%0D%0A- ").Replace(" ", "%0D%0A%0D%0A"))</Description>
<Copyright>Copyright © Olivier Marcoux 2021-2024</Copyright> <Copyright>Copyright © Olivier Marcoux 2021-2024</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression> <PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/wiz0u/WTelegramClient</PackageProjectUrl> <PackageProjectUrl>https://github.com/wiz0u/WTelegramClient</PackageProjectUrl>