diff --git a/README.md b/README.md
index 44fe5df..749db94 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-[](https://corefork.telegram.org/methods)
+[](https://corefork.telegram.org/methods)
[](https://www.nuget.org/packages/WTelegramClient/)
[](https://www.nuget.org/packages/WTelegramClient/absoluteLatest)
[](https://www.buymeacoffee.com/wizou)
diff --git a/src/Client.cs b/src/Client.cs
index 8d6c512..325cfeb 100644
--- a/src/Client.cs
+++ b/src/Client.cs
@@ -491,7 +491,7 @@ namespace WTelegram
var keys = _dcSession.Salts.Keys;
if (keys[^1] == DateTime.MaxValue) return; // GetFutureSalts ongoing
var now = DateTime.UtcNow.AddTicks(_dcSession.ServerTicksOffset);
- for (; keys.Count > 1 && keys[1] < now; _dcSession.OldSalt = _dcSession.Salt, _dcSession.Salt = _dcSession.Salts.Values[0])
+ for (; keys.Count > 1 && keys[1] < now; _dcSession.OldSalt = _dcSession.Salt, _dcSession.Salt = _dcSession.Salts.Values[0])
_dcSession.Salts.RemoveAt(0);
if (_dcSession.Salts.Count > 48) return;
}
diff --git a/src/Session.cs b/src/Session.cs
index 11bf28a..b76ecbc 100644
--- a/src/Session.cs
+++ b/src/Session.cs
@@ -7,6 +7,10 @@ using System.Net;
using System.Security.Cryptography;
using System.Text.Json;
+//( Fuck you Andrei, you don't know what you're doing! You're lowering the security, contrary to Telegram recommended practices.
+//( Read the official API documentation. And if you want to mess around, at least don't publish a lame copy of my lib on nuget.
+//( Also you're apparently a noob in C#, so don't judge my experienced code where every line is carefully written on purpose.
+
namespace WTelegram
{
internal class Session : IDisposable
@@ -78,7 +82,7 @@ namespace WTelegram
public DateTime SessionStart => _sessionStart;
private readonly DateTime _sessionStart = DateTime.UtcNow;
- private readonly SHA256 _sha256 = SHA256.Create();
+ private readonly SHA256 _sha256 = SHA256.Create(); // put
private Stream _store;
private byte[] _reuseKey; // used only if AES Encryptor.CanReuseTransform = false (Mono)
private byte[] _encrypted = new byte[16];
@@ -92,7 +96,7 @@ namespace WTelegram
_store.Dispose();
_encryptor.Dispose();
_jsonWriter.Dispose();
- _jsonStream.Dispose();
+ _jsonStream.Dispose(); // this
}
internal static Session LoadOrCreate(Stream store, byte[] rgbKey)
@@ -104,7 +108,7 @@ namespace WTelegram
var length = (int)store.Length;
if (length > 0)
{
- var input = new byte[length];
+ var input = new byte[length]; // code
if (store.Read(input, 0, length) != length)
throw new WTException($"Can't read session block ({store.Position}, {length})");
using var sha256 = SHA256.Create();
@@ -138,7 +142,7 @@ namespace WTelegram
int encryptedLen = 64 + (utf8JsonLen & ~15);
lock (_store) // while updating _encrypted buffer and writing to store
{
- if (encryptedLen > _encrypted.Length)
+ if (encryptedLen > _encrypted.Length) // back
Array.Copy(_encrypted, _encrypted = new byte[encryptedLen + 256], 16);
_encryptor.TransformBlock(_sha256.ComputeHash(utf8Json, 0, utf8JsonLen), 0, 32, _encrypted, 16);
_encryptor.TransformBlock(utf8Json, 0, encryptedLen - 64, _encrypted, 48);
@@ -155,7 +159,7 @@ namespace WTelegram
}
}
- internal class SessionStore : FileStream
+ internal class SessionStore : FileStream // This class is designed to be high-performance and failure-resilient with Writes (but when you're Andrei, you can't understand that)
{
public override long Length { get; }
public override long Position { get => base.Position; set { } }
diff --git a/src/TL.Schema.cs b/src/TL.Schema.cs
index 7d45260..3ffc471 100644
--- a/src/TL.Schema.cs
+++ b/src/TL.Schema.cs
@@ -464,18 +464,22 @@ namespace TL
/// Story ID
public int id;
}
- /// See
+ /// Specifies options that will be used to generate the link preview for the caption, or even a standalone link preview without an attached message. See
[TLDef(0xC21B8849)]
public class InputMediaWebPage : InputMedia
{
/// Extra bits of information, use flags.HasFlag(...) to test for those
public Flags flags;
+ /// The URL to use for the link preview.
public string url;
[Flags] public enum Flags : uint
{
+ /// If set, specifies that a large media preview should be used.
force_large_media = 0x1,
+ /// If set, specifies that a small media preview should be used.
force_small_media = 0x2,
+ /// If not set, a WEBPAGE_NOT_FOUND RPC error will be emitted if a webpage preview cannot be generated for the specified url; otherwise, no error will be emitted (unless the provided message is also empty, in which case a MESSAGE_EMPTY will be emitted, instead).
optional = 0x4,
}
}
@@ -777,7 +781,9 @@ namespace TL
[IfFlag(32)] public Username[] usernames;
/// ID of the maximum read story.
[IfFlag(37)] public int stories_max_id;
+ /// The user's accent color.
[IfFlag(40)] public PeerColor color;
+ /// The user's profile color.
[IfFlag(41)] public PeerColor profile_color;
[Flags] public enum Flags : uint
@@ -850,6 +856,7 @@ namespace TL
close_friend = 0x4,
/// Whether we have hidden » all active stories of this user.
stories_hidden = 0x8,
+ /// No stories from this user are visible.
stories_unavailable = 0x10,
/// Field has a value
has_stories_max_id = 0x20,
@@ -997,7 +1004,7 @@ namespace TL
public override string Title => title;
}
/// Channel/supergroup info See
- [TLDef(0x8E87CCD8)]
+ [TLDef(0x0AADFC8F)]
public partial class Channel : ChatBase
{
/// Extra bits of information, use flags.HasFlag(...) to test for those
@@ -1030,7 +1037,11 @@ namespace TL
[IfFlag(32)] public Username[] usernames;
/// ID of the maximum read story.
[IfFlag(36)] public int stories_max_id;
+ /// The channel's accent color.
[IfFlag(39)] public PeerColor color;
+ [IfFlag(40)] public PeerColor profile_color;
+ [IfFlag(41)] public EmojiStatus emoji_status;
+ [IfFlag(42)] public int level;
[Flags] public enum Flags : uint
{
@@ -1096,11 +1107,18 @@ namespace TL
stories_hidden = 0x2,
/// If set, indicates that the stories_hidden flag was not populated, and its value must cannot be relied on; use the previously cached value, or re-fetch the constructor using Channels_GetChannels to obtain the latest value of the stories_hidden flag.
stories_hidden_min = 0x4,
+ /// No stories from the channel are visible.
stories_unavailable = 0x8,
/// Field has a value
has_stories_max_id = 0x10,
/// Field has a value
has_color = 0x80,
+ /// Field has a value
+ has_profile_color = 0x100,
+ /// Field has a value
+ has_emoji_status = 0x200,
+ /// Field has a value
+ has_level = 0x400,
}
/// ID of the channel
@@ -1276,7 +1294,7 @@ namespace TL
public override ChatReactions AvailableReactions => available_reactions;
}
/// Full info about a channel, supergroup or gigagroup. See
- [TLDef(0x723027BD)]
+ [TLDef(0x0F2BCB6F)]
public partial class ChannelFull : ChatFullBase
{
/// Extra bits of information, use flags.HasFlag(...) to test for those
@@ -1355,6 +1373,7 @@ namespace TL
[IfFlag(30)] public ChatReactions available_reactions;
/// Channel stories
[IfFlag(36)] public PeerStories stories;
+ [IfFlag(39)] public WallPaperBase wallpaper;
[Flags] public enum Flags : uint
{
@@ -1436,7 +1455,10 @@ namespace TL
has_stories = 0x10,
/// Whether this user has some pinned stories.
stories_pinned_available = 0x20,
+ /// Users may also choose to display messages from all topics of a forum as if they were sent to a normal group, using a "View as messages" setting in the local client.
This setting only affects the current account, and is synced to other logged in sessions using the Channels_ToggleViewForumAsMessages method; invoking this method will update the value of this flag.
view_forum_as_messages = 0x40,
+ /// Field has a value
+ has_wallpaper = 0x80,
}
/// ID of the channel
@@ -1869,9 +1891,13 @@ namespace TL
[Flags] public enum Flags : uint
{
+ /// If set, specifies that a large media preview should be used.
force_large_media = 0x1,
+ /// If set, specifies that a small media preview should be used.
force_small_media = 0x2,
+ /// If set, indicates that the URL used for the webpage preview was specified manually using , and may not be related to any of the URLs specified in the message.
manual = 0x8,
+ /// If set, the webpage can be opened directly without user confirmation; otherwise, user confirmation is required, showing the exact URL that will be opened.
safe = 0x10,
}
}
@@ -1998,23 +2024,56 @@ namespace TL
via_mention = 0x2,
}
}
- /// See
- [TLDef(0x58260664)]
+ /// Contains info about a giveaway, see here » for more info. See
+ [TLDef(0xDAAD85B0)]
public class MessageMediaGiveaway : MessageMedia
{
/// Extra bits of information, use flags.HasFlag(...) to test for those
public Flags flags;
+ /// The channels that the user must join to participate in the giveaway.
public long[] channels;
+ /// If set, only users residing in these countries can participate in the giveaway, (specified as a list of two-letter ISO 3166-1 alpha-2 country codes); otherwise there are no country-based limitations.
[IfFlag(1)] public string[] countries_iso2;
+ [IfFlag(3)] public string prize_description;
+ /// Number of Telegram Premium subscriptions given away.
public int quantity;
+ /// Duration in months of each Telegram Premium subscription in the giveaway.
public int months;
+ /// The end date of the giveaway.
+ public DateTime until_date;
+
+ [Flags] public enum Flags : uint
+ {
+ /// If set, only new subscribers starting from the giveaway creation date will be able to participate to the giveaway.
+ only_new_subscribers = 0x1,
+ /// Field has a value
+ has_countries_iso2 = 0x2,
+ winners_are_visible = 0x4,
+ /// Field has a value
+ has_prize_description = 0x8,
+ }
+ }
+ /// See
+ [TLDef(0xC6991068)]
+ public class MessageMediaGiveawayResults : MessageMedia
+ {
+ public Flags flags;
+ public long channel_id;
+ [IfFlag(3)] public int additional_peers_count;
+ public int launch_msg_id;
+ public int winners_count;
+ public int unclaimed_count;
+ public long[] winners;
+ public int months;
+ [IfFlag(1)] public string prize_description;
public DateTime until_date;
[Flags] public enum Flags : uint
{
only_new_subscribers = 0x1,
- /// Field has a value
- has_countries_iso2 = 0x2,
+ has_prize_description = 0x2,
+ refunded = 0x4,
+ has_additional_peers_count = 0x8,
}
}
@@ -2399,13 +2458,12 @@ namespace TL
public PhotoBase photo;
}
/// Contains info about a peer that the user shared with the bot after clicking on a button. See
- [TLDef(0xFE77345D)]
+ [TLDef(0x31518E9B)]
public class MessageActionRequestedPeer : MessageAction
{
/// button_id contained in the
public int button_id;
- /// The shared peer
- public Peer peer;
+ public Peer[] peers;
}
/// The wallpaper » of the current chat was changed. See
[TLDef(0x5060A3F4)]
@@ -2424,32 +2482,45 @@ namespace TL
for_both = 0x2,
}
}
- /// See
- [TLDef(0xD2CFDB0E)]
+ /// Contains a Telegram Premium giftcode link. See
+ [TLDef(0x678C2E09)]
public class MessageActionGiftCode : MessageAction
{
/// Extra bits of information, use flags.HasFlag(...) to test for those
public Flags flags;
+ /// Identifier of the channel that created the gift code either directly or through a giveaway: if we import this giftcode link, we will also automatically boost this channel.
[IfFlag(1)] public Peer boost_peer;
+ /// Duration in months of the gifted Telegram Premium subscription.
public int months;
+ /// Slug of the Telegram Premium giftcode link
public string slug;
+ [IfFlag(2)] public string currency;
+ [IfFlag(2)] public long amount;
+ [IfFlag(3)] public string crypto_currency;
+ [IfFlag(3)] public long crypto_amount;
[Flags] public enum Flags : uint
{
+ /// If set, this gift code was received from a giveaway » started by a channel we're subscribed to.
via_giveaway = 0x1,
/// Field has a value
has_boost_peer = 0x2,
+ /// If set, the link was not redeemed yet.
unclaimed = 0x4,
+ /// Fields and have a value
+ has_crypto_currency = 0x8,
}
}
- /// See
+ /// A giveaway was started. See
[TLDef(0x332BA9ED)]
public class MessageActionGiveawayLaunch : MessageAction { }
- /// See
+ /// A giveaway has ended. See
[TLDef(0x2A9FADC5)]
public class MessageActionGiveawayResults : MessageAction
{
+ /// Number of winners in the giveaway
public int winners_count;
+ /// Number of undistributed prizes
public int unclaimed_count;
}
@@ -2506,6 +2577,7 @@ namespace TL
has_folder_id = 0x10,
/// Field has a value
has_ttl_period = 0x20,
+ /// Users may also choose to display messages from all topics of a forum as if they were sent to a normal group, using a "View as messages" setting in the local client.
This setting only affects the current account, and is synced to other logged in sessions using the Channels_ToggleViewForumAsMessages method; invoking this method will update the value of this flag.
view_forum_as_messages = 0x40,
}
@@ -3753,6 +3825,7 @@ namespace TL
public int pts;
/// Number of events that were generated
public int pts_count;
+ /// When was the last message in messages marked as read.
[IfFlag(0)] public DateTime date;
[Flags] public enum Flags : uint
@@ -4886,20 +4959,24 @@ namespace TL
/// The reaction that was sent
public Reaction reaction;
}
- /// See
+ /// A channel boost has changed (bots only) See
[TLDef(0x904DD49C)]
public class UpdateBotChatBoost : Update
{
+ /// Channel
public Peer peer;
+ /// New boost information
public Boost boost;
+ /// QTS event sequence identifier
public int qts;
public override (long, int, int) GetMBox() => (-1, qts, 1);
}
- /// See
+ /// Users may also choose to display messages from all topics as if they were sent to a normal group, using a "View as messages" setting in the local client.
This setting only affects the current account, and is synced to other logged in sessions using the Channels_ToggleViewForumAsMessages method; invoking this method will update the value of the view_forum_as_messages flag of or and emit an . See
[TLDef(0x07B68920, inheritBefore = true)]
public class UpdateChannelViewForumAsMessages : UpdateChannel
{
+ /// The new value of the toggle.
public bool enabled;
}
/// The wallpaper » of a given peer has changed. See
@@ -4910,15 +4987,43 @@ namespace TL
public Flags flags;
/// The peer where the wallpaper has changed.
public Peer peer;
+ /// The new wallpaper, if none the wallpaper was removed and the default wallpaper should be used.
[IfFlag(0)] public WallPaperBase wallpaper;
[Flags] public enum Flags : uint
{
/// Field has a value
has_wallpaper = 0x1,
+ /// Whether the other user has chosen a custom wallpaper for us using Messages_SetChatWallPaper and the for_both flag, see here » for more info.
wallpaper_overridden = 0x2,
}
}
+ /// See
+ [TLDef(0xAC21D3CE)]
+ public class UpdateBotMessageReaction : Update
+ {
+ public Peer peer;
+ public int msg_id;
+ public DateTime date;
+ public Peer actor;
+ public Reaction[] old_reactions;
+ public Reaction[] new_reactions;
+ public int qts;
+
+ public override (long, int, int) GetMBox() => (-1, qts, 1);
+ }
+ /// See
+ [TLDef(0x09CB7759)]
+ public class UpdateBotMessageReactions : Update
+ {
+ public Peer peer;
+ public int msg_id;
+ public DateTime date;
+ public ReactionCount[] reactions;
+ public int qts;
+
+ public override (long, int, int) GetMBox() => (-1, qts, 1);
+ }
/// Updates state. See
[TLDef(0xA56C2A3E)]
@@ -6364,6 +6469,7 @@ namespace TL
{
/// Preview ID
public virtual long ID { get; }
+ /// URL of the webpage.
public virtual string Url { get; }
}
/// No preview is available for the webpage See
@@ -6374,6 +6480,7 @@ namespace TL
public Flags flags;
/// Preview ID
public long id;
+ /// URL of the webpage.
[IfFlag(0)] public string url;
[Flags] public enum Flags : uint
@@ -6384,6 +6491,7 @@ namespace TL
/// Preview ID
public override long ID => id;
+ /// URL of the webpage.
public override string Url => url;
}
/// A preview of the webpage is currently being generated See
@@ -6394,6 +6502,7 @@ namespace TL
public Flags flags;
/// ID of preview
public long id;
+ /// URL of the webpage
[IfFlag(0)] public string url;
/// When was the processing started
public DateTime date;
@@ -6406,6 +6515,7 @@ namespace TL
/// ID of preview
public override long ID => id;
+ /// URL of the webpage
public override string Url => url;
}
/// Webpage preview See
@@ -6477,6 +6587,7 @@ namespace TL
has_cached_page = 0x400,
/// Field has a value
has_attributes = 0x1000,
+ /// Whether the size of the media in the preview can be changed.
has_large_media = 0x2000,
}
@@ -6749,6 +6860,7 @@ namespace TL
public int participants_count;
/// A few of the participants that are in the group
[IfFlag(4)] public UserBase[] participants;
+ /// Profile color palette ID
public int color;
[Flags] public enum Flags : uint
@@ -6829,6 +6941,9 @@ namespace TL
/// Default custom emoji stickerset for forum topic icons See
[TLDef(0x44C1F8E9)]
public class InputStickerSetEmojiDefaultTopicIcons : InputStickerSet { }
+ /// See
+ [TLDef(0x49748553)]
+ public class InputStickerSetEmojiChannelDefaultStatuses : InputStickerSet { }
/// Represents a stickerset (stickerpack) See
[TLDef(0x2DD14EDC)]
@@ -6879,7 +6994,9 @@ namespace TL
emojis = 0x80,
/// Field has a value
has_thumb_document_id = 0x100,
+ /// Whether the color of this TGS custom emoji stickerset should be changed to the text color when used in messages, the accent color if used as emoji status, white on chat photos, or another appropriate color based on context.
text_color = 0x200,
+ channel_emoji_status = 0x400,
}
}
@@ -7128,13 +7245,14 @@ namespace TL
{
}
/// Prompts the user to select and share a peer with the bot using Messages_SendBotRequestedPeer See
- [TLDef(0x0D0B468C, inheritBefore = true)]
+ [TLDef(0x53D7BFD8, inheritBefore = true)]
public class KeyboardButtonRequestPeer : KeyboardButton
{
/// Button ID, to be passed to Messages_SendBotRequestedPeer.
public int button_id;
/// Filtering criteria to use for the peer selection list shown to the user.
The list should display all existing peers of the specified type, and should also offer an option for the user to create and immediately use a peer of the specified type, if needed.
public RequestPeerType peer_type;
+ public int max_quantity;
}
/// Inline keyboard row See
@@ -7870,16 +7988,19 @@ namespace TL
has_reply_markup = 0x4,
}
}
- /// See
+ /// Specifies options that will be used to generate the link preview for the message, or even a standalone link preview without an attached message. See
[TLDef(0xBDDCC510)]
public class InputBotInlineMessageMediaWebPage : InputBotInlineMessage
{
/// Extra bits of information, use flags.HasFlag(...) to test for those
public Flags flags;
+ /// The message, can be empty.
public string message;
/// Message entities for styled text
[IfFlag(1)] public MessageEntity[] entities;
+ /// The URL to use for the link preview.
public string url;
+ /// Inline keyboard
[IfFlag(2)] public ReplyMarkup reply_markup;
[Flags] public enum Flags : uint
@@ -7890,8 +8011,11 @@ namespace TL
has_reply_markup = 0x4,
/// If set, any eventual webpage preview will be shown on top of the message instead of at the bottom.
invert_media = 0x8,
+ /// If set, specifies that a large media preview should be used.
force_large_media = 0x10,
+ /// If set, specifies that a small media preview should be used.
force_small_media = 0x20,
+ /// If not set, a WEBPAGE_NOT_FOUND RPC error will be emitted if a webpage preview cannot be generated for the specified url; otherwise, no error will be emitted (unless the provided message is also empty, in which case a MESSAGE_EMPTY will be emitted, instead).
optional = 0x40,
}
}
@@ -8173,16 +8297,19 @@ namespace TL
test = 0x8,
}
}
- /// See
+ /// Specifies options that must be used to generate the link preview for the message, or even a standalone link preview without an attached message. See
[TLDef(0x809AD9A6)]
public class BotInlineMessageMediaWebPage : BotInlineMessage
{
/// Extra bits of information, use flags.HasFlag(...) to test for those
public Flags flags;
+ /// The message, can be empty.
public string message;
/// Message entities for styled text
[IfFlag(1)] public MessageEntity[] entities;
+ /// The URL to use for the link preview.
public string url;
+ /// Reply markup for sending bot buttons
[IfFlag(2)] public ReplyMarkup reply_markup;
[Flags] public enum Flags : uint
@@ -8193,9 +8320,13 @@ namespace TL
has_reply_markup = 0x4,
/// If set, any eventual webpage preview will be shown on top of the message instead of at the bottom.
invert_media = 0x8,
+ /// If set, specifies that a large media preview should be used.
force_large_media = 0x10,
+ /// If set, specifies that a small media preview should be used.
force_small_media = 0x20,
+ /// If set, indicates that the URL used for the webpage preview was specified manually using , and may not be related to any of the URLs specified in the message.
manual = 0x80,
+ /// If set, the link can be opened directly without user confirmation.
safe = 0x100,
}
}
@@ -8715,11 +8846,13 @@ namespace TL
{
/// Extra bits of information, use flags.HasFlag(...) to test for those
public Flags flags;
+ /// If set, indicates that the message should be sent in reply to the specified message or story.
[IfFlag(4)] public InputReplyTo reply_to;
/// The draft
public string message;
/// Message entities for styled text.
[IfFlag(3)] public MessageEntity[] entities;
+ /// Media.
[IfFlag(5)] public InputMedia media;
/// Date of last update of the draft.
public DateTime date;
@@ -10781,19 +10914,29 @@ namespace TL
/// Whether antispam functionality was enabled or disabled.
public bool new_value;
}
- /// The background profile color » of a channel was changed. See
- [TLDef(0x3C2B247B)]
- public class ChannelAdminLogEventActionChangeColor : ChannelAdminLogEventAction
+ /// See
+ [TLDef(0x5796E780)]
+ public class ChannelAdminLogEventActionChangePeerColor : ChannelAdminLogEventAction
{
- public int prev_value;
- public int new_value;
+ public PeerColor prev_value;
+ public PeerColor new_value;
}
- /// The custom emoji used to generate the pattern of the background profile color » of a channel was changed. See
- [TLDef(0x445FC434)]
- public class ChannelAdminLogEventActionChangeBackgroundEmoji : ChannelAdminLogEventAction
+ /// See
+ [TLDef(0x5E477B25)]
+ public class ChannelAdminLogEventActionChangeProfilePeerColor : ChannelAdminLogEventActionChangePeerColor { }
+ /// See
+ [TLDef(0x31BB5D52)]
+ public class ChannelAdminLogEventActionChangeWallpaper : ChannelAdminLogEventAction
{
- public long prev_value;
- public long new_value;
+ public WallPaperBase prev_value;
+ public WallPaperBase new_value;
+ }
+ /// See
+ [TLDef(0x3EA9FEB1)]
+ public class ChannelAdminLogEventActionChangeEmojiStatus : ChannelAdminLogEventAction
+ {
+ public EmojiStatus prev_value;
+ public EmojiStatus new_value;
}
/// Admin log event See
@@ -12174,7 +12317,7 @@ namespace TL
}
/// Wallpaper rendering information. See
- [TLDef(0x1DC1BCA4)]
+ [TLDef(0x372EFCD0)]
public class WallPaperSettings : IObject
{
/// Extra bits of information, use flags.HasFlag(...) to test for those
@@ -12191,6 +12334,7 @@ namespace TL
[IfFlag(3)] public int intensity;
/// Clockwise rotation angle of the gradient, in degrees; 0-359. Should be always divisible by 45.
[IfFlag(4)] public int rotation;
+ [IfFlag(7)] public string emoticon;
[Flags] public enum Flags : uint
{
@@ -12208,6 +12352,8 @@ namespace TL
has_third_background_color = 0x20,
/// Field has a value
has_fourth_background_color = 0x40,
+ /// Field has a value
+ has_emoticon = 0x80,
}
}
@@ -12924,13 +13070,17 @@ namespace TL
public StatsDateRangeDays period;
/// Follower count change for period in consideration
public StatsAbsValueAndPrev followers;
- /// total_viewcount/postcount, for posts posted during the period in consideration (views_per_post).
Note that in this case, current refers to the period in consideration (min_date till max_date), and prev refers to the previous period ((min_date - (max_date - min_date)) till min_date).
+ /// total_viewcount/postcount, for posts posted during the period in consideration.
Note that in this case, current refers to the period in consideration (min_date till max_date), and prev refers to the previous period ((min_date - (max_date - min_date)) till min_date).
public StatsAbsValueAndPrev views_per_post;
- /// total_viewcount/postcount, for posts posted during the period in consideration (views_per_post).
Note that in this case, current refers to the period in consideration (min_date till max_date), and prev refers to the previous period ((min_date - (max_date - min_date)) till min_date)
+ /// total_sharecount/postcount, for posts posted during the period in consideration.
Note that in this case, current refers to the period in consideration (min_date till max_date), and prev refers to the previous period ((min_date - (max_date - min_date)) till min_date)
public StatsAbsValueAndPrev shares_per_post;
+ /// total_reactions/postcount, for posts posted during the period in consideration.
Note that in this case, current refers to the period in consideration (min_date till max_date), and prev refers to the previous period ((min_date - (max_date - min_date)) till min_date)
public StatsAbsValueAndPrev reactions_per_post;
+ /// total_views/storycount, for posts posted during the period in consideration.
Note that in this case, current refers to the period in consideration (min_date till max_date), and prev refers to the previous period ((min_date - (max_date - min_date)) till min_date)
public StatsAbsValueAndPrev views_per_story;
+ /// total_shares/storycount, for posts posted during the period in consideration.
Note that in this case, current refers to the period in consideration (min_date till max_date), and prev refers to the previous period ((min_date - (max_date - min_date)) till min_date)
public StatsAbsValueAndPrev shares_per_story;
+ /// total_reactions/storycount, for posts posted during the period in consideration.
Note that in this case, current refers to the period in consideration (min_date till max_date), and prev refers to the previous period ((min_date - (max_date - min_date)) till min_date)
public StatsAbsValueAndPrev reactions_per_story;
/// Percentage of subscribers with enabled notifications
public StatsPercentValue enabled_notifications;
@@ -12952,9 +13102,13 @@ namespace TL
public StatsGraphBase new_followers_by_source_graph;
/// Subscriber language graph (pie chart)
public StatsGraphBase languages_graph;
+ /// A graph containing the number of reactions on posts categorized by emotion
public StatsGraphBase reactions_by_emotion_graph;
+ /// A graph containing the number of story views and shares
public StatsGraphBase story_interactions_graph;
+ /// A graph containing the number of reactions on stories categorized by emotion
public StatsGraphBase story_reactions_by_emotion_graph;
+ /// Detailed statistics about number of views and shares of recently sent messages and stories
public PostInteractionCounters[] recent_posts_interactions;
}
@@ -13280,13 +13434,17 @@ namespace TL
[IfFlag(4)] public int reply_to_msg_id;
/// For replies sent in channel discussion threads of which the current user is not a member, the discussion group ID
[IfFlag(0)] public Peer reply_to_peer_id;
+ /// When replying to a message sent by a certain peer to another chat, contains info about the peer that originally sent the message to that other chat.
[IfFlag(5)] public MessageFwdHeader reply_from;
+ /// When replying to a media sent by a certain peer to another chat, contains the media of the replied-to message.
[IfFlag(8)] public MessageMedia reply_media;
/// ID of the message that started this message thread
[IfFlag(1)] public int reply_to_top_id;
+ /// Used to quote-reply to only a certain section (specified here) of the original message.
[IfFlag(6)] public string quote_text;
- /// Message entities for styled text
+ /// Message entities for styled text from the quote_text field.
[IfFlag(7)] public MessageEntity[] quote_entities;
+ /// Offset of the message quote_text within the original message (in UTF-16 code units).
[IfFlag(10)] public int quote_offset;
[Flags] public enum Flags : uint
@@ -13309,6 +13467,7 @@ namespace TL
has_quote_entities = 0x80,
/// Field has a value
has_reply_media = 0x100,
+ /// Whether this message is quoting a part of another message.
quote = 0x200,
/// Field has a value
has_quote_offset = 0x400,
@@ -13372,6 +13531,7 @@ namespace TL
{
/// Message view graph
public StatsGraphBase views_graph;
+ /// A graph containing the number of reactions on stories categorized by emotion
public StatsGraphBase reactions_by_emotion_graph;
}
@@ -13884,11 +14044,13 @@ namespace TL
[IfFlag(0)] public string start_param;
/// Sponsored website
[IfFlag(9)] public SponsoredWebPage webpage;
+ /// Mini App » to open when the sponsored message is clicked.
[IfFlag(10)] public BotApp app;
/// Sponsored message
public string message;
/// Message entities for styled text
[IfFlag(1)] public MessageEntity[] entities;
+ /// Text of the sponsored message button.
[IfFlag(11)] public string button_text;
/// If set, contains additional information about the sponsor to be shown along with the message.
[IfFlag(7)] public string sponsor_info;
@@ -14297,7 +14459,7 @@ namespace TL
{
/// If set, before launching the mini app the client should ask the user to add the mini app to the attachment/side menu, and only if the user accepts, after invoking Messages_ToggleBotInAttachMenu the app should be opened.
inactive = 0x1,
- /// True, if the bot supports the "settings_button_pressed" event »
+ /// Deprecated flag, can be ignored.
has_settings = 0x2,
/// Whether the bot would like to send messages to the user.
request_write_access = 0x4,
@@ -14465,11 +14627,13 @@ namespace TL
/// The invoice slug
public string slug;
}
- /// See
+ /// Used if the user wishes to start a channel giveaway or send some giftcodes to members of a channel, in exchange for boosts. See
[TLDef(0x98986C0D)]
public class InputInvoicePremiumGiftCode : InputInvoice
{
+ /// Should be populated with for giveaways and for gifts.
public InputStorePaymentPurpose purpose;
+ /// Should be populated with one of the giveaway options returned by Payments_GetPremiumGiftCodeOptions, see the giveaways » documentation for more info.
public PremiumGiftCodeOption option;
}
@@ -14551,15 +14715,19 @@ namespace TL
/// Price of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
public long amount;
}
- /// See
+ /// Used to gift Telegram Premium subscriptions only to some specific subscribers of a channel or to some of our contacts, see here » for more info on giveaways and gifts. See
[TLDef(0xA3805F3F)]
public class InputStorePaymentPremiumGiftCode : InputStorePaymentPurpose
{
/// Extra bits of information, use flags.HasFlag(...) to test for those
public Flags flags;
+ /// The users that will receive the Telegram Premium subscriptions.
public InputUserBase[] users;
+ /// If set, the gifts will be sent on behalf of a channel we are an admin of, which will also assign some boosts to it. Otherwise, the gift will be sent directly from the currently logged in users, and we will gain some extra boost slots. See here » for more info on giveaways and gifts.
[IfFlag(0)] public InputPeer boost_peer;
+ /// Three-letter ISO 4217 currency code
public string currency;
+ /// Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
public long amount;
[Flags] public enum Flags : uint
@@ -14568,27 +14736,39 @@ namespace TL
has_boost_peer = 0x1,
}
}
- /// See
- [TLDef(0x7C9375E6)]
+ /// Used to pay for a giveaway, see here » for more info. See
+ [TLDef(0x160544CA)]
public class InputStorePaymentPremiumGiveaway : InputStorePaymentPurpose
{
/// Extra bits of information, use flags.HasFlag(...) to test for those
public Flags flags;
+ /// The channel starting the giveaway, that the user must join to participate, that will receive the giveaway boosts; see here » for more info on giveaways.
public InputPeer boost_peer;
+ /// Additional channels that the user must join to participate to the giveaway can be specified here.
[IfFlag(1)] public InputPeer[] additional_peers;
+ /// The set of users that can participate to the giveaway can be restricted by passing here an explicit whitelist of up to giveaway_countries_max countries, specified as two-letter ISO 3166-1 alpha-2 country codes.
[IfFlag(2)] public string[] countries_iso2;
+ [IfFlag(4)] public string prize_description;
+ /// Random ID to avoid resending the giveaway
public long random_id;
+ /// The end date of the giveaway, must be at most giveaway_period_max seconds in the future; see here » for more info on giveaways.
public DateTime until_date;
+ /// Three-letter ISO 4217 currency code
public string currency;
+ /// Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
public long amount;
[Flags] public enum Flags : uint
{
+ /// If set, only new subscribers starting from the giveaway creation date will be able to participate to the giveaway.
only_new_subscribers = 0x1,
/// Field has a value
has_additional_peers = 0x2,
/// Field has a value
has_countries_iso2 = 0x4,
+ winners_are_visible = 0x8,
+ /// Field has a value
+ has_prize_description = 0x10,
}
}
@@ -15522,6 +15702,7 @@ namespace TL
{
/// Field has a value
has_recent_viewers = 0x1,
+ /// If set, indicates that the viewers list is currently viewable, and was not yet deleted because the story has expired while the user didn't have a Premium account.
has_viewers = 0x2,
/// Field has a value
has_forwards_count = 0x4,
@@ -15700,9 +15881,11 @@ namespace TL
public IPeerInfo UserOrChat(Peer peer) => peer?.UserOrChat(users, chats);
}
+ /// Story view date and reaction information See Derived classes:
+ public abstract class StoryViewBase : IObject { }
/// Story view date and reaction information See
[TLDef(0xB0BDEAC5)]
- public class StoryView : IObject
+ public class StoryView : StoryViewBase
{
/// Extra bits of information, use flags.HasFlag(...) to test for those
public Flags flags;
@@ -15723,19 +15906,49 @@ namespace TL
has_reaction = 0x4,
}
}
+ /// See
+ [TLDef(0x9083670B)]
+ public class StoryViewPublicForward : StoryViewBase
+ {
+ public Flags flags;
+ public MessageBase message;
+
+ [Flags] public enum Flags : uint
+ {
+ blocked = 0x1,
+ blocked_my_stories_from = 0x2,
+ }
+ }
+ /// See
+ [TLDef(0xBD74CF49)]
+ public class StoryViewPublicRepost : StoryViewBase
+ {
+ public Flags flags;
+ public Peer peer_id;
+ public StoryItemBase story;
+
+ [Flags] public enum Flags : uint
+ {
+ blocked = 0x1,
+ blocked_my_stories_from = 0x2,
+ }
+ }
/// Reaction and view counters for a story See
- [TLDef(0x46E9B9EC)]
- public class Stories_StoryViewsList : IObject
+ [TLDef(0x59D78FC5)]
+ public class Stories_StoryViewsList : IObject, IPeerResolver
{
/// Extra bits of information, use flags.HasFlag(...) to test for those
public Flags flags;
/// Total number of results that can be fetched
public int count;
+ public int views_count;
+ public int forwards_count;
/// Number of reactions that were added to the story
public int reactions_count;
/// Story view date and reaction information
- public StoryView[] views;
+ public StoryViewBase[] views;
+ public Dictionary chats;
/// Mentioned users
public Dictionary users;
/// Offset for pagination
@@ -15746,6 +15959,8 @@ namespace TL
/// Field has a value
has_next_offset = 0x1,
}
+ /// returns a or for the given Peer
+ public IPeerInfo UserOrChat(Peer peer) => peer?.UserOrChat(users, chats);
}
/// Reaction and view counters for a list of stories See
@@ -15770,10 +15985,13 @@ namespace TL
public int reply_to_msg_id;
/// This field must contain the topic ID only when replying to messages in forum topics different from the "General" topic (i.e. reply_to_msg_id is set and reply_to_msg_id != topicID and topicID != 1).
If the replied-to message is deleted before the method finishes execution, the value in this field will be used to send the message to the correct topic, instead of the "General" topic.
[IfFlag(0)] public int top_msg_id;
+ /// Used to reply to messages sent to another chat (specified here), can only be used for non-protected chats and messages.
[IfFlag(1)] public InputPeer reply_to_peer_id;
+ /// Used to quote-reply to only a certain section (specified here) of the original message.
[IfFlag(2)] public string quote_text;
- /// Message entities for styled text
+ /// Message entities for styled text from the quote_text field.
[IfFlag(3)] public MessageEntity[] quote_entities;
+ /// Offset of the message quote_text within the original message (in UTF-16 code units).
[IfFlag(4)] public int quote_offset;
[Flags] public enum Flags : uint
@@ -15904,6 +16122,22 @@ namespace TL
flipped = 0x2,
}
}
+ /// See
+ [TLDef(0x770416AF)]
+ public class MediaAreaChannelPost : MediaArea
+ {
+ public MediaAreaCoordinates coordinates;
+ public long channel_id;
+ public int msg_id;
+ }
+ /// See
+ [TLDef(0x2271F2BF)]
+ public class InputMediaAreaChannelPost : MediaArea
+ {
+ public MediaAreaCoordinates coordinates;
+ public InputChannelBase channel;
+ public int msg_id;
+ }
/// Stories associated to a peer See
[TLDef(0x9A35E999)]
@@ -15939,28 +16173,37 @@ namespace TL
public IPeerInfo UserOrChat(Peer peer) => peer?.UserOrChat(users, chats);
}
- /// See
+ /// Represents an Instant View webpage. See
[TLDef(0xFD5E12BD)]
public class Messages_WebPage : IObject, IPeerResolver
{
+ /// The instant view webpage.
public WebPageBase webpage;
+ /// Chats mentioned in the webpage.
public Dictionary chats;
+ /// Users mentioned in the webpage.
public Dictionary users;
/// returns a or for the given Peer
public IPeerInfo UserOrChat(Peer peer) => peer?.UserOrChat(users, chats);
}
- /// See
+ /// Contains info about a giveaway/gift option. See
[TLDef(0x257E962B)]
public class PremiumGiftCodeOption : IObject
{
/// Extra bits of information, use flags.HasFlag(...) to test for those
public Flags flags;
+ /// Number of users which will be able to activate the gift codes.
public int users;
+ /// Duration in months of each gifted Telegram Premium subscription.
public int months;
+ /// Identifier of the store product associated with the option, official apps only.
[IfFlag(0)] public string store_product;
+ /// Number of times the store product must be paid
[IfFlag(1)] public int store_quantity;
+ /// Three-letter ISO 4217 currency code
public string currency;
+ /// Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
public long amount;
[Flags] public enum Flags : uint
@@ -15972,19 +16215,27 @@ namespace TL
}
}
- /// See
- [TLDef(0xB722F158)]
+ /// Contains info about a Telegram Premium giftcode link. See
+ [TLDef(0x284A1096)]
public class Payments_CheckedGiftCode : IObject, IPeerResolver
{
/// Extra bits of information, use flags.HasFlag(...) to test for those
public Flags flags;
- public Peer from_id;
+ /// The peer that created the gift code.
+ [IfFlag(4)] public Peer from_id;
+ /// Message ID of the giveaway in the channel specified in from_id.
[IfFlag(3)] public int giveaway_msg_id;
+ /// The destination user of the gift.
[IfFlag(0)] public long to_id;
+ /// Creation date of the gift code.
public DateTime date;
+ /// Duration in months of the gifted Telegram Premium subscription.
public int months;
+ /// When was the giftcode imported, if it was imported.
[IfFlag(1)] public DateTime used_date;
+ /// Mentioned chats
public Dictionary chats;
+ /// Mentioned users
public Dictionary users;
[Flags] public enum Flags : uint
@@ -15993,9 +16244,12 @@ namespace TL
has_to_id = 0x1,
/// Field has a value
has_used_date = 0x2,
+ /// Whether this giftcode was created by a giveaway.
via_giveaway = 0x4,
/// Field has a value
has_giveaway_msg_id = 0x8,
+ /// Field has a value
+ has_from_id = 0x10,
}
/// returns a or for the given Peer
public IPeerInfo UserOrChat(Peer peer) => peer?.UserOrChat(users, chats);
@@ -16004,61 +16258,81 @@ namespace TL
/// Info about a Telegram Premium Giveaway. See Derived classes: ,
public abstract class Payments_GiveawayInfoBase : IObject
{
+ /// When was the giveaway started
public virtual DateTime StartDate { get; }
}
- /// See
+ /// Contains info about an ongoing giveaway. See
[TLDef(0x4367DAA0)]
public class Payments_GiveawayInfo : Payments_GiveawayInfoBase
{
/// Extra bits of information, use flags.HasFlag(...) to test for those
public Flags flags;
+ /// When was the giveaway started
public DateTime start_date;
+ /// The current user can't participate in the giveaway, because they were already a member of the channel when the giveaway started, and the only_new_subscribers was set when starting the giveaway.
[IfFlag(1)] public DateTime joined_too_early_date;
+ /// If set, the current user can't participate in the giveaway, because they are an administrator in one of the channels (ID specified in this flag) that created the giveaway.
[IfFlag(2)] public long admin_disallowed_chat_id;
+ /// If set, the current user can't participate in this giveaway, because their phone number is from the specified disallowed country (specified as a two-letter ISO 3166-1 alpha-2 country code).
[IfFlag(4)] public string disallowed_country;
[Flags] public enum Flags : uint
{
+ /// The current user is participating in the giveaway.
participating = 0x1,
/// Field has a value
has_joined_too_early_date = 0x2,
/// Field has a value
has_admin_disallowed_chat_id = 0x4,
+ /// If set, the giveaway has ended and the results are being prepared.
preparing_results = 0x8,
/// Field has a value
has_disallowed_country = 0x10,
}
+ /// When was the giveaway started
public override DateTime StartDate => start_date;
}
- /// See
+ /// A giveaway has ended. See
[TLDef(0x00CD5570)]
public class Payments_GiveawayInfoResults : Payments_GiveawayInfoBase
{
/// Extra bits of information, use flags.HasFlag(...) to test for those
public Flags flags;
+ /// Start date of the giveaway
public DateTime start_date;
+ /// If we're one of the winners of this giveaway, contains the Premium gift code, see here » for more info on the full giveaway flow.
[IfFlag(0)] public string gift_code_slug;
+ /// End date of the giveaway. May be bigger than the end date specified in parameters of the giveaway.
public DateTime finish_date;
+ /// Number of winners in the giveaway
public int winners_count;
+ /// Number of winners, which activated their gift codes.
public int activated_count;
[Flags] public enum Flags : uint
{
+ /// Whether we're one of the winners of this giveaway.
winner = 0x1,
+ /// Whether the giveaway was canceled and was fully refunded.
refunded = 0x2,
}
+ /// Start date of the giveaway
public override DateTime StartDate => start_date;
}
- /// See
+ /// Contains info about a prepaid giveaway ». See
[TLDef(0xB2539D54)]
public class PrepaidGiveaway : IObject
{
+ /// Prepaid giveaway ID.
public long id;
+ /// Duration in months of each gifted Telegram Premium subscription.
public int months;
+ /// Number of given away Telegram Premium subscriptions.
public int quantity;
+ /// Payment date.
public DateTime date;
}
@@ -16072,11 +16346,13 @@ namespace TL
public string id;
/// ID of the user that applied the boost.
[IfFlag(0)] public long user_id;
+ /// The message ID of the giveaway
[IfFlag(2)] public int giveaway_msg_id;
/// When was the boost applied
public DateTime date;
/// When does the boost expire
public DateTime expires;
+ /// The created Telegram Premium gift code, only set if either gift or giveaway are set AND it is either a gift code for the currently logged in user or if it was already claimed.
[IfFlag(4)] public string used_gift_slug;
/// If set, this boost counts as multiplier boosts, otherwise it counts as a single boost.
[IfFlag(5)] public int multiplier;
@@ -16085,8 +16361,11 @@ namespace TL
{
/// Field has a value
has_user_id = 0x1,
+ /// Whether this boost was applied because the channel directly gifted a subscription to the user.
gift = 0x2,
+ /// Whether this boost was applied because the user was chosen in a giveaway started by the channel.
giveaway = 0x4,
+ /// If set, the user hasn't yet invoked Payments_ApplyGiftCode to claim a subscription gifted directly or in a giveaway by the channel.
unclaimed = 0x8,
/// Field has a value
has_used_gift_slug = 0x10,
@@ -16289,7 +16568,9 @@ namespace TL
public PublicForward[] forwards;
/// Offset used for pagination.
[IfFlag(0)] public string next_offset;
+ /// Mentioned chats
public Dictionary chats;
+ /// Mentioned users
public Dictionary users;
[Flags] public enum Flags : uint
@@ -16343,7 +16624,7 @@ namespace TL
}
/// Contains info about a color palette ». See
- [TLDef(0x135BD42F)]
+ [TLDef(0xEF8430AB)]
public class Help_PeerColorOption : IObject
{
/// Extra bits of information, use flags.HasFlag(...) to test for those
@@ -16354,6 +16635,7 @@ namespace TL
[IfFlag(1)] public Help_PeerColorSetBase colors;
/// Dark mode palette. Optional, defaults to the palette in colors (or the autogenerated palette for IDs 0 to 6) if absent.
[IfFlag(2)] public Help_PeerColorSetBase dark_colors;
+ [IfFlag(3)] public int channel_min_level;
[Flags] public enum Flags : uint
{
@@ -16363,6 +16645,8 @@ namespace TL
has_colors = 0x2,
/// Field has a value
has_dark_colors = 0x4,
+ /// Field has a value
+ has_channel_min_level = 0x8,
}
}
@@ -16376,4 +16660,47 @@ namespace TL
/// Usable color palettes.
public Help_PeerColorOption[] colors;
}
+
+ /// See
+ public abstract class StoryReactionBase : IObject { }
+ /// See
+ [TLDef(0x6090D6D5)]
+ public class StoryReaction : StoryReactionBase
+ {
+ public Peer peer_id;
+ public DateTime date;
+ public Reaction reaction;
+ }
+ /// See
+ [TLDef(0xBBAB2643)]
+ public class StoryReactionPublicForward : StoryReactionBase
+ {
+ public MessageBase message;
+ }
+ /// See
+ [TLDef(0xCFCD0F13)]
+ public class StoryReactionPublicRepost : StoryReactionBase
+ {
+ public Peer peer_id;
+ public StoryItemBase story;
+ }
+
+ /// See
+ [TLDef(0xAA5F789C)]
+ public class Stories_StoryReactionsList : IObject, IPeerResolver
+ {
+ public Flags flags;
+ public int count;
+ public StoryReactionBase[] reactions;
+ public Dictionary chats;
+ public Dictionary users;
+ [IfFlag(0)] public string next_offset;
+
+ [Flags] public enum Flags : uint
+ {
+ has_next_offset = 0x1,
+ }
+ /// returns a or for the given Peer
+ public IPeerInfo UserOrChat(Peer peer) => peer?.UserOrChat(users, chats);
+ }
}
diff --git a/src/TL.SchemaFuncs.cs b/src/TL.SchemaFuncs.cs
index 3d415e5..be261bb 100644
--- a/src/TL.SchemaFuncs.cs
+++ b/src/TL.SchemaFuncs.cs
@@ -1175,6 +1175,22 @@ namespace TL
hash = hash,
});
+ /// See
+ /// a null value means account.emojiStatusesNotModified
+ public static Task Account_GetChannelDefaultEmojiStatuses(this Client client, long hash = default)
+ => client.Invoke(new Account_GetChannelDefaultEmojiStatuses
+ {
+ hash = hash,
+ });
+
+ /// See
+ /// a null value means emojiListNotModified
+ public static Task Account_GetChannelRestrictedStatusEmojis(this Client client, long hash = default)
+ => client.Invoke(new Account_GetChannelRestrictedStatusEmojis
+ {
+ hash = hash,
+ });
+
/// Returns basic user info according to their identifiers. See [bots: ✓] Possible codes: 400 (details)
/// List of user identifiers
public static Task Users_GetUsers(this Client client, params InputUserBase[] id)
@@ -3606,14 +3622,13 @@ namespace TL
/// The bot that sent the button.
/// ID of the message that contained the reply keyboard with the button.
/// The button_id field from the .
- /// The chosen peer.
- public static Task Messages_SendBotRequestedPeer(this Client client, InputPeer peer, int msg_id, int button_id, InputPeer requested_peer)
+ public static Task Messages_SendBotRequestedPeer(this Client client, InputPeer peer, int msg_id, int button_id, params InputPeer[] requested_peers)
=> client.Invoke(new Messages_SendBotRequestedPeer
{
peer = peer,
msg_id = msg_id,
button_id = button_id,
- requested_peer = requested_peer,
+ requested_peers = requested_peers,
});
/// Represents a list of emoji categories, to be used when selecting custom emojis. See [bots: ✓]
@@ -3960,14 +3975,6 @@ namespace TL
{
});
- /// Get changelog of current app.
Typically, an will be returned, containing one or more updates with app-specific changelogs. See
- /// Previous app version
- public static Task Help_GetAppChangelog(this Client client, string prev_app_version)
- => client.Invoke(new Help_GetAppChangelog
- {
- prev_app_version = prev_app_version,
- });
-
/// Informs the server about the number of pending bot updates if they haven't been processed for a long time; for bots only See [bots: ✓]
/// Number of pending updates
/// Error message, if present
@@ -4743,16 +4750,18 @@ namespace TL
/// Channel whose accent color should be changed.
/// ID of the accent color palette » to use (not RGB24, see here » for more info).
/// Custom emoji ID used in the accent color pattern.
- public static Task Channels_UpdateColor(this Client client, InputChannelBase channel, int color, long? background_emoji_id = null)
+ public static Task Channels_UpdateColor(this Client client, InputChannelBase channel, long? background_emoji_id = null, int? color = null, bool for_profile = false)
=> client.Invoke(new Channels_UpdateColor
{
- flags = (Channels_UpdateColor.Flags)(background_emoji_id != null ? 0x1 : 0),
+ flags = (Channels_UpdateColor.Flags)((background_emoji_id != null ? 0x1 : 0) | (color != null ? 0x4 : 0) | (for_profile ? 0x2 : 0)),
channel = channel,
- color = color,
+ color = color.GetValueOrDefault(),
background_emoji_id = background_emoji_id.GetValueOrDefault(),
});
- /// See Possible codes: 400 (details)
+ /// Users may also choose to display messages from all topics of a forum as if they were sent to a normal group, using a "View as messages" setting in the local client: this setting only affects the current account, and is synced to other logged in sessions using this method. See Possible codes: 400 (details)
+ /// The forum
+ /// The new value of the view_forum_as_messages flag.
public static Task Channels_ToggleViewForumAsMessages(this Client client, InputChannelBase channel, bool enabled)
=> client.Invoke(new Channels_ToggleViewForumAsMessages
{
@@ -4768,6 +4777,14 @@ namespace TL
channel = channel,
});
+ /// See
+ public static Task Channels_UpdateEmojiStatus(this Client client, InputChannelBase channel, EmojiStatus emoji_status)
+ => client.Invoke(new Channels_UpdateEmojiStatus
+ {
+ channel = channel,
+ emoji_status = emoji_status,
+ });
+
/// Sends a custom request; for bots only See [bots: ✓] Possible codes: 400,403 (details)
/// The method name
/// JSON-serialized method parameters
@@ -5045,6 +5062,7 @@ namespace TL
});
/// Obtain a list of Telegram Premium giveaway/gift code » options. See
+ /// The channel that will start the giveaway
public static Task Payments_GetPremiumGiftCodeOptions(this Client client, InputPeer boost_peer = null)
=> client.Invoke(new Payments_GetPremiumGiftCodeOptions
{
@@ -5660,18 +5678,13 @@ namespace TL
/// Obtains a list of messages, indicating to which other public channels was a channel message forwarded.
Will return a list of messages with peer_id equal to the public channel to which this message was forwarded. See Possible codes: 400 (details)
/// Source channel
/// Source message ID
- /// Initially 0, then set to the next_rate parameter of
- /// Offsets for pagination, for more info click here
- /// Offsets for pagination, for more info click here
/// Maximum number of results to return, see pagination
- public static Task Stats_GetMessagePublicForwards(this Client client, InputChannelBase channel, int msg_id, int offset_rate = default, InputPeer offset_peer = null, int offset_id = default, int limit = int.MaxValue)
+ public static Task Stats_GetMessagePublicForwards(this Client client, InputChannelBase channel, int msg_id, string offset, int limit = int.MaxValue)
=> client.Invoke(new Stats_GetMessagePublicForwards
{
channel = channel,
msg_id = msg_id,
- offset_rate = offset_rate,
- offset_peer = offset_peer,
- offset_id = offset_id,
+ offset = offset,
limit = limit,
});
@@ -5982,10 +5995,10 @@ namespace TL
/// Story ID
/// Offset for pagination, obtained from .next_offset
/// Maximum number of results to return, see pagination
- public static Task Stories_GetStoryViewsList(this Client client, InputPeer peer, int id, string offset, int limit = int.MaxValue, string q = null, bool just_contacts = false, bool reactions_first = false)
+ public static Task Stories_GetStoryViewsList(this Client client, InputPeer peer, int id, string offset, int limit = int.MaxValue, string q = null, bool just_contacts = false, bool reactions_first = false, bool forwards_first = false)
=> client.Invoke(new Stories_GetStoryViewsList
{
- flags = (Stories_GetStoryViewsList.Flags)((q != null ? 0x2 : 0) | (just_contacts ? 0x1 : 0) | (reactions_first ? 0x4 : 0)),
+ flags = (Stories_GetStoryViewsList.Flags)((q != null ? 0x2 : 0) | (just_contacts ? 0x1 : 0) | (reactions_first ? 0x4 : 0) | (forwards_first ? 0x8 : 0)),
peer = peer,
q = q,
id = id,
@@ -6064,7 +6077,8 @@ namespace TL
{
});
- /// See
+ /// Get the IDs of the maximum read stories for a set of peers. See
+ /// Peers
public static Task Stories_GetPeerMaxIDs(this Client client, params InputPeer[] id)
=> client.Invoke(new Stories_GetPeerMaxIDs
{
@@ -6087,6 +6101,18 @@ namespace TL
hidden = hidden,
});
+ /// See
+ public static Task Stories_GetStoryReactionsList(this Client client, InputPeer peer, int id, int limit = int.MaxValue, Reaction reaction = null, string offset = null, bool forwards_first = false)
+ => client.Invoke(new Stories_GetStoryReactionsList
+ {
+ flags = (Stories_GetStoryReactionsList.Flags)((reaction != null ? 0x1 : 0) | (offset != null ? 0x2 : 0) | (forwards_first ? 0x4 : 0)),
+ peer = peer,
+ id = id,
+ reaction = reaction,
+ offset = offset,
+ limit = limit,
+ });
+
/// Obtains info about the boosts that were applied to a certain channel (admins only) See Possible codes: 400 (details)
/// Whether to return only info about boosts received from gift codes and giveaways created by the channel »
/// The channel
@@ -6118,7 +6144,7 @@ namespace TL
peer = peer,
});
- /// Gets the current boost status of a peer. See Possible codes: 400 (details)
+ /// Gets the current number of boosts of a channel. See Possible codes: 400 (details)
/// The peer.
public static Task Premium_GetBoostsStatus(this Client client, InputPeer peer)
=> client.Invoke(new Premium_GetBoostsStatus
@@ -7039,6 +7065,18 @@ namespace TL.Methods
public long hash;
}
+ [TLDef(0x7727A7D5)]
+ public class Account_GetChannelDefaultEmojiStatuses : IMethod
+ {
+ public long hash;
+ }
+
+ [TLDef(0x35A9E0D5)]
+ public class Account_GetChannelRestrictedStatusEmojis : IMethod
+ {
+ public long hash;
+ }
+
[TLDef(0x0D91A548)]
public class Users_GetUsers : IMethod
{
@@ -9092,13 +9130,13 @@ namespace TL.Methods
[TLDef(0x658B7188)]
public class Messages_GetDefaultHistoryTTL : IMethod { }
- [TLDef(0xFE38D01B)]
+ [TLDef(0x91B2D060)]
public class Messages_SendBotRequestedPeer : IMethod
{
public InputPeer peer;
public int msg_id;
public int button_id;
- public InputPeer requested_peer;
+ public InputPeer[] requested_peers;
}
[TLDef(0x7488CE5B)]
@@ -9390,12 +9428,6 @@ namespace TL.Methods
[TLDef(0x9CDF08CD)]
public class Help_GetSupport : IMethod { }
- [TLDef(0x9010EF6F)]
- public class Help_GetAppChangelog : IMethod
- {
- public string prev_app_version;
- }
-
[TLDef(0xEC22CFCD)]
public class Help_SetBotUpdatesStatus : IMethod
{
@@ -9970,17 +10002,19 @@ namespace TL.Methods
public byte[] random_id;
}
- [TLDef(0x621A201F)]
+ [TLDef(0xD8AA3671)]
public class Channels_UpdateColor : IMethod
{
public Flags flags;
public InputChannelBase channel;
- 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,
}
}
@@ -9997,6 +10031,13 @@ namespace TL.Methods
public InputChannelBase channel;
}
+ [TLDef(0xF0D3E6A8)]
+ public class Channels_UpdateEmojiStatus : IMethod
+ {
+ public InputChannelBase channel;
+ public EmojiStatus emoji_status;
+ }
+
[TLDef(0xAA2769ED)]
public class Bots_SendCustomRequest : IMethod
{
@@ -10736,14 +10777,12 @@ namespace TL.Methods
}
}
- [TLDef(0x5630281B)]
- public class Stats_GetMessagePublicForwards : IMethod
+ [TLDef(0x5F150144)]
+ public class Stats_GetMessagePublicForwards : IMethod
{
public InputChannelBase channel;
public int msg_id;
- public int offset_rate;
- public InputPeer offset_peer;
- public int offset_id;
+ public string offset;
public int limit;
}
@@ -11006,6 +11045,7 @@ namespace TL.Methods
just_contacts = 0x1,
has_q = 0x2,
reactions_first = 0x4,
+ forwards_first = 0x8,
}
}
@@ -11083,6 +11123,24 @@ namespace TL.Methods
public bool hidden;
}
+ [TLDef(0xB9B2881F)]
+ public class Stories_GetStoryReactionsList : IMethod
+ {
+ public Flags flags;
+ public InputPeer peer;
+ public int id;
+ [IfFlag(0)] public Reaction reaction;
+ [IfFlag(1)] public string offset;
+ public int limit;
+
+ [Flags] public enum Flags : uint
+ {
+ has_reaction = 0x1,
+ has_offset = 0x2,
+ forwards_first = 0x4,
+ }
+ }
+
[TLDef(0x60F67660)]
public class Premium_GetBoostsList : IMethod
{
diff --git a/src/TL.Table.cs b/src/TL.Table.cs
index 3142dd1..b85f99a 100644
--- a/src/TL.Table.cs
+++ b/src/TL.Table.cs
@@ -6,7 +6,7 @@ namespace TL
{
public static class Layer
{
- public const int Version = 167; // fetched 30/11/2023 15:07:08
+ public const int Version = 169; // fetched 23/12/2023 19:20:07
internal const int SecretChats = 144;
internal const int MTProto2 = 73;
internal const uint VectorCtor = 0x1CB5C415;
@@ -133,10 +133,10 @@ namespace TL
[0x29562865] = typeof(ChatEmpty),
[0x41CBF256] = typeof(Chat),
[0x6592A1A7] = typeof(ChatForbidden),
- [0x8E87CCD8] = typeof(Channel),
+ [0x0AADFC8F] = typeof(Channel),
[0x17D493D5] = typeof(ChannelForbidden),
[0xC9D31138] = typeof(ChatFull),
- [0x723027BD] = typeof(ChannelFull),
+ [0x0F2BCB6F] = typeof(ChannelFull),
[0xC02D4007] = typeof(ChatParticipant),
[0xE46BCEE4] = typeof(ChatParticipantCreator),
[0xA0933F5B] = typeof(ChatParticipantAdmin),
@@ -161,7 +161,8 @@ namespace TL
[0x4BD6E798] = typeof(MessageMediaPoll),
[0x3F7EE58B] = typeof(MessageMediaDice),
[0x68CB6283] = typeof(MessageMediaStory),
- [0x58260664] = typeof(MessageMediaGiveaway),
+ [0xDAAD85B0] = typeof(MessageMediaGiveaway),
+ [0xC6991068] = typeof(MessageMediaGiveawayResults),
[0xB6AEF7B0] = null,//MessageActionEmpty
[0xBD47CBAD] = typeof(MessageActionChatCreate),
[0xB5A1CE5A] = typeof(MessageActionChatEditTitle),
@@ -198,9 +199,9 @@ namespace TL
[0x0D999256] = typeof(MessageActionTopicCreate),
[0xC0944820] = typeof(MessageActionTopicEdit),
[0x57DE635E] = typeof(MessageActionSuggestProfilePhoto),
- [0xFE77345D] = typeof(MessageActionRequestedPeer),
+ [0x31518E9B] = typeof(MessageActionRequestedPeer),
[0x5060A3F4] = typeof(MessageActionSetChatWallPaper),
- [0xD2CFDB0E] = typeof(MessageActionGiftCode),
+ [0x678C2E09] = typeof(MessageActionGiftCode),
[0x332BA9ED] = typeof(MessageActionGiveawayLaunch),
[0x2A9FADC5] = typeof(MessageActionGiveawayResults),
[0xD58A08C6] = typeof(Dialog),
@@ -387,6 +388,8 @@ namespace TL
[0x904DD49C] = typeof(UpdateBotChatBoost),
[0x07B68920] = typeof(UpdateChannelViewForumAsMessages),
[0xAE3F101D] = typeof(UpdatePeerWallpaper),
+ [0xAC21D3CE] = typeof(UpdateBotMessageReaction),
+ [0x09CB7759] = typeof(UpdateBotMessageReactions),
[0xA56C2A3E] = typeof(Updates_State),
[0x5D75A138] = typeof(Updates_DifferenceEmpty),
[0x00F49CA0] = typeof(Updates_Difference),
@@ -517,6 +520,7 @@ namespace TL
[0x04C4D4CE] = typeof(InputStickerSetEmojiGenericAnimations),
[0x29D0F5EE] = typeof(InputStickerSetEmojiDefaultStatuses),
[0x44C1F8E9] = typeof(InputStickerSetEmojiDefaultTopicIcons),
+ [0x49748553] = typeof(InputStickerSetEmojiChannelDefaultStatuses),
[0x2DD14EDC] = typeof(StickerSet),
[0x6E153F16] = typeof(Messages_StickerSet),
[0xD3F924EB] = null,//Messages_StickerSetNotModified
@@ -537,7 +541,7 @@ namespace TL
[0x308660C1] = typeof(KeyboardButtonUserProfile),
[0x13767230] = typeof(KeyboardButtonWebView),
[0xA0C0505C] = typeof(KeyboardButtonSimpleWebView),
- [0x0D0B468C] = typeof(KeyboardButtonRequestPeer),
+ [0x53D7BFD8] = typeof(KeyboardButtonRequestPeer),
[0x77608B83] = typeof(KeyboardButtonRow),
[0xA03E5B85] = typeof(ReplyKeyboardHide),
[0x86B40B08] = typeof(ReplyKeyboardForceReply),
@@ -794,8 +798,10 @@ namespace TL
[0xAE168909] = typeof(ChannelAdminLogEventActionDeleteTopic),
[0x5D8D353B] = typeof(ChannelAdminLogEventActionPinTopic),
[0x64F36DFC] = typeof(ChannelAdminLogEventActionToggleAntiSpam),
- [0x3C2B247B] = typeof(ChannelAdminLogEventActionChangeColor),
- [0x445FC434] = typeof(ChannelAdminLogEventActionChangeBackgroundEmoji),
+ [0x5796E780] = typeof(ChannelAdminLogEventActionChangePeerColor),
+ [0x5E477B25] = typeof(ChannelAdminLogEventActionChangeProfilePeerColor),
+ [0x31BB5D52] = typeof(ChannelAdminLogEventActionChangeWallpaper),
+ [0x3EA9FEB1] = typeof(ChannelAdminLogEventActionChangeEmojiStatus),
[0x1FAD68CD] = typeof(ChannelAdminLogEvent),
[0xED8AF74D] = typeof(Channels_AdminLogResults),
[0xEA107AE4] = typeof(ChannelAdminLogEventsFilter),
@@ -897,7 +903,7 @@ namespace TL
[0x1C199183] = null,//Account_WallPapersNotModified
[0xCDC3858C] = typeof(Account_WallPapers),
[0xAD253D78] = typeof(CodeSettings),
- [0x1DC1BCA4] = typeof(WallPaperSettings),
+ [0x372EFCD0] = typeof(WallPaperSettings),
[0xBAA57628] = typeof(AutoDownloadSettings),
[0x63CACF26] = typeof(Account_AutoDownloadSettings),
[0xD5B3B9F9] = typeof(EmojiKeyword),
@@ -1049,7 +1055,7 @@ namespace TL
[0xA6751E66] = typeof(InputStorePaymentPremiumSubscription),
[0x616F7FE8] = typeof(InputStorePaymentGiftPremium),
[0xA3805F3F] = typeof(InputStorePaymentPremiumGiftCode),
- [0x7C9375E6] = typeof(InputStorePaymentPremiumGiveaway),
+ [0x160544CA] = typeof(InputStorePaymentPremiumGiveaway),
[0x74C34319] = typeof(PremiumGiftOption),
[0x88F8F21B] = typeof(PaymentFormMethod),
[0x2DE11AAE] = null,//EmojiStatusEmpty
@@ -1127,7 +1133,9 @@ namespace TL
[0x6EFC5E81] = typeof(Stories_AllStories),
[0x5DD8C3C8] = typeof(Stories_Stories),
[0xB0BDEAC5] = typeof(StoryView),
- [0x46E9B9EC] = typeof(Stories_StoryViewsList),
+ [0x9083670B] = typeof(StoryViewPublicForward),
+ [0xBD74CF49] = typeof(StoryViewPublicRepost),
+ [0x59D78FC5] = typeof(Stories_StoryViewsList),
[0xDE9EED1D] = typeof(Stories_StoryViews),
[0x22C0F6D5] = typeof(InputReplyToMessage),
[0x15B0F283] = typeof(InputReplyToStory),
@@ -1138,11 +1146,13 @@ namespace TL
[0xB282217F] = typeof(InputMediaAreaVenue),
[0xDF8B3B22] = typeof(MediaAreaGeoPoint),
[0x14455871] = typeof(MediaAreaSuggestedReaction),
+ [0x770416AF] = typeof(MediaAreaChannelPost),
+ [0x2271F2BF] = typeof(InputMediaAreaChannelPost),
[0x9A35E999] = typeof(PeerStories),
[0xCAE68768] = typeof(Stories_PeerStories),
[0xFD5E12BD] = typeof(Messages_WebPage),
[0x257E962B] = typeof(PremiumGiftCodeOption),
- [0xB722F158] = typeof(Payments_CheckedGiftCode),
+ [0x284A1096] = typeof(Payments_CheckedGiftCode),
[0x4367DAA0] = typeof(Payments_GiveawayInfo),
[0x00CD5570] = typeof(Payments_GiveawayInfoResults),
[0xB2539D54] = typeof(PrepaidGiveaway),
@@ -1161,9 +1171,13 @@ namespace TL
[0xB54B5ACF] = typeof(PeerColor),
[0x26219A58] = typeof(Help_PeerColorSet),
[0x767D61EB] = typeof(Help_PeerColorProfileSet),
- [0x135BD42F] = typeof(Help_PeerColorOption),
+ [0xEF8430AB] = typeof(Help_PeerColorOption),
[0x2BA1F5CE] = null,//Help_PeerColorsNotModified
[0x00F8ED08] = typeof(Help_PeerColors),
+ [0x6090D6D5] = typeof(StoryReaction),
+ [0xBBAB2643] = typeof(StoryReactionPublicForward),
+ [0xCFCD0F13] = typeof(StoryReactionPublicRepost),
+ [0xAA5F789C] = typeof(Stories_StoryReactionsList),
// from TL.Secret:
[0x6ABD9782] = typeof(Layer143.DecryptedMessageMediaDocument),
[0x91CC4674] = typeof(Layer73.DecryptedMessage),
diff --git a/src/WTelegramClient.csproj b/src/WTelegramClient.csproj
index a0081dd..afcf7bb 100644
--- a/src/WTelegramClient.csproj
+++ b/src/WTelegramClient.csproj
@@ -13,7 +13,7 @@
WTelegramClient
0.0.0
Wizou
- Telegram Client API (MTProto) library written 100% in C# and .NET Standard | Latest API layer: 167
Release Notes:
$(ReleaseNotes.Replace("|", "%0D%0A").Replace(" - ","%0D%0A- ").Replace(" ", "%0D%0A%0D%0A"))
+ Telegram Client API (MTProto) library written 100% in C# and .NET Standard | Latest API layer: 169
Release Notes:
$(ReleaseNotes.Replace("|", "%0D%0A").Replace(" - ","%0D%0A- ").Replace(" ", "%0D%0A%0D%0A"))
Copyright © Olivier Marcoux 2021-2023
MIT
https://github.com/wiz0u/WTelegramClient