API Layer 167: PeerColor, wallpaper for_both, view_forum_as_messages, story forwards and more stats...

This commit is contained in:
Wizou 2023-11-30 16:19:42 +01:00
parent b6c98658db
commit d7ecd49b5c
5 changed files with 391 additions and 62 deletions

View file

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

View file

@ -739,7 +739,7 @@ namespace TL
public long id;
}
/// <summary>Indicates info about a certain user <para>See <a href="https://corefork.telegram.org/constructor/user"/></para></summary>
[TLDef(0xEB602F25)]
[TLDef(0x215C4438)]
public partial class User : UserBase
{
/// <summary>Extra bits of information, use <c>flags.HasFlag(...)</c> to test for those</summary>
@ -775,8 +775,8 @@ namespace TL
/// <summary>Additional usernames</summary>
[IfFlag(32)] public Username[] usernames;
[IfFlag(37)] public int stories_max_id;
[IfFlag(39)] public int color;
[IfFlag(38)] public long background_emoji_id;
[IfFlag(40)] public PeerColor color;
[IfFlag(41)] public PeerColor profile_color;
[Flags] public enum Flags : uint
{
@ -850,10 +850,10 @@ namespace TL
stories_unavailable = 0x10,
/// <summary>Field <see cref="stories_max_id"/> has a value</summary>
has_stories_max_id = 0x20,
/// <summary>Field <see cref="background_emoji_id"/> has a value</summary>
has_background_emoji_id = 0x40,
/// <summary>Field <see cref="color"/> has a value</summary>
has_color = 0x80,
has_color = 0x100,
/// <summary>Field <see cref="profile_color"/> has a value</summary>
has_profile_color = 0x200,
}
}
@ -994,7 +994,7 @@ namespace TL
public override string Title => title;
}
/// <summary>Channel/supergroup info <para>See <a href="https://corefork.telegram.org/constructor/channel"/></para></summary>
[TLDef(0x1981EA7E)]
[TLDef(0x8E87CCD8)]
public partial class Channel : ChatBase
{
/// <summary>Extra bits of information, use <c>flags.HasFlag(...)</c> to test for those</summary>
@ -1026,8 +1026,7 @@ namespace TL
/// <summary>Additional usernames</summary>
[IfFlag(32)] public Username[] usernames;
[IfFlag(36)] public int stories_max_id;
[IfFlag(38)] public int color;
[IfFlag(37)] public long background_emoji_id;
[IfFlag(39)] public PeerColor color;
[Flags] public enum Flags : uint
{
@ -1094,10 +1093,8 @@ namespace TL
stories_unavailable = 0x8,
/// <summary>Field <see cref="stories_max_id"/> has a value</summary>
has_stories_max_id = 0x10,
/// <summary>Field <see cref="background_emoji_id"/> has a value</summary>
has_background_emoji_id = 0x20,
/// <summary>Field <see cref="color"/> has a value</summary>
has_color = 0x40,
has_color = 0x80,
}
/// <summary>ID of the channel</summary>
@ -1432,6 +1429,7 @@ namespace TL
/// <summary>Field <see cref="stories"/> has a value</summary>
has_stories = 0x10,
stories_pinned_available = 0x20,
view_forum_as_messages = 0x40,
}
/// <summary>ID of the channel</summary>
@ -2394,15 +2392,19 @@ namespace TL
public Peer peer;
}
/// <summary>The <a href="https://corefork.telegram.org/api/wallpapers">wallpaper »</a> of the current chat was changed. <para>See <a href="https://corefork.telegram.org/constructor/messageActionSetChatWallPaper"/></para></summary>
[TLDef(0xBC44A927)]
[TLDef(0x5060A3F4)]
public class MessageActionSetChatWallPaper : MessageAction
{
public Flags flags;
/// <summary>New <a href="https://corefork.telegram.org/api/wallpapers">wallpaper</a></summary>
public WallPaperBase wallpaper;
[Flags] public enum Flags : uint
{
same = 0x1,
for_both = 0x2,
}
}
/// <summary>The user applied a <a href="https://corefork.telegram.org/api/wallpapers">wallpaper »</a> previously sent by the other user in a <see cref="MessageActionSetChatWallPaper"/> message. <para>See <a href="https://corefork.telegram.org/constructor/messageActionSetSameChatWallPaper"/></para></summary>
[TLDef(0xC0787D6D)]
public class MessageActionSetSameChatWallPaper : MessageActionSetChatWallPaper { }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/messageActionGiftCode"/></para></summary>
[TLDef(0xD2CFDB0E)]
public class MessageActionGiftCode : MessageAction
@ -2422,6 +2424,13 @@ namespace TL
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/messageActionGiveawayLaunch"/></para></summary>
[TLDef(0x332BA9ED)]
public class MessageActionGiveawayLaunch : MessageAction { }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/messageActionGiveawayResults"/></para></summary>
[TLDef(0x2A9FADC5)]
public class MessageActionGiveawayResults : MessageAction
{
public int winners_count;
public int unclaimed_count;
}
/// <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 class DialogBase : IObject
@ -2476,6 +2485,7 @@ namespace TL
has_folder_id = 0x10,
/// <summary>Field <see cref="ttl_period"/> has a value</summary>
has_ttl_period = 0x20,
view_forum_as_messages = 0x40,
}
/// <summary>The chat</summary>
@ -3107,6 +3117,7 @@ namespace TL
has_stories = 0x2000000,
stories_pinned_available = 0x4000000,
blocked_my_stories_from = 0x8000000,
wallpaper_overridden = 0x10000000,
}
}
@ -4808,6 +4819,26 @@ namespace TL
public Boost boost;
public int qts;
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/updateChannelViewForumAsMessages"/></para></summary>
[TLDef(0x07B68920, inheritBefore = true)]
public class UpdateChannelViewForumAsMessages : UpdateChannel
{
public bool enabled;
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/updatePeerWallpaper"/></para></summary>
[TLDef(0xAE3F101D)]
public class UpdatePeerWallpaper : Update
{
public Flags flags;
public Peer peer;
[IfFlag(0)] public WallPaperBase wallpaper;
[Flags] public enum Flags : uint
{
has_wallpaper = 0x1,
wallpaper_overridden = 0x2,
}
}
/// <summary>Updates state. <para>See <a href="https://corefork.telegram.org/constructor/updates.state"/></para></summary>
[TLDef(0xA56C2A3E)]
@ -12785,20 +12816,8 @@ namespace TL
}
}
/// <summary>Message interaction counters <para>See <a href="https://corefork.telegram.org/constructor/messageInteractionCounters"/></para></summary>
[TLDef(0xAD4FC9BD)]
public class MessageInteractionCounters : IObject
{
/// <summary>Message ID</summary>
public int msg_id;
/// <summary>Views</summary>
public int views;
/// <summary>Number of times this message was forwarded</summary>
public int forwards;
}
/// <summary><a href="https://corefork.telegram.org/api/stats">Channel statistics</a>. <para>See <a href="https://corefork.telegram.org/constructor/stats.broadcastStats"/></para></summary>
[TLDef(0xBDF78394)]
[TLDef(0x396CA5FC)]
public class Stats_BroadcastStats : IObject
{
/// <summary>Period in consideration</summary>
@ -12809,6 +12828,10 @@ namespace TL
public StatsAbsValueAndPrev views_per_post;
/// <summary><c>total_viewcount/postcount</c>, for posts posted during the period in consideration (<c>views_per_post</c>). <br/>Note that in this case, <c>current</c> refers to the <c>period</c> in consideration (<c>min_date</c> till <c>max_date</c>), and <c>prev</c> refers to the previous period (<c>(min_date - (max_date - min_date))</c> till <c>min_date</c>)</summary>
public StatsAbsValueAndPrev shares_per_post;
public StatsAbsValueAndPrev reactions_per_post;
public StatsAbsValueAndPrev views_per_story;
public StatsAbsValueAndPrev shares_per_story;
public StatsAbsValueAndPrev reactions_per_story;
/// <summary>Percentage of subscribers with enabled notifications</summary>
public StatsPercentValue enabled_notifications;
/// <summary>Channel growth graph (absolute subscriber count)</summary>
@ -12829,8 +12852,10 @@ namespace TL
public StatsGraphBase new_followers_by_source_graph;
/// <summary>Subscriber language graph (pie chart)</summary>
public StatsGraphBase languages_graph;
/// <summary>Recent message interactions</summary>
public MessageInteractionCounters[] recent_message_interactions;
public StatsGraphBase reactions_by_emotion_graph;
public StatsGraphBase story_interactions_graph;
public StatsGraphBase story_reactions_by_emotion_graph;
public PostInteractionCounters[] recent_posts_interactions;
}
/// <summary>Info about pinned MTProxy or Public Service Announcement peers. <para>See <a href="https://corefork.telegram.org/type/help.PromoData"/></para> <para>Derived classes: <see cref="Help_PromoDataEmpty"/>, <see cref="Help_PromoData"/></para></summary>
@ -13146,7 +13171,7 @@ namespace TL
/// <summary>Reply information <para>See <a href="https://corefork.telegram.org/type/MessageReplyHeader"/></para> <para>Derived classes: <see cref="MessageReplyHeader"/>, <see cref="MessageReplyStoryHeader"/></para></summary>
public abstract class MessageReplyHeaderBase : IObject { }
/// <summary>Message replies and <a href="https://corefork.telegram.org/api/threads">thread</a> information <para>See <a href="https://corefork.telegram.org/constructor/messageReplyHeader"/></para></summary>
[TLDef(0x6EEBCABD)]
[TLDef(0xAFBC09DB)]
public class MessageReplyHeader : MessageReplyHeaderBase
{
/// <summary>Extra bits of information, use <c>flags.HasFlag(...)</c> to test for those</summary>
@ -13161,6 +13186,7 @@ namespace TL
[IfFlag(1)] public int reply_to_top_id;
[IfFlag(6)] public string quote_text;
[IfFlag(7)] public MessageEntity[] quote_entities;
[IfFlag(10)] public int quote_offset;
[Flags] public enum Flags : uint
{
@ -13183,6 +13209,8 @@ namespace TL
/// <summary>Field <see cref="reply_media"/> has a value</summary>
has_reply_media = 0x100,
quote = 0x200,
/// <summary>Field <see cref="quote_offset"/> has a value</summary>
has_quote_offset = 0x400,
}
}
/// <summary>Represents a reply to a <a href="https://corefork.telegram.org/api/stories">story</a> <para>See <a href="https://corefork.telegram.org/constructor/messageReplyStoryHeader"/></para></summary>
@ -13238,11 +13266,12 @@ namespace TL
}
/// <summary>Message statistics <para>See <a href="https://corefork.telegram.org/constructor/stats.messageStats"/></para></summary>
[TLDef(0x8999F295)]
[TLDef(0x7FE91C14)]
public class Stats_MessageStats : IObject
{
/// <summary>Message view graph</summary>
public StatsGraphBase views_graph;
public StatsGraphBase reactions_by_emotion_graph;
}
/// <summary>A group call <para>See <a href="https://corefork.telegram.org/type/GroupCall"/></para> <para>Derived classes: <see cref="GroupCallDiscarded"/>, <see cref="GroupCall"/></para></summary>
@ -13735,7 +13764,7 @@ namespace TL
public 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>
[TLDef(0xDAAFFF6B)]
[TLDef(0xED5383F7)]
public class SponsoredMessage : IObject
{
/// <summary>Extra bits of information, use <c>flags.HasFlag(...)</c> to test for those</summary>
@ -13754,10 +13783,12 @@ namespace TL
[IfFlag(0)] public string start_param;
/// <summary>Sponsored website</summary>
[IfFlag(9)] public SponsoredWebPage webpage;
[IfFlag(10)] public BotApp app;
/// <summary>Sponsored message</summary>
public string message;
/// <summary><a href="https://corefork.telegram.org/api/entities">Message entities for styled text</a></summary>
[IfFlag(1)] public MessageEntity[] entities;
[IfFlag(11)] public string button_text;
/// <summary>If set, contains additional information about the sponsor to be shown along with the message.</summary>
[IfFlag(7)] public string sponsor_info;
/// <summary>If set, contains additional information about the sponsored message to be shown along with the message.</summary>
@ -13785,6 +13816,10 @@ namespace TL
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,
}
}
@ -14346,7 +14381,7 @@ namespace TL
}
/// <summary><a href="https://corefork.telegram.org/api/transcribe">Transcribed text from a voice message »</a> <para>See <a href="https://corefork.telegram.org/constructor/messages.transcribedAudio"/></para></summary>
[TLDef(0x93752C52)]
[TLDef(0xCFB9D957)]
public class Messages_TranscribedAudio : IObject
{
/// <summary>Extra bits of information, use <c>flags.HasFlag(...)</c> to test for those</summary>
@ -14355,11 +14390,15 @@ namespace TL
public long transcription_id;
/// <summary>Transcripted text</summary>
public string text;
[IfFlag(1)] public int trial_remains_num;
[IfFlag(1)] public DateTime trial_remains_until_date;
[Flags] public enum Flags : uint
{
/// <summary>Whether the transcription is partial because audio transcription is still in progress, if set the user may receive further <see cref="UpdateTranscribedAudio"/> updates with the updated transcription.</summary>
pending = 0x1,
/// <summary>Fields <see cref="trial_remains_num"/> and <see cref="trial_remains_until_date"/> have a value</summary>
has_trial_remains_num = 0x2,
}
}
@ -15422,7 +15461,7 @@ namespace TL
public override int ID => id;
}
/// <summary>Represents a <a href="https://corefork.telegram.org/api/stories">story</a>. <para>See <a href="https://corefork.telegram.org/constructor/storyItem"/></para></summary>
[TLDef(0x44C457CE)]
[TLDef(0xAF6365A1)]
public class StoryItem : StoryItemBase
{
/// <summary>Extra bits of information, use <c>flags.HasFlag(...)</c> to test for those</summary>
@ -15431,6 +15470,7 @@ namespace TL
public int id;
/// <summary>When was the story posted.</summary>
public DateTime date;
[IfFlag(17)] public StoryFwdHeader fwd_from;
/// <summary>When does the story expire.</summary>
public DateTime expire_date;
/// <summary>Story caption.</summary>
@ -15476,6 +15516,8 @@ namespace TL
has_sent_reaction = 0x8000,
/// <summary>indicates whether we sent this story.</summary>
out_ = 0x10000,
/// <summary>Field <see cref="fwd_from"/> has a value</summary>
has_fwd_from = 0x20000,
}
/// <summary>ID of the story.</summary>
@ -15601,7 +15643,7 @@ namespace TL
/// <summary>Contains info about a message or story to reply to. <para>See <a href="https://corefork.telegram.org/type/InputReplyTo"/></para> <para>Derived classes: <see cref="InputReplyToMessage"/>, <see cref="InputReplyToStory"/></para></summary>
public abstract class InputReplyTo : IObject { }
/// <summary>Reply to a message. <para>See <a href="https://corefork.telegram.org/constructor/inputReplyToMessage"/></para></summary>
[TLDef(0x073EC805)]
[TLDef(0x22C0F6D5)]
public class InputReplyToMessage : InputReplyTo
{
/// <summary>Extra bits of information, use <c>flags.HasFlag(...)</c> to test for those</summary>
@ -15613,6 +15655,7 @@ namespace TL
[IfFlag(1)] public InputPeer reply_to_peer_id;
[IfFlag(2)] public string quote_text;
[IfFlag(3)] public MessageEntity[] quote_entities;
[IfFlag(4)] public int quote_offset;
[Flags] public enum Flags : uint
{
@ -15624,6 +15667,8 @@ namespace TL
has_quote_text = 0x4,
/// <summary>Field <see cref="quote_entities"/> has a value</summary>
has_quote_entities = 0x8,
/// <summary>Field <see cref="quote_offset"/> has a value</summary>
has_quote_offset = 0x10,
}
}
/// <summary>Reply to a story. <para>See <a href="https://corefork.telegram.org/constructor/inputReplyToStory"/></para></summary>
@ -15979,4 +16024,143 @@ namespace TL
has_gift_boosts = 0x10,
}
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/storyFwdHeader"/></para></summary>
[TLDef(0xB826E150)]
public class StoryFwdHeader : IObject
{
public Flags flags;
[IfFlag(0)] public Peer from;
[IfFlag(1)] public string from_name;
[IfFlag(2)] public int story_id;
[Flags] public enum Flags : uint
{
has_from = 0x1,
has_from_name = 0x2,
has_story_id = 0x4,
modified = 0x8,
}
}
/// <summary><para>See <a href="https://corefork.telegram.org/type/PostInteractionCounters"/></para></summary>
public abstract class PostInteractionCounters : IObject
{
public int views;
public int forwards;
public int reactions;
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/postInteractionCountersMessage"/></para></summary>
[TLDef(0xE7058E7F)]
public class PostInteractionCountersMessage : PostInteractionCounters
{
public int msg_id;
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/postInteractionCountersStory"/></para></summary>
[TLDef(0x8A480E27)]
public class PostInteractionCountersStory : PostInteractionCounters
{
public int story_id;
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/stats.storyStats"/></para></summary>
[TLDef(0x50CD067C)]
public class Stats_StoryStats : IObject
{
public StatsGraphBase views_graph;
public StatsGraphBase reactions_by_emotion_graph;
}
/// <summary><para>See <a href="https://corefork.telegram.org/type/PublicForward"/></para></summary>
public abstract class PublicForward : IObject { }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/publicForwardMessage"/></para></summary>
[TLDef(0x01F2BF4A)]
public class PublicForwardMessage : PublicForward
{
public MessageBase message;
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/publicForwardStory"/></para></summary>
[TLDef(0xEDF3ADD0)]
public class PublicForwardStory : PublicForward
{
public Peer peer;
public StoryItemBase story;
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/stats.publicForwards"/></para></summary>
[TLDef(0x93037E20)]
public class Stats_PublicForwards : IObject, IPeerResolver
{
public Flags flags;
public int count;
public PublicForward[] forwards;
[IfFlag(0)] public string next_offset;
public Dictionary<long, ChatBase> chats;
public Dictionary<long, User> users;
[Flags] public enum Flags : uint
{
has_next_offset = 0x1,
}
/// <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/peerColor"/></para></summary>
[TLDef(0xB54B5ACF)]
public class PeerColor : IObject
{
public Flags flags;
[IfFlag(0)] public int color;
[IfFlag(1)] public long background_emoji_id;
[Flags] public enum Flags : uint
{
has_color = 0x1,
has_background_emoji_id = 0x2,
}
}
/// <summary><para>See <a href="https://corefork.telegram.org/type/help.PeerColorSet"/></para></summary>
public abstract class Help_PeerColorSetBase : IObject { }
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/help.peerColorSet"/></para></summary>
[TLDef(0x26219A58)]
public class Help_PeerColorSet : Help_PeerColorSetBase
{
public int[] colors;
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/help.peerColorProfileSet"/></para></summary>
[TLDef(0x767D61EB)]
public class Help_PeerColorProfileSet : Help_PeerColorSetBase
{
public int[] palette_colors;
public int[] bg_colors;
public int[] story_colors;
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/help.peerColorOption"/></para></summary>
[TLDef(0x135BD42F)]
public class Help_PeerColorOption : IObject
{
public Flags flags;
public int color_id;
[IfFlag(1)] public Help_PeerColorSetBase colors;
[IfFlag(2)] public Help_PeerColorSetBase dark_colors;
[Flags] public enum Flags : uint
{
hidden = 0x1,
has_colors = 0x2,
has_dark_colors = 0x4,
}
}
/// <summary><para>See <a href="https://corefork.telegram.org/constructor/help.peerColors"/></para></summary>
/// <remarks>a <see langword="null"/> value means <a href="https://corefork.telegram.org/constructor/help.peerColorsNotModified">help.peerColorsNotModified</a></remarks>
[TLDef(0x00F8ED08)]
public class Help_PeerColors : IObject
{
public int hash;
public Help_PeerColorOption[] colors;
}
}

View file

@ -1155,11 +1155,11 @@ namespace TL
});
/// <summary><para>See <a href="https://corefork.telegram.org/method/account.updateColor"/></para></summary>
public static Task<bool> Account_UpdateColor(this Client client, int color, long? background_emoji_id = null)
public static Task<bool> Account_UpdateColor(this Client client, long? background_emoji_id = null, int? color = null, bool for_profile = false)
=> client.Invoke(new Account_UpdateColor
{
flags = (Account_UpdateColor.Flags)(background_emoji_id != null ? 0x1 : 0),
color = color,
flags = (Account_UpdateColor.Flags)((background_emoji_id != null ? 0x1 : 0) | (color != null ? 0x4 : 0) | (for_profile ? 0x2 : 0)),
color = color.GetValueOrDefault(),
background_emoji_id = background_emoji_id.GetValueOrDefault(),
});
@ -3685,16 +3685,26 @@ namespace TL
/// <param name="wallpaper">The <a href="https://corefork.telegram.org/api/wallpapers">wallpaper »</a>, obtained as described in the <a href="https://corefork.telegram.org/api/wallpapers#uploading-wallpapers">wallpaper documentation »</a>; must <strong>not</strong> be provided when installing a wallpaper obtained from a <see cref="MessageActionSetChatWallPaper"/> service message (<c>id</c> must be provided, instead).</param>
/// <param name="settings">Wallpaper settings, obtained as described in the <a href="https://corefork.telegram.org/api/wallpapers#uploading-wallpapers">wallpaper documentation »</a> or from <see cref="MessageActionSetChatWallPaper"/>.<c>wallpaper</c>.<c>settings</c>.</param>
/// <param name="id">If the wallpaper was obtained from a <see cref="MessageActionSetChatWallPaper"/> service message, must contain the ID of that message.</param>
public static Task<UpdatesBase> Messages_SetChatWallPaper(this Client client, InputPeer peer, InputWallPaperBase wallpaper = null, int? id = null, WallPaperSettings settings = null)
public static Task<UpdatesBase> Messages_SetChatWallPaper(this Client client, InputPeer peer, InputWallPaperBase wallpaper = null, int? id = null, WallPaperSettings settings = null, bool for_both = false, bool revert = false)
=> client.Invoke(new Messages_SetChatWallPaper
{
flags = (Messages_SetChatWallPaper.Flags)((wallpaper != null ? 0x1 : 0) | (id != null ? 0x2 : 0) | (settings != null ? 0x4 : 0)),
flags = (Messages_SetChatWallPaper.Flags)((wallpaper != null ? 0x1 : 0) | (id != null ? 0x2 : 0) | (settings != null ? 0x4 : 0) | (for_both ? 0x8 : 0) | (revert ? 0x10 : 0)),
peer = peer,
wallpaper = wallpaper,
settings = settings,
id = id.GetValueOrDefault(),
});
/// <summary><para>See <a href="https://corefork.telegram.org/method/messages.searchEmojiStickerSets"/></para></summary>
/// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/messages.foundStickerSetsNotModified">messages.foundStickerSetsNotModified</a></returns>
public static Task<Messages_FoundStickerSets> Messages_SearchEmojiStickerSets(this Client client, string q, long hash = default, bool exclude_featured = false)
=> client.Invoke(new Messages_SearchEmojiStickerSets
{
flags = (Messages_SearchEmojiStickerSets.Flags)(exclude_featured ? 0x1 : 0),
q = q,
hash = hash,
});
/// <summary>Returns a current state of updates. <para>See <a href="https://corefork.telegram.org/method/updates.getState"/> [bots: ✓]</para></summary>
public static Task<Updates_State> Updates_GetState(this Client client)
=> client.Invoke(new Updates_GetState
@ -4083,6 +4093,22 @@ namespace TL
{
});
/// <summary><para>See <a href="https://corefork.telegram.org/method/help.getPeerColors"/></para></summary>
/// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/help.peerColorsNotModified">help.peerColorsNotModified</a></returns>
public static Task<Help_PeerColors> Help_GetPeerColors(this Client client, int hash = default)
=> client.Invoke(new Help_GetPeerColors
{
hash = hash,
});
/// <summary><para>See <a href="https://corefork.telegram.org/method/help.getPeerProfileColors"/></para></summary>
/// <returns>a <c>null</c> value means <a href="https://corefork.telegram.org/constructor/help.peerColorsNotModified">help.peerColorsNotModified</a></returns>
public static Task<Help_PeerColors> Help_GetPeerProfileColors(this Client client, int hash = default)
=> client.Invoke(new Help_GetPeerProfileColors
{
hash = hash,
});
/// <summary>Mark <a href="https://corefork.telegram.org/api/channel">channel/supergroup</a> history as read <para>See <a href="https://corefork.telegram.org/method/channels.readHistory"/></para> <para>Possible <see cref="RpcException"/> codes: 400,406 (<a href="https://corefork.telegram.org/method/channels.readHistory#possible-errors">details</a>)</para></summary>
/// <param name="channel"><a href="https://corefork.telegram.org/api/channel">Channel/supergroup</a></param>
/// <param name="max_id">ID of message up to which messages should be marked as read</param>
@ -4704,6 +4730,21 @@ namespace TL
background_emoji_id = background_emoji_id.GetValueOrDefault(),
});
/// <summary><para>See <a href="https://corefork.telegram.org/method/channels.toggleViewForumAsMessages"/></para></summary>
public static Task<UpdatesBase> Channels_ToggleViewForumAsMessages(this Client client, InputChannelBase channel, bool enabled)
=> client.Invoke(new Channels_ToggleViewForumAsMessages
{
channel = channel,
enabled = enabled,
});
/// <summary><para>See <a href="https://corefork.telegram.org/method/channels.getChannelRecommendations"/></para></summary>
public static Task<Messages_Chats> Channels_GetChannelRecommendations(this Client client, InputChannelBase channel)
=> client.Invoke(new Channels_GetChannelRecommendations
{
channel = channel,
});
/// <summary>Sends a custom request; for bots only <para>See <a href="https://corefork.telegram.org/method/bots.sendCustomRequest"/> [bots: ✓]</para> <para>Possible <see cref="RpcException"/> codes: 400,403 (<a href="https://corefork.telegram.org/method/bots.sendCustomRequest#possible-errors">details</a>)</para></summary>
/// <param name="custom_method">The method name</param>
/// <param name="params_">JSON-serialized method parameters</param>
@ -5616,6 +5657,25 @@ namespace TL
msg_id = msg_id,
});
/// <summary><para>See <a href="https://corefork.telegram.org/method/stats.getStoryStats"/></para></summary>
public static Task<Stats_StoryStats> Stats_GetStoryStats(this Client client, InputPeer peer, int id, bool dark = false)
=> client.Invoke(new Stats_GetStoryStats
{
flags = (Stats_GetStoryStats.Flags)(dark ? 0x1 : 0),
peer = peer,
id = id,
});
/// <summary><para>See <a href="https://corefork.telegram.org/method/stats.getStoryPublicForwards"/></para></summary>
public static Task<Stats_PublicForwards> Stats_GetStoryPublicForwards(this Client client, InputPeer peer, int id, string offset, int limit = int.MaxValue)
=> client.Invoke(new Stats_GetStoryPublicForwards
{
peer = peer,
id = id,
offset = offset,
limit = limit,
});
/// <summary>Export a <a href="https://corefork.telegram.org/api/folders">folder »</a>, creating a <a href="https://corefork.telegram.org/api/links#chat-folder-links">chat folder deep link »</a>. <para>See <a href="https://corefork.telegram.org/method/chatlists.exportChatlistInvite"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/chatlists.exportChatlistInvite#possible-errors">details</a>)</para></summary>
/// <param name="chatlist">The folder to export</param>
/// <param name="title">An optional name for the link</param>
@ -5742,10 +5802,10 @@ namespace TL
/// <param name="privacy_rules"><a href="https://corefork.telegram.org/api/privacy">Privacy rules</a> for the story, indicating who can or can't view the story.</param>
/// <param name="random_id">Unique client message ID required to prevent message resending. <para>You can use <see cref="WTelegram.Helpers.RandomLong"/></para></param>
/// <param name="period">Period after which the story is moved to archive (and to the profile if <c>pinned</c> is set), in seconds; must be one of <c>6 * 3600</c>, <c>12 * 3600</c>, <c>86400</c>, or <c>2 * 86400</c> for Telegram Premium users, and <c>86400</c> otherwise.</param>
public static Task<UpdatesBase> Stories_SendStory(this Client client, InputPeer peer, InputMedia media, InputPrivacyRule[] privacy_rules, long random_id, string caption = null, MessageEntity[] entities = null, int? period = null, MediaArea[] media_areas = null, bool pinned = false, bool noforwards = false)
public static Task<UpdatesBase> Stories_SendStory(this Client client, InputPeer peer, InputMedia media, InputPrivacyRule[] privacy_rules, long random_id, string caption = null, MessageEntity[] entities = null, int? period = null, MediaArea[] media_areas = null, InputPeer fwd_from_id = null, int? fwd_from_story = null, bool pinned = false, bool noforwards = false, bool fwd_modified = false)
=> client.Invoke(new Stories_SendStory
{
flags = (Stories_SendStory.Flags)((caption != null ? 0x1 : 0) | (entities != null ? 0x2 : 0) | (period != null ? 0x8 : 0) | (media_areas != null ? 0x20 : 0) | (pinned ? 0x4 : 0) | (noforwards ? 0x10 : 0)),
flags = (Stories_SendStory.Flags)((caption != null ? 0x1 : 0) | (entities != null ? 0x2 : 0) | (period != null ? 0x8 : 0) | (media_areas != null ? 0x20 : 0) | (fwd_from_id != null ? 0x40 : 0) | (fwd_from_story != null ? 0x40 : 0) | (pinned ? 0x4 : 0) | (noforwards ? 0x10 : 0) | (fwd_modified ? 0x80 : 0)),
peer = peer,
media = media,
media_areas = media_areas,
@ -5754,6 +5814,8 @@ namespace TL
privacy_rules = privacy_rules,
random_id = random_id,
period = period.GetValueOrDefault(),
fwd_from_id = fwd_from_id,
fwd_from_story = fwd_from_story.GetValueOrDefault(),
});
/// <summary>Edit an uploaded <a href="https://corefork.telegram.org/api/stories">story</a> <para>See <a href="https://corefork.telegram.org/method/stories.editStory"/></para> <para>Possible <see cref="RpcException"/> codes: 400 (<a href="https://corefork.telegram.org/method/stories.editStory#possible-errors">details</a>)</para></summary>
@ -6906,16 +6968,18 @@ namespace TL.Methods
public string[] codes;
}
[TLDef(0xA001CC43)]
[TLDef(0x7CEFA15D)]
public class Account_UpdateColor : IMethod<bool>
{
public Flags flags;
public int color;
[IfFlag(2)] public int color;
[IfFlag(0)] public long background_emoji_id;
[Flags] public enum Flags : uint
{
has_background_emoji_id = 0x1,
for_profile = 0x2,
has_color = 0x4,
}
}
@ -9063,6 +9127,21 @@ namespace TL.Methods
has_wallpaper = 0x1,
has_id = 0x2,
has_settings = 0x4,
for_both = 0x8,
revert = 0x10,
}
}
[TLDef(0x92B4494C)]
public class Messages_SearchEmojiStickerSets : IMethod<Messages_FoundStickerSets>
{
public Flags flags;
public string q;
public long hash;
[Flags] public enum Flags : uint
{
exclude_featured = 0x1,
}
}
@ -9359,6 +9438,18 @@ namespace TL.Methods
[TLDef(0xB81B93D4)]
public class Help_GetPremiumPromo : IMethod<Help_PremiumPromo> { }
[TLDef(0xDA80F42F)]
public class Help_GetPeerColors : IMethod<Help_PeerColors>
{
public int hash;
}
[TLDef(0xABCFA9FD)]
public class Help_GetPeerProfileColors : IMethod<Help_PeerColors>
{
public int hash;
}
[TLDef(0xCC104937)]
public class Channels_ReadHistory : IMethod<bool>
{
@ -9843,6 +9934,19 @@ namespace TL.Methods
}
}
[TLDef(0x9738BB15)]
public class Channels_ToggleViewForumAsMessages : IMethod<UpdatesBase>
{
public InputChannelBase channel;
public bool enabled;
}
[TLDef(0x83B70D97)]
public class Channels_GetChannelRecommendations : IMethod<Messages_Chats>
{
public InputChannelBase channel;
}
[TLDef(0xAA2769ED)]
public class Bots_SendCustomRequest : IMethod<DataJSON>
{
@ -10606,6 +10710,28 @@ namespace TL.Methods
}
}
[TLDef(0x374FEF40)]
public class Stats_GetStoryStats : IMethod<Stats_StoryStats>
{
public Flags flags;
public InputPeer peer;
public int id;
[Flags] public enum Flags : uint
{
dark = 0x1,
}
}
[TLDef(0xA6437EF6)]
public class Stats_GetStoryPublicForwards : IMethod<Stats_PublicForwards>
{
public InputPeer peer;
public int id;
public string offset;
public int limit;
}
[TLDef(0x8472478E)]
public class Chatlists_ExportChatlistInvite : IMethod<Chatlists_ExportedChatlistInvite>
{
@ -10694,7 +10820,7 @@ namespace TL.Methods
public InputPeer peer;
}
[TLDef(0xBCB73644)]
[TLDef(0xE4E6694B)]
public class Stories_SendStory : IMethod<UpdatesBase>
{
public Flags flags;
@ -10706,6 +10832,8 @@ namespace TL.Methods
public InputPrivacyRule[] privacy_rules;
public long random_id;
[IfFlag(3)] public int period;
[IfFlag(6)] public InputPeer fwd_from_id;
[IfFlag(6)] public int fwd_from_story;
[Flags] public enum Flags : uint
{
@ -10715,6 +10843,8 @@ namespace TL.Methods
has_period = 0x8,
noforwards = 0x10,
has_media_areas = 0x20,
has_fwd_from_id = 0x40,
fwd_modified = 0x80,
}
}

