From ddfa095f1ae8c38267beb56c13ffc03827295ec8 Mon Sep 17 00:00:00 2001 From: Wizou <11647984+wiz0u@users.noreply.github.com> Date: Sat, 8 Apr 2023 16:26:33 +0200 Subject: [PATCH] api doc --- EXAMPLES.md | 2 +- src/TL.Schema.cs | 50 +++++++++++++++++++++++++++++++------------ src/TL.SchemaFuncs.cs | 31 +++++++++++++++++++-------- 3 files changed, 59 insertions(+), 24 deletions(-) diff --git a/EXAMPLES.md b/EXAMPLES.md index 4bb75c8..c3cb81a 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -39,7 +39,7 @@ WTelegram.Helpers.Log += (lvl, str) => System.Diagnostics.Debug.WriteLine(str); // • In ASP.NET service, you will typically send logs to an ILogger: WTelegram.Helpers.Log = (lvl, str) => _logger.Log((LogLevel)lvl, str); -// • Disable logging (THIS IS NOT RECOMMENDED as you won't be able to diagnose any upcoming problem): +// • Disable logging (⛔️𝗗𝗢𝗡'𝗧 𝗗𝗢 𝗧𝗛𝗜𝗦 as you won't be able to diagnose any upcoming problem): WTelegram.Helpers.Log = (lvl, str) => { }; ``` diff --git a/src/TL.Schema.cs b/src/TL.Schema.cs index 81038fe..ca343c3 100644 --- a/src/TL.Schema.cs +++ b/src/TL.Schema.cs @@ -467,8 +467,9 @@ namespace TL [IfFlag(0)] public InputFileBase file; /// Square video for animated profile picture [IfFlag(1)] public InputFileBase video; - /// Timestamp that should be shown as static preview to the user (seconds) + /// Floating point UNIX timestamp in seconds, indicating the frame of the video/sticker that should be used as static preview; can only be used if video or video_emoji_markup is set. [IfFlag(2)] public double video_start_ts; + /// Animated sticker profile picture, must contain either a or a . [IfFlag(3)] public VideoSizeBase video_emoji_markup; [Flags] public enum Flags : uint @@ -2072,13 +2073,13 @@ namespace TL /// Action message public string message; } - /// The domain name of the website on which the user has logged in. More about Telegram Login » See + /// The user has given the bot permission to do something. See [TLDef(0xC516D679)] public class MessageActionBotAllowed : MessageAction { /// Flags, see TL conditional fields public Flags flags; - /// The domain name of the website on which the user has logged in. + /// The domain name of the website on which the user has logged in. More about Telegram Login » [IfFlag(0)] public string domain; [IfFlag(2)] public BotApp app; @@ -2253,10 +2254,11 @@ namespace TL has_hidden = 0x8, } } - /// See + /// A new profile picture was suggested using Photos_UploadContactProfilePhoto. See [TLDef(0x57DE635E)] public class MessageActionSuggestProfilePhoto : MessageAction { + /// The photo that the user suggested we set as profile picture. public PhotoBase photo; } /// Contains info about a peer that the user shared with the bot after clicking on a button. See @@ -2838,9 +2840,11 @@ namespace TL [IfFlag(1)] public string about; /// Peer settings public PeerSettings settings; + /// Personal profile photo, to be shown instead of profile_photo. [IfFlag(21)] public PhotoBase personal_photo; /// Profile photo [IfFlag(2)] public PhotoBase profile_photo; + /// Fallback profile photo, displayed if no photo is present in profile_photo or personal_photo, due to privacy settings. [IfFlag(22)] public PhotoBase fallback_photo; /// Notification settings public PeerNotifySettings notify_settings; @@ -3727,7 +3731,7 @@ namespace TL public Flags flags; /// The peer to which the draft is associated public Peer peer; - /// ID of the forum topic to which the draft is associated + /// ID of the forum topic to which the draft is associated [IfFlag(0)] public int top_msg_id; /// The draft public DraftMessageBase draft; @@ -4495,10 +4499,11 @@ namespace TL has_order = 0x1, } } - /// See + /// User information was updated, it must be refetched using Users_GetFullUser. See [TLDef(0x20529438)] public class UpdateUser : Update { + /// User ID public long user_id; } /// Media autosave settings have changed and must be refetched using Account_GetAutoSaveSettings. See @@ -5887,6 +5892,7 @@ namespace TL { /// Whether this custom emoji can be sent by non-Premium users free = 0x1, + /// Whether the color of this TGS custom emoji 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 = 0x2, } } @@ -6432,6 +6438,7 @@ namespace TL public StickerSet set; /// Emoji info for stickers public StickerPack[] packs; + /// Keywords for some or every sticker in the stickerset. public StickerKeyword[] keywords; /// Stickers in stickerset public DocumentBase[] documents; @@ -8310,6 +8317,7 @@ namespace TL public StickerSet set; /// Emoji information about every sticker in the stickerset public StickerPack[] packs; + /// Keywords for some or every sticker in the stickerset. public StickerKeyword[] keywords; /// Stickers public DocumentBase[] documents; @@ -8317,12 +8325,14 @@ namespace TL /// Stickerset public override StickerSet Set => set; } - /// See + /// Just the stickerset information, with no previews. See [TLDef(0x77B15D1C)] public class StickerSetNoCovered : StickerSetCoveredBase { + /// Stickerset information. public StickerSet set; + /// Stickerset information. public override StickerSet Set => set; } @@ -9375,7 +9385,7 @@ namespace TL public string emoji; /// Coordinates for mask sticker [IfFlag(0)] public MaskCoords mask_coords; - /// Set of keywords, separated by commas + /// Set of keywords, separated by commas (can't be provided for mask stickers) [IfFlag(1)] public string keywords; [Flags] public enum Flags : uint @@ -12402,7 +12412,7 @@ namespace TL /// Represents an animated video thumbnail See Derived classes: , , public abstract class VideoSizeBase : IObject { } - /// Animated profile picture in MPEG4 format See + /// An animated profile picture in MPEG4 format See [TLDef(0xDE33B094)] public class VideoSize : VideoSizeBase { @@ -12425,19 +12435,24 @@ namespace TL has_video_start_ts = 0x1, } } - /// See + /// An animated profile picture based on a custom emoji sticker. See [TLDef(0xF85C413C)] public class VideoSizeEmojiMarkup : VideoSizeBase { + /// Custom emoji ID: the custom emoji sticker is shown at the center of the profile picture and occupies at most 67% of it. public long emoji_id; + /// 1, 2, 3 or 4 RBG-24 colors used to generate a solid (1), gradient (2) or freeform gradient (3, 4) background, similar to how fill wallpapers are generated. The rotation angle for gradient backgrounds is 0. public int[] background_colors; } - /// See + /// An animated profile picture based on a sticker. See [TLDef(0x0DA082FE)] public class VideoSizeStickerMarkup : VideoSizeBase { + /// Stickerset public InputStickerSet stickerset; + /// Sticker ID public long sticker_id; + /// 1, 2, 3 or 4 RBG-24 colors used to generate a solid (1), gradient (2) or freeform gradient (3, 4) background, similar to how fill wallpapers are generated. The rotation angle for gradient backgrounds is 0. public int[] background_colors; } @@ -14340,30 +14355,37 @@ namespace TL } } - /// See + /// Represents a list of custom emojis. See /// a value means emojiListNotModified [TLDef(0x7A1E11D1)] public class EmojiList : IObject { + /// Hash for pagination, for more info click here public long hash; + /// Custom emoji IDs public long[] document_id; } - /// See + /// Represents an emoji category. See [TLDef(0x7A9ABDA9)] public class EmojiGroup : IObject { + /// Category name, i.e. "Animals", "Flags", "Faces" and so on... public string title; + /// A single custom emoji used as preview for the category. public long icon_emoji_id; + /// A list of UTF-8 emojis, matching the category. public string[] emoticons; } - /// See + /// Represents a list of emoji categories. See /// a value means messages.emojiGroupsNotModified [TLDef(0x881FB94B)] public class Messages_EmojiGroups : IObject { + /// Hash for pagination, for more info click here public int hash; + /// A list of emoji categories. public EmojiGroup[] groups; } diff --git a/src/TL.SchemaFuncs.cs b/src/TL.SchemaFuncs.cs index 979e3e7..f7265f8 100644 --- a/src/TL.SchemaFuncs.cs +++ b/src/TL.SchemaFuncs.cs @@ -1088,7 +1088,8 @@ namespace TL active = active, }); - /// See + /// Get a set of suggested custom emoji stickers that can be used as profile picture See + /// Hash for pagination, for more info click here /// a null value means emojiListNotModified public static Task Account_GetDefaultProfilePhotoEmojis(this Client client, long hash = default) => client.Invoke(new Account_GetDefaultProfilePhotoEmojis @@ -1096,7 +1097,8 @@ namespace TL hash = hash, }); - /// See + /// Get a set of suggested custom emoji stickers that can be used as group picture See + /// Hash for pagination, for more info click here /// a null value means emojiListNotModified public static Task Account_GetDefaultGroupPhotoEmojis(this Client client, long hash = default) => client.Invoke(new Account_GetDefaultGroupPhotoEmojis @@ -3552,7 +3554,8 @@ namespace TL requested_peer = requested_peer, }); - /// See [bots: ✓] + /// Represents a list of emoji categories, to be used when selecting custom emojis. See [bots: ✓] + /// Hash for pagination, for more info click here /// a null value means messages.emojiGroupsNotModified public static Task Messages_GetEmojiGroups(this Client client, int hash = default) => client.Invoke(new Messages_GetEmojiGroups @@ -3560,7 +3563,8 @@ namespace TL hash = hash, }); - /// See [bots: ✓] + /// Represents a list of emoji categories, to be used when selecting custom emojis to set as custom emoji status. See [bots: ✓] + /// Hash for pagination, for more info click here /// a null value means messages.emojiGroupsNotModified public static Task Messages_GetEmojiStatusGroups(this Client client, int hash = default) => client.Invoke(new Messages_GetEmojiStatusGroups @@ -3568,7 +3572,8 @@ namespace TL hash = hash, }); - /// See [bots: ✓] + /// Represents a list of emoji categories, to be used when selecting custom emojis to set as profile picture. See [bots: ✓] + /// Hash for pagination, for more info click here /// a null value means messages.emojiGroupsNotModified public static Task Messages_GetEmojiProfilePhotoGroups(this Client client, int hash = default) => client.Invoke(new Messages_GetEmojiProfilePhotoGroups @@ -3663,6 +3668,7 @@ namespace TL }); /// Installs a previously uploaded photo as a profile photo. See Possible codes: 400 (details) + /// If set, the chosen profile photo will be shown to users that can't display your main profile photo due to your privacy settings. /// Input photo public static Task Photos_UpdateProfilePhoto(this Client client, InputPhoto id, bool fallback = false) => client.Invoke(new Photos_UpdateProfilePhoto @@ -3672,9 +3678,11 @@ namespace TL }); /// Updates current user profile photo. See Possible codes: 400 (details) + /// If set, the chosen profile photo will be shown to users that can't display your main profile photo due to your privacy settings. /// Profile photo /// Animated profile picture video - /// Floating point UNIX timestamp in seconds, indicating the frame of the video that should be used as static preview. + /// Floating point UNIX timestamp in seconds, indicating the frame of the video/sticker that should be used as static preview; can only be used if video or video_emoji_markup is set. + /// Animated sticker profile picture, must contain either a or a . public static Task Photos_UploadProfilePhoto(this Client client, InputFileBase file = null, InputFileBase video = null, double? video_start_ts = null, VideoSizeBase video_emoji_markup = null, bool fallback = false) => client.Invoke(new Photos_UploadProfilePhoto { @@ -3707,10 +3715,14 @@ namespace TL limit = limit, }); - /// See [bots: ✓] Possible codes: 400 (details) + /// Upload a custom profile picture for a contact, or suggest a new profile picture to a contact. See [bots: ✓] Possible codes: 400 (details) + /// If set, will send a service message to user_id, suggesting them to use the specified profile picture; otherwise, will set a personal profile picture for the user (only visible to the current user). + /// If set, removes a previously set personal profile picture (does not affect suggested profile pictures, to remove them simply deleted the service message with Messages_DeleteMessages). + /// The contact /// Profile photo /// Animated profile picture video - /// Floating point UNIX timestamp in seconds, indicating the frame of the video that should be used as static preview. + /// Floating point UNIX timestamp in seconds, indicating the frame of the video/sticker that should be used as static preview; can only be used if video or video_emoji_markup is set. + /// Animated sticker profile picture, must contain either a or a . public static Task Photos_UploadContactProfilePhoto(this Client client, InputUserBase user_id, InputFileBase file = null, InputFileBase video = null, double? video_start_ts = null, VideoSizeBase video_emoji_markup = null, bool suggest = false, bool save = false) => client.Invoke(new Photos_UploadContactProfilePhoto { @@ -4825,6 +4837,7 @@ namespace TL /// Whether this is an animated stickerset /// Whether this is a video stickerset /// Whether this is a custom emoji stickerset. + /// Whether the color of TGS custom emojis contained in this set 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. For custom emoji stickersets only. /// Stickerset owner /// Stickerset name, 1-64 chars /// Short name of sticker set, to be used in sticker deep links ». Can contain only english letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and, if called by a bot, must end in "_by_<bot_username>". <bot_username> is case insensitive. 1-64 characters. @@ -4909,7 +4922,7 @@ namespace TL /// The sticker /// If set, updates the emoji list associated to the sticker /// If set, updates the mask coordinates - /// If set, updates the sticker keywords (separated by commas). + /// If set, updates the sticker keywords (separated by commas). Can't be provided for mask stickers. /// a null value means messages.stickerSetNotModified public static Task Stickers_ChangeSticker(this Client client, InputDocument sticker, string emoji = null, MaskCoords mask_coords = null, string keywords = null) => client.Invoke(new Stickers_ChangeSticker