From df2b2a79070fbd72d9fe9bc57e3b234ffe0ba6ad Mon Sep 17 00:00:00 2001
From: Wizou <11647984+wiz0u@users.noreply.github.com>
Date: Sat, 28 Oct 2023 23:47:04 +0200
Subject: [PATCH] API Layer 166: colors/emoji, new quotes, new link previews,
distant replies, invert_media, premium boosts/giveaway/gifts...
see https://t.me/tginfoen/1760
---
README.md | 2 +-
src/Client.Helpers.cs | 2 +-
src/TL.Helpers.cs | 1 +
src/TL.Schema.cs | 531 ++++++++++++++++++++++++++++++-------
src/TL.SchemaFuncs.cs | 258 ++++++++++++++----
src/TL.Table.cs | 48 ++--
src/WTelegramClient.csproj | 2 +-
7 files changed, 676 insertions(+), 168 deletions(-)
diff --git a/README.md b/README.md
index a847e48..63e9b2e 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.Helpers.cs b/src/Client.Helpers.cs
index 005bab0..00f03fa 100644
--- a/src/Client.Helpers.cs
+++ b/src/Client.Helpers.cs
@@ -159,7 +159,7 @@ namespace WTelegram
{
flags = (Message.Flags)sent.flags | (reply_to_msg_id == 0 ? 0 : Message.Flags.has_reply_to) | (peer is InputPeerSelf ? 0 : Message.Flags.has_from_id),
id = sent.id, date = sent.date, message = text, entities = sent.entities, media = sent.media, ttl_period = sent.ttl_period,
- reply_to = reply_to_msg_id == 0 ? null : new MessageReplyHeader { reply_to_msg_id = reply_to_msg_id },
+ reply_to = reply_to_msg_id == 0 ? null : new MessageReplyHeader { reply_to_msg_id = reply_to_msg_id, flags = MessageReplyHeader.Flags.has_reply_to_msg_id },
from_id = peer is InputPeerSelf ? null : new PeerUser { user_id = _session.UserId },
peer_id = InputToPeer(peer)
};
diff --git a/src/TL.Helpers.cs b/src/TL.Helpers.cs
index 25101be..694ac24 100644
--- a/src/TL.Helpers.cs
+++ b/src/TL.Helpers.cs
@@ -296,6 +296,7 @@ namespace TL
correct_answers = results.results?.Where(pav => pav.flags.HasFlag(PollAnswerVoters.Flags.correct)).Select(pav => pav.option).ToArray(),
flags = (results.results != null ? InputMediaPoll.Flags.has_correct_answers : 0) | (results.solution != null ? InputMediaPoll.Flags.has_solution : 0) }; }
partial class MessageMediaDice { public override InputMedia ToInputMedia() => new InputMediaDice { emoticon = emoticon }; }
+ partial class MessageMediaWebPage { public override InputMedia ToInputMedia() => new InputMediaWebPage { flags = (InputMediaWebPage.Flags)((int)flags & 3), url = webpage.Url }; }
partial class PhotoBase
{
diff --git a/src/TL.Schema.cs b/src/TL.Schema.cs
index 3a0fedf..624c276 100644
--- a/src/TL.Schema.cs
+++ b/src/TL.Schema.cs
@@ -462,6 +462,20 @@ namespace TL
public InputPeer peer;
public int id;
}
+ /// See
+ [TLDef(0xC21B8849)]
+ public class InputMediaWebPage : InputMedia
+ {
+ public Flags flags;
+ public string url;
+
+ [Flags] public enum Flags : uint
+ {
+ force_large_media = 0x1,
+ force_small_media = 0x2,
+ optional = 0x4,
+ }
+ }
/// Defines a new group profile photo. See Derived classes: ,
/// a value means inputChatPhotoEmpty
@@ -723,7 +737,7 @@ namespace TL
public long id;
}
/// Indicates info about a certain user See
- [TLDef(0xABB5F120)]
+ [TLDef(0xEB602F25)]
public partial class User : UserBase
{
/// Extra bits of information, use flags.HasFlag(...) to test for those
@@ -759,6 +773,8 @@ namespace TL
/// Additional usernames
[IfFlag(32)] public Username[] usernames;
[IfFlag(37)] public int stories_max_id;
+ [IfFlag(39)] public int color;
+ [IfFlag(38)] public long background_emoji_id;
[Flags] public enum Flags : uint
{
@@ -832,6 +848,10 @@ namespace TL
stories_unavailable = 0x10,
/// Field has a value
has_stories_max_id = 0x20,
+ /// Field has a value
+ has_background_emoji_id = 0x40,
+ /// Field has a value
+ has_color = 0x80,
}
}
@@ -972,7 +992,7 @@ namespace TL
public override string Title => title;
}
/// Channel/supergroup info See
- [TLDef(0x94F592DB)]
+ [TLDef(0x1981EA7E)]
public partial class Channel : ChatBase
{
/// Extra bits of information, use flags.HasFlag(...) to test for those
@@ -1004,6 +1024,8 @@ namespace TL
/// Additional usernames
[IfFlag(32)] public Username[] usernames;
[IfFlag(36)] public int stories_max_id;
+ [IfFlag(38)] public int color;
+ [IfFlag(37)] public long background_emoji_id;
[Flags] public enum Flags : uint
{
@@ -1070,6 +1092,10 @@ namespace TL
stories_unavailable = 0x8,
/// Field has a value
has_stories_max_id = 0x10,
+ /// Field has a value
+ has_background_emoji_id = 0x20,
+ /// Field has a value
+ has_color = 0x40,
}
/// ID of the channel
@@ -1674,6 +1700,7 @@ namespace TL
has_ttl_period = 0x2000000,
/// Whether this message is protected and thus cannot be forwarded; clients should also prevent users from saving attached media (i.e. videos should only be streamed, photos should be kept in RAM, et cetera).
noforwards = 0x4000000,
+ invert_media = 0x8000000,
}
/// ID of the message
@@ -1822,11 +1849,20 @@ namespace TL
}
}
/// Preview of webpage See
- [TLDef(0xA32DD600)]
- public class MessageMediaWebPage : MessageMedia
+ [TLDef(0xDDF10C3B)]
+ public partial class MessageMediaWebPage : MessageMedia
{
+ public Flags flags;
/// Webpage preview
public WebPageBase webpage;
+
+ [Flags] public enum Flags : uint
+ {
+ force_large_media = 0x1,
+ force_small_media = 0x2,
+ manual = 0x8,
+ safe = 0x10,
+ }
}
/// Venue See
[TLDef(0x2EC0533F)]
@@ -1947,6 +1983,23 @@ namespace TL
via_mention = 0x2,
}
}
+ /// See
+ [TLDef(0x58260664)]
+ public class MessageMediaGiveaway : MessageMedia
+ {
+ public Flags flags;
+ public long[] channels;
+ [IfFlag(1)] public string[] countries_iso2;
+ public int quantity;
+ public int months;
+ public DateTime until_date;
+
+ [Flags] public enum Flags : uint
+ {
+ only_new_subscribers = 0x1,
+ has_countries_iso2 = 0x2,
+ }
+ }
/// Object describing actions connected to a service message. See Derived classes: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
/// a value means messageActionEmpty
@@ -2346,6 +2399,25 @@ namespace TL
/// The user applied a wallpaper » previously sent by the other user in a message. See
[TLDef(0xC0787D6D)]
public class MessageActionSetSameChatWallPaper : MessageActionSetChatWallPaper { }
+ /// See
+ [TLDef(0xD2CFDB0E)]
+ public class MessageActionGiftCode : MessageAction
+ {
+ public Flags flags;
+ [IfFlag(1)] public Peer boost_peer;
+ public int months;
+ public string slug;
+
+ [Flags] public enum Flags : uint
+ {
+ via_giveaway = 0x1,
+ has_boost_peer = 0x2,
+ unclaimed = 0x4,
+ }
+ }
+ /// See
+ [TLDef(0x332BA9ED)]
+ public class MessageActionGiveawayLaunch : MessageAction { }
/// Chat info. See Derived classes: ,
public abstract class DialogBase : IObject
@@ -3536,6 +3608,7 @@ namespace TL
popup = 0x1,
/// Field has a value
has_inbox_date = 0x2,
+ invert_media = 0x4,
}
}
/// Privacy rules were changed See
@@ -6147,28 +6220,47 @@ namespace TL
{
/// Preview ID
public virtual long ID { get; }
+ public virtual string Url { get; }
}
/// No preview is available for the webpage See
- [TLDef(0xEB1477E8)]
+ [TLDef(0x211A1788)]
public class WebPageEmpty : WebPageBase
{
+ public Flags flags;
/// Preview ID
public long id;
+ [IfFlag(0)] public string url;
+
+ [Flags] public enum Flags : uint
+ {
+ /// Field has a value
+ has_url = 0x1,
+ }
/// Preview ID
public override long ID => id;
+ public override string Url => url;
}
/// A preview of the webpage is currently being generated See
- [TLDef(0xC586DA1C)]
+ [TLDef(0xB0D13E47)]
public class WebPagePending : WebPageBase
{
+ public Flags flags;
/// ID of preview
public long id;
+ [IfFlag(0)] public string url;
/// When was the processing started
public DateTime date;
+ [Flags] public enum Flags : uint
+ {
+ /// Field has a value
+ has_url = 0x1,
+ }
+
/// ID of preview
public override long ID => id;
+ public override string Url => url;
}
/// Webpage preview See
[TLDef(0xE89C45B2)]
@@ -6239,10 +6331,13 @@ namespace TL
has_cached_page = 0x400,
/// Field has a value
has_attributes = 0x1000,
+ has_large_media = 0x2000,
}
/// Preview ID
public override long ID => id;
+ /// URL of previewed webpage
+ public override string Url => url;
}
/// The preview of the webpage hasn't changed See
[TLDef(0x7311CA11)]
@@ -6492,7 +6587,7 @@ namespace TL
public ChatBase chat;
}
/// Chat invite info See
- [TLDef(0x300C44C1)]
+ [TLDef(0xCDE0EC40)]
public class ChatInvite : ChatInviteBase
{
/// Extra bits of information, use flags.HasFlag(...) to test for those
@@ -6507,6 +6602,7 @@ namespace TL
public int participants_count;
/// A few of the participants that are in the group
[IfFlag(4)] public UserBase[] participants;
+ public int color;
[Flags] public enum Flags : uint
{
@@ -6633,6 +6729,7 @@ namespace TL
emojis = 0x80,
/// Field has a value
has_thumb_document_id = 0x100,
+ text_color = 0x200,
}
}
@@ -7040,9 +7137,6 @@ namespace TL
/// Message entity representing strikethrough text. See
[TLDef(0xBF0693D4)]
public class MessageEntityStrike : MessageEntity { }
- /// Message entity representing a block quote. See
- [TLDef(0x020DF5D0)]
- public class MessageEntityBlockquote : MessageEntity { }
/// Indicates a credit card number See
[TLDef(0x761E6AF4)]
public class MessageEntityBankCard : MessageEntity { }
@@ -7056,6 +7150,9 @@ namespace TL
/// Document ID of the custom emoji, use Messages_GetCustomEmojiDocuments to fetch the emoji animation and the actual emoji it represents.
public long document_id;
}
+ /// Message entity representing a block quote. See
+ [TLDef(0x020DF5D0)]
+ public class MessageEntityBlockquote : MessageEntity { }
/// Represents a channel See Derived classes: ,
/// a value means inputChannelEmpty
@@ -7469,6 +7566,7 @@ namespace TL
has_entities = 0x2,
/// Field has a value
has_reply_markup = 0x4,
+ invert_media = 0x8,
}
}
/// Simple text message See
@@ -7492,6 +7590,7 @@ namespace TL
has_entities = 0x2,
/// Field has a value
has_reply_markup = 0x4,
+ invert_media = 0x8,
}
}
/// Geolocation See
@@ -7619,6 +7718,26 @@ namespace TL
has_reply_markup = 0x4,
}
}
+ /// See
+ [TLDef(0xBDDCC510)]
+ public class InputBotInlineMessageMediaWebPage : InputBotInlineMessage
+ {
+ public Flags flags;
+ public string message;
+ [IfFlag(1)] public MessageEntity[] entities;
+ public string url;
+ [IfFlag(2)] public ReplyMarkup reply_markup;
+
+ [Flags] public enum Flags : uint
+ {
+ has_entities = 0x2,
+ has_reply_markup = 0x4,
+ invert_media = 0x8,
+ force_large_media = 0x10,
+ force_small_media = 0x20,
+ optional = 0x40,
+ }
+ }
/// Inline bot result See Derived classes: , , ,
public abstract class InputBotInlineResultBase : IObject
@@ -7758,6 +7877,7 @@ namespace TL
has_entities = 0x2,
/// Field has a value
has_reply_markup = 0x4,
+ invert_media = 0x8,
}
}
/// Send a simple text message See
@@ -7781,6 +7901,7 @@ namespace TL
has_entities = 0x2,
/// Field has a value
has_reply_markup = 0x4,
+ invert_media = 0x8,
}
}
/// Send a geolocation See
@@ -7893,6 +8014,27 @@ namespace TL
test = 0x8,
}
}
+ /// See
+ [TLDef(0x809AD9A6)]
+ public class BotInlineMessageMediaWebPage : BotInlineMessage
+ {
+ public Flags flags;
+ public string message;
+ [IfFlag(1)] public MessageEntity[] entities;
+ public string url;
+ [IfFlag(2)] public ReplyMarkup reply_markup;
+
+ [Flags] public enum Flags : uint
+ {
+ has_entities = 0x2,
+ has_reply_markup = 0x4,
+ invert_media = 0x8,
+ force_large_media = 0x10,
+ force_small_media = 0x20,
+ manual = 0x80,
+ safe = 0x100,
+ }
+ }
/// Results of an inline query See Derived classes: ,
public abstract class BotInlineResultBase : IObject
@@ -8404,28 +8546,31 @@ namespace TL
}
}
/// Represents a message draft. See
- [TLDef(0xFD8E711F)]
+ [TLDef(0x3FCCF7EF)]
public class DraftMessage : DraftMessageBase
{
/// Extra bits of information, use flags.HasFlag(...) to test for those
public Flags flags;
- /// The message this message will reply to
- [IfFlag(0)] public int reply_to_msg_id;
+ [IfFlag(4)] public InputReplyTo reply_to;
/// The draft
public string message;
/// Message entities for styled text.
[IfFlag(3)] public MessageEntity[] entities;
+ [IfFlag(5)] public InputMedia media;
/// Date of last update of the draft.
public DateTime date;
[Flags] public enum Flags : uint
{
- /// Field has a value
- has_reply_to_msg_id = 0x1,
/// Whether no webpage preview will be generated
no_webpage = 0x2,
/// Field has a value
has_entities = 0x8,
+ /// Field has a value
+ has_reply_to = 0x10,
+ /// Field has a value
+ has_media = 0x20,
+ invert_media = 0x40,
}
}
@@ -10470,6 +10615,20 @@ namespace TL
/// Whether antispam functionality was enabled or disabled.
public bool new_value;
}
+ /// See
+ [TLDef(0x3C2B247B)]
+ public class ChannelAdminLogEventActionChangeColor : ChannelAdminLogEventAction
+ {
+ public int prev_value;
+ public int new_value;
+ }
+ /// See
+ [TLDef(0x445FC434)]
+ public class ChannelAdminLogEventActionChangeBackgroundEmoji : ChannelAdminLogEventAction
+ {
+ public long prev_value;
+ public long new_value;
+ }
/// Admin log event See
[TLDef(0x1FAD68CD)]
@@ -12945,17 +13104,21 @@ namespace TL
/// Reply information See Derived classes: ,
public abstract class MessageReplyHeaderBase : IObject { }
/// Message replies and thread information See
- [TLDef(0xA6D57763)]
+ [TLDef(0x6EEBCABD)]
public class MessageReplyHeader : MessageReplyHeaderBase
{
/// Extra bits of information, use flags.HasFlag(...) to test for those
public Flags flags;
/// ID of message to which this message is replying
- public int reply_to_msg_id;
+ [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;
+ [IfFlag(5)] public MessageFwdHeader reply_from;
+ [IfFlag(8)] public MessageMedia reply_media;
/// ID of the message that started this message thread
[IfFlag(1)] public int reply_to_top_id;
+ [IfFlag(6)] public string quote_text;
+ [IfFlag(7)] public MessageEntity[] quote_entities;
[Flags] public enum Flags : uint
{
@@ -12967,6 +13130,17 @@ namespace TL
reply_to_scheduled = 0x4,
/// Whether this message was sent in a forum topic (except for the General topic).
forum_topic = 0x8,
+ /// Field has a value
+ has_reply_to_msg_id = 0x10,
+ /// Field has a value
+ has_reply_from = 0x20,
+ /// Field has a value
+ has_quote_text = 0x40,
+ /// Field has a value
+ has_quote_entities = 0x80,
+ /// Field has a value
+ has_reply_media = 0x100,
+ quote = 0x200,
}
}
/// See
@@ -14107,6 +14281,13 @@ namespace TL
/// The invoice slug
public string slug;
}
+ /// See
+ [TLDef(0x98986C0D)]
+ public class InputInvoicePremiumGiftCode : InputInvoice
+ {
+ public InputStorePaymentPurpose purpose;
+ public PremiumGiftCodeOption option;
+ }
/// Exported invoice deep link See
[TLDef(0xAED0CBD9)]
@@ -14180,6 +14361,41 @@ 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
+ [TLDef(0xA3805F3F)]
+ public class InputStorePaymentPremiumGiftCode : InputStorePaymentPurpose
+ {
+ public Flags flags;
+ public InputUserBase[] users;
+ [IfFlag(0)] public InputPeer boost_peer;
+ public string currency;
+ public long amount;
+
+ [Flags] public enum Flags : uint
+ {
+ has_boost_peer = 0x1,
+ }
+ }
+ /// See
+ [TLDef(0x7C9375E6)]
+ public class InputStorePaymentPremiumGiveaway : InputStorePaymentPurpose
+ {
+ public Flags flags;
+ public InputPeer boost_peer;
+ [IfFlag(1)] public InputPeer[] additional_peers;
+ [IfFlag(2)] public string[] countries_iso2;
+ public long random_id;
+ public DateTime until_date;
+ public string currency;
+ public long amount;
+
+ [Flags] public enum Flags : uint
+ {
+ only_new_subscribers = 0x1,
+ has_additional_peers = 0x2,
+ has_countries_iso2 = 0x4,
+ }
+ }
/// Telegram Premium gift option See
[TLDef(0x74C34319)]
@@ -15281,7 +15497,7 @@ namespace TL
/// Contains info about a message or story to reply to. See Derived classes: ,
public abstract class InputReplyTo : IObject { }
/// Reply to a message. See
- [TLDef(0x9C5386E4)]
+ [TLDef(0x073EC805)]
public class InputReplyToMessage : InputReplyTo
{
/// Extra bits of information, use flags.HasFlag(...) to test for those
@@ -15290,11 +15506,20 @@ 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;
+ [IfFlag(1)] public InputPeer reply_to_peer_id;
+ [IfFlag(2)] public string quote_text;
+ [IfFlag(3)] public MessageEntity[] quote_entities;
[Flags] public enum Flags : uint
{
/// Field has a value
has_top_msg_id = 0x1,
+ /// Field has a value
+ has_reply_to_peer_id = 0x2,
+ /// Field has a value
+ has_quote_text = 0x4,
+ /// Field has a value
+ has_quote_entities = 0x8,
}
}
/// Reply to a story. See
@@ -15436,82 +15661,6 @@ namespace TL
public IPeerInfo UserOrChat(Peer peer) => peer?.UserOrChat(users, chats);
}
- /// The current boost status » of a channel. See
- [TLDef(0xE5C1AA5C)]
- public class Stories_BoostsStatus : IObject
- {
- /// Extra bits of information, use flags.HasFlag(...) to test for those
- public Flags flags;
- /// The current boost level of the channel.
- public int level;
- /// The number of boosts acquired so far in the current level.
- public int current_level_boosts;
- /// Total number of boosts acquired so far.
- public int boosts;
- /// Total number of boosts needed to reach the next level; if absent, the next level isn't available.
- [IfFlag(0)] public int next_level_boosts;
- /// Only returned to channel admins: contains the approximated number of Premium users subscribed to the channel, related to the total number of subscribers.
- [IfFlag(1)] public StatsPercentValue premium_audience;
- public string boost_url;
-
- [Flags] public enum Flags : uint
- {
- /// Field has a value
- has_next_level_boosts = 0x1,
- /// Field has a value
- has_premium_audience = 0x2,
- /// Whether we're currently boosting this channel.
- my_boost = 0x4,
- }
- }
-
- /// Whether the specified channel can be boosted, see here for more info ». See Derived classes: ,
- public abstract class Stories_CanApplyBoostResult : IObject { }
- /// We're not boosting any channel, and we can freely boost the specified channel. See
- [TLDef(0xC3173587)]
- public class Stories_CanApplyBoostOk : Stories_CanApplyBoostResult { }
- /// We're boosting another channel, but we can freely boost the specified channel. See
- [TLDef(0x712C4655)]
- public class Stories_CanApplyBoostReplace : Stories_CanApplyBoostResult
- {
- /// The channel we're currently boosting.
- public Peer current_boost;
- /// Channel information.
- public Dictionary chats;
- }
-
- /// Info about a boost made by a specific user. See
- [TLDef(0x0E9E6380)]
- public class Booster : IObject
- {
- /// ID of the user that made the boost.
- public long user_id;
- /// Default expiration date of the boost.
- public DateTime expires;
- }
-
- /// Info about the users currently boosting the channel. See
- [TLDef(0xF3DD3D1D)]
- public class Stories_BoostersList : IObject
- {
- /// Extra bits of information, use flags.HasFlag(...) to test for those
- public Flags flags;
- /// Total number of boosters.
- public int count;
- /// Info about the automatic expiration date of every user's boost.
- public Booster[] boosters;
- /// Next offset for pagination.
- [IfFlag(0)] public string next_offset;
- /// Info about the users mentioned in the boosters field.
- public Dictionary users;
-
- [Flags] public enum Flags : uint
- {
- /// Field has a value
- has_next_offset = 0x1,
- }
- }
-
/// See
[TLDef(0xFD5E12BD)]
public class Messages_WebPage : IObject, IPeerResolver
@@ -15522,4 +15671,198 @@ namespace TL
/// returns a or for the given Peer
public IPeerInfo UserOrChat(Peer peer) => peer?.UserOrChat(users, chats);
}
+
+ /// See
+ [TLDef(0x257E962B)]
+ public class PremiumGiftCodeOption : IObject
+ {
+ public Flags flags;
+ public int users;
+ public int months;
+ [IfFlag(0)] public string store_product;
+ [IfFlag(1)] public int store_quantity;
+ public string currency;
+ public long amount;
+
+ [Flags] public enum Flags : uint
+ {
+ has_store_product = 0x1,
+ has_store_quantity = 0x2,
+ }
+ }
+
+ /// See
+ [TLDef(0xB722F158)]
+ public class Payments_CheckedGiftCode : IObject, IPeerResolver
+ {
+ public Flags flags;
+ public Peer from_id;
+ [IfFlag(3)] public int giveaway_msg_id;
+ [IfFlag(0)] public long to_id;
+ public DateTime date;
+ public int months;
+ [IfFlag(1)] public DateTime used_date;
+ public Dictionary chats;
+ public Dictionary users;
+
+ [Flags] public enum Flags : uint
+ {
+ has_to_id = 0x1,
+ has_used_date = 0x2,
+ via_giveaway = 0x4,
+ has_giveaway_msg_id = 0x8,
+ }
+ /// returns a or for the given Peer
+ public IPeerInfo UserOrChat(Peer peer) => peer?.UserOrChat(users, chats);
+ }
+
+ /// See
+ public abstract class Payments_GiveawayInfoBase : IObject
+ {
+ public virtual DateTime StartDate { get; }
+ }
+ /// See
+ [TLDef(0x4367DAA0)]
+ public class Payments_GiveawayInfo : Payments_GiveawayInfoBase
+ {
+ public Flags flags;
+ public DateTime start_date;
+ [IfFlag(1)] public DateTime joined_too_early_date;
+ [IfFlag(2)] public long admin_disallowed_chat_id;
+ [IfFlag(4)] public string disallowed_country;
+
+ [Flags] public enum Flags : uint
+ {
+ participating = 0x1,
+ has_joined_too_early_date = 0x2,
+ has_admin_disallowed_chat_id = 0x4,
+ preparing_results = 0x8,
+ has_disallowed_country = 0x10,
+ }
+
+ public override DateTime StartDate => start_date;
+ }
+ /// See
+ [TLDef(0x00CD5570)]
+ public class Payments_GiveawayInfoResults : Payments_GiveawayInfoBase
+ {
+ public Flags flags;
+ public DateTime start_date;
+ [IfFlag(0)] public string gift_code_slug;
+ public DateTime finish_date;
+ public int winners_count;
+ public int activated_count;
+
+ [Flags] public enum Flags : uint
+ {
+ winner = 0x1,
+ refunded = 0x2,
+ }
+
+ public override DateTime StartDate => start_date;
+ }
+
+ /// See
+ [TLDef(0xB2539D54)]
+ public class PrepaidGiveaway : IObject
+ {
+ public long id;
+ public int months;
+ public int quantity;
+ public DateTime date;
+ }
+
+ /// See
+ [TLDef(0x2A1C8C71)]
+ public class Boost : IObject
+ {
+ public Flags flags;
+ public string id;
+ [IfFlag(0)] public long user_id;
+ [IfFlag(2)] public int giveaway_msg_id;
+ public DateTime date;
+ public DateTime expires;
+ [IfFlag(4)] public string used_gift_slug;
+ [IfFlag(5)] public int multiplier;
+
+ [Flags] public enum Flags : uint
+ {
+ has_user_id = 0x1,
+ gift = 0x2,
+ giveaway = 0x4,
+ unclaimed = 0x8,
+ has_used_gift_slug = 0x10,
+ has_multiplier = 0x20,
+ }
+ }
+
+ /// See
+ [TLDef(0x86F8613C)]
+ public class Premium_BoostsList : IObject
+ {
+ public Flags flags;
+ public int count;
+ public Boost[] boosts;
+ [IfFlag(0)] public string next_offset;
+ public Dictionary users;
+
+ [Flags] public enum Flags : uint
+ {
+ has_next_offset = 0x1,
+ }
+ }
+
+ /// See
+ [TLDef(0xC448415C)]
+ public class MyBoost : IObject
+ {
+ public Flags flags;
+ public int slot;
+ [IfFlag(0)] public Peer peer;
+ public DateTime date;
+ public DateTime expires;
+ [IfFlag(1)] public DateTime cooldown_until_date;
+
+ [Flags] public enum Flags : uint
+ {
+ has_peer = 0x1,
+ has_cooldown_until_date = 0x2,
+ }
+ }
+
+ /// See
+ [TLDef(0x9AE228E2)]
+ public class Premium_MyBoosts : IObject, IPeerResolver
+ {
+ public MyBoost[] my_boosts;
+ public Dictionary chats;
+ public Dictionary users;
+ /// returns a or for the given Peer
+ public IPeerInfo UserOrChat(Peer peer) => peer?.UserOrChat(users, chats);
+ }
+
+ /// See
+ [TLDef(0x4959427A)]
+ public class Premium_BoostsStatus : IObject
+ {
+ public Flags flags;
+ public int level;
+ public int current_level_boosts;
+ public int boosts;
+ [IfFlag(4)] public int gift_boosts;
+ [IfFlag(0)] public int next_level_boosts;
+ [IfFlag(1)] public StatsPercentValue premium_audience;
+ public string boost_url;
+ [IfFlag(3)] public PrepaidGiveaway[] prepaid_giveaways;
+ [IfFlag(2)] public int[] my_boost_slots;
+
+ [Flags] public enum Flags : uint
+ {
+ has_next_level_boosts = 0x1,
+ has_premium_audience = 0x2,
+ my_boost = 0x4,
+ has_prepaid_giveaways = 0x8,
+ has_gift_boosts = 0x10,
+ }
+ }
}
diff --git a/src/TL.SchemaFuncs.cs b/src/TL.SchemaFuncs.cs
index 37046e4..e15a205 100644
--- a/src/TL.SchemaFuncs.cs
+++ b/src/TL.SchemaFuncs.cs
@@ -1151,6 +1151,23 @@ namespace TL
codes = codes,
});
+ /// See
+ public static Task Account_UpdateColor(this Client client, int color, long? background_emoji_id = null)
+ => client.Invoke(new Account_UpdateColor
+ {
+ flags = (Account_UpdateColor.Flags)(background_emoji_id != null ? 0x1 : 0),
+ color = color,
+ background_emoji_id = background_emoji_id.GetValueOrDefault(),
+ });
+
+ /// See
+ /// a null value means emojiListNotModified
+ public static Task Account_GetDefaultBackgroundEmojis(this Client client, long hash = default)
+ => client.Invoke(new Account_GetDefaultBackgroundEmojis
+ {
+ 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)
@@ -1572,10 +1589,10 @@ namespace TL
/// Message entities for sending styled text
/// Scheduled message date for scheduled messages
/// Send this message as the specified peer
- public static Task Messages_SendMessage(this Client client, InputPeer peer, string message, long random_id, InputReplyTo reply_to = null, ReplyMarkup reply_markup = null, MessageEntity[] entities = null, DateTime? schedule_date = null, InputPeer send_as = null, bool no_webpage = false, bool silent = false, bool background = false, bool clear_draft = false, bool noforwards = false, bool update_stickersets_order = false)
+ public static Task Messages_SendMessage(this Client client, InputPeer peer, string message, long random_id, InputReplyTo reply_to = null, ReplyMarkup reply_markup = null, MessageEntity[] entities = null, DateTime? schedule_date = null, InputPeer send_as = null, bool no_webpage = false, bool silent = false, bool background = false, bool clear_draft = false, bool noforwards = false, bool update_stickersets_order = false, bool invert_media = false)
=> client.Invoke(new Messages_SendMessage
{
- flags = (Messages_SendMessage.Flags)((reply_to != null ? 0x1 : 0) | (reply_markup != null ? 0x4 : 0) | (entities != null ? 0x8 : 0) | (schedule_date != null ? 0x400 : 0) | (send_as != null ? 0x2000 : 0) | (no_webpage ? 0x2 : 0) | (silent ? 0x20 : 0) | (background ? 0x40 : 0) | (clear_draft ? 0x80 : 0) | (noforwards ? 0x4000 : 0) | (update_stickersets_order ? 0x8000 : 0)),
+ flags = (Messages_SendMessage.Flags)((reply_to != null ? 0x1 : 0) | (reply_markup != null ? 0x4 : 0) | (entities != null ? 0x8 : 0) | (schedule_date != null ? 0x400 : 0) | (send_as != null ? 0x2000 : 0) | (no_webpage ? 0x2 : 0) | (silent ? 0x20 : 0) | (background ? 0x40 : 0) | (clear_draft ? 0x80 : 0) | (noforwards ? 0x4000 : 0) | (update_stickersets_order ? 0x8000 : 0) | (invert_media ? 0x10000 : 0)),
peer = peer,
reply_to = reply_to,
message = message,
@@ -1601,10 +1618,10 @@ namespace TL
/// Message entities for styled text
/// Scheduled message date for scheduled messages
/// Send this message as the specified peer
- public static Task Messages_SendMedia(this Client client, InputPeer peer, InputMedia media, string message, long random_id, InputReplyTo reply_to = null, ReplyMarkup reply_markup = null, MessageEntity[] entities = null, DateTime? schedule_date = null, InputPeer send_as = null, bool silent = false, bool background = false, bool clear_draft = false, bool noforwards = false, bool update_stickersets_order = false)
+ public static Task Messages_SendMedia(this Client client, InputPeer peer, InputMedia media, string message, long random_id, InputReplyTo reply_to = null, ReplyMarkup reply_markup = null, MessageEntity[] entities = null, DateTime? schedule_date = null, InputPeer send_as = null, bool silent = false, bool background = false, bool clear_draft = false, bool noforwards = false, bool update_stickersets_order = false, bool invert_media = false)
=> client.Invoke(new Messages_SendMedia
{
- flags = (Messages_SendMedia.Flags)((reply_to != null ? 0x1 : 0) | (reply_markup != null ? 0x4 : 0) | (entities != null ? 0x8 : 0) | (schedule_date != null ? 0x400 : 0) | (send_as != null ? 0x2000 : 0) | (silent ? 0x20 : 0) | (background ? 0x40 : 0) | (clear_draft ? 0x80 : 0) | (noforwards ? 0x4000 : 0) | (update_stickersets_order ? 0x8000 : 0)),
+ flags = (Messages_SendMedia.Flags)((reply_to != null ? 0x1 : 0) | (reply_markup != null ? 0x4 : 0) | (entities != null ? 0x8 : 0) | (schedule_date != null ? 0x400 : 0) | (send_as != null ? 0x2000 : 0) | (silent ? 0x20 : 0) | (background ? 0x40 : 0) | (clear_draft ? 0x80 : 0) | (noforwards ? 0x4000 : 0) | (update_stickersets_order ? 0x8000 : 0) | (invert_media ? 0x10000 : 0)),
peer = peer,
reply_to = reply_to,
media = media,
@@ -2165,10 +2182,10 @@ namespace TL
/// Reply markup for inline keyboards
/// Message entities for styled text
/// Scheduled message date for scheduled messages
- public static Task Messages_EditMessage(this Client client, InputPeer peer, int id, string message = null, InputMedia media = null, ReplyMarkup reply_markup = null, MessageEntity[] entities = null, DateTime? schedule_date = null, bool no_webpage = false)
+ public static Task Messages_EditMessage(this Client client, InputPeer peer, int id, string message = null, InputMedia media = null, ReplyMarkup reply_markup = null, MessageEntity[] entities = null, DateTime? schedule_date = null, bool no_webpage = false, bool invert_media = false)
=> client.Invoke(new Messages_EditMessage
{
- flags = (Messages_EditMessage.Flags)((message != null ? 0x800 : 0) | (media != null ? 0x4000 : 0) | (reply_markup != null ? 0x4 : 0) | (entities != null ? 0x8 : 0) | (schedule_date != null ? 0x8000 : 0) | (no_webpage ? 0x2 : 0)),
+ flags = (Messages_EditMessage.Flags)((message != null ? 0x800 : 0) | (media != null ? 0x4000 : 0) | (reply_markup != null ? 0x4 : 0) | (entities != null ? 0x8 : 0) | (schedule_date != null ? 0x8000 : 0) | (no_webpage ? 0x2 : 0) | (invert_media ? 0x10000 : 0)),
peer = peer,
id = id,
message = message,
@@ -2185,10 +2202,10 @@ namespace TL
/// Media
/// Reply markup for inline keyboards
/// Message entities for styled text
- public static Task Messages_EditInlineBotMessage(this Client client, InputBotInlineMessageIDBase id, string message = null, InputMedia media = null, ReplyMarkup reply_markup = null, MessageEntity[] entities = null, bool no_webpage = false)
+ public static Task Messages_EditInlineBotMessage(this Client client, InputBotInlineMessageIDBase id, string message = null, InputMedia media = null, ReplyMarkup reply_markup = null, MessageEntity[] entities = null, bool no_webpage = false, bool invert_media = false)
=> client.Invoke(new Messages_EditInlineBotMessage
{
- flags = (Messages_EditInlineBotMessage.Flags)((message != null ? 0x800 : 0) | (media != null ? 0x4000 : 0) | (reply_markup != null ? 0x4 : 0) | (entities != null ? 0x8 : 0) | (no_webpage ? 0x2 : 0)),
+ flags = (Messages_EditInlineBotMessage.Flags)((message != null ? 0x800 : 0) | (media != null ? 0x4000 : 0) | (reply_markup != null ? 0x4 : 0) | (entities != null ? 0x8 : 0) | (no_webpage ? 0x2 : 0) | (invert_media ? 0x10000 : 0)),
id = id,
message = message,
media = media,
@@ -2238,20 +2255,18 @@ namespace TL
/// Save a message draft associated to a chat. See Possible codes: 400 (details)
/// Disable generation of the webpage preview
- /// Message ID the message should reply to
- /// Forum topic where the message will be sent
/// Destination of the message that should be sent
/// The draft
/// Message entities for styled text
- public static Task Messages_SaveDraft(this Client client, InputPeer peer, string message, int? reply_to_msg_id = null, int? top_msg_id = null, MessageEntity[] entities = null, bool no_webpage = false)
+ public static Task Messages_SaveDraft(this Client client, InputPeer peer, string message, MessageEntity[] entities = null, InputReplyTo reply_to = null, InputMedia media = null, bool no_webpage = false, bool invert_media = false)
=> client.Invoke(new Messages_SaveDraft
{
- flags = (Messages_SaveDraft.Flags)((reply_to_msg_id != null ? 0x1 : 0) | (top_msg_id != null ? 0x4 : 0) | (entities != null ? 0x8 : 0) | (no_webpage ? 0x2 : 0)),
- reply_to_msg_id = reply_to_msg_id.GetValueOrDefault(),
- top_msg_id = top_msg_id.GetValueOrDefault(),
+ flags = (Messages_SaveDraft.Flags)((entities != null ? 0x8 : 0) | (reply_to != null ? 0x10 : 0) | (media != null ? 0x20 : 0) | (no_webpage ? 0x2 : 0) | (invert_media ? 0x40 : 0)),
+ reply_to = reply_to,
peer = peer,
message = message,
entities = entities,
+ media = media,
});
/// Return all message drafts.
Returns all the latest updates related to all chats with drafts. See
@@ -2565,10 +2580,10 @@ namespace TL
/// The medias to send: note that they must be separately uploaded using Messages_UploadMedia first, using raw inputMediaUploaded* constructors is not supported.
/// Scheduled message date for scheduled messages
/// Send this message as the specified peer
- public static Task Messages_SendMultiMedia(this Client client, InputPeer peer, InputSingleMedia[] multi_media, InputReplyTo reply_to = null, DateTime? schedule_date = null, InputPeer send_as = null, bool silent = false, bool background = false, bool clear_draft = false, bool noforwards = false, bool update_stickersets_order = false)
+ public static Task Messages_SendMultiMedia(this Client client, InputPeer peer, InputSingleMedia[] multi_media, InputReplyTo reply_to = null, DateTime? schedule_date = null, InputPeer send_as = null, bool silent = false, bool background = false, bool clear_draft = false, bool noforwards = false, bool update_stickersets_order = false, bool invert_media = false)
=> client.Invoke(new Messages_SendMultiMedia
{
- flags = (Messages_SendMultiMedia.Flags)((reply_to != null ? 0x1 : 0) | (schedule_date != null ? 0x400 : 0) | (send_as != null ? 0x2000 : 0) | (silent ? 0x20 : 0) | (background ? 0x40 : 0) | (clear_draft ? 0x80 : 0) | (noforwards ? 0x4000 : 0) | (update_stickersets_order ? 0x8000 : 0)),
+ flags = (Messages_SendMultiMedia.Flags)((reply_to != null ? 0x1 : 0) | (schedule_date != null ? 0x400 : 0) | (send_as != null ? 0x2000 : 0) | (silent ? 0x20 : 0) | (background ? 0x40 : 0) | (clear_draft ? 0x80 : 0) | (noforwards ? 0x4000 : 0) | (update_stickersets_order ? 0x8000 : 0) | (invert_media ? 0x10000 : 0)),
peer = peer,
reply_to = reply_to,
multi_media = multi_media,
@@ -4672,6 +4687,16 @@ namespace TL
random_id = random_id,
});
+ /// See
+ public static Task Channels_UpdateColor(this Client client, InputChannelBase channel, int color, long? background_emoji_id = null)
+ => client.Invoke(new Channels_UpdateColor
+ {
+ flags = (Channels_UpdateColor.Flags)(background_emoji_id != null ? 0x1 : 0),
+ channel = channel,
+ color = color,
+ background_emoji_id = background_emoji_id.GetValueOrDefault(),
+ });
+
/// Sends a custom request; for bots only See [bots: ✓] Possible codes: 400,403 (details)
/// The method name
/// JSON-serialized method parameters
@@ -4943,6 +4968,45 @@ namespace TL
purpose = purpose,
});
+ /// See
+ public static Task Payments_GetPremiumGiftCodeOptions(this Client client, InputPeer boost_peer = null)
+ => client.Invoke(new Payments_GetPremiumGiftCodeOptions
+ {
+ flags = (Payments_GetPremiumGiftCodeOptions.Flags)(boost_peer != null ? 0x1 : 0),
+ boost_peer = boost_peer,
+ });
+
+ /// See
+ public static Task Payments_CheckGiftCode(this Client client, string slug)
+ => client.Invoke(new Payments_CheckGiftCode
+ {
+ slug = slug,
+ });
+
+ /// See
+ public static Task Payments_ApplyGiftCode(this Client client, string slug)
+ => client.Invoke(new Payments_ApplyGiftCode
+ {
+ slug = slug,
+ });
+
+ /// See
+ public static Task Payments_GetGiveawayInfo(this Client client, InputPeer peer, int msg_id)
+ => client.Invoke(new Payments_GetGiveawayInfo
+ {
+ peer = peer,
+ msg_id = msg_id,
+ });
+
+ /// See
+ public static Task Payments_LaunchPrepaidGiveaway(this Client client, InputPeer peer, long giveaway_id, InputStorePaymentPurpose purpose)
+ => client.Invoke(new Payments_LaunchPrepaidGiveaway
+ {
+ peer = peer,
+ giveaway_id = giveaway_id,
+ purpose = purpose,
+ });
+
/// Create a stickerset, bots only. See [bots: ✓] Possible codes: 400 (details)
/// Whether this is a mask stickerset
/// Whether this is an animated stickerset
@@ -5886,38 +5950,34 @@ namespace TL
hidden = hidden,
});
- /// Get the current boost status of a channel, see here » for more info on boosts. See Possible codes: 400 (details)
- /// The channel
- public static Task Stories_GetBoostsStatus(this Client client, InputPeer peer)
- => client.Invoke(new Stories_GetBoostsStatus
- {
- peer = peer,
- });
-
- /// Obtain info about the users currently boosting a channel, see here » for more info about boosts. See Possible codes: 400 (details)
- /// The channel.
- /// Next offset for pagination, obtained from the next_offset field of .
- /// Maximum number of results to return, see pagination
- public static Task Stories_GetBoostersList(this Client client, InputPeer peer, string offset, int limit = int.MaxValue)
- => client.Invoke(new Stories_GetBoostersList
+ /// See
+ public static Task Premium_GetBoostsList(this Client client, InputPeer peer, string offset, int limit = int.MaxValue, bool gifts = false)
+ => client.Invoke(new Premium_GetBoostsList
{
+ flags = (Premium_GetBoostsList.Flags)(gifts ? 0x1 : 0),
peer = peer,
offset = offset,
limit = limit,
});
- /// Check whether a channel can be boosted, see here for more info ». See Possible codes: 400 (details)
- /// The channel to boost.
- public static Task Stories_CanApplyBoost(this Client client, InputPeer peer)
- => client.Invoke(new Stories_CanApplyBoost
+ /// See
+ public static Task Premium_GetMyBoosts(this Client client)
+ => client.Invoke(new Premium_GetMyBoosts
{
+ });
+
+ /// See
+ public static Task Premium_ApplyBoost(this Client client, InputPeer peer, int[] slots = null)
+ => client.Invoke(new Premium_ApplyBoost
+ {
+ flags = (Premium_ApplyBoost.Flags)(slots != null ? 0x1 : 0),
+ slots = slots,
peer = peer,
});
- /// Boost » a channel, leveling it up and granting it permission to post stories ». See Possible codes: 400 (details)
- /// The channel to boost.
- public static Task Stories_ApplyBoost(this Client client, InputPeer peer)
- => client.Invoke(new Stories_ApplyBoost
+ /// See
+ public static Task Premium_GetBoostsStatus(this Client client, InputPeer peer)
+ => client.Invoke(new Premium_GetBoostsStatus
{
peer = peer,
});
@@ -6804,6 +6864,25 @@ namespace TL.Methods
public string[] codes;
}
+ [TLDef(0xA001CC43)]
+ public class Account_UpdateColor : IMethod
+ {
+ public Flags flags;
+ public int color;
+ [IfFlag(0)] public long background_emoji_id;
+
+ [Flags] public enum Flags : uint
+ {
+ has_background_emoji_id = 0x1,
+ }
+ }
+
+ [TLDef(0xA60AB9CE)]
+ public class Account_GetDefaultBackgroundEmojis : IMethod
+ {
+ public long hash;
+ }
+
[TLDef(0x0D91A548)]
public class Users_GetUsers : IMethod
{
@@ -7174,6 +7253,7 @@ namespace TL.Methods
has_send_as = 0x2000,
noforwards = 0x4000,
update_stickersets_order = 0x8000,
+ invert_media = 0x10000,
}
}
@@ -7203,6 +7283,7 @@ namespace TL.Methods
has_send_as = 0x2000,
noforwards = 0x4000,
update_stickersets_order = 0x8000,
+ invert_media = 0x10000,
}
}
@@ -7668,6 +7749,7 @@ namespace TL.Methods
has_message = 0x800,
has_media = 0x4000,
has_schedule_date = 0x8000,
+ invert_media = 0x10000,
}
}
@@ -7688,6 +7770,7 @@ namespace TL.Methods
has_entities = 0x8,
has_message = 0x800,
has_media = 0x4000,
+ invert_media = 0x10000,
}
}
@@ -7731,22 +7814,23 @@ namespace TL.Methods
public InputDialogPeerBase[] peers;
}
- [TLDef(0xB4331E3F)]
+ [TLDef(0x7FF3B806)]
public class Messages_SaveDraft : IMethod
{
public Flags flags;
- [IfFlag(0)] public int reply_to_msg_id;
- [IfFlag(2)] public int top_msg_id;
+ [IfFlag(4)] public InputReplyTo reply_to;
public InputPeer peer;
public string message;
[IfFlag(3)] public MessageEntity[] entities;
+ [IfFlag(5)] public InputMedia media;
[Flags] public enum Flags : uint
{
- has_reply_to_msg_id = 0x1,
no_webpage = 0x2,
- has_top_msg_id = 0x4,
has_entities = 0x8,
+ has_reply_to = 0x10,
+ has_media = 0x20,
+ invert_media = 0x40,
}
}
@@ -8035,6 +8119,7 @@ namespace TL.Methods
has_send_as = 0x2000,
noforwards = 0x4000,
update_stickersets_order = 0x8000,
+ invert_media = 0x10000,
}
}
@@ -9702,6 +9787,20 @@ namespace TL.Methods
public byte[] random_id;
}
+ [TLDef(0x621A201F)]
+ public class Channels_UpdateColor : IMethod
+ {
+ public Flags flags;
+ public InputChannelBase channel;
+ public int color;
+ [IfFlag(0)] public long background_emoji_id;
+
+ [Flags] public enum Flags : uint
+ {
+ has_background_emoji_id = 0x1,
+ }
+ }
+
[TLDef(0xAA2769ED)]
public class Bots_SendCustomRequest : IMethod
{
@@ -9929,6 +10028,45 @@ namespace TL.Methods
public InputStorePaymentPurpose purpose;
}
+ [TLDef(0x2757BA54)]
+ public class Payments_GetPremiumGiftCodeOptions : IMethod
+ {
+ public Flags flags;
+ [IfFlag(0)] public InputPeer boost_peer;
+
+ [Flags] public enum Flags : uint
+ {
+ has_boost_peer = 0x1,
+ }
+ }
+
+ [TLDef(0x8E51B4C1)]
+ public class Payments_CheckGiftCode : IMethod
+ {
+ public string slug;
+ }
+
+ [TLDef(0xF6E26854)]
+ public class Payments_ApplyGiftCode : IMethod
+ {
+ public string slug;
+ }
+
+ [TLDef(0xF4239425)]
+ public class Payments_GetGiveawayInfo : IMethod
+ {
+ public InputPeer peer;
+ public int msg_id;
+ }
+
+ [TLDef(0x5FF58F20)]
+ public class Payments_LaunchPrepaidGiveaway : IMethod
+ {
+ public InputPeer peer;
+ public long giveaway_id;
+ public InputStorePaymentPurpose purpose;
+ }
+
[TLDef(0x9021AB67)]
public class Stickers_CreateStickerSet : IMethod
{
@@ -10723,28 +10861,38 @@ namespace TL.Methods
public bool hidden;
}
- [TLDef(0x4C449472)]
- public class Stories_GetBoostsStatus : IMethod
- {
- public InputPeer peer;
- }
-
- [TLDef(0x337EF980)]
- public class Stories_GetBoostersList : IMethod
+ [TLDef(0x60F67660)]
+ public class Premium_GetBoostsList : IMethod
{
+ public Flags flags;
public InputPeer peer;
public string offset;
public int limit;
+
+ [Flags] public enum Flags : uint
+ {
+ gifts = 0x1,
+ }
}
- [TLDef(0xDB05C1BD)]
- public class Stories_CanApplyBoost : IMethod
+ [TLDef(0x0BE77B4A)]
+ public class Premium_GetMyBoosts : IMethod { }
+
+ [TLDef(0x6B7DA746)]
+ public class Premium_ApplyBoost : IMethod
{
+ public Flags flags;
+ [IfFlag(0)] public int[] slots;
public InputPeer peer;
+
+ [Flags] public enum Flags : uint
+ {
+ has_slots = 0x1,
+ }
}
- [TLDef(0xF29D7C2B)]
- public class Stories_ApplyBoost : IMethod
+ [TLDef(0x042F1F61)]
+ public class Premium_GetBoostsStatus : IMethod
{
public InputPeer peer;
}
diff --git a/src/TL.Table.cs b/src/TL.Table.cs
index 2534795..341e32a 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 = 165; // fetched 04/10/2023 17:10:52
+ public const int Version = 166; // fetched 28/10/2023 21:16:53
internal const int SecretChats = 144;
internal const int MTProto2 = 73;
internal const uint VectorCtor = 0x1CB5C415;
@@ -99,6 +99,7 @@ namespace TL
[0x0F94E5F1] = typeof(InputMediaPoll),
[0xE66FBF7B] = typeof(InputMediaDice),
[0x89FDD778] = typeof(InputMediaStory),
+ [0xC21B8849] = typeof(InputMediaWebPage),
[0x1CA48F57] = null,//InputChatPhotoEmpty
[0xBDCDAEC0] = typeof(InputChatUploadedPhoto),
[0x8953AD37] = typeof(InputChatPhoto),
@@ -120,7 +121,7 @@ namespace TL
[0x36C6019A] = typeof(PeerChat),
[0xA2A5371E] = typeof(PeerChannel),
[0xD3BC4B7A] = typeof(UserEmpty),
- [0xABB5F120] = typeof(User),
+ [0xEB602F25] = typeof(User),
[0x4F11BAE1] = null,//UserProfilePhotoEmpty
[0x82D1F706] = typeof(UserProfilePhoto),
[0x09D05049] = null,//UserStatusEmpty
@@ -132,7 +133,7 @@ namespace TL
[0x29562865] = typeof(ChatEmpty),
[0x41CBF256] = typeof(Chat),
[0x6592A1A7] = typeof(ChatForbidden),
- [0x94F592DB] = typeof(Channel),
+ [0x1981EA7E] = typeof(Channel),
[0x17D493D5] = typeof(ChannelForbidden),
[0xC9D31138] = typeof(ChatFull),
[0x723027BD] = typeof(ChannelFull),
@@ -152,7 +153,7 @@ namespace TL
[0x70322949] = typeof(MessageMediaContact),
[0x9F84F49E] = typeof(MessageMediaUnsupported),
[0x4CF4D72D] = typeof(MessageMediaDocument),
- [0xA32DD600] = typeof(MessageMediaWebPage),
+ [0xDDF10C3B] = typeof(MessageMediaWebPage),
[0x2EC0533F] = typeof(MessageMediaVenue),
[0xFDB19008] = typeof(MessageMediaGame),
[0xF6A548D3] = typeof(MessageMediaInvoice),
@@ -160,6 +161,7 @@ namespace TL
[0x4BD6E798] = typeof(MessageMediaPoll),
[0x3F7EE58B] = typeof(MessageMediaDice),
[0x68CB6283] = typeof(MessageMediaStory),
+ [0x58260664] = typeof(MessageMediaGiveaway),
[0xB6AEF7B0] = null,//MessageActionEmpty
[0xBD47CBAD] = typeof(MessageActionChatCreate),
[0xB5A1CE5A] = typeof(MessageActionChatEditTitle),
@@ -199,6 +201,8 @@ namespace TL
[0xFE77345D] = typeof(MessageActionRequestedPeer),
[0xBC44A927] = typeof(MessageActionSetChatWallPaper),
[0xC0787D6D] = typeof(MessageActionSetSameChatWallPaper),
+ [0xD2CFDB0E] = typeof(MessageActionGiftCode),
+ [0x332BA9ED] = typeof(MessageActionGiveawayLaunch),
[0xD58A08C6] = typeof(Dialog),
[0x71BD134C] = typeof(DialogFolder),
[0x2331B22D] = typeof(PhotoEmpty),
@@ -484,8 +488,8 @@ namespace TL
[0xE86602C3] = null,//Messages_AllStickersNotModified
[0xCDBBCEBB] = typeof(Messages_AllStickers),
[0x84D19185] = typeof(Messages_AffectedMessages),
- [0xEB1477E8] = typeof(WebPageEmpty),
- [0xC586DA1C] = typeof(WebPagePending),
+ [0x211A1788] = typeof(WebPageEmpty),
+ [0xB0D13E47] = typeof(WebPagePending),
[0xE89C45B2] = typeof(WebPage),
[0x7311CA11] = typeof(WebPageNotModified),
[0xAD01D61D] = typeof(Authorization),
@@ -498,7 +502,7 @@ namespace TL
[0x0AB4A819] = typeof(ChatInviteExported),
[0xED107AB7] = typeof(ChatInvitePublicJoinRequests),
[0x5A686D7C] = typeof(ChatInviteAlready),
- [0x300C44C1] = typeof(ChatInvite),
+ [0xCDE0EC40] = typeof(ChatInvite),
[0x61695CB0] = typeof(ChatInvitePeek),
[0xFFB62B95] = null,//InputStickerSetEmpty
[0x9DE7A269] = typeof(InputStickerSetID),
@@ -553,10 +557,10 @@ namespace TL
[0x4C4E743F] = typeof(MessageEntityCashtag),
[0x9C4E7E8B] = typeof(MessageEntityUnderline),
[0xBF0693D4] = typeof(MessageEntityStrike),
- [0x020DF5D0] = typeof(MessageEntityBlockquote),
[0x761E6AF4] = typeof(MessageEntityBankCard),
[0x32CA960F] = typeof(MessageEntitySpoiler),
[0xC8CF05F8] = typeof(MessageEntityCustomEmoji),
+ [0x020DF5D0] = typeof(MessageEntityBlockquote),
[0xEE8C1E86] = null,//InputChannelEmpty
[0xF35AEC28] = typeof(InputChannel),
[0x5B934F9D] = typeof(InputChannelFromMessage),
@@ -594,6 +598,7 @@ namespace TL
[0xA6EDBFFD] = typeof(InputBotInlineMessageMediaContact),
[0x4B425864] = typeof(InputBotInlineMessageGame),
[0xD7E78225] = typeof(InputBotInlineMessageMediaInvoice),
+ [0xBDDCC510] = typeof(InputBotInlineMessageMediaWebPage),
[0x88BF9319] = typeof(InputBotInlineResult),
[0xA8D864A7] = typeof(InputBotInlineResultPhoto),
[0xFFF8FDC4] = typeof(InputBotInlineResultDocument),
@@ -604,6 +609,7 @@ namespace TL
[0x8A86659C] = typeof(BotInlineMessageMediaVenue),
[0x18D1CDC2] = typeof(BotInlineMessageMediaContact),
[0x354A9B09] = typeof(BotInlineMessageMediaInvoice),
+ [0x809AD9A6] = typeof(BotInlineMessageMediaWebPage),
[0x11965F3A] = typeof(BotInlineResult),
[0x17DB940B] = typeof(BotInlineMediaResult),
[0xE021F2F6] = typeof(Messages_BotResults),
@@ -630,7 +636,7 @@ namespace TL
[0x70B772A8] = typeof(Contacts_TopPeers),
[0xB52C939D] = typeof(Contacts_TopPeersDisabled),
[0x1B0C841A] = typeof(DraftMessageEmpty),
- [0xFD8E711F] = typeof(DraftMessage),
+ [0x3FCCF7EF] = typeof(DraftMessage),
[0xC6DC0C66] = typeof(Messages_FeaturedStickersNotModified),
[0xBE382906] = typeof(Messages_FeaturedStickers),
[0x0B17F890] = null,//Messages_RecentStickersNotModified
@@ -785,6 +791,8 @@ namespace TL
[0xAE168909] = typeof(ChannelAdminLogEventActionDeleteTopic),
[0x5D8D353B] = typeof(ChannelAdminLogEventActionPinTopic),
[0x64F36DFC] = typeof(ChannelAdminLogEventActionToggleAntiSpam),
+ [0x3C2B247B] = typeof(ChannelAdminLogEventActionChangeColor),
+ [0x445FC434] = typeof(ChannelAdminLogEventActionChangeBackgroundEmoji),
[0x1FAD68CD] = typeof(ChannelAdminLogEvent),
[0xED8AF74D] = typeof(Channels_AdminLogResults),
[0xEA107AE4] = typeof(ChannelAdminLogEventsFilter),
@@ -952,7 +960,7 @@ namespace TL
[0x455B853D] = typeof(MessageViews),
[0xB6C4F543] = typeof(Messages_MessageViews),
[0xA6341782] = typeof(Messages_DiscussionMessage),
- [0xA6D57763] = typeof(MessageReplyHeader),
+ [0x6EEBCABD] = typeof(MessageReplyHeader),
[0x9C98BFC1] = typeof(MessageReplyStoryHeader),
[0x83D60FC2] = typeof(MessageReplies),
[0xE8FD8014] = typeof(PeerBlocked),
@@ -1032,11 +1040,14 @@ namespace TL
[0x1F307EB7] = typeof(Account_SavedRingtoneConverted),
[0xC5B56859] = typeof(InputInvoiceMessage),
[0xC326CAEF] = typeof(InputInvoiceSlug),
+ [0x98986C0D] = typeof(InputInvoicePremiumGiftCode),
[0xAED0CBD9] = typeof(Payments_ExportedInvoice),
[0x93752C52] = typeof(Messages_TranscribedAudio),
[0x5334759C] = typeof(Help_PremiumPromo),
[0xA6751E66] = typeof(InputStorePaymentPremiumSubscription),
[0x616F7FE8] = typeof(InputStorePaymentGiftPremium),
+ [0xA3805F3F] = typeof(InputStorePaymentPremiumGiftCode),
+ [0x7C9375E6] = typeof(InputStorePaymentPremiumGiveaway),
[0x74C34319] = typeof(PremiumGiftOption),
[0x88F8F21B] = typeof(PaymentFormMethod),
[0x2DE11AAE] = null,//EmojiStatusEmpty
@@ -1116,7 +1127,7 @@ namespace TL
[0xB0BDEAC5] = typeof(StoryView),
[0x46E9B9EC] = typeof(Stories_StoryViewsList),
[0xDE9EED1D] = typeof(Stories_StoryViews),
- [0x9C5386E4] = typeof(InputReplyToMessage),
+ [0x073EC805] = typeof(InputReplyToMessage),
[0x15B0F283] = typeof(InputReplyToStory),
[0x3FC9053B] = typeof(ExportedStoryLink),
[0x712E27FD] = typeof(StoriesStealthMode),
@@ -1127,12 +1138,17 @@ namespace TL
[0x14455871] = typeof(MediaAreaSuggestedReaction),
[0x9A35E999] = typeof(PeerStories),
[0xCAE68768] = typeof(Stories_PeerStories),
- [0xE5C1AA5C] = typeof(Stories_BoostsStatus),
- [0xC3173587] = typeof(Stories_CanApplyBoostOk),
- [0x712C4655] = typeof(Stories_CanApplyBoostReplace),
- [0x0E9E6380] = typeof(Booster),
- [0xF3DD3D1D] = typeof(Stories_BoostersList),
[0xFD5E12BD] = typeof(Messages_WebPage),
+ [0x257E962B] = typeof(PremiumGiftCodeOption),
+ [0xB722F158] = typeof(Payments_CheckedGiftCode),
+ [0x4367DAA0] = typeof(Payments_GiveawayInfo),
+ [0x00CD5570] = typeof(Payments_GiveawayInfoResults),
+ [0xB2539D54] = typeof(PrepaidGiveaway),
+ [0x2A1C8C71] = typeof(Boost),
+ [0x86F8613C] = typeof(Premium_BoostsList),
+ [0xC448415C] = typeof(MyBoost),
+ [0x9AE228E2] = typeof(Premium_MyBoosts),
+ [0x4959427A] = typeof(Premium_BoostsStatus),
// from TL.Secret:
[0x6ABD9782] = typeof(Layer143.DecryptedMessageMediaDocument),
[0x91CC4674] = typeof(Layer73.DecryptedMessage),
diff --git a/src/WTelegramClient.csproj b/src/WTelegramClient.csproj
index d734d90..a7397e8 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: 165
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: 166
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