View file

@ -6,7 +6,7 @@ namespace TL
{
public static class Layer
{
public const int Version = 166; // fetched 06/11/2023 22:51:44
public const int Version = 167; // fetched 30/11/2023 15:07:08
internal const int SecretChats = 144;
internal const int MTProto2 = 73;
internal const uint VectorCtor = 0x1CB5C415;
@ -121,7 +121,7 @@ namespace TL
[0x36C6019A] = typeof(PeerChat),
[0xA2A5371E] = typeof(PeerChannel),
[0xD3BC4B7A] = typeof(UserEmpty),
[0xEB602F25] = typeof(User),
[0x215C4438] = typeof(User),
[0x4F11BAE1] = null,//UserProfilePhotoEmpty
[0x82D1F706] = typeof(UserProfilePhoto),
[0x09D05049] = null,//UserStatusEmpty
@ -133,7 +133,7 @@ namespace TL
[0x29562865] = typeof(ChatEmpty),
[0x41CBF256] = typeof(Chat),
[0x6592A1A7] = typeof(ChatForbidden),
[0x1981EA7E] = typeof(Channel),
[0x8E87CCD8] = typeof(Channel),
[0x17D493D5] = typeof(ChannelForbidden),
[0xC9D31138] = typeof(ChatFull),
[0x723027BD] = typeof(ChannelFull),
@ -199,10 +199,10 @@ namespace TL
[0xC0944820] = typeof(MessageActionTopicEdit),
[0x57DE635E] = typeof(MessageActionSuggestProfilePhoto),
[0xFE77345D] = typeof(MessageActionRequestedPeer),
[0xBC44A927] = typeof(MessageActionSetChatWallPaper),
[0xC0787D6D] = typeof(MessageActionSetSameChatWallPaper),
[0x5060A3F4] = typeof(MessageActionSetChatWallPaper),
[0xD2CFDB0E] = typeof(MessageActionGiftCode),
[0x332BA9ED] = typeof(MessageActionGiveawayLaunch),
[0x2A9FADC5] = typeof(MessageActionGiveawayResults),
[0xD58A08C6] = typeof(Dialog),
[0x71BD134C] = typeof(DialogFolder),
[0x2331B22D] = typeof(PhotoEmpty),
@ -385,6 +385,8 @@ namespace TL
[0x2C084DC1] = typeof(UpdateStoriesStealthMode),
[0x7D627683] = typeof(UpdateSentStoryReaction),
[0x904DD49C] = typeof(UpdateBotChatBoost),
[0x07B68920] = typeof(UpdateChannelViewForumAsMessages),
[0xAE3F101D] = typeof(UpdatePeerWallpaper),
[0xA56C2A3E] = typeof(Updates_State),
[0x5D75A138] = typeof(Updates_DifferenceEmpty),
[0x00F49CA0] = typeof(Updates_Difference),
@ -942,8 +944,7 @@ namespace TL
[0x4A27EB2D] = typeof(StatsGraphAsync),
[0xBEDC9822] = typeof(StatsGraphError),
[0x8EA464B6] = typeof(StatsGraph),
[0xAD4FC9BD] = typeof(MessageInteractionCounters),
[0xBDF78394] = typeof(Stats_BroadcastStats),
[0x396CA5FC] = typeof(Stats_BroadcastStats),
[0x98F6AC75] = typeof(Help_PromoDataEmpty),
[0x8C39793F] = typeof(Help_PromoData),
[0xDE33B094] = typeof(VideoSize),
@ -961,11 +962,11 @@ namespace TL
[0x455B853D] = typeof(MessageViews),
[0xB6C4F543] = typeof(Messages_MessageViews),
[0xA6341782] = typeof(Messages_DiscussionMessage),
[0x6EEBCABD] = typeof(MessageReplyHeader),
[0xAFBC09DB] = typeof(MessageReplyHeader),
[0x9C98BFC1] = typeof(MessageReplyStoryHeader),
[0x83D60FC2] = typeof(MessageReplies),
[0xE8FD8014] = typeof(PeerBlocked),
[0x8999F295] = typeof(Stats_MessageStats),
[0x7FE91C14] = typeof(Stats_MessageStats),
[0x7780BCB4] = typeof(GroupCallDiscarded),
[0xD597650C] = typeof(GroupCall),
[0xD8AA840F] = typeof(InputGroupCall),
@ -998,7 +999,7 @@ namespace TL
[0xE3779861] = typeof(Account_ResetPasswordFailedWait),
[0xE9EFFC7D] = typeof(Account_ResetPasswordRequestedWait),
[0xE926D63E] = typeof(Account_ResetPasswordOk),
[0xDAAFFF6B] = typeof(SponsoredMessage),
[0xED5383F7] = typeof(SponsoredMessage),
[0xC9EE1D87] = typeof(Messages_SponsoredMessages),
[0x1839490F] = null,//Messages_SponsoredMessagesEmpty
[0xC9B0539F] = typeof(SearchResultsCalendarPeriod),
@ -1043,7 +1044,7 @@ namespace TL
[0xC326CAEF] = typeof(InputInvoiceSlug),
[0x98986C0D] = typeof(InputInvoicePremiumGiftCode),
[0xAED0CBD9] = typeof(Payments_ExportedInvoice),
[0x93752C52] = typeof(Messages_TranscribedAudio),
[0xCFB9D957] = typeof(Messages_TranscribedAudio),
[0x5334759C] = typeof(Help_PremiumPromo),
[0xA6751E66] = typeof(InputStorePaymentPremiumSubscription),
[0x616F7FE8] = typeof(InputStorePaymentGiftPremium),
@ -1121,14 +1122,14 @@ namespace TL
[0x8D595CD6] = typeof(StoryViews),
[0x51E6EE4F] = typeof(StoryItemDeleted),
[0xFFADC913] = typeof(StoryItemSkipped),
[0x44C457CE] = typeof(StoryItem),
[0xAF6365A1] = typeof(StoryItem),
[0x1158FE3E] = typeof(Stories_AllStoriesNotModified),
[0x6EFC5E81] = typeof(Stories_AllStories),
[0x5DD8C3C8] = typeof(Stories_Stories),
[0xB0BDEAC5] = typeof(StoryView),
[0x46E9B9EC] = typeof(Stories_StoryViewsList),
[0xDE9EED1D] = typeof(Stories_StoryViews),
[0x073EC805] = typeof(InputReplyToMessage),
[0x22C0F6D5] = typeof(InputReplyToMessage),
[0x15B0F283] = typeof(InputReplyToStory),
[0x3FC9053B] = typeof(ExportedStoryLink),
[0x712E27FD] = typeof(StoriesStealthMode),
@ -1150,6 +1151,19 @@ namespace TL
[0xC448415C] = typeof(MyBoost),
[0x9AE228E2] = typeof(Premium_MyBoosts),
[0x4959427A] = typeof(Premium_BoostsStatus),
[0xB826E150] = typeof(StoryFwdHeader),
[0xE7058E7F] = typeof(PostInteractionCountersMessage),
[0x8A480E27] = typeof(PostInteractionCountersStory),
[0x50CD067C] = typeof(Stats_StoryStats),
[0x01F2BF4A] = typeof(PublicForwardMessage),
[0xEDF3ADD0] = typeof(PublicForwardStory),
[0x93037E20] = typeof(Stats_PublicForwards),
[0xB54B5ACF] = typeof(PeerColor),
[0x26219A58] = typeof(Help_PeerColorSet),
[0x767D61EB] = typeof(Help_PeerColorProfileSet),
[0x135BD42F] = typeof(Help_PeerColorOption),
[0x2BA1F5CE] = null,//Help_PeerColorsNotModified
[0x00F8ED08] = typeof(Help_PeerColors),
// from TL.Secret:
[0x6ABD9782] = typeof(Layer143.DecryptedMessageMediaDocument),
[0x91CC4674] = typeof(Layer73.DecryptedMessage),
@ -1272,6 +1286,7 @@ namespace TL
[typeof(Messages_EmojiGroups)] = 0x6FB4AD87, //messages.emojiGroupsNotModified
[typeof(Help_AppConfig)] = 0x7CDE641D, //help.appConfigNotModified
[typeof(BotApp)] = 0x5DA674B7, //botAppNotModified
[typeof(Help_PeerColors)] = 0x2BA1F5CE, //help.peerColorsNotModified
[typeof(DecryptedMessageMedia)] = 0x089F5C4A, //decryptedMessageMediaEmpty
};
}

View file

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