diff --git a/Scripts/Get-TlFiles.ps1 b/Scripts/Get-TlFiles.ps1 index e840fb0b..4427801f 100644 --- a/Scripts/Get-TlFiles.ps1 +++ b/Scripts/Get-TlFiles.ps1 @@ -1,5 +1,5 @@ param( - [string] $CommitHash = 'c95598e5e1493881d31211c1329bdbe4630f6136', + [string] $CommitHash = '07c1d53a6d3cb1fad58d2822e55eef6d57363581', [string] $TdApiUrl = "https://github.com/tdlib/td/raw/$CommitHash/td/generate/scheme/td_api.tl", [string] $SourceRoot = "$PSScriptRoot/..", diff --git a/TdLib.Api/Functions/ActivateStoryStealthMode.cs b/TdLib.Api/Functions/ActivateStoryStealthMode.cs new file mode 100644 index 00000000..15c59fca --- /dev/null +++ b/TdLib.Api/Functions/ActivateStoryStealthMode.cs @@ -0,0 +1,46 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Activates stealth mode for stories, which hides all views of stories from the current user in the last "story_stealth_mode_past_period" seconds + /// and for the next "story_stealth_mode_future_period" seconds; for Telegram Premium users only + /// + public class ActivateStoryStealthMode : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "activateStoryStealthMode"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + + /// + /// Activates stealth mode for stories, which hides all views of stories from the current user in the last "story_stealth_mode_past_period" seconds + /// and for the next "story_stealth_mode_future_period" seconds; for Telegram Premium users only + /// + public static Task ActivateStoryStealthModeAsync( + this Client client) + { + return client.ExecuteAsync(new ActivateStoryStealthMode + { + + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/AddApplicationChangelog.cs b/TdLib.Api/Functions/AddApplicationChangelog.cs index 1be17519..91ad5621 100644 --- a/TdLib.Api/Functions/AddApplicationChangelog.cs +++ b/TdLib.Api/Functions/AddApplicationChangelog.cs @@ -10,7 +10,7 @@ namespace TdLib public static partial class TdApi { /// - /// Adds server-provided application changelog as messages to the chat 777000 (Telegram); for official applications only. Returns a 404 error if nothing changed + /// Adds server-provided application changelog as messages to the chat 777000 (Telegram) or as a stories; for official applications only. Returns a 404 error if nothing changed /// public class AddApplicationChangelog : Function { @@ -35,7 +35,7 @@ public class AddApplicationChangelog : Function } /// - /// Adds server-provided application changelog as messages to the chat 777000 (Telegram); for official applications only. Returns a 404 error if nothing changed + /// Adds server-provided application changelog as messages to the chat 777000 (Telegram) or as a stories; for official applications only. Returns a 404 error if nothing changed /// public static Task AddApplicationChangelogAsync( this Client client, string previousApplicationVersion = default) diff --git a/TdLib.Api/Functions/AddChatFolderByInviteLink.cs b/TdLib.Api/Functions/AddChatFolderByInviteLink.cs new file mode 100644 index 00000000..c260cdd9 --- /dev/null +++ b/TdLib.Api/Functions/AddChatFolderByInviteLink.cs @@ -0,0 +1,55 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Adds a chat folder by an invite link + /// + public class AddChatFolderByInviteLink : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "addChatFolderByInviteLink"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Invite link for the chat folder + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("invite_link")] + public string InviteLink { get; set; } + + /// + /// Identifiers of the chats added to the chat folder. The chats are automatically joined if they aren't joined yet + /// + [JsonProperty("chat_ids", ItemConverterType = typeof(Converter))] + public long[] ChatIds { get; set; } + } + + /// + /// Adds a chat folder by an invite link + /// + public static Task AddChatFolderByInviteLinkAsync( + this Client client, string inviteLink = default, long[] chatIds = default) + { + return client.ExecuteAsync(new AddChatFolderByInviteLink + { + InviteLink = inviteLink, ChatIds = chatIds + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/AddLocalMessage.cs b/TdLib.Api/Functions/AddLocalMessage.cs index 1e8daa0d..cf1646c2 100644 --- a/TdLib.Api/Functions/AddLocalMessage.cs +++ b/TdLib.Api/Functions/AddLocalMessage.cs @@ -41,11 +41,11 @@ public class AddLocalMessage : Function public MessageSender SenderId { get; set; } /// - /// Identifier of the replied message; 0 if none + /// Information about the message or story to be replied; pass null if none /// [JsonConverter(typeof(Converter))] - [JsonProperty("reply_to_message_id")] - public long ReplyToMessageId { get; set; } + [JsonProperty("reply_to")] + public InputMessageReplyTo ReplyTo { get; set; } /// /// Pass true to disable notification for the message @@ -66,11 +66,11 @@ public class AddLocalMessage : Function /// Adds a local message to a chat. The message is persistent across application restarts only if the message database is used. Returns the added message /// public static Task AddLocalMessageAsync( - this Client client, long chatId = default, MessageSender senderId = default, long replyToMessageId = default, bool disableNotification = default, InputMessageContent inputMessageContent = default) + this Client client, long chatId = default, MessageSender senderId = default, InputMessageReplyTo replyTo = default, bool disableNotification = default, InputMessageContent inputMessageContent = default) { return client.ExecuteAsync(new AddLocalMessage { - ChatId = chatId, SenderId = senderId, ReplyToMessageId = replyToMessageId, DisableNotification = disableNotification, InputMessageContent = inputMessageContent + ChatId = chatId, SenderId = senderId, ReplyTo = replyTo, DisableNotification = disableNotification, InputMessageContent = inputMessageContent }); } } diff --git a/TdLib.Api/Functions/AddProxy.cs b/TdLib.Api/Functions/AddProxy.cs index d6974aff..af5bf1ac 100644 --- a/TdLib.Api/Functions/AddProxy.cs +++ b/TdLib.Api/Functions/AddProxy.cs @@ -27,7 +27,7 @@ public class AddProxy : Function public override string Extra { get; set; } /// - /// Proxy server IP address + /// Proxy server domain or IP address /// [JsonConverter(typeof(Converter))] [JsonProperty("server")] diff --git a/TdLib.Api/Functions/AllowBotToSendMessages.cs b/TdLib.Api/Functions/AllowBotToSendMessages.cs new file mode 100644 index 00000000..0545648e --- /dev/null +++ b/TdLib.Api/Functions/AllowBotToSendMessages.cs @@ -0,0 +1,49 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Allows the specified bot to send messages to the user + /// + public class AllowBotToSendMessages : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "allowBotToSendMessages"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of the target bot + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("bot_user_id")] + public long BotUserId { get; set; } + } + + /// + /// Allows the specified bot to send messages to the user + /// + public static Task AllowBotToSendMessagesAsync( + this Client client, long botUserId = default) + { + return client.ExecuteAsync(new AllowBotToSendMessages + { + BotUserId = botUserId + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/DeleteChatFilter.cs b/TdLib.Api/Functions/ApplyPremiumGiftCode.cs similarity index 58% rename from TdLib.Api/Functions/DeleteChatFilter.cs rename to TdLib.Api/Functions/ApplyPremiumGiftCode.cs index 7075c9c0..ea793e35 100644 --- a/TdLib.Api/Functions/DeleteChatFilter.cs +++ b/TdLib.Api/Functions/ApplyPremiumGiftCode.cs @@ -10,15 +10,15 @@ namespace TdLib public static partial class TdApi { /// - /// Deletes existing chat filter + /// Applies a Telegram Premium gift code /// - public class DeleteChatFilter : Function + public class ApplyPremiumGiftCode : Function { /// /// Data type for serialization /// [JsonProperty("@type")] - public override string DataType { get; set; } = "deleteChatFilter"; + public override string DataType { get; set; } = "applyPremiumGiftCode"; /// /// Extra data attached to the function @@ -27,22 +27,22 @@ public class DeleteChatFilter : Function public override string Extra { get; set; } /// - /// Chat filter identifier + /// The code to apply /// [JsonConverter(typeof(Converter))] - [JsonProperty("chat_filter_id")] - public int ChatFilterId { get; set; } + [JsonProperty("code")] + public string Code { get; set; } } /// - /// Deletes existing chat filter + /// Applies a Telegram Premium gift code /// - public static Task DeleteChatFilterAsync( - this Client client, int chatFilterId = default) + public static Task ApplyPremiumGiftCodeAsync( + this Client client, string code = default) { - return client.ExecuteAsync(new DeleteChatFilter + return client.ExecuteAsync(new ApplyPremiumGiftCode { - ChatFilterId = chatFilterId + Code = code }); } } diff --git a/TdLib.Api/Functions/BoostChat.cs b/TdLib.Api/Functions/BoostChat.cs new file mode 100644 index 00000000..24edff02 --- /dev/null +++ b/TdLib.Api/Functions/BoostChat.cs @@ -0,0 +1,55 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Boosts a chat and returns the list of available chat boost slots for the current user after the boost + /// + public class BoostChat : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "boostChat"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of the chat + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_id")] + public long ChatId { get; set; } + + /// + /// Identifiers of boost slots of the current user from which to apply boosts to the chat + /// + [JsonProperty("slot_ids", ItemConverterType = typeof(Converter))] + public int[] SlotIds { get; set; } + } + + /// + /// Boosts a chat and returns the list of available chat boost slots for the current user after the boost + /// + public static Task BoostChatAsync( + this Client client, long chatId = default, int[] slotIds = default) + { + return client.ExecuteAsync(new BoostChat + { + ChatId = chatId, SlotIds = slotIds + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/CanBotSendMessages.cs b/TdLib.Api/Functions/CanBotSendMessages.cs new file mode 100644 index 00000000..c25331ee --- /dev/null +++ b/TdLib.Api/Functions/CanBotSendMessages.cs @@ -0,0 +1,49 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Checks whether the specified bot can send messages to the user. Returns a 404 error if can't and the access can be granted by call to allowBotToSendMessages + /// + public class CanBotSendMessages : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "canBotSendMessages"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of the target bot + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("bot_user_id")] + public long BotUserId { get; set; } + } + + /// + /// Checks whether the specified bot can send messages to the user. Returns a 404 error if can't and the access can be granted by call to allowBotToSendMessages + /// + public static Task CanBotSendMessagesAsync( + this Client client, long botUserId = default) + { + return client.ExecuteAsync(new CanBotSendMessages + { + BotUserId = botUserId + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/SendChatScreenshotTakenNotification.cs b/TdLib.Api/Functions/CanSendStory.cs similarity index 64% rename from TdLib.Api/Functions/SendChatScreenshotTakenNotification.cs rename to TdLib.Api/Functions/CanSendStory.cs index 025c83d4..820424e5 100644 --- a/TdLib.Api/Functions/SendChatScreenshotTakenNotification.cs +++ b/TdLib.Api/Functions/CanSendStory.cs @@ -10,15 +10,15 @@ namespace TdLib public static partial class TdApi { /// - /// Sends a notification about a screenshot taken in a chat. Supported only in private and secret chats + /// Checks whether the current user can send a story on behalf of a chat; requires can_post_stories rights for channel chats /// - public class SendChatScreenshotTakenNotification : Function + public class CanSendStory : Function { /// /// Data type for serialization /// [JsonProperty("@type")] - public override string DataType { get; set; } = "sendChatScreenshotTakenNotification"; + public override string DataType { get; set; } = "canSendStory"; /// /// Extra data attached to the function @@ -35,12 +35,12 @@ public class SendChatScreenshotTakenNotification : Function } /// - /// Sends a notification about a screenshot taken in a chat. Supported only in private and secret chats + /// Checks whether the current user can send a story on behalf of a chat; requires can_post_stories rights for channel chats /// - public static Task SendChatScreenshotTakenNotificationAsync( + public static Task CanSendStoryAsync( this Client client, long chatId = default) { - return client.ExecuteAsync(new SendChatScreenshotTakenNotification + return client.ExecuteAsync(new CanSendStory { ChatId = chatId }); diff --git a/TdLib.Api/Functions/ChangePhoneNumber.cs b/TdLib.Api/Functions/ChangePhoneNumber.cs index ce47cd32..423a273d 100644 --- a/TdLib.Api/Functions/ChangePhoneNumber.cs +++ b/TdLib.Api/Functions/ChangePhoneNumber.cs @@ -10,7 +10,7 @@ namespace TdLib public static partial class TdApi { /// - /// Changes the phone number of the user and sends an authentication code to the user's new phone number. On success, returns information about the sent code + /// Changes the phone number of the user and sends an authentication code to the user's new phone number; for official Android and iOS applications only. On success, returns information about the sent code /// public class ChangePhoneNumber : Function { @@ -42,7 +42,7 @@ public class ChangePhoneNumber : Function } /// - /// Changes the phone number of the user and sends an authentication code to the user's new phone number. On success, returns information about the sent code + /// Changes the phone number of the user and sends an authentication code to the user's new phone number; for official Android and iOS applications only. On success, returns information about the sent code /// public static Task ChangePhoneNumberAsync( this Client client, string phoneNumber = default, PhoneNumberAuthenticationSettings settings = default) diff --git a/TdLib.Api/Functions/CheckChatFolderInviteLink.cs b/TdLib.Api/Functions/CheckChatFolderInviteLink.cs new file mode 100644 index 00000000..2472b270 --- /dev/null +++ b/TdLib.Api/Functions/CheckChatFolderInviteLink.cs @@ -0,0 +1,49 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Checks the validity of an invite link for a chat folder and returns information about the corresponding chat folder + /// + public class CheckChatFolderInviteLink : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "checkChatFolderInviteLink"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Invite link to be checked + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("invite_link")] + public string InviteLink { get; set; } + } + + /// + /// Checks the validity of an invite link for a chat folder and returns information about the corresponding chat folder + /// + public static Task CheckChatFolderInviteLinkAsync( + this Client client, string inviteLink = default) + { + return client.ExecuteAsync(new CheckChatFolderInviteLink + { + InviteLink = inviteLink + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/CheckChatUsername.cs b/TdLib.Api/Functions/CheckChatUsername.cs index df7cbfa4..3d55faa1 100644 --- a/TdLib.Api/Functions/CheckChatUsername.cs +++ b/TdLib.Api/Functions/CheckChatUsername.cs @@ -27,7 +27,7 @@ public class CheckChatUsername : Function public override string Extra { get; set; } /// - /// Chat identifier; must be identifier of a supergroup chat, or a channel chat, or a private chat with self, or zero if the chat is being created + /// Chat identifier; must be identifier of a supergroup chat, or a channel chat, or a private chat with self, or 0 if the chat is being created /// [JsonConverter(typeof(Converter))] [JsonProperty("chat_id")] diff --git a/TdLib.Api/Functions/CheckPremiumGiftCode.cs b/TdLib.Api/Functions/CheckPremiumGiftCode.cs new file mode 100644 index 00000000..a7e3ab31 --- /dev/null +++ b/TdLib.Api/Functions/CheckPremiumGiftCode.cs @@ -0,0 +1,49 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Return information about a Telegram Premium gift code + /// + public class CheckPremiumGiftCode : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "checkPremiumGiftCode"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// The code to check + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("code")] + public string Code { get; set; } + } + + /// + /// Return information about a Telegram Premium gift code + /// + public static Task CheckPremiumGiftCodeAsync( + this Client client, string code = default) + { + return client.ExecuteAsync(new CheckPremiumGiftCode + { + Code = code + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/ClickChatSponsoredMessage.cs b/TdLib.Api/Functions/ClickChatSponsoredMessage.cs new file mode 100644 index 00000000..dd4611b3 --- /dev/null +++ b/TdLib.Api/Functions/ClickChatSponsoredMessage.cs @@ -0,0 +1,56 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Informs TDLib that the user opened the sponsored chat via the button, the name, the photo, or a mention in the sponsored message + /// + public class ClickChatSponsoredMessage : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "clickChatSponsoredMessage"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Chat identifier of the sponsored message + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_id")] + public long ChatId { get; set; } + + /// + /// Identifier of the sponsored message + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("message_id")] + public long MessageId { get; set; } + } + + /// + /// Informs TDLib that the user opened the sponsored chat via the button, the name, the photo, or a mention in the sponsored message + /// + public static Task ClickChatSponsoredMessageAsync( + this Client client, long chatId = default, long messageId = default) + { + return client.ExecuteAsync(new ClickChatSponsoredMessage + { + ChatId = chatId, MessageId = messageId + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/CloseStory.cs b/TdLib.Api/Functions/CloseStory.cs new file mode 100644 index 00000000..cd1c857c --- /dev/null +++ b/TdLib.Api/Functions/CloseStory.cs @@ -0,0 +1,56 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Informs TDLib that a story is closed by the user + /// + public class CloseStory : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "closeStory"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// The identifier of the sender of the story to close + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_sender_chat_id")] + public long StorySenderChatId { get; set; } + + /// + /// The identifier of the story + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_id")] + public int StoryId { get; set; } + } + + /// + /// Informs TDLib that a story is closed by the user + /// + public static Task CloseStoryAsync( + this Client client, long storySenderChatId = default, int storyId = default) + { + return client.ExecuteAsync(new CloseStory + { + StorySenderChatId = storySenderChatId, StoryId = storyId + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/ConfirmSession.cs b/TdLib.Api/Functions/ConfirmSession.cs new file mode 100644 index 00000000..331d017d --- /dev/null +++ b/TdLib.Api/Functions/ConfirmSession.cs @@ -0,0 +1,49 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Confirms an unconfirmed session of the current user from another device + /// + public class ConfirmSession : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "confirmSession"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Session identifier + /// + [JsonConverter(typeof(Converter.Int64))] + [JsonProperty("session_id")] + public long SessionId { get; set; } + } + + /// + /// Confirms an unconfirmed session of the current user from another device + /// + public static Task ConfirmSessionAsync( + this Client client, long sessionId = default) + { + return client.ExecuteAsync(new ConfirmSession + { + SessionId = sessionId + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/CreateChatFilter.cs b/TdLib.Api/Functions/CreateChatFolder.cs similarity index 52% rename from TdLib.Api/Functions/CreateChatFilter.cs rename to TdLib.Api/Functions/CreateChatFolder.cs index 9cf8a4ff..05d2a5a3 100644 --- a/TdLib.Api/Functions/CreateChatFilter.cs +++ b/TdLib.Api/Functions/CreateChatFolder.cs @@ -10,15 +10,15 @@ namespace TdLib public static partial class TdApi { /// - /// Creates new chat filter. Returns information about the created chat filter. There can be up to getOption("chat_filter_count_max") chat filters, but the limit can be increased with Telegram Premium + /// Creates new chat folder. Returns information about the created chat folder. There can be up to getOption("chat_folder_count_max") chat folders, but the limit can be increased with Telegram Premium /// - public class CreateChatFilter : Function + public class CreateChatFolder : Function { /// /// Data type for serialization /// [JsonProperty("@type")] - public override string DataType { get; set; } = "createChatFilter"; + public override string DataType { get; set; } = "createChatFolder"; /// /// Extra data attached to the function @@ -27,22 +27,22 @@ public class CreateChatFilter : Function public override string Extra { get; set; } /// - /// Chat filter + /// The new chat folder /// [JsonConverter(typeof(Converter))] - [JsonProperty("filter")] - public ChatFilter Filter { get; set; } + [JsonProperty("folder")] + public ChatFolder Folder { get; set; } } /// - /// Creates new chat filter. Returns information about the created chat filter. There can be up to getOption("chat_filter_count_max") chat filters, but the limit can be increased with Telegram Premium + /// Creates new chat folder. Returns information about the created chat folder. There can be up to getOption("chat_folder_count_max") chat folders, but the limit can be increased with Telegram Premium /// - public static Task CreateChatFilterAsync( - this Client client, ChatFilter filter = default) + public static Task CreateChatFolderAsync( + this Client client, ChatFolder folder = default) { - return client.ExecuteAsync(new CreateChatFilter + return client.ExecuteAsync(new CreateChatFolder { - Filter = filter + Folder = folder }); } } diff --git a/TdLib.Api/Functions/CreateChatFolderInviteLink.cs b/TdLib.Api/Functions/CreateChatFolderInviteLink.cs new file mode 100644 index 00000000..441986c0 --- /dev/null +++ b/TdLib.Api/Functions/CreateChatFolderInviteLink.cs @@ -0,0 +1,62 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Creates a new invite link for a chat folder. A link can be created for a chat folder if it has only pinned and included chats + /// + public class CreateChatFolderInviteLink : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "createChatFolderInviteLink"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Chat folder identifier + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_folder_id")] + public int ChatFolderId { get; set; } + + /// + /// Name of the link; 0-32 characters + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("name")] + public string Name { get; set; } + + /// + /// Identifiers of chats to be accessible by the invite link. Use getChatsForChatFolderInviteLink to get suitable chats. Basic groups will be automatically converted to supergroups before link creation + /// + [JsonProperty("chat_ids", ItemConverterType = typeof(Converter))] + public long[] ChatIds { get; set; } + } + + /// + /// Creates a new invite link for a chat folder. A link can be created for a chat folder if it has only pinned and included chats + /// + public static Task CreateChatFolderInviteLinkAsync( + this Client client, int chatFolderId = default, string name = default, long[] chatIds = default) + { + return client.ExecuteAsync(new CreateChatFolderInviteLink + { + ChatFolderId = chatFolderId, Name = name, ChatIds = chatIds + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/CreateNewSupergroupChat.cs b/TdLib.Api/Functions/CreateNewSupergroupChat.cs index 3b610897..b6d5c2e1 100644 --- a/TdLib.Api/Functions/CreateNewSupergroupChat.cs +++ b/TdLib.Api/Functions/CreateNewSupergroupChat.cs @@ -69,7 +69,7 @@ public class CreateNewSupergroupChat : Function public int MessageAutoDeleteTime { get; set; } /// - /// Pass true to create a supergroup for importing messages using importMessage + /// Pass true to create a supergroup for importing messages using importMessages /// [JsonConverter(typeof(Converter))] [JsonProperty("for_import")] diff --git a/TdLib.Api/Functions/DeleteChatFolder.cs b/TdLib.Api/Functions/DeleteChatFolder.cs new file mode 100644 index 00000000..7ea8f491 --- /dev/null +++ b/TdLib.Api/Functions/DeleteChatFolder.cs @@ -0,0 +1,55 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Deletes existing chat folder + /// + public class DeleteChatFolder : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "deleteChatFolder"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Chat folder identifier + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_folder_id")] + public int ChatFolderId { get; set; } + + /// + /// Identifiers of the chats to leave. The chats must be pinned or always included in the folder + /// + [JsonProperty("leave_chat_ids", ItemConverterType = typeof(Converter))] + public long[] LeaveChatIds { get; set; } + } + + /// + /// Deletes existing chat folder + /// + public static Task DeleteChatFolderAsync( + this Client client, int chatFolderId = default, long[] leaveChatIds = default) + { + return client.ExecuteAsync(new DeleteChatFolder + { + ChatFolderId = chatFolderId, LeaveChatIds = leaveChatIds + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/DeleteChatFolderInviteLink.cs b/TdLib.Api/Functions/DeleteChatFolderInviteLink.cs new file mode 100644 index 00000000..6643ef6d --- /dev/null +++ b/TdLib.Api/Functions/DeleteChatFolderInviteLink.cs @@ -0,0 +1,56 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Deletes an invite link for a chat folder + /// + public class DeleteChatFolderInviteLink : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "deleteChatFolderInviteLink"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Chat folder identifier + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_folder_id")] + public int ChatFolderId { get; set; } + + /// + /// Invite link to be deleted + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("invite_link")] + public string InviteLink { get; set; } + } + + /// + /// Deletes an invite link for a chat folder + /// + public static Task DeleteChatFolderInviteLinkAsync( + this Client client, int chatFolderId = default, string inviteLink = default) + { + return client.ExecuteAsync(new DeleteChatFolderInviteLink + { + ChatFolderId = chatFolderId, InviteLink = inviteLink + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/DeleteStory.cs b/TdLib.Api/Functions/DeleteStory.cs new file mode 100644 index 00000000..df81128c --- /dev/null +++ b/TdLib.Api/Functions/DeleteStory.cs @@ -0,0 +1,56 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Deletes a previously sent story. Can be called only if story.can_be_deleted == true + /// + public class DeleteStory : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "deleteStory"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of the chat that posted the story + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_sender_chat_id")] + public long StorySenderChatId { get; set; } + + /// + /// Identifier of the story to delete + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_id")] + public int StoryId { get; set; } + } + + /// + /// Deletes a previously sent story. Can be called only if story.can_be_deleted == true + /// + public static Task DeleteStoryAsync( + this Client client, long storySenderChatId = default, int storyId = default) + { + return client.ExecuteAsync(new DeleteStory + { + StorySenderChatId = storySenderChatId, StoryId = storyId + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/EditChatFilter.cs b/TdLib.Api/Functions/EditChatFolder.cs similarity index 55% rename from TdLib.Api/Functions/EditChatFilter.cs rename to TdLib.Api/Functions/EditChatFolder.cs index 1cb2affb..5ae1168b 100644 --- a/TdLib.Api/Functions/EditChatFilter.cs +++ b/TdLib.Api/Functions/EditChatFolder.cs @@ -10,15 +10,15 @@ namespace TdLib public static partial class TdApi { /// - /// Edits existing chat filter. Returns information about the edited chat filter + /// Edits existing chat folder. Returns information about the edited chat folder /// - public class EditChatFilter : Function + public class EditChatFolder : Function { /// /// Data type for serialization /// [JsonProperty("@type")] - public override string DataType { get; set; } = "editChatFilter"; + public override string DataType { get; set; } = "editChatFolder"; /// /// Extra data attached to the function @@ -27,29 +27,29 @@ public class EditChatFilter : Function public override string Extra { get; set; } /// - /// Chat filter identifier + /// Chat folder identifier /// [JsonConverter(typeof(Converter))] - [JsonProperty("chat_filter_id")] - public int ChatFilterId { get; set; } + [JsonProperty("chat_folder_id")] + public int ChatFolderId { get; set; } /// - /// The edited chat filter + /// The edited chat folder /// [JsonConverter(typeof(Converter))] - [JsonProperty("filter")] - public ChatFilter Filter { get; set; } + [JsonProperty("folder")] + public ChatFolder Folder { get; set; } } /// - /// Edits existing chat filter. Returns information about the edited chat filter + /// Edits existing chat folder. Returns information about the edited chat folder /// - public static Task EditChatFilterAsync( - this Client client, int chatFilterId = default, ChatFilter filter = default) + public static Task EditChatFolderAsync( + this Client client, int chatFolderId = default, ChatFolder folder = default) { - return client.ExecuteAsync(new EditChatFilter + return client.ExecuteAsync(new EditChatFolder { - ChatFilterId = chatFilterId, Filter = filter + ChatFolderId = chatFolderId, Folder = folder }); } } diff --git a/TdLib.Api/Functions/EditChatFolderInviteLink.cs b/TdLib.Api/Functions/EditChatFolderInviteLink.cs new file mode 100644 index 00000000..25cee6ce --- /dev/null +++ b/TdLib.Api/Functions/EditChatFolderInviteLink.cs @@ -0,0 +1,69 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Edits an invite link for a chat folder + /// + public class EditChatFolderInviteLink : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "editChatFolderInviteLink"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Chat folder identifier + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_folder_id")] + public int ChatFolderId { get; set; } + + /// + /// Invite link to be edited + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("invite_link")] + public string InviteLink { get; set; } + + /// + /// New name of the link; 0-32 characters + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("name")] + public string Name { get; set; } + + /// + /// New identifiers of chats to be accessible by the invite link. Use getChatsForChatFolderInviteLink to get suitable chats. Basic groups will be automatically converted to supergroups before link editing + /// + [JsonProperty("chat_ids", ItemConverterType = typeof(Converter))] + public long[] ChatIds { get; set; } + } + + /// + /// Edits an invite link for a chat folder + /// + public static Task EditChatFolderInviteLinkAsync( + this Client client, int chatFolderId = default, string inviteLink = default, string name = default, long[] chatIds = default) + { + return client.ExecuteAsync(new EditChatFolderInviteLink + { + ChatFolderId = chatFolderId, InviteLink = inviteLink, Name = name, ChatIds = chatIds + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/EditProxy.cs b/TdLib.Api/Functions/EditProxy.cs index 9fb24ae0..36fbb299 100644 --- a/TdLib.Api/Functions/EditProxy.cs +++ b/TdLib.Api/Functions/EditProxy.cs @@ -34,7 +34,7 @@ public class EditProxy : Function public int ProxyId { get; set; } /// - /// Proxy server IP address + /// Proxy server domain or IP address /// [JsonConverter(typeof(Converter))] [JsonProperty("server")] diff --git a/TdLib.Api/Functions/EditStory.cs b/TdLib.Api/Functions/EditStory.cs new file mode 100644 index 00000000..4a0e4607 --- /dev/null +++ b/TdLib.Api/Functions/EditStory.cs @@ -0,0 +1,77 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Changes content and caption of a story. Can be called only if story.can_be_edited == true + /// + public class EditStory : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "editStory"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of the chat that posted the story + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_sender_chat_id")] + public long StorySenderChatId { get; set; } + + /// + /// Identifier of the story to edit + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_id")] + public int StoryId { get; set; } + + /// + /// New content of the story; pass null to keep the current content + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("content")] + public InputStoryContent Content { get; set; } + + /// + /// New clickable rectangle areas to be shown on the story media; pass null to keep the current areas. Areas can't be edited if story content isn't changed + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("areas")] + public InputStoryAreas Areas { get; set; } + + /// + /// New story caption; pass null to keep the current caption + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("caption")] + public FormattedText Caption { get; set; } + } + + /// + /// Changes content and caption of a story. Can be called only if story.can_be_edited == true + /// + public static Task EditStoryAsync( + this Client client, long storySenderChatId = default, int storyId = default, InputStoryContent content = default, InputStoryAreas areas = default, FormattedText caption = default) + { + return client.ExecuteAsync(new EditStory + { + StorySenderChatId = storySenderChatId, StoryId = storyId, Content = content, Areas = areas, Caption = caption + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/ForwardMessages.cs b/TdLib.Api/Functions/ForwardMessages.cs index 38a93c07..998c4079 100644 --- a/TdLib.Api/Functions/ForwardMessages.cs +++ b/TdLib.Api/Functions/ForwardMessages.cs @@ -48,7 +48,7 @@ public class ForwardMessages : Function public long FromChatId { get; set; } /// - /// Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order. At most 100 messages can be forwarded simultaneously + /// Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order. At most 100 messages can be forwarded simultaneously. A message can be forwarded only if message.can_be_forwarded /// [JsonProperty("message_ids", ItemConverterType = typeof(Converter))] public long[] MessageIds { get; set; } @@ -73,24 +73,17 @@ public class ForwardMessages : Function [JsonConverter(typeof(Converter))] [JsonProperty("remove_caption")] public bool RemoveCaption { get; set; } - - /// - /// Pass true to get fake messages instead of actually forwarding them - /// - [JsonConverter(typeof(Converter))] - [JsonProperty("only_preview")] - public bool OnlyPreview { get; set; } } /// /// Forwards previously sent messages. Returns the forwarded messages in the same order as the message identifiers passed in message_ids. If a message can't be forwarded, null will be returned instead of the message /// public static Task ForwardMessagesAsync( - this Client client, long chatId = default, long messageThreadId = default, long fromChatId = default, long[] messageIds = default, MessageSendOptions options = default, bool sendCopy = default, bool removeCaption = default, bool onlyPreview = default) + this Client client, long chatId = default, long messageThreadId = default, long fromChatId = default, long[] messageIds = default, MessageSendOptions options = default, bool sendCopy = default, bool removeCaption = default) { return client.ExecuteAsync(new ForwardMessages { - ChatId = chatId, MessageThreadId = messageThreadId, FromChatId = fromChatId, MessageIds = messageIds, Options = options, SendCopy = sendCopy, RemoveCaption = removeCaption, OnlyPreview = onlyPreview + ChatId = chatId, MessageThreadId = messageThreadId, FromChatId = fromChatId, MessageIds = messageIds, Options = options, SendCopy = sendCopy, RemoveCaption = removeCaption }); } } diff --git a/TdLib.Api/Functions/GetAllStickerEmojis.cs b/TdLib.Api/Functions/GetAllStickerEmojis.cs new file mode 100644 index 00000000..4324b133 --- /dev/null +++ b/TdLib.Api/Functions/GetAllStickerEmojis.cs @@ -0,0 +1,70 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Returns unique emoji that correspond to stickers to be found by the getStickers(sticker_type, query, 1000000, chat_id) + /// + public class GetAllStickerEmojis : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "getAllStickerEmojis"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Type of the stickers to search for + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("sticker_type")] + public StickerType StickerType { get; set; } + + /// + /// Search query + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("query")] + public string Query { get; set; } + + /// + /// Chat identifier for which to find stickers + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_id")] + public long ChatId { get; set; } + + /// + /// Pass true if only main emoji for each found sticker must be included in the result + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("return_only_main_emoji")] + public bool ReturnOnlyMainEmoji { get; set; } + } + + /// + /// Returns unique emoji that correspond to stickers to be found by the getStickers(sticker_type, query, 1000000, chat_id) + /// + public static Task GetAllStickerEmojisAsync( + this Client client, StickerType stickerType = default, string query = default, long chatId = default, bool returnOnlyMainEmoji = default) + { + return client.ExecuteAsync(new GetAllStickerEmojis + { + StickerType = stickerType, Query = query, ChatId = chatId, ReturnOnlyMainEmoji = returnOnlyMainEmoji + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/GetArchiveChatListSettings.cs b/TdLib.Api/Functions/GetArchiveChatListSettings.cs new file mode 100644 index 00000000..1ab3a2ad --- /dev/null +++ b/TdLib.Api/Functions/GetArchiveChatListSettings.cs @@ -0,0 +1,44 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Returns settings for automatic moving of chats to and from the Archive chat lists + /// + public class GetArchiveChatListSettings : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "getArchiveChatListSettings"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + + /// + /// Returns settings for automatic moving of chats to and from the Archive chat lists + /// + public static Task GetArchiveChatListSettingsAsync( + this Client client) + { + return client.ExecuteAsync(new GetArchiveChatListSettings + { + + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/GetAttachmentMenuBot.cs b/TdLib.Api/Functions/GetAttachmentMenuBot.cs index af77a464..0cf2a839 100644 --- a/TdLib.Api/Functions/GetAttachmentMenuBot.cs +++ b/TdLib.Api/Functions/GetAttachmentMenuBot.cs @@ -10,7 +10,7 @@ namespace TdLib public static partial class TdApi { /// - /// Returns information about a bot that can be added to attachment menu + /// Returns information about a bot that can be added to attachment or side menu /// public class GetAttachmentMenuBot : Function { @@ -35,7 +35,7 @@ public class GetAttachmentMenuBot : Function } /// - /// Returns information about a bot that can be added to attachment menu + /// Returns information about a bot that can be added to attachment or side menu /// public static Task GetAttachmentMenuBotAsync( this Client client, long botUserId = default) diff --git a/TdLib.Api/Functions/GetAvailableChatBoostSlots.cs b/TdLib.Api/Functions/GetAvailableChatBoostSlots.cs new file mode 100644 index 00000000..112ed3d8 --- /dev/null +++ b/TdLib.Api/Functions/GetAvailableChatBoostSlots.cs @@ -0,0 +1,44 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Returns the list of available chat boost slots for the current user + /// + public class GetAvailableChatBoostSlots : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "getAvailableChatBoostSlots"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + + /// + /// Returns the list of available chat boost slots for the current user + /// + public static Task GetAvailableChatBoostSlotsAsync( + this Client client) + { + return client.ExecuteAsync(new GetAvailableChatBoostSlots + { + + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/GetBlockedMessageSenders.cs b/TdLib.Api/Functions/GetBlockedMessageSenders.cs index ae133b7e..61298a63 100644 --- a/TdLib.Api/Functions/GetBlockedMessageSenders.cs +++ b/TdLib.Api/Functions/GetBlockedMessageSenders.cs @@ -26,6 +26,13 @@ public class GetBlockedMessageSenders : Function [JsonProperty("@extra")] public override string Extra { get; set; } + /// + /// Block list from which to return users + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("block_list")] + public BlockList BlockList { get; set; } + /// /// Number of users and chats to skip in the result; must be non-negative /// @@ -45,11 +52,11 @@ public class GetBlockedMessageSenders : Function /// Returns users and chats that were blocked by the current user /// public static Task GetBlockedMessageSendersAsync( - this Client client, int offset = default, int limit = default) + this Client client, BlockList blockList = default, int offset = default, int limit = default) { return client.ExecuteAsync(new GetBlockedMessageSenders { - Offset = offset, Limit = limit + BlockList = blockList, Offset = offset, Limit = limit }); } } diff --git a/TdLib.Api/Functions/GetBotInfoDescription.cs b/TdLib.Api/Functions/GetBotInfoDescription.cs index d85e4425..2faac0fe 100644 --- a/TdLib.Api/Functions/GetBotInfoDescription.cs +++ b/TdLib.Api/Functions/GetBotInfoDescription.cs @@ -10,7 +10,7 @@ namespace TdLib public static partial class TdApi { /// - /// Returns the text shown in the chat with the bot if the chat is empty in the given language; bots only + /// Returns the text shown in the chat with a bot if the chat is empty in the given language. Can be called only if userTypeBot.can_be_edited == true /// public class GetBotInfoDescription : Function { @@ -26,6 +26,13 @@ public class GetBotInfoDescription : Function [JsonProperty("@extra")] public override string Extra { get; set; } + /// + /// Identifier of the target bot + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("bot_user_id")] + public long BotUserId { get; set; } + /// /// A two-letter ISO 639-1 language code or an empty string /// @@ -35,14 +42,14 @@ public class GetBotInfoDescription : Function } /// - /// Returns the text shown in the chat with the bot if the chat is empty in the given language; bots only + /// Returns the text shown in the chat with a bot if the chat is empty in the given language. Can be called only if userTypeBot.can_be_edited == true /// public static Task GetBotInfoDescriptionAsync( - this Client client, string languageCode = default) + this Client client, long botUserId = default, string languageCode = default) { return client.ExecuteAsync(new GetBotInfoDescription { - LanguageCode = languageCode + BotUserId = botUserId, LanguageCode = languageCode }); } } diff --git a/TdLib.Api/Functions/GetBotInfoShortDescription.cs b/TdLib.Api/Functions/GetBotInfoShortDescription.cs index a9f053e8..bed210af 100644 --- a/TdLib.Api/Functions/GetBotInfoShortDescription.cs +++ b/TdLib.Api/Functions/GetBotInfoShortDescription.cs @@ -10,7 +10,7 @@ namespace TdLib public static partial class TdApi { /// - /// Returns the text shown on the bot's profile page and sent together with the link when users share the bot in the given language; bots only + /// Returns the text shown on a bot's profile page and sent together with the link when users share the bot in the given language. Can be called only if userTypeBot.can_be_edited == true /// public class GetBotInfoShortDescription : Function { @@ -26,6 +26,13 @@ public class GetBotInfoShortDescription : Function [JsonProperty("@extra")] public override string Extra { get; set; } + /// + /// Identifier of the target bot + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("bot_user_id")] + public long BotUserId { get; set; } + /// /// A two-letter ISO 639-1 language code or an empty string /// @@ -35,14 +42,14 @@ public class GetBotInfoShortDescription : Function } /// - /// Returns the text shown on the bot's profile page and sent together with the link when users share the bot in the given language; bots only + /// Returns the text shown on a bot's profile page and sent together with the link when users share the bot in the given language. Can be called only if userTypeBot.can_be_edited == true /// public static Task GetBotInfoShortDescriptionAsync( - this Client client, string languageCode = default) + this Client client, long botUserId = default, string languageCode = default) { return client.ExecuteAsync(new GetBotInfoShortDescription { - LanguageCode = languageCode + BotUserId = botUserId, LanguageCode = languageCode }); } } diff --git a/TdLib.Api/Functions/GetBotName.cs b/TdLib.Api/Functions/GetBotName.cs new file mode 100644 index 00000000..ec5b69d5 --- /dev/null +++ b/TdLib.Api/Functions/GetBotName.cs @@ -0,0 +1,56 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Returns the name of a bot in the given language. Can be called only if userTypeBot.can_be_edited == true + /// + public class GetBotName : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "getBotName"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of the target bot + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("bot_user_id")] + public long BotUserId { get; set; } + + /// + /// A two-letter ISO 639-1 language code or an empty string + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("language_code")] + public string LanguageCode { get; set; } + } + + /// + /// Returns the name of a bot in the given language. Can be called only if userTypeBot.can_be_edited == true + /// + public static Task GetBotNameAsync( + this Client client, long botUserId = default, string languageCode = default) + { + return client.ExecuteAsync(new GetBotName + { + BotUserId = botUserId, LanguageCode = languageCode + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/GetChat.cs b/TdLib.Api/Functions/GetChat.cs index d5ee49e1..1c208f35 100644 --- a/TdLib.Api/Functions/GetChat.cs +++ b/TdLib.Api/Functions/GetChat.cs @@ -10,7 +10,7 @@ namespace TdLib public static partial class TdApi { /// - /// Returns information about a chat by its identifier, this is an offline request if the current user is not a bot + /// Returns information about a chat by its identifier; this is an offline request if the current user is not a bot /// public class GetChat : Function { @@ -35,7 +35,7 @@ public class GetChat : Function } /// - /// Returns information about a chat by its identifier, this is an offline request if the current user is not a bot + /// Returns information about a chat by its identifier; this is an offline request if the current user is not a bot /// public static Task GetChatAsync( this Client client, long chatId = default) diff --git a/TdLib.Api/Functions/GetChatActiveStories.cs b/TdLib.Api/Functions/GetChatActiveStories.cs new file mode 100644 index 00000000..8b84d7af --- /dev/null +++ b/TdLib.Api/Functions/GetChatActiveStories.cs @@ -0,0 +1,49 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Returns the list of active stories posted by the given chat + /// + public class GetChatActiveStories : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "getChatActiveStories"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Chat identifier + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_id")] + public long ChatId { get; set; } + } + + /// + /// Returns the list of active stories posted by the given chat + /// + public static Task GetChatActiveStoriesAsync( + this Client client, long chatId = default) + { + return client.ExecuteAsync(new GetChatActiveStories + { + ChatId = chatId + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/GetChatArchivedStories.cs b/TdLib.Api/Functions/GetChatArchivedStories.cs new file mode 100644 index 00000000..67789a07 --- /dev/null +++ b/TdLib.Api/Functions/GetChatArchivedStories.cs @@ -0,0 +1,65 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Returns the list of all stories posted by the given chat; requires can_edit_stories rights for channel chats. + /// The stories are returned in a reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of returned stories is chosen by TDLib + /// + public class GetChatArchivedStories : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "getChatArchivedStories"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Chat identifier + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_id")] + public long ChatId { get; set; } + + /// + /// Identifier of the story starting from which stories must be returned; use 0 to get results from the last story + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("from_story_id")] + public int FromStoryId { get; set; } + + /// + /// The maximum number of stories to be returned + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("limit")] + public int Limit { get; set; } + } + + /// + /// Returns the list of all stories posted by the given chat; requires can_edit_stories rights for channel chats. + /// The stories are returned in a reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of returned stories is chosen by TDLib + /// + public static Task GetChatArchivedStoriesAsync( + this Client client, long chatId = default, int fromStoryId = default, int limit = default) + { + return client.ExecuteAsync(new GetChatArchivedStories + { + ChatId = chatId, FromStoryId = fromStoryId, Limit = limit + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/GetChatBoostLink.cs b/TdLib.Api/Functions/GetChatBoostLink.cs new file mode 100644 index 00000000..e91b7566 --- /dev/null +++ b/TdLib.Api/Functions/GetChatBoostLink.cs @@ -0,0 +1,49 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Returns an HTTPS link to boost the specified channel chat + /// + public class GetChatBoostLink : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "getChatBoostLink"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of the chat + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_id")] + public long ChatId { get; set; } + } + + /// + /// Returns an HTTPS link to boost the specified channel chat + /// + public static Task GetChatBoostLinkAsync( + this Client client, long chatId = default) + { + return client.ExecuteAsync(new GetChatBoostLink + { + ChatId = chatId + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/GetChatBoostLinkInfo.cs b/TdLib.Api/Functions/GetChatBoostLinkInfo.cs new file mode 100644 index 00000000..4319a892 --- /dev/null +++ b/TdLib.Api/Functions/GetChatBoostLinkInfo.cs @@ -0,0 +1,49 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Returns information about a link to boost a chat. Can be called for any internal link of the type internalLinkTypeChatBoost + /// + public class GetChatBoostLinkInfo : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "getChatBoostLinkInfo"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// The link to boost a chat + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("url")] + public string Url { get; set; } + } + + /// + /// Returns information about a link to boost a chat. Can be called for any internal link of the type internalLinkTypeChatBoost + /// + public static Task GetChatBoostLinkInfoAsync( + this Client client, string url = default) + { + return client.ExecuteAsync(new GetChatBoostLinkInfo + { + Url = url + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/GetChatBoostStatus.cs b/TdLib.Api/Functions/GetChatBoostStatus.cs new file mode 100644 index 00000000..534f6b66 --- /dev/null +++ b/TdLib.Api/Functions/GetChatBoostStatus.cs @@ -0,0 +1,49 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Returns the current boost status for a channel chat + /// + public class GetChatBoostStatus : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "getChatBoostStatus"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of the channel chat + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_id")] + public long ChatId { get; set; } + } + + /// + /// Returns the current boost status for a channel chat + /// + public static Task GetChatBoostStatusAsync( + this Client client, long chatId = default) + { + return client.ExecuteAsync(new GetChatBoostStatus + { + ChatId = chatId + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/GetChatBoosts.cs b/TdLib.Api/Functions/GetChatBoosts.cs new file mode 100644 index 00000000..33b4d1f8 --- /dev/null +++ b/TdLib.Api/Functions/GetChatBoosts.cs @@ -0,0 +1,70 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Returns list of boosts applied to a chat; requires administrator rights in the channel chat + /// + public class GetChatBoosts : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "getChatBoosts"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of the chat + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_id")] + public long ChatId { get; set; } + + /// + /// Pass true to receive only boosts received from gift codes and giveaways created by the chat + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("only_gift_codes")] + public bool OnlyGiftCodes { get; set; } + + /// + /// Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("offset")] + public string Offset { get; set; } + + /// + /// The maximum number of boosts to be returned; up to 100. For optimal performance, the number of returned boosts can be smaller than the specified limit + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("limit")] + public int Limit { get; set; } + } + + /// + /// Returns list of boosts applied to a chat; requires administrator rights in the channel chat + /// + public static Task GetChatBoostsAsync( + this Client client, long chatId = default, bool onlyGiftCodes = default, string offset = default, int limit = default) + { + return client.ExecuteAsync(new GetChatBoosts + { + ChatId = chatId, OnlyGiftCodes = onlyGiftCodes, Offset = offset, Limit = limit + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/GetChatFilter.cs b/TdLib.Api/Functions/GetChatFolder.cs similarity index 61% rename from TdLib.Api/Functions/GetChatFilter.cs rename to TdLib.Api/Functions/GetChatFolder.cs index 707bea03..d7e95a7f 100644 --- a/TdLib.Api/Functions/GetChatFilter.cs +++ b/TdLib.Api/Functions/GetChatFolder.cs @@ -10,15 +10,15 @@ namespace TdLib public static partial class TdApi { /// - /// Returns information about a chat filter by its identifier + /// Returns information about a chat folder by its identifier /// - public class GetChatFilter : Function + public class GetChatFolder : Function { /// /// Data type for serialization /// [JsonProperty("@type")] - public override string DataType { get; set; } = "getChatFilter"; + public override string DataType { get; set; } = "getChatFolder"; /// /// Extra data attached to the function @@ -27,22 +27,22 @@ public class GetChatFilter : Function public override string Extra { get; set; } /// - /// Chat filter identifier + /// Chat folder identifier /// [JsonConverter(typeof(Converter))] - [JsonProperty("chat_filter_id")] - public int ChatFilterId { get; set; } + [JsonProperty("chat_folder_id")] + public int ChatFolderId { get; set; } } /// - /// Returns information about a chat filter by its identifier + /// Returns information about a chat folder by its identifier /// - public static Task GetChatFilterAsync( - this Client client, int chatFilterId = default) + public static Task GetChatFolderAsync( + this Client client, int chatFolderId = default) { - return client.ExecuteAsync(new GetChatFilter + return client.ExecuteAsync(new GetChatFolder { - ChatFilterId = chatFilterId + ChatFolderId = chatFolderId }); } } diff --git a/TdLib.Api/Functions/GetChatFolderChatCount.cs b/TdLib.Api/Functions/GetChatFolderChatCount.cs new file mode 100644 index 00000000..10b6dff6 --- /dev/null +++ b/TdLib.Api/Functions/GetChatFolderChatCount.cs @@ -0,0 +1,49 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Returns approximate number of chats in a being created chat folder. Main and archive chat lists must be fully preloaded for this function to work correctly + /// + public class GetChatFolderChatCount : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "getChatFolderChatCount"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// The new chat folder + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("folder")] + public ChatFolder Folder { get; set; } + } + + /// + /// Returns approximate number of chats in a being created chat folder. Main and archive chat lists must be fully preloaded for this function to work correctly + /// + public static Task GetChatFolderChatCountAsync( + this Client client, ChatFolder folder = default) + { + return client.ExecuteAsync(new GetChatFolderChatCount + { + Folder = folder + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/GetChatFolderChatsToLeave.cs b/TdLib.Api/Functions/GetChatFolderChatsToLeave.cs new file mode 100644 index 00000000..7be4f07f --- /dev/null +++ b/TdLib.Api/Functions/GetChatFolderChatsToLeave.cs @@ -0,0 +1,49 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Returns identifiers of pinned or always included chats from a chat folder, which are suggested to be left when the chat folder is deleted + /// + public class GetChatFolderChatsToLeave : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "getChatFolderChatsToLeave"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Chat folder identifier + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_folder_id")] + public int ChatFolderId { get; set; } + } + + /// + /// Returns identifiers of pinned or always included chats from a chat folder, which are suggested to be left when the chat folder is deleted + /// + public static Task GetChatFolderChatsToLeaveAsync( + this Client client, int chatFolderId = default) + { + return client.ExecuteAsync(new GetChatFolderChatsToLeave + { + ChatFolderId = chatFolderId + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/GetChatFilterDefaultIconName.cs b/TdLib.Api/Functions/GetChatFolderDefaultIconName.cs similarity index 60% rename from TdLib.Api/Functions/GetChatFilterDefaultIconName.cs rename to TdLib.Api/Functions/GetChatFolderDefaultIconName.cs index 82e0b77e..96a74e8d 100644 --- a/TdLib.Api/Functions/GetChatFilterDefaultIconName.cs +++ b/TdLib.Api/Functions/GetChatFolderDefaultIconName.cs @@ -10,15 +10,15 @@ namespace TdLib public static partial class TdApi { /// - /// Returns default icon name for a filter. Can be called synchronously + /// Returns default icon name for a folder. Can be called synchronously /// - public class GetChatFilterDefaultIconName : Function + public class GetChatFolderDefaultIconName : Function { /// /// Data type for serialization /// [JsonProperty("@type")] - public override string DataType { get; set; } = "getChatFilterDefaultIconName"; + public override string DataType { get; set; } = "getChatFolderDefaultIconName"; /// /// Extra data attached to the function @@ -27,22 +27,22 @@ public class GetChatFilterDefaultIconName : Function public override string Extra { get; set; } /// - /// Chat filter + /// Chat folder /// [JsonConverter(typeof(Converter))] - [JsonProperty("filter")] - public ChatFilter Filter { get; set; } + [JsonProperty("folder")] + public ChatFolder Folder { get; set; } } /// - /// Returns default icon name for a filter. Can be called synchronously + /// Returns default icon name for a folder. Can be called synchronously /// - public static Task GetChatFilterDefaultIconNameAsync( - this Client client, ChatFilter filter = default) + public static Task GetChatFolderDefaultIconNameAsync( + this Client client, ChatFolder folder = default) { - return client.ExecuteAsync(new GetChatFilterDefaultIconName + return client.ExecuteAsync(new GetChatFolderDefaultIconName { - Filter = filter + Folder = folder }); } } diff --git a/TdLib.Api/Functions/GetChatFolderInviteLinks.cs b/TdLib.Api/Functions/GetChatFolderInviteLinks.cs new file mode 100644 index 00000000..de73e703 --- /dev/null +++ b/TdLib.Api/Functions/GetChatFolderInviteLinks.cs @@ -0,0 +1,49 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Returns invite links created by the current user for a shareable chat folder + /// + public class GetChatFolderInviteLinks : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "getChatFolderInviteLinks"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Chat folder identifier + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_folder_id")] + public int ChatFolderId { get; set; } + } + + /// + /// Returns invite links created by the current user for a shareable chat folder + /// + public static Task GetChatFolderInviteLinksAsync( + this Client client, int chatFolderId = default) + { + return client.ExecuteAsync(new GetChatFolderInviteLinks + { + ChatFolderId = chatFolderId + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/GetChatFolderNewChats.cs b/TdLib.Api/Functions/GetChatFolderNewChats.cs new file mode 100644 index 00000000..741d4d8c --- /dev/null +++ b/TdLib.Api/Functions/GetChatFolderNewChats.cs @@ -0,0 +1,49 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Returns new chats added to a shareable chat folder by its owner. The method must be called at most once in getOption("chat_folder_new_chats_update_period") for the given chat folder + /// + public class GetChatFolderNewChats : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "getChatFolderNewChats"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Chat folder identifier + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_folder_id")] + public int ChatFolderId { get; set; } + } + + /// + /// Returns new chats added to a shareable chat folder by its owner. The method must be called at most once in getOption("chat_folder_new_chats_update_period") for the given chat folder + /// + public static Task GetChatFolderNewChatsAsync( + this Client client, int chatFolderId = default) + { + return client.ExecuteAsync(new GetChatFolderNewChats + { + ChatFolderId = chatFolderId + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/GetChatNotificationSettingsExceptions.cs b/TdLib.Api/Functions/GetChatNotificationSettingsExceptions.cs index 69b7a779..d43edebc 100644 --- a/TdLib.Api/Functions/GetChatNotificationSettingsExceptions.cs +++ b/TdLib.Api/Functions/GetChatNotificationSettingsExceptions.cs @@ -10,7 +10,7 @@ namespace TdLib public static partial class TdApi { /// - /// Returns list of chats with non-default notification settings + /// Returns list of chats with non-default notification settings for new messages /// public class GetChatNotificationSettingsExceptions : Function { @@ -42,7 +42,7 @@ public class GetChatNotificationSettingsExceptions : Function } /// - /// Returns list of chats with non-default notification settings + /// Returns list of chats with non-default notification settings for new messages /// public static Task GetChatNotificationSettingsExceptionsAsync( this Client client, NotificationSettingsScope scope = default, bool compareSound = default) diff --git a/TdLib.Api/Functions/GetChatPinnedStories.cs b/TdLib.Api/Functions/GetChatPinnedStories.cs new file mode 100644 index 00000000..5300ccfa --- /dev/null +++ b/TdLib.Api/Functions/GetChatPinnedStories.cs @@ -0,0 +1,65 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Returns the list of pinned stories posted by the given chat. The stories are returned in a reverse chronological order (i.e., in order of decreasing story_id). + /// For optimal performance, the number of returned stories is chosen by TDLib + /// + public class GetChatPinnedStories : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "getChatPinnedStories"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Chat identifier + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_id")] + public long ChatId { get; set; } + + /// + /// Identifier of the story starting from which stories must be returned; use 0 to get results from the last story + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("from_story_id")] + public int FromStoryId { get; set; } + + /// + /// The maximum number of stories to be returned + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("limit")] + public int Limit { get; set; } + } + + /// + /// Returns the list of pinned stories posted by the given chat. The stories are returned in a reverse chronological order (i.e., in order of decreasing story_id). + /// For optimal performance, the number of returned stories is chosen by TDLib + /// + public static Task GetChatPinnedStoriesAsync( + this Client client, long chatId = default, int fromStoryId = default, int limit = default) + { + return client.ExecuteAsync(new GetChatPinnedStories + { + ChatId = chatId, FromStoryId = fromStoryId, Limit = limit + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/GetChatsForChatFolderInviteLink.cs b/TdLib.Api/Functions/GetChatsForChatFolderInviteLink.cs new file mode 100644 index 00000000..5ac17dbd --- /dev/null +++ b/TdLib.Api/Functions/GetChatsForChatFolderInviteLink.cs @@ -0,0 +1,49 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Returns identifiers of chats from a chat folder, suitable for adding to a chat folder invite link + /// + public class GetChatsForChatFolderInviteLink : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "getChatsForChatFolderInviteLink"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Chat folder identifier + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_folder_id")] + public int ChatFolderId { get; set; } + } + + /// + /// Returns identifiers of chats from a chat folder, suitable for adding to a chat folder invite link + /// + public static Task GetChatsForChatFolderInviteLinkAsync( + this Client client, int chatFolderId = default) + { + return client.ExecuteAsync(new GetChatsForChatFolderInviteLink + { + ChatFolderId = chatFolderId + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/GetChatsToSendStories.cs b/TdLib.Api/Functions/GetChatsToSendStories.cs new file mode 100644 index 00000000..5be41ee1 --- /dev/null +++ b/TdLib.Api/Functions/GetChatsToSendStories.cs @@ -0,0 +1,44 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Returns channel chats in which the current user has the right to post stories. The chats must be rechecked with canSendStory before actually trying to post a story there + /// + public class GetChatsToSendStories : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "getChatsToSendStories"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + + /// + /// Returns channel chats in which the current user has the right to post stories. The chats must be rechecked with canSendStory before actually trying to post a story there + /// + public static Task GetChatsToSendStoriesAsync( + this Client client) + { + return client.ExecuteAsync(new GetChatsToSendStories + { + + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/GetCloseFriends.cs b/TdLib.Api/Functions/GetCloseFriends.cs new file mode 100644 index 00000000..09ac147a --- /dev/null +++ b/TdLib.Api/Functions/GetCloseFriends.cs @@ -0,0 +1,44 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Returns all close friends of the current user + /// + public class GetCloseFriends : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "getCloseFriends"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + + /// + /// Returns all close friends of the current user + /// + public static Task GetCloseFriendsAsync( + this Client client) + { + return client.ExecuteAsync(new GetCloseFriends + { + + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/GetContacts.cs b/TdLib.Api/Functions/GetContacts.cs index abe9db1b..6a51ad27 100644 --- a/TdLib.Api/Functions/GetContacts.cs +++ b/TdLib.Api/Functions/GetContacts.cs @@ -10,7 +10,7 @@ namespace TdLib public static partial class TdApi { /// - /// Returns all user contacts + /// Returns all contacts of the user /// public class GetContacts : Function { @@ -30,7 +30,7 @@ public class GetContacts : Function } /// - /// Returns all user contacts + /// Returns all contacts of the user /// public static Task GetContactsAsync( this Client client) diff --git a/TdLib.Api/Functions/GetDefaultBackgroundCustomEmojiStickers.cs b/TdLib.Api/Functions/GetDefaultBackgroundCustomEmojiStickers.cs new file mode 100644 index 00000000..589b623e --- /dev/null +++ b/TdLib.Api/Functions/GetDefaultBackgroundCustomEmojiStickers.cs @@ -0,0 +1,44 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Returns default list of custom emoji stickers for reply background + /// + public class GetDefaultBackgroundCustomEmojiStickers : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "getDefaultBackgroundCustomEmojiStickers"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + + /// + /// Returns default list of custom emoji stickers for reply background + /// + public static Task GetDefaultBackgroundCustomEmojiStickersAsync( + this Client client) + { + return client.ExecuteAsync(new GetDefaultBackgroundCustomEmojiStickers + { + + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/GetInlineQueryResults.cs b/TdLib.Api/Functions/GetInlineQueryResults.cs index 4e754f9d..6cdfb633 100644 --- a/TdLib.Api/Functions/GetInlineQueryResults.cs +++ b/TdLib.Api/Functions/GetInlineQueryResults.cs @@ -27,7 +27,7 @@ public class GetInlineQueryResults : Function public override string Extra { get; set; } /// - /// The identifier of the target bot + /// Identifier of the target bot /// [JsonConverter(typeof(Converter))] [JsonProperty("bot_user_id")] @@ -55,7 +55,7 @@ public class GetInlineQueryResults : Function public string Query { get; set; } /// - /// Offset of the first entry to return + /// Offset of the first entry to return; use empty string to get the first chunk of results /// [JsonConverter(typeof(Converter))] [JsonProperty("offset")] diff --git a/TdLib.Api/Functions/GetMessageLink.cs b/TdLib.Api/Functions/GetMessageLink.cs index 280fc397..48dd0f0a 100644 --- a/TdLib.Api/Functions/GetMessageLink.cs +++ b/TdLib.Api/Functions/GetMessageLink.cs @@ -41,7 +41,7 @@ public class GetMessageLink : Function public long MessageId { get; set; } /// - /// If not 0, timestamp from which the video/audio/video note/voice note playing must start, in seconds. The media can be in the message content or in its web page preview + /// If not 0, timestamp from which the video/audio/video note/voice note/story playing must start, in seconds. The media can be in the message content or in its web page preview /// [JsonConverter(typeof(Converter))] [JsonProperty("media_timestamp")] diff --git a/TdLib.Api/Functions/GetMessagePublicForwards.cs b/TdLib.Api/Functions/GetMessagePublicForwards.cs index 0d7c0f15..b402fdda 100644 --- a/TdLib.Api/Functions/GetMessagePublicForwards.cs +++ b/TdLib.Api/Functions/GetMessagePublicForwards.cs @@ -10,7 +10,7 @@ namespace TdLib public static partial class TdApi { /// - /// Returns forwarded copies of a channel message to different public channels. For optimal performance, the number of returned messages is chosen by TDLib + /// Returns forwarded copies of a channel message to different public channels. Can be used only if message.can_get_statistics == true. For optimal performance, the number of returned messages is chosen by TDLib /// public class GetMessagePublicForwards : Function { @@ -56,7 +56,7 @@ public class GetMessagePublicForwards : Function } /// - /// Returns forwarded copies of a channel message to different public channels. For optimal performance, the number of returned messages is chosen by TDLib + /// Returns forwarded copies of a channel message to different public channels. Can be used only if message.can_get_statistics == true. For optimal performance, the number of returned messages is chosen by TDLib /// public static Task GetMessagePublicForwardsAsync( this Client client, long chatId = default, long messageId = default, string offset = default, int limit = default) diff --git a/TdLib.Api/Functions/GetPaymentForm.cs b/TdLib.Api/Functions/GetPaymentForm.cs index d1172653..c0c25260 100644 --- a/TdLib.Api/Functions/GetPaymentForm.cs +++ b/TdLib.Api/Functions/GetPaymentForm.cs @@ -10,7 +10,7 @@ namespace TdLib public static partial class TdApi { /// - /// Returns an invoice payment form. This method must be called when the user presses inlineKeyboardButtonBuy + /// Returns an invoice payment form. This method must be called when the user presses inline button of the type inlineKeyboardButtonTypeBuy /// public class GetPaymentForm : Function { @@ -42,7 +42,7 @@ public class GetPaymentForm : Function } /// - /// Returns an invoice payment form. This method must be called when the user presses inlineKeyboardButtonBuy + /// Returns an invoice payment form. This method must be called when the user presses inline button of the type inlineKeyboardButtonTypeBuy /// public static Task GetPaymentFormAsync( this Client client, InputInvoice inputInvoice = default, ThemeParameters theme = default) diff --git a/TdLib.Api/Functions/GetPollVoters.cs b/TdLib.Api/Functions/GetPollVoters.cs index 9711da72..d314f1ad 100644 --- a/TdLib.Api/Functions/GetPollVoters.cs +++ b/TdLib.Api/Functions/GetPollVoters.cs @@ -10,9 +10,9 @@ namespace TdLib public static partial class TdApi { /// - /// Returns users voted for the specified option in a non-anonymous polls. For optimal performance, the number of returned users is chosen by TDLib + /// Returns message senders voted for the specified option in a non-anonymous polls. For optimal performance, the number of returned users is chosen by TDLib /// - public class GetPollVoters : Function + public class GetPollVoters : Function { /// /// Data type for serialization @@ -48,14 +48,14 @@ public class GetPollVoters : Function public int OptionId { get; set; } /// - /// Number of users to skip in the result; must be non-negative + /// Number of voters to skip in the result; must be non-negative /// [JsonConverter(typeof(Converter))] [JsonProperty("offset")] public int Offset { get; set; } /// - /// The maximum number of users to be returned; must be positive and can't be greater than 50. For optimal performance, the number of returned users is chosen by TDLib and can be smaller than the specified limit, even if the end of the voter list has not been reached + /// The maximum number of voters to be returned; must be positive and can't be greater than 50. For optimal performance, the number of returned voters is chosen by TDLib and can be smaller than the specified limit, even if the end of the voter list has not been reached /// [JsonConverter(typeof(Converter))] [JsonProperty("limit")] @@ -63,9 +63,9 @@ public class GetPollVoters : Function } /// - /// Returns users voted for the specified option in a non-anonymous polls. For optimal performance, the number of returned users is chosen by TDLib + /// Returns message senders voted for the specified option in a non-anonymous polls. For optimal performance, the number of returned users is chosen by TDLib /// - public static Task GetPollVotersAsync( + public static Task GetPollVotersAsync( this Client client, long chatId = default, long messageId = default, int optionId = default, int offset = default, int limit = default) { return client.ExecuteAsync(new GetPollVoters diff --git a/TdLib.Api/Functions/GetPremiumGiftCodePaymentOptions.cs b/TdLib.Api/Functions/GetPremiumGiftCodePaymentOptions.cs new file mode 100644 index 00000000..eb82be4f --- /dev/null +++ b/TdLib.Api/Functions/GetPremiumGiftCodePaymentOptions.cs @@ -0,0 +1,49 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Returns available options for Telegram Premium gift code or giveaway creation + /// + public class GetPremiumGiftCodePaymentOptions : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "getPremiumGiftCodePaymentOptions"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of the channel chat, which will be automatically boosted by receivers of the gift codes and which is administered by the user; 0 if none + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("boosted_chat_id")] + public long BoostedChatId { get; set; } + } + + /// + /// Returns available options for Telegram Premium gift code or giveaway creation + /// + public static Task GetPremiumGiftCodePaymentOptionsAsync( + this Client client, long boostedChatId = default) + { + return client.ExecuteAsync(new GetPremiumGiftCodePaymentOptions + { + BoostedChatId = boostedChatId + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/GetPremiumGiveawayInfo.cs b/TdLib.Api/Functions/GetPremiumGiveawayInfo.cs new file mode 100644 index 00000000..e66d6cdc --- /dev/null +++ b/TdLib.Api/Functions/GetPremiumGiveawayInfo.cs @@ -0,0 +1,56 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Returns information about a Telegram Premium giveaway + /// + public class GetPremiumGiveawayInfo : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "getPremiumGiveawayInfo"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of the channel chat which started the giveaway + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_id")] + public long ChatId { get; set; } + + /// + /// Identifier of the giveaway message in the chat + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("message_id")] + public long MessageId { get; set; } + } + + /// + /// Returns information about a Telegram Premium giveaway + /// + public static Task GetPremiumGiveawayInfoAsync( + this Client client, long chatId = default, long messageId = default) + { + return client.ExecuteAsync(new GetPremiumGiveawayInfo + { + ChatId = chatId, MessageId = messageId + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/GetRecentlyOpenedChats.cs b/TdLib.Api/Functions/GetRecentlyOpenedChats.cs index 9c272efc..5591b423 100644 --- a/TdLib.Api/Functions/GetRecentlyOpenedChats.cs +++ b/TdLib.Api/Functions/GetRecentlyOpenedChats.cs @@ -10,7 +10,7 @@ namespace TdLib public static partial class TdApi { /// - /// Returns recently opened chats, this is an offline request. Returns chats in the order of last opening + /// Returns recently opened chats; this is an offline request. Returns chats in the order of last opening /// public class GetRecentlyOpenedChats : Function { @@ -35,7 +35,7 @@ public class GetRecentlyOpenedChats : Function } /// - /// Returns recently opened chats, this is an offline request. Returns chats in the order of last opening + /// Returns recently opened chats; this is an offline request. Returns chats in the order of last opening /// public static Task GetRecentlyOpenedChatsAsync( this Client client, int limit = default) diff --git a/TdLib.Api/Functions/GetRecommendedChatFilters.cs b/TdLib.Api/Functions/GetRecommendedChatFolders.cs similarity index 67% rename from TdLib.Api/Functions/GetRecommendedChatFilters.cs rename to TdLib.Api/Functions/GetRecommendedChatFolders.cs index 7b6a7b1d..c13c5700 100644 --- a/TdLib.Api/Functions/GetRecommendedChatFilters.cs +++ b/TdLib.Api/Functions/GetRecommendedChatFolders.cs @@ -10,15 +10,15 @@ namespace TdLib public static partial class TdApi { /// - /// Returns recommended chat filters for the current user + /// Returns recommended chat folders for the current user /// - public class GetRecommendedChatFilters : Function + public class GetRecommendedChatFolders : Function { /// /// Data type for serialization /// [JsonProperty("@type")] - public override string DataType { get; set; } = "getRecommendedChatFilters"; + public override string DataType { get; set; } = "getRecommendedChatFolders"; /// /// Extra data attached to the function @@ -30,12 +30,12 @@ public class GetRecommendedChatFilters : Function } /// - /// Returns recommended chat filters for the current user + /// Returns recommended chat folders for the current user /// - public static Task GetRecommendedChatFiltersAsync( + public static Task GetRecommendedChatFoldersAsync( this Client client) { - return client.ExecuteAsync(new GetRecommendedChatFilters + return client.ExecuteAsync(new GetRecommendedChatFolders { }); diff --git a/TdLib.Api/Functions/GetRemoteFile.cs b/TdLib.Api/Functions/GetRemoteFile.cs index cdb43e7b..4d48637e 100644 --- a/TdLib.Api/Functions/GetRemoteFile.cs +++ b/TdLib.Api/Functions/GetRemoteFile.cs @@ -10,7 +10,7 @@ namespace TdLib public static partial class TdApi { /// - /// Returns information about a file by its remote ID; this is an offline request. Can be used to register a URL as a file for further uploading, or sending as a message. Even the request succeeds, the file can be used only if it is still accessible to the user. + /// Returns information about a file by its remote identifier; this is an offline request. Can be used to register a URL as a file for further uploading, or sending as a message. Even the request succeeds, the file can be used only if it is still accessible to the user. /// For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the application /// public class GetRemoteFile : Function @@ -43,7 +43,7 @@ public class GetRemoteFile : Function } /// - /// Returns information about a file by its remote ID; this is an offline request. Can be used to register a URL as a file for further uploading, or sending as a message. Even the request succeeds, the file can be used only if it is still accessible to the user. + /// Returns information about a file by its remote identifier; this is an offline request. Can be used to register a URL as a file for further uploading, or sending as a message. Even the request succeeds, the file can be used only if it is still accessible to the user. /// For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the application /// public static Task GetRemoteFileAsync( diff --git a/TdLib.Api/Functions/GetRepliedMessage.cs b/TdLib.Api/Functions/GetRepliedMessage.cs index 088be28b..cedf1bdd 100644 --- a/TdLib.Api/Functions/GetRepliedMessage.cs +++ b/TdLib.Api/Functions/GetRepliedMessage.cs @@ -10,8 +10,9 @@ namespace TdLib public static partial class TdApi { /// - /// Returns information about a message that is replied by a given message. Also, returns the pinned message, the game message, the invoice message, and the topic creation message for messages - /// of the types messagePinMessage, messageGameScore, messagePaymentSuccessful, and topic messages without replied message respectively + /// Returns information about a non-bundled message that is replied by a given message. Also, returns the pinned message, the game message, the invoice message, + /// the message with a previously set same background, and the topic creation message for messages of the types + /// messagePinMessage, messageGameScore, messagePaymentSuccessful, messageChatSetBackground and topic messages without non-bundled replied message respectively /// public class GetRepliedMessage : Function { @@ -43,8 +44,9 @@ public class GetRepliedMessage : Function } /// - /// Returns information about a message that is replied by a given message. Also, returns the pinned message, the game message, the invoice message, and the topic creation message for messages - /// of the types messagePinMessage, messageGameScore, messagePaymentSuccessful, and topic messages without replied message respectively + /// Returns information about a non-bundled message that is replied by a given message. Also, returns the pinned message, the game message, the invoice message, + /// the message with a previously set same background, and the topic creation message for messages of the types + /// messagePinMessage, messageGameScore, messagePaymentSuccessful, messageChatSetBackground and topic messages without non-bundled replied message respectively /// public static Task GetRepliedMessageAsync( this Client client, long chatId = default, long messageId = default) diff --git a/TdLib.Api/Functions/GetStory.cs b/TdLib.Api/Functions/GetStory.cs new file mode 100644 index 00000000..5c4fcd45 --- /dev/null +++ b/TdLib.Api/Functions/GetStory.cs @@ -0,0 +1,63 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Returns a story + /// + public class GetStory : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "getStory"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of the chat that posted the story + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_sender_chat_id")] + public long StorySenderChatId { get; set; } + + /// + /// Story identifier + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_id")] + public int StoryId { get; set; } + + /// + /// Pass true to get only locally available information without sending network requests + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("only_local")] + public bool OnlyLocal { get; set; } + } + + /// + /// Returns a story + /// + public static Task GetStoryAsync( + this Client client, long storySenderChatId = default, int storyId = default, bool onlyLocal = default) + { + return client.ExecuteAsync(new GetStory + { + StorySenderChatId = storySenderChatId, StoryId = storyId, OnlyLocal = onlyLocal + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/GetStoryAvailableReactions.cs b/TdLib.Api/Functions/GetStoryAvailableReactions.cs new file mode 100644 index 00000000..f4b8a9a1 --- /dev/null +++ b/TdLib.Api/Functions/GetStoryAvailableReactions.cs @@ -0,0 +1,49 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Returns reactions, which can be chosen for a story + /// + public class GetStoryAvailableReactions : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "getStoryAvailableReactions"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Number of reaction per row, 5-25 + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("row_size")] + public int RowSize { get; set; } + } + + /// + /// Returns reactions, which can be chosen for a story + /// + public static Task GetStoryAvailableReactionsAsync( + this Client client, int rowSize = default) + { + return client.ExecuteAsync(new GetStoryAvailableReactions + { + RowSize = rowSize + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/GetStoryNotificationSettingsExceptions.cs b/TdLib.Api/Functions/GetStoryNotificationSettingsExceptions.cs new file mode 100644 index 00000000..31dbcc3b --- /dev/null +++ b/TdLib.Api/Functions/GetStoryNotificationSettingsExceptions.cs @@ -0,0 +1,44 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Returns list of chats with non-default notification settings for stories + /// + public class GetStoryNotificationSettingsExceptions : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "getStoryNotificationSettingsExceptions"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + + /// + /// Returns list of chats with non-default notification settings for stories + /// + public static Task GetStoryNotificationSettingsExceptionsAsync( + this Client client) + { + return client.ExecuteAsync(new GetStoryNotificationSettingsExceptions + { + + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/GetStoryViewers.cs b/TdLib.Api/Functions/GetStoryViewers.cs new file mode 100644 index 00000000..f9a31cdf --- /dev/null +++ b/TdLib.Api/Functions/GetStoryViewers.cs @@ -0,0 +1,84 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Returns viewers of a story. The method can be called only for stories posted on behalf of the current user + /// + public class GetStoryViewers : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "getStoryViewers"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Story identifier + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_id")] + public int StoryId { get; set; } + + /// + /// Query to search for in names and usernames of the viewers; may be empty to get all relevant viewers + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("query")] + public string Query { get; set; } + + /// + /// Pass true to get only contacts; pass false to get all relevant viewers + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("only_contacts")] + public bool OnlyContacts { get; set; } + + /// + /// Pass true to get viewers with reaction first; pass false to get viewers sorted just by view_date + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("prefer_with_reaction")] + public bool PreferWithReaction { get; set; } + + /// + /// Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("offset")] + public string Offset { get; set; } + + /// + /// The maximum number of story viewers to return + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("limit")] + public int Limit { get; set; } + } + + /// + /// Returns viewers of a story. The method can be called only for stories posted on behalf of the current user + /// + public static Task GetStoryViewersAsync( + this Client client, int storyId = default, string query = default, bool onlyContacts = default, bool preferWithReaction = default, string offset = default, int limit = default) + { + return client.ExecuteAsync(new GetStoryViewers + { + StoryId = storyId, Query = query, OnlyContacts = onlyContacts, PreferWithReaction = preferWithReaction, Offset = offset, Limit = limit + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/GetTopChats.cs b/TdLib.Api/Functions/GetTopChats.cs index 38db9f7b..b7f927cf 100644 --- a/TdLib.Api/Functions/GetTopChats.cs +++ b/TdLib.Api/Functions/GetTopChats.cs @@ -10,7 +10,7 @@ namespace TdLib public static partial class TdApi { /// - /// Returns a list of frequently used chats. Supported only if the chat info database is enabled + /// Returns a list of frequently used chats /// public class GetTopChats : Function { @@ -42,7 +42,7 @@ public class GetTopChats : Function } /// - /// Returns a list of frequently used chats. Supported only if the chat info database is enabled + /// Returns a list of frequently used chats /// public static Task GetTopChatsAsync( this Client client, TopChatCategory category = default, int limit = default) diff --git a/TdLib.Api/Functions/GetUserChatBoosts.cs b/TdLib.Api/Functions/GetUserChatBoosts.cs new file mode 100644 index 00000000..44cc7835 --- /dev/null +++ b/TdLib.Api/Functions/GetUserChatBoosts.cs @@ -0,0 +1,56 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Returns list of boosts applied to a chat by a given user; requires administrator rights in the channel chat; for bots only + /// + public class GetUserChatBoosts : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "getUserChatBoosts"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of the chat + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_id")] + public long ChatId { get; set; } + + /// + /// Identifier of the user + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("user_id")] + public long UserId { get; set; } + } + + /// + /// Returns list of boosts applied to a chat by a given user; requires administrator rights in the channel chat; for bots only + /// + public static Task GetUserChatBoostsAsync( + this Client client, long chatId = default, long userId = default) + { + return client.ExecuteAsync(new GetUserChatBoosts + { + ChatId = chatId, UserId = userId + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/GetWebAppUrl.cs b/TdLib.Api/Functions/GetWebAppUrl.cs index 5d93ff90..5494c873 100644 --- a/TdLib.Api/Functions/GetWebAppUrl.cs +++ b/TdLib.Api/Functions/GetWebAppUrl.cs @@ -10,7 +10,7 @@ namespace TdLib public static partial class TdApi { /// - /// Returns an HTTPS URL of a Web App to open after keyboardButtonTypeWebApp or inlineQueryResultsButtonTypeWebApp button is pressed + /// Returns an HTTPS URL of a Web App to open from the side menu, a keyboardButtonTypeWebApp button, an inlineQueryResultsButtonTypeWebApp button, or an internalLinkTypeSideMenuBot link /// public class GetWebAppUrl : Function { @@ -34,7 +34,7 @@ public class GetWebAppUrl : Function public long BotUserId { get; set; } /// - /// The URL from the keyboardButtonTypeWebApp or inlineQueryResultsButtonTypeWebApp button + /// The URL from a keyboardButtonTypeWebApp button, inlineQueryResultsButtonTypeWebApp button, an internalLinkTypeSideMenuBot link, or an empty when the bot is opened from the side menu /// [JsonConverter(typeof(Converter))] [JsonProperty("url")] @@ -56,7 +56,7 @@ public class GetWebAppUrl : Function } /// - /// Returns an HTTPS URL of a Web App to open after keyboardButtonTypeWebApp or inlineQueryResultsButtonTypeWebApp button is pressed + /// Returns an HTTPS URL of a Web App to open from the side menu, a keyboardButtonTypeWebApp button, an inlineQueryResultsButtonTypeWebApp button, or an internalLinkTypeSideMenuBot link /// public static Task GetWebAppUrlAsync( this Client client, long botUserId = default, string url = default, ThemeParameters theme = default, string applicationName = default) diff --git a/TdLib.Api/Functions/GetWebPagePreview.cs b/TdLib.Api/Functions/GetWebPagePreview.cs index 4b302b54..10b7a531 100644 --- a/TdLib.Api/Functions/GetWebPagePreview.cs +++ b/TdLib.Api/Functions/GetWebPagePreview.cs @@ -10,7 +10,7 @@ namespace TdLib public static partial class TdApi { /// - /// Returns a web page preview by the text of the message. Do not call this function too often. Returns a 404 error if the web page has no preview + /// Returns a link preview by the text of a message. Do not call this function too often. Returns a 404 error if the text has no link preview /// public class GetWebPagePreview : Function { @@ -32,17 +32,24 @@ public class GetWebPagePreview : Function [JsonConverter(typeof(Converter))] [JsonProperty("text")] public FormattedText Text { get; set; } + + /// + /// Options to be used for generation of the link preview; pass null to use default link preview options + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("link_preview_options")] + public LinkPreviewOptions LinkPreviewOptions { get; set; } } /// - /// Returns a web page preview by the text of the message. Do not call this function too often. Returns a 404 error if the web page has no preview + /// Returns a link preview by the text of a message. Do not call this function too often. Returns a 404 error if the text has no link preview /// public static Task GetWebPagePreviewAsync( - this Client client, FormattedText text = default) + this Client client, FormattedText text = default, LinkPreviewOptions linkPreviewOptions = default) { return client.ExecuteAsync(new GetWebPagePreview { - Text = text + Text = text, LinkPreviewOptions = linkPreviewOptions }); } } diff --git a/TdLib.Api/Functions/InviteGroupCallParticipants.cs b/TdLib.Api/Functions/InviteGroupCallParticipants.cs index 9de1942a..c9193854 100644 --- a/TdLib.Api/Functions/InviteGroupCallParticipants.cs +++ b/TdLib.Api/Functions/InviteGroupCallParticipants.cs @@ -10,7 +10,7 @@ namespace TdLib public static partial class TdApi { /// - /// Invites users to an active group call. Sends a service message of type messageInviteToGroupCall for video chats + /// Invites users to an active group call. Sends a service message of type messageInviteVideoChatParticipants for video chats /// public class InviteGroupCallParticipants : Function { @@ -41,7 +41,7 @@ public class InviteGroupCallParticipants : Function } /// - /// Invites users to an active group call. Sends a service message of type messageInviteToGroupCall for video chats + /// Invites users to an active group call. Sends a service message of type messageInviteVideoChatParticipants for video chats /// public static Task InviteGroupCallParticipantsAsync( this Client client, int groupCallId = default, long[] userIds = default) diff --git a/TdLib.Api/Functions/LaunchPrepaidPremiumGiveaway.cs b/TdLib.Api/Functions/LaunchPrepaidPremiumGiveaway.cs new file mode 100644 index 00000000..548a4232 --- /dev/null +++ b/TdLib.Api/Functions/LaunchPrepaidPremiumGiveaway.cs @@ -0,0 +1,56 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Launches a prepaid Telegram Premium giveaway for subscribers of channel chats; requires can_post_messages rights in the channels + /// + public class LaunchPrepaidPremiumGiveaway : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "launchPrepaidPremiumGiveaway"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Unique identifier of the prepaid giveaway + /// + [JsonConverter(typeof(Converter.Int64))] + [JsonProperty("giveaway_id")] + public long GiveawayId { get; set; } + + /// + /// Giveaway parameters + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("parameters")] + public PremiumGiveawayParameters Parameters { get; set; } + } + + /// + /// Launches a prepaid Telegram Premium giveaway for subscribers of channel chats; requires can_post_messages rights in the channels + /// + public static Task LaunchPrepaidPremiumGiveawayAsync( + this Client client, long giveawayId = default, PremiumGiveawayParameters parameters = default) + { + return client.ExecuteAsync(new LaunchPrepaidPremiumGiveaway + { + GiveawayId = giveawayId, Parameters = parameters + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/LoadActiveStories.cs b/TdLib.Api/Functions/LoadActiveStories.cs new file mode 100644 index 00000000..c1f57199 --- /dev/null +++ b/TdLib.Api/Functions/LoadActiveStories.cs @@ -0,0 +1,51 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Loads more active stories from a story list. The loaded stories will be sent through updates. Active stories are sorted by + /// the pair (active_stories.order, active_stories.story_sender_chat_id) in descending order. Returns a 404 error if all active stories have been loaded + /// + public class LoadActiveStories : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "loadActiveStories"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// The story list in which to load active stories + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_list")] + public StoryList StoryList { get; set; } + } + + /// + /// Loads more active stories from a story list. The loaded stories will be sent through updates. Active stories are sorted by + /// the pair (active_stories.order, active_stories.story_sender_chat_id) in descending order. Returns a 404 error if all active stories have been loaded + /// + public static Task LoadActiveStoriesAsync( + this Client client, StoryList storyList = default) + { + return client.ExecuteAsync(new LoadActiveStories + { + StoryList = storyList + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/OpenStory.cs b/TdLib.Api/Functions/OpenStory.cs new file mode 100644 index 00000000..616462e1 --- /dev/null +++ b/TdLib.Api/Functions/OpenStory.cs @@ -0,0 +1,56 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Informs TDLib that a story is opened and is being viewed by the user + /// + public class OpenStory : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "openStory"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// The identifier of the sender of the opened story + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_sender_chat_id")] + public long StorySenderChatId { get; set; } + + /// + /// The identifier of the story + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_id")] + public int StoryId { get; set; } + } + + /// + /// Informs TDLib that a story is opened and is being viewed by the user + /// + public static Task OpenStoryAsync( + this Client client, long storySenderChatId = default, int storyId = default) + { + return client.ExecuteAsync(new OpenStory + { + StorySenderChatId = storySenderChatId, StoryId = storyId + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/OpenWebApp.cs b/TdLib.Api/Functions/OpenWebApp.cs index 57b0e3c7..53a74e89 100644 --- a/TdLib.Api/Functions/OpenWebApp.cs +++ b/TdLib.Api/Functions/OpenWebApp.cs @@ -10,7 +10,7 @@ namespace TdLib public static partial class TdApi { /// - /// Informs TDLib that a Web App is being opened from attachment menu, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an inlineKeyboardButtonTypeWebApp button. + /// Informs TDLib that a Web App is being opened from the attachment menu, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an inlineKeyboardButtonTypeWebApp button. /// For each bot, a confirmation alert about data sent to the bot must be shown once /// public class OpenWebApp : Function @@ -42,7 +42,7 @@ public class OpenWebApp : Function public long BotUserId { get; set; } /// - /// The URL from an inlineKeyboardButtonTypeWebApp button, a botMenuButton button, or an internalLinkTypeAttachmentMenuBot link, or an empty string otherwise + /// The URL from an inlineKeyboardButtonTypeWebApp button, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an empty string otherwise /// [JsonConverter(typeof(Converter))] [JsonProperty("url")] @@ -70,23 +70,23 @@ public class OpenWebApp : Function public long MessageThreadId { get; set; } /// - /// Identifier of the replied message for the message sent by the Web App; 0 if none + /// Information about the message or story to be replied in the message sent by the Web App; pass null if none /// [JsonConverter(typeof(Converter))] - [JsonProperty("reply_to_message_id")] - public long ReplyToMessageId { get; set; } + [JsonProperty("reply_to")] + public InputMessageReplyTo ReplyTo { get; set; } } /// - /// Informs TDLib that a Web App is being opened from attachment menu, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an inlineKeyboardButtonTypeWebApp button. + /// Informs TDLib that a Web App is being opened from the attachment menu, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an inlineKeyboardButtonTypeWebApp button. /// For each bot, a confirmation alert about data sent to the bot must be shown once /// public static Task OpenWebAppAsync( - this Client client, long chatId = default, long botUserId = default, string url = default, ThemeParameters theme = default, string applicationName = default, long messageThreadId = default, long replyToMessageId = default) + this Client client, long chatId = default, long botUserId = default, string url = default, ThemeParameters theme = default, string applicationName = default, long messageThreadId = default, InputMessageReplyTo replyTo = default) { return client.ExecuteAsync(new OpenWebApp { - ChatId = chatId, BotUserId = botUserId, Url = url, Theme = theme, ApplicationName = applicationName, MessageThreadId = messageThreadId, ReplyToMessageId = replyToMessageId + ChatId = chatId, BotUserId = botUserId, Url = url, Theme = theme, ApplicationName = applicationName, MessageThreadId = messageThreadId, ReplyTo = replyTo }); } } diff --git a/TdLib.Api/Functions/ParseTextEntities.cs b/TdLib.Api/Functions/ParseTextEntities.cs index 615c8b8e..cfd180c6 100644 --- a/TdLib.Api/Functions/ParseTextEntities.cs +++ b/TdLib.Api/Functions/ParseTextEntities.cs @@ -10,7 +10,7 @@ namespace TdLib public static partial class TdApi { /// - /// Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously + /// Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously /// public class ParseTextEntities : Function { @@ -42,7 +42,7 @@ public class ParseTextEntities : Function } /// - /// Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously + /// Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously /// public static Task ParseTextEntitiesAsync( this Client client, string text = default, TextParseMode parseMode = default) diff --git a/TdLib.Api/Functions/PreliminaryUploadFile.cs b/TdLib.Api/Functions/PreliminaryUploadFile.cs index 29da6efd..f5670212 100644 --- a/TdLib.Api/Functions/PreliminaryUploadFile.cs +++ b/TdLib.Api/Functions/PreliminaryUploadFile.cs @@ -11,7 +11,7 @@ public static partial class TdApi { /// /// Preliminary uploads a file to the cloud before sending it in a message, which can be useful for uploading of being recorded voice and video notes. Updates updateFile will be used - /// to notify about upload progress and successful completion of the upload. The file will not have a persistent remote identifier until it will be sent in a message + /// to notify about upload progress and successful completion of the upload. The file will not have a persistent remote identifier until it is sent in a message /// public class PreliminaryUploadFile : Function { @@ -51,7 +51,7 @@ public class PreliminaryUploadFile : Function /// /// Preliminary uploads a file to the cloud before sending it in a message, which can be useful for uploading of being recorded voice and video notes. Updates updateFile will be used - /// to notify about upload progress and successful completion of the upload. The file will not have a persistent remote identifier until it will be sent in a message + /// to notify about upload progress and successful completion of the upload. The file will not have a persistent remote identifier until it is sent in a message /// public static Task PreliminaryUploadFileAsync( this Client client, InputFile file = default, FileType fileType = default, int priority = default) diff --git a/TdLib.Api/Functions/ProcessChatFolderNewChats.cs b/TdLib.Api/Functions/ProcessChatFolderNewChats.cs new file mode 100644 index 00000000..0adae470 --- /dev/null +++ b/TdLib.Api/Functions/ProcessChatFolderNewChats.cs @@ -0,0 +1,55 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Process new chats added to a shareable chat folder by its owner + /// + public class ProcessChatFolderNewChats : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "processChatFolderNewChats"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Chat folder identifier + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_folder_id")] + public int ChatFolderId { get; set; } + + /// + /// Identifiers of the new chats, which are added to the chat folder. The chats are automatically joined if they aren't joined yet + /// + [JsonProperty("added_chat_ids", ItemConverterType = typeof(Converter))] + public long[] AddedChatIds { get; set; } + } + + /// + /// Process new chats added to a shareable chat folder by its owner + /// + public static Task ProcessChatFolderNewChatsAsync( + this Client client, int chatFolderId = default, long[] addedChatIds = default) + { + return client.ExecuteAsync(new ProcessChatFolderNewChats + { + ChatFolderId = chatFolderId, AddedChatIds = addedChatIds + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/ReadChatList.cs b/TdLib.Api/Functions/ReadChatList.cs new file mode 100644 index 00000000..9d4185f3 --- /dev/null +++ b/TdLib.Api/Functions/ReadChatList.cs @@ -0,0 +1,49 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Traverse all chats in a chat list and marks all messages in the chats as read + /// + public class ReadChatList : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "readChatList"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Chat list in which to mark all chats as read + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_list")] + public ChatList ChatList { get; set; } + } + + /// + /// Traverse all chats in a chat list and marks all messages in the chats as read + /// + public static Task ReadChatListAsync( + this Client client, ChatList chatList = default) + { + return client.ExecuteAsync(new ReadChatList + { + ChatList = chatList + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/RecognizeSpeech.cs b/TdLib.Api/Functions/RecognizeSpeech.cs index 7b5ef595..eecb289d 100644 --- a/TdLib.Api/Functions/RecognizeSpeech.cs +++ b/TdLib.Api/Functions/RecognizeSpeech.cs @@ -10,7 +10,7 @@ namespace TdLib public static partial class TdApi { /// - /// Recognizes speech in a video note or a voice note message. The message must be successfully sent and must not be scheduled. May return an error with a message "MSG_VOICE_TOO_LONG" if media duration is too big to be recognized + /// Recognizes speech in a video note or a voice note message. The message must be successfully sent and must not be scheduled /// public class RecognizeSpeech : Function { @@ -42,7 +42,7 @@ public class RecognizeSpeech : Function } /// - /// Recognizes speech in a video note or a voice note message. The message must be successfully sent and must not be scheduled. May return an error with a message "MSG_VOICE_TOO_LONG" if media duration is too big to be recognized + /// Recognizes speech in a video note or a voice note message. The message must be successfully sent and must not be scheduled /// public static Task RecognizeSpeechAsync( this Client client, long chatId = default, long messageId = default) diff --git a/TdLib.Api/Functions/ReorderBotActiveUsernames.cs b/TdLib.Api/Functions/ReorderBotActiveUsernames.cs new file mode 100644 index 00000000..e9696fb3 --- /dev/null +++ b/TdLib.Api/Functions/ReorderBotActiveUsernames.cs @@ -0,0 +1,55 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Changes order of active usernames of a bot. Can be called only if userTypeBot.can_be_edited == true + /// + public class ReorderBotActiveUsernames : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "reorderBotActiveUsernames"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of the target bot + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("bot_user_id")] + public long BotUserId { get; set; } + + /// + /// The new order of active usernames. All currently active usernames must be specified + /// + [JsonProperty("usernames", ItemConverterType = typeof(Converter))] + public string[] Usernames { get; set; } + } + + /// + /// Changes order of active usernames of a bot. Can be called only if userTypeBot.can_be_edited == true + /// + public static Task ReorderBotActiveUsernamesAsync( + this Client client, long botUserId = default, string[] usernames = default) + { + return client.ExecuteAsync(new ReorderBotActiveUsernames + { + BotUserId = botUserId, Usernames = usernames + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/ReorderChatFilters.cs b/TdLib.Api/Functions/ReorderChatFolders.cs similarity index 64% rename from TdLib.Api/Functions/ReorderChatFilters.cs rename to TdLib.Api/Functions/ReorderChatFolders.cs index c42d5ccf..e60c6dc7 100644 --- a/TdLib.Api/Functions/ReorderChatFilters.cs +++ b/TdLib.Api/Functions/ReorderChatFolders.cs @@ -10,15 +10,15 @@ namespace TdLib public static partial class TdApi { /// - /// Changes the order of chat filters + /// Changes the order of chat folders /// - public class ReorderChatFilters : Function + public class ReorderChatFolders : Function { /// /// Data type for serialization /// [JsonProperty("@type")] - public override string DataType { get; set; } = "reorderChatFilters"; + public override string DataType { get; set; } = "reorderChatFolders"; /// /// Extra data attached to the function @@ -27,13 +27,13 @@ public class ReorderChatFilters : Function public override string Extra { get; set; } /// - /// Identifiers of chat filters in the new correct order + /// Identifiers of chat folders in the new correct order /// - [JsonProperty("chat_filter_ids", ItemConverterType = typeof(Converter))] - public int[] ChatFilterIds { get; set; } + [JsonProperty("chat_folder_ids", ItemConverterType = typeof(Converter))] + public int[] ChatFolderIds { get; set; } /// - /// Position of the main chat list among chat filters, 0-based. Can be non-zero only for Premium users + /// Position of the main chat list among chat folders, 0-based. Can be non-zero only for Premium users /// [JsonConverter(typeof(Converter))] [JsonProperty("main_chat_list_position")] @@ -41,14 +41,14 @@ public class ReorderChatFilters : Function } /// - /// Changes the order of chat filters + /// Changes the order of chat folders /// - public static Task ReorderChatFiltersAsync( - this Client client, int[] chatFilterIds = default, int mainChatListPosition = default) + public static Task ReorderChatFoldersAsync( + this Client client, int[] chatFolderIds = default, int mainChatListPosition = default) { - return client.ExecuteAsync(new ReorderChatFilters + return client.ExecuteAsync(new ReorderChatFolders { - ChatFilterIds = chatFilterIds, MainChatListPosition = mainChatListPosition + ChatFolderIds = chatFolderIds, MainChatListPosition = mainChatListPosition }); } } diff --git a/TdLib.Api/Functions/ReportChat.cs b/TdLib.Api/Functions/ReportChat.cs index 35af5361..be5d9a9e 100644 --- a/TdLib.Api/Functions/ReportChat.cs +++ b/TdLib.Api/Functions/ReportChat.cs @@ -44,7 +44,7 @@ public class ReportChat : Function /// [JsonConverter(typeof(Converter))] [JsonProperty("reason")] - public ChatReportReason Reason { get; set; } + public ReportReason Reason { get; set; } /// /// Additional report details; 0-1024 characters @@ -58,7 +58,7 @@ public class ReportChat : Function /// Reports a chat to the Telegram moderators. A chat can be reported only from the chat action bar, or if chat.can_be_reported /// public static Task ReportChatAsync( - this Client client, long chatId = default, long[] messageIds = default, ChatReportReason reason = default, string text = default) + this Client client, long chatId = default, long[] messageIds = default, ReportReason reason = default, string text = default) { return client.ExecuteAsync(new ReportChat { diff --git a/TdLib.Api/Functions/ReportChatPhoto.cs b/TdLib.Api/Functions/ReportChatPhoto.cs index 09af2901..f00ed720 100644 --- a/TdLib.Api/Functions/ReportChatPhoto.cs +++ b/TdLib.Api/Functions/ReportChatPhoto.cs @@ -45,7 +45,7 @@ public class ReportChatPhoto : Function /// [JsonConverter(typeof(Converter))] [JsonProperty("reason")] - public ChatReportReason Reason { get; set; } + public ReportReason Reason { get; set; } /// /// Additional report details; 0-1024 characters @@ -59,7 +59,7 @@ public class ReportChatPhoto : Function /// Reports a chat photo to the Telegram moderators. A chat photo can be reported only if chat.can_be_reported /// public static Task ReportChatPhotoAsync( - this Client client, long chatId = default, int fileId = default, ChatReportReason reason = default, string text = default) + this Client client, long chatId = default, int fileId = default, ReportReason reason = default, string text = default) { return client.ExecuteAsync(new ReportChatPhoto { diff --git a/TdLib.Api/Functions/ReportStory.cs b/TdLib.Api/Functions/ReportStory.cs new file mode 100644 index 00000000..42578e52 --- /dev/null +++ b/TdLib.Api/Functions/ReportStory.cs @@ -0,0 +1,70 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Reports a story to the Telegram moderators + /// + public class ReportStory : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "reportStory"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// The identifier of the sender of the story to report + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_sender_chat_id")] + public long StorySenderChatId { get; set; } + + /// + /// The identifier of the story to report + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_id")] + public int StoryId { get; set; } + + /// + /// The reason for reporting the story + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("reason")] + public ReportReason Reason { get; set; } + + /// + /// Additional report details; 0-1024 characters + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("text")] + public string Text { get; set; } + } + + /// + /// Reports a story to the Telegram moderators + /// + public static Task ReportStoryAsync( + this Client client, long storySenderChatId = default, int storyId = default, ReportReason reason = default, string text = default) + { + return client.ExecuteAsync(new ReportStory + { + StorySenderChatId = storySenderChatId, StoryId = storyId, Reason = reason, Text = text + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/ResendMessages.cs b/TdLib.Api/Functions/ResendMessages.cs index 6aed8588..8e8bcae9 100644 --- a/TdLib.Api/Functions/ResendMessages.cs +++ b/TdLib.Api/Functions/ResendMessages.cs @@ -39,6 +39,13 @@ public class ResendMessages : Function /// [JsonProperty("message_ids", ItemConverterType = typeof(Converter))] public long[] MessageIds { get; set; } + + /// + /// New manually chosen quote from the message to be replied; pass null if none. Ignored if more than one message is re-sent, or if messageSendingStateFailed.need_another_reply_quote == false + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("quote")] + public FormattedText Quote { get; set; } } /// @@ -46,11 +53,11 @@ public class ResendMessages : Function /// If a message is re-sent, the corresponding failed to send message is deleted. Returns the sent messages in the same order as the message identifiers passed in message_ids. If a message can't be re-sent, null will be returned instead of the message /// public static Task ResendMessagesAsync( - this Client client, long chatId = default, long[] messageIds = default) + this Client client, long chatId = default, long[] messageIds = default, FormattedText quote = default) { return client.ExecuteAsync(new ResendMessages { - ChatId = chatId, MessageIds = messageIds + ChatId = chatId, MessageIds = messageIds, Quote = quote }); } } diff --git a/TdLib.Api/Functions/SearchChats.cs b/TdLib.Api/Functions/SearchChats.cs index 3022999e..9e18ba6f 100644 --- a/TdLib.Api/Functions/SearchChats.cs +++ b/TdLib.Api/Functions/SearchChats.cs @@ -10,7 +10,7 @@ namespace TdLib public static partial class TdApi { /// - /// Searches for the specified query in the title and username of already known chats, this is an offline request. Returns chats in the order seen in the main chat list + /// Searches for the specified query in the title and username of already known chats; this is an offline request. Returns chats in the order seen in the main chat list /// public class SearchChats : Function { @@ -42,7 +42,7 @@ public class SearchChats : Function } /// - /// Searches for the specified query in the title and username of already known chats, this is an offline request. Returns chats in the order seen in the main chat list + /// Searches for the specified query in the title and username of already known chats; this is an offline request. Returns chats in the order seen in the main chat list /// public static Task SearchChatsAsync( this Client client, string query = default, int limit = default) diff --git a/TdLib.Api/Functions/SearchQuote.cs b/TdLib.Api/Functions/SearchQuote.cs new file mode 100644 index 00000000..f66268dd --- /dev/null +++ b/TdLib.Api/Functions/SearchQuote.cs @@ -0,0 +1,63 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Searches for a given quote in a text. Returns found quote start position in UTF-16 code units. Returns a 404 error if the quote is not found. Can be called synchronously + /// + public class SearchQuote : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "searchQuote"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Text in which to search for the quote + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("text")] + public FormattedText Text { get; set; } + + /// + /// Quote to search for + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("quote")] + public FormattedText Quote { get; set; } + + /// + /// Approximate quote position in UTF-16 code units + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("quote_position")] + public int QuotePosition { get; set; } + } + + /// + /// Searches for a given quote in a text. Returns found quote start position in UTF-16 code units. Returns a 404 error if the quote is not found. Can be called synchronously + /// + public static Task SearchQuoteAsync( + this Client client, FormattedText text = default, FormattedText quote = default, int quotePosition = default) + { + return client.ExecuteAsync(new SearchQuote + { + Text = text, Quote = quote, QuotePosition = quotePosition + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/SearchRecentlyFoundChats.cs b/TdLib.Api/Functions/SearchRecentlyFoundChats.cs new file mode 100644 index 00000000..089de48d --- /dev/null +++ b/TdLib.Api/Functions/SearchRecentlyFoundChats.cs @@ -0,0 +1,56 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Searches for the specified query in the title and username of up to 50 recently found chats; this is an offline request + /// + public class SearchRecentlyFoundChats : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "searchRecentlyFoundChats"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Query to search for + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("query")] + public string Query { get; set; } + + /// + /// The maximum number of chats to be returned + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("limit")] + public int Limit { get; set; } + } + + /// + /// Searches for the specified query in the title and username of up to 50 recently found chats; this is an offline request + /// + public static Task SearchRecentlyFoundChatsAsync( + this Client client, string query = default, int limit = default) + { + return client.ExecuteAsync(new SearchRecentlyFoundChats + { + Query = query, Limit = limit + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/SearchStringsByPrefix.cs b/TdLib.Api/Functions/SearchStringsByPrefix.cs new file mode 100644 index 00000000..37e297c8 --- /dev/null +++ b/TdLib.Api/Functions/SearchStringsByPrefix.cs @@ -0,0 +1,69 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Searches specified query by word prefixes in the provided strings. Returns 0-based positions of strings that matched. Can be called synchronously + /// + public class SearchStringsByPrefix : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "searchStringsByPrefix"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// The strings to search in for the query + /// + [JsonProperty("strings", ItemConverterType = typeof(Converter))] + public string[] Strings { get; set; } + + /// + /// Query to search for + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("query")] + public string Query { get; set; } + + /// + /// The maximum number of objects to return + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("limit")] + public int Limit { get; set; } + + /// + /// Pass true to receive no results for an empty query + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("return_none_for_empty_query")] + public bool ReturnNoneForEmptyQuery { get; set; } + } + + /// + /// Searches specified query by word prefixes in the provided strings. Returns 0-based positions of strings that matched. Can be called synchronously + /// + public static Task SearchStringsByPrefixAsync( + this Client client, string[] strings = default, string query = default, int limit = default, bool returnNoneForEmptyQuery = default) + { + return client.ExecuteAsync(new SearchStringsByPrefix + { + Strings = strings, Query = query, Limit = limit, ReturnNoneForEmptyQuery = returnNoneForEmptyQuery + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/SendInlineQueryResultMessage.cs b/TdLib.Api/Functions/SendInlineQueryResultMessage.cs index aff6d763..e1b5df08 100644 --- a/TdLib.Api/Functions/SendInlineQueryResultMessage.cs +++ b/TdLib.Api/Functions/SendInlineQueryResultMessage.cs @@ -41,11 +41,11 @@ public class SendInlineQueryResultMessage : Function public long MessageThreadId { get; set; } /// - /// Identifier of a replied message; 0 if none + /// Information about the message or story to be replied; pass null if none /// [JsonConverter(typeof(Converter))] - [JsonProperty("reply_to_message_id")] - public long ReplyToMessageId { get; set; } + [JsonProperty("reply_to")] + public InputMessageReplyTo ReplyTo { get; set; } /// /// Options to be used to send the message; pass null to use default options @@ -62,7 +62,7 @@ public class SendInlineQueryResultMessage : Function public long QueryId { get; set; } /// - /// Identifier of the inline result + /// Identifier of the inline query result /// [JsonConverter(typeof(Converter))] [JsonProperty("result_id")] @@ -80,11 +80,11 @@ public class SendInlineQueryResultMessage : Function /// Sends the result of an inline query as a message. Returns the sent message. Always clears a chat draft message /// public static Task SendInlineQueryResultMessageAsync( - this Client client, long chatId = default, long messageThreadId = default, long replyToMessageId = default, MessageSendOptions options = default, long queryId = default, string resultId = default, bool hideViaBot = default) + this Client client, long chatId = default, long messageThreadId = default, InputMessageReplyTo replyTo = default, MessageSendOptions options = default, long queryId = default, string resultId = default, bool hideViaBot = default) { return client.ExecuteAsync(new SendInlineQueryResultMessage { - ChatId = chatId, MessageThreadId = messageThreadId, ReplyToMessageId = replyToMessageId, Options = options, QueryId = queryId, ResultId = resultId, HideViaBot = hideViaBot + ChatId = chatId, MessageThreadId = messageThreadId, ReplyTo = replyTo, Options = options, QueryId = queryId, ResultId = resultId, HideViaBot = hideViaBot }); } } diff --git a/TdLib.Api/Functions/SendMessage.cs b/TdLib.Api/Functions/SendMessage.cs index f25ab4e7..0f3ed3de 100644 --- a/TdLib.Api/Functions/SendMessage.cs +++ b/TdLib.Api/Functions/SendMessage.cs @@ -41,11 +41,11 @@ public class SendMessage : Function public long MessageThreadId { get; set; } /// - /// Identifier of the replied message; 0 if none + /// Information about the message or story to be replied; pass null if none /// [JsonConverter(typeof(Converter))] - [JsonProperty("reply_to_message_id")] - public long ReplyToMessageId { get; set; } + [JsonProperty("reply_to")] + public InputMessageReplyTo ReplyTo { get; set; } /// /// Options to be used to send the message; pass null to use default options @@ -73,11 +73,11 @@ public class SendMessage : Function /// Sends a message. Returns the sent message /// public static Task SendMessageAsync( - this Client client, long chatId = default, long messageThreadId = default, long replyToMessageId = default, MessageSendOptions options = default, ReplyMarkup replyMarkup = default, InputMessageContent inputMessageContent = default) + this Client client, long chatId = default, long messageThreadId = default, InputMessageReplyTo replyTo = default, MessageSendOptions options = default, ReplyMarkup replyMarkup = default, InputMessageContent inputMessageContent = default) { return client.ExecuteAsync(new SendMessage { - ChatId = chatId, MessageThreadId = messageThreadId, ReplyToMessageId = replyToMessageId, Options = options, ReplyMarkup = replyMarkup, InputMessageContent = inputMessageContent + ChatId = chatId, MessageThreadId = messageThreadId, ReplyTo = replyTo, Options = options, ReplyMarkup = replyMarkup, InputMessageContent = inputMessageContent }); } } diff --git a/TdLib.Api/Functions/SendMessageAlbum.cs b/TdLib.Api/Functions/SendMessageAlbum.cs index 15daa869..e7248cb2 100644 --- a/TdLib.Api/Functions/SendMessageAlbum.cs +++ b/TdLib.Api/Functions/SendMessageAlbum.cs @@ -41,11 +41,11 @@ public class SendMessageAlbum : Function public long MessageThreadId { get; set; } /// - /// Identifier of a replied message; 0 if none + /// Information about the message or story to be replied; pass null if none /// [JsonConverter(typeof(Converter))] - [JsonProperty("reply_to_message_id")] - public long ReplyToMessageId { get; set; } + [JsonProperty("reply_to")] + public InputMessageReplyTo ReplyTo { get; set; } /// /// Options to be used to send the messages; pass null to use default options @@ -59,24 +59,17 @@ public class SendMessageAlbum : Function /// [JsonProperty("input_message_contents", ItemConverterType = typeof(Converter))] public InputMessageContent[] InputMessageContents { get; set; } - - /// - /// Pass true to get fake messages instead of actually sending them - /// - [JsonConverter(typeof(Converter))] - [JsonProperty("only_preview")] - public bool OnlyPreview { get; set; } } /// /// Sends 2-10 messages grouped together into an album. Currently, only audio, document, photo and video messages can be grouped into an album. Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages /// public static Task SendMessageAlbumAsync( - this Client client, long chatId = default, long messageThreadId = default, long replyToMessageId = default, MessageSendOptions options = default, InputMessageContent[] inputMessageContents = default, bool onlyPreview = default) + this Client client, long chatId = default, long messageThreadId = default, InputMessageReplyTo replyTo = default, MessageSendOptions options = default, InputMessageContent[] inputMessageContents = default) { return client.ExecuteAsync(new SendMessageAlbum { - ChatId = chatId, MessageThreadId = messageThreadId, ReplyToMessageId = replyToMessageId, Options = options, InputMessageContents = inputMessageContents, OnlyPreview = onlyPreview + ChatId = chatId, MessageThreadId = messageThreadId, ReplyTo = replyTo, Options = options, InputMessageContents = inputMessageContents }); } } diff --git a/TdLib.Api/Functions/SendStory.cs b/TdLib.Api/Functions/SendStory.cs new file mode 100644 index 00000000..d38e946f --- /dev/null +++ b/TdLib.Api/Functions/SendStory.cs @@ -0,0 +1,98 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Sends a new story to a chat; requires can_post_stories rights for channel chats. Returns a temporary story + /// + public class SendStory : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "sendStory"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of the chat that will post the story + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_id")] + public long ChatId { get; set; } + + /// + /// Content of the story + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("content")] + public InputStoryContent Content { get; set; } + + /// + /// Clickable rectangle areas to be shown on the story media; pass null if none + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("areas")] + public InputStoryAreas Areas { get; set; } + + /// + /// Story caption; pass null to use an empty caption; 0-getOption("story_caption_length_max") characters + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("caption")] + public FormattedText Caption { get; set; } + + /// + /// The privacy settings for the story + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("privacy_settings")] + public StoryPrivacySettings PrivacySettings { get; set; } + + /// + /// Period after which the story is moved to archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 for Telegram Premium users, and 86400 otherwise + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("active_period")] + public int ActivePeriod { get; set; } + + /// + /// Pass true to keep the story accessible after expiration + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("is_pinned")] + public bool IsPinned { get; set; } + + /// + /// Pass true if the content of the story must be protected from forwarding and screenshotting + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("protect_content")] + public bool ProtectContent { get; set; } + } + + /// + /// Sends a new story to a chat; requires can_post_stories rights for channel chats. Returns a temporary story + /// + public static Task SendStoryAsync( + this Client client, long chatId = default, InputStoryContent content = default, InputStoryAreas areas = default, FormattedText caption = default, StoryPrivacySettings privacySettings = default, int activePeriod = default, bool isPinned = default, bool protectContent = default) + { + return client.ExecuteAsync(new SendStory + { + ChatId = chatId, Content = content, Areas = areas, Caption = caption, PrivacySettings = privacySettings, ActivePeriod = activePeriod, IsPinned = isPinned, ProtectContent = protectContent + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/SendWebAppCustomRequest.cs b/TdLib.Api/Functions/SendWebAppCustomRequest.cs new file mode 100644 index 00000000..8a328305 --- /dev/null +++ b/TdLib.Api/Functions/SendWebAppCustomRequest.cs @@ -0,0 +1,63 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Sends a custom request from a Web App + /// + public class SendWebAppCustomRequest : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "sendWebAppCustomRequest"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of the bot + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("bot_user_id")] + public long BotUserId { get; set; } + + /// + /// The method name + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("method")] + public string Method { get; set; } + + /// + /// JSON-serialized method parameters + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("parameters")] + public string Parameters { get; set; } + } + + /// + /// Sends a custom request from a Web App + /// + public static Task SendWebAppCustomRequestAsync( + this Client client, long botUserId = default, string method = default, string parameters = default) + { + return client.ExecuteAsync(new SendWebAppCustomRequest + { + BotUserId = botUserId, Method = method, Parameters = parameters + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/SendWebAppData.cs b/TdLib.Api/Functions/SendWebAppData.cs index 1aa93176..24b7cb1f 100644 --- a/TdLib.Api/Functions/SendWebAppData.cs +++ b/TdLib.Api/Functions/SendWebAppData.cs @@ -41,7 +41,7 @@ public class SendWebAppData : Function public string ButtonText { get; set; } /// - /// Received data + /// The data /// [JsonConverter(typeof(Converter))] [JsonProperty("data")] diff --git a/TdLib.Api/Functions/SetAccentColor.cs b/TdLib.Api/Functions/SetAccentColor.cs new file mode 100644 index 00000000..80302b9d --- /dev/null +++ b/TdLib.Api/Functions/SetAccentColor.cs @@ -0,0 +1,56 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Changes accent color and background custom emoji for the current user; for Telegram Premium users only + /// + public class SetAccentColor : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "setAccentColor"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of the accent color to use + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("accent_color_id")] + public int AccentColorId { get; set; } + + /// + /// Identifier of a custom emoji to be shown on the reply header background; 0 if none + /// + [JsonConverter(typeof(Converter.Int64))] + [JsonProperty("background_custom_emoji_id")] + public long BackgroundCustomEmojiId { get; set; } + } + + /// + /// Changes accent color and background custom emoji for the current user; for Telegram Premium users only + /// + public static Task SetAccentColorAsync( + this Client client, int accentColorId = default, long backgroundCustomEmojiId = default) + { + return client.ExecuteAsync(new SetAccentColor + { + AccentColorId = accentColorId, BackgroundCustomEmojiId = backgroundCustomEmojiId + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/SetArchiveChatListSettings.cs b/TdLib.Api/Functions/SetArchiveChatListSettings.cs new file mode 100644 index 00000000..def348b1 --- /dev/null +++ b/TdLib.Api/Functions/SetArchiveChatListSettings.cs @@ -0,0 +1,49 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Changes settings for automatic moving of chats to and from the Archive chat lists + /// + public class SetArchiveChatListSettings : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "setArchiveChatListSettings"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// New settings + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("settings")] + public ArchiveChatListSettings Settings { get; set; } + } + + /// + /// Changes settings for automatic moving of chats to and from the Archive chat lists + /// + public static Task SetArchiveChatListSettingsAsync( + this Client client, ArchiveChatListSettings settings = default) + { + return client.ExecuteAsync(new SetArchiveChatListSettings + { + Settings = settings + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/SetBackground.cs b/TdLib.Api/Functions/SetBackground.cs index 20bb17b9..59d9f3f6 100644 --- a/TdLib.Api/Functions/SetBackground.cs +++ b/TdLib.Api/Functions/SetBackground.cs @@ -27,7 +27,7 @@ public class SetBackground : Function public override string Extra { get; set; } /// - /// The input background to use; pass null to create a new filled backgrounds or to remove the current background + /// The input background to use; pass null to create a new filled background or to remove the current background /// [JsonConverter(typeof(Converter))] [JsonProperty("background")] diff --git a/TdLib.Api/Functions/SetBotInfoDescription.cs b/TdLib.Api/Functions/SetBotInfoDescription.cs index a36026a4..e36f8781 100644 --- a/TdLib.Api/Functions/SetBotInfoDescription.cs +++ b/TdLib.Api/Functions/SetBotInfoDescription.cs @@ -10,7 +10,7 @@ namespace TdLib public static partial class TdApi { /// - /// Sets the text shown in the chat with the bot if the chat is empty; bots only + /// Sets the text shown in the chat with a bot if the chat is empty. Can be called only if userTypeBot.can_be_edited == true /// public class SetBotInfoDescription : Function { @@ -27,7 +27,14 @@ public class SetBotInfoDescription : Function public override string Extra { get; set; } /// - /// A two-letter ISO 639-1 language code. If empty, the description will be shown to all users, for which language there are no dedicated description + /// Identifier of the target bot + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("bot_user_id")] + public long BotUserId { get; set; } + + /// + /// A two-letter ISO 639-1 language code. If empty, the description will be shown to all users for whose languages there is no dedicated description /// [JsonConverter(typeof(Converter))] [JsonProperty("language_code")] @@ -42,14 +49,14 @@ public class SetBotInfoDescription : Function } /// - /// Sets the text shown in the chat with the bot if the chat is empty; bots only + /// Sets the text shown in the chat with a bot if the chat is empty. Can be called only if userTypeBot.can_be_edited == true /// public static Task SetBotInfoDescriptionAsync( - this Client client, string languageCode = default, string description = default) + this Client client, long botUserId = default, string languageCode = default, string description = default) { return client.ExecuteAsync(new SetBotInfoDescription { - LanguageCode = languageCode, Description = description + BotUserId = botUserId, LanguageCode = languageCode, Description = description }); } } diff --git a/TdLib.Api/Functions/SetBotInfoShortDescription.cs b/TdLib.Api/Functions/SetBotInfoShortDescription.cs index 59d429ff..5e246a30 100644 --- a/TdLib.Api/Functions/SetBotInfoShortDescription.cs +++ b/TdLib.Api/Functions/SetBotInfoShortDescription.cs @@ -10,7 +10,7 @@ namespace TdLib public static partial class TdApi { /// - /// Sets the text shown on the bot's profile page and sent together with the link when users share the bot; bots only + /// Sets the text shown on a bot's profile page and sent together with the link when users share the bot. Can be called only if userTypeBot.can_be_edited == true /// public class SetBotInfoShortDescription : Function { @@ -27,7 +27,14 @@ public class SetBotInfoShortDescription : Function public override string Extra { get; set; } /// - /// A two-letter ISO 639-1 language code. If empty, the short description will be shown to all users, for which language there are no dedicated description + /// Identifier of the target bot + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("bot_user_id")] + public long BotUserId { get; set; } + + /// + /// A two-letter ISO 639-1 language code. If empty, the short description will be shown to all users for whose languages there is no dedicated description /// [JsonConverter(typeof(Converter))] [JsonProperty("language_code")] @@ -42,14 +49,14 @@ public class SetBotInfoShortDescription : Function } /// - /// Sets the text shown on the bot's profile page and sent together with the link when users share the bot; bots only + /// Sets the text shown on a bot's profile page and sent together with the link when users share the bot. Can be called only if userTypeBot.can_be_edited == true /// public static Task SetBotInfoShortDescriptionAsync( - this Client client, string languageCode = default, string shortDescription = default) + this Client client, long botUserId = default, string languageCode = default, string shortDescription = default) { return client.ExecuteAsync(new SetBotInfoShortDescription { - LanguageCode = languageCode, ShortDescription = shortDescription + BotUserId = botUserId, LanguageCode = languageCode, ShortDescription = shortDescription }); } } diff --git a/TdLib.Api/Functions/SetBotName.cs b/TdLib.Api/Functions/SetBotName.cs new file mode 100644 index 00000000..2f7a36bc --- /dev/null +++ b/TdLib.Api/Functions/SetBotName.cs @@ -0,0 +1,63 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Sets the name of a bot. Can be called only if userTypeBot.can_be_edited == true + /// + public class SetBotName : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "setBotName"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of the target bot + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("bot_user_id")] + public long BotUserId { get; set; } + + /// + /// A two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose languages there is no dedicated name + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("language_code")] + public string LanguageCode { get; set; } + + /// + /// New bot's name on the specified language; 0-64 characters; must be non-empty if language code is empty + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("name")] + public string Name { get; set; } + } + + /// + /// Sets the name of a bot. Can be called only if userTypeBot.can_be_edited == true + /// + public static Task SetBotNameAsync( + this Client client, long botUserId = default, string languageCode = default, string name = default) + { + return client.ExecuteAsync(new SetBotName + { + BotUserId = botUserId, LanguageCode = languageCode, Name = name + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/SetBotProfilePhoto.cs b/TdLib.Api/Functions/SetBotProfilePhoto.cs new file mode 100644 index 00000000..c3ac663f --- /dev/null +++ b/TdLib.Api/Functions/SetBotProfilePhoto.cs @@ -0,0 +1,56 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Changes a profile photo for a bot + /// + public class SetBotProfilePhoto : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "setBotProfilePhoto"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of the target bot + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("bot_user_id")] + public long BotUserId { get; set; } + + /// + /// Profile photo to set; pass null to delete the chat photo + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("photo")] + public InputChatPhoto Photo { get; set; } + } + + /// + /// Changes a profile photo for a bot + /// + public static Task SetBotProfilePhotoAsync( + this Client client, long botUserId = default, InputChatPhoto photo = default) + { + return client.ExecuteAsync(new SetBotProfilePhoto + { + BotUserId = botUserId, Photo = photo + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/SetChatAccentColor.cs b/TdLib.Api/Functions/SetChatAccentColor.cs new file mode 100644 index 00000000..260211b0 --- /dev/null +++ b/TdLib.Api/Functions/SetChatAccentColor.cs @@ -0,0 +1,63 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Changes accent color and background custom emoji of a chat. Supported only for channels with getOption("channel_custom_accent_color_boost_level_min") boost level. Requires can_change_info administrator right + /// + public class SetChatAccentColor : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "setChatAccentColor"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Chat identifier + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_id")] + public long ChatId { get; set; } + + /// + /// Identifier of the accent color to use + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("accent_color_id")] + public int AccentColorId { get; set; } + + /// + /// Identifier of a custom emoji to be shown on the reply header background; 0 if none + /// + [JsonConverter(typeof(Converter.Int64))] + [JsonProperty("background_custom_emoji_id")] + public long BackgroundCustomEmojiId { get; set; } + } + + /// + /// Changes accent color and background custom emoji of a chat. Supported only for channels with getOption("channel_custom_accent_color_boost_level_min") boost level. Requires can_change_info administrator right + /// + public static Task SetChatAccentColorAsync( + this Client client, long chatId = default, int accentColorId = default, long backgroundCustomEmojiId = default) + { + return client.ExecuteAsync(new SetChatAccentColor + { + ChatId = chatId, AccentColorId = accentColorId, BackgroundCustomEmojiId = backgroundCustomEmojiId + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/SetChatActiveStoriesList.cs b/TdLib.Api/Functions/SetChatActiveStoriesList.cs new file mode 100644 index 00000000..c2a422a2 --- /dev/null +++ b/TdLib.Api/Functions/SetChatActiveStoriesList.cs @@ -0,0 +1,56 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Changes story list in which stories from the chat are shown + /// + public class SetChatActiveStoriesList : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "setChatActiveStoriesList"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of the chat that posted stories + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_id")] + public long ChatId { get; set; } + + /// + /// New list for active stories posted by the chat + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_list")] + public StoryList StoryList { get; set; } + } + + /// + /// Changes story list in which stories from the chat are shown + /// + public static Task SetChatActiveStoriesListAsync( + this Client client, long chatId = default, StoryList storyList = default) + { + return client.ExecuteAsync(new SetChatActiveStoriesList + { + ChatId = chatId, StoryList = storyList + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/SetChatBackground.cs b/TdLib.Api/Functions/SetChatBackground.cs new file mode 100644 index 00000000..82203e5d --- /dev/null +++ b/TdLib.Api/Functions/SetChatBackground.cs @@ -0,0 +1,70 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Changes the background in a specific chat. Supported only in private and secret chats with non-deleted users + /// + public class SetChatBackground : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "setChatBackground"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Chat identifier + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_id")] + public long ChatId { get; set; } + + /// + /// The input background to use; pass null to create a new filled background or to remove the current background + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("background")] + public InputBackground Background { get; set; } + + /// + /// Background type; pass null to remove the current background + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("type")] + public BackgroundType Type { get; set; } + + /// + /// Dimming of the background in dark themes, as a percentage; 0-100 + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("dark_theme_dimming")] + public int DarkThemeDimming { get; set; } + } + + /// + /// Changes the background in a specific chat. Supported only in private and secret chats with non-deleted users + /// + public static Task SetChatBackgroundAsync( + this Client client, long chatId = default, InputBackground background = default, BackgroundType type = default, int darkThemeDimming = default) + { + return client.ExecuteAsync(new SetChatBackground + { + ChatId = chatId, Background = background, Type = type, DarkThemeDimming = darkThemeDimming + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/SetCloseFriends.cs b/TdLib.Api/Functions/SetCloseFriends.cs new file mode 100644 index 00000000..e8c47520 --- /dev/null +++ b/TdLib.Api/Functions/SetCloseFriends.cs @@ -0,0 +1,48 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Changes the list of close friends of the current user + /// + public class SetCloseFriends : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "setCloseFriends"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// User identifiers of close friends; the users must be contacts of the current user + /// + [JsonProperty("user_ids", ItemConverterType = typeof(Converter))] + public long[] UserIds { get; set; } + } + + /// + /// Changes the list of close friends of the current user + /// + public static Task SetCloseFriendsAsync( + this Client client, long[] userIds = default) + { + return client.ExecuteAsync(new SetCloseFriends + { + UserIds = userIds + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/SetCustomLanguagePack.cs b/TdLib.Api/Functions/SetCustomLanguagePack.cs index f182558b..76252196 100644 --- a/TdLib.Api/Functions/SetCustomLanguagePack.cs +++ b/TdLib.Api/Functions/SetCustomLanguagePack.cs @@ -27,7 +27,7 @@ public class SetCustomLanguagePack : Function public override string Extra { get; set; } /// - /// Information about the language pack. Language pack ID must start with 'X', consist only of English letters, digits and hyphens, and must not exceed 64 characters. Can be called before authorization + /// Information about the language pack. Language pack identifier must start with 'X', consist only of English letters, digits and hyphens, and must not exceed 64 characters. Can be called before authorization /// [JsonConverter(typeof(Converter))] [JsonProperty("info")] diff --git a/TdLib.Api/Functions/SetDefaultChannelAdministratorRights.cs b/TdLib.Api/Functions/SetDefaultChannelAdministratorRights.cs index 85c2da2a..f8ea4ed5 100644 --- a/TdLib.Api/Functions/SetDefaultChannelAdministratorRights.cs +++ b/TdLib.Api/Functions/SetDefaultChannelAdministratorRights.cs @@ -27,7 +27,7 @@ public class SetDefaultChannelAdministratorRights : Function public override string Extra { get; set; } /// - /// Default administrator rights for adding the bot to channels; may be null + /// Default administrator rights for adding the bot to channels; pass null to remove default rights /// [JsonConverter(typeof(Converter))] [JsonProperty("default_channel_administrator_rights")] diff --git a/TdLib.Api/Functions/SetDefaultGroupAdministratorRights.cs b/TdLib.Api/Functions/SetDefaultGroupAdministratorRights.cs index fed91dea..33ffa9f3 100644 --- a/TdLib.Api/Functions/SetDefaultGroupAdministratorRights.cs +++ b/TdLib.Api/Functions/SetDefaultGroupAdministratorRights.cs @@ -27,7 +27,7 @@ public class SetDefaultGroupAdministratorRights : Function public override string Extra { get; set; } /// - /// Default administrator rights for adding the bot to basic group and supergroup chats; may be null + /// Default administrator rights for adding the bot to basic group and supergroup chats; pass null to remove default rights /// [JsonConverter(typeof(Converter))] [JsonProperty("default_group_administrator_rights")] diff --git a/TdLib.Api/Functions/SetEmojiStatus.cs b/TdLib.Api/Functions/SetEmojiStatus.cs index d075ee26..d2605c05 100644 --- a/TdLib.Api/Functions/SetEmojiStatus.cs +++ b/TdLib.Api/Functions/SetEmojiStatus.cs @@ -32,24 +32,17 @@ public class SetEmojiStatus : Function [JsonConverter(typeof(Converter))] [JsonProperty("emoji_status")] public EmojiStatus EmojiStatus { get; set; } - - /// - /// Duration of the status, in seconds; pass 0 to keep the status active until it will be changed manually - /// - [JsonConverter(typeof(Converter))] - [JsonProperty("duration")] - public int Duration { get; set; } } /// /// Changes the emoji status of the current user; for Telegram Premium users only /// public static Task SetEmojiStatusAsync( - this Client client, EmojiStatus emojiStatus = default, int duration = default) + this Client client, EmojiStatus emojiStatus = default) { return client.ExecuteAsync(new SetEmojiStatus { - EmojiStatus = emojiStatus, Duration = duration + EmojiStatus = emojiStatus }); } } diff --git a/TdLib.Api/Functions/ToggleMessageSenderIsBlocked.cs b/TdLib.Api/Functions/SetMessageSenderBlockList.cs similarity index 58% rename from TdLib.Api/Functions/ToggleMessageSenderIsBlocked.cs rename to TdLib.Api/Functions/SetMessageSenderBlockList.cs index 30cc3208..c36dc2b0 100644 --- a/TdLib.Api/Functions/ToggleMessageSenderIsBlocked.cs +++ b/TdLib.Api/Functions/SetMessageSenderBlockList.cs @@ -10,15 +10,15 @@ namespace TdLib public static partial class TdApi { /// - /// Changes the block state of a message sender. Currently, only users and supergroup chats can be blocked + /// Changes the block list of a message sender. Currently, only users and supergroup chats can be blocked /// - public class ToggleMessageSenderIsBlocked : Function + public class SetMessageSenderBlockList : Function { /// /// Data type for serialization /// [JsonProperty("@type")] - public override string DataType { get; set; } = "toggleMessageSenderIsBlocked"; + public override string DataType { get; set; } = "setMessageSenderBlockList"; /// /// Extra data attached to the function @@ -34,22 +34,22 @@ public class ToggleMessageSenderIsBlocked : Function public MessageSender SenderId { get; set; } /// - /// New value of is_blocked + /// New block list for the message sender; pass null to unblock the message sender /// [JsonConverter(typeof(Converter))] - [JsonProperty("is_blocked")] - public bool IsBlocked { get; set; } + [JsonProperty("block_list")] + public BlockList BlockList { get; set; } } /// - /// Changes the block state of a message sender. Currently, only users and supergroup chats can be blocked + /// Changes the block list of a message sender. Currently, only users and supergroup chats can be blocked /// - public static Task ToggleMessageSenderIsBlockedAsync( - this Client client, MessageSender senderId = default, bool isBlocked = default) + public static Task SetMessageSenderBlockListAsync( + this Client client, MessageSender senderId = default, BlockList blockList = default) { - return client.ExecuteAsync(new ToggleMessageSenderIsBlocked + return client.ExecuteAsync(new SetMessageSenderBlockList { - SenderId = senderId, IsBlocked = isBlocked + SenderId = senderId, BlockList = blockList }); } } diff --git a/TdLib.Api/Functions/SetStoryPrivacySettings.cs b/TdLib.Api/Functions/SetStoryPrivacySettings.cs new file mode 100644 index 00000000..54e324c8 --- /dev/null +++ b/TdLib.Api/Functions/SetStoryPrivacySettings.cs @@ -0,0 +1,63 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Changes privacy settings of a story. Can be called only if story.can_be_edited == true + /// + public class SetStoryPrivacySettings : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "setStoryPrivacySettings"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of the chat that posted the story + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_sender_chat_id")] + public long StorySenderChatId { get; set; } + + /// + /// Identifier of the story + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_id")] + public int StoryId { get; set; } + + /// + /// The new privacy settigs for the story + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("privacy_settings")] + public StoryPrivacySettings PrivacySettings { get; set; } + } + + /// + /// Changes privacy settings of a story. Can be called only if story.can_be_edited == true + /// + public static Task SetStoryPrivacySettingsAsync( + this Client client, long storySenderChatId = default, int storyId = default, StoryPrivacySettings privacySettings = default) + { + return client.ExecuteAsync(new SetStoryPrivacySettings + { + StorySenderChatId = storySenderChatId, StoryId = storyId, PrivacySettings = privacySettings + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/SetStoryReaction.cs b/TdLib.Api/Functions/SetStoryReaction.cs new file mode 100644 index 00000000..0c6b533c --- /dev/null +++ b/TdLib.Api/Functions/SetStoryReaction.cs @@ -0,0 +1,70 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Changes chosen reaction on a story + /// + public class SetStoryReaction : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "setStoryReaction"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// The identifier of the sender of the story + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_sender_chat_id")] + public long StorySenderChatId { get; set; } + + /// + /// The identifier of the story + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_id")] + public int StoryId { get; set; } + + /// + /// Type of the reaction to set; pass null to remove the reaction. `reactionTypeCustomEmoji` reactions can be used only by Telegram Premium users + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("reaction_type")] + public ReactionType ReactionType { get; set; } + + /// + /// Pass true if the reaction needs to be added to recent reactions + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("update_recent_reactions")] + public bool UpdateRecentReactions { get; set; } + } + + /// + /// Changes chosen reaction on a story + /// + public static Task SetStoryReactionAsync( + this Client client, long storySenderChatId = default, int storyId = default, ReactionType reactionType = default, bool updateRecentReactions = default) + { + return client.ExecuteAsync(new SetStoryReaction + { + StorySenderChatId = storySenderChatId, StoryId = storyId, ReactionType = reactionType, UpdateRecentReactions = updateRecentReactions + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/StopPoll.cs b/TdLib.Api/Functions/StopPoll.cs index 41ad69a3..ad2c4538 100644 --- a/TdLib.Api/Functions/StopPoll.cs +++ b/TdLib.Api/Functions/StopPoll.cs @@ -10,7 +10,7 @@ namespace TdLib public static partial class TdApi { /// - /// Stops a poll. A poll in a message can be stopped when the message has can_be_edited flag set + /// Stops a poll. A poll in a message can be stopped when the message has can_be_edited flag is set /// public class StopPoll : Function { @@ -49,7 +49,7 @@ public class StopPoll : Function } /// - /// Stops a poll. A poll in a message can be stopped when the message has can_be_edited flag set + /// Stops a poll. A poll in a message can be stopped when the message has can_be_edited flag is set /// public static Task StopPollAsync( this Client client, long chatId = default, long messageId = default, ReplyMarkup replyMarkup = default) diff --git a/TdLib.Api/Functions/SynchronizeLanguagePack.cs b/TdLib.Api/Functions/SynchronizeLanguagePack.cs index 08a3106d..8c12253f 100644 --- a/TdLib.Api/Functions/SynchronizeLanguagePack.cs +++ b/TdLib.Api/Functions/SynchronizeLanguagePack.cs @@ -10,7 +10,8 @@ namespace TdLib public static partial class TdApi { /// - /// Fetches the latest versions of all strings from a language pack in the current localization target from the server. This method doesn't need to be called explicitly for the current used/base language packs. Can be called before authorization + /// Fetches the latest versions of all strings from a language pack in the current localization target from the server. + /// This method doesn't need to be called explicitly for the current used/base language packs. Can be called before authorization /// public class SynchronizeLanguagePack : Function { @@ -35,7 +36,8 @@ public class SynchronizeLanguagePack : Function } /// - /// Fetches the latest versions of all strings from a language pack in the current localization target from the server. This method doesn't need to be called explicitly for the current used/base language packs. Can be called before authorization + /// Fetches the latest versions of all strings from a language pack in the current localization target from the server. + /// This method doesn't need to be called explicitly for the current used/base language packs. Can be called before authorization /// public static Task SynchronizeLanguagePackAsync( this Client client, string languagePackId = default) diff --git a/TdLib.Api/Functions/TestProxy.cs b/TdLib.Api/Functions/TestProxy.cs index 880d9c12..34d7af77 100644 --- a/TdLib.Api/Functions/TestProxy.cs +++ b/TdLib.Api/Functions/TestProxy.cs @@ -27,7 +27,7 @@ public class TestProxy : Function public override string Extra { get; set; } /// - /// Proxy server IP address + /// Proxy server domain or IP address /// [JsonConverter(typeof(Converter))] [JsonProperty("server")] diff --git a/TdLib.Api/Functions/ToggleBotIsAddedToAttachmentMenu.cs b/TdLib.Api/Functions/ToggleBotIsAddedToAttachmentMenu.cs index ee734f42..a26cf305 100644 --- a/TdLib.Api/Functions/ToggleBotIsAddedToAttachmentMenu.cs +++ b/TdLib.Api/Functions/ToggleBotIsAddedToAttachmentMenu.cs @@ -10,7 +10,7 @@ namespace TdLib public static partial class TdApi { /// - /// Adds or removes a bot to attachment menu. Bot can be added to attachment menu, only if userTypeBot.can_be_added_to_attachment_menu == true + /// Adds or removes a bot to attachment and side menu. Bot can be added to the menu, only if userTypeBot.can_be_added_to_attachment_menu == true /// public class ToggleBotIsAddedToAttachmentMenu : Function { @@ -49,7 +49,7 @@ public class ToggleBotIsAddedToAttachmentMenu : Function } /// - /// Adds or removes a bot to attachment menu. Bot can be added to attachment menu, only if userTypeBot.can_be_added_to_attachment_menu == true + /// Adds or removes a bot to attachment and side menu. Bot can be added to the menu, only if userTypeBot.can_be_added_to_attachment_menu == true /// public static Task ToggleBotIsAddedToAttachmentMenuAsync( this Client client, long botUserId = default, bool isAdded = default, bool allowWriteAccess = default) diff --git a/TdLib.Api/Functions/ToggleBotUsernameIsActive.cs b/TdLib.Api/Functions/ToggleBotUsernameIsActive.cs new file mode 100644 index 00000000..4984776a --- /dev/null +++ b/TdLib.Api/Functions/ToggleBotUsernameIsActive.cs @@ -0,0 +1,63 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Changes active state for a username of a bot. The editable username can't be disabled. May return an error with a message "USERNAMES_ACTIVE_TOO_MUCH" if the maximum number of active usernames has been reached. Can be called only if userTypeBot.can_be_edited == true + /// + public class ToggleBotUsernameIsActive : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "toggleBotUsernameIsActive"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of the target bot + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("bot_user_id")] + public long BotUserId { get; set; } + + /// + /// The username to change + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("username")] + public string Username { get; set; } + + /// + /// Pass true to activate the username; pass false to disable it + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("is_active")] + public bool IsActive { get; set; } + } + + /// + /// Changes active state for a username of a bot. The editable username can't be disabled. May return an error with a message "USERNAMES_ACTIVE_TOO_MUCH" if the maximum number of active usernames has been reached. Can be called only if userTypeBot.can_be_edited == true + /// + public static Task ToggleBotUsernameIsActiveAsync( + this Client client, long botUserId = default, string username = default, bool isActive = default) + { + return client.ExecuteAsync(new ToggleBotUsernameIsActive + { + BotUserId = botUserId, Username = username, IsActive = isActive + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Functions/ToggleGroupCallEnabledStartNotification.cs b/TdLib.Api/Functions/ToggleGroupCallEnabledStartNotification.cs index 61f1880e..94c266b9 100644 --- a/TdLib.Api/Functions/ToggleGroupCallEnabledStartNotification.cs +++ b/TdLib.Api/Functions/ToggleGroupCallEnabledStartNotification.cs @@ -10,7 +10,7 @@ namespace TdLib public static partial class TdApi { /// - /// Toggles whether the current user will receive a notification when the group call will start; scheduled group calls only + /// Toggles whether the current user will receive a notification when the group call starts; scheduled group calls only /// public class ToggleGroupCallEnabledStartNotification : Function { @@ -42,7 +42,7 @@ public class ToggleGroupCallEnabledStartNotification : Function } /// - /// Toggles whether the current user will receive a notification when the group call will start; scheduled group calls only + /// Toggles whether the current user will receive a notification when the group call starts; scheduled group calls only /// public static Task ToggleGroupCallEnabledStartNotificationAsync( this Client client, int groupCallId = default, bool enabledStartNotification = default) diff --git a/TdLib.Api/Functions/ToggleGroupCallParticipantIsMuted.cs b/TdLib.Api/Functions/ToggleGroupCallParticipantIsMuted.cs index 84e91bc9..12e8c9f6 100644 --- a/TdLib.Api/Functions/ToggleGroupCallParticipantIsMuted.cs +++ b/TdLib.Api/Functions/ToggleGroupCallParticipantIsMuted.cs @@ -41,7 +41,7 @@ public class ToggleGroupCallParticipantIsMuted : Function public MessageSender ParticipantId { get; set; } /// - /// Pass true to mute the user; pass false to unmute the them + /// Pass true to mute the user; pass false to unmute them /// [JsonConverter(typeof(Converter))] [JsonProperty("is_muted")] diff --git a/TdLib.Api/Functions/ToggleStoryIsPinned.cs b/TdLib.Api/Functions/ToggleStoryIsPinned.cs new file mode 100644 index 00000000..25393fe3 --- /dev/null +++ b/TdLib.Api/Functions/ToggleStoryIsPinned.cs @@ -0,0 +1,63 @@ +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Toggles whether a story is accessible after expiration. Can be called only if story.can_toggle_is_pinned == true + /// + public class ToggleStoryIsPinned : Function + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "toggleStoryIsPinned"; + + /// + /// Extra data attached to the function + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of the chat that posted the story + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_sender_chat_id")] + public long StorySenderChatId { get; set; } + + /// + /// Identifier of the story + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_id")] + public int StoryId { get; set; } + + /// + /// Pass true to make the story accessible after expiration; pass false to make it private + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("is_pinned")] + public bool IsPinned { get; set; } + } + + /// + /// Toggles whether a story is accessible after expiration. Can be called only if story.can_toggle_is_pinned == true + /// + public static Task ToggleStoryIsPinnedAsync( + this Client client, long storySenderChatId = default, int storyId = default, bool isPinned = default) + { + return client.ExecuteAsync(new ToggleStoryIsPinned + { + StorySenderChatId = storySenderChatId, StoryId = storyId, IsPinned = isPinned + }); + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/AccentColor.cs b/TdLib.Api/Objects/AccentColor.cs new file mode 100644 index 00000000..d199df98 --- /dev/null +++ b/TdLib.Api/Objects/AccentColor.cs @@ -0,0 +1,55 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Contains information about supported accent color for user/chat name, background of empty chat photo, replies to messages and link previews + /// + public partial class AccentColor : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "accentColor"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Accent color identifier + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("id")] + public int Id { get; set; } + + /// + /// Identifier of a built-in color to use in places, where only one color is needed; 0-6 + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("built_in_accent_color_id")] + public int BuiltInAccentColorId { get; set; } + + /// + /// The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in light themes + /// + [JsonProperty("light_theme_colors", ItemConverterType = typeof(Converter))] + public int[] LightThemeColors { get; set; } + + /// + /// The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in dark themes + /// + [JsonProperty("dark_theme_colors", ItemConverterType = typeof(Converter))] + public int[] DarkThemeColors { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/AddedReaction.cs b/TdLib.Api/Objects/AddedReaction.cs index 3bab90da..b386fdcc 100644 --- a/TdLib.Api/Objects/AddedReaction.cs +++ b/TdLib.Api/Objects/AddedReaction.cs @@ -39,6 +39,13 @@ public partial class AddedReaction : Object [JsonProperty("sender_id")] public MessageSender SenderId { get; set; } + /// + /// True, if the reaction was added by the current user + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("is_outgoing")] + public bool IsOutgoing { get; set; } + /// /// Point in time (Unix timestamp) when the reaction was added /// diff --git a/TdLib.Api/Objects/ArchiveChatListSettings.cs b/TdLib.Api/Objects/ArchiveChatListSettings.cs new file mode 100644 index 00000000..6be664bf --- /dev/null +++ b/TdLib.Api/Objects/ArchiveChatListSettings.cs @@ -0,0 +1,50 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Contains settings for automatic moving of chats to and from the Archive chat lists + /// + public partial class ArchiveChatListSettings : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "archiveChatListSettings"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// True, if new chats from non-contacts will be automatically archived and muted. Can be set to true only if the option "can_archive_and_mute_new_chats_from_unknown_users" is true + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("archive_and_mute_new_chats_from_unknown_users")] + public bool ArchiveAndMuteNewChatsFromUnknownUsers { get; set; } + + /// + /// True, if unmuted chats will be kept in the Archive chat list when they get a new message + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("keep_unmuted_chats_archived")] + public bool KeepUnmutedChatsArchived { get; set; } + + /// + /// True, if unmuted chats, that are always included or pinned in a folder, will be kept in the Archive chat list when they get a new message. Ignored if keep_unmuted_chats_archived == true + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("keep_chats_from_folders_archived")] + public bool KeepChatsFromFoldersArchived { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/AttachmentMenuBot.cs b/TdLib.Api/Objects/AttachmentMenuBot.cs index 0d77bdd9..23e93400 100644 --- a/TdLib.Api/Objects/AttachmentMenuBot.cs +++ b/TdLib.Api/Objects/AttachmentMenuBot.cs @@ -9,7 +9,7 @@ namespace TdLib public static partial class TdApi { /// - /// Represents a bot, which can be added to attachment menu + /// Represents a bot, which can be added to attachment or side menu /// public partial class AttachmentMenuBot : Object { @@ -26,7 +26,7 @@ public partial class AttachmentMenuBot : Object public override string Extra { get; set; } /// - /// User identifier of the bot added to attachment menu + /// User identifier of the bot /// [JsonConverter(typeof(Converter))] [JsonProperty("bot_user_id")] @@ -68,18 +68,39 @@ public partial class AttachmentMenuBot : Object public bool SupportsChannelChats { get; set; } /// - /// True, if the bot supports "settings_button_pressed" event + /// True, if the user must be asked for the permission to send messages to the bot /// [JsonConverter(typeof(Converter))] - [JsonProperty("supports_settings")] - public bool SupportsSettings { get; set; } + [JsonProperty("request_write_access")] + public bool RequestWriteAccess { get; set; } /// - /// True, if the user must be asked for the permission to the bot to send them messages + /// True, if the bot was explicitly added by the user. If the bot isn't added, then on the first bot launch toggleBotIsAddedToAttachmentMenu must be called and the bot must be added or removed /// [JsonConverter(typeof(Converter))] - [JsonProperty("request_write_access")] - public bool RequestWriteAccess { get; set; } + [JsonProperty("is_added")] + public bool IsAdded { get; set; } + + /// + /// True, if the bot must be shown in the attachment menu + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("show_in_attachment_menu")] + public bool ShowInAttachmentMenu { get; set; } + + /// + /// True, if the bot must be shown in the side menu + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("show_in_side_menu")] + public bool ShowInSideMenu { get; set; } + + /// + /// True, if a disclaimer, why the bot is shown in the side menu, is needed + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("show_disclaimer_in_side_menu")] + public bool ShowDisclaimerInSideMenu { get; set; } /// /// Name for the bot in attachment menu @@ -96,40 +117,61 @@ public partial class AttachmentMenuBot : Object public AttachmentMenuBotColor NameColor { get; set; } /// - /// Default attachment menu icon for the bot in SVG format; may be null + /// Default icon for the bot in SVG format; may be null /// [JsonConverter(typeof(Converter))] [JsonProperty("default_icon")] public File DefaultIcon { get; set; } /// - /// Attachment menu icon for the bot in SVG format for the official iOS app; may be null + /// Icon for the bot in SVG format for the official iOS app; may be null /// [JsonConverter(typeof(Converter))] [JsonProperty("ios_static_icon")] public File IosStaticIcon { get; set; } /// - /// Attachment menu icon for the bot in TGS format for the official iOS app; may be null + /// Icon for the bot in TGS format for the official iOS app; may be null /// [JsonConverter(typeof(Converter))] [JsonProperty("ios_animated_icon")] public File IosAnimatedIcon { get; set; } /// - /// Attachment menu icon for the bot in TGS format for the official Android app; may be null + /// Icon for the bot in PNG format for the official iOS app side menu; may be null + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("ios_side_menu_icon")] + public File IosSideMenuIcon { get; set; } + + /// + /// Icon for the bot in TGS format for the official Android app; may be null /// [JsonConverter(typeof(Converter))] [JsonProperty("android_icon")] public File AndroidIcon { get; set; } /// - /// Attachment menu icon for the bot in TGS format for the official native macOS app; may be null + /// Icon for the bot in SVG format for the official Android app side menu; may be null + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("android_side_menu_icon")] + public File AndroidSideMenuIcon { get; set; } + + /// + /// Icon for the bot in TGS format for the official native macOS app; may be null /// [JsonConverter(typeof(Converter))] [JsonProperty("macos_icon")] public File MacosIcon { get; set; } + /// + /// Icon for the bot in PNG format for the official macOS app side menu; may be null + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("macos_side_menu_icon")] + public File MacosSideMenuIcon { get; set; } + /// /// Color to highlight selected icon of the bot if appropriate; may be null /// diff --git a/TdLib.Api/Objects/AutoDownloadSettings.cs b/TdLib.Api/Objects/AutoDownloadSettings.cs index cf6bf8fc..f21e6238 100644 --- a/TdLib.Api/Objects/AutoDownloadSettings.cs +++ b/TdLib.Api/Objects/AutoDownloadSettings.cs @@ -74,6 +74,13 @@ public partial class AutoDownloadSettings : Object [JsonProperty("preload_next_audio")] public bool PreloadNextAudio { get; set; } + /// + /// True, if stories needs to be preloaded + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("preload_stories")] + public bool PreloadStories { get; set; } + /// /// True, if "use less data for calls" option needs to be enabled /// diff --git a/TdLib.Api/Objects/BlockListMain.cs b/TdLib.Api/Objects/BlockListMain.cs new file mode 100644 index 00000000..e5dd2500 --- /dev/null +++ b/TdLib.Api/Objects/BlockListMain.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class BlockList : Object + { + /// + /// Describes a type of a block list + /// + public class BlockListMain : BlockList + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "blockListMain"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/BlockListStories.cs b/TdLib.Api/Objects/BlockListStories.cs new file mode 100644 index 00000000..fbe3d22e --- /dev/null +++ b/TdLib.Api/Objects/BlockListStories.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class BlockList : Object + { + /// + /// The block list that disallows viewing of stories of the current user + /// + public class BlockListStories : BlockList + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "blockListStories"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/BotInfo.cs b/TdLib.Api/Objects/BotInfo.cs index eec21d35..6dc6fdce 100644 --- a/TdLib.Api/Objects/BotInfo.cs +++ b/TdLib.Api/Objects/BotInfo.cs @@ -79,6 +79,34 @@ public partial class BotInfo : Object [JsonConverter(typeof(Converter))] [JsonProperty("default_channel_administrator_rights")] public ChatAdministratorRights DefaultChannelAdministratorRights { get; set; } + + /// + /// The internal link, which can be used to edit bot commands; may be null + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("edit_commands_link")] + public InternalLinkType EditCommandsLink { get; set; } + + /// + /// The internal link, which can be used to edit bot description; may be null + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("edit_description_link")] + public InternalLinkType EditDescriptionLink { get; set; } + + /// + /// The internal link, which can be used to edit the photo or animation shown in the chat with the bot if the chat is empty; may be null + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("edit_description_media_link")] + public InternalLinkType EditDescriptionMediaLink { get; set; } + + /// + /// The internal link, which can be used to edit bot settings; may be null + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("edit_settings_link")] + public InternalLinkType EditSettingsLink { get; set; } } } } \ No newline at end of file diff --git a/TdLib.Api/Objects/BotWriteAccessAllowReasonAcceptedRequest.cs b/TdLib.Api/Objects/BotWriteAccessAllowReasonAcceptedRequest.cs new file mode 100644 index 00000000..4f9b1cde --- /dev/null +++ b/TdLib.Api/Objects/BotWriteAccessAllowReasonAcceptedRequest.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class BotWriteAccessAllowReason : Object + { + /// + /// The user accepted bot's request to send messages with allowBotToSendMessages + /// + public class BotWriteAccessAllowReasonAcceptedRequest : BotWriteAccessAllowReason + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "botWriteAccessAllowReasonAcceptedRequest"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/BotWriteAccessAllowReasonAddedToAttachmentMenu.cs b/TdLib.Api/Objects/BotWriteAccessAllowReasonAddedToAttachmentMenu.cs new file mode 100644 index 00000000..de935585 --- /dev/null +++ b/TdLib.Api/Objects/BotWriteAccessAllowReasonAddedToAttachmentMenu.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class BotWriteAccessAllowReason : Object + { + /// + /// The user added the bot to attachment or side menu using toggleBotIsAddedToAttachmentMenu + /// + public class BotWriteAccessAllowReasonAddedToAttachmentMenu : BotWriteAccessAllowReason + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "botWriteAccessAllowReasonAddedToAttachmentMenu"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/MessageWebsiteConnected.cs b/TdLib.Api/Objects/BotWriteAccessAllowReasonConnectedWebsite.cs similarity index 76% rename from TdLib.Api/Objects/MessageWebsiteConnected.cs rename to TdLib.Api/Objects/BotWriteAccessAllowReasonConnectedWebsite.cs index fc6fd2ec..4a2b9892 100644 --- a/TdLib.Api/Objects/MessageWebsiteConnected.cs +++ b/TdLib.Api/Objects/BotWriteAccessAllowReasonConnectedWebsite.cs @@ -8,18 +8,18 @@ namespace TdLib /// public static partial class TdApi { - public partial class MessageContent : Object + public partial class BotWriteAccessAllowReason : Object { /// - /// The current user has connected a website by logging in using Telegram Login Widget on it + /// Describes a reason why a bot was allowed to write messages to the current user /// - public class MessageWebsiteConnected : MessageContent + public class BotWriteAccessAllowReasonConnectedWebsite : BotWriteAccessAllowReason { /// /// Data type for serialization /// [JsonProperty("@type")] - public override string DataType { get; set; } = "messageWebsiteConnected"; + public override string DataType { get; set; } = "botWriteAccessAllowReasonConnectedWebsite"; /// /// Extra data attached to the message diff --git a/TdLib.Api/Objects/BotWriteAccessAllowReasonLaunchedWebApp.cs b/TdLib.Api/Objects/BotWriteAccessAllowReasonLaunchedWebApp.cs new file mode 100644 index 00000000..2fc39a7f --- /dev/null +++ b/TdLib.Api/Objects/BotWriteAccessAllowReasonLaunchedWebApp.cs @@ -0,0 +1,39 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class BotWriteAccessAllowReason : Object + { + /// + /// The user launched a Web App using getWebAppLinkUrl + /// + public class BotWriteAccessAllowReasonLaunchedWebApp : BotWriteAccessAllowReason + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "botWriteAccessAllowReasonLaunchedWebApp"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Information about the Web App + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("web_app")] + public WebApp WebApp { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/Call.cs b/TdLib.Api/Objects/Call.cs index b3e03128..533df9ed 100644 --- a/TdLib.Api/Objects/Call.cs +++ b/TdLib.Api/Objects/Call.cs @@ -33,7 +33,7 @@ public partial class Call : Object public int Id { get; set; } /// - /// Peer user identifier + /// User identifier of the other call participant /// [JsonConverter(typeof(Converter))] [JsonProperty("user_id")] diff --git a/TdLib.Api/Objects/CallProtocol.cs b/TdLib.Api/Objects/CallProtocol.cs index b466fbad..1a52dfae 100644 --- a/TdLib.Api/Objects/CallProtocol.cs +++ b/TdLib.Api/Objects/CallProtocol.cs @@ -47,7 +47,7 @@ public partial class CallProtocol : Object public int MinLayer { get; set; } /// - /// The maximum supported API layer; use 65 + /// The maximum supported API layer; use 92 /// [JsonConverter(typeof(Converter))] [JsonProperty("max_layer")] diff --git a/TdLib.Api/Objects/CallStateDiscarded.cs b/TdLib.Api/Objects/CallStateDiscarded.cs index 70729d22..76e1e562 100644 --- a/TdLib.Api/Objects/CallStateDiscarded.cs +++ b/TdLib.Api/Objects/CallStateDiscarded.cs @@ -28,7 +28,7 @@ public class CallStateDiscarded : CallState public override string Extra { get; set; } /// - /// The reason, why the call has ended + /// The reason why the call has ended /// [JsonConverter(typeof(Converter))] [JsonProperty("reason")] diff --git a/TdLib.Api/Objects/CallStateReady.cs b/TdLib.Api/Objects/CallStateReady.cs index 0ac04002..e18d7858 100644 --- a/TdLib.Api/Objects/CallStateReady.cs +++ b/TdLib.Api/Objects/CallStateReady.cs @@ -28,7 +28,7 @@ public class CallStateReady : CallState public override string Extra { get; set; } /// - /// Call protocols supported by the peer + /// Call protocols supported by the other call participant /// [JsonConverter(typeof(Converter))] [JsonProperty("protocol")] diff --git a/TdLib.Api/Objects/CanSendStoryResultActiveStoryLimitExceeded.cs b/TdLib.Api/Objects/CanSendStoryResultActiveStoryLimitExceeded.cs new file mode 100644 index 00000000..cb963f66 --- /dev/null +++ b/TdLib.Api/Objects/CanSendStoryResultActiveStoryLimitExceeded.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class CanSendStoryResult : Object + { + /// + /// The limit for the number of active stories exceeded. The user can buy Telegram Premium, delete an active story, or wait for the oldest story to expire + /// + public class CanSendStoryResultActiveStoryLimitExceeded : CanSendStoryResult + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "canSendStoryResultActiveStoryLimitExceeded"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/CanSendStoryResultBoostNeeded.cs b/TdLib.Api/Objects/CanSendStoryResultBoostNeeded.cs new file mode 100644 index 00000000..8fe96ae5 --- /dev/null +++ b/TdLib.Api/Objects/CanSendStoryResultBoostNeeded.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class CanSendStoryResult : Object + { + /// + /// The channel chat must be boosted first by Telegram Premium subscribers to post more stories. Call getChatBoostStatus to get current boost status of the chat + /// + public class CanSendStoryResultBoostNeeded : CanSendStoryResult + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "canSendStoryResultBoostNeeded"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/CanSendStoryResultMonthlyLimitExceeded.cs b/TdLib.Api/Objects/CanSendStoryResultMonthlyLimitExceeded.cs new file mode 100644 index 00000000..ee958dab --- /dev/null +++ b/TdLib.Api/Objects/CanSendStoryResultMonthlyLimitExceeded.cs @@ -0,0 +1,39 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class CanSendStoryResult : Object + { + /// + /// The monthly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time + /// + public class CanSendStoryResultMonthlyLimitExceeded : CanSendStoryResult + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "canSendStoryResultMonthlyLimitExceeded"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Time left before the user can send the next story + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("retry_after")] + public int RetryAfter { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/CanSendStoryResultOk.cs b/TdLib.Api/Objects/CanSendStoryResultOk.cs new file mode 100644 index 00000000..4221787f --- /dev/null +++ b/TdLib.Api/Objects/CanSendStoryResultOk.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class CanSendStoryResult : Object + { + /// + /// Represents result of checking whether the current user can send a story in the specific chat + /// + public class CanSendStoryResultOk : CanSendStoryResult + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "canSendStoryResultOk"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/CanSendStoryResultPremiumNeeded.cs b/TdLib.Api/Objects/CanSendStoryResultPremiumNeeded.cs new file mode 100644 index 00000000..0ff85c8e --- /dev/null +++ b/TdLib.Api/Objects/CanSendStoryResultPremiumNeeded.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class CanSendStoryResult : Object + { + /// + /// The user must subscribe to Telegram Premium to be able to post stories + /// + public class CanSendStoryResultPremiumNeeded : CanSendStoryResult + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "canSendStoryResultPremiumNeeded"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/CanSendStoryResultWeeklyLimitExceeded.cs b/TdLib.Api/Objects/CanSendStoryResultWeeklyLimitExceeded.cs new file mode 100644 index 00000000..4307e615 --- /dev/null +++ b/TdLib.Api/Objects/CanSendStoryResultWeeklyLimitExceeded.cs @@ -0,0 +1,39 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class CanSendStoryResult : Object + { + /// + /// The weekly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time + /// + public class CanSendStoryResultWeeklyLimitExceeded : CanSendStoryResult + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "canSendStoryResultWeeklyLimitExceeded"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Time left before the user can send the next story + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("retry_after")] + public int RetryAfter { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/Chat.cs b/TdLib.Api/Objects/Chat.cs index 86eb4297..a8ec9f77 100644 --- a/TdLib.Api/Objects/Chat.cs +++ b/TdLib.Api/Objects/Chat.cs @@ -53,6 +53,20 @@ public partial class Chat : Object [JsonProperty("photo")] public ChatPhotoInfo Photo { get; set; } + /// + /// Identifier of the accent color for message sender name, and backgrounds of chat photo, reply header, and link preview + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("accent_color_id")] + public int AccentColorId { get; set; } + + /// + /// Identifier of a custom emoji to be shown on the reply header background in replies to messages sent by the chat; 0 if none + /// + [JsonConverter(typeof(Converter.Int64))] + [JsonProperty("background_custom_emoji_id")] + public long BackgroundCustomEmojiId { get; set; } + /// /// Actions that non-administrator chat members are allowed to take in the chat /// @@ -61,7 +75,7 @@ public partial class Chat : Object public ChatPermissions Permissions { get; set; } /// - /// Last message in the chat; may be null + /// Last message in the chat; may be null if none or unknown /// [JsonConverter(typeof(Converter))] [JsonProperty("last_message")] @@ -80,6 +94,13 @@ public partial class Chat : Object [JsonProperty("message_sender_id")] public MessageSender MessageSenderId { get; set; } + /// + /// Block list to which the chat is added; may be null if none + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("block_list")] + public BlockList BlockList { get; set; } + /// /// True, if chat content can't be saved locally, forwarded, or copied /// @@ -101,13 +122,6 @@ public partial class Chat : Object [JsonProperty("is_marked_as_unread")] public bool IsMarkedAsUnread { get; set; } - /// - /// True, if the chat is blocked by the current user and private messages from the chat can't be received - /// - [JsonConverter(typeof(Converter))] - [JsonProperty("is_blocked")] - public bool IsBlocked { get; set; } - /// /// True, if the chat has scheduled messages /// @@ -199,6 +213,13 @@ public partial class Chat : Object [JsonProperty("message_auto_delete_time")] public int MessageAutoDeleteTime { get; set; } + /// + /// Background set for the chat; may be null if none + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("background")] + public ChatBackground Background { get; set; } + /// /// If non-empty, name of a theme, set for the chat /// @@ -207,7 +228,7 @@ public partial class Chat : Object public string ThemeName { get; set; } /// - /// Information about actions which must be possible to do through the chat action bar; may be null + /// Information about actions which must be possible to do through the chat action bar; may be null if none /// [JsonConverter(typeof(Converter))] [JsonProperty("action_bar")] @@ -221,7 +242,7 @@ public partial class Chat : Object public VideoChat VideoChat { get; set; } /// - /// Information about pending join requests; may be null + /// Information about pending join requests; may be null if none /// [JsonConverter(typeof(Converter))] [JsonProperty("pending_join_requests")] @@ -235,7 +256,7 @@ public partial class Chat : Object public long ReplyMarkupMessageId { get; set; } /// - /// A draft of a message in the chat; may be null + /// A draft of a message in the chat; may be null if none /// [JsonConverter(typeof(Converter))] [JsonProperty("draft_message")] diff --git a/TdLib.Api/Objects/ChatActionBarReportAddBlock.cs b/TdLib.Api/Objects/ChatActionBarReportAddBlock.cs index d7cc53d1..4117091b 100644 --- a/TdLib.Api/Objects/ChatActionBarReportAddBlock.cs +++ b/TdLib.Api/Objects/ChatActionBarReportAddBlock.cs @@ -11,7 +11,7 @@ public static partial class TdApi public partial class ChatActionBar : Object { /// - /// The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be blocked using the method toggleMessageSenderIsBlocked, + /// The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be blocked using the method setMessageSenderBlockList, /// or the other user can be added to the contact list using the method addContact. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown /// public class ChatActionBarReportAddBlock : ChatActionBar @@ -36,7 +36,7 @@ public class ChatActionBarReportAddBlock : ChatActionBar public bool CanUnarchive { get; set; } /// - /// If non-negative, the current user was found by the peer through searchChatsNearby and this is the distance between the users + /// If non-negative, the current user was found by the other user through searchChatsNearby and this is the distance between the users /// [JsonConverter(typeof(Converter))] [JsonProperty("distance")] diff --git a/TdLib.Api/Objects/ChatActionBarReportUnrelatedLocation.cs b/TdLib.Api/Objects/ChatActionBarReportUnrelatedLocation.cs index 97e25dd2..a71d3699 100644 --- a/TdLib.Api/Objects/ChatActionBarReportUnrelatedLocation.cs +++ b/TdLib.Api/Objects/ChatActionBarReportUnrelatedLocation.cs @@ -11,7 +11,7 @@ public static partial class TdApi public partial class ChatActionBar : Object { /// - /// The chat is a location-based supergroup, which can be reported as having unrelated location using the method reportChat with the reason chatReportReasonUnrelatedLocation + /// The chat is a location-based supergroup, which can be reported as having unrelated location using the method reportChat with the reason reportReasonUnrelatedLocation /// public class ChatActionBarReportUnrelatedLocation : ChatActionBar { diff --git a/TdLib.Api/Objects/ChatActiveStories.cs b/TdLib.Api/Objects/ChatActiveStories.cs new file mode 100644 index 00000000..e2cfeb7b --- /dev/null +++ b/TdLib.Api/Objects/ChatActiveStories.cs @@ -0,0 +1,63 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Describes active stories posted by a chat + /// + public partial class ChatActiveStories : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "chatActiveStories"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of the chat that posted the stories + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_id")] + public long ChatId { get; set; } + + /// + /// Identifier of the story list in which the stories are shown; may be null if the stories aren't shown in a story list + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("list")] + public StoryList List { get; set; } + + /// + /// A parameter used to determine order of the stories in the story list; 0 if the stories doesn't need to be shown in the story list. Stories must be sorted by the pair (order, story_sender_chat_id) in descending order + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("order")] + public long Order { get; set; } + + /// + /// Identifier of the last read active story + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("max_read_story_id")] + public int MaxReadStoryId { get; set; } + + /// + /// Basic information about the stories; use getStory to get full information about the stories. The stories are in a chronological order (i.e., in order of increasing story identifiers) + /// + [JsonProperty("stories", ItemConverterType = typeof(Converter))] + public StoryInfo[] Stories { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/ChatAdministratorRights.cs b/TdLib.Api/Objects/ChatAdministratorRights.cs index d6dbf438..6e3c05eb 100644 --- a/TdLib.Api/Objects/ChatAdministratorRights.cs +++ b/TdLib.Api/Objects/ChatAdministratorRights.cs @@ -26,7 +26,7 @@ public partial class ChatAdministratorRights : Object public override string Extra { get; set; } /// - /// True, if the administrator can get chat event log, get chat statistics, get message statistics in channels, get channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only + /// True, if the administrator can get chat event log, get chat boosts in channels, get channel members, report supergroup spam messages, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only /// [JsonConverter(typeof(Converter))] [JsonProperty("can_manage_chat")] @@ -40,7 +40,7 @@ public partial class ChatAdministratorRights : Object public bool CanChangeInfo { get; set; } /// - /// True, if the administrator can create channel posts; applicable to channels only + /// True, if the administrator can create channel posts or view channel statistics; applicable to channels only /// [JsonConverter(typeof(Converter))] [JsonProperty("can_post_messages")] @@ -68,7 +68,7 @@ public partial class ChatAdministratorRights : Object public bool CanInviteUsers { get; set; } /// - /// True, if the administrator can restrict, ban, or unban chat members; always true for channels + /// True, if the administrator can restrict, ban, or unban chat members or view supergroup statistics; always true for channels /// [JsonConverter(typeof(Converter))] [JsonProperty("can_restrict_members")] @@ -102,6 +102,27 @@ public partial class ChatAdministratorRights : Object [JsonProperty("can_manage_video_chats")] public bool CanManageVideoChats { get; set; } + /// + /// True, if the administrator can create new channel stories, or edit and delete posted stories; applicable to channels only + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("can_post_stories")] + public bool CanPostStories { get; set; } + + /// + /// True, if the administrator can edit stories posted by other users, pin stories and access story archive; applicable to channels only + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("can_edit_stories")] + public bool CanEditStories { get; set; } + + /// + /// True, if the administrator can delete stories posted by other users; applicable to channels only + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("can_delete_stories")] + public bool CanDeleteStories { get; set; } + /// /// True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only /// diff --git a/TdLib.Api/Objects/ChatBackground.cs b/TdLib.Api/Objects/ChatBackground.cs new file mode 100644 index 00000000..12f1545c --- /dev/null +++ b/TdLib.Api/Objects/ChatBackground.cs @@ -0,0 +1,43 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Describes a background set for a specific chat + /// + public partial class ChatBackground : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "chatBackground"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// The background + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("background")] + public Background Background { get; set; } + + /// + /// Dimming of the background in dark themes, as a percentage; 0-100 + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("dark_theme_dimming")] + public int DarkThemeDimming { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/ChatBoost.cs b/TdLib.Api/Objects/ChatBoost.cs new file mode 100644 index 00000000..664f1f84 --- /dev/null +++ b/TdLib.Api/Objects/ChatBoost.cs @@ -0,0 +1,64 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Describes a boost applied to a chat + /// + public partial class ChatBoost : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "chatBoost"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Unique identifier of the boost + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("id")] + public string Id { get; set; } + + /// + /// The number of identical boosts applied + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("count")] + public int Count { get; set; } + + /// + /// Source of the boost + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("source")] + public ChatBoostSource Source { get; set; } + + /// + /// Point in time (Unix timestamp) when the chat was boosted + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("start_date")] + public int StartDate { get; set; } + + /// + /// Point in time (Unix timestamp) when the boost will expire + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("expiration_date")] + public int ExpirationDate { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/ChatBoostLink.cs b/TdLib.Api/Objects/ChatBoostLink.cs new file mode 100644 index 00000000..b3251e1d --- /dev/null +++ b/TdLib.Api/Objects/ChatBoostLink.cs @@ -0,0 +1,43 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Contains an HTTPS link to boost a chat + /// + public partial class ChatBoostLink : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "chatBoostLink"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// The link + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("link")] + public string Link { get; set; } + + /// + /// True, if the link will work for non-members of the chat + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("is_public")] + public bool IsPublic { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/ChatBoostLinkInfo.cs b/TdLib.Api/Objects/ChatBoostLinkInfo.cs new file mode 100644 index 00000000..9701f7da --- /dev/null +++ b/TdLib.Api/Objects/ChatBoostLinkInfo.cs @@ -0,0 +1,43 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Contains information about a link to boost a chat + /// + public partial class ChatBoostLinkInfo : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "chatBoostLinkInfo"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// True, if the link will work for non-members of the chat + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("is_public")] + public bool IsPublic { get; set; } + + /// + /// Identifier of the chat to which the link points; 0 if the chat isn't found + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_id")] + public long ChatId { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/ChatBoostSlot.cs b/TdLib.Api/Objects/ChatBoostSlot.cs new file mode 100644 index 00000000..47011140 --- /dev/null +++ b/TdLib.Api/Objects/ChatBoostSlot.cs @@ -0,0 +1,64 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Describes a slot for chat boost + /// + public partial class ChatBoostSlot : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "chatBoostSlot"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Unique identifier of the slot + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("slot_id")] + public int SlotId { get; set; } + + /// + /// Identifier of the currently boosted chat; 0 if none + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("currently_boosted_chat_id")] + public long CurrentlyBoostedChatId { get; set; } + + /// + /// Point in time (Unix timestamp) when the chat was boosted; 0 if none + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("start_date")] + public int StartDate { get; set; } + + /// + /// Point in time (Unix timestamp) when the boost will expire + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("expiration_date")] + public int ExpirationDate { get; set; } + + /// + /// Point in time (Unix timestamp) after which the boost can be used for another chat + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("cooldown_until_date")] + public int CooldownUntilDate { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/ChatBoostSlots.cs b/TdLib.Api/Objects/ChatBoostSlots.cs new file mode 100644 index 00000000..931b9714 --- /dev/null +++ b/TdLib.Api/Objects/ChatBoostSlots.cs @@ -0,0 +1,35 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Contains a list of chat boost slots + /// + public partial class ChatBoostSlots : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "chatBoostSlots"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// List of boost slots + /// + [JsonProperty("slots", ItemConverterType = typeof(Converter))] + public ChatBoostSlot[] Slots { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/ChatBoostSourceGiftCode.cs b/TdLib.Api/Objects/ChatBoostSourceGiftCode.cs new file mode 100644 index 00000000..5159c293 --- /dev/null +++ b/TdLib.Api/Objects/ChatBoostSourceGiftCode.cs @@ -0,0 +1,46 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class ChatBoostSource : Object + { + /// + /// Describes source of a chat boost + /// + public class ChatBoostSourceGiftCode : ChatBoostSource + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "chatBoostSourceGiftCode"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of a user, for which the gift code was created + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("user_id")] + public long UserId { get; set; } + + /// + /// The created Telegram Premium gift code, which is known only if this is a gift code for the current user, or it has already been claimed + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("gift_code")] + public string GiftCode { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/ChatBoostSourceGiveaway.cs b/TdLib.Api/Objects/ChatBoostSourceGiveaway.cs new file mode 100644 index 00000000..cd651abf --- /dev/null +++ b/TdLib.Api/Objects/ChatBoostSourceGiveaway.cs @@ -0,0 +1,60 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class ChatBoostSource : Object + { + /// + /// The chat created a Telegram Premium giveaway + /// + public class ChatBoostSourceGiveaway : ChatBoostSource + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "chatBoostSourceGiveaway"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of a user that won in the giveaway; 0 if none + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("user_id")] + public long UserId { get; set; } + + /// + /// The created Telegram Premium gift code if it was used by the user or can be claimed by the current user; an empty string otherwise + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("gift_code")] + public string GiftCode { get; set; } + + /// + /// Identifier of the corresponding giveaway message; can be an identifier of a deleted message + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("giveaway_message_id")] + public long GiveawayMessageId { get; set; } + + /// + /// True, if the winner for the corresponding Telegram Premium subscription wasn't chosen, because there were not enough participants + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("is_unclaimed")] + public bool IsUnclaimed { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/MessageForwardOriginMessageImport.cs b/TdLib.Api/Objects/ChatBoostSourcePremium.cs similarity index 67% rename from TdLib.Api/Objects/MessageForwardOriginMessageImport.cs rename to TdLib.Api/Objects/ChatBoostSourcePremium.cs index 7e5b9ca2..de4318a4 100644 --- a/TdLib.Api/Objects/MessageForwardOriginMessageImport.cs +++ b/TdLib.Api/Objects/ChatBoostSourcePremium.cs @@ -8,18 +8,18 @@ namespace TdLib /// public static partial class TdApi { - public partial class MessageForwardOrigin : Object + public partial class ChatBoostSource : Object { /// - /// The message was imported from an exported message history + /// A user with Telegram Premium subscription or gifted Telegram Premium boosted the chat /// - public class MessageForwardOriginMessageImport : MessageForwardOrigin + public class ChatBoostSourcePremium : ChatBoostSource { /// /// Data type for serialization /// [JsonProperty("@type")] - public override string DataType { get; set; } = "messageForwardOriginMessageImport"; + public override string DataType { get; set; } = "chatBoostSourcePremium"; /// /// Extra data attached to the message @@ -28,11 +28,11 @@ public class MessageForwardOriginMessageImport : MessageForwardOrigin public override string Extra { get; set; } /// - /// Name of the sender + /// Identifier of the user /// [JsonConverter(typeof(Converter))] - [JsonProperty("sender_name")] - public string SenderName { get; set; } + [JsonProperty("user_id")] + public long UserId { get; set; } } } } diff --git a/TdLib.Api/Objects/ChatBoostStatus.cs b/TdLib.Api/Objects/ChatBoostStatus.cs new file mode 100644 index 00000000..b4b6cca8 --- /dev/null +++ b/TdLib.Api/Objects/ChatBoostStatus.cs @@ -0,0 +1,97 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Describes current boost status of a chat + /// + public partial class ChatBoostStatus : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "chatBoostStatus"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// An HTTP URL, which can be used to boost the chat + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("boost_url")] + public string BoostUrl { get; set; } + + /// + /// Identifiers of boost slots of the current user applied to the chat + /// + [JsonProperty("applied_slot_ids", ItemConverterType = typeof(Converter))] + public int[] AppliedSlotIds { get; set; } + + /// + /// Current boost level of the chat + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("level")] + public int Level { get; set; } + + /// + /// The number of boosts received by the chat from created Telegram Premium gift codes and giveaways; always 0 if the current user isn't an administrator in the chat + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("gift_code_boost_count")] + public int GiftCodeBoostCount { get; set; } + + /// + /// The number of boosts received by the chat + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("boost_count")] + public int BoostCount { get; set; } + + /// + /// The number of boosts added to reach the current level + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("current_level_boost_count")] + public int CurrentLevelBoostCount { get; set; } + + /// + /// The number of boosts needed to reach the next level; 0 if the next level isn't available + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("next_level_boost_count")] + public int NextLevelBoostCount { get; set; } + + /// + /// Approximate number of Telegram Premium subscribers joined the chat; always 0 if the current user isn't an administrator in the chat + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("premium_member_count")] + public int PremiumMemberCount { get; set; } + + /// + /// A percentage of Telegram Premium subscribers joined the chat; always 0 if the current user isn't an administrator in the chat + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("premium_member_percentage")] + public double? PremiumMemberPercentage { get; set; } + + /// + /// The list of prepaid giveaways available for the chat; only for chat administrators + /// + [JsonProperty("prepaid_giveaways", ItemConverterType = typeof(Converter))] + public PrepaidPremiumGiveaway[] PrepaidGiveaways { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/ChatEventAccentColorChanged.cs b/TdLib.Api/Objects/ChatEventAccentColorChanged.cs new file mode 100644 index 00000000..953c64ae --- /dev/null +++ b/TdLib.Api/Objects/ChatEventAccentColorChanged.cs @@ -0,0 +1,46 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class ChatEventAction : Object + { + /// + /// The chat accent color was changed + /// + public class ChatEventAccentColorChanged : ChatEventAction + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "chatEventAccentColorChanged"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Previous identifier of chat accent color + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("old_accent_color_id")] + public int OldAccentColorId { get; set; } + + /// + /// New identifier of chat accent color + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("new_accent_color_id")] + public int NewAccentColorId { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/ChatEventBackgroundCustomEmojiChanged.cs b/TdLib.Api/Objects/ChatEventBackgroundCustomEmojiChanged.cs new file mode 100644 index 00000000..30736bb9 --- /dev/null +++ b/TdLib.Api/Objects/ChatEventBackgroundCustomEmojiChanged.cs @@ -0,0 +1,46 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class ChatEventAction : Object + { + /// + /// The chat's custom emoji for reply background was changed + /// + public class ChatEventBackgroundCustomEmojiChanged : ChatEventAction + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "chatEventBackgroundCustomEmojiChanged"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Previous identifier of the custom emoji; 0 if none + /// + [JsonConverter(typeof(Converter.Int64))] + [JsonProperty("old_background_custom_emoji_id")] + public long OldBackgroundCustomEmojiId { get; set; } + + /// + /// New identifier of the custom emoji; 0 if none + /// + [JsonConverter(typeof(Converter.Int64))] + [JsonProperty("new_background_custom_emoji_id")] + public long NewBackgroundCustomEmojiId { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/ChatEventMemberJoinedByInviteLink.cs b/TdLib.Api/Objects/ChatEventMemberJoinedByInviteLink.cs index a5dbfee8..c942b6ec 100644 --- a/TdLib.Api/Objects/ChatEventMemberJoinedByInviteLink.cs +++ b/TdLib.Api/Objects/ChatEventMemberJoinedByInviteLink.cs @@ -33,6 +33,13 @@ public class ChatEventMemberJoinedByInviteLink : ChatEventAction [JsonConverter(typeof(Converter))] [JsonProperty("invite_link")] public ChatInviteLink InviteLink { get; set; } + + /// + /// True, if the user has joined the chat using an invite link for a chat folder + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("via_chat_folder_invite_link")] + public bool ViaChatFolderInviteLink { get; set; } } } } diff --git a/TdLib.Api/Objects/ChatFilter.cs b/TdLib.Api/Objects/ChatFolder.cs similarity index 71% rename from TdLib.Api/Objects/ChatFilter.cs rename to TdLib.Api/Objects/ChatFolder.cs index 2f0a6a6e..b06da483 100644 --- a/TdLib.Api/Objects/ChatFilter.cs +++ b/TdLib.Api/Objects/ChatFolder.cs @@ -9,15 +9,15 @@ namespace TdLib public static partial class TdApi { /// - /// Represents a filter of user chats + /// Represents a folder for user chats /// - public partial class ChatFilter : Object + public partial class ChatFolder : Object { /// /// Data type for serialization /// [JsonProperty("@type")] - public override string DataType { get; set; } = "chatFilter"; + public override string DataType { get; set; } = "chatFolder"; /// /// Extra data attached to the object @@ -26,35 +26,40 @@ public partial class ChatFilter : Object public override string Extra { get; set; } /// - /// The title of the filter; 1-12 characters without line feeds + /// The title of the folder; 1-12 characters without line feeds /// [JsonConverter(typeof(Converter))] [JsonProperty("title")] public string Title { get; set; } /// - /// The chosen icon name for short filter representation. If non-empty, must be one of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", - /// "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work", "Airplane", "Book", "Light", "Like", "Money", "Note", "Palette". - /// If empty, use getChatFilterDefaultIconName to get default icon name for the filter + /// The chosen icon for the chat folder; may be null. If null, use getChatFolderDefaultIconName to get default icon name for the folder /// [JsonConverter(typeof(Converter))] - [JsonProperty("icon_name")] - public string IconName { get; set; } + [JsonProperty("icon")] + public ChatFolderIcon Icon { get; set; } /// - /// The chat identifiers of pinned chats in the filtered chat list. There can be up to getOption("chat_filter_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium + /// True, if at least one link has been created for the folder + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("is_shareable")] + public bool IsShareable { get; set; } + + /// + /// The chat identifiers of pinned chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium /// [JsonProperty("pinned_chat_ids", ItemConverterType = typeof(Converter))] public long[] PinnedChatIds { get; set; } /// - /// The chat identifiers of always included chats in the filtered chat list. There can be up to getOption("chat_filter_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium + /// The chat identifiers of always included chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium /// [JsonProperty("included_chat_ids", ItemConverterType = typeof(Converter))] public long[] IncludedChatIds { get; set; } /// - /// The chat identifiers of always excluded chats in the filtered chat list. There can be up to getOption("chat_filter_chosen_chat_count_max") always excluded non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium + /// The chat identifiers of always excluded chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") always excluded non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium /// [JsonProperty("excluded_chat_ids", ItemConverterType = typeof(Converter))] public long[] ExcludedChatIds { get; set; } diff --git a/TdLib.Api/Objects/ChatFolderIcon.cs b/TdLib.Api/Objects/ChatFolderIcon.cs new file mode 100644 index 00000000..ba95559d --- /dev/null +++ b/TdLib.Api/Objects/ChatFolderIcon.cs @@ -0,0 +1,37 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Represents an icon for a chat folder + /// + public partial class ChatFolderIcon : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "chatFolderIcon"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// The chosen icon name for short folder representation; one of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", + /// "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work", "Airplane", "Book", "Light", "Like", "Money", "Note", "Palette" + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("name")] + public string Name { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/ChatFolderInfo.cs b/TdLib.Api/Objects/ChatFolderInfo.cs new file mode 100644 index 00000000..9c82b2a5 --- /dev/null +++ b/TdLib.Api/Objects/ChatFolderInfo.cs @@ -0,0 +1,64 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Contains basic information about a chat folder + /// + public partial class ChatFolderInfo : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "chatFolderInfo"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Unique chat folder identifier + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("id")] + public int Id { get; set; } + + /// + /// The title of the folder; 1-12 characters without line feeds + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("title")] + public string Title { get; set; } + + /// + /// The chosen or default icon for the chat folder + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("icon")] + public ChatFolderIcon Icon { get; set; } + + /// + /// True, if at least one link has been created for the folder + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("is_shareable")] + public bool IsShareable { get; set; } + + /// + /// True, if the chat folder has invite links created by the current user + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("has_my_invite_links")] + public bool HasMyInviteLinks { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/ChatFilterInfo.cs b/TdLib.Api/Objects/ChatFolderInviteLink.cs similarity index 54% rename from TdLib.Api/Objects/ChatFilterInfo.cs rename to TdLib.Api/Objects/ChatFolderInviteLink.cs index 9c93eee0..ab751ea7 100644 --- a/TdLib.Api/Objects/ChatFilterInfo.cs +++ b/TdLib.Api/Objects/ChatFolderInviteLink.cs @@ -9,15 +9,15 @@ namespace TdLib public static partial class TdApi { /// - /// Contains basic information about a chat filter + /// Contains a chat folder invite link /// - public partial class ChatFilterInfo : Object + public partial class ChatFolderInviteLink : Object { /// /// Data type for serialization /// [JsonProperty("@type")] - public override string DataType { get; set; } = "chatFilterInfo"; + public override string DataType { get; set; } = "chatFolderInviteLink"; /// /// Extra data attached to the object @@ -26,25 +26,24 @@ public partial class ChatFilterInfo : Object public override string Extra { get; set; } /// - /// Unique chat filter identifier + /// The chat folder invite link /// [JsonConverter(typeof(Converter))] - [JsonProperty("id")] - public int Id { get; set; } + [JsonProperty("invite_link")] + public string InviteLink { get; set; } /// - /// The title of the filter; 1-12 characters without line feeds + /// Name of the link /// [JsonConverter(typeof(Converter))] - [JsonProperty("title")] - public string Title { get; set; } + [JsonProperty("name")] + public string Name { get; set; } /// - /// The chosen or default icon name for short filter representation. One of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", + /// Identifiers of chats, included in the link /// - [JsonConverter(typeof(Converter))] - [JsonProperty("icon_name")] - public string IconName { get; set; } + [JsonProperty("chat_ids", ItemConverterType = typeof(Converter))] + public long[] ChatIds { get; set; } } } } \ No newline at end of file diff --git a/TdLib.Api/Objects/ChatFolderInviteLinkInfo.cs b/TdLib.Api/Objects/ChatFolderInviteLinkInfo.cs new file mode 100644 index 00000000..2f0a8dfc --- /dev/null +++ b/TdLib.Api/Objects/ChatFolderInviteLinkInfo.cs @@ -0,0 +1,48 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Contains information about an invite link to a chat folder + /// + public partial class ChatFolderInviteLinkInfo : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "chatFolderInviteLinkInfo"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Basic information about the chat folder; chat folder identifier will be 0 if the user didn't have the chat folder yet + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_folder_info")] + public ChatFolderInfo ChatFolderInfo { get; set; } + + /// + /// Identifiers of the chats from the link, which aren't added to the folder yet + /// + [JsonProperty("missing_chat_ids", ItemConverterType = typeof(Converter))] + public long[] MissingChatIds { get; set; } + + /// + /// Identifiers of the chats from the link, which are added to the folder already + /// + [JsonProperty("added_chat_ids", ItemConverterType = typeof(Converter))] + public long[] AddedChatIds { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/ChatFolderInviteLinks.cs b/TdLib.Api/Objects/ChatFolderInviteLinks.cs new file mode 100644 index 00000000..3adb603f --- /dev/null +++ b/TdLib.Api/Objects/ChatFolderInviteLinks.cs @@ -0,0 +1,35 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Represents a list of chat folder invite links + /// + public partial class ChatFolderInviteLinks : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "chatFolderInviteLinks"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// List of the invite links + /// + [JsonProperty("invite_links", ItemConverterType = typeof(Converter))] + public ChatFolderInviteLink[] InviteLinks { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/ChatInviteLinkInfo.cs b/TdLib.Api/Objects/ChatInviteLinkInfo.cs index c2b49a49..8a014905 100644 --- a/TdLib.Api/Objects/ChatInviteLinkInfo.cs +++ b/TdLib.Api/Objects/ChatInviteLinkInfo.cs @@ -44,7 +44,7 @@ public partial class ChatInviteLinkInfo : Object /// [JsonConverter(typeof(Converter))] [JsonProperty("type")] - public ChatType Type { get; set; } + public InviteLinkChatType Type { get; set; } /// /// Title of the chat @@ -60,6 +60,13 @@ public partial class ChatInviteLinkInfo : Object [JsonProperty("photo")] public ChatPhotoInfo Photo { get; set; } + /// + /// Identifier of the accent color for chat title and background of chat photo + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("accent_color_id")] + public int AccentColorId { get; set; } + /// /// /// @@ -93,6 +100,27 @@ public partial class ChatInviteLinkInfo : Object [JsonConverter(typeof(Converter))] [JsonProperty("is_public")] public bool IsPublic { get; set; } + + /// + /// True, if the chat is verified + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("is_verified")] + public bool IsVerified { get; set; } + + /// + /// True, if many users reported this chat as a scam + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("is_scam")] + public bool IsScam { get; set; } + + /// + /// True, if many users reported this chat as a fake account + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("is_fake")] + public bool IsFake { get; set; } } } } \ No newline at end of file diff --git a/TdLib.Api/Objects/ChatInviteLinkMember.cs b/TdLib.Api/Objects/ChatInviteLinkMember.cs index f0bbca86..222d3775 100644 --- a/TdLib.Api/Objects/ChatInviteLinkMember.cs +++ b/TdLib.Api/Objects/ChatInviteLinkMember.cs @@ -39,6 +39,13 @@ public partial class ChatInviteLinkMember : Object [JsonProperty("joined_chat_date")] public int JoinedChatDate { get; set; } + /// + /// True, if the user has joined the chat using an invite link for a chat folder + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("via_chat_folder_invite_link")] + public bool ViaChatFolderInviteLink { get; set; } + /// /// User identifier of the chat administrator, approved user join request /// diff --git a/TdLib.Api/Objects/ChatListFilter.cs b/TdLib.Api/Objects/ChatListFolder.cs similarity index 76% rename from TdLib.Api/Objects/ChatListFilter.cs rename to TdLib.Api/Objects/ChatListFolder.cs index 99e440ce..318964ce 100644 --- a/TdLib.Api/Objects/ChatListFilter.cs +++ b/TdLib.Api/Objects/ChatListFolder.cs @@ -11,15 +11,15 @@ public static partial class TdApi public partial class ChatList : Object { /// - /// A list of chats belonging to a chat filter + /// A list of chats added to a chat folder /// - public class ChatListFilter : ChatList + public class ChatListFolder : ChatList { /// /// Data type for serialization /// [JsonProperty("@type")] - public override string DataType { get; set; } = "chatListFilter"; + public override string DataType { get; set; } = "chatListFolder"; /// /// Extra data attached to the message @@ -28,11 +28,11 @@ public class ChatListFilter : ChatList public override string Extra { get; set; } /// - /// Chat filter identifier + /// Chat folder identifier /// [JsonConverter(typeof(Converter))] - [JsonProperty("chat_filter_id")] - public int ChatFilterId { get; set; } + [JsonProperty("chat_folder_id")] + public int ChatFolderId { get; set; } } } } diff --git a/TdLib.Api/Objects/ChatMessageSender.cs b/TdLib.Api/Objects/ChatMessageSender.cs index 27e9e529..17e9618b 100644 --- a/TdLib.Api/Objects/ChatMessageSender.cs +++ b/TdLib.Api/Objects/ChatMessageSender.cs @@ -26,7 +26,7 @@ public partial class ChatMessageSender : Object public override string Extra { get; set; } /// - /// Available message senders + /// The message sender /// [JsonConverter(typeof(Converter))] [JsonProperty("sender")] diff --git a/TdLib.Api/Objects/ChatNotificationSettings.cs b/TdLib.Api/Objects/ChatNotificationSettings.cs index 7733df73..1c52f725 100644 --- a/TdLib.Api/Objects/ChatNotificationSettings.cs +++ b/TdLib.Api/Objects/ChatNotificationSettings.cs @@ -47,7 +47,7 @@ public partial class ChatNotificationSettings : Object public bool UseDefaultSound { get; set; } /// - /// Identifier of the notification sound to be played; 0 if sound is disabled + /// Identifier of the notification sound to be played for messages; 0 if sound is disabled /// [JsonConverter(typeof(Converter.Int64))] [JsonProperty("sound_id")] @@ -67,6 +67,48 @@ public partial class ChatNotificationSettings : Object [JsonProperty("show_preview")] public bool ShowPreview { get; set; } + /// + /// If true, mute_stories is ignored and the value for the relevant type of chat is used instead + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("use_default_mute_stories")] + public bool UseDefaultMuteStories { get; set; } + + /// + /// True, if story notifications are disabled for the chat + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("mute_stories")] + public bool MuteStories { get; set; } + + /// + /// If true, the value for the relevant type of chat is used instead of story_sound_id + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("use_default_story_sound")] + public bool UseDefaultStorySound { get; set; } + + /// + /// Identifier of the notification sound to be played for stories; 0 if sound is disabled + /// + [JsonConverter(typeof(Converter.Int64))] + [JsonProperty("story_sound_id")] + public long StorySoundId { get; set; } + + /// + /// If true, show_story_sender is ignored and the value for the relevant type of chat is used instead + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("use_default_show_story_sender")] + public bool UseDefaultShowStorySender { get; set; } + + /// + /// True, if the sender of stories must be displayed in notifications + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("show_story_sender")] + public bool ShowStorySender { get; set; } + /// /// If true, disable_pinned_message_notifications is ignored and the value for the relevant type of chat or the forum chat is used instead /// diff --git a/TdLib.Api/Objects/ChatPermissions.cs b/TdLib.Api/Objects/ChatPermissions.cs index c0f5afff..188bd82f 100644 --- a/TdLib.Api/Objects/ChatPermissions.cs +++ b/TdLib.Api/Objects/ChatPermissions.cs @@ -26,7 +26,7 @@ public partial class ChatPermissions : Object public override string Extra { get; set; } /// - /// True, if the user can send text messages, contacts, invoices, locations, and venues + /// True, if the user can send text messages, contacts, giveaways, invoices, locations, and venues /// [JsonConverter(typeof(Converter))] [JsonProperty("can_send_basic_messages")] @@ -47,14 +47,14 @@ public partial class ChatPermissions : Object public bool CanSendDocuments { get; set; } /// - /// True, if the user can send audio photos + /// True, if the user can send photos /// [JsonConverter(typeof(Converter))] [JsonProperty("can_send_photos")] public bool CanSendPhotos { get; set; } /// - /// True, if the user can send audio videos + /// True, if the user can send videos /// [JsonConverter(typeof(Converter))] [JsonProperty("can_send_videos")] diff --git a/TdLib.Api/Objects/ChatStatisticsChannel.cs b/TdLib.Api/Objects/ChatStatisticsChannel.cs index 213998ea..5813417b 100644 --- a/TdLib.Api/Objects/ChatStatisticsChannel.cs +++ b/TdLib.Api/Objects/ChatStatisticsChannel.cs @@ -56,7 +56,7 @@ public class ChatStatisticsChannel : ChatStatistics public StatisticalValue MeanShareCount { get; set; } /// - /// A percentage of users with enabled notifications for the chat + /// A percentage of users with enabled notifications for the chat; 0-100 /// [JsonConverter(typeof(Converter))] [JsonProperty("enabled_notifications_percentage")] diff --git a/TdLib.Api/Objects/ChatTypeSecret.cs b/TdLib.Api/Objects/ChatTypeSecret.cs index 48cf140b..87699034 100644 --- a/TdLib.Api/Objects/ChatTypeSecret.cs +++ b/TdLib.Api/Objects/ChatTypeSecret.cs @@ -35,7 +35,7 @@ public class ChatTypeSecret : ChatType public int SecretChatId { get; set; } /// - /// User identifier of the secret chat peer + /// User identifier of the other user in the secret chat /// [JsonConverter(typeof(Converter))] [JsonProperty("user_id")] diff --git a/TdLib.Api/Objects/ConnectedWebsite.cs b/TdLib.Api/Objects/ConnectedWebsite.cs index e76daa08..8c0490f5 100644 --- a/TdLib.Api/Objects/ConnectedWebsite.cs +++ b/TdLib.Api/Objects/ConnectedWebsite.cs @@ -78,8 +78,8 @@ public partial class ConnectedWebsite : Object /// IP address from which the user was logged in, in human-readable format /// [JsonConverter(typeof(Converter))] - [JsonProperty("ip")] - public string Ip { get; set; } + [JsonProperty("ip_address")] + public string IpAddress { get; set; } /// /// Human-readable description of a country and a region from which the user was logged in, based on the IP address diff --git a/TdLib.Api/Objects/DraftMessage.cs b/TdLib.Api/Objects/DraftMessage.cs index 162cb1cc..cf6f9c57 100644 --- a/TdLib.Api/Objects/DraftMessage.cs +++ b/TdLib.Api/Objects/DraftMessage.cs @@ -26,11 +26,11 @@ public partial class DraftMessage : Object public override string Extra { get; set; } /// - /// Identifier of the replied message; 0 if none + /// Information about the message to be replied; must be of the type inputMessageReplyToMessage; may be null if none /// [JsonConverter(typeof(Converter))] - [JsonProperty("reply_to_message_id")] - public long ReplyToMessageId { get; set; } + [JsonProperty("reply_to")] + public InputMessageReplyTo ReplyTo { get; set; } /// /// Point in time (Unix timestamp) when the draft was created diff --git a/TdLib.Api/Objects/EmojiStatus.cs b/TdLib.Api/Objects/EmojiStatus.cs index a747c74c..4a7bcee5 100644 --- a/TdLib.Api/Objects/EmojiStatus.cs +++ b/TdLib.Api/Objects/EmojiStatus.cs @@ -31,6 +31,13 @@ public partial class EmojiStatus : Object [JsonConverter(typeof(Converter.Int64))] [JsonProperty("custom_emoji_id")] public long CustomEmojiId { get; set; } + + /// + /// Point in time (Unix timestamp) when the status will expire; 0 if never + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("expiration_date")] + public int ExpirationDate { get; set; } } } } \ No newline at end of file diff --git a/TdLib.Api/Objects/EmojiStatuses.cs b/TdLib.Api/Objects/EmojiStatuses.cs index a493b9bc..b7134807 100644 --- a/TdLib.Api/Objects/EmojiStatuses.cs +++ b/TdLib.Api/Objects/EmojiStatuses.cs @@ -9,7 +9,7 @@ namespace TdLib public static partial class TdApi { /// - /// Contains a list of emoji statuses + /// Contains a list of custom emoji identifiers, which can be set as emoji statuses /// public partial class EmojiStatuses : Object { @@ -26,10 +26,10 @@ public partial class EmojiStatuses : Object public override string Extra { get; set; } /// - /// The list of emoji statuses + /// The list of custom emoji identifiers /// - [JsonProperty("emoji_statuses", ItemConverterType = typeof(Converter))] - public EmojiStatus[] EmojiStatuses_ { get; set; } + [JsonProperty("custom_emoji_ids", ItemConverterType = typeof(Converter))] + public long[] CustomEmojiIds { get; set; } } } } \ No newline at end of file diff --git a/TdLib.Api/Objects/FileTypePhotoStory.cs b/TdLib.Api/Objects/FileTypePhotoStory.cs new file mode 100644 index 00000000..eea7a335 --- /dev/null +++ b/TdLib.Api/Objects/FileTypePhotoStory.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class FileType : Object + { + /// + /// The file is a photo published as a story + /// + public class FileTypePhotoStory : FileType + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "fileTypePhotoStory"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/FileTypeVideoStory.cs b/TdLib.Api/Objects/FileTypeVideoStory.cs new file mode 100644 index 00000000..6d3399ed --- /dev/null +++ b/TdLib.Api/Objects/FileTypeVideoStory.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class FileType : Object + { + /// + /// The file is a video published as a story + /// + public class FileTypeVideoStory : FileType + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "fileTypeVideoStory"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/FormattedText.cs b/TdLib.Api/Objects/FormattedText.cs index 85311e41..98a30115 100644 --- a/TdLib.Api/Objects/FormattedText.cs +++ b/TdLib.Api/Objects/FormattedText.cs @@ -34,7 +34,7 @@ public partial class FormattedText : Object /// /// Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. - /// Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and can be part of any other entities. All other entities can't contain each other + /// Pre, Code and PreCode entities can't contain other entities. BlockQuote entities can't contain other BlockQuote entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and can be part of any other entities. All other entities can't contain each other /// [JsonProperty("entities", ItemConverterType = typeof(Converter))] public TextEntity[] Entities { get; set; } diff --git a/TdLib.Api/Objects/ForumTopic.cs b/TdLib.Api/Objects/ForumTopic.cs index e12cf9ed..f9645b67 100644 --- a/TdLib.Api/Objects/ForumTopic.cs +++ b/TdLib.Api/Objects/ForumTopic.cs @@ -89,7 +89,7 @@ public partial class ForumTopic : Object public ChatNotificationSettings NotificationSettings { get; set; } /// - /// A draft of a message in the topic; may be null + /// A draft of a message in the topic; may be null if none /// [JsonConverter(typeof(Converter))] [JsonProperty("draft_message")] diff --git a/TdLib.Api/Objects/ForumTopicInfo.cs b/TdLib.Api/Objects/ForumTopicInfo.cs index 9cfa4853..a5fcf3bc 100644 --- a/TdLib.Api/Objects/ForumTopicInfo.cs +++ b/TdLib.Api/Objects/ForumTopicInfo.cs @@ -47,7 +47,7 @@ public partial class ForumTopicInfo : Object public ForumTopicIcon Icon { get; set; } /// - /// Date the topic was created + /// Point in time (Unix timestamp) when the topic was created /// [JsonConverter(typeof(Converter))] [JsonProperty("creation_date")] diff --git a/TdLib.Api/Objects/FoundChatBoosts.cs b/TdLib.Api/Objects/FoundChatBoosts.cs new file mode 100644 index 00000000..e2eadec9 --- /dev/null +++ b/TdLib.Api/Objects/FoundChatBoosts.cs @@ -0,0 +1,49 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Contains a list of boosts applied to a chat + /// + public partial class FoundChatBoosts : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "foundChatBoosts"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Total number of boosts applied to the chat + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("total_count")] + public int TotalCount { get; set; } + + /// + /// List of boosts + /// + [JsonProperty("boosts", ItemConverterType = typeof(Converter))] + public ChatBoost[] Boosts { get; set; } + + /// + /// The offset for the next request. If empty, there are no more results + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("next_offset")] + public string NextOffset { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/FoundPosition.cs b/TdLib.Api/Objects/FoundPosition.cs new file mode 100644 index 00000000..0577a721 --- /dev/null +++ b/TdLib.Api/Objects/FoundPosition.cs @@ -0,0 +1,36 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Contains 0-based match position + /// + public partial class FoundPosition : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "foundPosition"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// The position of the match + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("position")] + public int Position { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/FoundPositions.cs b/TdLib.Api/Objects/FoundPositions.cs new file mode 100644 index 00000000..a0aade2a --- /dev/null +++ b/TdLib.Api/Objects/FoundPositions.cs @@ -0,0 +1,42 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Contains 0-based positions of matched objects + /// + public partial class FoundPositions : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "foundPositions"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Total number of matched objects + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("total_count")] + public int TotalCount { get; set; } + + /// + /// The positions of the matched objects + /// + [JsonProperty("positions", ItemConverterType = typeof(Converter))] + public int[] Positions { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/GroupCall.cs b/TdLib.Api/Objects/GroupCall.cs index 77e6e03a..9f210d4d 100644 --- a/TdLib.Api/Objects/GroupCall.cs +++ b/TdLib.Api/Objects/GroupCall.cs @@ -47,7 +47,7 @@ public partial class GroupCall : Object public int ScheduledStartDate { get; set; } /// - /// True, if the group call is scheduled and the current user will receive a notification when the group call will start + /// True, if the group call is scheduled and the current user will receive a notification when the group call starts /// [JsonConverter(typeof(Converter))] [JsonProperty("enabled_start_notification")] diff --git a/TdLib.Api/Objects/IdentityDocument.cs b/TdLib.Api/Objects/IdentityDocument.cs index eaf5c322..ef3414ed 100644 --- a/TdLib.Api/Objects/IdentityDocument.cs +++ b/TdLib.Api/Objects/IdentityDocument.cs @@ -33,11 +33,11 @@ public partial class IdentityDocument : Object public string Number { get; set; } /// - /// Document expiry date; may be null if not applicable + /// Document expiration date; may be null if not applicable /// [JsonConverter(typeof(Converter))] - [JsonProperty("expiry_date")] - public Date ExpiryDate { get; set; } + [JsonProperty("expiration_date")] + public Date ExpirationDate { get; set; } /// /// Front side of the document diff --git a/TdLib.Api/Objects/InlineKeyboardButtonTypeSwitchInline.cs b/TdLib.Api/Objects/InlineKeyboardButtonTypeSwitchInline.cs index 1343a6aa..4ff83215 100644 --- a/TdLib.Api/Objects/InlineKeyboardButtonTypeSwitchInline.cs +++ b/TdLib.Api/Objects/InlineKeyboardButtonTypeSwitchInline.cs @@ -35,11 +35,11 @@ public class InlineKeyboardButtonTypeSwitchInline : InlineKeyboardButtonType public string Query { get; set; } /// - /// True, if the inline query must be sent from the current chat + /// Target chat from which to send the inline query /// [JsonConverter(typeof(Converter))] - [JsonProperty("in_current_chat")] - public bool InCurrentChat { get; set; } + [JsonProperty("target_chat")] + public TargetChat TargetChat { get; set; } } } } diff --git a/TdLib.Api/Objects/InputBackgroundPrevious.cs b/TdLib.Api/Objects/InputBackgroundPrevious.cs new file mode 100644 index 00000000..af2f0b35 --- /dev/null +++ b/TdLib.Api/Objects/InputBackgroundPrevious.cs @@ -0,0 +1,39 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class InputBackground : Object + { + /// + /// A background previously set in the chat; for chat backgrounds only + /// + public class InputBackgroundPrevious : InputBackground + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "inputBackgroundPrevious"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of the message with the background + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("message_id")] + public long MessageId { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/InputFileRemote.cs b/TdLib.Api/Objects/InputFileRemote.cs index cef070a9..05fdac1e 100644 --- a/TdLib.Api/Objects/InputFileRemote.cs +++ b/TdLib.Api/Objects/InputFileRemote.cs @@ -11,7 +11,7 @@ public static partial class TdApi public partial class InputFile : Object { /// - /// A file defined by its remote ID. The remote ID is guaranteed to be usable only if the corresponding file is still accessible to the user and known to TDLib. + /// A file defined by its remote identifier. The remote identifier is guaranteed to be usable only if the corresponding file is still accessible to the user and known to TDLib. /// For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the application /// public class InputFileRemote : InputFile diff --git a/TdLib.Api/Objects/InputIdentityDocument.cs b/TdLib.Api/Objects/InputIdentityDocument.cs index c63bd303..7f5a047d 100644 --- a/TdLib.Api/Objects/InputIdentityDocument.cs +++ b/TdLib.Api/Objects/InputIdentityDocument.cs @@ -33,11 +33,11 @@ public partial class InputIdentityDocument : Object public string Number { get; set; } /// - /// Document expiry date; pass null if not applicable + /// Document expiration date; pass null if not applicable /// [JsonConverter(typeof(Converter))] - [JsonProperty("expiry_date")] - public Date ExpiryDate { get; set; } + [JsonProperty("expiration_date")] + public Date ExpirationDate { get; set; } /// /// Front side of the document diff --git a/TdLib.Api/Objects/InputInvoiceTelegram.cs b/TdLib.Api/Objects/InputInvoiceTelegram.cs new file mode 100644 index 00000000..e209bd18 --- /dev/null +++ b/TdLib.Api/Objects/InputInvoiceTelegram.cs @@ -0,0 +1,39 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class InputInvoice : Object + { + /// + /// An invoice for a payment toward Telegram; must not be used in the in-store apps + /// + public class InputInvoiceTelegram : InputInvoice + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "inputInvoiceTelegram"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Transaction purpose + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("purpose")] + public TelegramPaymentPurpose Purpose { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/InputMessageDocument.cs b/TdLib.Api/Objects/InputMessageDocument.cs index 856cb211..0aafba72 100644 --- a/TdLib.Api/Objects/InputMessageDocument.cs +++ b/TdLib.Api/Objects/InputMessageDocument.cs @@ -42,7 +42,7 @@ public class InputMessageDocument : InputMessageContent public InputThumbnail Thumbnail { get; set; } /// - /// If true, automatic file type detection will be disabled and the document will always be sent as file. Always true for files sent to secret chats + /// True, if automatic file type detection is disabled and the document must be sent as a file. Always true for files sent to secret chats /// [JsonConverter(typeof(Converter))] [JsonProperty("disable_content_type_detection")] diff --git a/TdLib.Api/Objects/InputMessageForwarded.cs b/TdLib.Api/Objects/InputMessageForwarded.cs index ecbfa77e..204b15cf 100644 --- a/TdLib.Api/Objects/InputMessageForwarded.cs +++ b/TdLib.Api/Objects/InputMessageForwarded.cs @@ -35,7 +35,7 @@ public class InputMessageForwarded : InputMessageContent public long FromChatId { get; set; } /// - /// Identifier of the message to forward + /// Identifier of the message to forward. A message can be forwarded only if message.can_be_forwarded /// [JsonConverter(typeof(Converter))] [JsonProperty("message_id")] diff --git a/TdLib.Api/Objects/InputMessagePhoto.cs b/TdLib.Api/Objects/InputMessagePhoto.cs index 07694311..120ee7dc 100644 --- a/TdLib.Api/Objects/InputMessagePhoto.cs +++ b/TdLib.Api/Objects/InputMessagePhoto.cs @@ -69,11 +69,11 @@ public class InputMessagePhoto : InputMessageContent public FormattedText Caption { get; set; } /// - /// Photo self-destruct time, in seconds (0-60). A non-zero self-destruct time can be specified only in private chats + /// Photo self-destruct type; pass null if none; private chats only /// [JsonConverter(typeof(Converter))] - [JsonProperty("self_destruct_time")] - public int SelfDestructTime { get; set; } + [JsonProperty("self_destruct_type")] + public MessageSelfDestructType SelfDestructType { get; set; } /// /// True, if the photo preview must be covered by a spoiler animation; not supported in secret chats diff --git a/TdLib.Api/Objects/InputMessageReplyToMessage.cs b/TdLib.Api/Objects/InputMessageReplyToMessage.cs new file mode 100644 index 00000000..a087ccb9 --- /dev/null +++ b/TdLib.Api/Objects/InputMessageReplyToMessage.cs @@ -0,0 +1,53 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class InputMessageReplyTo : Object + { + /// + /// Contains information about the message or the story to be replied + /// + public class InputMessageReplyToMessage : InputMessageReplyTo + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "inputMessageReplyToMessage"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// The identifier of the chat to which the message to be replied belongs; pass 0 if the message to be replied is in the same chat. Must always be 0 for replies in secret chats. A message can be replied in another chat or topic only if message.can_be_replied_in_another_chat + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_id")] + public long ChatId { get; set; } + + /// + /// The identifier of the message to be replied in the same or the specified chat + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("message_id")] + public long MessageId { get; set; } + + /// + /// Manually chosen quote from the message to be replied; pass null if none; 0-getOption("message_reply_quote_length_max") characters. Must always be null for replies in secret chats. + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("quote")] + public FormattedText Quote { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/InputMessageReplyToStory.cs b/TdLib.Api/Objects/InputMessageReplyToStory.cs new file mode 100644 index 00000000..b5b57022 --- /dev/null +++ b/TdLib.Api/Objects/InputMessageReplyToStory.cs @@ -0,0 +1,46 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class InputMessageReplyTo : Object + { + /// + /// Describes a story to be replied + /// + public class InputMessageReplyToStory : InputMessageReplyTo + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "inputMessageReplyToStory"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// The identifier of the sender of the story. Currently, stories can be replied only in the sender's chat + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_sender_chat_id")] + public long StorySenderChatId { get; set; } + + /// + /// The identifier of the story + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_id")] + public int StoryId { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/InputMessageStory.cs b/TdLib.Api/Objects/InputMessageStory.cs new file mode 100644 index 00000000..86575595 --- /dev/null +++ b/TdLib.Api/Objects/InputMessageStory.cs @@ -0,0 +1,46 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class InputMessageContent : Object + { + /// + /// A message with a forwarded story. Stories can't be sent to secret chats. A story can be forwarded only if story.can_be_forwarded + /// + public class InputMessageStory : InputMessageContent + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "inputMessageStory"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of the chat that posted the story + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_sender_chat_id")] + public long StorySenderChatId { get; set; } + + /// + /// Story identifier + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_id")] + public int StoryId { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/InputMessageText.cs b/TdLib.Api/Objects/InputMessageText.cs index be729b2c..7344da4f 100644 --- a/TdLib.Api/Objects/InputMessageText.cs +++ b/TdLib.Api/Objects/InputMessageText.cs @@ -28,18 +28,18 @@ public class InputMessageText : InputMessageContent public override string Extra { get; set; } /// - /// Formatted text to be sent; 1-getOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually + /// Formatted text to be sent; 0-getOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually /// [JsonConverter(typeof(Converter))] [JsonProperty("text")] public FormattedText Text { get; set; } /// - /// True, if rich web page previews for URLs in the message text must be disabled + /// Options to be used for generation of a link preview; pass null to use default link preview options /// [JsonConverter(typeof(Converter))] - [JsonProperty("disable_web_page_preview")] - public bool DisableWebPagePreview { get; set; } + [JsonProperty("link_preview_options")] + public LinkPreviewOptions LinkPreviewOptions { get; set; } /// /// True, if a chat message draft must be deleted diff --git a/TdLib.Api/Objects/InputMessageVideo.cs b/TdLib.Api/Objects/InputMessageVideo.cs index 7b21cdf8..a508024d 100644 --- a/TdLib.Api/Objects/InputMessageVideo.cs +++ b/TdLib.Api/Objects/InputMessageVideo.cs @@ -83,11 +83,11 @@ public class InputMessageVideo : InputMessageContent public FormattedText Caption { get; set; } /// - /// Video self-destruct time, in seconds (0-60). A non-zero self-destruct time can be specified only in private chats + /// Video self-destruct type; pass null if none; private chats only /// [JsonConverter(typeof(Converter))] - [JsonProperty("self_destruct_time")] - public int SelfDestructTime { get; set; } + [JsonProperty("self_destruct_type")] + public MessageSelfDestructType SelfDestructType { get; set; } /// /// True, if the video preview must be covered by a spoiler animation; not supported in secret chats diff --git a/TdLib.Api/Objects/InputStoryArea.cs b/TdLib.Api/Objects/InputStoryArea.cs new file mode 100644 index 00000000..fa384769 --- /dev/null +++ b/TdLib.Api/Objects/InputStoryArea.cs @@ -0,0 +1,43 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Describes a clickable rectangle area on a story media to be added + /// + public partial class InputStoryArea : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "inputStoryArea"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Position of the area + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("position")] + public StoryAreaPosition Position { get; set; } + + /// + /// Type of the area + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("type")] + public InputStoryAreaType Type { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/InputStoryAreaTypeFoundVenue.cs b/TdLib.Api/Objects/InputStoryAreaTypeFoundVenue.cs new file mode 100644 index 00000000..f0ae4f61 --- /dev/null +++ b/TdLib.Api/Objects/InputStoryAreaTypeFoundVenue.cs @@ -0,0 +1,46 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class InputStoryAreaType : Object + { + /// + /// An area pointing to a venue found by the bot getOption("venue_search_bot_username") + /// + public class InputStoryAreaTypeFoundVenue : InputStoryAreaType + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "inputStoryAreaTypeFoundVenue"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of the inline query, used to found the venue + /// + [JsonConverter(typeof(Converter.Int64))] + [JsonProperty("query_id")] + public long QueryId { get; set; } + + /// + /// Identifier of the inline query result + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("result_id")] + public string ResultId { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/InputStoryAreaTypeLocation.cs b/TdLib.Api/Objects/InputStoryAreaTypeLocation.cs new file mode 100644 index 00000000..d2e65285 --- /dev/null +++ b/TdLib.Api/Objects/InputStoryAreaTypeLocation.cs @@ -0,0 +1,39 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class InputStoryAreaType : Object + { + /// + /// Describes type of a clickable rectangle area on a story media to be added + /// + public class InputStoryAreaTypeLocation : InputStoryAreaType + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "inputStoryAreaTypeLocation"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// The location + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("location")] + public Location Location { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/InputStoryAreaTypePreviousVenue.cs b/TdLib.Api/Objects/InputStoryAreaTypePreviousVenue.cs new file mode 100644 index 00000000..f27a1958 --- /dev/null +++ b/TdLib.Api/Objects/InputStoryAreaTypePreviousVenue.cs @@ -0,0 +1,46 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class InputStoryAreaType : Object + { + /// + /// An area pointing to a venue already added to the story + /// + public class InputStoryAreaTypePreviousVenue : InputStoryAreaType + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "inputStoryAreaTypePreviousVenue"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Provider of the venue + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("venue_provider")] + public string VenueProvider { get; set; } + + /// + /// Identifier of the venue in the provider database + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("venue_id")] + public string VenueId { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/InputStoryAreaTypeSuggestedReaction.cs b/TdLib.Api/Objects/InputStoryAreaTypeSuggestedReaction.cs new file mode 100644 index 00000000..faf8112f --- /dev/null +++ b/TdLib.Api/Objects/InputStoryAreaTypeSuggestedReaction.cs @@ -0,0 +1,53 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class InputStoryAreaType : Object + { + /// + /// An area pointing to a suggested reaction + /// + public class InputStoryAreaTypeSuggestedReaction : InputStoryAreaType + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "inputStoryAreaTypeSuggestedReaction"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Type of the reaction + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("reaction_type")] + public ReactionType ReactionType { get; set; } + + /// + /// True, if reaction has a dark background + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("is_dark")] + public bool IsDark { get; set; } + + /// + /// True, if reaction corner is flipped + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("is_flipped")] + public bool IsFlipped { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/InputStoryAreas.cs b/TdLib.Api/Objects/InputStoryAreas.cs new file mode 100644 index 00000000..07e302ce --- /dev/null +++ b/TdLib.Api/Objects/InputStoryAreas.cs @@ -0,0 +1,35 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Contains a list of story areas to be added + /// + public partial class InputStoryAreas : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "inputStoryAreas"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// List of 0-10 input story areas + /// + [JsonProperty("areas", ItemConverterType = typeof(Converter))] + public InputStoryArea[] Areas { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/InputStoryContentPhoto.cs b/TdLib.Api/Objects/InputStoryContentPhoto.cs new file mode 100644 index 00000000..1a098bf6 --- /dev/null +++ b/TdLib.Api/Objects/InputStoryContentPhoto.cs @@ -0,0 +1,45 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class InputStoryContent : Object + { + /// + /// The content of a story to send + /// + public class InputStoryContentPhoto : InputStoryContent + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "inputStoryContentPhoto"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Photo to send. The photo must be at most 10 MB in size. The photo size must be 1080x1920 + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("photo")] + public InputFile Photo { get; set; } + + /// + /// File identifiers of the stickers added to the photo, if applicable + /// + [JsonProperty("added_sticker_file_ids", ItemConverterType = typeof(Converter))] + public int[] AddedStickerFileIds { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/InputStoryContentVideo.cs b/TdLib.Api/Objects/InputStoryContentVideo.cs new file mode 100644 index 00000000..aa935e68 --- /dev/null +++ b/TdLib.Api/Objects/InputStoryContentVideo.cs @@ -0,0 +1,59 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class InputStoryContent : Object + { + /// + /// A video story + /// + public class InputStoryContentVideo : InputStoryContent + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "inputStoryContentVideo"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Video to be sent. The video size must be 720x1280. The video must be streamable and stored in MPEG4 format, after encoding with x265 codec and key frames added each second + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("video")] + public InputFile Video { get; set; } + + /// + /// File identifiers of the stickers added to the video, if applicable + /// + [JsonProperty("added_sticker_file_ids", ItemConverterType = typeof(Converter))] + public int[] AddedStickerFileIds { get; set; } + + /// + /// Precise duration of the video, in seconds; 0-60 + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("duration")] + public double? Duration { get; set; } + + /// + /// True, if the video has no sound + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("is_animation")] + public bool IsAnimation { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/InternalLinkTypeAttachmentMenuBot.cs b/TdLib.Api/Objects/InternalLinkTypeAttachmentMenuBot.cs index 802558d9..c0b29eca 100644 --- a/TdLib.Api/Objects/InternalLinkTypeAttachmentMenuBot.cs +++ b/TdLib.Api/Objects/InternalLinkTypeAttachmentMenuBot.cs @@ -13,7 +13,8 @@ public partial class InternalLinkType : Object /// /// The link is a link to an attachment menu bot to be opened in the specified or a chosen chat. Process given target_chat to open the chat. /// Then, call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then, use getAttachmentMenuBot to receive information about the bot. - /// If the bot isn't added to attachment menu, then user needs to confirm adding the bot to attachment menu. If user confirms adding, then use toggleBotIsAddedToAttachmentMenu to add it. + /// If the bot isn't added to attachment menu, then show a disclaimer about Mini Apps being a third-party apps, ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu. + /// If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. /// If the attachment menu bot can't be used in the opened chat, show an error to the user. If the bot is added to attachment menu and can be used in the chat, then use openWebApp with the given URL /// public class InternalLinkTypeAttachmentMenuBot : InternalLinkType diff --git a/TdLib.Api/Objects/InternalLinkTypeChatBoost.cs b/TdLib.Api/Objects/InternalLinkTypeChatBoost.cs new file mode 100644 index 00000000..c00f065b --- /dev/null +++ b/TdLib.Api/Objects/InternalLinkTypeChatBoost.cs @@ -0,0 +1,41 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class InternalLinkType : Object + { + /// + /// The link is a link to boost a Telegram chat. Call getChatBoostLinkInfo with the given URL to process the link. + /// If the chat is found, then call getChatBoostStatus and getAvailableChatBoostSlots to get the current boost status and check whether the chat can be boosted. + /// If the user wants to boost the chat and the chat can be boosted, then call boostChat + /// + public class InternalLinkTypeChatBoost : InternalLinkType + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "internalLinkTypeChatBoost"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// URL to be passed to getChatBoostLinkInfo + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("url")] + public string Url { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/InternalLinkTypeChatFolderInvite.cs b/TdLib.Api/Objects/InternalLinkTypeChatFolderInvite.cs new file mode 100644 index 00000000..e51c2ea0 --- /dev/null +++ b/TdLib.Api/Objects/InternalLinkTypeChatFolderInvite.cs @@ -0,0 +1,39 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class InternalLinkType : Object + { + /// + /// The link is an invite link to a chat folder. Call checkChatFolderInviteLink with the given invite link to process the link + /// + public class InternalLinkTypeChatFolderInvite : InternalLinkType + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "internalLinkTypeChatFolderInvite"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Internal representation of the invite link + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("invite_link")] + public string InviteLink { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/InternalLinkTypeFilterSettings.cs b/TdLib.Api/Objects/InternalLinkTypeChatFolderSettings.cs similarity index 81% rename from TdLib.Api/Objects/InternalLinkTypeFilterSettings.cs rename to TdLib.Api/Objects/InternalLinkTypeChatFolderSettings.cs index 61deb048..116aa669 100644 --- a/TdLib.Api/Objects/InternalLinkTypeFilterSettings.cs +++ b/TdLib.Api/Objects/InternalLinkTypeChatFolderSettings.cs @@ -11,15 +11,15 @@ public static partial class TdApi public partial class InternalLinkType : Object { /// - /// The link is a link to the filter section of the app settings + /// The link is a link to the folder section of the app settings /// - public class InternalLinkTypeFilterSettings : InternalLinkType + public class InternalLinkTypeChatFolderSettings : InternalLinkType { /// /// Data type for serialization /// [JsonProperty("@type")] - public override string DataType { get; set; } = "internalLinkTypeFilterSettings"; + public override string DataType { get; set; } = "internalLinkTypeChatFolderSettings"; /// /// Extra data attached to the message diff --git a/TdLib.Api/Objects/InternalLinkTypePremiumGiftCode.cs b/TdLib.Api/Objects/InternalLinkTypePremiumGiftCode.cs new file mode 100644 index 00000000..02b38eba --- /dev/null +++ b/TdLib.Api/Objects/InternalLinkTypePremiumGiftCode.cs @@ -0,0 +1,39 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class InternalLinkType : Object + { + /// + /// The link is a link with a Telegram Premium gift code. Call checkPremiumGiftCode with the given code to process the link. If the code is valid and the user wants to apply it, then call applyPremiumGiftCode + /// + public class InternalLinkTypePremiumGiftCode : InternalLinkType + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "internalLinkTypePremiumGiftCode"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// The Telegram Premium gift code + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("code")] + public string Code { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/InternalLinkTypeProxy.cs b/TdLib.Api/Objects/InternalLinkTypeProxy.cs index 4b423be6..554ee00c 100644 --- a/TdLib.Api/Objects/InternalLinkTypeProxy.cs +++ b/TdLib.Api/Objects/InternalLinkTypeProxy.cs @@ -28,7 +28,7 @@ public class InternalLinkTypeProxy : InternalLinkType public override string Extra { get; set; } /// - /// Proxy server IP address + /// Proxy server domain or IP address /// [JsonConverter(typeof(Converter))] [JsonProperty("server")] diff --git a/TdLib.Api/Objects/InternalLinkTypeSideMenuBot.cs b/TdLib.Api/Objects/InternalLinkTypeSideMenuBot.cs new file mode 100644 index 00000000..76ed0b71 --- /dev/null +++ b/TdLib.Api/Objects/InternalLinkTypeSideMenuBot.cs @@ -0,0 +1,49 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class InternalLinkType : Object + { + /// + /// The link is a link to a bot, which can be installed to the side menu. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. + /// Then, use getAttachmentMenuBot to receive information about the bot. If the bot isn't added to side menu, then show a disclaimer about Mini Apps being a third-party apps, + /// ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. + /// If the bot is added to side menu, then use getWebAppUrl with the given URL + /// + public class InternalLinkTypeSideMenuBot : InternalLinkType + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "internalLinkTypeSideMenuBot"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Username of the bot + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("bot_username")] + public string BotUsername { get; set; } + + /// + /// URL to be passed to getWebAppUrl + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("url")] + public string Url { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/InternalLinkTypeStory.cs b/TdLib.Api/Objects/InternalLinkTypeStory.cs new file mode 100644 index 00000000..c03bf0a0 --- /dev/null +++ b/TdLib.Api/Objects/InternalLinkTypeStory.cs @@ -0,0 +1,46 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class InternalLinkType : Object + { + /// + /// The link is a link to a story. Call searchPublicChat with the given sender username, then call getStory with the received chat identifier and the given story identifier + /// + public class InternalLinkTypeStory : InternalLinkType + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "internalLinkTypeStory"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Username of the sender of the story + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_sender_username")] + public string StorySenderUsername { get; set; } + + /// + /// Story identifier + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_id")] + public int StoryId { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/InternalLinkTypeWebApp.cs b/TdLib.Api/Objects/InternalLinkTypeWebApp.cs index 7872113a..6a9ad937 100644 --- a/TdLib.Api/Objects/InternalLinkTypeWebApp.cs +++ b/TdLib.Api/Objects/InternalLinkTypeWebApp.cs @@ -12,7 +12,9 @@ public partial class InternalLinkType : Object { /// /// The link is a link to a Web App. Call searchPublicChat with the given bot username, check that the user is a bot, then call searchWebApp with the received bot and the given web_app_short_name. - /// Process received foundWebApp by showing a confirmation dialog if needed, then calling getWebAppLinkUrl and opening the returned URL + /// Process received foundWebApp by showing a confirmation dialog if needed. If the bot can be added to attachment or side menu, but isn't added yet, then show a disclaimer about Mini Apps being a third-party apps + /// instead of the dialog and ask the user to accept their Terms of service. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. + /// Then, call getWebAppLinkUrl and open the returned URL as a Web App /// public class InternalLinkTypeWebApp : InternalLinkType { diff --git a/TdLib.Api/Objects/InviteLinkChatTypeBasicGroup.cs b/TdLib.Api/Objects/InviteLinkChatTypeBasicGroup.cs new file mode 100644 index 00000000..7ace15c1 --- /dev/null +++ b/TdLib.Api/Objects/InviteLinkChatTypeBasicGroup.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class InviteLinkChatType : Object + { + /// + /// Describes the type of a chat to which points an invite link + /// + public class InviteLinkChatTypeBasicGroup : InviteLinkChatType + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "inviteLinkChatTypeBasicGroup"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/InviteLinkChatTypeChannel.cs b/TdLib.Api/Objects/InviteLinkChatTypeChannel.cs new file mode 100644 index 00000000..b55c33d1 --- /dev/null +++ b/TdLib.Api/Objects/InviteLinkChatTypeChannel.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class InviteLinkChatType : Object + { + /// + /// The link is an invite link for a channel + /// + public class InviteLinkChatTypeChannel : InviteLinkChatType + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "inviteLinkChatTypeChannel"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/InviteLinkChatTypeSupergroup.cs b/TdLib.Api/Objects/InviteLinkChatTypeSupergroup.cs new file mode 100644 index 00000000..33d0ca62 --- /dev/null +++ b/TdLib.Api/Objects/InviteLinkChatTypeSupergroup.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class InviteLinkChatType : Object + { + /// + /// The link is an invite link for a supergroup + /// + public class InviteLinkChatTypeSupergroup : InviteLinkChatType + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "inviteLinkChatTypeSupergroup"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/Invoice.cs b/TdLib.Api/Objects/Invoice.cs index 03a0ee39..c6399c08 100644 --- a/TdLib.Api/Objects/Invoice.cs +++ b/TdLib.Api/Objects/Invoice.cs @@ -58,6 +58,13 @@ public partial class Invoice : Object [JsonProperty("recurring_payment_terms_of_service_url")] public string RecurringPaymentTermsOfServiceUrl { get; set; } + /// + /// An HTTP URL with terms of service for non-recurring payments. If non-empty, then the user must accept the terms of service before allowed to pay + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("terms_of_service_url")] + public string TermsOfServiceUrl { get; set; } + /// /// True, if the payment is a test payment /// diff --git a/TdLib.Api/Objects/LinkPreviewOptions.cs b/TdLib.Api/Objects/LinkPreviewOptions.cs new file mode 100644 index 00000000..015d5d4c --- /dev/null +++ b/TdLib.Api/Objects/LinkPreviewOptions.cs @@ -0,0 +1,64 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Options to be used for generation of a link preview + /// + public partial class LinkPreviewOptions : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "linkPreviewOptions"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// True, if link preview must be disabled + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("is_disabled")] + public bool IsDisabled { get; set; } + + /// + /// URL to use for link preview. If empty, then the first URL found in the message text will be used + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("url")] + public string Url { get; set; } + + /// + /// True, if shown media preview must be small; ignored in secret chats or if the URL isn't explicitly specified + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("force_small_media")] + public bool ForceSmallMedia { get; set; } + + /// + /// True, if shown media preview must be large; ignored in secret chats or if the URL isn't explicitly specified + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("force_large_media")] + public bool ForceLargeMedia { get; set; } + + /// + /// True, if link preview must be shown above message text; otherwise, the link preview will be shown below the message text; ignored in secret chats + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("show_above_text")] + public bool ShowAboveText { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/Message.cs b/TdLib.Api/Objects/Message.cs index 9b23e3be..3741407f 100644 --- a/TdLib.Api/Objects/Message.cs +++ b/TdLib.Api/Objects/Message.cs @@ -47,14 +47,14 @@ public partial class Message : Object public long ChatId { get; set; } /// - /// The sending state of the message; may be null + /// The sending state of the message; may be null if the message isn't being sent and didn't fail to be sent /// [JsonConverter(typeof(Converter))] [JsonProperty("sending_state")] public MessageSendingState SendingState { get; set; } /// - /// The scheduling state of the message; may be null + /// The scheduling state of the message; may be null if the message isn't scheduled /// [JsonConverter(typeof(Converter))] [JsonProperty("scheduling_state")] @@ -88,6 +88,13 @@ public partial class Message : Object [JsonProperty("can_be_forwarded")] public bool CanBeForwarded { get; set; } + /// + /// True, if the message can be replied in another chat or topic + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("can_be_replied_in_another_chat")] + public bool CanBeRepliedInAnotherChat { get; set; } + /// /// True, if content of the message can be saved locally or copied /// @@ -194,14 +201,21 @@ public partial class Message : Object public int EditDate { get; set; } /// - /// Information about the initial message sender; may be null + /// Information about the initial message sender; may be null if none or unknown /// [JsonConverter(typeof(Converter))] [JsonProperty("forward_info")] public MessageForwardInfo ForwardInfo { get; set; } /// - /// Information about interactions with the message; may be null + /// Information about the initial message for messages created with importMessages; may be null if the message isn't imported + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("import_info")] + public MessageImportInfo ImportInfo { get; set; } + + /// + /// Information about interactions with the message; may be null if none /// [JsonConverter(typeof(Converter))] [JsonProperty("interaction_info")] @@ -214,18 +228,11 @@ public partial class Message : Object public UnreadReaction[] UnreadReactions { get; set; } /// - /// If non-zero, the identifier of the chat to which the replied message belongs; Currently, only messages in the Replies chat can have different reply_in_chat_id and chat_id - /// - [JsonConverter(typeof(Converter))] - [JsonProperty("reply_in_chat_id")] - public long ReplyInChatId { get; set; } - - /// - /// If non-zero, the identifier of the message this message is replying to; can be the identifier of a deleted message + /// Information about the message or the story this message is replying to; may be null if none /// [JsonConverter(typeof(Converter))] - [JsonProperty("reply_to_message_id")] - public long ReplyToMessageId { get; set; } + [JsonProperty("reply_to")] + public MessageReplyTo ReplyTo { get; set; } /// /// If non-zero, the identifier of the message thread the message belongs to; unique within the chat to which the message belongs @@ -235,21 +242,21 @@ public partial class Message : Object public long MessageThreadId { get; set; } /// - /// The message's self-destruct time, in seconds; 0 if none. TDLib will send updateDeleteMessages or updateMessageContent once the time expires + /// The message's self-destruct type; may be null if none /// [JsonConverter(typeof(Converter))] - [JsonProperty("self_destruct_time")] - public int SelfDestructTime { get; set; } + [JsonProperty("self_destruct_type")] + public MessageSelfDestructType SelfDestructType { get; set; } /// - /// Time left before the message self-destruct timer expires, in seconds. If the self-destruct timer isn't started yet, equals to the value of the self_destruct_time field + /// Time left before the message self-destruct timer expires, in seconds; 0 if self-destruction isn't scheduled yet /// [JsonConverter(typeof(Converter))] [JsonProperty("self_destruct_in")] public double? SelfDestructIn { get; set; } /// - /// Time left before the message will be automatically deleted by message_auto_delete_time setting of the chat, in seconds; 0 if never. TDLib will send updateDeleteMessages or updateMessageContent once the time expires + /// Time left before the message will be automatically deleted by message_auto_delete_time setting of the chat, in seconds; 0 if never /// [JsonConverter(typeof(Converter))] [JsonProperty("auto_delete_in")] @@ -291,7 +298,7 @@ public partial class Message : Object public MessageContent Content { get; set; } /// - /// Reply markup for the message; may be null + /// Reply markup for the message; may be null if none /// [JsonConverter(typeof(Converter))] [JsonProperty("reply_markup")] diff --git a/TdLib.Api/Objects/MessageBotWriteAccessAllowed.cs b/TdLib.Api/Objects/MessageBotWriteAccessAllowed.cs index 58cc5c93..a2b8f8d2 100644 --- a/TdLib.Api/Objects/MessageBotWriteAccessAllowed.cs +++ b/TdLib.Api/Objects/MessageBotWriteAccessAllowed.cs @@ -28,11 +28,11 @@ public class MessageBotWriteAccessAllowed : MessageContent public override string Extra { get; set; } /// - /// Information about the Web App, which requested the access; may be null if none or the Web App was opened from the attachment menu + /// The reason why the bot was allowed to write messages /// [JsonConverter(typeof(Converter))] - [JsonProperty("web_app")] - public WebApp WebApp { get; set; } + [JsonProperty("reason")] + public BotWriteAccessAllowReason Reason { get; set; } } } } diff --git a/TdLib.Api/Objects/MessageChatSetBackground.cs b/TdLib.Api/Objects/MessageChatSetBackground.cs new file mode 100644 index 00000000..31d665de --- /dev/null +++ b/TdLib.Api/Objects/MessageChatSetBackground.cs @@ -0,0 +1,46 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class MessageContent : Object + { + /// + /// A new background was set in the chat + /// + public class MessageChatSetBackground : MessageContent + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "messageChatSetBackground"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of the message with a previously set same background; 0 if none. Can be an identifier of a deleted message + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("old_background_message_id")] + public long OldBackgroundMessageId { get; set; } + + /// + /// The new background + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("background")] + public ChatBackground Background { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/MessageCopyOptions.cs b/TdLib.Api/Objects/MessageCopyOptions.cs index a955083c..296c2890 100644 --- a/TdLib.Api/Objects/MessageCopyOptions.cs +++ b/TdLib.Api/Objects/MessageCopyOptions.cs @@ -9,7 +9,7 @@ namespace TdLib public static partial class TdApi { /// - /// Options to be used when a message content is copied without reference to the original sender. Service messages and messageInvoice can't be copied + /// Options to be used when a message content is copied without reference to the original sender. Service messages, and messages with messageInvoice or messagePremiumGiveaway content can't be copied /// public partial class MessageCopyOptions : Object { diff --git a/TdLib.Api/Objects/MessageForwardInfo.cs b/TdLib.Api/Objects/MessageForwardInfo.cs index 38e2c71c..a3f74169 100644 --- a/TdLib.Api/Objects/MessageForwardInfo.cs +++ b/TdLib.Api/Objects/MessageForwardInfo.cs @@ -26,11 +26,11 @@ public partial class MessageForwardInfo : Object public override string Extra { get; set; } /// - /// Origin of a forwarded message + /// Origin of the forwarded message /// [JsonConverter(typeof(Converter))] [JsonProperty("origin")] - public MessageForwardOrigin Origin { get; set; } + public MessageOrigin Origin { get; set; } /// /// Point in time (Unix timestamp) when the message was originally sent diff --git a/TdLib.Api/Objects/MessageGiftedPremium.cs b/TdLib.Api/Objects/MessageGiftedPremium.cs index 58997395..98a8ad80 100644 --- a/TdLib.Api/Objects/MessageGiftedPremium.cs +++ b/TdLib.Api/Objects/MessageGiftedPremium.cs @@ -27,6 +27,13 @@ public class MessageGiftedPremium : MessageContent [JsonProperty("@extra")] public override string Extra { get; set; } + /// + /// The identifier of a user that gifted Telegram Premium; 0 if the gift was anonymous + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("gifter_user_id")] + public long GifterUserId { get; set; } + /// /// Currency for the paid amount /// @@ -41,6 +48,20 @@ public class MessageGiftedPremium : MessageContent [JsonProperty("amount")] public long Amount { get; set; } + /// + /// Cryptocurrency used to pay for the gift; may be empty if none + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("cryptocurrency")] + public string Cryptocurrency { get; set; } + + /// + /// The paid amount, in the smallest units of the cryptocurrency + /// + [JsonConverter(typeof(Converter.Int64))] + [JsonProperty("cryptocurrency_amount")] + public long CryptocurrencyAmount { get; set; } + /// /// Number of month the Telegram Premium subscription will be active /// diff --git a/TdLib.Api/Objects/MessageImportInfo.cs b/TdLib.Api/Objects/MessageImportInfo.cs new file mode 100644 index 00000000..3e30b205 --- /dev/null +++ b/TdLib.Api/Objects/MessageImportInfo.cs @@ -0,0 +1,43 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Contains information about a message created with importMessages + /// + public partial class MessageImportInfo : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "messageImportInfo"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Name of the original sender + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("sender_name")] + public string SenderName { get; set; } + + /// + /// Point in time (Unix timestamp) when the message was originally sent + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("date")] + public int Date { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/MessageLinkInfo.cs b/TdLib.Api/Objects/MessageLinkInfo.cs index 0fb1e670..54483689 100644 --- a/TdLib.Api/Objects/MessageLinkInfo.cs +++ b/TdLib.Api/Objects/MessageLinkInfo.cs @@ -54,7 +54,7 @@ public partial class MessageLinkInfo : Object public Message Message { get; set; } /// - /// Timestamp from which the video/audio/video note/voice note playing must start, in seconds; 0 if not specified. The media can be in the message content or in its web page preview + /// Timestamp from which the video/audio/video note/voice note/story playing must start, in seconds; 0 if not specified. The media can be in the message content or in its web page preview /// [JsonConverter(typeof(Converter))] [JsonProperty("media_timestamp")] diff --git a/TdLib.Api/Objects/MessageForwardOriginChannel.cs b/TdLib.Api/Objects/MessageOriginChannel.cs similarity index 85% rename from TdLib.Api/Objects/MessageForwardOriginChannel.cs rename to TdLib.Api/Objects/MessageOriginChannel.cs index 3d89e2ef..ad5d3c45 100644 --- a/TdLib.Api/Objects/MessageForwardOriginChannel.cs +++ b/TdLib.Api/Objects/MessageOriginChannel.cs @@ -8,18 +8,18 @@ namespace TdLib /// public static partial class TdApi { - public partial class MessageForwardOrigin : Object + public partial class MessageOrigin : Object { /// /// The message was originally a post in a channel /// - public class MessageForwardOriginChannel : MessageForwardOrigin + public class MessageOriginChannel : MessageOrigin { /// /// Data type for serialization /// [JsonProperty("@type")] - public override string DataType { get; set; } = "messageForwardOriginChannel"; + public override string DataType { get; set; } = "messageOriginChannel"; /// /// Extra data attached to the message @@ -28,7 +28,7 @@ public class MessageForwardOriginChannel : MessageForwardOrigin public override string Extra { get; set; } /// - /// Identifier of the chat from which the message was originally forwarded + /// Identifier of the channel chat to which the message was originally sent /// [JsonConverter(typeof(Converter))] [JsonProperty("chat_id")] diff --git a/TdLib.Api/Objects/MessageForwardOriginChat.cs b/TdLib.Api/Objects/MessageOriginChat.cs similarity index 89% rename from TdLib.Api/Objects/MessageForwardOriginChat.cs rename to TdLib.Api/Objects/MessageOriginChat.cs index ccea7490..f8824bff 100644 --- a/TdLib.Api/Objects/MessageForwardOriginChat.cs +++ b/TdLib.Api/Objects/MessageOriginChat.cs @@ -8,18 +8,18 @@ namespace TdLib /// public static partial class TdApi { - public partial class MessageForwardOrigin : Object + public partial class MessageOrigin : Object { /// /// The message was originally sent on behalf of a chat /// - public class MessageForwardOriginChat : MessageForwardOrigin + public class MessageOriginChat : MessageOrigin { /// /// Data type for serialization /// [JsonProperty("@type")] - public override string DataType { get; set; } = "messageForwardOriginChat"; + public override string DataType { get; set; } = "messageOriginChat"; /// /// Extra data attached to the message diff --git a/TdLib.Api/Objects/MessageForwardOriginHiddenUser.cs b/TdLib.Api/Objects/MessageOriginHiddenUser.cs similarity index 86% rename from TdLib.Api/Objects/MessageForwardOriginHiddenUser.cs rename to TdLib.Api/Objects/MessageOriginHiddenUser.cs index 1e26357f..7badd7f4 100644 --- a/TdLib.Api/Objects/MessageForwardOriginHiddenUser.cs +++ b/TdLib.Api/Objects/MessageOriginHiddenUser.cs @@ -8,18 +8,18 @@ namespace TdLib /// public static partial class TdApi { - public partial class MessageForwardOrigin : Object + public partial class MessageOrigin : Object { /// /// The message was originally sent by a user, which is hidden by their privacy settings /// - public class MessageForwardOriginHiddenUser : MessageForwardOrigin + public class MessageOriginHiddenUser : MessageOrigin { /// /// Data type for serialization /// [JsonProperty("@type")] - public override string DataType { get; set; } = "messageForwardOriginHiddenUser"; + public override string DataType { get; set; } = "messageOriginHiddenUser"; /// /// Extra data attached to the message diff --git a/TdLib.Api/Objects/MessageForwardOriginUser.cs b/TdLib.Api/Objects/MessageOriginUser.cs similarity index 80% rename from TdLib.Api/Objects/MessageForwardOriginUser.cs rename to TdLib.Api/Objects/MessageOriginUser.cs index eaff91ba..27bf7deb 100644 --- a/TdLib.Api/Objects/MessageForwardOriginUser.cs +++ b/TdLib.Api/Objects/MessageOriginUser.cs @@ -8,18 +8,18 @@ namespace TdLib /// public static partial class TdApi { - public partial class MessageForwardOrigin : Object + public partial class MessageOrigin : Object { /// - /// Contains information about the origin of a forwarded message + /// Contains information about the origin of a message /// - public class MessageForwardOriginUser : MessageForwardOrigin + public class MessageOriginUser : MessageOrigin { /// /// Data type for serialization /// [JsonProperty("@type")] - public override string DataType { get; set; } = "messageForwardOriginUser"; + public override string DataType { get; set; } = "messageOriginUser"; /// /// Extra data attached to the message diff --git a/TdLib.Api/Objects/MessagePremiumGiftCode.cs b/TdLib.Api/Objects/MessagePremiumGiftCode.cs new file mode 100644 index 00000000..b35e6806 --- /dev/null +++ b/TdLib.Api/Objects/MessagePremiumGiftCode.cs @@ -0,0 +1,74 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class MessageContent : Object + { + /// + /// A Telegram Premium gift code was created for the user + /// + public class MessagePremiumGiftCode : MessageContent + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "messagePremiumGiftCode"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of a chat or a user that created the gift code + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("creator_id")] + public MessageSender CreatorId { get; set; } + + /// + /// True, if the gift code was created for a giveaway + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("is_from_giveaway")] + public bool IsFromGiveaway { get; set; } + + /// + /// True, if the winner for the corresponding Telegram Premium subscription wasn't chosen + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("is_unclaimed")] + public bool IsUnclaimed { get; set; } + + /// + /// Number of month the Telegram Premium subscription will be active after code activation + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("month_count")] + public int MonthCount { get; set; } + + /// + /// A sticker to be shown in the message; may be null if unknown + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("sticker")] + public Sticker Sticker { get; set; } + + /// + /// The gift code + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("code")] + public string Code { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/MessagePremiumGiveaway.cs b/TdLib.Api/Objects/MessagePremiumGiveaway.cs new file mode 100644 index 00000000..7b3ec769 --- /dev/null +++ b/TdLib.Api/Objects/MessagePremiumGiveaway.cs @@ -0,0 +1,60 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class MessageContent : Object + { + /// + /// A Telegram Premium giveaway + /// + public class MessagePremiumGiveaway : MessageContent + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "messagePremiumGiveaway"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Giveaway parameters + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("parameters")] + public PremiumGiveawayParameters Parameters { get; set; } + + /// + /// Number of users which will receive Telegram Premium subscription gift codes + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("winner_count")] + public int WinnerCount { get; set; } + + /// + /// Number of month the Telegram Premium subscription will be active after code activation + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("month_count")] + public int MonthCount { get; set; } + + /// + /// A sticker to be shown in the message; may be null if unknown + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("sticker")] + public Sticker Sticker { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/MessagePremiumGiveawayCreated.cs b/TdLib.Api/Objects/MessagePremiumGiveawayCreated.cs new file mode 100644 index 00000000..3c1889bb --- /dev/null +++ b/TdLib.Api/Objects/MessagePremiumGiveawayCreated.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class MessageContent : Object + { + /// + /// A Telegram Premium giveaway was created for the chat + /// + public class MessagePremiumGiveawayCreated : MessageContent + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "messagePremiumGiveawayCreated"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/MessageReaction.cs b/TdLib.Api/Objects/MessageReaction.cs index 83814eb4..e8e054ee 100644 --- a/TdLib.Api/Objects/MessageReaction.cs +++ b/TdLib.Api/Objects/MessageReaction.cs @@ -46,6 +46,13 @@ public partial class MessageReaction : Object [JsonProperty("is_chosen")] public bool IsChosen { get; set; } + /// + /// Identifier of the message sender used by the current user to add the reaction; may be null if unknown or the reaction isn't chosen + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("used_sender_id")] + public MessageSender UsedSenderId { get; set; } + /// /// Identifiers of at most 3 recent message senders, added the reaction; available in private, basic group and supergroup chats /// diff --git a/TdLib.Api/Objects/MessageReplyToMessage.cs b/TdLib.Api/Objects/MessageReplyToMessage.cs new file mode 100644 index 00000000..ef9cffb0 --- /dev/null +++ b/TdLib.Api/Objects/MessageReplyToMessage.cs @@ -0,0 +1,81 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class MessageReplyTo : Object + { + /// + /// Contains information about the message or the story a message is replying to + /// + public class MessageReplyToMessage : MessageReplyTo + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "messageReplyToMessage"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// The identifier of the chat to which the message belongs; may be 0 if the replied message is in unknown chat + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_id")] + public long ChatId { get; set; } + + /// + /// The identifier of the message; may be 0 if the replied message is in unknown chat + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("message_id")] + public long MessageId { get; set; } + + /// + /// Manually or automatically chosen quote from the replied message; may be null if none. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities can be present in the quote + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("quote")] + public FormattedText Quote { get; set; } + + /// + /// True, if the quote was manually chosen by the message sender + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("is_quote_manual")] + public bool IsQuoteManual { get; set; } + + /// + /// Information about origin of the message if the message was from another chat or topic; may be null for messages from the same chat + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("origin")] + public MessageOrigin Origin { get; set; } + + /// + /// Point in time (Unix timestamp) when the message was sent if the message was from another chat or topic; 0 for messages from the same chat + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("origin_send_date")] + public int OriginSendDate { get; set; } + + /// + /// Media content of the message if the message was from another chat or topic; may be null for messages from the same chat and messages without media. + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("content")] + public MessageContent Content { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/MessageReplyToStory.cs b/TdLib.Api/Objects/MessageReplyToStory.cs new file mode 100644 index 00000000..25026018 --- /dev/null +++ b/TdLib.Api/Objects/MessageReplyToStory.cs @@ -0,0 +1,46 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class MessageReplyTo : Object + { + /// + /// Describes a story replied by a given message + /// + public class MessageReplyToStory : MessageReplyTo + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "messageReplyToStory"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// The identifier of the sender of the story + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_sender_chat_id")] + public long StorySenderChatId { get; set; } + + /// + /// The identifier of the story + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_id")] + public int StoryId { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/MessageSchedulingStateSendAtDate.cs b/TdLib.Api/Objects/MessageSchedulingStateSendAtDate.cs index 9efa25bb..5ad1ca8f 100644 --- a/TdLib.Api/Objects/MessageSchedulingStateSendAtDate.cs +++ b/TdLib.Api/Objects/MessageSchedulingStateSendAtDate.cs @@ -28,7 +28,7 @@ public class MessageSchedulingStateSendAtDate : MessageSchedulingState public override string Extra { get; set; } /// - /// Date the message will be sent. The date must be within 367 days in the future + /// Point in time (Unix timestamp) when the message will be sent. The date must be within 367 days in the future /// [JsonConverter(typeof(Converter))] [JsonProperty("send_date")] diff --git a/TdLib.Api/Objects/MessageSchedulingStateSendWhenOnline.cs b/TdLib.Api/Objects/MessageSchedulingStateSendWhenOnline.cs index 772df557..c88bdd9e 100644 --- a/TdLib.Api/Objects/MessageSchedulingStateSendWhenOnline.cs +++ b/TdLib.Api/Objects/MessageSchedulingStateSendWhenOnline.cs @@ -11,7 +11,7 @@ public static partial class TdApi public partial class MessageSchedulingState : Object { /// - /// The message will be sent when the peer will be online. Applicable to private chats only and when the exact online status of the peer is known + /// The message will be sent when the other user is online. Applicable to private chats only and when the exact online status of the other user is known /// public class MessageSchedulingStateSendWhenOnline : MessageSchedulingState { diff --git a/TdLib.Api/Objects/MessageSelfDestructTypeImmediately.cs b/TdLib.Api/Objects/MessageSelfDestructTypeImmediately.cs new file mode 100644 index 00000000..e1963859 --- /dev/null +++ b/TdLib.Api/Objects/MessageSelfDestructTypeImmediately.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class MessageSelfDestructType : Object + { + /// + /// The message can be opened only once and will be self-destructed once closed + /// + public class MessageSelfDestructTypeImmediately : MessageSelfDestructType + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "messageSelfDestructTypeImmediately"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/MessageSelfDestructTypeTimer.cs b/TdLib.Api/Objects/MessageSelfDestructTypeTimer.cs new file mode 100644 index 00000000..f871e27b --- /dev/null +++ b/TdLib.Api/Objects/MessageSelfDestructTypeTimer.cs @@ -0,0 +1,39 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class MessageSelfDestructType : Object + { + /// + /// Describes when a message will be self-destructed + /// + public class MessageSelfDestructTypeTimer : MessageSelfDestructType + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "messageSelfDestructTypeTimer"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// The message's self-destruct time, in seconds; must be between 0 and 60 in private chats + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("self_destruct_time")] + public int SelfDestructTime { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/MessageSendOptions.cs b/TdLib.Api/Objects/MessageSendOptions.cs index 9dd75c57..6d4e5902 100644 --- a/TdLib.Api/Objects/MessageSendOptions.cs +++ b/TdLib.Api/Objects/MessageSendOptions.cs @@ -66,6 +66,13 @@ public partial class MessageSendOptions : Object [JsonConverter(typeof(Converter))] [JsonProperty("sending_id")] public int SendingId { get; set; } + + /// + /// Pass true to get a fake message instead of actually sending them + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("only_preview")] + public bool OnlyPreview { get; set; } } } } \ No newline at end of file diff --git a/TdLib.Api/Objects/MessageSendingStateFailed.cs b/TdLib.Api/Objects/MessageSendingStateFailed.cs index 7863896d..13a29b2d 100644 --- a/TdLib.Api/Objects/MessageSendingStateFailed.cs +++ b/TdLib.Api/Objects/MessageSendingStateFailed.cs @@ -28,18 +28,11 @@ public class MessageSendingStateFailed : MessageSendingState public override string Extra { get; set; } /// - /// An error code; 0 if unknown + /// The cause of the message sending failure /// [JsonConverter(typeof(Converter))] - [JsonProperty("error_code")] - public int ErrorCode { get; set; } - - /// - /// Error message - /// - [JsonConverter(typeof(Converter))] - [JsonProperty("error_message")] - public string ErrorMessage { get; set; } + [JsonProperty("error")] + public Error Error { get; set; } /// /// True, if the message can be re-sent @@ -55,6 +48,20 @@ public class MessageSendingStateFailed : MessageSendingState [JsonProperty("need_another_sender")] public bool NeedAnotherSender { get; set; } + /// + /// True, if the message can be re-sent only if another quote is chosen in the message that is replied by the given message + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("need_another_reply_quote")] + public bool NeedAnotherReplyQuote { get; set; } + + /// + /// True, if the message can be re-sent only if the message to be replied is removed. This will be done automatically by resendMessages + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("need_drop_reply")] + public bool NeedDropReply { get; set; } + /// /// Time left before the message can be re-sent, in seconds. No update is sent when this field changes /// diff --git a/TdLib.Api/Objects/MessageSourceScreenshot.cs b/TdLib.Api/Objects/MessageSourceScreenshot.cs new file mode 100644 index 00000000..c685fd25 --- /dev/null +++ b/TdLib.Api/Objects/MessageSourceScreenshot.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class MessageSource : Object + { + /// + /// The message was screenshotted; the source must be used only if the message content was visible during the screenshot + /// + public class MessageSourceScreenshot : MessageSource + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "messageSourceScreenshot"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/MessageSponsor.cs b/TdLib.Api/Objects/MessageSponsor.cs new file mode 100644 index 00000000..d4b5530e --- /dev/null +++ b/TdLib.Api/Objects/MessageSponsor.cs @@ -0,0 +1,50 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Information about the sponsor of a message + /// + public partial class MessageSponsor : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "messageSponsor"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Type of the sponsor + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("type")] + public MessageSponsorType Type { get; set; } + + /// + /// Photo of the sponsor; may be null if must not be shown + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("photo")] + public ChatPhotoInfo Photo { get; set; } + + /// + /// Additional optional information about the sponsor to be shown along with the message + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("info")] + public string Info { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/MessageSponsorTypeBot.cs b/TdLib.Api/Objects/MessageSponsorTypeBot.cs new file mode 100644 index 00000000..2cf23a5e --- /dev/null +++ b/TdLib.Api/Objects/MessageSponsorTypeBot.cs @@ -0,0 +1,46 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class MessageSponsorType : Object + { + /// + /// Describes type of a message sponsor + /// + public class MessageSponsorTypeBot : MessageSponsorType + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "messageSponsorTypeBot"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// User identifier of the bot + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("bot_user_id")] + public long BotUserId { get; set; } + + /// + /// An internal link to be opened when the sponsored message is clicked + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("link")] + public InternalLinkType Link { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/MessageSponsorTypePrivateChannel.cs b/TdLib.Api/Objects/MessageSponsorTypePrivateChannel.cs new file mode 100644 index 00000000..b7d93a26 --- /dev/null +++ b/TdLib.Api/Objects/MessageSponsorTypePrivateChannel.cs @@ -0,0 +1,46 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class MessageSponsorType : Object + { + /// + /// The sponsor is a private channel chat + /// + public class MessageSponsorTypePrivateChannel : MessageSponsorType + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "messageSponsorTypePrivateChannel"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Title of the chat + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("title")] + public string Title { get; set; } + + /// + /// Invite link for the channel + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("invite_link")] + public string InviteLink { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/MessageSponsorTypePublicChannel.cs b/TdLib.Api/Objects/MessageSponsorTypePublicChannel.cs new file mode 100644 index 00000000..d3ccf4be --- /dev/null +++ b/TdLib.Api/Objects/MessageSponsorTypePublicChannel.cs @@ -0,0 +1,46 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class MessageSponsorType : Object + { + /// + /// The sponsor is a public channel chat + /// + public class MessageSponsorTypePublicChannel : MessageSponsorType + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "messageSponsorTypePublicChannel"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Sponsor chat identifier + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_id")] + public long ChatId { get; set; } + + /// + /// An internal link to be opened when the sponsored message is clicked; may be null if the sponsor chat needs to be opened instead + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("link")] + public InternalLinkType Link { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/MessageSponsorTypeWebsite.cs b/TdLib.Api/Objects/MessageSponsorTypeWebsite.cs new file mode 100644 index 00000000..9d302e48 --- /dev/null +++ b/TdLib.Api/Objects/MessageSponsorTypeWebsite.cs @@ -0,0 +1,46 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class MessageSponsorType : Object + { + /// + /// The sponsor is a website + /// + public class MessageSponsorTypeWebsite : MessageSponsorType + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "messageSponsorTypeWebsite"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// URL of the website + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("url")] + public string Url { get; set; } + + /// + /// Name of the website + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("name")] + public string Name { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/MessageStory.cs b/TdLib.Api/Objects/MessageStory.cs new file mode 100644 index 00000000..e9145d2e --- /dev/null +++ b/TdLib.Api/Objects/MessageStory.cs @@ -0,0 +1,53 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class MessageContent : Object + { + /// + /// A message with a forwarded story + /// + public class MessageStory : MessageContent + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "messageStory"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of the chat that posted the story + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_sender_chat_id")] + public long StorySenderChatId { get; set; } + + /// + /// Story identifier + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_id")] + public int StoryId { get; set; } + + /// + /// True, if the story was automatically forwarded because of a mention of the user + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("via_mention")] + public bool ViaMention { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/MessageText.cs b/TdLib.Api/Objects/MessageText.cs index 78fa9d02..fc8bd25f 100644 --- a/TdLib.Api/Objects/MessageText.cs +++ b/TdLib.Api/Objects/MessageText.cs @@ -35,11 +35,18 @@ public class MessageText : MessageContent public FormattedText Text { get; set; } /// - /// A preview of the web page that's mentioned in the text; may be null + /// A link preview attached to the message; may be null /// [JsonConverter(typeof(Converter))] [JsonProperty("web_page")] public WebPage WebPage { get; set; } + + /// + /// Options which was used for generation of the link preview; may be null if default options were used + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("link_preview_options")] + public LinkPreviewOptions LinkPreviewOptions { get; set; } } } } diff --git a/TdLib.Api/Objects/MessageThreadInfo.cs b/TdLib.Api/Objects/MessageThreadInfo.cs index ec0115ed..7dfc3ad2 100644 --- a/TdLib.Api/Objects/MessageThreadInfo.cs +++ b/TdLib.Api/Objects/MessageThreadInfo.cs @@ -60,7 +60,7 @@ public partial class MessageThreadInfo : Object public Message[] Messages { get; set; } /// - /// A draft of a message in the message thread; may be null + /// A draft of a message in the message thread; may be null if none /// [JsonConverter(typeof(Converter))] [JsonProperty("draft_message")] diff --git a/TdLib.Api/Objects/MessageUnsupported.cs b/TdLib.Api/Objects/MessageUnsupported.cs index 67779306..1052aee7 100644 --- a/TdLib.Api/Objects/MessageUnsupported.cs +++ b/TdLib.Api/Objects/MessageUnsupported.cs @@ -11,7 +11,7 @@ public static partial class TdApi public partial class MessageContent : Object { /// - /// Message content that is not supported in the current TDLib version + /// A message content that is not supported in the current TDLib version /// public class MessageUnsupported : MessageContent { diff --git a/TdLib.Api/Objects/MessageWebAppDataReceived.cs b/TdLib.Api/Objects/MessageWebAppDataReceived.cs index e4b57cf0..986ae5e0 100644 --- a/TdLib.Api/Objects/MessageWebAppDataReceived.cs +++ b/TdLib.Api/Objects/MessageWebAppDataReceived.cs @@ -35,7 +35,7 @@ public class MessageWebAppDataReceived : MessageContent public string ButtonText { get; set; } /// - /// Received data + /// The data /// [JsonConverter(typeof(Converter))] [JsonProperty("data")] diff --git a/TdLib.Api/Objects/NotificationTypeNewPushMessage.cs b/TdLib.Api/Objects/NotificationTypeNewPushMessage.cs index 27f2f97d..43e9bb54 100644 --- a/TdLib.Api/Objects/NotificationTypeNewPushMessage.cs +++ b/TdLib.Api/Objects/NotificationTypeNewPushMessage.cs @@ -28,7 +28,7 @@ public class NotificationTypeNewPushMessage : NotificationType public override string Extra { get; set; } /// - /// The message identifier. The message will not be available in the chat history, but the ID can be used in viewMessages, or as reply_to_message_id + /// The message identifier. The message will not be available in the chat history, but the identifier can be used in viewMessages, or as a message to be replied in the same chat /// [JsonConverter(typeof(Converter))] [JsonProperty("message_id")] diff --git a/TdLib.Api/Objects/PageBlockChatLink.cs b/TdLib.Api/Objects/PageBlockChatLink.cs index af73eefe..32514581 100644 --- a/TdLib.Api/Objects/PageBlockChatLink.cs +++ b/TdLib.Api/Objects/PageBlockChatLink.cs @@ -41,6 +41,13 @@ public class PageBlockChatLink : PageBlock [JsonProperty("photo")] public ChatPhotoInfo Photo { get; set; } + /// + /// Identifier of the accent color for chat title and background of chat photo + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("accent_color_id")] + public int AccentColorId { get; set; } + /// /// Chat username by which all other information about the chat can be resolved /// diff --git a/TdLib.Api/Objects/Poll.cs b/TdLib.Api/Objects/Poll.cs index d29425db..324aa36c 100644 --- a/TdLib.Api/Objects/Poll.cs +++ b/TdLib.Api/Objects/Poll.cs @@ -53,10 +53,10 @@ public partial class Poll : Object public int TotalVoterCount { get; set; } /// - /// User identifiers of recent voters, if the poll is non-anonymous + /// Identifiers of recent voters, if the poll is non-anonymous /// - [JsonProperty("recent_voter_user_ids", ItemConverterType = typeof(Converter))] - public long[] RecentVoterUserIds { get; set; } + [JsonProperty("recent_voter_ids", ItemConverterType = typeof(Converter))] + public MessageSender[] RecentVoterIds { get; set; } /// /// True, if the poll is anonymous diff --git a/TdLib.Api/Objects/PremiumFeatureAccentColor.cs b/TdLib.Api/Objects/PremiumFeatureAccentColor.cs new file mode 100644 index 00000000..821dcf7f --- /dev/null +++ b/TdLib.Api/Objects/PremiumFeatureAccentColor.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class PremiumFeature : Object + { + /// + /// The ability to choose accent color + /// + public class PremiumFeatureAccentColor : PremiumFeature + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "premiumFeatureAccentColor"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/PremiumFeatureChatBoost.cs b/TdLib.Api/Objects/PremiumFeatureChatBoost.cs new file mode 100644 index 00000000..f74e813a --- /dev/null +++ b/TdLib.Api/Objects/PremiumFeatureChatBoost.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class PremiumFeature : Object + { + /// + /// The ability to boost chats + /// + public class PremiumFeatureChatBoost : PremiumFeature + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "premiumFeatureChatBoost"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/PremiumFeatureEmojiStatus.cs b/TdLib.Api/Objects/PremiumFeatureEmojiStatus.cs index e13890df..3383b8ea 100644 --- a/TdLib.Api/Objects/PremiumFeatureEmojiStatus.cs +++ b/TdLib.Api/Objects/PremiumFeatureEmojiStatus.cs @@ -11,7 +11,7 @@ public static partial class TdApi public partial class PremiumFeature : Object { /// - /// A emoji status shown along with the user's name + /// An emoji status shown along with the user's name /// public class PremiumFeatureEmojiStatus : PremiumFeature { diff --git a/TdLib.Api/Objects/PremiumFeatureUpgradedStories.cs b/TdLib.Api/Objects/PremiumFeatureUpgradedStories.cs new file mode 100644 index 00000000..6f628a5b --- /dev/null +++ b/TdLib.Api/Objects/PremiumFeatureUpgradedStories.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class PremiumFeature : Object + { + /// + /// Allowed to use many additional features for stories + /// + public class PremiumFeatureUpgradedStories : PremiumFeature + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "premiumFeatureUpgradedStories"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/PremiumGiftCodeInfo.cs b/TdLib.Api/Objects/PremiumGiftCodeInfo.cs new file mode 100644 index 00000000..3d3201ba --- /dev/null +++ b/TdLib.Api/Objects/PremiumGiftCodeInfo.cs @@ -0,0 +1,78 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Contains information about a Telegram Premium gift code + /// + public partial class PremiumGiftCodeInfo : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "premiumGiftCodeInfo"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of a chat or a user that created the gift code + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("creator_id")] + public MessageSender CreatorId { get; set; } + + /// + /// Point in time (Unix timestamp) when the code was created + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("creation_date")] + public int CreationDate { get; set; } + + /// + /// True, if the gift code was created for a giveaway + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("is_from_giveaway")] + public bool IsFromGiveaway { get; set; } + + /// + /// Identifier of the corresponding giveaway message in the creator_id chat; can be 0 or an identifier of a deleted message + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("giveaway_message_id")] + public long GiveawayMessageId { get; set; } + + /// + /// Number of month the Telegram Premium subscription will be active after code activation + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("month_count")] + public int MonthCount { get; set; } + + /// + /// Identifier of a user for which the code was created; 0 if none + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("user_id")] + public long UserId { get; set; } + + /// + /// Point in time (Unix timestamp) when the code was activated; 0 if none + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("use_date")] + public int UseDate { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/PremiumGiftCodePaymentOption.cs b/TdLib.Api/Objects/PremiumGiftCodePaymentOption.cs new file mode 100644 index 00000000..763d8c42 --- /dev/null +++ b/TdLib.Api/Objects/PremiumGiftCodePaymentOption.cs @@ -0,0 +1,71 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Describes an option for creating Telegram Premium gift codes + /// + public partial class PremiumGiftCodePaymentOption : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "premiumGiftCodePaymentOption"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// ISO 4217 currency code for Telegram Premium gift code payment + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("currency")] + public string Currency { get; set; } + + /// + /// The amount to pay, in the smallest units of the currency + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("amount")] + public long Amount { get; set; } + + /// + /// Number of users which will be able to activate the gift codes + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("user_count")] + public int UserCount { get; set; } + + /// + /// Number of month the Telegram Premium subscription will be active + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("month_count")] + public int MonthCount { get; set; } + + /// + /// Identifier of the store product associated with the option; may be empty if none + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("store_product_id")] + public string StoreProductId { get; set; } + + /// + /// Number of times the store product must be paid + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("store_product_quantity")] + public int StoreProductQuantity { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/PremiumGiftCodePaymentOptions.cs b/TdLib.Api/Objects/PremiumGiftCodePaymentOptions.cs new file mode 100644 index 00000000..ec9a66de --- /dev/null +++ b/TdLib.Api/Objects/PremiumGiftCodePaymentOptions.cs @@ -0,0 +1,35 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Contains a list of options for creating Telegram Premium gift codes + /// + public partial class PremiumGiftCodePaymentOptions : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "premiumGiftCodePaymentOptions"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// The list of options + /// + [JsonProperty("options", ItemConverterType = typeof(Converter))] + public PremiumGiftCodePaymentOption[] Options { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/PremiumGiveawayInfoCompleted.cs b/TdLib.Api/Objects/PremiumGiveawayInfoCompleted.cs new file mode 100644 index 00000000..cc0a5b45 --- /dev/null +++ b/TdLib.Api/Objects/PremiumGiveawayInfoCompleted.cs @@ -0,0 +1,74 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class PremiumGiveawayInfo : Object + { + /// + /// Describes a completed giveaway + /// + public class PremiumGiveawayInfoCompleted : PremiumGiveawayInfo + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "premiumGiveawayInfoCompleted"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Point in time (Unix timestamp) when the giveaway was created + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("creation_date")] + public int CreationDate { get; set; } + + /// + /// Point in time (Unix timestamp) when the winners were selected. May be bigger than winners selection date specified in parameters of the giveaway + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("actual_winners_selection_date")] + public int ActualWinnersSelectionDate { get; set; } + + /// + /// True, if the giveaway was canceled and was fully refunded + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("was_refunded")] + public bool WasRefunded { get; set; } + + /// + /// Number of winners in the giveaway + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("winner_count")] + public int WinnerCount { get; set; } + + /// + /// Number of winners, which activated their gift codes + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("activation_count")] + public int ActivationCount { get; set; } + + /// + /// Telegram Premium gift code that was received by the current user; empty if the user isn't a winner in the giveaway + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("gift_code")] + public string GiftCode { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/PremiumGiveawayInfoOngoing.cs b/TdLib.Api/Objects/PremiumGiveawayInfoOngoing.cs new file mode 100644 index 00000000..78dccf4d --- /dev/null +++ b/TdLib.Api/Objects/PremiumGiveawayInfoOngoing.cs @@ -0,0 +1,53 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class PremiumGiveawayInfo : Object + { + /// + /// Contains information about Telegram Premium giveaway + /// + public class PremiumGiveawayInfoOngoing : PremiumGiveawayInfo + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "premiumGiveawayInfoOngoing"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Point in time (Unix timestamp) when the giveaway was created + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("creation_date")] + public int CreationDate { get; set; } + + /// + /// Status of the current user in the giveaway + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("status")] + public PremiumGiveawayParticipantStatus Status { get; set; } + + /// + /// True, if the giveaway has ended and results are being prepared + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("is_ended")] + public bool IsEnded { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/PremiumGiveawayParameters.cs b/TdLib.Api/Objects/PremiumGiveawayParameters.cs new file mode 100644 index 00000000..045dd235 --- /dev/null +++ b/TdLib.Api/Objects/PremiumGiveawayParameters.cs @@ -0,0 +1,62 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Describes parameters of a Telegram Premium giveaway + /// + public partial class PremiumGiveawayParameters : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "premiumGiveawayParameters"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of the channel chat, which will be automatically boosted by the winners of the giveaway for duration of the Premium subscription + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("boosted_chat_id")] + public long BoostedChatId { get; set; } + + /// + /// Identifiers of other channel chats that must be subscribed by the users to be eligible for the giveaway. There can be up to getOption("giveaway_additional_chat_count_max") additional chats + /// + [JsonProperty("additional_chat_ids", ItemConverterType = typeof(Converter))] + public long[] AdditionalChatIds { get; set; } + + /// + /// Point in time (Unix timestamp) when the giveaway is expected to be performed; must be 60-getOption("giveaway_duration_max") seconds in the future in scheduled giveaways + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("winners_selection_date")] + public int WinnersSelectionDate { get; set; } + + /// + /// True, if only new subscribers of the chats will be eligible for the giveaway + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("only_new_members")] + public bool OnlyNewMembers { get; set; } + + /// + /// The list of two-letter ISO 3166-1 alpha-2 codes of countries, users from which will be eligible for the giveaway. If empty, then all users can participate in the giveaway. + /// + [JsonProperty("country_codes", ItemConverterType = typeof(Converter))] + public string[] CountryCodes { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/PremiumGiveawayParticipantStatusAdministrator.cs b/TdLib.Api/Objects/PremiumGiveawayParticipantStatusAdministrator.cs new file mode 100644 index 00000000..9719b2b7 --- /dev/null +++ b/TdLib.Api/Objects/PremiumGiveawayParticipantStatusAdministrator.cs @@ -0,0 +1,39 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class PremiumGiveawayParticipantStatus : Object + { + /// + /// The user can't participate in the giveaway, because they are an administrator in one of the chats that created the giveaway + /// + public class PremiumGiveawayParticipantStatusAdministrator : PremiumGiveawayParticipantStatus + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "premiumGiveawayParticipantStatusAdministrator"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of the chat administered by the user + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_id")] + public long ChatId { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/PremiumGiveawayParticipantStatusAlreadyWasMember.cs b/TdLib.Api/Objects/PremiumGiveawayParticipantStatusAlreadyWasMember.cs new file mode 100644 index 00000000..b011e277 --- /dev/null +++ b/TdLib.Api/Objects/PremiumGiveawayParticipantStatusAlreadyWasMember.cs @@ -0,0 +1,39 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class PremiumGiveawayParticipantStatus : Object + { + /// + /// The user can't participate in the giveaway, because they have already been member of the chat + /// + public class PremiumGiveawayParticipantStatusAlreadyWasMember : PremiumGiveawayParticipantStatus + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "premiumGiveawayParticipantStatusAlreadyWasMember"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Point in time (Unix timestamp) when the user joined the chat + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("joined_chat_date")] + public int JoinedChatDate { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/PremiumGiveawayParticipantStatusDisallowedCountry.cs b/TdLib.Api/Objects/PremiumGiveawayParticipantStatusDisallowedCountry.cs new file mode 100644 index 00000000..41e063cc --- /dev/null +++ b/TdLib.Api/Objects/PremiumGiveawayParticipantStatusDisallowedCountry.cs @@ -0,0 +1,39 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class PremiumGiveawayParticipantStatus : Object + { + /// + /// The user can't participate in the giveaway, because they phone number is from a disallowed country + /// + public class PremiumGiveawayParticipantStatusDisallowedCountry : PremiumGiveawayParticipantStatus + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "premiumGiveawayParticipantStatusDisallowedCountry"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// A two-letter ISO 3166-1 alpha-2 country code of the user's country + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("user_country_code")] + public string UserCountryCode { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/PremiumGiveawayParticipantStatusEligible.cs b/TdLib.Api/Objects/PremiumGiveawayParticipantStatusEligible.cs new file mode 100644 index 00000000..f68bb39b --- /dev/null +++ b/TdLib.Api/Objects/PremiumGiveawayParticipantStatusEligible.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class PremiumGiveawayParticipantStatus : Object + { + /// + /// Contains information about status of a user in a Telegram Premium giveaway + /// + public class PremiumGiveawayParticipantStatusEligible : PremiumGiveawayParticipantStatus + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "premiumGiveawayParticipantStatusEligible"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/PremiumGiveawayParticipantStatusParticipating.cs b/TdLib.Api/Objects/PremiumGiveawayParticipantStatusParticipating.cs new file mode 100644 index 00000000..73251350 --- /dev/null +++ b/TdLib.Api/Objects/PremiumGiveawayParticipantStatusParticipating.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class PremiumGiveawayParticipantStatus : Object + { + /// + /// The user participates in the giveaway + /// + public class PremiumGiveawayParticipantStatusParticipating : PremiumGiveawayParticipantStatus + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "premiumGiveawayParticipantStatusParticipating"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/PremiumLimitTypeActiveStoryCount.cs b/TdLib.Api/Objects/PremiumLimitTypeActiveStoryCount.cs new file mode 100644 index 00000000..78eaf111 --- /dev/null +++ b/TdLib.Api/Objects/PremiumLimitTypeActiveStoryCount.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class PremiumLimitType : Object + { + /// + /// The maximum number of active stories + /// + public class PremiumLimitTypeActiveStoryCount : PremiumLimitType + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "premiumLimitTypeActiveStoryCount"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/PremiumLimitTypeChatFilterChosenChatCount.cs b/TdLib.Api/Objects/PremiumLimitTypeChatFolderChosenChatCount.cs similarity index 84% rename from TdLib.Api/Objects/PremiumLimitTypeChatFilterChosenChatCount.cs rename to TdLib.Api/Objects/PremiumLimitTypeChatFolderChosenChatCount.cs index 2f540cff..87553a76 100644 --- a/TdLib.Api/Objects/PremiumLimitTypeChatFilterChosenChatCount.cs +++ b/TdLib.Api/Objects/PremiumLimitTypeChatFolderChosenChatCount.cs @@ -11,15 +11,15 @@ public static partial class TdApi public partial class PremiumLimitType : Object { /// - /// The maximum number of pinned and always included, or always excluded chats in a chat filter + /// The maximum number of pinned and always included, or always excluded chats in a chat folder /// - public class PremiumLimitTypeChatFilterChosenChatCount : PremiumLimitType + public class PremiumLimitTypeChatFolderChosenChatCount : PremiumLimitType { /// /// Data type for serialization /// [JsonProperty("@type")] - public override string DataType { get; set; } = "premiumLimitTypeChatFilterChosenChatCount"; + public override string DataType { get; set; } = "premiumLimitTypeChatFolderChosenChatCount"; /// /// Extra data attached to the message diff --git a/TdLib.Api/Objects/PremiumLimitTypeChatFilterCount.cs b/TdLib.Api/Objects/PremiumLimitTypeChatFolderCount.cs similarity index 83% rename from TdLib.Api/Objects/PremiumLimitTypeChatFilterCount.cs rename to TdLib.Api/Objects/PremiumLimitTypeChatFolderCount.cs index c8e44515..5fe4576d 100644 --- a/TdLib.Api/Objects/PremiumLimitTypeChatFilterCount.cs +++ b/TdLib.Api/Objects/PremiumLimitTypeChatFolderCount.cs @@ -11,15 +11,15 @@ public static partial class TdApi public partial class PremiumLimitType : Object { /// - /// The maximum number of chat filters + /// The maximum number of chat folders /// - public class PremiumLimitTypeChatFilterCount : PremiumLimitType + public class PremiumLimitTypeChatFolderCount : PremiumLimitType { /// /// Data type for serialization /// [JsonProperty("@type")] - public override string DataType { get; set; } = "premiumLimitTypeChatFilterCount"; + public override string DataType { get; set; } = "premiumLimitTypeChatFolderCount"; /// /// Extra data attached to the message diff --git a/TdLib.Api/Objects/PremiumLimitTypeChatFolderInviteLinkCount.cs b/TdLib.Api/Objects/PremiumLimitTypeChatFolderInviteLinkCount.cs new file mode 100644 index 00000000..e7a753c0 --- /dev/null +++ b/TdLib.Api/Objects/PremiumLimitTypeChatFolderInviteLinkCount.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class PremiumLimitType : Object + { + /// + /// The maximum number of invite links for a chat folder + /// + public class PremiumLimitTypeChatFolderInviteLinkCount : PremiumLimitType + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "premiumLimitTypeChatFolderInviteLinkCount"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/PremiumLimitTypeMonthlySentStoryCount.cs b/TdLib.Api/Objects/PremiumLimitTypeMonthlySentStoryCount.cs new file mode 100644 index 00000000..db4ee04a --- /dev/null +++ b/TdLib.Api/Objects/PremiumLimitTypeMonthlySentStoryCount.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class PremiumLimitType : Object + { + /// + /// The maximum number of stories sent per month + /// + public class PremiumLimitTypeMonthlySentStoryCount : PremiumLimitType + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "premiumLimitTypeMonthlySentStoryCount"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/PremiumLimitTypeShareableChatFolderCount.cs b/TdLib.Api/Objects/PremiumLimitTypeShareableChatFolderCount.cs new file mode 100644 index 00000000..f1c8edad --- /dev/null +++ b/TdLib.Api/Objects/PremiumLimitTypeShareableChatFolderCount.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class PremiumLimitType : Object + { + /// + /// The maximum number of added shareable chat folders + /// + public class PremiumLimitTypeShareableChatFolderCount : PremiumLimitType + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "premiumLimitTypeShareableChatFolderCount"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/PremiumLimitTypeStoryCaptionLength.cs b/TdLib.Api/Objects/PremiumLimitTypeStoryCaptionLength.cs new file mode 100644 index 00000000..23c5a58d --- /dev/null +++ b/TdLib.Api/Objects/PremiumLimitTypeStoryCaptionLength.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class PremiumLimitType : Object + { + /// + /// The maximum length of captions of sent stories + /// + public class PremiumLimitTypeStoryCaptionLength : PremiumLimitType + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "premiumLimitTypeStoryCaptionLength"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/PremiumLimitTypeStorySuggestedReactionAreaCount.cs b/TdLib.Api/Objects/PremiumLimitTypeStorySuggestedReactionAreaCount.cs new file mode 100644 index 00000000..2e9373b3 --- /dev/null +++ b/TdLib.Api/Objects/PremiumLimitTypeStorySuggestedReactionAreaCount.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class PremiumLimitType : Object + { + /// + /// The maximum number of suggested reaction areas on a story + /// + public class PremiumLimitTypeStorySuggestedReactionAreaCount : PremiumLimitType + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "premiumLimitTypeStorySuggestedReactionAreaCount"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/PremiumLimitTypeWeeklySentStoryCount.cs b/TdLib.Api/Objects/PremiumLimitTypeWeeklySentStoryCount.cs new file mode 100644 index 00000000..021c48f0 --- /dev/null +++ b/TdLib.Api/Objects/PremiumLimitTypeWeeklySentStoryCount.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class PremiumLimitType : Object + { + /// + /// The maximum number of stories sent per week + /// + public class PremiumLimitTypeWeeklySentStoryCount : PremiumLimitType + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "premiumLimitTypeWeeklySentStoryCount"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/PremiumSourceStoryFeature.cs b/TdLib.Api/Objects/PremiumSourceStoryFeature.cs new file mode 100644 index 00000000..c135539f --- /dev/null +++ b/TdLib.Api/Objects/PremiumSourceStoryFeature.cs @@ -0,0 +1,39 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class PremiumSource : Object + { + /// + /// A user tried to use a Premium story feature + /// + public class PremiumSourceStoryFeature : PremiumSource + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "premiumSourceStoryFeature"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// The used feature + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("feature")] + public PremiumStoryFeature Feature { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/PremiumStoryFeatureCustomExpirationDuration.cs b/TdLib.Api/Objects/PremiumStoryFeatureCustomExpirationDuration.cs new file mode 100644 index 00000000..6e4265fb --- /dev/null +++ b/TdLib.Api/Objects/PremiumStoryFeatureCustomExpirationDuration.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class PremiumStoryFeature : Object + { + /// + /// The ability to set custom expiration duration for stories + /// + public class PremiumStoryFeatureCustomExpirationDuration : PremiumStoryFeature + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "premiumStoryFeatureCustomExpirationDuration"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/PremiumStoryFeatureLinksAndFormatting.cs b/TdLib.Api/Objects/PremiumStoryFeatureLinksAndFormatting.cs new file mode 100644 index 00000000..b7ba6dd3 --- /dev/null +++ b/TdLib.Api/Objects/PremiumStoryFeatureLinksAndFormatting.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class PremiumStoryFeature : Object + { + /// + /// The ability to use links and formatting in story caption + /// + public class PremiumStoryFeatureLinksAndFormatting : PremiumStoryFeature + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "premiumStoryFeatureLinksAndFormatting"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/PremiumStoryFeaturePermanentViewsHistory.cs b/TdLib.Api/Objects/PremiumStoryFeaturePermanentViewsHistory.cs new file mode 100644 index 00000000..9962a13f --- /dev/null +++ b/TdLib.Api/Objects/PremiumStoryFeaturePermanentViewsHistory.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class PremiumStoryFeature : Object + { + /// + /// The ability to check who opened the current user's stories after they expire + /// + public class PremiumStoryFeaturePermanentViewsHistory : PremiumStoryFeature + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "premiumStoryFeaturePermanentViewsHistory"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/PremiumStoryFeaturePriorityOrder.cs b/TdLib.Api/Objects/PremiumStoryFeaturePriorityOrder.cs new file mode 100644 index 00000000..fcb22686 --- /dev/null +++ b/TdLib.Api/Objects/PremiumStoryFeaturePriorityOrder.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class PremiumStoryFeature : Object + { + /// + /// Describes a story feature available to Premium users + /// + public class PremiumStoryFeaturePriorityOrder : PremiumStoryFeature + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "premiumStoryFeaturePriorityOrder"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/PremiumStoryFeatureSaveStories.cs b/TdLib.Api/Objects/PremiumStoryFeatureSaveStories.cs new file mode 100644 index 00000000..52098a04 --- /dev/null +++ b/TdLib.Api/Objects/PremiumStoryFeatureSaveStories.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class PremiumStoryFeature : Object + { + /// + /// The ability to save other's unprotected stories + /// + public class PremiumStoryFeatureSaveStories : PremiumStoryFeature + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "premiumStoryFeatureSaveStories"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/PremiumStoryFeatureStealthMode.cs b/TdLib.Api/Objects/PremiumStoryFeatureStealthMode.cs new file mode 100644 index 00000000..d81c5a2e --- /dev/null +++ b/TdLib.Api/Objects/PremiumStoryFeatureStealthMode.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class PremiumStoryFeature : Object + { + /// + /// The ability to hide the fact that the user viewed other's stories + /// + public class PremiumStoryFeatureStealthMode : PremiumStoryFeature + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "premiumStoryFeatureStealthMode"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/PrepaidPremiumGiveaway.cs b/TdLib.Api/Objects/PrepaidPremiumGiveaway.cs new file mode 100644 index 00000000..3ab7b49e --- /dev/null +++ b/TdLib.Api/Objects/PrepaidPremiumGiveaway.cs @@ -0,0 +1,57 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Describes a prepaid Telegram Premium giveaway + /// + public partial class PrepaidPremiumGiveaway : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "prepaidPremiumGiveaway"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Unique identifier of the prepaid giveaway + /// + [JsonConverter(typeof(Converter.Int64))] + [JsonProperty("id")] + public long Id { get; set; } + + /// + /// Number of users which will receive Telegram Premium subscription gift codes + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("winner_count")] + public int WinnerCount { get; set; } + + /// + /// Number of month the Telegram Premium subscription will be active after code activation + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("month_count")] + public int MonthCount { get; set; } + + /// + /// Point in time (Unix timestamp) when the giveaway was paid + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("payment_date")] + public int PaymentDate { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/Proxy.cs b/TdLib.Api/Objects/Proxy.cs index 1ff576c2..9de4450f 100644 --- a/TdLib.Api/Objects/Proxy.cs +++ b/TdLib.Api/Objects/Proxy.cs @@ -33,7 +33,7 @@ public partial class Proxy : Object public int Id { get; set; } /// - /// Proxy server IP address + /// Proxy server domain or IP address /// [JsonConverter(typeof(Converter))] [JsonProperty("server")] diff --git a/TdLib.Api/Objects/PushMessageContentChatSetBackground.cs b/TdLib.Api/Objects/PushMessageContentChatSetBackground.cs new file mode 100644 index 00000000..4d8eac9b --- /dev/null +++ b/TdLib.Api/Objects/PushMessageContentChatSetBackground.cs @@ -0,0 +1,39 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class PushMessageContent : Object + { + /// + /// A chat background was edited + /// + public class PushMessageContentChatSetBackground : PushMessageContent + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "pushMessageContentChatSetBackground"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// True, if the set background is the same as the background of the current user + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("is_same")] + public bool IsSame { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/PushMessageContentPremiumGiftCode.cs b/TdLib.Api/Objects/PushMessageContentPremiumGiftCode.cs new file mode 100644 index 00000000..f6689927 --- /dev/null +++ b/TdLib.Api/Objects/PushMessageContentPremiumGiftCode.cs @@ -0,0 +1,39 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class PushMessageContent : Object + { + /// + /// A message with a Telegram Premium gift code created for the user + /// + public class PushMessageContentPremiumGiftCode : PushMessageContent + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "pushMessageContentPremiumGiftCode"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Number of month the Telegram Premium subscription will be active after code activation + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("month_count")] + public int MonthCount { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/PushMessageContentPremiumGiveaway.cs b/TdLib.Api/Objects/PushMessageContentPremiumGiveaway.cs new file mode 100644 index 00000000..37992a0d --- /dev/null +++ b/TdLib.Api/Objects/PushMessageContentPremiumGiveaway.cs @@ -0,0 +1,53 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class PushMessageContent : Object + { + /// + /// A message with a Telegram Premium giveaway + /// + public class PushMessageContentPremiumGiveaway : PushMessageContent + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "pushMessageContentPremiumGiveaway"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Number of users which will receive Telegram Premium subscription gift codes; 0 for pinned message + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("winner_count")] + public int WinnerCount { get; set; } + + /// + /// Number of month the Telegram Premium subscription will be active after code activation; 0 for pinned message + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("month_count")] + public int MonthCount { get; set; } + + /// + /// True, if the message is a pinned message with the specified content + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("is_pinned")] + public bool IsPinned { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/PushMessageContentRecurringPayment.cs b/TdLib.Api/Objects/PushMessageContentRecurringPayment.cs index 5632fed6..40173785 100644 --- a/TdLib.Api/Objects/PushMessageContentRecurringPayment.cs +++ b/TdLib.Api/Objects/PushMessageContentRecurringPayment.cs @@ -11,7 +11,7 @@ public static partial class TdApi public partial class PushMessageContent : Object { /// - /// A new recurrent payment was made by the current user + /// A new recurring payment was made by the current user /// public class PushMessageContentRecurringPayment : PushMessageContent { diff --git a/TdLib.Api/Objects/PushMessageContentStory.cs b/TdLib.Api/Objects/PushMessageContentStory.cs new file mode 100644 index 00000000..2ea98299 --- /dev/null +++ b/TdLib.Api/Objects/PushMessageContentStory.cs @@ -0,0 +1,39 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class PushMessageContent : Object + { + /// + /// A message with a story + /// + public class PushMessageContentStory : PushMessageContent + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "pushMessageContentStory"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// True, if the message is a pinned message with the specified content + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("is_pinned")] + public bool IsPinned { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/RecommendedChatFilter.cs b/TdLib.Api/Objects/RecommendedChatFolder.cs similarity index 79% rename from TdLib.Api/Objects/RecommendedChatFilter.cs rename to TdLib.Api/Objects/RecommendedChatFolder.cs index 60da2481..1da45d3d 100644 --- a/TdLib.Api/Objects/RecommendedChatFilter.cs +++ b/TdLib.Api/Objects/RecommendedChatFolder.cs @@ -9,15 +9,15 @@ namespace TdLib public static partial class TdApi { /// - /// Describes a recommended chat filter + /// Describes a recommended chat folder /// - public partial class RecommendedChatFilter : Object + public partial class RecommendedChatFolder : Object { /// /// Data type for serialization /// [JsonProperty("@type")] - public override string DataType { get; set; } = "recommendedChatFilter"; + public override string DataType { get; set; } = "recommendedChatFolder"; /// /// Extra data attached to the object @@ -26,11 +26,11 @@ public partial class RecommendedChatFilter : Object public override string Extra { get; set; } /// - /// The chat filter + /// The chat folder /// [JsonConverter(typeof(Converter))] - [JsonProperty("filter")] - public ChatFilter Filter { get; set; } + [JsonProperty("folder")] + public ChatFolder Folder { get; set; } /// /// diff --git a/TdLib.Api/Objects/RecommendedChatFilters.cs b/TdLib.Api/Objects/RecommendedChatFolders.cs similarity index 69% rename from TdLib.Api/Objects/RecommendedChatFilters.cs rename to TdLib.Api/Objects/RecommendedChatFolders.cs index 0fa4e598..527d01de 100644 --- a/TdLib.Api/Objects/RecommendedChatFilters.cs +++ b/TdLib.Api/Objects/RecommendedChatFolders.cs @@ -9,15 +9,15 @@ namespace TdLib public static partial class TdApi { /// - /// Contains a list of recommended chat filters + /// Contains a list of recommended chat folders /// - public partial class RecommendedChatFilters : Object + public partial class RecommendedChatFolders : Object { /// /// Data type for serialization /// [JsonProperty("@type")] - public override string DataType { get; set; } = "recommendedChatFilters"; + public override string DataType { get; set; } = "recommendedChatFolders"; /// /// Extra data attached to the object @@ -26,10 +26,10 @@ public partial class RecommendedChatFilters : Object public override string Extra { get; set; } /// - /// List of recommended chat filters + /// List of recommended chat folders /// - [JsonProperty("chat_filters", ItemConverterType = typeof(Converter))] - public RecommendedChatFilter[] ChatFilters { get; set; } + [JsonProperty("chat_folders", ItemConverterType = typeof(Converter))] + public RecommendedChatFolder[] ChatFolders { get; set; } } } } \ No newline at end of file diff --git a/TdLib.Api/Objects/ChatReportReasonChildAbuse.cs b/TdLib.Api/Objects/ReportReasonChildAbuse.cs similarity index 83% rename from TdLib.Api/Objects/ChatReportReasonChildAbuse.cs rename to TdLib.Api/Objects/ReportReasonChildAbuse.cs index 0a725c80..01457df8 100644 --- a/TdLib.Api/Objects/ChatReportReasonChildAbuse.cs +++ b/TdLib.Api/Objects/ReportReasonChildAbuse.cs @@ -8,18 +8,18 @@ namespace TdLib /// public static partial class TdApi { - public partial class ChatReportReason : Object + public partial class ReportReason : Object { /// /// The chat has child abuse related content /// - public class ChatReportReasonChildAbuse : ChatReportReason + public class ReportReasonChildAbuse : ReportReason { /// /// Data type for serialization /// [JsonProperty("@type")] - public override string DataType { get; set; } = "chatReportReasonChildAbuse"; + public override string DataType { get; set; } = "reportReasonChildAbuse"; /// /// Extra data attached to the message diff --git a/TdLib.Api/Objects/ChatReportReasonCopyright.cs b/TdLib.Api/Objects/ReportReasonCopyright.cs similarity index 83% rename from TdLib.Api/Objects/ChatReportReasonCopyright.cs rename to TdLib.Api/Objects/ReportReasonCopyright.cs index 22df1186..94a5863c 100644 --- a/TdLib.Api/Objects/ChatReportReasonCopyright.cs +++ b/TdLib.Api/Objects/ReportReasonCopyright.cs @@ -8,18 +8,18 @@ namespace TdLib /// public static partial class TdApi { - public partial class ChatReportReason : Object + public partial class ReportReason : Object { /// /// The chat contains copyrighted content /// - public class ChatReportReasonCopyright : ChatReportReason + public class ReportReasonCopyright : ReportReason { /// /// Data type for serialization /// [JsonProperty("@type")] - public override string DataType { get; set; } = "chatReportReasonCopyright"; + public override string DataType { get; set; } = "reportReasonCopyright"; /// /// Extra data attached to the message diff --git a/TdLib.Api/Objects/ChatReportReasonCustom.cs b/TdLib.Api/Objects/ReportReasonCustom.cs similarity index 83% rename from TdLib.Api/Objects/ChatReportReasonCustom.cs rename to TdLib.Api/Objects/ReportReasonCustom.cs index d62da038..43a5c787 100644 --- a/TdLib.Api/Objects/ChatReportReasonCustom.cs +++ b/TdLib.Api/Objects/ReportReasonCustom.cs @@ -8,18 +8,18 @@ namespace TdLib /// public static partial class TdApi { - public partial class ChatReportReason : Object + public partial class ReportReason : Object { /// /// A custom reason provided by the user /// - public class ChatReportReasonCustom : ChatReportReason + public class ReportReasonCustom : ReportReason { /// /// Data type for serialization /// [JsonProperty("@type")] - public override string DataType { get; set; } = "chatReportReasonCustom"; + public override string DataType { get; set; } = "reportReasonCustom"; /// /// Extra data attached to the message diff --git a/TdLib.Api/Objects/ChatReportReasonFake.cs b/TdLib.Api/Objects/ReportReasonFake.cs similarity index 84% rename from TdLib.Api/Objects/ChatReportReasonFake.cs rename to TdLib.Api/Objects/ReportReasonFake.cs index 3a57622d..cd53767d 100644 --- a/TdLib.Api/Objects/ChatReportReasonFake.cs +++ b/TdLib.Api/Objects/ReportReasonFake.cs @@ -8,18 +8,18 @@ namespace TdLib /// public static partial class TdApi { - public partial class ChatReportReason : Object + public partial class ReportReason : Object { /// /// The chat represents a fake account /// - public class ChatReportReasonFake : ChatReportReason + public class ReportReasonFake : ReportReason { /// /// Data type for serialization /// [JsonProperty("@type")] - public override string DataType { get; set; } = "chatReportReasonFake"; + public override string DataType { get; set; } = "reportReasonFake"; /// /// Extra data attached to the message diff --git a/TdLib.Api/Objects/ChatReportReasonIllegalDrugs.cs b/TdLib.Api/Objects/ReportReasonIllegalDrugs.cs similarity index 82% rename from TdLib.Api/Objects/ChatReportReasonIllegalDrugs.cs rename to TdLib.Api/Objects/ReportReasonIllegalDrugs.cs index 1fd628c7..da3a995a 100644 --- a/TdLib.Api/Objects/ChatReportReasonIllegalDrugs.cs +++ b/TdLib.Api/Objects/ReportReasonIllegalDrugs.cs @@ -8,18 +8,18 @@ namespace TdLib /// public static partial class TdApi { - public partial class ChatReportReason : Object + public partial class ReportReason : Object { /// /// The chat has illegal drugs related content /// - public class ChatReportReasonIllegalDrugs : ChatReportReason + public class ReportReasonIllegalDrugs : ReportReason { /// /// Data type for serialization /// [JsonProperty("@type")] - public override string DataType { get; set; } = "chatReportReasonIllegalDrugs"; + public override string DataType { get; set; } = "reportReasonIllegalDrugs"; /// /// Extra data attached to the message diff --git a/TdLib.Api/Objects/ChatReportReasonPersonalDetails.cs b/TdLib.Api/Objects/ReportReasonPersonalDetails.cs similarity index 82% rename from TdLib.Api/Objects/ChatReportReasonPersonalDetails.cs rename to TdLib.Api/Objects/ReportReasonPersonalDetails.cs index 60ef7c0f..bd63160f 100644 --- a/TdLib.Api/Objects/ChatReportReasonPersonalDetails.cs +++ b/TdLib.Api/Objects/ReportReasonPersonalDetails.cs @@ -8,18 +8,18 @@ namespace TdLib /// public static partial class TdApi { - public partial class ChatReportReason : Object + public partial class ReportReason : Object { /// /// The chat contains messages with personal details /// - public class ChatReportReasonPersonalDetails : ChatReportReason + public class ReportReasonPersonalDetails : ReportReason { /// /// Data type for serialization /// [JsonProperty("@type")] - public override string DataType { get; set; } = "chatReportReasonPersonalDetails"; + public override string DataType { get; set; } = "reportReasonPersonalDetails"; /// /// Extra data attached to the message diff --git a/TdLib.Api/Objects/ChatReportReasonPornography.cs b/TdLib.Api/Objects/ReportReasonPornography.cs similarity index 82% rename from TdLib.Api/Objects/ChatReportReasonPornography.cs rename to TdLib.Api/Objects/ReportReasonPornography.cs index 43b3e9fb..12f31e75 100644 --- a/TdLib.Api/Objects/ChatReportReasonPornography.cs +++ b/TdLib.Api/Objects/ReportReasonPornography.cs @@ -8,18 +8,18 @@ namespace TdLib /// public static partial class TdApi { - public partial class ChatReportReason : Object + public partial class ReportReason : Object { /// /// The chat contains pornographic messages /// - public class ChatReportReasonPornography : ChatReportReason + public class ReportReasonPornography : ReportReason { /// /// Data type for serialization /// [JsonProperty("@type")] - public override string DataType { get; set; } = "chatReportReasonPornography"; + public override string DataType { get; set; } = "reportReasonPornography"; /// /// Extra data attached to the message diff --git a/TdLib.Api/Objects/ChatReportReasonSpam.cs b/TdLib.Api/Objects/ReportReasonSpam.cs similarity index 84% rename from TdLib.Api/Objects/ChatReportReasonSpam.cs rename to TdLib.Api/Objects/ReportReasonSpam.cs index 6c24f480..d0c290b1 100644 --- a/TdLib.Api/Objects/ChatReportReasonSpam.cs +++ b/TdLib.Api/Objects/ReportReasonSpam.cs @@ -8,18 +8,18 @@ namespace TdLib /// public static partial class TdApi { - public partial class ChatReportReason : Object + public partial class ReportReason : Object { /// /// Describes the reason why a chat is reported /// - public class ChatReportReasonSpam : ChatReportReason + public class ReportReasonSpam : ReportReason { /// /// Data type for serialization /// [JsonProperty("@type")] - public override string DataType { get; set; } = "chatReportReasonSpam"; + public override string DataType { get; set; } = "reportReasonSpam"; /// /// Extra data attached to the message diff --git a/TdLib.Api/Objects/ChatReportReasonUnrelatedLocation.cs b/TdLib.Api/Objects/ReportReasonUnrelatedLocation.cs similarity index 82% rename from TdLib.Api/Objects/ChatReportReasonUnrelatedLocation.cs rename to TdLib.Api/Objects/ReportReasonUnrelatedLocation.cs index 51355437..e43d6a98 100644 --- a/TdLib.Api/Objects/ChatReportReasonUnrelatedLocation.cs +++ b/TdLib.Api/Objects/ReportReasonUnrelatedLocation.cs @@ -8,18 +8,18 @@ namespace TdLib /// public static partial class TdApi { - public partial class ChatReportReason : Object + public partial class ReportReason : Object { /// /// The location-based chat is unrelated to its stated location /// - public class ChatReportReasonUnrelatedLocation : ChatReportReason + public class ReportReasonUnrelatedLocation : ReportReason { /// /// Data type for serialization /// [JsonProperty("@type")] - public override string DataType { get; set; } = "chatReportReasonUnrelatedLocation"; + public override string DataType { get; set; } = "reportReasonUnrelatedLocation"; /// /// Extra data attached to the message diff --git a/TdLib.Api/Objects/ChatReportReasonViolence.cs b/TdLib.Api/Objects/ReportReasonViolence.cs similarity index 83% rename from TdLib.Api/Objects/ChatReportReasonViolence.cs rename to TdLib.Api/Objects/ReportReasonViolence.cs index 392c9d3a..7ece44eb 100644 --- a/TdLib.Api/Objects/ChatReportReasonViolence.cs +++ b/TdLib.Api/Objects/ReportReasonViolence.cs @@ -8,18 +8,18 @@ namespace TdLib /// public static partial class TdApi { - public partial class ChatReportReason : Object + public partial class ReportReason : Object { /// /// The chat promotes violence /// - public class ChatReportReasonViolence : ChatReportReason + public class ReportReasonViolence : ReportReason { /// /// Data type for serialization /// [JsonProperty("@type")] - public override string DataType { get; set; } = "chatReportReasonViolence"; + public override string DataType { get; set; } = "reportReasonViolence"; /// /// Extra data attached to the message diff --git a/TdLib.Api/Objects/ScopeNotificationSettings.cs b/TdLib.Api/Objects/ScopeNotificationSettings.cs index 4700b7a1..714b9d76 100644 --- a/TdLib.Api/Objects/ScopeNotificationSettings.cs +++ b/TdLib.Api/Objects/ScopeNotificationSettings.cs @@ -46,6 +46,34 @@ public partial class ScopeNotificationSettings : Object [JsonProperty("show_preview")] public bool ShowPreview { get; set; } + /// + /// If true, mute_stories is ignored and story notifications are received only for the first 5 chats from topChatCategoryUsers + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("use_default_mute_stories")] + public bool UseDefaultMuteStories { get; set; } + + /// + /// True, if story notifications are disabled for the chat + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("mute_stories")] + public bool MuteStories { get; set; } + + /// + /// Identifier of the notification sound to be played for stories; 0 if sound is disabled + /// + [JsonConverter(typeof(Converter.Int64))] + [JsonProperty("story_sound_id")] + public long StorySoundId { get; set; } + + /// + /// True, if the sender of stories must be displayed in notifications + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("show_story_sender")] + public bool ShowStorySender { get; set; } + /// /// True, if notifications for incoming pinned messages will be created as for an ordinary unread message /// diff --git a/TdLib.Api/Objects/Session.cs b/TdLib.Api/Objects/Session.cs index c8703e23..f4a76c17 100644 --- a/TdLib.Api/Objects/Session.cs +++ b/TdLib.Api/Objects/Session.cs @@ -46,6 +46,13 @@ public partial class Session : Object [JsonProperty("is_password_pending")] public bool IsPasswordPending { get; set; } + /// + /// True, if the session wasn't confirmed from another session + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("is_unconfirmed")] + public bool IsUnconfirmed { get; set; } + /// /// True, if incoming secret chats can be accepted by the session /// @@ -134,22 +141,15 @@ public partial class Session : Object /// IP address from which the session was created, in human-readable format /// [JsonConverter(typeof(Converter))] - [JsonProperty("ip")] - public string Ip { get; set; } - - /// - /// A two-letter country code for the country from which the session was created, based on the IP address - /// - [JsonConverter(typeof(Converter))] - [JsonProperty("country")] - public string Country { get; set; } + [JsonProperty("ip_address")] + public string IpAddress { get; set; } /// - /// Region code from which the session was created, based on the IP address + /// A human-readable description of the location from which the session was created, based on the IP address /// [JsonConverter(typeof(Converter))] - [JsonProperty("region")] - public string Region { get; set; } + [JsonProperty("location")] + public string Location { get; set; } } } } \ No newline at end of file diff --git a/TdLib.Api/Objects/SpeechRecognitionResultError.cs b/TdLib.Api/Objects/SpeechRecognitionResultError.cs index 3598e786..57f7c13b 100644 --- a/TdLib.Api/Objects/SpeechRecognitionResultError.cs +++ b/TdLib.Api/Objects/SpeechRecognitionResultError.cs @@ -28,7 +28,7 @@ public class SpeechRecognitionResultError : SpeechRecognitionResult public override string Extra { get; set; } /// - /// Received error + /// Recognition error. An error with a message "MSG_VOICE_TOO_LONG" is returned when media duration is too big to be recognized /// [JsonConverter(typeof(Converter))] [JsonProperty("error")] diff --git a/TdLib.Api/Objects/SponsoredMessage.cs b/TdLib.Api/Objects/SponsoredMessage.cs index 72d4c0bb..c9cc562e 100644 --- a/TdLib.Api/Objects/SponsoredMessage.cs +++ b/TdLib.Api/Objects/SponsoredMessage.cs @@ -39,34 +39,6 @@ public partial class SponsoredMessage : Object [JsonProperty("is_recommended")] public bool IsRecommended { get; set; } - /// - /// Sponsor chat identifier; 0 if the sponsor chat is accessible through an invite link - /// - [JsonConverter(typeof(Converter))] - [JsonProperty("sponsor_chat_id")] - public long SponsorChatId { get; set; } - - /// - /// Information about the sponsor chat; may be null unless sponsor_chat_id == 0 - /// - [JsonConverter(typeof(Converter))] - [JsonProperty("sponsor_chat_info")] - public ChatInviteLinkInfo SponsorChatInfo { get; set; } - - /// - /// True, if the sponsor's chat photo must be shown - /// - [JsonConverter(typeof(Converter))] - [JsonProperty("show_chat_photo")] - public bool ShowChatPhoto { get; set; } - - /// - /// An internal link to be opened when the sponsored message is clicked; may be null if the sponsor chat needs to be opened instead - /// - [JsonConverter(typeof(Converter))] - [JsonProperty("link")] - public InternalLinkType Link { get; set; } - /// /// Content of the message. Currently, can be only of the type messageText /// @@ -75,11 +47,11 @@ public partial class SponsoredMessage : Object public MessageContent Content { get; set; } /// - /// If non-empty, information about the sponsor to be shown along with the message + /// Information about the sponsor of the message /// [JsonConverter(typeof(Converter))] - [JsonProperty("sponsor_info")] - public string SponsorInfo { get; set; } + [JsonProperty("sponsor")] + public MessageSponsor Sponsor { get; set; } /// /// If non-empty, additional information about the sponsored message to be shown along with the message diff --git a/TdLib.Api/Objects/Sticker.cs b/TdLib.Api/Objects/Sticker.cs index 73482e5e..8b7869be 100644 --- a/TdLib.Api/Objects/Sticker.cs +++ b/TdLib.Api/Objects/Sticker.cs @@ -33,7 +33,7 @@ public partial class Sticker : Object public long Id { get; set; } /// - /// The identifier of the sticker set to which the sticker belongs; 0 if none + /// Identifier of the sticker set to which the sticker belongs; 0 if none /// [JsonConverter(typeof(Converter.Int64))] [JsonProperty("set_id")] diff --git a/TdLib.Api/Objects/StickerSet.cs b/TdLib.Api/Objects/StickerSet.cs index 90e1631e..dc9ad2cb 100644 --- a/TdLib.Api/Objects/StickerSet.cs +++ b/TdLib.Api/Objects/StickerSet.cs @@ -94,6 +94,13 @@ public partial class StickerSet : Object [JsonProperty("sticker_type")] public StickerType StickerType { get; set; } + /// + /// True, if stickers in the sticker set are custom emoji that must be repainted; for custom emoji sticker sets only + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("needs_repainting")] + public bool NeedsRepainting { get; set; } + /// /// True for already viewed trending sticker sets /// diff --git a/TdLib.Api/Objects/StickerSetInfo.cs b/TdLib.Api/Objects/StickerSetInfo.cs index 52fd5d75..b4a9ed0d 100644 --- a/TdLib.Api/Objects/StickerSetInfo.cs +++ b/TdLib.Api/Objects/StickerSetInfo.cs @@ -94,6 +94,13 @@ public partial class StickerSetInfo : Object [JsonProperty("sticker_type")] public StickerType StickerType { get; set; } + /// + /// True, if stickers in the sticker set are custom emoji that must be repainted; for custom emoji sticker sets only + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("needs_repainting")] + public bool NeedsRepainting { get; set; } + /// /// True for already viewed trending sticker sets /// diff --git a/TdLib.Api/Objects/StorePaymentPurposeGiftedPremium.cs b/TdLib.Api/Objects/StorePaymentPurposeGiftedPremium.cs index 212a75df..1af526bf 100644 --- a/TdLib.Api/Objects/StorePaymentPurposeGiftedPremium.cs +++ b/TdLib.Api/Objects/StorePaymentPurposeGiftedPremium.cs @@ -11,7 +11,7 @@ public static partial class TdApi public partial class StorePaymentPurpose : Object { /// - /// The user gifted Telegram Premium to another user + /// The user gifting Telegram Premium to another user /// public class StorePaymentPurposeGiftedPremium : StorePaymentPurpose { @@ -28,7 +28,7 @@ public class StorePaymentPurposeGiftedPremium : StorePaymentPurpose public override string Extra { get; set; } /// - /// Identifier of the user for which Premium was gifted + /// Identifier of the user to which Premium was gifted /// [JsonConverter(typeof(Converter))] [JsonProperty("user_id")] diff --git a/TdLib.Api/Objects/StorePaymentPurposePremiumGiftCodes.cs b/TdLib.Api/Objects/StorePaymentPurposePremiumGiftCodes.cs new file mode 100644 index 00000000..dea2d828 --- /dev/null +++ b/TdLib.Api/Objects/StorePaymentPurposePremiumGiftCodes.cs @@ -0,0 +1,59 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class StorePaymentPurpose : Object + { + /// + /// The user creating Telegram Premium gift codes for other users + /// + public class StorePaymentPurposePremiumGiftCodes : StorePaymentPurpose + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "storePaymentPurposePremiumGiftCodes"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of the channel chat, which will be automatically boosted by the users for duration of the Premium subscription and which is administered by the user; 0 if none + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("boosted_chat_id")] + public long BoostedChatId { get; set; } + + /// + /// ISO 4217 currency code of the payment currency + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("currency")] + public string Currency { get; set; } + + /// + /// Paid amount, in the smallest units of the currency + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("amount")] + public long Amount { get; set; } + + /// + /// Identifiers of the users which can activate the gift codes + /// + [JsonProperty("user_ids", ItemConverterType = typeof(Converter))] + public long[] UserIds { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/StorePaymentPurposePremiumGiveaway.cs b/TdLib.Api/Objects/StorePaymentPurposePremiumGiveaway.cs new file mode 100644 index 00000000..09f59f19 --- /dev/null +++ b/TdLib.Api/Objects/StorePaymentPurposePremiumGiveaway.cs @@ -0,0 +1,53 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class StorePaymentPurpose : Object + { + /// + /// The user creating a Telegram Premium giveaway for subscribers of channel chats; requires can_post_messages rights in the channels + /// + public class StorePaymentPurposePremiumGiveaway : StorePaymentPurpose + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "storePaymentPurposePremiumGiveaway"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Giveaway parameters + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("parameters")] + public PremiumGiveawayParameters Parameters { get; set; } + + /// + /// ISO 4217 currency code of the payment currency + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("currency")] + public string Currency { get; set; } + + /// + /// Paid amount, in the smallest units of the currency + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("amount")] + public long Amount { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/Stories.cs b/TdLib.Api/Objects/Stories.cs new file mode 100644 index 00000000..b6dc7d8d --- /dev/null +++ b/TdLib.Api/Objects/Stories.cs @@ -0,0 +1,42 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Represents a list of stories + /// + public partial class Stories : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "stories"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Approximate total number of stories found + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("total_count")] + public int TotalCount { get; set; } + + /// + /// The list of stories + /// + [JsonProperty("stories", ItemConverterType = typeof(Converter))] + public Story[] Stories_ { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/Story.cs b/TdLib.Api/Objects/Story.cs new file mode 100644 index 00000000..4f6f208b --- /dev/null +++ b/TdLib.Api/Objects/Story.cs @@ -0,0 +1,175 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Represents a story + /// + public partial class Story : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "story"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Unique story identifier among stories of the given sender + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("id")] + public int Id { get; set; } + + /// + /// Identifier of the chat that posted the story + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("sender_chat_id")] + public long SenderChatId { get; set; } + + /// + /// Point in time (Unix timestamp) when the story was published + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("date")] + public int Date { get; set; } + + /// + /// True, if the story is being sent by the current user + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("is_being_sent")] + public bool IsBeingSent { get; set; } + + /// + /// True, if the story is being edited by the current user + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("is_being_edited")] + public bool IsBeingEdited { get; set; } + + /// + /// True, if the story was edited + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("is_edited")] + public bool IsEdited { get; set; } + + /// + /// True, if the story is saved in the sender's profile and will be available there after expiration + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("is_pinned")] + public bool IsPinned { get; set; } + + /// + /// True, if the story is visible only for the current user + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("is_visible_only_for_self")] + public bool IsVisibleOnlyForSelf { get; set; } + + /// + /// True, if the story can be deleted + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("can_be_deleted")] + public bool CanBeDeleted { get; set; } + + /// + /// True, if the story can be edited + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("can_be_edited")] + public bool CanBeEdited { get; set; } + + /// + /// True, if the story can be forwarded as a message. Otherwise, screenshots and saving of the story content must be also forbidden + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("can_be_forwarded")] + public bool CanBeForwarded { get; set; } + + /// + /// True, if the story can be replied in the chat with the story sender + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("can_be_replied")] + public bool CanBeReplied { get; set; } + + /// + /// True, if the story's is_pinned value can be changed + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("can_toggle_is_pinned")] + public bool CanToggleIsPinned { get; set; } + + /// + /// True, if users viewed the story can be received through getStoryViewers + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("can_get_viewers")] + public bool CanGetViewers { get; set; } + + /// + /// True, if users viewed the story can't be received, because the story has expired more than getOption("story_viewers_expiration_delay") seconds ago + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("has_expired_viewers")] + public bool HasExpiredViewers { get; set; } + + /// + /// Information about interactions with the story; may be null if the story isn't owned or there were no interactions + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("interaction_info")] + public StoryInteractionInfo InteractionInfo { get; set; } + + /// + /// Type of the chosen reaction; may be null if none + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chosen_reaction_type")] + public ReactionType ChosenReactionType { get; set; } + + /// + /// Privacy rules affecting story visibility; may be approximate for non-owned stories + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("privacy_settings")] + public StoryPrivacySettings PrivacySettings { get; set; } + + /// + /// Content of the story + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("content")] + public StoryContent Content { get; set; } + + /// + /// Clickable areas to be shown on the story content + /// + [JsonProperty("areas", ItemConverterType = typeof(Converter))] + public StoryArea[] Areas { get; set; } + + /// + /// Caption of the story + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("caption")] + public FormattedText Caption { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/StoryArea.cs b/TdLib.Api/Objects/StoryArea.cs new file mode 100644 index 00000000..84c7e67a --- /dev/null +++ b/TdLib.Api/Objects/StoryArea.cs @@ -0,0 +1,43 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Describes a clickable rectangle area on a story media + /// + public partial class StoryArea : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "storyArea"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Position of the area + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("position")] + public StoryAreaPosition Position { get; set; } + + /// + /// Type of the area + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("type")] + public StoryAreaType Type { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/StoryAreaPosition.cs b/TdLib.Api/Objects/StoryAreaPosition.cs new file mode 100644 index 00000000..5218416f --- /dev/null +++ b/TdLib.Api/Objects/StoryAreaPosition.cs @@ -0,0 +1,64 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Describes position of a clickable rectangle area on a story media + /// + public partial class StoryAreaPosition : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "storyAreaPosition"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// The abscissa of the rectangle's center, as a percentage of the media width + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("x_percentage")] + public double? XPercentage { get; set; } + + /// + /// The ordinate of the rectangle's center, as a percentage of the media height + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("y_percentage")] + public double? YPercentage { get; set; } + + /// + /// The width of the rectangle, as a percentage of the media width + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("width_percentage")] + public double? WidthPercentage { get; set; } + + /// + /// The height of the rectangle, as a percentage of the media height + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("height_percentage")] + public double? HeightPercentage { get; set; } + + /// + /// Clockwise rotation angle of the rectangle, in degrees; 0-360 + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("rotation_angle")] + public double? RotationAngle { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/StoryAreaTypeLocation.cs b/TdLib.Api/Objects/StoryAreaTypeLocation.cs new file mode 100644 index 00000000..9c28e10c --- /dev/null +++ b/TdLib.Api/Objects/StoryAreaTypeLocation.cs @@ -0,0 +1,39 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class StoryAreaType : Object + { + /// + /// Describes type of a clickable rectangle area on a story media + /// + public class StoryAreaTypeLocation : StoryAreaType + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "storyAreaTypeLocation"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// The location + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("location")] + public Location Location { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/StoryAreaTypeSuggestedReaction.cs b/TdLib.Api/Objects/StoryAreaTypeSuggestedReaction.cs new file mode 100644 index 00000000..30358a84 --- /dev/null +++ b/TdLib.Api/Objects/StoryAreaTypeSuggestedReaction.cs @@ -0,0 +1,60 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class StoryAreaType : Object + { + /// + /// An area pointing to a suggested reaction. App needs to show a clickable reaction on the area and call setStoryReaction when the are is clicked + /// + public class StoryAreaTypeSuggestedReaction : StoryAreaType + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "storyAreaTypeSuggestedReaction"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Type of the reaction + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("reaction_type")] + public ReactionType ReactionType { get; set; } + + /// + /// Number of times the reaction was added + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("total_count")] + public int TotalCount { get; set; } + + /// + /// True, if reaction has a dark background + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("is_dark")] + public bool IsDark { get; set; } + + /// + /// True, if reaction corner is flipped + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("is_flipped")] + public bool IsFlipped { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/StoryAreaTypeVenue.cs b/TdLib.Api/Objects/StoryAreaTypeVenue.cs new file mode 100644 index 00000000..5a8b4027 --- /dev/null +++ b/TdLib.Api/Objects/StoryAreaTypeVenue.cs @@ -0,0 +1,39 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class StoryAreaType : Object + { + /// + /// An area pointing to a venue + /// + public class StoryAreaTypeVenue : StoryAreaType + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "storyAreaTypeVenue"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Information about the venue + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("venue")] + public Venue Venue { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/StoryContentPhoto.cs b/TdLib.Api/Objects/StoryContentPhoto.cs new file mode 100644 index 00000000..9d9d71a9 --- /dev/null +++ b/TdLib.Api/Objects/StoryContentPhoto.cs @@ -0,0 +1,39 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class StoryContent : Object + { + /// + /// Contains the content of a story + /// + public class StoryContentPhoto : StoryContent + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "storyContentPhoto"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// The photo + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("photo")] + public Photo Photo { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/StoryContentUnsupported.cs b/TdLib.Api/Objects/StoryContentUnsupported.cs new file mode 100644 index 00000000..64d50468 --- /dev/null +++ b/TdLib.Api/Objects/StoryContentUnsupported.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class StoryContent : Object + { + /// + /// A story content that is not supported in the current TDLib version + /// + public class StoryContentUnsupported : StoryContent + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "storyContentUnsupported"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/StoryContentVideo.cs b/TdLib.Api/Objects/StoryContentVideo.cs new file mode 100644 index 00000000..8bbace87 --- /dev/null +++ b/TdLib.Api/Objects/StoryContentVideo.cs @@ -0,0 +1,46 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class StoryContent : Object + { + /// + /// A video story + /// + public class StoryContentVideo : StoryContent + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "storyContentVideo"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// The video in MPEG4 format + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("video")] + public StoryVideo Video { get; set; } + + /// + /// Alternative version of the video in MPEG4 format, encoded by x264 codec; may be null + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("alternative_video")] + public StoryVideo AlternativeVideo { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/StoryInfo.cs b/TdLib.Api/Objects/StoryInfo.cs new file mode 100644 index 00000000..4a42fb36 --- /dev/null +++ b/TdLib.Api/Objects/StoryInfo.cs @@ -0,0 +1,50 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Contains basic information about a story + /// + public partial class StoryInfo : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "storyInfo"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Unique story identifier among stories of the given sender + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_id")] + public int StoryId { get; set; } + + /// + /// Point in time (Unix timestamp) when the story was published + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("date")] + public int Date { get; set; } + + /// + /// True, if the story is available only to close friends + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("is_for_close_friends")] + public bool IsForCloseFriends { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/StoryInteractionInfo.cs b/TdLib.Api/Objects/StoryInteractionInfo.cs new file mode 100644 index 00000000..b0a58b30 --- /dev/null +++ b/TdLib.Api/Objects/StoryInteractionInfo.cs @@ -0,0 +1,56 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Contains information about interactions with a story + /// + public partial class StoryInteractionInfo : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "storyInteractionInfo"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Number of times the story was viewed + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("view_count")] + public int ViewCount { get; set; } + + /// + /// Number of times the story was forwarded; 0 if none or unknown + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("forward_count")] + public int ForwardCount { get; set; } + + /// + /// Number of reactions added to the story; 0 if none or unknown + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("reaction_count")] + public int ReactionCount { get; set; } + + /// + /// Identifiers of at most 3 recent viewers of the story + /// + [JsonProperty("recent_viewer_user_ids", ItemConverterType = typeof(Converter))] + public long[] RecentViewerUserIds { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/StoryListArchive.cs b/TdLib.Api/Objects/StoryListArchive.cs new file mode 100644 index 00000000..dd76d659 --- /dev/null +++ b/TdLib.Api/Objects/StoryListArchive.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class StoryList : Object + { + /// + /// The list of stories, shown in the Arvhive chat list + /// + public class StoryListArchive : StoryList + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "storyListArchive"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/StoryListMain.cs b/TdLib.Api/Objects/StoryListMain.cs new file mode 100644 index 00000000..7a336854 --- /dev/null +++ b/TdLib.Api/Objects/StoryListMain.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class StoryList : Object + { + /// + /// Describes a list of stories + /// + public class StoryListMain : StoryList + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "storyListMain"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/StoryPrivacySettingsCloseFriends.cs b/TdLib.Api/Objects/StoryPrivacySettingsCloseFriends.cs new file mode 100644 index 00000000..8be90fed --- /dev/null +++ b/TdLib.Api/Objects/StoryPrivacySettingsCloseFriends.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class StoryPrivacySettings : Object + { + /// + /// The story can be viewed by all close friends + /// + public class StoryPrivacySettingsCloseFriends : StoryPrivacySettings + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "storyPrivacySettingsCloseFriends"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/StoryPrivacySettingsContacts.cs b/TdLib.Api/Objects/StoryPrivacySettingsContacts.cs new file mode 100644 index 00000000..50341d64 --- /dev/null +++ b/TdLib.Api/Objects/StoryPrivacySettingsContacts.cs @@ -0,0 +1,38 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class StoryPrivacySettings : Object + { + /// + /// The story can be viewed by all contacts except chosen users + /// + public class StoryPrivacySettingsContacts : StoryPrivacySettings + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "storyPrivacySettingsContacts"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// User identifiers of the contacts that can't see the story; always unknown and empty for non-owned stories + /// + [JsonProperty("except_user_ids", ItemConverterType = typeof(Converter))] + public long[] ExceptUserIds { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/StoryPrivacySettingsEveryone.cs b/TdLib.Api/Objects/StoryPrivacySettingsEveryone.cs new file mode 100644 index 00000000..2d6bef88 --- /dev/null +++ b/TdLib.Api/Objects/StoryPrivacySettingsEveryone.cs @@ -0,0 +1,38 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class StoryPrivacySettings : Object + { + /// + /// Describes privacy settings of a story + /// + public class StoryPrivacySettingsEveryone : StoryPrivacySettings + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "storyPrivacySettingsEveryone"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifiers of the users that can't see the story; always unknown and empty for non-owned stories + /// + [JsonProperty("except_user_ids", ItemConverterType = typeof(Converter))] + public long[] ExceptUserIds { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/StoryPrivacySettingsSelectedUsers.cs b/TdLib.Api/Objects/StoryPrivacySettingsSelectedUsers.cs new file mode 100644 index 00000000..cbd3e9c6 --- /dev/null +++ b/TdLib.Api/Objects/StoryPrivacySettingsSelectedUsers.cs @@ -0,0 +1,38 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class StoryPrivacySettings : Object + { + /// + /// The story can be viewed by certain specified users + /// + public class StoryPrivacySettingsSelectedUsers : StoryPrivacySettings + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "storyPrivacySettingsSelectedUsers"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifiers of the users; always unknown and empty for non-owned stories + /// + [JsonProperty("user_ids", ItemConverterType = typeof(Converter))] + public long[] UserIds { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/StoryVideo.cs b/TdLib.Api/Objects/StoryVideo.cs new file mode 100644 index 00000000..27bec869 --- /dev/null +++ b/TdLib.Api/Objects/StoryVideo.cs @@ -0,0 +1,92 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Describes a video file sent in a story + /// + public partial class StoryVideo : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "storyVideo"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Duration of the video, in seconds + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("duration")] + public double? Duration { get; set; } + + /// + /// Video width + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("width")] + public int Width { get; set; } + + /// + /// Video height + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("height")] + public int Height { get; set; } + + /// + /// True, if stickers were added to the video. The list of corresponding sticker sets can be received using getAttachedStickerSets + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("has_stickers")] + public bool HasStickers { get; set; } + + /// + /// True, if the video has no sound + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("is_animation")] + public bool IsAnimation { get; set; } + + /// + /// Video minithumbnail; may be null + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("minithumbnail")] + public Minithumbnail Minithumbnail { get; set; } + + /// + /// Video thumbnail in JPEG or MPEG4 format; may be null + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("thumbnail")] + public Thumbnail Thumbnail { get; set; } + + /// + /// Size of file prefix, which is supposed to be preloaded, in bytes + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("preload_prefix_size")] + public int PreloadPrefixSize { get; set; } + + /// + /// File containing the video + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("video")] + public File Video { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/StoryViewer.cs b/TdLib.Api/Objects/StoryViewer.cs new file mode 100644 index 00000000..8525dc26 --- /dev/null +++ b/TdLib.Api/Objects/StoryViewer.cs @@ -0,0 +1,57 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Represents a viewer of a story + /// + public partial class StoryViewer : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "storyViewer"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// User identifier of the viewer + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("user_id")] + public long UserId { get; set; } + + /// + /// Approximate point in time (Unix timestamp) when the story was viewed + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("view_date")] + public int ViewDate { get; set; } + + /// + /// Block list to which the user is added; may be null if none + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("block_list")] + public BlockList BlockList { get; set; } + + /// + /// Type of the reaction that was chosen by the user; may be null if none + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chosen_reaction_type")] + public ReactionType ChosenReactionType { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/StoryViewers.cs b/TdLib.Api/Objects/StoryViewers.cs new file mode 100644 index 00000000..c1f5aa05 --- /dev/null +++ b/TdLib.Api/Objects/StoryViewers.cs @@ -0,0 +1,56 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Represents a list of story viewers + /// + public partial class StoryViewers : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "storyViewers"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Approximate total number of story viewers found + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("total_count")] + public int TotalCount { get; set; } + + /// + /// Approximate total number of reactions set by found story viewers + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("total_reaction_count")] + public int TotalReactionCount { get; set; } + + /// + /// List of story viewers + /// + [JsonProperty("viewers", ItemConverterType = typeof(Converter))] + public StoryViewer[] Viewers { get; set; } + + /// + /// The offset for the next request. If empty, there are no more results + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("next_offset")] + public string NextOffset { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/SuggestedActionRestorePremium.cs b/TdLib.Api/Objects/SuggestedActionRestorePremium.cs new file mode 100644 index 00000000..9b34c2f2 --- /dev/null +++ b/TdLib.Api/Objects/SuggestedActionRestorePremium.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class SuggestedAction : Object + { + /// + /// Suggests the user to restore a recently expired Premium subscription + /// + public class SuggestedActionRestorePremium : SuggestedAction + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "suggestedActionRestorePremium"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/Supergroup.cs b/TdLib.Api/Objects/Supergroup.cs index ba5977de..8809e343 100644 --- a/TdLib.Api/Objects/Supergroup.cs +++ b/TdLib.Api/Objects/Supergroup.cs @@ -152,6 +152,20 @@ public partial class Supergroup : Object [JsonConverter(typeof(Converter))] [JsonProperty("is_fake")] public bool IsFake { get; set; } + + /// + /// True, if the channel has non-expired stories available to the current user + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("has_active_stories")] + public bool HasActiveStories { get; set; } + + /// + /// True, if the channel has unread non-expired stories available to the current user + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("has_unread_active_stories")] + public bool HasUnreadActiveStories { get; set; } } } } \ No newline at end of file diff --git a/TdLib.Api/Objects/SupergroupFullInfo.cs b/TdLib.Api/Objects/SupergroupFullInfo.cs index 2783111f..74d5b4bd 100644 --- a/TdLib.Api/Objects/SupergroupFullInfo.cs +++ b/TdLib.Api/Objects/SupergroupFullInfo.cs @@ -109,13 +109,6 @@ public partial class SupergroupFullInfo : Object [JsonProperty("can_hide_members")] public bool CanHideMembers { get; set; } - /// - /// True, if the chat username can be changed - /// - [JsonConverter(typeof(Converter))] - [JsonProperty("can_set_username")] - public bool CanSetUsername { get; set; } - /// /// True, if the supergroup sticker set can be changed /// @@ -146,7 +139,6 @@ public partial class SupergroupFullInfo : Object /// /// True, if new chat members will have access to old messages. In public, discussion, of forum groups and all channels, old messages are always available, - /// so this option affects only private non-forum supergroups without a linked chat. The value of this field is only available to chat administrators /// [JsonConverter(typeof(Converter))] [JsonProperty("is_all_history_available")] @@ -159,6 +151,13 @@ public partial class SupergroupFullInfo : Object [JsonProperty("has_aggressive_anti_spam_enabled")] public bool HasAggressiveAntiSpamEnabled { get; set; } + /// + /// True, if the channel has pinned stories + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("has_pinned_stories")] + public bool HasPinnedStories { get; set; } + /// /// Identifier of the supergroup sticker set; 0 if none /// @@ -167,7 +166,7 @@ public partial class SupergroupFullInfo : Object public long StickerSetId { get; set; } /// - /// Location to which the supergroup is connected; may be null + /// Location to which the supergroup is connected; may be null if none /// [JsonConverter(typeof(Converter))] [JsonProperty("location")] diff --git a/TdLib.Api/Objects/TelegramPaymentPurposePremiumGiftCodes.cs b/TdLib.Api/Objects/TelegramPaymentPurposePremiumGiftCodes.cs new file mode 100644 index 00000000..bd3eda6c --- /dev/null +++ b/TdLib.Api/Objects/TelegramPaymentPurposePremiumGiftCodes.cs @@ -0,0 +1,66 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class TelegramPaymentPurpose : Object + { + /// + /// Describes a purpose of a payment toward Telegram + /// + public class TelegramPaymentPurposePremiumGiftCodes : TelegramPaymentPurpose + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "telegramPaymentPurposePremiumGiftCodes"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of the channel chat, which will be automatically boosted by the users for duration of the Premium subscription and which is administered by the user; 0 if none + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("boosted_chat_id")] + public long BoostedChatId { get; set; } + + /// + /// ISO 4217 currency code of the payment currency + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("currency")] + public string Currency { get; set; } + + /// + /// Paid amount, in the smallest units of the currency + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("amount")] + public long Amount { get; set; } + + /// + /// Identifiers of the users which can activate the gift codes + /// + [JsonProperty("user_ids", ItemConverterType = typeof(Converter))] + public long[] UserIds { get; set; } + + /// + /// Number of month the Telegram Premium subscription will be active for the users + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("month_count")] + public int MonthCount { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/TelegramPaymentPurposePremiumGiveaway.cs b/TdLib.Api/Objects/TelegramPaymentPurposePremiumGiveaway.cs new file mode 100644 index 00000000..e66b47a9 --- /dev/null +++ b/TdLib.Api/Objects/TelegramPaymentPurposePremiumGiveaway.cs @@ -0,0 +1,67 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class TelegramPaymentPurpose : Object + { + /// + /// The user creating a Telegram Premium giveaway for subscribers of channel chats; requires can_post_messages rights in the channels + /// + public class TelegramPaymentPurposePremiumGiveaway : TelegramPaymentPurpose + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "telegramPaymentPurposePremiumGiveaway"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Giveaway parameters + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("parameters")] + public PremiumGiveawayParameters Parameters { get; set; } + + /// + /// ISO 4217 currency code of the payment currency + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("currency")] + public string Currency { get; set; } + + /// + /// Paid amount, in the smallest units of the currency + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("amount")] + public long Amount { get; set; } + + /// + /// Number of users which will be able to activate the gift codes + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("winner_count")] + public int WinnerCount { get; set; } + + /// + /// Number of month the Telegram Premium subscription will be active for the users + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("month_count")] + public int MonthCount { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/TextEntityTypeBlockQuote.cs b/TdLib.Api/Objects/TextEntityTypeBlockQuote.cs new file mode 100644 index 00000000..55d14dbc --- /dev/null +++ b/TdLib.Api/Objects/TextEntityTypeBlockQuote.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class TextEntityType : Object + { + /// + /// Text that must be formatted as if inside a blockquote HTML tag + /// + public class TextEntityTypeBlockQuote : TextEntityType + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "textEntityTypeBlockQuote"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/TextEntityTypeMediaTimestamp.cs b/TdLib.Api/Objects/TextEntityTypeMediaTimestamp.cs index 1fe35aef..385b73ed 100644 --- a/TdLib.Api/Objects/TextEntityTypeMediaTimestamp.cs +++ b/TdLib.Api/Objects/TextEntityTypeMediaTimestamp.cs @@ -28,7 +28,7 @@ public class TextEntityTypeMediaTimestamp : TextEntityType public override string Extra { get; set; } /// - /// Timestamp from which a video/audio/video note/voice note playing must start, in seconds. The media can be in the content or the web page preview of the current message, or in the same places in the replied message + /// Timestamp from which a video/audio/video note/voice note/story playing must start, in seconds. The media can be in the content or the web page preview of the current message, or in the same places in the replied message /// [JsonConverter(typeof(Converter))] [JsonProperty("media_timestamp")] diff --git a/TdLib.Api/Objects/ThemeParameters.cs b/TdLib.Api/Objects/ThemeParameters.cs index 37fccf88..559968ca 100644 --- a/TdLib.Api/Objects/ThemeParameters.cs +++ b/TdLib.Api/Objects/ThemeParameters.cs @@ -39,6 +39,20 @@ public partial class ThemeParameters : Object [JsonProperty("secondary_background_color")] public int SecondaryBackgroundColor { get; set; } + /// + /// A color of the header background in the RGB24 format + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("header_background_color")] + public int HeaderBackgroundColor { get; set; } + + /// + /// A color of the section background in the RGB24 format + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("section_background_color")] + public int SectionBackgroundColor { get; set; } + /// /// A color of text in the RGB24 format /// @@ -46,6 +60,34 @@ public partial class ThemeParameters : Object [JsonProperty("text_color")] public int TextColor { get; set; } + /// + /// An accent color of the text in the RGB24 format + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("accent_text_color")] + public int AccentTextColor { get; set; } + + /// + /// A color of text on the section headers in the RGB24 format + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("section_header_text_color")] + public int SectionHeaderTextColor { get; set; } + + /// + /// A color of the subtitle text in the RGB24 format + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("subtitle_text_color")] + public int SubtitleTextColor { get; set; } + + /// + /// A color of the text for destructive actions in the RGB24 format + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("destructive_text_color")] + public int DestructiveTextColor { get; set; } + /// /// A color of hints in the RGB24 format /// diff --git a/TdLib.Api/Objects/ThumbnailFormatGif.cs b/TdLib.Api/Objects/ThumbnailFormatGif.cs index 0383c4ef..2a0f456f 100644 --- a/TdLib.Api/Objects/ThumbnailFormatGif.cs +++ b/TdLib.Api/Objects/ThumbnailFormatGif.cs @@ -11,7 +11,7 @@ public static partial class TdApi public partial class ThumbnailFormat : Object { /// - /// The thumbnail is in static GIF format. It will be used only for some bot inline results + /// The thumbnail is in static GIF format. It will be used only for some bot inline query results /// public class ThumbnailFormatGif : ThumbnailFormat { diff --git a/TdLib.Api/Objects/UnconfirmedSession.cs b/TdLib.Api/Objects/UnconfirmedSession.cs new file mode 100644 index 00000000..ce39f25b --- /dev/null +++ b/TdLib.Api/Objects/UnconfirmedSession.cs @@ -0,0 +1,57 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + /// + /// Contains information about an unconfirmed session + /// + public partial class UnconfirmedSession : Object + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "unconfirmedSession"; + + /// + /// Extra data attached to the object + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Session identifier + /// + [JsonConverter(typeof(Converter.Int64))] + [JsonProperty("id")] + public long Id { get; set; } + + /// + /// Point in time (Unix timestamp) when the user has logged in + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("log_in_date")] + public int LogInDate { get; set; } + + /// + /// Model of the device that was used for the session creation, as provided by the application + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("device_model")] + public string DeviceModel { get; set; } + + /// + /// A human-readable description of the location from which the session was created, based on the IP address + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("location")] + public string Location { get; set; } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/UpdateAccentColors.cs b/TdLib.Api/Objects/UpdateAccentColors.cs new file mode 100644 index 00000000..82cc0aab --- /dev/null +++ b/TdLib.Api/Objects/UpdateAccentColors.cs @@ -0,0 +1,44 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class Update : Object + { + /// + /// The list of supported accent colors has changed + /// + public class UpdateAccentColors : Update + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "updateAccentColors"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Information about supported colors; colors with identifiers 0 (red), 1 (orange), 2 (purple/violet), 3 (green), 4 (cyan), 5 (blue), 6 (pink) must always be supported + /// + [JsonProperty("colors", ItemConverterType = typeof(Converter))] + public AccentColor[] Colors { get; set; } + + /// + /// The list of accent color identifiers, which can be set through setAccentColor and setChatAccentColor. The colors must be shown in the specififed order + /// + [JsonProperty("available_accent_color_ids", ItemConverterType = typeof(Converter))] + public int[] AvailableAccentColorIds { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/UpdateAttachmentMenuBots.cs b/TdLib.Api/Objects/UpdateAttachmentMenuBots.cs index a54f2efc..7eb6c44d 100644 --- a/TdLib.Api/Objects/UpdateAttachmentMenuBots.cs +++ b/TdLib.Api/Objects/UpdateAttachmentMenuBots.cs @@ -11,7 +11,7 @@ public static partial class TdApi public partial class Update : Object { /// - /// The list of bots added to attachment menu has changed + /// The list of bots added to attachment or side menu has changed /// public class UpdateAttachmentMenuBots : Update { @@ -28,7 +28,7 @@ public class UpdateAttachmentMenuBots : Update public override string Extra { get; set; } /// - /// The new list of bots added to attachment menu. The bots must not be shown on scheduled messages screen + /// The new list of bots. The bots must not be shown on scheduled messages screen /// [JsonProperty("bots", ItemConverterType = typeof(Converter))] public AttachmentMenuBot[] Bots { get; set; } diff --git a/TdLib.Api/Objects/UpdateChatAccentColor.cs b/TdLib.Api/Objects/UpdateChatAccentColor.cs new file mode 100644 index 00000000..6d699c97 --- /dev/null +++ b/TdLib.Api/Objects/UpdateChatAccentColor.cs @@ -0,0 +1,46 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class Update : Object + { + /// + /// A chat accent color has changed + /// + public class UpdateChatAccentColor : Update + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "updateChatAccentColor"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Chat identifier + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_id")] + public long ChatId { get; set; } + + /// + /// The new chat accent color identifier + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("accent_color_id")] + public int AccentColorId { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/UpdateChatActiveStories.cs b/TdLib.Api/Objects/UpdateChatActiveStories.cs new file mode 100644 index 00000000..21b74715 --- /dev/null +++ b/TdLib.Api/Objects/UpdateChatActiveStories.cs @@ -0,0 +1,39 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class Update : Object + { + /// + /// The list of active stories posted by a specific chat has changed + /// + public class UpdateChatActiveStories : Update + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "updateChatActiveStories"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// The new list of active stories + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("active_stories")] + public ChatActiveStories ActiveStories { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/UpdateChatBackground.cs b/TdLib.Api/Objects/UpdateChatBackground.cs new file mode 100644 index 00000000..2a55fe43 --- /dev/null +++ b/TdLib.Api/Objects/UpdateChatBackground.cs @@ -0,0 +1,46 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class Update : Object + { + /// + /// The chat background was changed + /// + public class UpdateChatBackground : Update + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "updateChatBackground"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Chat identifier + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_id")] + public long ChatId { get; set; } + + /// + /// The new chat background; may be null if background was reset to default + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("background")] + public ChatBackground Background { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/UpdateChatBackgroundCustomEmoji.cs b/TdLib.Api/Objects/UpdateChatBackgroundCustomEmoji.cs new file mode 100644 index 00000000..a431b11d --- /dev/null +++ b/TdLib.Api/Objects/UpdateChatBackgroundCustomEmoji.cs @@ -0,0 +1,46 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class Update : Object + { + /// + /// A chat's custom emoji for reply background has changed + /// + public class UpdateChatBackgroundCustomEmoji : Update + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "updateChatBackgroundCustomEmoji"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Chat identifier + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_id")] + public long ChatId { get; set; } + + /// + /// The new identifier of a custom emoji to be shown on the reply header background; 0 if none + /// + [JsonConverter(typeof(Converter.Int64))] + [JsonProperty("background_custom_emoji_id")] + public long BackgroundCustomEmojiId { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/UpdateChatIsBlocked.cs b/TdLib.Api/Objects/UpdateChatBlockList.cs similarity index 81% rename from TdLib.Api/Objects/UpdateChatIsBlocked.cs rename to TdLib.Api/Objects/UpdateChatBlockList.cs index dcf19bc4..75748a59 100644 --- a/TdLib.Api/Objects/UpdateChatIsBlocked.cs +++ b/TdLib.Api/Objects/UpdateChatBlockList.cs @@ -13,13 +13,13 @@ public partial class Update : Object /// /// A chat was blocked or unblocked /// - public class UpdateChatIsBlocked : Update + public class UpdateChatBlockList : Update { /// /// Data type for serialization /// [JsonProperty("@type")] - public override string DataType { get; set; } = "updateChatIsBlocked"; + public override string DataType { get; set; } = "updateChatBlockList"; /// /// Extra data attached to the message @@ -35,11 +35,11 @@ public class UpdateChatIsBlocked : Update public long ChatId { get; set; } /// - /// New value of is_blocked + /// Block list to which the chat is added; may be null if none /// [JsonConverter(typeof(Converter))] - [JsonProperty("is_blocked")] - public bool IsBlocked { get; set; } + [JsonProperty("block_list")] + public BlockList BlockList { get; set; } } } } diff --git a/TdLib.Api/Objects/UpdateChatBoost.cs b/TdLib.Api/Objects/UpdateChatBoost.cs new file mode 100644 index 00000000..7f5fe30d --- /dev/null +++ b/TdLib.Api/Objects/UpdateChatBoost.cs @@ -0,0 +1,46 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class Update : Object + { + /// + /// A chat boost has changed; for bots only + /// + public class UpdateChatBoost : Update + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "updateChatBoost"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Chat identifier + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_id")] + public long ChatId { get; set; } + + /// + /// New information about the boost + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("boost")] + public ChatBoost Boost { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/UpdateChatFilters.cs b/TdLib.Api/Objects/UpdateChatFolders.cs similarity index 73% rename from TdLib.Api/Objects/UpdateChatFilters.cs rename to TdLib.Api/Objects/UpdateChatFolders.cs index 3990fa06..e6f9bc20 100644 --- a/TdLib.Api/Objects/UpdateChatFilters.cs +++ b/TdLib.Api/Objects/UpdateChatFolders.cs @@ -11,15 +11,15 @@ public static partial class TdApi public partial class Update : Object { /// - /// The list of chat filters or a chat filter has changed + /// The list of chat folders or a chat folder has changed /// - public class UpdateChatFilters : Update + public class UpdateChatFolders : Update { /// /// Data type for serialization /// [JsonProperty("@type")] - public override string DataType { get; set; } = "updateChatFilters"; + public override string DataType { get; set; } = "updateChatFolders"; /// /// Extra data attached to the message @@ -28,13 +28,13 @@ public class UpdateChatFilters : Update public override string Extra { get; set; } /// - /// The new list of chat filters + /// The new list of chat folders /// - [JsonProperty("chat_filters", ItemConverterType = typeof(Converter))] - public ChatFilterInfo[] ChatFilters { get; set; } + [JsonProperty("chat_folders", ItemConverterType = typeof(Converter))] + public ChatFolderInfo[] ChatFolders { get; set; } /// - /// Position of the main chat list among chat filters, 0-based + /// Position of the main chat list among chat folders, 0-based /// [JsonConverter(typeof(Converter))] [JsonProperty("main_chat_list_position")] diff --git a/TdLib.Api/Objects/UpdateChatLastMessage.cs b/TdLib.Api/Objects/UpdateChatLastMessage.cs index f5dd5db8..79c389dd 100644 --- a/TdLib.Api/Objects/UpdateChatLastMessage.cs +++ b/TdLib.Api/Objects/UpdateChatLastMessage.cs @@ -11,7 +11,7 @@ public static partial class TdApi public partial class Update : Object { /// - /// The last message of a chat was changed. If last_message is null, then the last message in the chat became unknown. Some new unknown messages might be added to the chat in this case + /// The last message of a chat was changed /// public class UpdateChatLastMessage : Update { @@ -35,7 +35,7 @@ public class UpdateChatLastMessage : Update public long ChatId { get; set; } /// - /// The new last message in the chat; may be null + /// The new last message in the chat; may be null if the last message became unknown. While the last message is unknown, new messages can be added to the chat without corresponding updateNewMessage update /// [JsonConverter(typeof(Converter))] [JsonProperty("last_message")] diff --git a/TdLib.Api/Objects/UpdateChatMember.cs b/TdLib.Api/Objects/UpdateChatMember.cs index c71da0c9..7570e607 100644 --- a/TdLib.Api/Objects/UpdateChatMember.cs +++ b/TdLib.Api/Objects/UpdateChatMember.cs @@ -55,6 +55,13 @@ public class UpdateChatMember : Update [JsonProperty("invite_link")] public ChatInviteLink InviteLink { get; set; } + /// + /// True, if the user has joined the chat using an invite link for a chat folder + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("via_chat_folder_invite_link")] + public bool ViaChatFolderInviteLink { get; set; } + /// /// Previous chat member /// diff --git a/TdLib.Api/Objects/UpdateChatOnlineMemberCount.cs b/TdLib.Api/Objects/UpdateChatOnlineMemberCount.cs index ea0792ec..b113cbbd 100644 --- a/TdLib.Api/Objects/UpdateChatOnlineMemberCount.cs +++ b/TdLib.Api/Objects/UpdateChatOnlineMemberCount.cs @@ -12,7 +12,7 @@ public partial class Update : Object { /// /// The number of online group members has changed. This update with non-zero number of online group members is sent only for currently opened chats. - /// There is no guarantee that it will be sent just after the number of online users has changed + /// There is no guarantee that it is sent just after the number of online users has changed /// public class UpdateChatOnlineMemberCount : Update { diff --git a/TdLib.Api/Objects/UpdateMessageSendAcknowledged.cs b/TdLib.Api/Objects/UpdateMessageSendAcknowledged.cs index 4c1961db..727944af 100644 --- a/TdLib.Api/Objects/UpdateMessageSendAcknowledged.cs +++ b/TdLib.Api/Objects/UpdateMessageSendAcknowledged.cs @@ -11,8 +11,8 @@ public static partial class TdApi public partial class Update : Object { /// - /// A request to send a message has reached the Telegram server. This doesn't mean that the message will be sent successfully or even that the send message request will be processed. - /// This update will be sent only if the option "use_quick_ack" is set to true. This update may be sent multiple times for the same message + /// A request to send a message has reached the Telegram server. This doesn't mean that the message will be sent successfully. + /// This update is sent only if the option "use_quick_ack" is set to true. This update may be sent multiple times for the same message /// public class UpdateMessageSendAcknowledged : Update { diff --git a/TdLib.Api/Objects/UpdateMessageSendFailed.cs b/TdLib.Api/Objects/UpdateMessageSendFailed.cs index a4feeb0b..f79fb562 100644 --- a/TdLib.Api/Objects/UpdateMessageSendFailed.cs +++ b/TdLib.Api/Objects/UpdateMessageSendFailed.cs @@ -42,18 +42,11 @@ public class UpdateMessageSendFailed : Update public long OldMessageId { get; set; } /// - /// An error code + /// The cause of the message sending failure /// [JsonConverter(typeof(Converter))] - [JsonProperty("error_code")] - public int ErrorCode { get; set; } - - /// - /// Error message - /// - [JsonConverter(typeof(Converter))] - [JsonProperty("error_message")] - public string ErrorMessage { get; set; } + [JsonProperty("error")] + public Error Error { get; set; } } } } diff --git a/TdLib.Api/Objects/UpdateNotificationGroup.cs b/TdLib.Api/Objects/UpdateNotificationGroup.cs index 302a7fea..8a67ebe3 100644 --- a/TdLib.Api/Objects/UpdateNotificationGroup.cs +++ b/TdLib.Api/Objects/UpdateNotificationGroup.cs @@ -70,13 +70,13 @@ public class UpdateNotificationGroup : Update public int TotalCount { get; set; } /// - /// List of added group notifications, sorted by notification ID + /// List of added group notifications, sorted by notification identifier /// [JsonProperty("added_notifications", ItemConverterType = typeof(Converter))] public Notification[] AddedNotifications { get; set; } /// - /// Identifiers of removed group notifications, sorted by notification ID + /// Identifiers of removed group notifications, sorted by notification identifier /// [JsonProperty("removed_notification_ids", ItemConverterType = typeof(Converter))] public int[] RemovedNotificationIds { get; set; } diff --git a/TdLib.Api/Objects/UpdatePollAnswer.cs b/TdLib.Api/Objects/UpdatePollAnswer.cs index c796cff0..278e53ae 100644 --- a/TdLib.Api/Objects/UpdatePollAnswer.cs +++ b/TdLib.Api/Objects/UpdatePollAnswer.cs @@ -35,11 +35,11 @@ public class UpdatePollAnswer : Update public long PollId { get; set; } /// - /// The user, who changed the answer to the poll + /// Identifier of the message sender that changed the answer to the poll /// [JsonConverter(typeof(Converter))] - [JsonProperty("user_id")] - public long UserId { get; set; } + [JsonProperty("voter_id")] + public MessageSender VoterId { get; set; } /// /// 0-based identifiers of answer options, chosen by the user diff --git a/TdLib.Api/Objects/UpdateStory.cs b/TdLib.Api/Objects/UpdateStory.cs new file mode 100644 index 00000000..1ba6b2e9 --- /dev/null +++ b/TdLib.Api/Objects/UpdateStory.cs @@ -0,0 +1,39 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class Update : Object + { + /// + /// A story was changed + /// + public class UpdateStory : Update + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "updateStory"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// The new information about the story + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story")] + public Story Story { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/UpdateStoryDeleted.cs b/TdLib.Api/Objects/UpdateStoryDeleted.cs new file mode 100644 index 00000000..c41587b5 --- /dev/null +++ b/TdLib.Api/Objects/UpdateStoryDeleted.cs @@ -0,0 +1,46 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class Update : Object + { + /// + /// A story became inaccessible + /// + public class UpdateStoryDeleted : Update + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "updateStoryDeleted"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Identifier of the chat that posted the story + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_sender_chat_id")] + public long StorySenderChatId { get; set; } + + /// + /// Story identifier + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_id")] + public int StoryId { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/UpdateStoryListChatCount.cs b/TdLib.Api/Objects/UpdateStoryListChatCount.cs new file mode 100644 index 00000000..f5eb51cf --- /dev/null +++ b/TdLib.Api/Objects/UpdateStoryListChatCount.cs @@ -0,0 +1,46 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class Update : Object + { + /// + /// Number of chats in a story list has changed + /// + public class UpdateStoryListChatCount : Update + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "updateStoryListChatCount"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// The story list + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_list")] + public StoryList StoryList { get; set; } + + /// + /// Approximate total number of chats with active stories in the list + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("chat_count")] + public int ChatCount { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/UpdateStorySendFailed.cs b/TdLib.Api/Objects/UpdateStorySendFailed.cs new file mode 100644 index 00000000..0cfb7a99 --- /dev/null +++ b/TdLib.Api/Objects/UpdateStorySendFailed.cs @@ -0,0 +1,53 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class Update : Object + { + /// + /// A story failed to send. If the story sending is canceled, then updateStoryDeleted will be received instead of this update + /// + public class UpdateStorySendFailed : Update + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "updateStorySendFailed"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// The failed to send story + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story")] + public Story Story { get; set; } + + /// + /// The cause of the story sending failure + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("error")] + public Error Error { get; set; } + + /// + /// Type of the error; may be null if unknown + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("error_type")] + public CanSendStoryResult ErrorType { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/UpdateStorySendSucceeded.cs b/TdLib.Api/Objects/UpdateStorySendSucceeded.cs new file mode 100644 index 00000000..d241a782 --- /dev/null +++ b/TdLib.Api/Objects/UpdateStorySendSucceeded.cs @@ -0,0 +1,46 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class Update : Object + { + /// + /// A story has been successfully sent + /// + public class UpdateStorySendSucceeded : Update + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "updateStorySendSucceeded"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// The sent story + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story")] + public Story Story { get; set; } + + /// + /// The previous temporary story identifier + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("old_story_id")] + public int OldStoryId { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/UpdateStoryStealthMode.cs b/TdLib.Api/Objects/UpdateStoryStealthMode.cs new file mode 100644 index 00000000..cc0a0b45 --- /dev/null +++ b/TdLib.Api/Objects/UpdateStoryStealthMode.cs @@ -0,0 +1,46 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class Update : Object + { + /// + /// Story stealth mode settings have changed + /// + public class UpdateStoryStealthMode : Update + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "updateStoryStealthMode"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// Point in time (Unix timestamp) until stealth mode is active; 0 if it is disabled + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("active_until_date")] + public int ActiveUntilDate { get; set; } + + /// + /// Point in time (Unix timestamp) when stealth mode can be enabled again; 0 if there is no active cooldown + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("cooldown_until_date")] + public int CooldownUntilDate { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/UpdateUnconfirmedSession.cs b/TdLib.Api/Objects/UpdateUnconfirmedSession.cs new file mode 100644 index 00000000..02a4d73c --- /dev/null +++ b/TdLib.Api/Objects/UpdateUnconfirmedSession.cs @@ -0,0 +1,39 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class Update : Object + { + /// + /// The first unconfirmed session has changed + /// + public class UpdateUnconfirmedSession : Update + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "updateUnconfirmedSession"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + /// + /// The unconfirmed session; may be null if none + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("session")] + public UnconfirmedSession Session { get; set; } + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/User.cs b/TdLib.Api/Objects/User.cs index 22af1320..115d1c1e 100644 --- a/TdLib.Api/Objects/User.cs +++ b/TdLib.Api/Objects/User.cs @@ -74,6 +74,20 @@ public partial class User : Object [JsonProperty("profile_photo")] public ProfilePhoto ProfilePhoto { get; set; } + /// + /// Identifier of the accent color for name, and backgrounds of profile photo, reply header, and link preview + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("accent_color_id")] + public int AccentColorId { get; set; } + + /// + /// Identifier of a custom emoji to be shown on the reply header background; 0 if none. For Telegram Premium users only + /// + [JsonConverter(typeof(Converter.Int64))] + [JsonProperty("background_custom_emoji_id")] + public long BackgroundCustomEmojiId { get; set; } + /// /// Emoji status to be shown instead of the default Telegram Premium badge; may be null. For Telegram Premium users only /// @@ -95,6 +109,13 @@ public partial class User : Object [JsonProperty("is_mutual_contact")] public bool IsMutualContact { get; set; } + /// + /// The user is a close friend of the current user; implies that the user is a contact + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("is_close_friend")] + public bool IsCloseFriend { get; set; } + /// /// True, if the user is verified /// @@ -137,6 +158,20 @@ public partial class User : Object [JsonProperty("is_fake")] public bool IsFake { get; set; } + /// + /// True, if the user has non-expired stories available to the current user + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("has_active_stories")] + public bool HasActiveStories { get; set; } + + /// + /// True, if the user has unread non-expired stories available to the current user + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("has_unread_active_stories")] + public bool HasUnreadActiveStories { get; set; } + /// /// If false, the user is inaccessible, and the only information known about the user is inside this class. Identifier of the user can't be passed to any method /// diff --git a/TdLib.Api/Objects/UserFullInfo.cs b/TdLib.Api/Objects/UserFullInfo.cs index 049a0d6d..fb547bed 100644 --- a/TdLib.Api/Objects/UserFullInfo.cs +++ b/TdLib.Api/Objects/UserFullInfo.cs @@ -47,11 +47,11 @@ public partial class UserFullInfo : Object public ChatPhoto PublicPhoto { get; set; } /// - /// True, if the user is blocked by the current user + /// Block list to which the user is added; may be null if none /// [JsonConverter(typeof(Converter))] - [JsonProperty("is_blocked")] - public bool IsBlocked { get; set; } + [JsonProperty("block_list")] + public BlockList BlockList { get; set; } /// /// True, if the user can be called @@ -88,6 +88,13 @@ public partial class UserFullInfo : Object [JsonProperty("has_restricted_voice_and_video_note_messages")] public bool HasRestrictedVoiceAndVideoNoteMessages { get; set; } + /// + /// True, if the user has pinned stories + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("has_pinned_stories")] + public bool HasPinnedStories { get; set; } + /// /// True, if the current user needs to explicitly allow to share their phone number with the user when the method addContact is used /// @@ -116,7 +123,7 @@ public partial class UserFullInfo : Object public int GroupInCommonCount { get; set; } /// - /// For bots, information about the bot; may be null + /// For bots, information about the bot; may be null if the user isn't a bot /// [JsonConverter(typeof(Converter))] [JsonProperty("bot_info")] diff --git a/TdLib.Api/Objects/UserPrivacySettingRuleAllowAll.cs b/TdLib.Api/Objects/UserPrivacySettingRuleAllowAll.cs index db6f46a6..1dd16fec 100644 --- a/TdLib.Api/Objects/UserPrivacySettingRuleAllowAll.cs +++ b/TdLib.Api/Objects/UserPrivacySettingRuleAllowAll.cs @@ -11,7 +11,7 @@ public static partial class TdApi public partial class UserPrivacySettingRule : Object { /// - /// Represents a single rule for managing privacy settings + /// Represents a single rule for managing user privacy settings /// public class UserPrivacySettingRuleAllowAll : UserPrivacySettingRule { diff --git a/TdLib.Api/Objects/UserPrivacySettingRuleAllowContacts.cs b/TdLib.Api/Objects/UserPrivacySettingRuleAllowContacts.cs index e61aa3c8..b3dce1cd 100644 --- a/TdLib.Api/Objects/UserPrivacySettingRuleAllowContacts.cs +++ b/TdLib.Api/Objects/UserPrivacySettingRuleAllowContacts.cs @@ -11,7 +11,7 @@ public static partial class TdApi public partial class UserPrivacySettingRule : Object { /// - /// A rule to allow all of a user's contacts to do something + /// A rule to allow all contacts of the user to do something /// public class UserPrivacySettingRuleAllowContacts : UserPrivacySettingRule { diff --git a/TdLib.Api/Objects/UserPrivacySettingRuleRestrictContacts.cs b/TdLib.Api/Objects/UserPrivacySettingRuleRestrictContacts.cs index be38c4a7..6fe3a1ee 100644 --- a/TdLib.Api/Objects/UserPrivacySettingRuleRestrictContacts.cs +++ b/TdLib.Api/Objects/UserPrivacySettingRuleRestrictContacts.cs @@ -11,7 +11,7 @@ public static partial class TdApi public partial class UserPrivacySettingRule : Object { /// - /// A rule to restrict all contacts of a user from doing something + /// A rule to restrict all contacts of the user from doing something /// public class UserPrivacySettingRuleRestrictContacts : UserPrivacySettingRule { diff --git a/TdLib.Api/Objects/UserPrivacySettingShowBio.cs b/TdLib.Api/Objects/UserPrivacySettingShowBio.cs new file mode 100644 index 00000000..c921017b --- /dev/null +++ b/TdLib.Api/Objects/UserPrivacySettingShowBio.cs @@ -0,0 +1,34 @@ +using System; +using Newtonsoft.Json; + +namespace TdLib +{ + /// + /// Autogenerated TDLib APIs + /// + public static partial class TdApi + { + public partial class UserPrivacySetting : Object + { + /// + /// A privacy setting for managing whether the user's bio is visible + /// + public class UserPrivacySettingShowBio : UserPrivacySetting + { + /// + /// Data type for serialization + /// + [JsonProperty("@type")] + public override string DataType { get; set; } = "userPrivacySettingShowBio"; + + /// + /// Extra data attached to the message + /// + [JsonProperty("@extra")] + public override string Extra { get; set; } + + + } + } + } +} \ No newline at end of file diff --git a/TdLib.Api/Objects/UserTypeBot.cs b/TdLib.Api/Objects/UserTypeBot.cs index 8bbc913e..dd2fa826 100644 --- a/TdLib.Api/Objects/UserTypeBot.cs +++ b/TdLib.Api/Objects/UserTypeBot.cs @@ -27,6 +27,13 @@ public class UserTypeBot : UserType [JsonProperty("@extra")] public override string Extra { get; set; } + /// + /// True, if the bot is owned by the current user and can be edited using the methods toggleBotUsernameIsActive, reorderBotActiveUsernames, setBotProfilePhoto, setBotName, setBotInfoDescription, and setBotInfoShortDescription + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("can_be_edited")] + public bool CanBeEdited { get; set; } + /// /// True, if the bot can be invited to basic group and supergroup chats /// @@ -63,7 +70,7 @@ public class UserTypeBot : UserType public bool NeedLocation { get; set; } /// - /// True, if the bot can be added to attachment menu + /// True, if the bot can be added to attachment or side menu /// [JsonConverter(typeof(Converter))] [JsonProperty("can_be_added_to_attachment_menu")] diff --git a/TdLib.Api/Objects/Usernames.cs b/TdLib.Api/Objects/Usernames.cs index baa9656e..2a38a94c 100644 --- a/TdLib.Api/Objects/Usernames.cs +++ b/TdLib.Api/Objects/Usernames.cs @@ -26,19 +26,19 @@ public partial class Usernames : Object public override string Extra { get; set; } /// - /// List of active usernames; the first one must be shown as the primary username. The order of active usernames can be changed with reorderActiveUsernames or reorderSupergroupActiveUsernames + /// List of active usernames; the first one must be shown as the primary username. The order of active usernames can be changed with reorderActiveUsernames, reorderBotActiveUsernames or reorderSupergroupActiveUsernames /// [JsonProperty("active_usernames", ItemConverterType = typeof(Converter))] public string[] ActiveUsernames { get; set; } /// - /// List of currently disabled usernames; the username can be activated with toggleUsernameIsActive/toggleSupergroupUsernameIsActive + /// List of currently disabled usernames; the username can be activated with toggleUsernameIsActive, toggleBotUsernameIsActive, or toggleSupergroupUsernameIsActive /// [JsonProperty("disabled_usernames", ItemConverterType = typeof(Converter))] public string[] DisabledUsernames { get; set; } /// - /// The active username, which can be changed with setUsername/setSupergroupUsername + /// The active username, which can be changed with setUsername or setSupergroupUsername /// [JsonConverter(typeof(Converter))] [JsonProperty("editable_username")] diff --git a/TdLib.Api/Objects/WebPage.cs b/TdLib.Api/Objects/WebPage.cs index 948ddcf0..5af26681 100644 --- a/TdLib.Api/Objects/WebPage.cs +++ b/TdLib.Api/Objects/WebPage.cs @@ -9,7 +9,7 @@ namespace TdLib public static partial class TdApi { /// - /// Describes a web page preview + /// Describes a link preview /// public partial class WebPage : Object { @@ -116,6 +116,34 @@ public partial class WebPage : Object [JsonProperty("author")] public string Author { get; set; } + /// + /// True, if size of media in the preview can be changed + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("has_large_media")] + public bool HasLargeMedia { get; set; } + + /// + /// True, if large media preview must be shown; otherwise, the media preview must be shown small and only the first frame must be shown for videos + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("show_large_media")] + public bool ShowLargeMedia { get; set; } + + /// + /// True, if there is no need to show an ordinary open URL confirmation, when opening the URL from the preview, because the URL is shown in the message text in clear + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("skip_confirmation")] + public bool SkipConfirmation { get; set; } + + /// + /// True, if the link preview must be shown above message text; otherwise, the link preview must be shown below the message text + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("show_above_text")] + public bool ShowAboveText { get; set; } + /// /// Preview of the content as an animation, if available; may be null /// @@ -165,6 +193,20 @@ public partial class WebPage : Object [JsonProperty("voice_note")] public VoiceNote VoiceNote { get; set; } + /// + /// The identifier of the sender of the previewed story; 0 if none + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_sender_chat_id")] + public long StorySenderChatId { get; set; } + + /// + /// The identifier of the previewed story; 0 if none + /// + [JsonConverter(typeof(Converter))] + [JsonProperty("story_id")] + public int StoryId { get; set; } + /// /// Version of web page instant view (currently, can be 1 or 2); 0 if none /// diff --git a/TdLib.CodeGen/Methods.tl b/TdLib.CodeGen/Methods.tl index 29c8a85e..e27bba1f 100644 --- a/TdLib.CodeGen/Methods.tl +++ b/TdLib.CodeGen/Methods.tl @@ -1,4 +1,4 @@ -//@description Returns the current authorization state; this is an offline request. For informational purposes only. Use updateAuthorizationState instead to maintain the current authorization state. Can be called before initialization +//@description Returns the current authorization state; this is an offline request. For informational purposes only. Use updateAuthorizationState instead to maintain the current authorization state. Can be called before initialization getAuthorizationState = AuthorizationState; @@ -185,7 +185,7 @@ getSupergroupFullInfo supergroup_id:int53 = SupergroupFullInfo; //@description Returns information about a secret chat by its identifier. This is an offline request @secret_chat_id Secret chat identifier getSecretChat secret_chat_id:int32 = SecretChat; -//@description Returns information about a chat by its identifier, this is an offline request if the current user is not a bot @chat_id Chat identifier +//@description Returns information about a chat by its identifier; this is an offline request if the current user is not a bot @chat_id Chat identifier getChat chat_id:int53 = Chat; //@description Returns information about a message @chat_id Identifier of the chat the message belongs to @message_id Identifier of the message to get @@ -194,8 +194,9 @@ getMessage chat_id:int53 message_id:int53 = Message; //@description Returns information about a message, if it is available without sending network request. This is an offline request @chat_id Identifier of the chat the message belongs to @message_id Identifier of the message to get getMessageLocally chat_id:int53 message_id:int53 = Message; -//@description Returns information about a message that is replied by a given message. Also, returns the pinned message, the game message, the invoice message, and the topic creation message for messages -//-of the types messagePinMessage, messageGameScore, messagePaymentSuccessful, and topic messages without replied message respectively +//@description Returns information about a non-bundled message that is replied by a given message. Also, returns the pinned message, the game message, the invoice message, +//-the message with a previously set same background, and the topic creation message for messages of the types +//-messagePinMessage, messageGameScore, messagePaymentSuccessful, messageChatSetBackground and topic messages without non-bundled replied message respectively //@chat_id Identifier of the chat the message belongs to //@message_id Identifier of the reply message getRepliedMessage chat_id:int53 message_id:int53 = Message; @@ -220,7 +221,7 @@ getMessageViewers chat_id:int53 message_id:int53 = MessageViewers; //@description Returns information about a file; this is an offline request @file_id Identifier of the file to get getFile file_id:int32 = File; -//@description Returns information about a file by its remote ID; this is an offline request. Can be used to register a URL as a file for further uploading, or sending as a message. Even the request succeeds, the file can be used only if it is still accessible to the user. +//@description Returns information about a file by its remote identifier; this is an offline request. Can be used to register a URL as a file for further uploading, or sending as a message. Even the request succeeds, the file can be used only if it is still accessible to the user. //-For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the application //@remote_file_id Remote identifier of the file to get //@file_type File type; pass null if unknown @@ -244,7 +245,7 @@ searchPublicChat username:string = Chat; //@query Query to search for searchPublicChats query:string = Chats; -//@description Searches for the specified query in the title and username of already known chats, this is an offline request. Returns chats in the order seen in the main chat list +//@description Searches for the specified query in the title and username of already known chats; this is an offline request. Returns chats in the order seen in the main chat list //@query Query to search for. If the query is empty, returns up to 50 recently found chats //@limit The maximum number of chats to be returned searchChats query:string limit:int32 = Chats; @@ -257,12 +258,17 @@ searchChatsOnServer query:string limit:int32 = Chats; //@location Current user location searchChatsNearby location:location = ChatsNearby; -//@description Returns a list of frequently used chats. Supported only if the chat info database is enabled @category Category of chats to be returned @limit The maximum number of chats to be returned; up to 30 +//@description Returns a list of frequently used chats @category Category of chats to be returned @limit The maximum number of chats to be returned; up to 30 getTopChats category:TopChatCategory limit:int32 = Chats; //@description Removes a chat from the list of frequently used chats. Supported only if the chat info database is enabled @category Category of frequently used chats @chat_id Chat identifier removeTopChat category:TopChatCategory chat_id:int53 = Ok; +//@description Searches for the specified query in the title and username of up to 50 recently found chats; this is an offline request +//@query Query to search for +//@limit The maximum number of chats to be returned +searchRecentlyFoundChats query:string limit:int32 = Chats; + //@description Adds a chat to the list of recently found chats. The chat is added to the beginning of the list. If the chat is already in the list, it will be removed from the list first @chat_id Identifier of the chat to add addRecentlyFoundChat chat_id:int53 = Ok; @@ -272,10 +278,10 @@ removeRecentlyFoundChat chat_id:int53 = Ok; //@description Clears the list of recently found chats clearRecentlyFoundChats = Ok; -//@description Returns recently opened chats, this is an offline request. Returns chats in the order of last opening @limit The maximum number of chats to be returned +//@description Returns recently opened chats; this is an offline request. Returns chats in the order of last opening @limit The maximum number of chats to be returned getRecentlyOpenedChats limit:int32 = Chats; -//@description Checks whether a username can be set for a chat @chat_id Chat identifier; must be identifier of a supergroup chat, or a channel chat, or a private chat with self, or zero if the chat is being created @username Username to be checked +//@description Checks whether a username can be set for a chat @chat_id Chat identifier; must be identifier of a supergroup chat, or a channel chat, or a private chat with self, or 0 if the chat is being created @username Username to be checked checkChatUsername chat_id:int53 username:string = CheckChatUsernameResult; //@description Returns a list of public chats of the specified type, owned by the user @type Type of the public chats to return @@ -416,16 +422,14 @@ getChatMessagePosition chat_id:int53 message_id:int53 filter:SearchMessagesFilte //@description Returns all scheduled messages in a chat. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id) @chat_id Chat identifier getChatScheduledMessages chat_id:int53 = Messages; -//@description Returns forwarded copies of a channel message to different public channels. For optimal performance, the number of returned messages is chosen by TDLib -//@chat_id Chat identifier of the message -//@message_id Message identifier -//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results -//@limit The maximum number of messages to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit -getMessagePublicForwards chat_id:int53 message_id:int53 offset:string limit:int32 = FoundMessages; - //@description Returns sponsored messages to be shown in a chat; for channel chats only @chat_id Identifier of the chat getChatSponsoredMessages chat_id:int53 = SponsoredMessages; +//@description Informs TDLib that the user opened the sponsored chat via the button, the name, the photo, or a mention in the sponsored message +//@chat_id Chat identifier of the sponsored message +//@message_id Identifier of the sponsored message +clickChatSponsoredMessage chat_id:int53 message_id:int53 = Ok; + //@description Removes an active notification from notification list. Needs to be called only if the notification is removed by the current user @notification_group_id Identifier of notification group to which the notification belongs @notification_id Identifier of removed notification removeNotification notification_group_id:int32 notification_id:int32 = Ok; @@ -437,7 +441,7 @@ removeNotificationGroup notification_group_id:int32 max_notification_id:int32 = //@description Returns an HTTPS link to a message in a chat. Available only for already sent messages in supergroups and channels, or if message.can_get_media_timestamp_links and a media timestamp link is generated. This is an offline request //@chat_id Identifier of the chat to which the message belongs //@message_id Identifier of the message -//@media_timestamp If not 0, timestamp from which the video/audio/video note/voice note playing must start, in seconds. The media can be in the message content or in its web page preview +//@media_timestamp If not 0, timestamp from which the video/audio/video note/voice note/story playing must start, in seconds. The media can be in the message content or in its web page preview //@for_album Pass true to create a link for the whole media album //@in_message_thread Pass true to create a link to the message as a channel post comment, in a message thread, or a forum topic getMessageLink chat_id:int53 message_id:int53 media_timestamp:int32 for_album:Bool in_message_thread:Bool = MessageLink; @@ -471,7 +475,7 @@ translateText text:formattedText to_language_code:string = FormattedText; //-"st", "sn", "sd", "si", "sk", "sl", "so", "es", "su", "sw", "sv", "tl", "tg", "ta", "tt", "te", "th", "tr", "tk", "uk", "ur", "ug", "uz", "vi", "cy", "xh", "yi", "ji", "yo", "zu" translateMessageText chat_id:int53 message_id:int53 to_language_code:string = FormattedText; -//@description Recognizes speech in a video note or a voice note message. The message must be successfully sent and must not be scheduled. May return an error with a message "MSG_VOICE_TOO_LONG" if media duration is too big to be recognized +//@description Recognizes speech in a video note or a voice note message. The message must be successfully sent and must not be scheduled //@chat_id Identifier of the chat to which the message belongs //@message_id Identifier of the message recognizeSpeech chat_id:int53 message_id:int53 = Ok; @@ -489,20 +493,19 @@ setChatMessageSender chat_id:int53 message_sender_id:MessageSender = Ok; //@description Sends a message. Returns the sent message //@chat_id Target chat //@message_thread_id If not 0, a message thread identifier in which the message will be sent -//@reply_to_message_id Identifier of the replied message; 0 if none +//@reply_to Information about the message or story to be replied; pass null if none //@options Options to be used to send the message; pass null to use default options //@reply_markup Markup for replying to the message; pass null if none; for bots only //@input_message_content The content of the message to be sent -sendMessage chat_id:int53 message_thread_id:int53 reply_to_message_id:int53 options:messageSendOptions reply_markup:ReplyMarkup input_message_content:InputMessageContent = Message; +sendMessage chat_id:int53 message_thread_id:int53 reply_to:InputMessageReplyTo options:messageSendOptions reply_markup:ReplyMarkup input_message_content:InputMessageContent = Message; //@description Sends 2-10 messages grouped together into an album. Currently, only audio, document, photo and video messages can be grouped into an album. Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages //@chat_id Target chat //@message_thread_id If not 0, a message thread identifier in which the messages will be sent -//@reply_to_message_id Identifier of a replied message; 0 if none +//@reply_to Information about the message or story to be replied; pass null if none //@options Options to be used to send the messages; pass null to use default options //@input_message_contents Contents of messages to be sent. At most 10 messages can be added to an album -//@only_preview Pass true to get fake messages instead of actually sending them -sendMessageAlbum chat_id:int53 message_thread_id:int53 reply_to_message_id:int53 options:messageSendOptions input_message_contents:vector only_preview:Bool = Messages; +sendMessageAlbum chat_id:int53 message_thread_id:int53 reply_to:InputMessageReplyTo options:messageSendOptions input_message_contents:vector = Messages; //@description Invites a bot to a chat (if it is not yet a member) and sends it the /start command. Bots can't be invited to a private chat other than the chat with the bot. Bots can't be invited to channels (although they can be added as admins) and secret chats. Returns the sent message //@bot_user_id Identifier of the bot @@ -513,40 +516,37 @@ sendBotStartMessage bot_user_id:int53 chat_id:int53 parameter:string = Message; //@description Sends the result of an inline query as a message. Returns the sent message. Always clears a chat draft message //@chat_id Target chat //@message_thread_id If not 0, a message thread identifier in which the message will be sent -//@reply_to_message_id Identifier of a replied message; 0 if none +//@reply_to Information about the message or story to be replied; pass null if none //@options Options to be used to send the message; pass null to use default options //@query_id Identifier of the inline query -//@result_id Identifier of the inline result +//@result_id Identifier of the inline query result //@hide_via_bot Pass true to hide the bot, via which the message is sent. Can be used only for bots getOption("animation_search_bot_username"), getOption("photo_search_bot_username"), and getOption("venue_search_bot_username") -sendInlineQueryResultMessage chat_id:int53 message_thread_id:int53 reply_to_message_id:int53 options:messageSendOptions query_id:int64 result_id:string hide_via_bot:Bool = Message; +sendInlineQueryResultMessage chat_id:int53 message_thread_id:int53 reply_to:InputMessageReplyTo options:messageSendOptions query_id:int64 result_id:string hide_via_bot:Bool = Message; //@description Forwards previously sent messages. Returns the forwarded messages in the same order as the message identifiers passed in message_ids. If a message can't be forwarded, null will be returned instead of the message //@chat_id Identifier of the chat to which to forward messages //@message_thread_id If not 0, a message thread identifier in which the message will be sent; for forum threads only //@from_chat_id Identifier of the chat from which to forward messages -//@message_ids Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order. At most 100 messages can be forwarded simultaneously +//@message_ids Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order. At most 100 messages can be forwarded simultaneously. A message can be forwarded only if message.can_be_forwarded //@options Options to be used to send the messages; pass null to use default options //@send_copy Pass true to copy content of the messages without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local //@remove_caption Pass true to remove media captions of message copies. Ignored if send_copy is false -//@only_preview Pass true to get fake messages instead of actually forwarding them -forwardMessages chat_id:int53 message_thread_id:int53 from_chat_id:int53 message_ids:vector options:messageSendOptions send_copy:Bool remove_caption:Bool only_preview:Bool = Messages; +forwardMessages chat_id:int53 message_thread_id:int53 from_chat_id:int53 message_ids:vector options:messageSendOptions send_copy:Bool remove_caption:Bool = Messages; //@description Resends messages which failed to send. Can be called only for messages for which messageSendingStateFailed.can_retry is true and after specified in messageSendingStateFailed.retry_after time passed. //-If a message is re-sent, the corresponding failed to send message is deleted. Returns the sent messages in the same order as the message identifiers passed in message_ids. If a message can't be re-sent, null will be returned instead of the message //@chat_id Identifier of the chat to send messages //@message_ids Identifiers of the messages to resend. Message identifiers must be in a strictly increasing order -resendMessages chat_id:int53 message_ids:vector = Messages; - -//@description Sends a notification about a screenshot taken in a chat. Supported only in private and secret chats @chat_id Chat identifier -sendChatScreenshotTakenNotification chat_id:int53 = Ok; +//@quote New manually chosen quote from the message to be replied; pass null if none. Ignored if more than one message is re-sent, or if messageSendingStateFailed.need_another_reply_quote == false +resendMessages chat_id:int53 message_ids:vector quote:formattedText = Messages; //@description Adds a local message to a chat. The message is persistent across application restarts only if the message database is used. Returns the added message //@chat_id Target chat //@sender_id Identifier of the sender of the message -//@reply_to_message_id Identifier of the replied message; 0 if none +//@reply_to Information about the message or story to be replied; pass null if none //@disable_notification Pass true to disable notification for the message //@input_message_content The content of the message to be added -addLocalMessage chat_id:int53 sender_id:MessageSender reply_to_message_id:int53 disable_notification:Bool input_message_content:InputMessageContent = Message; +addLocalMessage chat_id:int53 sender_id:MessageSender reply_to:InputMessageReplyTo disable_notification:Bool input_message_content:InputMessageContent = Message; //@description Deletes messages @chat_id Chat identifier @message_ids Identifiers of the messages to be deleted @revoke Pass true to delete messages for all chat members. Always true for supergroups, channels and secret chats deleteMessages chat_id:int53 message_ids:vector revoke:Bool = Ok; @@ -742,10 +742,16 @@ getMessageAddedReactions chat_id:int53 message_id:int53 reaction_type:ReactionTy setDefaultReactionType reaction_type:ReactionType = Ok; +//@description Searches for a given quote in a text. Returns found quote start position in UTF-16 code units. Returns a 404 error if the quote is not found. Can be called synchronously +//@text Text in which to search for the quote +//@quote Quote to search for +//@quote_position Approximate quote position in UTF-16 code units +searchQuote text:formattedText quote:formattedText quote_position:int32 = FoundPosition; + //@description Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) found in the text. Can be called synchronously @text The text in which to look for entities getTextEntities text:string = TextEntities; -//@description Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously @text The text to parse @parse_mode Text parse mode +//@description Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously @text The text to parse @parse_mode Text parse mode parseTextEntities text:string parse_mode:TextParseMode = FormattedText; //@description Parses Markdown entities in a human-friendly format, ignoring markup errors. Can be called synchronously @@ -787,15 +793,15 @@ getThemeParametersJsonString theme:themeParameters = Text; //@option_ids 0-based identifiers of answer options, chosen by the user. User can choose more than 1 answer option only is the poll allows multiple answers setPollAnswer chat_id:int53 message_id:int53 option_ids:vector = Ok; -//@description Returns users voted for the specified option in a non-anonymous polls. For optimal performance, the number of returned users is chosen by TDLib +//@description Returns message senders voted for the specified option in a non-anonymous polls. For optimal performance, the number of returned users is chosen by TDLib //@chat_id Identifier of the chat to which the poll belongs //@message_id Identifier of the message containing the poll //@option_id 0-based identifier of the answer option -//@offset Number of users to skip in the result; must be non-negative -//@limit The maximum number of users to be returned; must be positive and can't be greater than 50. For optimal performance, the number of returned users is chosen by TDLib and can be smaller than the specified limit, even if the end of the voter list has not been reached -getPollVoters chat_id:int53 message_id:int53 option_id:int32 offset:int32 limit:int32 = Users; +//@offset Number of voters to skip in the result; must be non-negative +//@limit The maximum number of voters to be returned; must be positive and can't be greater than 50. For optimal performance, the number of returned voters is chosen by TDLib and can be smaller than the specified limit, even if the end of the voter list has not been reached +getPollVoters chat_id:int53 message_id:int53 option_id:int32 offset:int32 limit:int32 = MessageSenders; -//@description Stops a poll. A poll in a message can be stopped when the message has can_be_edited flag set +//@description Stops a poll. A poll in a message can be stopped when the message has can_be_edited flag is set //@chat_id Identifier of the chat to which the poll belongs //@message_id Identifier of the message containing the poll //@reply_markup The new message reply markup; pass null if none; for bots only @@ -841,11 +847,11 @@ shareChatWithBot chat_id:int53 message_id:int53 button_id:int32 shared_chat_id:i //@description Sends an inline query to a bot and returns its results. Returns an error with code 502 if the bot fails to answer the query before the query timeout expires -//@bot_user_id The identifier of the target bot +//@bot_user_id Identifier of the target bot //@chat_id Identifier of the chat where the query was sent //@user_location Location of the user; pass null if unknown or the bot doesn't need user's location //@query Text of the query -//@offset Offset of the first entry to return +//@offset Offset of the first entry to return; use empty string to get the first chunk of results getInlineQueryResults bot_user_id:int53 chat_id:int53 user_location:location query:string offset:string = InlineQueryResults; //@description Sets the result of an inline query; for bots only @@ -873,9 +879,9 @@ searchWebApp bot_user_id:int53 web_app_short_name:string = FoundWebApp; //@allow_write_access Pass true if the current user allowed the bot to send them messages getWebAppLinkUrl chat_id:int53 bot_user_id:int53 web_app_short_name:string start_parameter:string theme:themeParameters application_name:string allow_write_access:Bool = HttpUrl; -//@description Returns an HTTPS URL of a Web App to open after keyboardButtonTypeWebApp or inlineQueryResultsButtonTypeWebApp button is pressed +//@description Returns an HTTPS URL of a Web App to open from the side menu, a keyboardButtonTypeWebApp button, an inlineQueryResultsButtonTypeWebApp button, or an internalLinkTypeSideMenuBot link //@bot_user_id Identifier of the target bot -//@url The URL from the keyboardButtonTypeWebApp or inlineQueryResultsButtonTypeWebApp button +//@url The URL from a keyboardButtonTypeWebApp button, inlineQueryResultsButtonTypeWebApp button, an internalLinkTypeSideMenuBot link, or an empty when the bot is opened from the side menu //@theme Preferred Web App theme; pass null to use the default theme //@application_name Short name of the application; 0-64 English letters, digits, and underscores getWebAppUrl bot_user_id:int53 url:string theme:themeParameters application_name:string = HttpUrl; @@ -883,19 +889,19 @@ getWebAppUrl bot_user_id:int53 url:string theme:themeParameters application_name //@description Sends data received from a keyboardButtonTypeWebApp Web App to a bot //@bot_user_id Identifier of the target bot //@button_text Text of the keyboardButtonTypeWebApp button, which opened the Web App -//@data Received data +//@data The data sendWebAppData bot_user_id:int53 button_text:string data:string = Ok; -//@description Informs TDLib that a Web App is being opened from attachment menu, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an inlineKeyboardButtonTypeWebApp button. +//@description Informs TDLib that a Web App is being opened from the attachment menu, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an inlineKeyboardButtonTypeWebApp button. //-For each bot, a confirmation alert about data sent to the bot must be shown once //@chat_id Identifier of the chat in which the Web App is opened. The Web App can't be opened in secret chats //@bot_user_id Identifier of the bot, providing the Web App -//@url The URL from an inlineKeyboardButtonTypeWebApp button, a botMenuButton button, or an internalLinkTypeAttachmentMenuBot link, or an empty string otherwise +//@url The URL from an inlineKeyboardButtonTypeWebApp button, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an empty string otherwise //@theme Preferred Web App theme; pass null to use the default theme //@application_name Short name of the application; 0-64 English letters, digits, and underscores //@message_thread_id If not 0, a message thread identifier in which the message will be sent -//@reply_to_message_id Identifier of the replied message for the message sent by the Web App; 0 if none -openWebApp chat_id:int53 bot_user_id:int53 url:string theme:themeParameters application_name:string message_thread_id:int53 reply_to_message_id:int53 = WebAppInfo; +//@reply_to Information about the message or story to be replied in the message sent by the Web App; pass null if none +openWebApp chat_id:int53 bot_user_id:int53 url:string theme:themeParameters application_name:string message_thread_id:int53 reply_to:InputMessageReplyTo = WebAppInfo; //@description Informs TDLib that a previously opened Web App was closed @web_app_launch_id Identifier of Web App launch, received from openWebApp closeWebApp web_app_launch_id:int64 = Ok; @@ -1038,7 +1044,7 @@ createNewBasicGroupChat user_ids:vector title:string message_auto_delete_ //@param_description Chat description; 0-255 characters //@location Chat location if a location-based supergroup is being created; pass null to create an ordinary supergroup chat //@message_auto_delete_time Message auto-delete time value, in seconds; must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren't deleted automatically -//@for_import Pass true to create a supergroup for importing messages using importMessage +//@for_import Pass true to create a supergroup for importing messages using importMessages createNewSupergroupChat title:string is_forum:Bool is_channel:Bool description:string location:chatLocation message_auto_delete_time:int32 for_import:Bool = Chat; //@description Creates a new secret chat. Returns the newly created chat @user_id Identifier of the target user @@ -1056,26 +1062,74 @@ getChatListsToAddChat chat_id:int53 = ChatLists; //@chat_list The chat list. Use getChatListsToAddChat to get suitable chat lists addChatToList chat_id:int53 chat_list:ChatList = Ok; -//@description Returns information about a chat filter by its identifier @chat_filter_id Chat filter identifier -getChatFilter chat_filter_id:int32 = ChatFilter; +//@description Returns information about a chat folder by its identifier @chat_folder_id Chat folder identifier +getChatFolder chat_folder_id:int32 = ChatFolder; + +//@description Creates new chat folder. Returns information about the created chat folder. There can be up to getOption("chat_folder_count_max") chat folders, but the limit can be increased with Telegram Premium @folder The new chat folder +createChatFolder folder:chatFolder = ChatFolderInfo; + +//@description Edits existing chat folder. Returns information about the edited chat folder @chat_folder_id Chat folder identifier @folder The edited chat folder +editChatFolder chat_folder_id:int32 folder:chatFolder = ChatFolderInfo; + +//@description Deletes existing chat folder @chat_folder_id Chat folder identifier @leave_chat_ids Identifiers of the chats to leave. The chats must be pinned or always included in the folder +deleteChatFolder chat_folder_id:int32 leave_chat_ids:vector = Ok; + +//@description Returns identifiers of pinned or always included chats from a chat folder, which are suggested to be left when the chat folder is deleted @chat_folder_id Chat folder identifier +getChatFolderChatsToLeave chat_folder_id:int32 = Chats; + +//@description Returns approximate number of chats in a being created chat folder. Main and archive chat lists must be fully preloaded for this function to work correctly @folder The new chat folder +getChatFolderChatCount folder:chatFolder = Count; -//@description Creates new chat filter. Returns information about the created chat filter. There can be up to getOption("chat_filter_count_max") chat filters, but the limit can be increased with Telegram Premium @filter Chat filter -createChatFilter filter:chatFilter = ChatFilterInfo; +//@description Changes the order of chat folders @chat_folder_ids Identifiers of chat folders in the new correct order @main_chat_list_position Position of the main chat list among chat folders, 0-based. Can be non-zero only for Premium users +reorderChatFolders chat_folder_ids:vector main_chat_list_position:int32 = Ok; -//@description Edits existing chat filter. Returns information about the edited chat filter @chat_filter_id Chat filter identifier @filter The edited chat filter -editChatFilter chat_filter_id:int32 filter:chatFilter = ChatFilterInfo; +//@description Returns recommended chat folders for the current user +getRecommendedChatFolders = RecommendedChatFolders; + +//@description Returns default icon name for a folder. Can be called synchronously @folder Chat folder +getChatFolderDefaultIconName folder:chatFolder = ChatFolderIcon; + +//@description Returns identifiers of chats from a chat folder, suitable for adding to a chat folder invite link @chat_folder_id Chat folder identifier +getChatsForChatFolderInviteLink chat_folder_id:int32 = Chats; + +//@description Creates a new invite link for a chat folder. A link can be created for a chat folder if it has only pinned and included chats +//@chat_folder_id Chat folder identifier +//@name Name of the link; 0-32 characters +//@chat_ids Identifiers of chats to be accessible by the invite link. Use getChatsForChatFolderInviteLink to get suitable chats. Basic groups will be automatically converted to supergroups before link creation +createChatFolderInviteLink chat_folder_id:int32 name:string chat_ids:vector = ChatFolderInviteLink; + +//@description Returns invite links created by the current user for a shareable chat folder @chat_folder_id Chat folder identifier +getChatFolderInviteLinks chat_folder_id:int32 = ChatFolderInviteLinks; + +//@description Edits an invite link for a chat folder +//@chat_folder_id Chat folder identifier +//@invite_link Invite link to be edited +//@name New name of the link; 0-32 characters +//@chat_ids New identifiers of chats to be accessible by the invite link. Use getChatsForChatFolderInviteLink to get suitable chats. Basic groups will be automatically converted to supergroups before link editing +editChatFolderInviteLink chat_folder_id:int32 invite_link:string name:string chat_ids:vector = ChatFolderInviteLink; -//@description Deletes existing chat filter @chat_filter_id Chat filter identifier -deleteChatFilter chat_filter_id:int32 = Ok; +//@description Deletes an invite link for a chat folder +//@chat_folder_id Chat folder identifier +//@invite_link Invite link to be deleted +deleteChatFolderInviteLink chat_folder_id:int32 invite_link:string = Ok; -//@description Changes the order of chat filters @chat_filter_ids Identifiers of chat filters in the new correct order @main_chat_list_position Position of the main chat list among chat filters, 0-based. Can be non-zero only for Premium users -reorderChatFilters chat_filter_ids:vector main_chat_list_position:int32 = Ok; +//@description Checks the validity of an invite link for a chat folder and returns information about the corresponding chat folder @invite_link Invite link to be checked +checkChatFolderInviteLink invite_link:string = ChatFolderInviteLinkInfo; -//@description Returns recommended chat filters for the current user -getRecommendedChatFilters = RecommendedChatFilters; +//@description Adds a chat folder by an invite link @invite_link Invite link for the chat folder @chat_ids Identifiers of the chats added to the chat folder. The chats are automatically joined if they aren't joined yet +addChatFolderByInviteLink invite_link:string chat_ids:vector = Ok; -//@description Returns default icon name for a filter. Can be called synchronously @filter Chat filter -getChatFilterDefaultIconName filter:chatFilter = Text; +//@description Returns new chats added to a shareable chat folder by its owner. The method must be called at most once in getOption("chat_folder_new_chats_update_period") for the given chat folder @chat_folder_id Chat folder identifier +getChatFolderNewChats chat_folder_id:int32 = Chats; + +//@description Process new chats added to a shareable chat folder by its owner @chat_folder_id Chat folder identifier @added_chat_ids Identifiers of the new chats, which are added to the chat folder. The chats are automatically joined if they aren't joined yet +processChatFolderNewChats chat_folder_id:int32 added_chat_ids:vector = Ok; + +//@description Returns settings for automatic moving of chats to and from the Archive chat lists +getArchiveChatListSettings = ArchiveChatListSettings; + +//@description Changes settings for automatic moving of chats to and from the Archive chat lists @settings New settings +setArchiveChatListSettings settings:archiveChatListSettings = Ok; //@description Changes the chat title. Supported only for basic groups, supergroups and channels. Requires can_change_info administrator right @@ -1088,6 +1142,12 @@ setChatTitle chat_id:int53 title:string = Ok; //@photo New chat photo; pass null to delete the chat photo setChatPhoto chat_id:int53 photo:InputChatPhoto = Ok; +//@description Changes accent color and background custom emoji of a chat. Supported only for channels with getOption("channel_custom_accent_color_boost_level_min") boost level. Requires can_change_info administrator right +//@chat_id Chat identifier +//@accent_color_id Identifier of the accent color to use +//@background_custom_emoji_id Identifier of a custom emoji to be shown on the reply header background; 0 if none +setChatAccentColor chat_id:int53 accent_color_id:int32 background_custom_emoji_id:int64 = Ok; + //@description Changes the message auto-delete or self-destruct (for secret chats) time in a chat. Requires change_info administrator right in basic groups, supergroups and channels //-Message auto-delete time can't be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram). //@chat_id Chat identifier @@ -1099,6 +1159,13 @@ setChatMessageAutoDeleteTime chat_id:int53 message_auto_delete_time:int32 = Ok; //@permissions New non-administrator members permissions in the chat setChatPermissions chat_id:int53 permissions:chatPermissions = Ok; +//@description Changes the background in a specific chat. Supported only in private and secret chats with non-deleted users +//@chat_id Chat identifier +//@background The input background to use; pass null to create a new filled background or to remove the current background +//@type Background type; pass null to remove the current background +//@dark_theme_dimming Dimming of the background in dark themes, as a percentage; 0-100 +setChatBackground chat_id:int53 background:InputBackground type:BackgroundType dark_theme_dimming:int32 = Ok; + //@description Changes the chat theme. Supported only in private and secret chats @chat_id Chat identifier @theme_name Name of the new chat theme; pass an empty string to return the default theme setChatTheme chat_id:int53 theme_name:string = Ok; @@ -1234,7 +1301,7 @@ addSavedNotificationSound sound:InputFile = NotificationSound; removeSavedNotificationSound notification_sound_id:int64 = Ok; -//@description Returns list of chats with non-default notification settings +//@description Returns list of chats with non-default notification settings for new messages //@scope If specified, only chats from the scope will be returned; pass null to return chats from all scopes //@compare_sound Pass true to include in the response chats with only non-default sound getChatNotificationSettingsExceptions scope:NotificationSettingsScope compare_sound:Bool = Chats; @@ -1258,11 +1325,161 @@ toggleChatIsPinned chat_list:ChatList chat_id:int53 is_pinned:Bool = Ok; //@description Changes the order of pinned chats @chat_list Chat list in which to change the order of pinned chats @chat_ids The new list of pinned chats setPinnedChats chat_list:ChatList chat_ids:vector = Ok; +//@description Traverse all chats in a chat list and marks all messages in the chats as read @chat_list Chat list in which to mark all chats as read +readChatList chat_list:ChatList = Ok; + + +//@description Returns a story +//@story_sender_chat_id Identifier of the chat that posted the story +//@story_id Story identifier +//@only_local Pass true to get only locally available information without sending network requests +getStory story_sender_chat_id:int53 story_id:int32 only_local:Bool = Story; + +//@description Returns channel chats in which the current user has the right to post stories. The chats must be rechecked with canSendStory before actually trying to post a story there +getChatsToSendStories = Chats; + +//@description Checks whether the current user can send a story on behalf of a chat; requires can_post_stories rights for channel chats @chat_id Chat identifier +canSendStory chat_id:int53 = CanSendStoryResult; + +//@description Sends a new story to a chat; requires can_post_stories rights for channel chats. Returns a temporary story +//@chat_id Identifier of the chat that will post the story +//@content Content of the story +//@areas Clickable rectangle areas to be shown on the story media; pass null if none +//@caption Story caption; pass null to use an empty caption; 0-getOption("story_caption_length_max") characters +//@privacy_settings The privacy settings for the story +//@active_period Period after which the story is moved to archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 for Telegram Premium users, and 86400 otherwise +//@is_pinned Pass true to keep the story accessible after expiration +//@protect_content Pass true if the content of the story must be protected from forwarding and screenshotting +sendStory chat_id:int53 content:InputStoryContent areas:inputStoryAreas caption:formattedText privacy_settings:StoryPrivacySettings active_period:int32 is_pinned:Bool protect_content:Bool = Story; + +//@description Changes content and caption of a story. Can be called only if story.can_be_edited == true +//@story_sender_chat_id Identifier of the chat that posted the story +//@story_id Identifier of the story to edit +//@content New content of the story; pass null to keep the current content +//@areas New clickable rectangle areas to be shown on the story media; pass null to keep the current areas. Areas can't be edited if story content isn't changed +//@caption New story caption; pass null to keep the current caption +editStory story_sender_chat_id:int53 story_id:int32 content:InputStoryContent areas:inputStoryAreas caption:formattedText = Ok; + +//@description Changes privacy settings of a story. Can be called only if story.can_be_edited == true +//@story_sender_chat_id Identifier of the chat that posted the story +//@story_id Identifier of the story +//@privacy_settings The new privacy settigs for the story +setStoryPrivacySettings story_sender_chat_id:int53 story_id:int32 privacy_settings:StoryPrivacySettings = Ok; + +//@description Toggles whether a story is accessible after expiration. Can be called only if story.can_toggle_is_pinned == true +//@story_sender_chat_id Identifier of the chat that posted the story +//@story_id Identifier of the story +//@is_pinned Pass true to make the story accessible after expiration; pass false to make it private +toggleStoryIsPinned story_sender_chat_id:int53 story_id:int32 is_pinned:Bool = Ok; + +//@description Deletes a previously sent story. Can be called only if story.can_be_deleted == true +//@story_sender_chat_id Identifier of the chat that posted the story +//@story_id Identifier of the story to delete +deleteStory story_sender_chat_id:int53 story_id:int32 = Ok; + +//@description Returns list of chats with non-default notification settings for stories +getStoryNotificationSettingsExceptions = Chats; + +//@description Loads more active stories from a story list. The loaded stories will be sent through updates. Active stories are sorted by +//-the pair (active_stories.order, active_stories.story_sender_chat_id) in descending order. Returns a 404 error if all active stories have been loaded +//@story_list The story list in which to load active stories +loadActiveStories story_list:StoryList = Ok; + +//@description Changes story list in which stories from the chat are shown @chat_id Identifier of the chat that posted stories @story_list New list for active stories posted by the chat +setChatActiveStoriesList chat_id:int53 story_list:StoryList = Ok; + +//@description Returns the list of active stories posted by the given chat @chat_id Chat identifier +getChatActiveStories chat_id:int53 = ChatActiveStories; + +//@description Returns the list of pinned stories posted by the given chat. The stories are returned in a reverse chronological order (i.e., in order of decreasing story_id). +//-For optimal performance, the number of returned stories is chosen by TDLib +//@chat_id Chat identifier +//@from_story_id Identifier of the story starting from which stories must be returned; use 0 to get results from the last story +//@limit The maximum number of stories to be returned +//-For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit +getChatPinnedStories chat_id:int53 from_story_id:int32 limit:int32 = Stories; + +//@description Returns the list of all stories posted by the given chat; requires can_edit_stories rights for channel chats. +//-The stories are returned in a reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of returned stories is chosen by TDLib +//@chat_id Chat identifier +//@from_story_id Identifier of the story starting from which stories must be returned; use 0 to get results from the last story +//@limit The maximum number of stories to be returned +//-For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit +getChatArchivedStories chat_id:int53 from_story_id:int32 limit:int32 = Stories; + +//@description Informs TDLib that a story is opened and is being viewed by the user +//@story_sender_chat_id The identifier of the sender of the opened story +//@story_id The identifier of the story +openStory story_sender_chat_id:int53 story_id:int32 = Ok; + +//@description Informs TDLib that a story is closed by the user +//@story_sender_chat_id The identifier of the sender of the story to close +//@story_id The identifier of the story +closeStory story_sender_chat_id:int53 story_id:int32 = Ok; + +//@description Returns reactions, which can be chosen for a story @row_size Number of reaction per row, 5-25 +getStoryAvailableReactions row_size:int32 = AvailableReactions; + +//@description Changes chosen reaction on a story +//@story_sender_chat_id The identifier of the sender of the story +//@story_id The identifier of the story +//@reaction_type Type of the reaction to set; pass null to remove the reaction. `reactionTypeCustomEmoji` reactions can be used only by Telegram Premium users +//@update_recent_reactions Pass true if the reaction needs to be added to recent reactions +setStoryReaction story_sender_chat_id:int53 story_id:int32 reaction_type:ReactionType update_recent_reactions:Bool = Ok; + +//@description Returns viewers of a story. The method can be called only for stories posted on behalf of the current user +//@story_id Story identifier +//@query Query to search for in names and usernames of the viewers; may be empty to get all relevant viewers +//@only_contacts Pass true to get only contacts; pass false to get all relevant viewers +//@prefer_with_reaction Pass true to get viewers with reaction first; pass false to get viewers sorted just by view_date +//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results +//@limit The maximum number of story viewers to return +getStoryViewers story_id:int32 query:string only_contacts:Bool prefer_with_reaction:Bool offset:string limit:int32 = StoryViewers; + +//@description Reports a story to the Telegram moderators +//@story_sender_chat_id The identifier of the sender of the story to report +//@story_id The identifier of the story to report +//@reason The reason for reporting the story +//@text Additional report details; 0-1024 characters +reportStory story_sender_chat_id:int53 story_id:int32 reason:ReportReason text:string = Ok; + +//@description Activates stealth mode for stories, which hides all views of stories from the current user in the last "story_stealth_mode_past_period" seconds +//-and for the next "story_stealth_mode_future_period" seconds; for Telegram Premium users only +activateStoryStealthMode = Ok; + + +//@description Returns the list of available chat boost slots for the current user +getAvailableChatBoostSlots = ChatBoostSlots; + +//@description Returns the current boost status for a channel chat @chat_id Identifier of the channel chat +getChatBoostStatus chat_id:int53 = ChatBoostStatus; + +//@description Boosts a chat and returns the list of available chat boost slots for the current user after the boost @chat_id Identifier of the chat @slot_ids Identifiers of boost slots of the current user from which to apply boosts to the chat +boostChat chat_id:int53 slot_ids:vector = ChatBoostSlots; + +//@description Returns an HTTPS link to boost the specified channel chat @chat_id Identifier of the chat +getChatBoostLink chat_id:int53 = ChatBoostLink; + +//@description Returns information about a link to boost a chat. Can be called for any internal link of the type internalLinkTypeChatBoost @url The link to boost a chat +getChatBoostLinkInfo url:string = ChatBoostLinkInfo; + +//@description Returns list of boosts applied to a chat; requires administrator rights in the channel chat +//@chat_id Identifier of the chat +//@only_gift_codes Pass true to receive only boosts received from gift codes and giveaways created by the chat +//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results +//@limit The maximum number of boosts to be returned; up to 100. For optimal performance, the number of returned boosts can be smaller than the specified limit +getChatBoosts chat_id:int53 only_gift_codes:Bool offset:string limit:int32 = FoundChatBoosts; + +//@description Returns list of boosts applied to a chat by a given user; requires administrator rights in the channel chat; for bots only +//@chat_id Identifier of the chat +//@user_id Identifier of the user +getUserChatBoosts chat_id:int53 user_id:int53 = FoundChatBoosts; + -//@description Returns information about a bot that can be added to attachment menu @bot_user_id Bot's user identifier +//@description Returns information about a bot that can be added to attachment or side menu @bot_user_id Bot's user identifier getAttachmentMenuBot bot_user_id:int53 = AttachmentMenuBot; -//@description Adds or removes a bot to attachment menu. Bot can be added to attachment menu, only if userTypeBot.can_be_added_to_attachment_menu == true +//@description Adds or removes a bot to attachment and side menu. Bot can be added to the menu, only if userTypeBot.can_be_added_to_attachment_menu == true //@bot_user_id Bot's user identifier //@is_added Pass true to add the bot to attachment menu; pass false to remove the bot from attachment menu //@allow_write_access Pass true if the current user allowed the bot to send them messages. Ignored if is_added is false @@ -1300,7 +1517,7 @@ cancelDownloadFile file_id:int32 only_if_pending:Bool = Ok; getSuggestedFileName file_id:int32 directory:string = Text; //@description Preliminary uploads a file to the cloud before sending it in a message, which can be useful for uploading of being recorded voice and video notes. Updates updateFile will be used -//-to notify about upload progress and successful completion of the upload. The file will not have a persistent remote identifier until it will be sent in a message +//-to notify about upload progress and successful completion of the upload. The file will not have a persistent remote identifier until it is sent in a message //@file File to upload //@file_type File type; pass null if unknown //@priority Priority of the upload (1-32). The higher the priority, the earlier the file will be uploaded. If the priorities of two files are equal, then the first one for which preliminaryUploadFile was called will be uploaded first @@ -1521,7 +1738,7 @@ getGroupCall group_call_id:int32 = GroupCall; //@description Starts a scheduled group call @group_call_id Group call identifier startScheduledGroupCall group_call_id:int32 = Ok; -//@description Toggles whether the current user will receive a notification when the group call will start; scheduled group calls only +//@description Toggles whether the current user will receive a notification when the group call starts; scheduled group calls only //@group_call_id Group call identifier //@enabled_start_notification New value of the enabled_start_notification setting toggleGroupCallEnabledStartNotification group_call_id:int32 enabled_start_notification:Bool = Ok; @@ -1556,7 +1773,7 @@ setGroupCallTitle group_call_id:int32 title:string = Ok; //@mute_new_participants New value of the mute_new_participants setting toggleGroupCallMuteNewParticipants group_call_id:int32 mute_new_participants:Bool = Ok; -//@description Invites users to an active group call. Sends a service message of type messageInviteToGroupCall for video chats +//@description Invites users to an active group call. Sends a service message of type messageInviteVideoChatParticipants for video chats //@group_call_id Group call identifier //@user_ids User identifiers. At most 10 users can be invited simultaneously inviteGroupCallParticipants group_call_id:int32 user_ids:vector = Ok; @@ -1594,7 +1811,7 @@ setGroupCallParticipantIsSpeaking group_call_id:int32 audio_source:int32 is_spea //@description Toggles whether a participant of an active group call is muted, unmuted, or allowed to unmute themselves //@group_call_id Group call identifier //@participant_id Participant identifier -//@is_muted Pass true to mute the user; pass false to unmute the them +//@is_muted Pass true to mute the user; pass false to unmute them toggleGroupCallParticipantIsMuted group_call_id:int32 participant_id:MessageSender is_muted:Bool = Ok; //@description Changes volume level of a participant of an active group call. If the current user can manage the group call, then the participant's volume level will be changed for all users with the default volume level @@ -1632,8 +1849,10 @@ getGroupCallStreams group_call_id:int32 = GroupCallStreams; getGroupCallStreamSegment group_call_id:int32 time_offset:int53 scale:int32 channel_id:int32 video_quality:GroupCallVideoQuality = FilePart; -//@description Changes the block state of a message sender. Currently, only users and supergroup chats can be blocked @sender_id Identifier of a message sender to block/unblock @is_blocked New value of is_blocked -toggleMessageSenderIsBlocked sender_id:MessageSender is_blocked:Bool = Ok; +//@description Changes the block list of a message sender. Currently, only users and supergroup chats can be blocked +//@sender_id Identifier of a message sender to block/unblock +//@block_list New block list for the message sender; pass null to unblock the message sender +setMessageSenderBlockList sender_id:MessageSender block_list:BlockList = Ok; //@description Blocks an original sender of a message in the Replies chat //@message_id The identifier of an incoming message in the Replies chat @@ -1642,8 +1861,11 @@ toggleMessageSenderIsBlocked sender_id:MessageSender is_blocked:Bool = Ok; //@report_spam Pass true to report the sender to the Telegram moderators blockMessageSenderFromReplies message_id:int53 delete_message:Bool delete_all_messages:Bool report_spam:Bool = Ok; -//@description Returns users and chats that were blocked by the current user @offset Number of users and chats to skip in the result; must be non-negative @limit The maximum number of users and chats to return; up to 100 -getBlockedMessageSenders offset:int32 limit:int32 = MessageSenders; +//@description Returns users and chats that were blocked by the current user +//@block_list Block list from which to return users +//@offset Number of users and chats to skip in the result; must be non-negative +//@limit The maximum number of users and chats to return; up to 100 +getBlockedMessageSenders block_list:BlockList offset:int32 limit:int32 = MessageSenders; //@description Adds a user to the contact list or edits an existing contact by their user identifier @@ -1655,7 +1877,7 @@ addContact contact:contact share_phone_number:Bool = Ok; //@description Adds new contacts or edits existing contacts by their phone numbers; contacts' user identifiers are ignored @contacts The list of contacts to import or edit; contacts' vCard are ignored and are not imported importContacts contacts:vector = ImportedContacts; -//@description Returns all user contacts +//@description Returns all contacts of the user getContacts = Users; //@description Searches for the specified query in the first names, last names and usernames of the known user contacts @@ -1677,6 +1899,12 @@ changeImportedContacts contacts:vector = ImportedContacts; //@description Clears all imported contacts, contact list remains unchanged clearImportedContacts = Ok; +//@description Changes the list of close friends of the current user @user_ids User identifiers of close friends; the users must be contacts of the current user +setCloseFriends user_ids:vector = Ok; + +//@description Returns all close friends of the current user +getCloseFriends = Users; + //@description Changes a personal profile photo of a contact user @user_id User identifier @photo Profile photo to set; pass null to delete the photo; inputChatPhotoPrevious isn't supported in this function setUserPersonalProfilePhoto user_id:int53 photo:InputChatPhoto = Ok; @@ -1702,6 +1930,13 @@ getUserProfilePhotos user_id:int53 offset:int32 limit:int32 = ChatPhotos; //@chat_id Chat identifier for which to return stickers. Available custom emoji stickers may be different for different chats getStickers sticker_type:StickerType query:string limit:int32 chat_id:int53 = Stickers; +//@description Returns unique emoji that correspond to stickers to be found by the getStickers(sticker_type, query, 1000000, chat_id) +//@sticker_type Type of the stickers to search for +//@query Search query +//@chat_id Chat identifier for which to find stickers +//@return_only_main_emoji Pass true if only main emoji for each found sticker must be included in the result +getAllStickerEmojis sticker_type:StickerType query:string chat_id:int53 return_only_main_emoji:Bool = Emojis; + //@description Searches for stickers from public sticker sets that correspond to any of the given emoji //@sticker_type Type of the stickers to return //@emojis Space-separated list of emoji to search for; must be non-empty @@ -1800,6 +2035,9 @@ getDefaultChatPhotoCustomEmojiStickers = Stickers; //@description Returns default list of custom emoji stickers for placing on a profile photo getDefaultProfilePhotoCustomEmojiStickers = Stickers; +//@description Returns default list of custom emoji stickers for reply background +getDefaultBackgroundCustomEmojiStickers = Stickers; + //@description Returns saved animations getSavedAnimations = Animations; @@ -1823,8 +2061,10 @@ searchHashtags prefix:string limit:int32 = Hashtags; removeRecentHashtag hashtag:string = Ok; -//@description Returns a web page preview by the text of the message. Do not call this function too often. Returns a 404 error if the web page has no preview @text Message text with formatting -getWebPagePreview text:formattedText = WebPage; +//@description Returns a link preview by the text of a message. Do not call this function too often. Returns a 404 error if the text has no link preview +//@text Message text with formatting +//@link_preview_options Options to be used for generation of the link preview; pass null to use default link preview options +getWebPagePreview text:formattedText link_preview_options:linkPreviewOptions = WebPage; //@description Returns an instant view version of a web page if available. Returns a 404 error if the web page has no instant view page @url The web page URL @force_full Pass true to get full instant view for the web page getWebPageInstantView url:string force_full:Bool = WebPageInstantView; @@ -1838,6 +2078,11 @@ setProfilePhoto photo:InputChatPhoto is_public:Bool = Ok; //@description Deletes a profile photo @profile_photo_id Identifier of the profile photo to delete deleteProfilePhoto profile_photo_id:int64 = Ok; +//@description Changes accent color and background custom emoji for the current user; for Telegram Premium users only +//@accent_color_id Identifier of the accent color to use +//@background_custom_emoji_id Identifier of a custom emoji to be shown on the reply header background; 0 if none +setAccentColor accent_color_id:int32 background_custom_emoji_id:int64 = Ok; + //@description Changes the first and last name of the current user @first_name The new value of the first name for the current user; 1-64 characters @last_name The new value of the optional last name for the current user; 0-64 characters setName first_name:string last_name:string = Ok; @@ -1856,15 +2101,13 @@ toggleUsernameIsActive username:string is_active:Bool = Ok; //@description Changes order of active usernames of the current user @usernames The new order of active usernames. All currently active usernames must be specified reorderActiveUsernames usernames:vector = Ok; -//@description Changes the emoji status of the current user; for Telegram Premium users only -//@emoji_status New emoji status; pass null to switch to the default badge -//@duration Duration of the status, in seconds; pass 0 to keep the status active until it will be changed manually -setEmojiStatus emoji_status:emojiStatus duration:int32 = Ok; +//@description Changes the emoji status of the current user; for Telegram Premium users only @emoji_status New emoji status; pass null to switch to the default badge +setEmojiStatus emoji_status:emojiStatus = Ok; //@description Changes the location of the current user. Needs to be called if getOption("is_location_visible") is true and location changes for more than 1 kilometer @location The new location of the user setLocation location:location = Ok; -//@description Changes the phone number of the user and sends an authentication code to the user's new phone number. On success, returns information about the sent code +//@description Changes the phone number of the user and sends an authentication code to the user's new phone number; for official Android and iOS applications only. On success, returns information about the sent code //@phone_number The new phone number of the user in international format //@settings Settings for the authentication of the user's phone number; pass null to use default settings changePhoneNumber phone_number:string settings:phoneNumberAuthenticationSettings = AuthenticationCodeInfo; @@ -1907,30 +2150,70 @@ setMenuButton user_id:int53 menu_button:botMenuButton = Ok; //@description Returns menu button set by the bot for the given user; for bots only @user_id Identifier of the user or 0 to get the default menu button getMenuButton user_id:int53 = BotMenuButton; -//@description Sets default administrator rights for adding the bot to basic group and supergroup chats; for bots only @default_group_administrator_rights Default administrator rights for adding the bot to basic group and supergroup chats; may be null +//@description Sets default administrator rights for adding the bot to basic group and supergroup chats; for bots only @default_group_administrator_rights Default administrator rights for adding the bot to basic group and supergroup chats; pass null to remove default rights setDefaultGroupAdministratorRights default_group_administrator_rights:chatAdministratorRights = Ok; -//@description Sets default administrator rights for adding the bot to channel chats; for bots only @default_channel_administrator_rights Default administrator rights for adding the bot to channels; may be null +//@description Sets default administrator rights for adding the bot to channel chats; for bots only @default_channel_administrator_rights Default administrator rights for adding the bot to channels; pass null to remove default rights setDefaultChannelAdministratorRights default_channel_administrator_rights:chatAdministratorRights = Ok; -//@description Sets the text shown in the chat with the bot if the chat is empty; bots only -//@language_code A two-letter ISO 639-1 language code. If empty, the description will be shown to all users, for which language there are no dedicated description +//@description Checks whether the specified bot can send messages to the user. Returns a 404 error if can't and the access can be granted by call to allowBotToSendMessages @bot_user_id Identifier of the target bot +canBotSendMessages bot_user_id:int53 = Ok; + +//@description Allows the specified bot to send messages to the user @bot_user_id Identifier of the target bot +allowBotToSendMessages bot_user_id:int53 = Ok; + +//@description Sends a custom request from a Web App +//@bot_user_id Identifier of the bot +//@method The method name +//@parameters JSON-serialized method parameters +sendWebAppCustomRequest bot_user_id:int53 method:string parameters:string = CustomRequestResult; + + +//@description Sets the name of a bot. Can be called only if userTypeBot.can_be_edited == true +//@bot_user_id Identifier of the target bot +//@language_code A two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose languages there is no dedicated name +//@name New bot's name on the specified language; 0-64 characters; must be non-empty if language code is empty +setBotName bot_user_id:int53 language_code:string name:string = Ok; + +//@description Returns the name of a bot in the given language. Can be called only if userTypeBot.can_be_edited == true +//@bot_user_id Identifier of the target bot +//@language_code A two-letter ISO 639-1 language code or an empty string +getBotName bot_user_id:int53 language_code:string = Text; + +//@description Changes a profile photo for a bot @bot_user_id Identifier of the target bot @photo Profile photo to set; pass null to delete the chat photo +setBotProfilePhoto bot_user_id:int53 photo:InputChatPhoto = Ok; + +//@description Changes active state for a username of a bot. The editable username can't be disabled. May return an error with a message "USERNAMES_ACTIVE_TOO_MUCH" if the maximum number of active usernames has been reached. Can be called only if userTypeBot.can_be_edited == true +//@bot_user_id Identifier of the target bot +//@username The username to change +//@is_active Pass true to activate the username; pass false to disable it +toggleBotUsernameIsActive bot_user_id:int53 username:string is_active:Bool = Ok; + +//@description Changes order of active usernames of a bot. Can be called only if userTypeBot.can_be_edited == true @bot_user_id Identifier of the target bot @usernames The new order of active usernames. All currently active usernames must be specified +reorderBotActiveUsernames bot_user_id:int53 usernames:vector = Ok; + +//@description Sets the text shown in the chat with a bot if the chat is empty. Can be called only if userTypeBot.can_be_edited == true +//@bot_user_id Identifier of the target bot +//@language_code A two-letter ISO 639-1 language code. If empty, the description will be shown to all users for whose languages there is no dedicated description //@param_description New bot's description on the specified language -setBotInfoDescription language_code:string description:string = Ok; +setBotInfoDescription bot_user_id:int53 language_code:string description:string = Ok; -//@description Returns the text shown in the chat with the bot if the chat is empty in the given language; bots only +//@description Returns the text shown in the chat with a bot if the chat is empty in the given language. Can be called only if userTypeBot.can_be_edited == true +//@bot_user_id Identifier of the target bot //@language_code A two-letter ISO 639-1 language code or an empty string -getBotInfoDescription language_code:string = Text; +getBotInfoDescription bot_user_id:int53 language_code:string = Text; -//@description Sets the text shown on the bot's profile page and sent together with the link when users share the bot; bots only -//@language_code A two-letter ISO 639-1 language code. If empty, the short description will be shown to all users, for which language there are no dedicated description +//@description Sets the text shown on a bot's profile page and sent together with the link when users share the bot. Can be called only if userTypeBot.can_be_edited == true +//@bot_user_id Identifier of the target bot +//@language_code A two-letter ISO 639-1 language code. If empty, the short description will be shown to all users for whose languages there is no dedicated description //@short_description New bot's short description on the specified language -setBotInfoShortDescription language_code:string short_description:string = Ok; +setBotInfoShortDescription bot_user_id:int53 language_code:string short_description:string = Ok; -//@description Returns the text shown on the bot's profile page and sent together with the link when users share the bot in the given language; bots only +//@description Returns the text shown on a bot's profile page and sent together with the link when users share the bot in the given language. Can be called only if userTypeBot.can_be_edited == true +//@bot_user_id Identifier of the target bot //@language_code A two-letter ISO 639-1 language code or an empty string -getBotInfoShortDescription language_code:string = Text; +getBotInfoShortDescription bot_user_id:int53 language_code:string = Text; //@description Returns all active sessions of the current user @@ -1942,6 +2225,9 @@ terminateSession session_id:int64 = Ok; //@description Terminates all other sessions of the current user terminateAllOtherSessions = Ok; +//@description Confirms an unconfirmed session of the current user from another device @session_id Session identifier +confirmSession session_id:int64 = Ok; + //@description Toggles whether a session can accept incoming calls @session_id Session identifier @can_accept_calls Pass true to allow accepting incoming calls by the session; pass false otherwise toggleSessionCanAcceptCalls session_id:int64 can_accept_calls:Bool = Ok; @@ -2041,7 +2327,7 @@ closeSecretChat secret_chat_id:int32 = Ok; getChatEventLog chat_id:int53 query:string from_event_id:int64 limit:int32 filters:chatEventLogFilters user_ids:vector = ChatEvents; -//@description Returns an invoice payment form. This method must be called when the user presses inlineKeyboardButtonBuy +//@description Returns an invoice payment form. This method must be called when the user presses inline button of the type inlineKeyboardButtonTypeBuy //@input_invoice The invoice //@theme Preferred payment form theme; pass null to use the default theme getPaymentForm input_invoice:InputInvoice theme:themeParameters = PaymentForm; @@ -2092,7 +2378,7 @@ getBackgroundUrl name:string type:BackgroundType = HttpUrl; searchBackground name:string = Background; //@description Changes the background selected by the user; adds background to the list of installed backgrounds -//@background The input background to use; pass null to create a new filled backgrounds or to remove the current background +//@background The input background to use; pass null to create a new filled background or to remove the current background //@type Background type; pass null to use the default type of the remote background or to remove the current background //@for_dark_theme Pass true if the background is changed for a dark theme setBackground background:InputBackground type:BackgroundType for_dark_theme:Bool = Background; @@ -2115,14 +2401,16 @@ getLanguagePackInfo language_pack_id:string = LanguagePackInfo; //@keys Language pack keys of the strings to be returned; leave empty to request all available strings getLanguagePackStrings language_pack_id:string keys:vector = LanguagePackStrings; -//@description Fetches the latest versions of all strings from a language pack in the current localization target from the server. This method doesn't need to be called explicitly for the current used/base language packs. Can be called before authorization @language_pack_id Language pack identifier +//@description Fetches the latest versions of all strings from a language pack in the current localization target from the server. +//-This method doesn't need to be called explicitly for the current used/base language packs. Can be called before authorization +//@language_pack_id Language pack identifier synchronizeLanguagePack language_pack_id:string = Ok; //@description Adds a custom server language pack to the list of installed language packs in current localization target. Can be called before authorization @language_pack_id Identifier of a language pack to be added addCustomServerLanguagePack language_pack_id:string = Ok; //@description Adds or changes a custom local language pack to the current localization target -//@info Information about the language pack. Language pack ID must start with 'X', consist only of English letters, digits and hyphens, and must not exceed 64 characters. Can be called before authorization +//@info Information about the language pack. Language pack identifier must start with 'X', consist only of English letters, digits and hyphens, and must not exceed 64 characters. Can be called before authorization //@strings Strings of the new language pack setCustomLanguagePack info:languagePackInfo strings:vector = Ok; @@ -2198,14 +2486,14 @@ removeChatActionBar chat_id:int53 = Ok; //@message_ids Identifiers of reported messages; may be empty to report the whole chat //@reason The reason for reporting the chat //@text Additional report details; 0-1024 characters -reportChat chat_id:int53 message_ids:vector reason:ChatReportReason text:string = Ok; +reportChat chat_id:int53 message_ids:vector reason:ReportReason text:string = Ok; //@description Reports a chat photo to the Telegram moderators. A chat photo can be reported only if chat.can_be_reported //@chat_id Chat identifier //@file_id Identifier of the photo to report. Only full photos from chatPhoto can be reported //@reason The reason for reporting the chat photo //@text Additional report details; 0-1024 characters -reportChatPhoto chat_id:int53 file_id:int32 reason:ChatReportReason text:string = Ok; +reportChatPhoto chat_id:int53 file_id:int32 reason:ReportReason text:string = Ok; //@description Reports reactions set on a message to the Telegram moderators. Reactions on a message can be reported only if message.can_report_reactions //@chat_id Chat identifier @@ -2220,6 +2508,13 @@ getChatStatistics chat_id:int53 is_dark:Bool = ChatStatistics; //@description Returns detailed statistics about a message. Can be used only if message.can_get_statistics == true @chat_id Chat identifier @message_id Message identifier @is_dark Pass true if a dark theme is used by the application getMessageStatistics chat_id:int53 message_id:int53 is_dark:Bool = MessageStatistics; +//@description Returns forwarded copies of a channel message to different public channels. Can be used only if message.can_get_statistics == true. For optimal performance, the number of returned messages is chosen by TDLib +//@chat_id Chat identifier of the message +//@message_id Message identifier +//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results +//@limit The maximum number of messages to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit +getMessagePublicForwards chat_id:int53 message_id:int53 offset:string limit:int32 = FoundMessages; + //@description Loads an asynchronous or a zoomed in statistical graph @chat_id Chat identifier @token The token for graph loading @x X-value for zoomed in graph or 0 otherwise getStatisticalGraph chat_id:int53 token:string x:int53 = StatisticalGraph; @@ -2460,6 +2755,26 @@ clickPremiumSubscriptionButton = Ok; //@description Returns state of Telegram Premium subscription and promotion videos for Premium features getPremiumState = PremiumState; +//@description Returns available options for Telegram Premium gift code or giveaway creation +//@boosted_chat_id Identifier of the channel chat, which will be automatically boosted by receivers of the gift codes and which is administered by the user; 0 if none +getPremiumGiftCodePaymentOptions boosted_chat_id:int53 = PremiumGiftCodePaymentOptions; + +//@description Return information about a Telegram Premium gift code @code The code to check +checkPremiumGiftCode code:string = PremiumGiftCodeInfo; + +//@description Applies a Telegram Premium gift code @code The code to apply +applyPremiumGiftCode code:string = Ok; + +//@description Launches a prepaid Telegram Premium giveaway for subscribers of channel chats; requires can_post_messages rights in the channels +//@giveaway_id Unique identifier of the prepaid giveaway +//@parameters Giveaway parameters +launchPrepaidPremiumGiveaway giveaway_id:int64 parameters:premiumGiveawayParameters = Ok; + +//@description Returns information about a Telegram Premium giveaway +//@chat_id Identifier of the channel chat which started the giveaway +//@message_id Identifier of the giveaway message in the chat +getPremiumGiveawayInfo chat_id:int53 message_id:int53 = PremiumGiveawayInfo; + //@description Checks whether Telegram Premium purchase is possible. Must be called before in-store Premium purchase @purpose Transaction purpose canPurchasePremium purpose:StorePaymentPurpose = Ok; @@ -2478,6 +2793,14 @@ assignGooglePlayTransaction package_name:string store_product_id:string purchase acceptTermsOfService terms_of_service_id:string = Ok; +//@description Searches specified query by word prefixes in the provided strings. Returns 0-based positions of strings that matched. Can be called synchronously +//@strings The strings to search in for the query +//@query Query to search for +//@limit The maximum number of objects to return +//@return_none_for_empty_query Pass true to receive no results for an empty query +searchStringsByPrefix strings:vector query:string limit:int32 return_none_for_empty_query:Bool = FoundPositions; + + //@description Sends a custom request; for bots only @method The method name @parameters JSON-serialized method parameters sendCustomRequest method:string parameters:string = CustomRequestResult; @@ -2511,7 +2834,7 @@ getDeepLinkInfo link:string = DeepLinkInfo; //@description Returns application config, provided by the server. Can be called before authorization getApplicationConfig = JsonValue; -//@description Adds server-provided application changelog as messages to the chat 777000 (Telegram); for official applications only. Returns a 404 error if nothing changed @previous_application_version The previous application version +//@description Adds server-provided application changelog as messages to the chat 777000 (Telegram) or as a stories; for official applications only. Returns a 404 error if nothing changed @previous_application_version The previous application version addApplicationChangelog previous_application_version:string = Ok; //@description Saves application log event on the server. Can be called before authorization @type Event type @chat_id Optional chat identifier, associated with the event @data The log event data @@ -2522,7 +2845,7 @@ getApplicationDownloadLink = HttpUrl; //@description Adds a proxy server for network requests. Can be called before authorization -//@server Proxy server IP address +//@server Proxy server domain or IP address //@port Proxy server port //@enable Pass true to immediately enable the proxy //@type Proxy type @@ -2530,7 +2853,7 @@ addProxy server:string port:int32 enable:Bool type:ProxyType = Proxy; //@description Edits an existing proxy server for network requests. Can be called before authorization //@proxy_id Proxy identifier -//@server Proxy server IP address +//@server Proxy server domain or IP address //@port Proxy server port //@enable Pass true to immediately enable the proxy //@type Proxy type @@ -2624,7 +2947,7 @@ testSquareInt x:int32 = TestInt; testNetwork = Ok; //@description Sends a simple network request to the Telegram servers via proxy; for testing only. Can be called before authorization -//@server Proxy server IP address +//@server Proxy server domain or IP address //@port Proxy server port //@type Proxy type //@dc_id Identifier of a datacenter with which to test connection diff --git a/TdLib.CodeGen/Types.tl b/TdLib.CodeGen/Types.tl index 6abe43c7..2698993a 100644 --- a/TdLib.CodeGen/Types.tl +++ b/TdLib.CodeGen/Types.tl @@ -1,4 +1,4 @@ -double ? = Double; +double ? = Double; string ? = String; int32 = Int32; @@ -105,7 +105,7 @@ textEntity offset:int32 length:int32 type:TextEntityType = TextEntity; textEntities entities:vector = TextEntities; //@description A text with some entities @text The text @entities Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. -//-Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and can be part of any other entities. All other entities can't contain each other +//-Pre, Code and PreCode entities can't contain other entities. BlockQuote entities can't contain other BlockQuote entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and can be part of any other entities. All other entities can't contain each other formattedText text:string entities:vector = FormattedText; @@ -195,7 +195,7 @@ localFile path:string can_be_downloaded:Bool can_be_deleted:Bool is_downloading_ //@description Represents a remote file //@id Remote file identifier; may be empty. Can be used by the current user across application restarts or even from other devices. Uniquely identifies a file, but a file can have a lot of different valid identifiers. -//-If the ID starts with "http://" or "https://", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. +//-If the identifier starts with "http://" or "https://", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. //-If downloadFile/addFileToDownloads is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the application with the HTTP URL in the original_path and "#url#" as the conversion string. //-Application must generate the file by downloading it to the specified location //@unique_id Unique file identifier; may be empty if unknown. The unique file identifier which is the same for the same file even for different users and is persistent over time @@ -215,10 +215,10 @@ file id:int32 size:int53 expected_size:int53 local:localFile remote:remoteFile = //@class InputFile @description Points to a file -//@description A file defined by its unique ID @id Unique file identifier +//@description A file defined by its unique identifier @id Unique file identifier inputFileId id:int32 = InputFile; -//@description A file defined by its remote ID. The remote ID is guaranteed to be usable only if the corresponding file is still accessible to the user and known to TDLib. +//@description A file defined by its remote identifier. The remote identifier is guaranteed to be usable only if the corresponding file is still accessible to the user and known to TDLib. //-For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the application //@id Remote file identifier inputFileRemote id:string = InputFile; @@ -250,7 +250,7 @@ minithumbnail width:int32 height:int32 data:bytes = Minithumbnail; //@description The thumbnail is in JPEG format thumbnailFormatJpeg = ThumbnailFormat; -//@description The thumbnail is in static GIF format. It will be used only for some bot inline results +//@description The thumbnail is in static GIF format. It will be used only for some bot inline query results thumbnailFormatGif = ThumbnailFormat; //@description The thumbnail is in MPEG4 format. It will be used only for some animations and videos @@ -401,7 +401,7 @@ photo has_stickers:Bool minithumbnail:minithumbnail sizes:vector = Ph //@description Describes a sticker //@id Unique sticker identifier within the set; 0 if none -//@set_id The identifier of the sticker set to which the sticker belongs; 0 if none +//@set_id Identifier of the sticker set to which the sticker belongs; 0 if none //@width Sticker width; as defined by the sender //@height Sticker height; as defined by the sender //@emoji Emoji corresponding to the sticker @@ -497,13 +497,29 @@ webApp short_name:string title:string description:string photo:photo animation:a //@question Poll question; 1-300 characters //@options List of poll answer options //@total_voter_count Total number of voters, participating in the poll -//@recent_voter_user_ids User identifiers of recent voters, if the poll is non-anonymous +//@recent_voter_ids Identifiers of recent voters, if the poll is non-anonymous //@is_anonymous True, if the poll is anonymous //@type Type of the poll //@open_period Amount of time the poll will be active after creation, in seconds //@close_date Point in time (Unix timestamp) when the poll will automatically be closed //@is_closed True, if the poll is closed -poll id:int64 question:string options:vector total_voter_count:int32 recent_voter_user_ids:vector is_anonymous:Bool type:PollType open_period:int32 close_date:int32 is_closed:Bool = Poll; +poll id:int64 question:string options:vector total_voter_count:int32 recent_voter_ids:vector is_anonymous:Bool type:PollType open_period:int32 close_date:int32 is_closed:Bool = Poll; + + +//@description Describes a chat background +//@id Unique background identifier +//@is_default True, if this is one of default backgrounds +//@is_dark True, if the background is dark and is recommended to be used with dark theme +//@name Unique background name +//@document Document with the background; may be null. Null only for filled backgrounds +//@type Type of the background +background id:int64 is_default:Bool is_dark:Bool name:string document:document type:BackgroundType = Background; + +//@description Contains a list of backgrounds @backgrounds A list of backgrounds +backgrounds backgrounds:vector = Backgrounds; + +//@description Describes a background set for a specific chat @background The background @dark_theme_dimming Dimming of the background in dark themes, as a percentage; 0-100 +chatBackground background:background dark_theme_dimming:int32 = ChatBackground; //@description Describes a user profile photo @@ -533,13 +549,14 @@ userTypeRegular = UserType; userTypeDeleted = UserType; //@description A bot (see https://core.telegram.org/bots) +//@can_be_edited True, if the bot is owned by the current user and can be edited using the methods toggleBotUsernameIsActive, reorderBotActiveUsernames, setBotProfilePhoto, setBotName, setBotInfoDescription, and setBotInfoShortDescription //@can_join_groups True, if the bot can be invited to basic group and supergroup chats //@can_read_all_group_messages True, if the bot can read all messages in basic group or supergroup chats and not just those addressed to the bot. In private and channel chats a bot can always read all messages //@is_inline True, if the bot supports inline queries //@inline_query_placeholder Placeholder for inline queries (displayed on the application input field) //@need_location True, if the location of the user is expected to be sent with every inline query to this bot -//@can_be_added_to_attachment_menu True, if the bot can be added to attachment menu -userTypeBot can_join_groups:Bool can_read_all_group_messages:Bool is_inline:Bool inline_query_placeholder:string need_location:Bool can_be_added_to_attachment_menu:Bool = UserType; +//@can_be_added_to_attachment_menu True, if the bot can be added to attachment or side menu +userTypeBot can_be_edited:Bool can_join_groups:Bool can_read_all_group_messages:Bool is_inline:Bool inline_query_placeholder:string need_location:Bool can_be_added_to_attachment_menu:Bool = UserType; //@description No information on the user besides the user identifier is available, yet this user has not been deleted. This object is extremely rare and must be handled like a deleted user. It is not possible to perform any actions on users of this type userTypeUnknown = UserType; @@ -615,11 +632,11 @@ inputChatPhotoSticker sticker:chatPhotoSticker = InputChatPhoto; //@description Describes actions that a user is allowed to take in a chat -//@can_send_basic_messages True, if the user can send text messages, contacts, invoices, locations, and venues +//@can_send_basic_messages True, if the user can send text messages, contacts, giveaways, invoices, locations, and venues //@can_send_audios True, if the user can send music files //@can_send_documents True, if the user can send documents -//@can_send_photos True, if the user can send audio photos -//@can_send_videos True, if the user can send audio videos +//@can_send_photos True, if the user can send photos +//@can_send_videos True, if the user can send videos //@can_send_video_notes True, if the user can send video notes //@can_send_voice_notes True, if the user can send voice notes //@can_send_polls True, if the user can send polls @@ -632,19 +649,22 @@ inputChatPhotoSticker sticker:chatPhotoSticker = InputChatPhoto; chatPermissions can_send_basic_messages:Bool can_send_audios:Bool can_send_documents:Bool can_send_photos:Bool can_send_videos:Bool can_send_video_notes:Bool can_send_voice_notes:Bool can_send_polls:Bool can_send_other_messages:Bool can_add_web_page_previews:Bool can_change_info:Bool can_invite_users:Bool can_pin_messages:Bool can_manage_topics:Bool = ChatPermissions; //@description Describes rights of the administrator -//@can_manage_chat True, if the administrator can get chat event log, get chat statistics, get message statistics in channels, get channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only +//@can_manage_chat True, if the administrator can get chat event log, get chat boosts in channels, get channel members, report supergroup spam messages, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only //@can_change_info True, if the administrator can change the chat title, photo, and other settings -//@can_post_messages True, if the administrator can create channel posts; applicable to channels only +//@can_post_messages True, if the administrator can create channel posts or view channel statistics; applicable to channels only //@can_edit_messages True, if the administrator can edit messages of other users and pin messages; applicable to channels only //@can_delete_messages True, if the administrator can delete messages of other users //@can_invite_users True, if the administrator can invite new users to the chat -//@can_restrict_members True, if the administrator can restrict, ban, or unban chat members; always true for channels +//@can_restrict_members True, if the administrator can restrict, ban, or unban chat members or view supergroup statistics; always true for channels //@can_pin_messages True, if the administrator can pin messages; applicable to basic groups and supergroups only //@can_manage_topics True, if the administrator can manage topics; applicable to forum supergroups only //@can_promote_members True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that were directly or indirectly promoted by them //@can_manage_video_chats True, if the administrator can manage video chats +//@can_post_stories True, if the administrator can create new channel stories, or edit and delete posted stories; applicable to channels only +//@can_edit_stories True, if the administrator can edit stories posted by other users, pin stories and access story archive; applicable to channels only +//@can_delete_stories True, if the administrator can delete stories posted by other users; applicable to channels only //@is_anonymous True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only -chatAdministratorRights can_manage_chat:Bool can_change_info:Bool can_post_messages:Bool can_edit_messages:Bool can_delete_messages:Bool can_invite_users:Bool can_restrict_members:Bool can_pin_messages:Bool can_manage_topics:Bool can_promote_members:Bool can_manage_video_chats:Bool is_anonymous:Bool = ChatAdministratorRights; +chatAdministratorRights can_manage_chat:Bool can_change_info:Bool can_post_messages:Bool can_edit_messages:Bool can_delete_messages:Bool can_invite_users:Bool can_restrict_members:Bool can_pin_messages:Bool can_manage_topics:Bool can_promote_members:Bool can_manage_video_chats:Bool can_post_stories:Bool can_edit_stories:Bool can_delete_stories:Bool is_anonymous:Bool = ChatAdministratorRights; //@description Describes an option for buying Telegram Premium to a user @@ -663,18 +683,86 @@ premiumPaymentOption currency:string amount:int53 discount_percentage:int32 mont //@last_transaction_id Identifier of the last in-store transaction for the currently used option premiumStatePaymentOption payment_option:premiumPaymentOption is_current:Bool is_upgrade:Bool last_transaction_id:string = PremiumStatePaymentOption; +//@description Describes an option for creating Telegram Premium gift codes +//@currency ISO 4217 currency code for Telegram Premium gift code payment +//@amount The amount to pay, in the smallest units of the currency +//@user_count Number of users which will be able to activate the gift codes +//@month_count Number of month the Telegram Premium subscription will be active +//@store_product_id Identifier of the store product associated with the option; may be empty if none +//@store_product_quantity Number of times the store product must be paid +premiumGiftCodePaymentOption currency:string amount:int53 user_count:int32 month_count:int32 store_product_id:string store_product_quantity:int32 = PremiumGiftCodePaymentOption; + +//@description Contains a list of options for creating Telegram Premium gift codes @options The list of options +premiumGiftCodePaymentOptions options:vector = PremiumGiftCodePaymentOptions; + +//@description Contains information about a Telegram Premium gift code +//@creator_id Identifier of a chat or a user that created the gift code +//@creation_date Point in time (Unix timestamp) when the code was created +//@is_from_giveaway True, if the gift code was created for a giveaway +//@giveaway_message_id Identifier of the corresponding giveaway message in the creator_id chat; can be 0 or an identifier of a deleted message +//@month_count Number of month the Telegram Premium subscription will be active after code activation +//@user_id Identifier of a user for which the code was created; 0 if none +//@use_date Point in time (Unix timestamp) when the code was activated; 0 if none +premiumGiftCodeInfo creator_id:MessageSender creation_date:int32 is_from_giveaway:Bool giveaway_message_id:int53 month_count:int32 user_id:int53 use_date:int32 = PremiumGiftCodeInfo; + + +//@class PremiumGiveawayParticipantStatus @description Contains information about status of a user in a Telegram Premium giveaway + +//@description The user is eligible for the giveaway +premiumGiveawayParticipantStatusEligible = PremiumGiveawayParticipantStatus; + +//@description The user participates in the giveaway +premiumGiveawayParticipantStatusParticipating = PremiumGiveawayParticipantStatus; + +//@description The user can't participate in the giveaway, because they have already been member of the chat +//@joined_chat_date Point in time (Unix timestamp) when the user joined the chat +premiumGiveawayParticipantStatusAlreadyWasMember joined_chat_date:int32 = PremiumGiveawayParticipantStatus; + +//@description The user can't participate in the giveaway, because they are an administrator in one of the chats that created the giveaway @chat_id Identifier of the chat administered by the user +premiumGiveawayParticipantStatusAdministrator chat_id:int53 = PremiumGiveawayParticipantStatus; + +//@description The user can't participate in the giveaway, because they phone number is from a disallowed country @user_country_code A two-letter ISO 3166-1 alpha-2 country code of the user's country +premiumGiveawayParticipantStatusDisallowedCountry user_country_code:string = PremiumGiveawayParticipantStatus; + + +//@class PremiumGiveawayInfo @description Contains information about Telegram Premium giveaway + +//@description Describes an ongoing giveaway +//@creation_date Point in time (Unix timestamp) when the giveaway was created +//@status Status of the current user in the giveaway +//@is_ended True, if the giveaway has ended and results are being prepared +premiumGiveawayInfoOngoing creation_date:int32 status:PremiumGiveawayParticipantStatus is_ended:Bool = PremiumGiveawayInfo; + +//@description Describes a completed giveaway +//@creation_date Point in time (Unix timestamp) when the giveaway was created +//@actual_winners_selection_date Point in time (Unix timestamp) when the winners were selected. May be bigger than winners selection date specified in parameters of the giveaway +//@was_refunded True, if the giveaway was canceled and was fully refunded +//@winner_count Number of winners in the giveaway +//@activation_count Number of winners, which activated their gift codes +//@gift_code Telegram Premium gift code that was received by the current user; empty if the user isn't a winner in the giveaway +premiumGiveawayInfoCompleted creation_date:int32 actual_winners_selection_date:int32 was_refunded:Bool winner_count:int32 activation_count:int32 gift_code:string = PremiumGiveawayInfo; + -//@description Describes a custom emoji to be shown instead of the Telegram Premium badge @custom_emoji_id Identifier of the custom emoji in stickerFormatTgs format -emojiStatus custom_emoji_id:int64 = EmojiStatus; +//@description Contains information about supported accent color for user/chat name, background of empty chat photo, replies to messages and link previews +//@id Accent color identifier +//@built_in_accent_color_id Identifier of a built-in color to use in places, where only one color is needed; 0-6 +//@light_theme_colors The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in light themes +//@dark_theme_colors The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in dark themes +accentColor id:int32 built_in_accent_color_id:int32 light_theme_colors:vector dark_theme_colors:vector = AccentColor; -//@description Contains a list of emoji statuses @emoji_statuses The list of emoji statuses -emojiStatuses emoji_statuses:vector = EmojiStatuses; +//@description Describes a custom emoji to be shown instead of the Telegram Premium badge +//@custom_emoji_id Identifier of the custom emoji in stickerFormatTgs format +//@expiration_date Point in time (Unix timestamp) when the status will expire; 0 if never +emojiStatus custom_emoji_id:int64 expiration_date:int32 = EmojiStatus; + +//@description Contains a list of custom emoji identifiers, which can be set as emoji statuses @custom_emoji_ids The list of custom emoji identifiers +emojiStatuses custom_emoji_ids:vector = EmojiStatuses; //@description Describes usernames assigned to a user, a supergroup, or a channel -//@active_usernames List of active usernames; the first one must be shown as the primary username. The order of active usernames can be changed with reorderActiveUsernames or reorderSupergroupActiveUsernames -//@disabled_usernames List of currently disabled usernames; the username can be activated with toggleUsernameIsActive/toggleSupergroupUsernameIsActive -//@editable_username The active username, which can be changed with setUsername/setSupergroupUsername +//@active_usernames List of active usernames; the first one must be shown as the primary username. The order of active usernames can be changed with reorderActiveUsernames, reorderBotActiveUsernames or reorderSupergroupActiveUsernames +//@disabled_usernames List of currently disabled usernames; the username can be activated with toggleUsernameIsActive, toggleBotUsernameIsActive, or toggleSupergroupUsernameIsActive +//@editable_username The active username, which can be changed with setUsername or setSupergroupUsername usernames active_usernames:vector disabled_usernames:vector editable_username:string = Usernames; @@ -686,20 +774,25 @@ usernames active_usernames:vector disabled_usernames:vector edit //@phone_number Phone number of the user //@status Current online status of the user //@profile_photo Profile photo of the user; may be null +//@accent_color_id Identifier of the accent color for name, and backgrounds of profile photo, reply header, and link preview +//@background_custom_emoji_id Identifier of a custom emoji to be shown on the reply header background; 0 if none. For Telegram Premium users only //@emoji_status Emoji status to be shown instead of the default Telegram Premium badge; may be null. For Telegram Premium users only //@is_contact The user is a contact of the current user //@is_mutual_contact The user is a contact of the current user and the current user is a contact of the user +//@is_close_friend The user is a close friend of the current user; implies that the user is a contact //@is_verified True, if the user is verified //@is_premium True, if the user is a Telegram Premium user //@is_support True, if the user is Telegram support account //@restriction_reason If non-empty, it contains a human-readable description of the reason why access to this user must be restricted //@is_scam True, if many users reported this user as a scam //@is_fake True, if many users reported this user as a fake account +//@has_active_stories True, if the user has non-expired stories available to the current user +//@has_unread_active_stories True, if the user has unread non-expired stories available to the current user //@have_access If false, the user is inaccessible, and the only information known about the user is inside this class. Identifier of the user can't be passed to any method //@type Type of the user //@language_code IETF language tag of the user's language; only available to bots //@added_to_attachment_menu True, if the user added the current bot to attachment menu; only available to bots -user id:int53 first_name:string last_name:string usernames:usernames phone_number:string status:UserStatus profile_photo:profilePhoto emoji_status:emojiStatus is_contact:Bool is_mutual_contact:Bool is_verified:Bool is_premium:Bool is_support:Bool restriction_reason:string is_scam:Bool is_fake:Bool have_access:Bool type:UserType language_code:string added_to_attachment_menu:Bool = User; +user id:int53 first_name:string last_name:string usernames:usernames phone_number:string status:UserStatus profile_photo:profilePhoto accent_color_id:int32 background_custom_emoji_id:int64 emoji_status:emojiStatus is_contact:Bool is_mutual_contact:Bool is_close_friend:Bool is_verified:Bool is_premium:Bool is_support:Bool restriction_reason:string is_scam:Bool is_fake:Bool has_active_stories:Bool has_unread_active_stories:Bool have_access:Bool type:UserType language_code:string added_to_attachment_menu:Bool = User; //@description Contains information about a bot @@ -711,7 +804,11 @@ user id:int53 first_name:string last_name:string usernames:usernames phone_numbe //@commands List of the bot commands //@default_group_administrator_rights Default administrator rights for adding the bot to basic group and supergroup chats; may be null //@default_channel_administrator_rights Default administrator rights for adding the bot to channels; may be null -botInfo short_description:string description:string photo:photo animation:animation menu_button:botMenuButton commands:vector default_group_administrator_rights:chatAdministratorRights default_channel_administrator_rights:chatAdministratorRights = BotInfo; +//@edit_commands_link The internal link, which can be used to edit bot commands; may be null +//@edit_description_link The internal link, which can be used to edit bot description; may be null +//@edit_description_media_link The internal link, which can be used to edit the photo or animation shown in the chat with the bot if the chat is empty; may be null +//@edit_settings_link The internal link, which can be used to edit bot settings; may be null +botInfo short_description:string description:string photo:photo animation:animation menu_button:botMenuButton commands:vector default_group_administrator_rights:chatAdministratorRights default_channel_administrator_rights:chatAdministratorRights edit_commands_link:InternalLinkType edit_description_link:InternalLinkType edit_description_media_link:InternalLinkType edit_settings_link:InternalLinkType = BotInfo; //@description Contains full information about a user //@personal_photo User profile photo set by the current user for the contact; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown. @@ -720,18 +817,19 @@ botInfo short_description:string description:string photo:photo animation:animat //-If non-null and personal_photo is null, then it is the same photo as in user.profile_photo and chat.photo //@public_photo User profile photo visible if the main photo is hidden by privacy settings; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown. //-If non-null and both photo and personal_photo are null, then it is the same photo as in user.profile_photo and chat.photo. This photo isn't returned in the list of user photos -//@is_blocked True, if the user is blocked by the current user +//@block_list Block list to which the user is added; may be null if none //@can_be_called True, if the user can be called //@supports_video_calls True, if a video call can be created with the user //@has_private_calls True, if the user can't be called due to their privacy settings //@has_private_forwards True, if the user can't be linked in forwarded messages due to their privacy settings //@has_restricted_voice_and_video_note_messages True, if voice and video notes can't be sent or forwarded to the user +//@has_pinned_stories True, if the user has pinned stories //@need_phone_number_privacy_exception True, if the current user needs to explicitly allow to share their phone number with the user when the method addContact is used //@bio A short user bio; may be null for bots //@premium_gift_options The list of available options for gifting Telegram Premium to the user //@group_in_common_count Number of group chats where both the other user and the current user are a member; 0 for the current user -//@bot_info For bots, information about the bot; may be null -userFullInfo personal_photo:chatPhoto photo:chatPhoto public_photo:chatPhoto is_blocked:Bool can_be_called:Bool supports_video_calls:Bool has_private_calls:Bool has_private_forwards:Bool has_restricted_voice_and_video_note_messages:Bool need_phone_number_privacy_exception:Bool bio:formattedText premium_gift_options:vector group_in_common_count:int32 bot_info:botInfo = UserFullInfo; +//@bot_info For bots, information about the bot; may be null if the user isn't a bot +userFullInfo personal_photo:chatPhoto photo:chatPhoto public_photo:chatPhoto block_list:BlockList can_be_called:Bool supports_video_calls:Bool has_private_calls:Bool has_private_forwards:Bool has_restricted_voice_and_video_note_messages:Bool has_pinned_stories:Bool need_phone_number_privacy_exception:Bool bio:formattedText premium_gift_options:vector group_in_common_count:int32 bot_info:botInfo = UserFullInfo; //@description Represents a list of users @total_count Approximate total number of users found @user_ids A list of user identifiers users total_count:int32 user_ids:vector = Users; @@ -865,24 +963,46 @@ chatInviteLinkCount user_id:int53 invite_link_count:int32 revoked_invite_link_co //@description Contains a list of chat invite link counts @invite_link_counts List of invite link counts chatInviteLinkCounts invite_link_counts:vector = ChatInviteLinkCounts; -//@description Describes a chat member joined a chat via an invite link @user_id User identifier @joined_chat_date Point in time (Unix timestamp) when the user joined the chat @approver_user_id User identifier of the chat administrator, approved user join request -chatInviteLinkMember user_id:int53 joined_chat_date:int32 approver_user_id:int53 = ChatInviteLinkMember; +//@description Describes a chat member joined a chat via an invite link +//@user_id User identifier +//@joined_chat_date Point in time (Unix timestamp) when the user joined the chat +//@via_chat_folder_invite_link True, if the user has joined the chat using an invite link for a chat folder +//@approver_user_id User identifier of the chat administrator, approved user join request +chatInviteLinkMember user_id:int53 joined_chat_date:int32 via_chat_folder_invite_link:Bool approver_user_id:int53 = ChatInviteLinkMember; //@description Contains a list of chat members joined a chat via an invite link @total_count Approximate total number of chat members found @members List of chat members, joined a chat via an invite link chatInviteLinkMembers total_count:int32 members:vector = ChatInviteLinkMembers; + +//@class InviteLinkChatType @description Describes the type of a chat to which points an invite link + +//@description The link is an invite link for a basic group +inviteLinkChatTypeBasicGroup = InviteLinkChatType; + +//@description The link is an invite link for a supergroup +inviteLinkChatTypeSupergroup = InviteLinkChatType; + +//@description The link is an invite link for a channel +inviteLinkChatTypeChannel = InviteLinkChatType; + + //@description Contains information about a chat invite link //@chat_id Chat identifier of the invite link; 0 if the user has no access to the chat before joining //@accessible_for If non-zero, the amount of time for which read access to the chat will remain available, in seconds //@type Type of the chat //@title Title of the chat //@photo Chat photo; may be null +//@accent_color_id Identifier of the accent color for chat title and background of chat photo //@param_description Chat description //@member_count Number of members in the chat //@member_user_ids User identifiers of some chat members that may be known to the current user //@creates_join_request True, if the link only creates join request //@is_public True, if the chat is a public supergroup or channel, i.e. it has a username or it is a location-based supergroup -chatInviteLinkInfo chat_id:int53 accessible_for:int32 type:ChatType title:string photo:chatPhotoInfo description:string member_count:int32 member_user_ids:vector creates_join_request:Bool is_public:Bool = ChatInviteLinkInfo; +//@is_verified True, if the chat is verified +//@is_scam True, if many users reported this chat as a scam +//@is_fake True, if many users reported this chat as a fake account +chatInviteLinkInfo chat_id:int53 accessible_for:int32 type:InviteLinkChatType title:string photo:chatPhotoInfo accent_color_id:int32 description:string member_count:int32 member_user_ids:vector creates_join_request:Bool is_public:Bool is_verified:Bool is_scam:Bool is_fake:Bool = ChatInviteLinkInfo; + //@description Describes a user that sent a join request and waits for administrator approval @user_id User identifier @date Point in time (Unix timestamp) when the user sent the join request @bio A short bio of the user chatJoinRequest user_id:int53 date:int32 bio:string = ChatJoinRequest; @@ -922,7 +1042,7 @@ basicGroupFullInfo photo:chatPhoto description:string creator_user_id:int53 memb //@date Point in time (Unix timestamp) when the current user joined, or the point in time when the supergroup or channel was created, in case the user is not a member //@status Status of the current user in the supergroup or channel; custom title will always be empty //@member_count Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received -//-through searchPublicChats, searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, or getUserPrivacySettingRules +//-through searchPublicChats, searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, getUserPrivacySettingRules, or in chatFolderInviteLinkInfo.missing_chat_ids //@has_linked_chat True, if the channel has a discussion group, or the supergroup is the designated discussion group for a channel //@has_location True, if the supergroup is connected to a location, i.e. the supergroup is a location-based supergroup //@sign_messages True, if messages sent to the channel need to contain information about the sender. This field is only applicable to channels @@ -936,7 +1056,9 @@ basicGroupFullInfo photo:chatPhoto description:string creator_user_id:int53 memb //@restriction_reason If non-empty, contains a human-readable description of the reason why access to this supergroup or channel must be restricted //@is_scam True, if many users reported this supergroup or channel as a scam //@is_fake True, if many users reported this supergroup or channel as a fake account -supergroup id:int53 usernames:usernames date:int32 status:ChatMemberStatus member_count:int32 has_linked_chat:Bool has_location:Bool sign_messages:Bool join_to_send_messages:Bool join_by_request:Bool is_slow_mode_enabled:Bool is_channel:Bool is_broadcast_group:Bool is_forum:Bool is_verified:Bool restriction_reason:string is_scam:Bool is_fake:Bool = Supergroup; +//@has_active_stories True, if the channel has non-expired stories available to the current user +//@has_unread_active_stories True, if the channel has unread non-expired stories available to the current user +supergroup id:int53 usernames:usernames date:int32 status:ChatMemberStatus member_count:int32 has_linked_chat:Bool has_location:Bool sign_messages:Bool join_to_send_messages:Bool join_by_request:Bool is_slow_mode_enabled:Bool is_channel:Bool is_broadcast_group:Bool is_forum:Bool is_verified:Bool restriction_reason:string is_scam:Bool is_fake:Bool has_active_stories:Bool has_unread_active_stories:Bool = Supergroup; //@description Contains full information about a supergroup or channel //@photo Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo @@ -951,7 +1073,6 @@ supergroup id:int53 usernames:usernames date:int32 status:ChatMemberStatus membe //@can_get_members True, if members of the chat can be retrieved via getSupergroupMembers or searchChatMembers //@has_hidden_members True, if non-administrators can receive only administrators and bots using getSupergroupMembers or searchChatMembers //@can_hide_members True, if non-administrators and non-bots can be hidden in responses to getSupergroupMembers and searchChatMembers for non-administrators -//@can_set_username True, if the chat username can be changed //@can_set_sticker_set True, if the supergroup sticker set can be changed //@can_set_location True, if the supergroup location can be changed //@can_get_statistics True, if the supergroup or channel statistics are available @@ -959,13 +1080,14 @@ supergroup id:int53 usernames:usernames date:int32 status:ChatMemberStatus membe //@is_all_history_available True, if new chat members will have access to old messages. In public, discussion, of forum groups and all channels, old messages are always available, //-so this option affects only private non-forum supergroups without a linked chat. The value of this field is only available to chat administrators //@has_aggressive_anti_spam_enabled True, if aggressive anti-spam checks are enabled in the supergroup. The value of this field is only available to chat administrators +//@has_pinned_stories True, if the channel has pinned stories //@sticker_set_id Identifier of the supergroup sticker set; 0 if none -//@location Location to which the supergroup is connected; may be null +//@location Location to which the supergroup is connected; may be null if none //@invite_link Primary invite link for the chat; may be null. For chat administrators with can_invite_users right only //@bot_commands List of commands of bots in the group //@upgraded_from_basic_group_id Identifier of the basic group from which supergroup was upgraded; 0 if none //@upgraded_from_max_message_id Identifier of the last message in the basic group from which supergroup was upgraded; 0 if none -supergroupFullInfo photo:chatPhoto description:string member_count:int32 administrator_count:int32 restricted_count:int32 banned_count:int32 linked_chat_id:int53 slow_mode_delay:int32 slow_mode_delay_expires_in:double can_get_members:Bool has_hidden_members:Bool can_hide_members:Bool can_set_username:Bool can_set_sticker_set:Bool can_set_location:Bool can_get_statistics:Bool can_toggle_aggressive_anti_spam:Bool is_all_history_available:Bool has_aggressive_anti_spam_enabled:Bool sticker_set_id:int64 location:chatLocation invite_link:chatInviteLink bot_commands:vector upgraded_from_basic_group_id:int53 upgraded_from_max_message_id:int53 = SupergroupFullInfo; +supergroupFullInfo photo:chatPhoto description:string member_count:int32 administrator_count:int32 restricted_count:int32 banned_count:int32 linked_chat_id:int53 slow_mode_delay:int32 slow_mode_delay_expires_in:double can_get_members:Bool has_hidden_members:Bool can_hide_members:Bool can_set_sticker_set:Bool can_set_location:Bool can_get_statistics:Bool can_toggle_aggressive_anti_spam:Bool is_all_history_available:Bool has_aggressive_anti_spam_enabled:Bool has_pinned_stories:Bool sticker_set_id:int64 location:chatLocation invite_link:chatInviteLink bot_commands:vector upgraded_from_basic_group_id:int53 upgraded_from_max_message_id:int53 = SupergroupFullInfo; //@class SecretChatState @description Describes the current secret chat state @@ -1005,7 +1127,7 @@ messageSenderChat chat_id:int53 = MessageSender; messageSenders total_count:int32 senders:vector = MessageSenders; -//@description Represents a message sender, which can be used to send messages in a chat @sender Available message senders @needs_premium True, if Telegram Premium is needed to use the message sender +//@description Represents a message sender, which can be used to send messages in a chat @sender The message sender @needs_premium True, if Telegram Premium is needed to use the message sender chatMessageSender sender:MessageSender needs_premium:Bool = ChatMessageSender; //@description Represents a list of message senders, which can be used to send messages in a chat @senders List of available message senders @@ -1019,27 +1141,24 @@ messageViewer user_id:int53 view_date:int32 = MessageViewer; messageViewers viewers:vector = MessageViewers; -//@class MessageForwardOrigin @description Contains information about the origin of a forwarded message +//@class MessageOrigin @description Contains information about the origin of a message //@description The message was originally sent by a known user @sender_user_id Identifier of the user that originally sent the message -messageForwardOriginUser sender_user_id:int53 = MessageForwardOrigin; +messageOriginUser sender_user_id:int53 = MessageOrigin; + +//@description The message was originally sent by a user, which is hidden by their privacy settings @sender_name Name of the sender +messageOriginHiddenUser sender_name:string = MessageOrigin; //@description The message was originally sent on behalf of a chat //@sender_chat_id Identifier of the chat that originally sent the message //@author_signature For messages originally sent by an anonymous chat administrator, original message author signature -messageForwardOriginChat sender_chat_id:int53 author_signature:string = MessageForwardOrigin; - -//@description The message was originally sent by a user, which is hidden by their privacy settings @sender_name Name of the sender -messageForwardOriginHiddenUser sender_name:string = MessageForwardOrigin; +messageOriginChat sender_chat_id:int53 author_signature:string = MessageOrigin; //@description The message was originally a post in a channel -//@chat_id Identifier of the chat from which the message was originally forwarded +//@chat_id Identifier of the channel chat to which the message was originally sent //@message_id Message identifier of the original message //@author_signature Original post author signature -messageForwardOriginChannel chat_id:int53 message_id:int53 author_signature:string = MessageForwardOrigin; - -//@description The message was imported from an exported message history @sender_name Name of the sender -messageForwardOriginMessageImport sender_name:string = MessageForwardOrigin; +messageOriginChannel chat_id:int53 message_id:int53 author_signature:string = MessageOrigin; //@class ReactionType @description Describes type of message reaction @@ -1052,12 +1171,17 @@ reactionTypeCustomEmoji custom_emoji_id:int64 = ReactionType; //@description Contains information about a forwarded message -//@origin Origin of a forwarded message +//@origin Origin of the forwarded message //@date Point in time (Unix timestamp) when the message was originally sent //@public_service_announcement_type The type of a public service announcement for the forwarded message //@from_chat_id For messages forwarded to the chat with the current user (Saved Messages), to the Replies bot chat, or to the channel's discussion group, the identifier of the chat from which the message was forwarded last time; 0 if unknown //@from_message_id For messages forwarded to the chat with the current user (Saved Messages), to the Replies bot chat, or to the channel's discussion group, the identifier of the original message from which the new message was forwarded last time; 0 if unknown -messageForwardInfo origin:MessageForwardOrigin date:int32 public_service_announcement_type:string from_chat_id:int53 from_message_id:int53 = MessageForwardInfo; +messageForwardInfo origin:MessageOrigin date:int32 public_service_announcement_type:string from_chat_id:int53 from_message_id:int53 = MessageForwardInfo; + +//@description Contains information about a message created with importMessages +//@sender_name Name of the original sender +//@date Point in time (Unix timestamp) when the message was originally sent +messageImportInfo sender_name:string date:int32 = MessageImportInfo; //@description Contains information about replies to a message //@reply_count Number of times the message was directly or indirectly replied @@ -1071,8 +1195,10 @@ messageReplyInfo reply_count:int32 recent_replier_ids:vector last //@type Type of the reaction //@total_count Number of times the reaction was added //@is_chosen True, if the reaction is chosen by the current user +//@used_sender_id Identifier of the message sender used by the current user to add the reaction; may be null if unknown or the reaction isn't chosen //@recent_sender_ids Identifiers of at most 3 recent message senders, added the reaction; available in private, basic group and supergroup chats -messageReaction type:ReactionType total_count:int32 is_chosen:Bool recent_sender_ids:vector = MessageReaction; +messageReaction type:ReactionType total_count:int32 is_chosen:Bool used_sender_id:MessageSender recent_sender_ids:vector = MessageReaction; + //@description Contains information about interactions with a message //@view_count Number of times the message was viewed @@ -1094,24 +1220,57 @@ unreadReaction type:ReactionType sender_id:MessageSender is_big:Bool = UnreadRea messageSendingStatePending sending_id:int32 = MessageSendingState; //@description The message failed to be sent -//@error_code An error code; 0 if unknown -//@error_message Error message +//@error The cause of the message sending failure //@can_retry True, if the message can be re-sent //@need_another_sender True, if the message can be re-sent only on behalf of a different sender +//@need_another_reply_quote True, if the message can be re-sent only if another quote is chosen in the message that is replied by the given message +//@need_drop_reply True, if the message can be re-sent only if the message to be replied is removed. This will be done automatically by resendMessages //@retry_after Time left before the message can be re-sent, in seconds. No update is sent when this field changes -messageSendingStateFailed error_code:int32 error_message:string can_retry:Bool need_another_sender:Bool retry_after:double = MessageSendingState; +messageSendingStateFailed error:error can_retry:Bool need_another_sender:Bool need_another_reply_quote:Bool need_drop_reply:Bool retry_after:double = MessageSendingState; + + +//@class MessageReplyTo @description Contains information about the message or the story a message is replying to + +//@description Describes a message replied by a given message +//@chat_id The identifier of the chat to which the message belongs; may be 0 if the replied message is in unknown chat +//@message_id The identifier of the message; may be 0 if the replied message is in unknown chat +//@quote Manually or automatically chosen quote from the replied message; may be null if none. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities can be present in the quote +//@is_quote_manual True, if the quote was manually chosen by the message sender +//@origin Information about origin of the message if the message was from another chat or topic; may be null for messages from the same chat +//@origin_send_date Point in time (Unix timestamp) when the message was sent if the message was from another chat or topic; 0 for messages from the same chat +//@content Media content of the message if the message was from another chat or topic; may be null for messages from the same chat and messages without media. +//-Can be only one of the following types: messageAnimation, messageAudio, messageContact, messageDice, messageDocument, messageGame, messageInvoice, messageLocation, +//-messagePhoto, messagePoll, messagePremiumGiveaway, messageSticker, messageStory, messageText (for link preview), messageVenue, messageVideo, messageVideoNote, or messageVoiceNote +messageReplyToMessage chat_id:int53 message_id:int53 quote:formattedText is_quote_manual:Bool origin:MessageOrigin origin_send_date:int32 content:MessageContent = MessageReplyTo; + +//@description Describes a story replied by a given message @story_sender_chat_id The identifier of the sender of the story @story_id The identifier of the story +messageReplyToStory story_sender_chat_id:int53 story_id:int32 = MessageReplyTo; + + +//@class InputMessageReplyTo @description Contains information about the message or the story to be replied + +//@description Describes a message to be replied +//@chat_id The identifier of the chat to which the message to be replied belongs; pass 0 if the message to be replied is in the same chat. Must always be 0 for replies in secret chats. A message can be replied in another chat or topic only if message.can_be_replied_in_another_chat +//@message_id The identifier of the message to be replied in the same or the specified chat +//@quote Manually chosen quote from the message to be replied; pass null if none; 0-getOption("message_reply_quote_length_max") characters. Must always be null for replies in secret chats. +//-Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed to be kept and must be kept in the quote +inputMessageReplyToMessage chat_id:int53 message_id:int53 quote:formattedText = InputMessageReplyTo; + +//@description Describes a story to be replied @story_sender_chat_id The identifier of the sender of the story. Currently, stories can be replied only in the sender's chat @story_id The identifier of the story +inputMessageReplyToStory story_sender_chat_id:int53 story_id:int32 = InputMessageReplyTo; //@description Describes a message //@id Message identifier; unique for the chat to which the message belongs //@sender_id Identifier of the sender of the message //@chat_id Chat identifier -//@sending_state The sending state of the message; may be null -//@scheduling_state The scheduling state of the message; may be null +//@sending_state The sending state of the message; may be null if the message isn't being sent and didn't fail to be sent +//@scheduling_state The scheduling state of the message; may be null if the message isn't scheduled //@is_outgoing True, if the message is outgoing //@is_pinned True, if the message is pinned //@can_be_edited True, if the message can be edited. For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used with this message by the application //@can_be_forwarded True, if the message can be forwarded +//@can_be_replied_in_another_chat True, if the message can be replied in another chat or topic //@can_be_saved True, if content of the message can be saved locally or copied //@can_be_deleted_only_for_self True, if the message can be deleted only for the current user while other users will continue to see it //@can_be_deleted_for_all_users True, if the message can be deleted for all users @@ -1127,22 +1286,22 @@ messageSendingStateFailed error_code:int32 error_message:string can_retry:Bool n //@contains_unread_mention True, if the message contains an unread mention for the current user //@date Point in time (Unix timestamp) when the message was sent //@edit_date Point in time (Unix timestamp) when the message was last edited -//@forward_info Information about the initial message sender; may be null -//@interaction_info Information about interactions with the message; may be null +//@forward_info Information about the initial message sender; may be null if none or unknown +//@import_info Information about the initial message for messages created with importMessages; may be null if the message isn't imported +//@interaction_info Information about interactions with the message; may be null if none //@unread_reactions Information about unread reactions added to the message -//@reply_in_chat_id If non-zero, the identifier of the chat to which the replied message belongs; Currently, only messages in the Replies chat can have different reply_in_chat_id and chat_id -//@reply_to_message_id If non-zero, the identifier of the message this message is replying to; can be the identifier of a deleted message +//@reply_to Information about the message or the story this message is replying to; may be null if none //@message_thread_id If non-zero, the identifier of the message thread the message belongs to; unique within the chat to which the message belongs -//@self_destruct_time The message's self-destruct time, in seconds; 0 if none. TDLib will send updateDeleteMessages or updateMessageContent once the time expires -//@self_destruct_in Time left before the message self-destruct timer expires, in seconds. If the self-destruct timer isn't started yet, equals to the value of the self_destruct_time field -//@auto_delete_in Time left before the message will be automatically deleted by message_auto_delete_time setting of the chat, in seconds; 0 if never. TDLib will send updateDeleteMessages or updateMessageContent once the time expires +//@self_destruct_type The message's self-destruct type; may be null if none +//@self_destruct_in Time left before the message self-destruct timer expires, in seconds; 0 if self-destruction isn't scheduled yet +//@auto_delete_in Time left before the message will be automatically deleted by message_auto_delete_time setting of the chat, in seconds; 0 if never //@via_bot_user_id If non-zero, the user identifier of the bot through which this message was sent //@author_signature For channel posts and anonymous group messages, optional author signature //@media_album_id Unique identifier of an album this message belongs to. Only audios, documents, photos and videos can be grouped together in albums //@restriction_reason If non-empty, contains a human-readable description of the reason why access to this message must be restricted //@content Content of the message -//@reply_markup Reply markup for the message; may be null -message id:int53 sender_id:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_saved:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_get_added_reactions:Bool can_get_statistics:Bool can_get_message_thread:Bool can_get_viewers:Bool can_get_media_timestamp_links:Bool can_report_reactions:Bool has_timestamped_media:Bool is_channel_post:Bool is_topic_message:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo interaction_info:messageInteractionInfo unread_reactions:vector reply_in_chat_id:int53 reply_to_message_id:int53 message_thread_id:int53 self_destruct_time:int32 self_destruct_in:double auto_delete_in:double via_bot_user_id:int53 author_signature:string media_album_id:int64 restriction_reason:string content:MessageContent reply_markup:ReplyMarkup = Message; +//@reply_markup Reply markup for the message; may be null if none +message id:int53 sender_id:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_replied_in_another_chat:Bool can_be_saved:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_get_added_reactions:Bool can_get_statistics:Bool can_get_message_thread:Bool can_get_viewers:Bool can_get_media_timestamp_links:Bool can_report_reactions:Bool has_timestamped_media:Bool is_channel_post:Bool is_topic_message:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo import_info:messageImportInfo interaction_info:messageInteractionInfo unread_reactions:vector reply_to:MessageReplyTo message_thread_id:int53 self_destruct_type:MessageSelfDestructType self_destruct_in:double auto_delete_in:double via_bot_user_id:int53 author_signature:string media_album_id:int64 restriction_reason:string content:MessageContent reply_markup:ReplyMarkup = Message; //@description Contains a list of messages @total_count Approximate total number of messages found @messages List of messages; messages may be null messages total_count:int32 messages:vector = Messages; @@ -1192,21 +1351,41 @@ messageSourceChatEventLog = MessageSource; //@description The message is from a notification messageSourceNotification = MessageSource; +//@description The message was screenshotted; the source must be used only if the message content was visible during the screenshot +messageSourceScreenshot = MessageSource; + //@description The message is from some other source messageSourceOther = MessageSource; +//@class MessageSponsorType @description Describes type of a message sponsor + +//@description The sponsor is a bot @bot_user_id User identifier of the bot @link An internal link to be opened when the sponsored message is clicked +messageSponsorTypeBot bot_user_id:int53 link:InternalLinkType = MessageSponsorType; + +//@description The sponsor is a public channel chat @chat_id Sponsor chat identifier @link An internal link to be opened when the sponsored message is clicked; may be null if the sponsor chat needs to be opened instead +messageSponsorTypePublicChannel chat_id:int53 link:InternalLinkType = MessageSponsorType; + +//@description The sponsor is a private channel chat @title Title of the chat @invite_link Invite link for the channel +messageSponsorTypePrivateChannel title:string invite_link:string = MessageSponsorType; + +//@description The sponsor is a website @url URL of the website @name Name of the website +messageSponsorTypeWebsite url:string name:string = MessageSponsorType; + + +//@description Information about the sponsor of a message +//@type Type of the sponsor +//@photo Photo of the sponsor; may be null if must not be shown +//@info Additional optional information about the sponsor to be shown along with the message +messageSponsor type:MessageSponsorType photo:chatPhotoInfo info:string = MessageSponsor; + //@description Describes a sponsored message //@message_id Message identifier; unique for the chat to which the sponsored message belongs among both ordinary and sponsored messages //@is_recommended True, if the message needs to be labeled as "recommended" instead of "sponsored" -//@sponsor_chat_id Sponsor chat identifier; 0 if the sponsor chat is accessible through an invite link -//@sponsor_chat_info Information about the sponsor chat; may be null unless sponsor_chat_id == 0 -//@show_chat_photo True, if the sponsor's chat photo must be shown -//@link An internal link to be opened when the sponsored message is clicked; may be null if the sponsor chat needs to be opened instead //@content Content of the message. Currently, can be only of the type messageText -//@sponsor_info If non-empty, information about the sponsor to be shown along with the message +//@sponsor Information about the sponsor of the message //@additional_info If non-empty, additional information about the sponsored message to be shown along with the message -sponsoredMessage message_id:int53 is_recommended:Bool sponsor_chat_id:int53 sponsor_chat_info:chatInviteLinkInfo show_chat_photo:Bool link:InternalLinkType content:MessageContent sponsor_info:string additional_info:string = SponsoredMessage; +sponsoredMessage message_id:int53 is_recommended:Bool content:MessageContent sponsor:messageSponsor additional_info:string = SponsoredMessage; //@description Contains a list of sponsored messages @messages List of sponsored messages @messages_between The minimum number of messages between shown sponsored messages, or 0 if only one sponsored message must be shown after all ordinary messages sponsoredMessages messages:vector messages_between:int32 = SponsoredMessages; @@ -1249,29 +1428,39 @@ notificationSettingsScopeChannelChats = NotificationSettingsScope; //@use_default_mute_for If true, mute_for is ignored and the value for the relevant type of chat or the forum chat is used instead //@mute_for Time left before notifications will be unmuted, in seconds //@use_default_sound If true, the value for the relevant type of chat or the forum chat is used instead of sound_id -//@sound_id Identifier of the notification sound to be played; 0 if sound is disabled +//@sound_id Identifier of the notification sound to be played for messages; 0 if sound is disabled //@use_default_show_preview If true, show_preview is ignored and the value for the relevant type of chat or the forum chat is used instead //@show_preview True, if message content must be displayed in notifications +//@use_default_mute_stories If true, mute_stories is ignored and the value for the relevant type of chat is used instead +//@mute_stories True, if story notifications are disabled for the chat +//@use_default_story_sound If true, the value for the relevant type of chat is used instead of story_sound_id +//@story_sound_id Identifier of the notification sound to be played for stories; 0 if sound is disabled +//@use_default_show_story_sender If true, show_story_sender is ignored and the value for the relevant type of chat is used instead +//@show_story_sender True, if the sender of stories must be displayed in notifications //@use_default_disable_pinned_message_notifications If true, disable_pinned_message_notifications is ignored and the value for the relevant type of chat or the forum chat is used instead //@disable_pinned_message_notifications If true, notifications for incoming pinned messages will be created as for an ordinary unread message //@use_default_disable_mention_notifications If true, disable_mention_notifications is ignored and the value for the relevant type of chat or the forum chat is used instead //@disable_mention_notifications If true, notifications for messages with mentions will be created as for an ordinary unread message -chatNotificationSettings use_default_mute_for:Bool mute_for:int32 use_default_sound:Bool sound_id:int64 use_default_show_preview:Bool show_preview:Bool use_default_disable_pinned_message_notifications:Bool disable_pinned_message_notifications:Bool use_default_disable_mention_notifications:Bool disable_mention_notifications:Bool = ChatNotificationSettings; +chatNotificationSettings use_default_mute_for:Bool mute_for:int32 use_default_sound:Bool sound_id:int64 use_default_show_preview:Bool show_preview:Bool use_default_mute_stories:Bool mute_stories:Bool use_default_story_sound:Bool story_sound_id:int64 use_default_show_story_sender:Bool show_story_sender:Bool use_default_disable_pinned_message_notifications:Bool disable_pinned_message_notifications:Bool use_default_disable_mention_notifications:Bool disable_mention_notifications:Bool = ChatNotificationSettings; //@description Contains information about notification settings for several chats //@mute_for Time left before notifications will be unmuted, in seconds //@sound_id Identifier of the notification sound to be played; 0 if sound is disabled //@show_preview True, if message content must be displayed in notifications +//@use_default_mute_stories If true, mute_stories is ignored and story notifications are received only for the first 5 chats from topChatCategoryUsers +//@mute_stories True, if story notifications are disabled for the chat +//@story_sound_id Identifier of the notification sound to be played for stories; 0 if sound is disabled +//@show_story_sender True, if the sender of stories must be displayed in notifications //@disable_pinned_message_notifications True, if notifications for incoming pinned messages will be created as for an ordinary unread message //@disable_mention_notifications True, if notifications for messages with mentions will be created as for an ordinary unread message -scopeNotificationSettings mute_for:int32 sound_id:int64 show_preview:Bool disable_pinned_message_notifications:Bool disable_mention_notifications:Bool = ScopeNotificationSettings; +scopeNotificationSettings mute_for:int32 sound_id:int64 show_preview:Bool use_default_mute_stories:Bool mute_stories:Bool story_sound_id:int64 show_story_sender:Bool disable_pinned_message_notifications:Bool disable_mention_notifications:Bool = ScopeNotificationSettings; //@description Contains information about a message draft -//@reply_to_message_id Identifier of the replied message; 0 if none +//@reply_to Information about the message to be replied; must be of the type inputMessageReplyToMessage; may be null if none //@date Point in time (Unix timestamp) when the draft was created //@input_message_text Content of the message draft; must be of the type inputMessageText -draftMessage reply_to_message_id:int53 date:int32 input_message_text:InputMessageContent = DraftMessage; +draftMessage reply_to:InputMessageReplyTo date:int32 input_message_text:InputMessageContent = DraftMessage; //@class ChatType @description Describes the type of a chat @@ -1285,18 +1474,21 @@ chatTypeBasicGroup basic_group_id:int53 = ChatType; //@description A supergroup or channel (with unlimited members) @supergroup_id Supergroup or channel identifier @is_channel True, if the supergroup is a channel chatTypeSupergroup supergroup_id:int53 is_channel:Bool = ChatType; -//@description A secret chat with a user @secret_chat_id Secret chat identifier @user_id User identifier of the secret chat peer +//@description A secret chat with a user @secret_chat_id Secret chat identifier @user_id User identifier of the other user in the secret chat chatTypeSecret secret_chat_id:int32 user_id:int53 = ChatType; -//@description Represents a filter of user chats -//@title The title of the filter; 1-12 characters without line feeds -//@icon_name The chosen icon name for short filter representation. If non-empty, must be one of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", -//-"Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work", "Airplane", "Book", "Light", "Like", "Money", "Note", "Palette". -//-If empty, use getChatFilterDefaultIconName to get default icon name for the filter -//@pinned_chat_ids The chat identifiers of pinned chats in the filtered chat list. There can be up to getOption("chat_filter_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium -//@included_chat_ids The chat identifiers of always included chats in the filtered chat list. There can be up to getOption("chat_filter_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium -//@excluded_chat_ids The chat identifiers of always excluded chats in the filtered chat list. There can be up to getOption("chat_filter_chosen_chat_count_max") always excluded non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium +//@description Represents an icon for a chat folder @name The chosen icon name for short folder representation; one of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", +//-"Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work", "Airplane", "Book", "Light", "Like", "Money", "Note", "Palette" +chatFolderIcon name:string = ChatFolderIcon; + +//@description Represents a folder for user chats +//@title The title of the folder; 1-12 characters without line feeds +//@icon The chosen icon for the chat folder; may be null. If null, use getChatFolderDefaultIconName to get default icon name for the folder +//@is_shareable True, if at least one link has been created for the folder +//@pinned_chat_ids The chat identifiers of pinned chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium +//@included_chat_ids The chat identifiers of always included chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium +//@excluded_chat_ids The chat identifiers of always excluded chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") always excluded non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium //@exclude_muted True, if muted chats need to be excluded //@exclude_read True, if read chats need to be excluded //@exclude_archived True, if archived chats need to be excluded @@ -1305,20 +1497,42 @@ chatTypeSecret secret_chat_id:int32 user_id:int53 = ChatType; //@include_bots True, if bots need to be included //@include_groups True, if basic groups and supergroups need to be included //@include_channels True, if channels need to be included -chatFilter title:string icon_name:string pinned_chat_ids:vector included_chat_ids:vector excluded_chat_ids:vector exclude_muted:Bool exclude_read:Bool exclude_archived:Bool include_contacts:Bool include_non_contacts:Bool include_bots:Bool include_groups:Bool include_channels:Bool = ChatFilter; +chatFolder title:string icon:chatFolderIcon is_shareable:Bool pinned_chat_ids:vector included_chat_ids:vector excluded_chat_ids:vector exclude_muted:Bool exclude_read:Bool exclude_archived:Bool include_contacts:Bool include_non_contacts:Bool include_bots:Bool include_groups:Bool include_channels:Bool = ChatFolder; + +//@description Contains basic information about a chat folder +//@id Unique chat folder identifier +//@title The title of the folder; 1-12 characters without line feeds +//@icon The chosen or default icon for the chat folder +//@is_shareable True, if at least one link has been created for the folder +//@has_my_invite_links True, if the chat folder has invite links created by the current user +chatFolderInfo id:int32 title:string icon:chatFolderIcon is_shareable:Bool has_my_invite_links:Bool = ChatFolderInfo; + +//@description Contains a chat folder invite link +//@invite_link The chat folder invite link +//@name Name of the link +//@chat_ids Identifiers of chats, included in the link +chatFolderInviteLink invite_link:string name:string chat_ids:vector = ChatFolderInviteLink; -//@description Contains basic information about a chat filter -//@id Unique chat filter identifier -//@title The title of the filter; 1-12 characters without line feeds -//@icon_name The chosen or default icon name for short filter representation. One of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", -//-"Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work", "Airplane", "Book", "Light", "Like", "Money", "Note", "Palette" -chatFilterInfo id:int32 title:string icon_name:string = ChatFilterInfo; +//@description Represents a list of chat folder invite links @invite_links List of the invite links +chatFolderInviteLinks invite_links:vector = ChatFolderInviteLinks; + +//@description Contains information about an invite link to a chat folder +//@chat_folder_info Basic information about the chat folder; chat folder identifier will be 0 if the user didn't have the chat folder yet +//@missing_chat_ids Identifiers of the chats from the link, which aren't added to the folder yet +//@added_chat_ids Identifiers of the chats from the link, which are added to the folder already +chatFolderInviteLinkInfo chat_folder_info:chatFolderInfo missing_chat_ids:vector added_chat_ids:vector = ChatFolderInviteLinkInfo; -//@description Describes a recommended chat filter @filter The chat filter @param_description Chat filter description -recommendedChatFilter filter:chatFilter description:string = RecommendedChatFilter; +//@description Describes a recommended chat folder @folder The chat folder @param_description Chat folder description +recommendedChatFolder folder:chatFolder description:string = RecommendedChatFolder; -//@description Contains a list of recommended chat filters @chat_filters List of recommended chat filters -recommendedChatFilters chat_filters:vector = RecommendedChatFilters; +//@description Contains a list of recommended chat folders @chat_folders List of recommended chat folders +recommendedChatFolders chat_folders:vector = RecommendedChatFolders; + +//@description Contains settings for automatic moving of chats to and from the Archive chat lists +//@archive_and_mute_new_chats_from_unknown_users True, if new chats from non-contacts will be automatically archived and muted. Can be set to true only if the option "can_archive_and_mute_new_chats_from_unknown_users" is true +//@keep_unmuted_chats_archived True, if unmuted chats will be kept in the Archive chat list when they get a new message +//@keep_chats_from_folders_archived True, if unmuted chats, that are always included or pinned in a folder, will be kept in the Archive chat list when they get a new message. Ignored if keep_unmuted_chats_archived == true +archiveChatListSettings archive_and_mute_new_chats_from_unknown_users:Bool keep_unmuted_chats_archived:Bool keep_chats_from_folders_archived:Bool = ArchiveChatListSettings; //@class ChatList @description Describes a list of chats @@ -1329,8 +1543,8 @@ chatListMain = ChatList; //@description A list of chats usually located at the top of the main chat list. Unmuted chats are automatically moved from the Archive to the Main chat list when a new message arrives chatListArchive = ChatList; -//@description A list of chats belonging to a chat filter @chat_filter_id Chat filter identifier -chatListFilter chat_filter_id:int32 = ChatList; +//@description A list of chats added to a chat folder @chat_folder_id Chat folder identifier +chatListFolder chat_folder_id:int32 = ChatList; //@description Contains a list of chat lists @chat_lists List of chat lists chatLists chat_lists:vector = ChatLists; @@ -1374,14 +1588,16 @@ videoChat group_call_id:int32 has_participants:Bool default_participant_id:Messa //@type Type of the chat //@title Chat title //@photo Chat photo; may be null +//@accent_color_id Identifier of the accent color for message sender name, and backgrounds of chat photo, reply header, and link preview +//@background_custom_emoji_id Identifier of a custom emoji to be shown on the reply header background in replies to messages sent by the chat; 0 if none //@permissions Actions that non-administrator chat members are allowed to take in the chat -//@last_message Last message in the chat; may be null +//@last_message Last message in the chat; may be null if none or unknown //@positions Positions of the chat in chat lists //@message_sender_id Identifier of a user or chat that is selected to send messages in the chat; may be null if the user can't change message sender +//@block_list Block list to which the chat is added; may be null if none //@has_protected_content True, if chat content can't be saved locally, forwarded, or copied //@is_translatable True, if translation of all messages in the chat must be suggested to the user //@is_marked_as_unread True, if the chat is marked as unread -//@is_blocked True, if the chat is blocked by the current user and private messages from the chat can't be received //@has_scheduled_messages True, if the chat has scheduled messages //@can_be_deleted_only_for_self True, if the chat messages can be deleted only for the current user while other users will continue to see the messages //@can_be_deleted_for_all_users True, if the chat messages can be deleted for all users @@ -1395,14 +1611,15 @@ videoChat group_call_id:int32 has_participants:Bool default_participant_id:Messa //@notification_settings Notification settings for the chat //@available_reactions Types of reaction, available in the chat //@message_auto_delete_time Current message auto-delete or self-destruct timer setting for the chat, in seconds; 0 if disabled. Self-destruct timer in secret chats starts after the message or its content is viewed. Auto-delete timer in other chats starts from the send date +//@background Background set for the chat; may be null if none //@theme_name If non-empty, name of a theme, set for the chat -//@action_bar Information about actions which must be possible to do through the chat action bar; may be null +//@action_bar Information about actions which must be possible to do through the chat action bar; may be null if none //@video_chat Information about video chat of the chat -//@pending_join_requests Information about pending join requests; may be null +//@pending_join_requests Information about pending join requests; may be null if none //@reply_markup_message_id Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat -//@draft_message A draft of a message in the chat; may be null +//@draft_message A draft of a message in the chat; may be null if none //@client_data Application-specific data associated with the chat. (For example, the chat scroll position or local chat notification settings can be stored here.) Persistent if the message database is used -chat id:int53 type:ChatType title:string photo:chatPhotoInfo permissions:chatPermissions last_message:message positions:vector message_sender_id:MessageSender has_protected_content:Bool is_translatable:Bool is_marked_as_unread:Bool is_blocked:Bool has_scheduled_messages:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_reported:Bool default_disable_notification:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 unread_reaction_count:int32 notification_settings:chatNotificationSettings available_reactions:ChatAvailableReactions message_auto_delete_time:int32 theme_name:string action_bar:ChatActionBar video_chat:videoChat pending_join_requests:chatJoinRequestsInfo reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat; +chat id:int53 type:ChatType title:string photo:chatPhotoInfo accent_color_id:int32 background_custom_emoji_id:int64 permissions:chatPermissions last_message:message positions:vector message_sender_id:MessageSender block_list:BlockList has_protected_content:Bool is_translatable:Bool is_marked_as_unread:Bool has_scheduled_messages:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_reported:Bool default_disable_notification:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 unread_reaction_count:int32 notification_settings:chatNotificationSettings available_reactions:ChatAvailableReactions message_auto_delete_time:int32 background:chatBackground theme_name:string action_bar:ChatActionBar video_chat:videoChat pending_join_requests:chatJoinRequestsInfo reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat; //@description Represents a list of chats @total_count Approximate total number of chats found @chat_ids List of chat identifiers chats total_count:int32 chat_ids:vector = Chats; @@ -1426,20 +1643,20 @@ publicChatTypeIsLocationBased = PublicChatType; //@class ChatActionBar @description Describes actions which must be possible to do through a chat action bar -//@description The chat can be reported as spam using the method reportChat with the reason chatReportReasonSpam. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown +//@description The chat can be reported as spam using the method reportChat with the reason reportReasonSpam. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown //@can_unarchive If true, the chat was automatically archived and can be moved back to the main chat list using addChatToList simultaneously with setting chat notification settings to default using setChatNotificationSettings chatActionBarReportSpam can_unarchive:Bool = ChatActionBar; -//@description The chat is a location-based supergroup, which can be reported as having unrelated location using the method reportChat with the reason chatReportReasonUnrelatedLocation +//@description The chat is a location-based supergroup, which can be reported as having unrelated location using the method reportChat with the reason reportReasonUnrelatedLocation chatActionBarReportUnrelatedLocation = ChatActionBar; //@description The chat is a recently created group chat to which new members can be invited chatActionBarInviteMembers = ChatActionBar; -//@description The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be blocked using the method toggleMessageSenderIsBlocked, +//@description The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be blocked using the method setMessageSenderBlockList, //-or the other user can be added to the contact list using the method addContact. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown //@can_unarchive If true, the chat was automatically archived and can be moved back to the main chat list using addChatToList simultaneously with setting chat notification settings to default using setChatNotificationSettings -//@distance If non-negative, the current user was found by the peer through searchChatsNearby and this is the distance between the users +//@distance If non-negative, the current user was found by the other user through searchChatsNearby and this is the distance between the users chatActionBarReportAddBlock can_unarchive:Bool distance:int32 = ChatActionBar; //@description The chat is a private or secret chat and the other user can be added to the contact list using the method addContact @@ -1518,8 +1735,8 @@ inlineKeyboardButtonTypeCallbackWithPassword data:bytes = InlineKeyboardButtonTy //@description A button with a game that sends a callback query to a bot. This button must be in the first column and row of the keyboard and can be attached only to a message with content of the type messageGame inlineKeyboardButtonTypeCallbackGame = InlineKeyboardButtonType; -//@description A button that forces an inline query to the bot to be inserted in the input field @query Inline query to be sent to the bot @in_current_chat True, if the inline query must be sent from the current chat -inlineKeyboardButtonTypeSwitchInline query:string in_current_chat:Bool = InlineKeyboardButtonType; +//@description A button that forces an inline query to the bot to be inserted in the input field @query Inline query to be sent to the bot @target_chat Target chat from which to send the inline query +inlineKeyboardButtonTypeSwitchInline query:string target_chat:TargetChat = InlineKeyboardButtonType; //@description A button to buy something. This button must be in the first column and row of the keyboard and can be attached only to a message with content of the type messageInvoice inlineKeyboardButtonTypeBuy = InlineKeyboardButtonType; @@ -1586,7 +1803,7 @@ webAppInfo launch_id:int64 url:string = WebAppInfo; //@reply_info Information about the message thread; may be null for forum topic threads //@unread_message_count Approximate number of unread messages in the message thread //@messages The messages from which the thread starts. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id) -//@draft_message A draft of a message in the message thread; may be null +//@draft_message A draft of a message in the message thread; may be null if none messageThreadInfo chat_id:int53 message_thread_id:int53 reply_info:messageReplyInfo unread_message_count:int32 messages:vector draft_message:draftMessage = MessageThreadInfo; @@ -1597,7 +1814,7 @@ forumTopicIcon color:int32 custom_emoji_id:int64 = ForumTopicIcon; //@message_thread_id Message thread identifier of the topic //@name Name of the topic //@icon Icon of the topic -//@creation_date Date the topic was created +//@creation_date Point in time (Unix timestamp) when the topic was created //@creator_id Identifier of the creator of the topic //@is_general True, if the topic is the General topic list //@is_outgoing True, if the topic was created by the current user @@ -1615,7 +1832,7 @@ forumTopicInfo message_thread_id:int53 name:string icon:forumTopicIcon creation_ //@unread_mention_count Number of unread messages with a mention/reply in the topic //@unread_reaction_count Number of messages with unread reactions in the topic //@notification_settings Notification settings for the topic -//@draft_message A draft of a message in the topic; may be null +//@draft_message A draft of a message in the topic; may be null if none forumTopic info:forumTopicInfo last_message:message is_pinned:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 unread_reaction_count:int32 notification_settings:chatNotificationSettings draft_message:draftMessage = ForumTopic; //@description Describes a list of forum topics @@ -1627,6 +1844,15 @@ forumTopic info:forumTopicInfo last_message:message is_pinned:Bool unread_count: forumTopics total_count:int32 topics:vector next_offset_date:int32 next_offset_message_id:int53 next_offset_message_thread_id:int53 = ForumTopics; +//@description Options to be used for generation of a link preview +//@is_disabled True, if link preview must be disabled +//@url URL to use for link preview. If empty, then the first URL found in the message text will be used +//@force_small_media True, if shown media preview must be small; ignored in secret chats or if the URL isn't explicitly specified +//@force_large_media True, if shown media preview must be large; ignored in secret chats or if the URL isn't explicitly specified +//@show_above_text True, if link preview must be shown above message text; otherwise, the link preview will be shown below the message text; ignored in secret chats +linkPreviewOptions is_disabled:Bool url:string force_small_media:Bool force_large_media:Bool show_above_text:Bool = LinkPreviewOptions; + + //@class RichText @description Describes a text object inside an instant-view web page //@description A plain text @text Text @@ -1845,8 +2071,9 @@ pageBlockSlideshow page_blocks:vector caption:pageBlockCaption = Page //@description A link to a chat //@title Chat title //@photo Chat photo; may be null +//@accent_color_id Identifier of the accent color for chat title and background of chat photo //@username Chat username by which all other information about the chat can be resolved -pageBlockChatLink title:string photo:chatPhotoInfo username:string = PageBlock; +pageBlockChatLink title:string photo:chatPhotoInfo accent_color_id:int32 username:string = PageBlock; //@description A table //@caption Table caption @@ -1885,7 +2112,7 @@ pageBlockMap location:location zoom:int32 width:int32 height:int32 caption:pageB webPageInstantView page_blocks:vector view_count:int32 version:int32 is_rtl:Bool is_full:Bool feedback_link:InternalLinkType = WebPageInstantView; -//@description Describes a web page preview +//@description Describes a link preview //@url Original URL of the link //@display_url URL to display //@type Type of the web page. Can be: article, photo, audio, video, document, profile, app, or something else @@ -1899,6 +2126,10 @@ webPageInstantView page_blocks:vector view_count:int32 version:int32 //@embed_height Height of the embedded preview //@duration Duration of the content, in seconds //@author Author of the content +//@has_large_media True, if size of media in the preview can be changed +//@show_large_media True, if large media preview must be shown; otherwise, the media preview must be shown small and only the first frame must be shown for videos +//@skip_confirmation True, if there is no need to show an ordinary open URL confirmation, when opening the URL from the preview, because the URL is shown in the message text in clear +//@show_above_text True, if the link preview must be shown above message text; otherwise, the link preview must be shown below the message text //@animation Preview of the content as an animation, if available; may be null //@audio Preview of the content as an audio file, if available; may be null //@document Preview of the content as a document, if available; may be null @@ -1906,8 +2137,10 @@ webPageInstantView page_blocks:vector view_count:int32 version:int32 //@video Preview of the content as a video, if available; may be null //@video_note Preview of the content as a video note, if available; may be null //@voice_note Preview of the content as a voice note, if available; may be null +//@story_sender_chat_id The identifier of the sender of the previewed story; 0 if none +//@story_id The identifier of the previewed story; 0 if none //@instant_view_version Version of web page instant view (currently, can be 1 or 2); 0 if none -webPage url:string display_url:string type:string site_name:string title:string description:formattedText photo:photo embed_url:string embed_type:string embed_width:int32 embed_height:int32 duration:int32 author:string animation:animation audio:audio document:document sticker:sticker video:video video_note:videoNote voice_note:voiceNote instant_view_version:int32 = WebPage; +webPage url:string display_url:string type:string site_name:string title:string description:formattedText photo:photo embed_url:string embed_type:string embed_width:int32 embed_height:int32 duration:int32 author:string has_large_media:Bool show_large_media:Bool skip_confirmation:Bool show_above_text:Bool animation:animation audio:audio document:document sticker:sticker video:video video_note:videoNote voice_note:voiceNote story_sender_chat_id:int53 story_id:int32 instant_view_version:int32 = WebPage; //@description Contains information about a country @@ -1949,12 +2182,18 @@ address country_code:string state:string city:string street_line1:string street_ //@description Contains parameters of the application theme //@background_color A color of the background in the RGB24 format //@secondary_background_color A secondary color for the background in the RGB24 format +//@header_background_color A color of the header background in the RGB24 format +//@section_background_color A color of the section background in the RGB24 format //@text_color A color of text in the RGB24 format +//@accent_text_color An accent color of the text in the RGB24 format +//@section_header_text_color A color of text on the section headers in the RGB24 format +//@subtitle_text_color A color of the subtitle text in the RGB24 format +//@destructive_text_color A color of the text for destructive actions in the RGB24 format //@hint_color A color of hints in the RGB24 format //@link_color A color of links in the RGB24 format //@button_color A color of the buttons in the RGB24 format //@button_text_color A color of text on the buttons in the RGB24 format -themeParameters background_color:int32 secondary_background_color:int32 text_color:int32 hint_color:int32 link_color:int32 button_color:int32 button_text_color:int32 = ThemeParameters; +themeParameters background_color:int32 secondary_background_color:int32 header_background_color:int32 section_background_color:int32 text_color:int32 accent_text_color:int32 section_header_text_color:int32 subtitle_text_color:int32 destructive_text_color:int32 hint_color:int32 link_color:int32 button_color:int32 button_text_color:int32 = ThemeParameters; //@description Portion of the price of a product (e.g., "delivery cost", "tax amount") @label Label for this portion of the product price @amount Currency amount in the smallest units of the currency @@ -1966,6 +2205,7 @@ labeledPricePart label:string amount:int53 = LabeledPricePart; //@max_tip_amount The maximum allowed amount of tip in the smallest units of the currency //@suggested_tip_amounts Suggested amounts of tip in the smallest units of the currency //@recurring_payment_terms_of_service_url An HTTP URL with terms of service for recurring payments. If non-empty, the invoice payment will result in recurring payments and the user must accept the terms of service before allowed to pay +//@terms_of_service_url An HTTP URL with terms of service for non-recurring payments. If non-empty, then the user must accept the terms of service before allowed to pay //@is_test True, if the payment is a test payment //@need_name True, if the user's name is needed for payment //@need_phone_number True, if the user's phone number is needed for payment @@ -1974,7 +2214,7 @@ labeledPricePart label:string amount:int53 = LabeledPricePart; //@send_phone_number_to_provider True, if the user's phone number will be sent to the provider //@send_email_address_to_provider True, if the user's email address will be sent to the provider //@is_flexible True, if the total price depends on the shipping method -invoice currency:string price_parts:vector max_tip_amount:int53 suggested_tip_amounts:vector recurring_payment_terms_of_service_url:string is_test:Bool need_name:Bool need_phone_number:Bool need_email_address:Bool need_shipping_address:Bool send_phone_number_to_provider:Bool send_email_address_to_provider:Bool is_flexible:Bool = Invoice; +invoice currency:string price_parts:vector max_tip_amount:int53 suggested_tip_amounts:vector recurring_payment_terms_of_service_url:string terms_of_service_url:string is_test:Bool need_name:Bool need_phone_number:Bool need_email_address:Bool need_shipping_address:Bool send_phone_number_to_provider:Bool send_email_address_to_provider:Bool is_flexible:Bool = Invoice; //@description Order information //@name Name of the user @@ -2073,6 +2313,9 @@ inputInvoiceMessage chat_id:int53 message_id:int53 = InputInvoice; //@description An invoice from a link of the type internalLinkTypeInvoice @name Name of the invoice inputInvoiceName name:string = InputInvoice; +//@description An invoice for a payment toward Telegram; must not be used in the in-store apps @purpose Transaction purpose +inputInvoiceTelegram purpose:TelegramPaymentPurpose = InputInvoice; + //@class MessageExtendedMedia @description Describes a media, which is attached to an invoice @@ -2094,6 +2337,15 @@ messageExtendedMediaVideo video:video caption:formattedText = MessageExtendedMed messageExtendedMediaUnsupported caption:formattedText = MessageExtendedMedia; +//@description Describes parameters of a Telegram Premium giveaway +//@boosted_chat_id Identifier of the channel chat, which will be automatically boosted by the winners of the giveaway for duration of the Premium subscription +//@additional_chat_ids Identifiers of other channel chats that must be subscribed by the users to be eligible for the giveaway. There can be up to getOption("giveaway_additional_chat_count_max") additional chats +//@winners_selection_date Point in time (Unix timestamp) when the giveaway is expected to be performed; must be 60-getOption("giveaway_duration_max") seconds in the future in scheduled giveaways +//@only_new_members True, if only new subscribers of the chats will be eligible for the giveaway +//@country_codes The list of two-letter ISO 3166-1 alpha-2 codes of countries, users from which will be eligible for the giveaway. If empty, then all users can participate in the giveaway. +//-There can be up to getOption("giveaway_country_count_max") chosen countries. Users with phone number that was bought on Fragment can participate in any giveaway and the country code "FT" must not be specified in the list +premiumGiveawayParameters boosted_chat_id:int53 additional_chat_ids:vector winners_selection_date:int32 only_new_members:Bool country_codes:vector = PremiumGiveawayParameters; + //@description File with the date it was uploaded @file The file @date Point in time (Unix timestamp) when the file was uploaded datedFile file:file date:int32 = DatedFile; @@ -2159,21 +2411,21 @@ personalDetails first_name:string middle_name:string last_name:string native_fir //@description An identity document //@number Document number; 1-24 characters -//@expiry_date Document expiry date; may be null if not applicable +//@expiration_date Document expiration date; may be null if not applicable //@front_side Front side of the document //@reverse_side Reverse side of the document; only for driver license and identity card; may be null //@selfie Selfie with the document; may be null //@translation List of files containing a certified English translation of the document -identityDocument number:string expiry_date:date front_side:datedFile reverse_side:datedFile selfie:datedFile translation:vector = IdentityDocument; +identityDocument number:string expiration_date:date front_side:datedFile reverse_side:datedFile selfie:datedFile translation:vector = IdentityDocument; //@description An identity document to be saved to Telegram Passport //@number Document number; 1-24 characters -//@expiry_date Document expiry date; pass null if not applicable +//@expiration_date Document expiration date; pass null if not applicable //@front_side Front side of the document //@reverse_side Reverse side of the document; only for driver license and identity card; pass null otherwise //@selfie Selfie with the document; pass null if unavailable //@translation List of files containing a certified English translation of the document -inputIdentityDocument number:string expiry_date:date front_side:InputFile reverse_side:InputFile selfie:InputFile translation:vector = InputIdentityDocument; +inputIdentityDocument number:string expiration_date:date front_side:InputFile reverse_side:InputFile selfie:InputFile translation:vector = InputIdentityDocument; //@description A personal document, containing some information about a user @files List of files containing the pages of the document @translation List of files containing a certified English translation of the document personalDocument files:vector translation:vector = PersonalDocument; @@ -2377,8 +2629,11 @@ inputPassportElementError type:PassportElementType message:string source:InputPa //@class MessageContent @description Contains the content of a message -//@description A text message @text Text of the message @web_page A preview of the web page that's mentioned in the text; may be null -messageText text:formattedText web_page:webPage = MessageContent; +//@description A text message +//@text Text of the message +//@web_page A link preview attached to the message; may be null +//@link_preview_options Options which was used for generation of the link preview; may be null if default options were used +messageText text:formattedText web_page:webPage link_preview_options:linkPreviewOptions = MessageContent; //@description An animation message (GIF-style). //@animation The animation description @@ -2453,6 +2708,12 @@ messageGame game:game = MessageContent; //@description A message with a poll @poll The poll description messagePoll poll:poll = MessageContent; +//@description A message with a forwarded story +//@story_sender_chat_id Identifier of the chat that posted the story +//@story_id Story identifier +//@via_mention True, if the story was automatically forwarded because of a mention of the user +messageStory story_sender_chat_id:int53 story_id:int32 via_mention:Bool = MessageContent; + //@description A message with an invoice from a bot. Use getInternalLink with internalLinkTypeBotStart to share the invoice //@title Product title //@param_description Product description @@ -2520,6 +2781,9 @@ messagePinMessage message_id:int53 = MessageContent; //@description A screenshot of a message in the chat has been taken messageScreenshotTaken = MessageContent; +//@description A new background was set in the chat @old_background_message_id Identifier of the message with a previously set same background; 0 if none. Can be an identifier of a deleted message @background The new background +messageChatSetBackground old_background_message_id:int53 background:chatBackground = MessageContent; + //@description A theme in the chat has been changed @theme_name If non-empty, name of a new theme, set for the chat. Otherwise, chat theme was reset to the default one messageChatSetTheme theme_name:string = MessageContent; @@ -2573,11 +2837,33 @@ messagePaymentSuccessful invoice_chat_id:int53 invoice_message_id:int53 currency messagePaymentSuccessfulBot currency:string total_amount:int53 is_recurring:Bool is_first_recurring:Bool invoice_payload:bytes shipping_option_id:string order_info:orderInfo telegram_payment_charge_id:string provider_payment_charge_id:string = MessageContent; //@description Telegram Premium was gifted to the user +//@gifter_user_id The identifier of a user that gifted Telegram Premium; 0 if the gift was anonymous //@currency Currency for the paid amount //@amount The paid amount, in the smallest units of the currency +//@cryptocurrency Cryptocurrency used to pay for the gift; may be empty if none +//@cryptocurrency_amount The paid amount, in the smallest units of the cryptocurrency //@month_count Number of month the Telegram Premium subscription will be active //@sticker A sticker to be shown in the message; may be null if unknown -messageGiftedPremium currency:string amount:int53 month_count:int32 sticker:sticker = MessageContent; +messageGiftedPremium gifter_user_id:int53 currency:string amount:int53 cryptocurrency:string cryptocurrency_amount:int64 month_count:int32 sticker:sticker = MessageContent; + +//@description A Telegram Premium gift code was created for the user +//@creator_id Identifier of a chat or a user that created the gift code +//@is_from_giveaway True, if the gift code was created for a giveaway +//@is_unclaimed True, if the winner for the corresponding Telegram Premium subscription wasn't chosen +//@month_count Number of month the Telegram Premium subscription will be active after code activation +//@sticker A sticker to be shown in the message; may be null if unknown +//@code The gift code +messagePremiumGiftCode creator_id:MessageSender is_from_giveaway:Bool is_unclaimed:Bool month_count:int32 sticker:sticker code:string = MessageContent; + +//@description A Telegram Premium giveaway was created for the chat +messagePremiumGiveawayCreated = MessageContent; + +//@description A Telegram Premium giveaway +//@parameters Giveaway parameters +//@winner_count Number of users which will receive Telegram Premium subscription gift codes +//@month_count Number of month the Telegram Premium subscription will be active after code activation +//@sticker A sticker to be shown in the message; may be null if unknown +messagePremiumGiveaway parameters:premiumGiveawayParameters winner_count:int32 month_count:int32 sticker:sticker = MessageContent; //@description A contact has registered with Telegram messageContactRegistered = MessageContent; @@ -2588,16 +2874,13 @@ messageUserShared user_id:int53 button_id:int32 = MessageContent; //@description The current user shared a chat, which was requested by the bot @chat_id Identifier of the shared chat @button_id Identifier of the keyboard button with the request messageChatShared chat_id:int53 button_id:int32 = MessageContent; -//@description The current user has connected a website by logging in using Telegram Login Widget on it @domain_name Domain name of the connected website -messageWebsiteConnected domain_name:string = MessageContent; - -//@description The user allowed the bot to send messages @web_app Information about the Web App, which requested the access; may be null if none or the Web App was opened from the attachment menu -messageBotWriteAccessAllowed web_app:webApp = MessageContent; +//@description The user allowed the bot to send messages @reason The reason why the bot was allowed to write messages +messageBotWriteAccessAllowed reason:BotWriteAccessAllowReason = MessageContent; //@description Data from a Web App has been sent to a bot @button_text Text of the keyboardButtonTypeWebApp button, which opened the Web App messageWebAppDataSent button_text:string = MessageContent; -//@description Data from a Web App has been received; for bots only @button_text Text of the keyboardButtonTypeWebApp button, which opened the Web App @data Received data +//@description Data from a Web App has been received; for bots only @button_text Text of the keyboardButtonTypeWebApp button, which opened the Web App @data The data messageWebAppDataReceived button_text:string data:string = MessageContent; //@description Telegram Passport data has been sent to a bot @types List of Telegram Passport element types sent @@ -2609,7 +2892,7 @@ messagePassportDataReceived elements:vector credential //@description A user in the chat came within proximity alert range @traveler_id The identifier of a user or chat that triggered the proximity alert @watcher_id The identifier of a user or chat that subscribed for the proximity alert @distance The distance between the users messageProximityAlertTriggered traveler_id:MessageSender watcher_id:MessageSender distance:int32 = MessageContent; -//@description Message content that is not supported in the current TDLib version +//@description A message content that is not supported in the current TDLib version messageUnsupported = MessageContent; @@ -2663,6 +2946,9 @@ textEntityTypePre = TextEntityType; //@description Text that must be formatted as if inside pre, and code HTML tags @language Programming language of the code; as defined by the sender textEntityTypePreCode language:string = TextEntityType; +//@description Text that must be formatted as if inside a blockquote HTML tag +textEntityTypeBlockQuote = TextEntityType; + //@description A text description shown instead of a raw URL @url HTTP or tg:// URL to be opened when the link is clicked textEntityTypeTextUrl url:string = TextEntityType; @@ -2672,7 +2958,7 @@ textEntityTypeMentionName user_id:int53 = TextEntityType; //@description A custom emoji. The text behind a custom emoji must be an emoji. Only premium users can use premium custom emoji @custom_emoji_id Unique identifier of the custom emoji textEntityTypeCustomEmoji custom_emoji_id:int64 = TextEntityType; -//@description A media timestamp @media_timestamp Timestamp from which a video/audio/video note/voice note playing must start, in seconds. The media can be in the content or the web page preview of the current message, or in the same places in the replied message +//@description A media timestamp @media_timestamp Timestamp from which a video/audio/video note/voice note/story playing must start, in seconds. The media can be in the content or the web page preview of the current message, or in the same places in the replied message textEntityTypeMediaTimestamp media_timestamp:int32 = TextEntityType; @@ -2685,13 +2971,22 @@ inputThumbnail thumbnail:InputFile width:int32 height:int32 = InputThumbnail; //@class MessageSchedulingState @description Contains information about the time when a scheduled message will be sent -//@description The message will be sent at the specified date @send_date Date the message will be sent. The date must be within 367 days in the future +//@description The message will be sent at the specified date @send_date Point in time (Unix timestamp) when the message will be sent. The date must be within 367 days in the future messageSchedulingStateSendAtDate send_date:int32 = MessageSchedulingState; -//@description The message will be sent when the peer will be online. Applicable to private chats only and when the exact online status of the peer is known +//@description The message will be sent when the other user is online. Applicable to private chats only and when the exact online status of the other user is known messageSchedulingStateSendWhenOnline = MessageSchedulingState; +//@class MessageSelfDestructType @description Describes when a message will be self-destructed + +//@description The message will be self-destructed in the specified time after its content was opened @self_destruct_time The message's self-destruct time, in seconds; must be between 0 and 60 in private chats +messageSelfDestructTypeTimer self_destruct_time:int32 = MessageSelfDestructType; + +//@description The message can be opened only once and will be self-destructed once closed +messageSelfDestructTypeImmediately = MessageSelfDestructType; + + //@description Options to be used when a message is sent //@disable_notification Pass true to disable notification for the message //@from_background Pass true if the message is sent from the background @@ -2699,9 +2994,10 @@ messageSchedulingStateSendWhenOnline = MessageSchedulingState; //@update_order_of_installed_sticker_sets Pass true if the user explicitly chosen a sticker or a custom emoji from an installed sticker set; applicable only to sendMessage and sendMessageAlbum //@scheduling_state Message scheduling state; pass null to send message immediately. Messages sent to a secret chat, live location messages and self-destructing messages can't be scheduled //@sending_id Non-persistent identifier, which will be returned back in messageSendingStatePending object and can be used to match sent messages and corresponding updateNewMessage updates -messageSendOptions disable_notification:Bool from_background:Bool protect_content:Bool update_order_of_installed_sticker_sets:Bool scheduling_state:MessageSchedulingState sending_id:int32 = MessageSendOptions; +//@only_preview Pass true to get a fake message instead of actually sending them +messageSendOptions disable_notification:Bool from_background:Bool protect_content:Bool update_order_of_installed_sticker_sets:Bool scheduling_state:MessageSchedulingState sending_id:int32 only_preview:Bool = MessageSendOptions; -//@description Options to be used when a message content is copied without reference to the original sender. Service messages and messageInvoice can't be copied +//@description Options to be used when a message content is copied without reference to the original sender. Service messages, and messages with messageInvoice or messagePremiumGiveaway content can't be copied //@send_copy True, if content of the message needs to be copied without reference to the original sender. Always true if the message is forwarded to a secret chat or is local //@replace_caption True, if media caption of the message copy needs to be replaced. Ignored if send_copy is false //@new_caption New message caption; pass null to copy message without caption. Ignored if replace_caption is false @@ -2711,10 +3007,10 @@ messageCopyOptions send_copy:Bool replace_caption:Bool new_caption:formattedText //@class InputMessageContent @description The content of a message to send //@description A text message -//@text Formatted text to be sent; 1-getOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually -//@disable_web_page_preview True, if rich web page previews for URLs in the message text must be disabled +//@text Formatted text to be sent; 0-getOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually +//@link_preview_options Options to be used for generation of a link preview; pass null to use default link preview options //@clear_draft True, if a chat message draft must be deleted -inputMessageText text:formattedText disable_web_page_preview:Bool clear_draft:Bool = InputMessageContent; +inputMessageText text:formattedText link_preview_options:linkPreviewOptions clear_draft:Bool = InputMessageContent; //@description An animation message (GIF-style). //@animation Animation file to be sent @@ -2739,7 +3035,7 @@ inputMessageAudio audio:InputFile album_cover_thumbnail:inputThumbnail duration: //@description A document message (general file) //@document Document to be sent //@thumbnail Document thumbnail; pass null to skip thumbnail uploading -//@disable_content_type_detection If true, automatic file type detection will be disabled and the document will always be sent as file. Always true for files sent to secret chats +//@disable_content_type_detection True, if automatic file type detection is disabled and the document must be sent as a file. Always true for files sent to secret chats //@caption Document caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters inputMessageDocument document:InputFile thumbnail:inputThumbnail disable_content_type_detection:Bool caption:formattedText = InputMessageContent; @@ -2750,9 +3046,10 @@ inputMessageDocument document:InputFile thumbnail:inputThumbnail disable_content //@width Photo width //@height Photo height //@caption Photo caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters -//@self_destruct_time Photo self-destruct time, in seconds (0-60). A non-zero self-destruct time can be specified only in private chats +//@self_destruct_type Photo self-destruct type; pass null if none; private chats only //@has_spoiler True, if the photo preview must be covered by a spoiler animation; not supported in secret chats -inputMessagePhoto photo:InputFile thumbnail:inputThumbnail added_sticker_file_ids:vector width:int32 height:int32 caption:formattedText self_destruct_time:int32 has_spoiler:Bool = InputMessageContent; +inputMessagePhoto photo:InputFile thumbnail:inputThumbnail added_sticker_file_ids:vector width:int32 height:int32 caption:formattedText self_destruct_type:MessageSelfDestructType has_spoiler:Bool = InputMessageContent; + //@description A sticker message //@sticker Sticker to be sent @@ -2771,9 +3068,9 @@ inputMessageSticker sticker:InputFile thumbnail:inputThumbnail width:int32 heigh //@height Video height //@supports_streaming True, if the video is supposed to be streamed //@caption Video caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters -//@self_destruct_time Video self-destruct time, in seconds (0-60). A non-zero self-destruct time can be specified only in private chats +//@self_destruct_type Video self-destruct type; pass null if none; private chats only //@has_spoiler True, if the video preview must be covered by a spoiler animation; not supported in secret chats -inputMessageVideo video:InputFile thumbnail:inputThumbnail added_sticker_file_ids:vector duration:int32 width:int32 height:int32 supports_streaming:Bool caption:formattedText self_destruct_time:int32 has_spoiler:Bool = InputMessageContent; +inputMessageVideo video:InputFile thumbnail:inputThumbnail added_sticker_file_ids:vector duration:int32 width:int32 height:int32 supports_streaming:Bool caption:formattedText self_destruct_type:MessageSelfDestructType has_spoiler:Bool = InputMessageContent; //@description A video note message //@video_note Video note to be sent @@ -2833,9 +3130,14 @@ inputMessageInvoice invoice:invoice title:string description:string photo_url:st //@is_closed True, if the poll needs to be sent already closed; for bots only inputMessagePoll question:string options:vector is_anonymous:Bool type:PollType open_period:int32 close_date:int32 is_closed:Bool = InputMessageContent; +//@description A message with a forwarded story. Stories can't be sent to secret chats. A story can be forwarded only if story.can_be_forwarded +//@story_sender_chat_id Identifier of the chat that posted the story +//@story_id Story identifier +inputMessageStory story_sender_chat_id:int53 story_id:int32 = InputMessageContent; + //@description A forwarded message //@from_chat_id Identifier for the chat this forwarded message came from -//@message_id Identifier of the message to forward +//@message_id Identifier of the message to forward. A message can be forwarded only if message.can_be_forwarded //@in_game_share True, if a game message is being shared from a launched game; applies only to game messages //@copy_options Options to be used to copy content of the message without reference to the original sender; pass null to forward the message as usual inputMessageForwarded from_chat_id:int53 message_id:int53 in_game_share:Bool copy_options:messageCopyOptions = InputMessageContent; @@ -2981,10 +3283,11 @@ emojis emojis:vector = Emojis; //@is_official True, if the sticker set is official //@sticker_format Format of the stickers in the set //@sticker_type Type of the stickers in the set +//@needs_repainting True, if stickers in the sticker set are custom emoji that must be repainted; for custom emoji sticker sets only //@is_viewed True for already viewed trending sticker sets //@stickers List of stickers in this set //@emojis A list of emoji corresponding to the stickers in the same order. The list is only for informational purposes, because a sticker is always sent with a fixed emoji from the corresponding Sticker object -stickerSet id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector is_installed:Bool is_archived:Bool is_official:Bool sticker_format:StickerFormat sticker_type:StickerType is_viewed:Bool stickers:vector emojis:vector = StickerSet; +stickerSet id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector is_installed:Bool is_archived:Bool is_official:Bool sticker_format:StickerFormat sticker_type:StickerType needs_repainting:Bool is_viewed:Bool stickers:vector emojis:vector = StickerSet; //@description Represents short information about a sticker set //@id Identifier of the sticker set @@ -2997,10 +3300,11 @@ stickerSet id:int64 title:string name:string thumbnail:thumbnail thumbnail_outli //@is_official True, if the sticker set is official //@sticker_format Format of the stickers in the set //@sticker_type Type of the stickers in the set +//@needs_repainting True, if stickers in the sticker set are custom emoji that must be repainted; for custom emoji sticker sets only //@is_viewed True for already viewed trending sticker sets //@size Total number of stickers in the set //@covers Up to the first 5 stickers from the set, depending on the context. If the application needs more stickers the full sticker set needs to be requested -stickerSetInfo id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector is_installed:Bool is_archived:Bool is_official:Bool sticker_format:StickerFormat sticker_type:StickerType is_viewed:Bool size:int32 covers:vector = StickerSetInfo; +stickerSetInfo id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector is_installed:Bool is_archived:Bool is_official:Bool sticker_format:StickerFormat sticker_type:StickerType needs_repainting:Bool is_viewed:Bool size:int32 covers:vector = StickerSetInfo; //@description Represents a list of sticker sets @total_count Approximate total number of sticker sets found @sets List of sticker sets stickerSets total_count:int32 sets:vector = StickerSets; @@ -3031,6 +3335,239 @@ emojiCategoryTypeEmojiStatus = EmojiCategoryType; emojiCategoryTypeChatPhoto = EmojiCategoryType; +//@description Represents a viewer of a story +//@user_id User identifier of the viewer +//@view_date Approximate point in time (Unix timestamp) when the story was viewed +//@block_list Block list to which the user is added; may be null if none +//@chosen_reaction_type Type of the reaction that was chosen by the user; may be null if none +storyViewer user_id:int53 view_date:int32 block_list:BlockList chosen_reaction_type:ReactionType = StoryViewer; + +//@description Represents a list of story viewers +//@total_count Approximate total number of story viewers found +//@total_reaction_count Approximate total number of reactions set by found story viewers +//@viewers List of story viewers +//@next_offset The offset for the next request. If empty, there are no more results +storyViewers total_count:int32 total_reaction_count:int32 viewers:vector next_offset:string = StoryViewers; + + +//@description Describes position of a clickable rectangle area on a story media +//@x_percentage The abscissa of the rectangle's center, as a percentage of the media width +//@y_percentage The ordinate of the rectangle's center, as a percentage of the media height +//@width_percentage The width of the rectangle, as a percentage of the media width +//@height_percentage The height of the rectangle, as a percentage of the media height +//@rotation_angle Clockwise rotation angle of the rectangle, in degrees; 0-360 +storyAreaPosition x_percentage:double y_percentage:double width_percentage:double height_percentage:double rotation_angle:double = StoryAreaPosition; + + +//@class StoryAreaType @description Describes type of a clickable rectangle area on a story media + +//@description An area pointing to a location @location The location +storyAreaTypeLocation location:location = StoryAreaType; + +//@description An area pointing to a venue @venue Information about the venue +storyAreaTypeVenue venue:venue = StoryAreaType; + +//@description An area pointing to a suggested reaction. App needs to show a clickable reaction on the area and call setStoryReaction when the are is clicked +//@reaction_type Type of the reaction +//@total_count Number of times the reaction was added +//@is_dark True, if reaction has a dark background +//@is_flipped True, if reaction corner is flipped +storyAreaTypeSuggestedReaction reaction_type:ReactionType total_count:int32 is_dark:Bool is_flipped:Bool = StoryAreaType; + + +//@description Describes a clickable rectangle area on a story media @position Position of the area @type Type of the area +storyArea position:storyAreaPosition type:StoryAreaType = StoryArea; + + +//@class InputStoryAreaType @description Describes type of a clickable rectangle area on a story media to be added + +//@description An area pointing to a location @location The location +inputStoryAreaTypeLocation location:location = InputStoryAreaType; + +//@description An area pointing to a venue found by the bot getOption("venue_search_bot_username") +//@query_id Identifier of the inline query, used to found the venue +//@result_id Identifier of the inline query result +inputStoryAreaTypeFoundVenue query_id:int64 result_id:string = InputStoryAreaType; + +//@description An area pointing to a venue already added to the story +//@venue_provider Provider of the venue +//@venue_id Identifier of the venue in the provider database +inputStoryAreaTypePreviousVenue venue_provider:string venue_id:string = InputStoryAreaType; + +//@description An area pointing to a suggested reaction +//@reaction_type Type of the reaction +//@is_dark True, if reaction has a dark background +//@is_flipped True, if reaction corner is flipped +inputStoryAreaTypeSuggestedReaction reaction_type:ReactionType is_dark:Bool is_flipped:Bool = InputStoryAreaType; + + +//@description Describes a clickable rectangle area on a story media to be added @position Position of the area @type Type of the area +inputStoryArea position:storyAreaPosition type:InputStoryAreaType = InputStoryArea; + +//@description Contains a list of story areas to be added @areas List of 0-10 input story areas +inputStoryAreas areas:vector = InputStoryAreas; + + +//@description Describes a video file sent in a story +//@duration Duration of the video, in seconds +//@width Video width +//@height Video height +//@has_stickers True, if stickers were added to the video. The list of corresponding sticker sets can be received using getAttachedStickerSets +//@is_animation True, if the video has no sound +//@minithumbnail Video minithumbnail; may be null +//@thumbnail Video thumbnail in JPEG or MPEG4 format; may be null +//@preload_prefix_size Size of file prefix, which is supposed to be preloaded, in bytes +//@video File containing the video +storyVideo duration:double width:int32 height:int32 has_stickers:Bool is_animation:Bool minithumbnail:minithumbnail thumbnail:thumbnail preload_prefix_size:int32 video:file = StoryVideo; + + +//@class StoryContent @description Contains the content of a story + +//@description A photo story @photo The photo +storyContentPhoto photo:photo = StoryContent; + +//@description A video story @video The video in MPEG4 format @alternative_video Alternative version of the video in MPEG4 format, encoded by x264 codec; may be null +storyContentVideo video:storyVideo alternative_video:storyVideo = StoryContent; + +//@description A story content that is not supported in the current TDLib version +storyContentUnsupported = StoryContent; + + +//@class InputStoryContent @description The content of a story to send + +//@description A photo story +//@photo Photo to send. The photo must be at most 10 MB in size. The photo size must be 1080x1920 +//@added_sticker_file_ids File identifiers of the stickers added to the photo, if applicable +inputStoryContentPhoto photo:InputFile added_sticker_file_ids:vector = InputStoryContent; + +//@description A video story +//@video Video to be sent. The video size must be 720x1280. The video must be streamable and stored in MPEG4 format, after encoding with x265 codec and key frames added each second +//@added_sticker_file_ids File identifiers of the stickers added to the video, if applicable +//@duration Precise duration of the video, in seconds; 0-60 +//@is_animation True, if the video has no sound +inputStoryContentVideo video:InputFile added_sticker_file_ids:vector duration:double is_animation:Bool = InputStoryContent; + + +//@class StoryList @description Describes a list of stories + +//@description The list of stories, shown in the main chat list and folder chat lists +storyListMain = StoryList; + +//@description The list of stories, shown in the Arvhive chat list +storyListArchive = StoryList; + + +//@description Contains information about interactions with a story +//@view_count Number of times the story was viewed +//@forward_count Number of times the story was forwarded; 0 if none or unknown +//@reaction_count Number of reactions added to the story; 0 if none or unknown +//@recent_viewer_user_ids Identifiers of at most 3 recent viewers of the story +storyInteractionInfo view_count:int32 forward_count:int32 reaction_count:int32 recent_viewer_user_ids:vector = StoryInteractionInfo; + +//@description Represents a story +//@id Unique story identifier among stories of the given sender +//@sender_chat_id Identifier of the chat that posted the story +//@date Point in time (Unix timestamp) when the story was published +//@is_being_sent True, if the story is being sent by the current user +//@is_being_edited True, if the story is being edited by the current user +//@is_edited True, if the story was edited +//@is_pinned True, if the story is saved in the sender's profile and will be available there after expiration +//@is_visible_only_for_self True, if the story is visible only for the current user +//@can_be_deleted True, if the story can be deleted +//@can_be_edited True, if the story can be edited +//@can_be_forwarded True, if the story can be forwarded as a message. Otherwise, screenshots and saving of the story content must be also forbidden +//@can_be_replied True, if the story can be replied in the chat with the story sender +//@can_toggle_is_pinned True, if the story's is_pinned value can be changed +//@can_get_viewers True, if users viewed the story can be received through getStoryViewers +//@has_expired_viewers True, if users viewed the story can't be received, because the story has expired more than getOption("story_viewers_expiration_delay") seconds ago +//@interaction_info Information about interactions with the story; may be null if the story isn't owned or there were no interactions +//@chosen_reaction_type Type of the chosen reaction; may be null if none +//@privacy_settings Privacy rules affecting story visibility; may be approximate for non-owned stories +//@content Content of the story +//@areas Clickable areas to be shown on the story content +//@caption Caption of the story +story id:int32 sender_chat_id:int53 date:int32 is_being_sent:Bool is_being_edited:Bool is_edited:Bool is_pinned:Bool is_visible_only_for_self:Bool can_be_deleted:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_replied:Bool can_toggle_is_pinned:Bool can_get_viewers:Bool has_expired_viewers:Bool interaction_info:storyInteractionInfo chosen_reaction_type:ReactionType privacy_settings:StoryPrivacySettings content:StoryContent areas:vector caption:formattedText = Story; + +//@description Represents a list of stories @total_count Approximate total number of stories found @stories The list of stories +stories total_count:int32 stories:vector = Stories; + +//@description Contains basic information about a story +//@story_id Unique story identifier among stories of the given sender +//@date Point in time (Unix timestamp) when the story was published +//@is_for_close_friends True, if the story is available only to close friends +storyInfo story_id:int32 date:int32 is_for_close_friends:Bool = StoryInfo; + +//@description Describes active stories posted by a chat +//@chat_id Identifier of the chat that posted the stories +//@list Identifier of the story list in which the stories are shown; may be null if the stories aren't shown in a story list +//@order A parameter used to determine order of the stories in the story list; 0 if the stories doesn't need to be shown in the story list. Stories must be sorted by the pair (order, story_sender_chat_id) in descending order +//@max_read_story_id Identifier of the last read active story +//@stories Basic information about the stories; use getStory to get full information about the stories. The stories are in a chronological order (i.e., in order of increasing story identifiers) +chatActiveStories chat_id:int53 list:StoryList order:int53 max_read_story_id:int32 stories:vector = ChatActiveStories; + + +//@class ChatBoostSource @description Describes source of a chat boost + +//@description The chat created a Telegram Premium gift code for a user +//@user_id Identifier of a user, for which the gift code was created +//@gift_code The created Telegram Premium gift code, which is known only if this is a gift code for the current user, or it has already been claimed +chatBoostSourceGiftCode user_id:int53 gift_code:string = ChatBoostSource; + +//@description The chat created a Telegram Premium giveaway +//@user_id Identifier of a user that won in the giveaway; 0 if none +//@gift_code The created Telegram Premium gift code if it was used by the user or can be claimed by the current user; an empty string otherwise +//@giveaway_message_id Identifier of the corresponding giveaway message; can be an identifier of a deleted message +//@is_unclaimed True, if the winner for the corresponding Telegram Premium subscription wasn't chosen, because there were not enough participants +chatBoostSourceGiveaway user_id:int53 gift_code:string giveaway_message_id:int53 is_unclaimed:Bool = ChatBoostSource; + +//@description A user with Telegram Premium subscription or gifted Telegram Premium boosted the chat +//@user_id Identifier of the user +chatBoostSourcePremium user_id:int53 = ChatBoostSource; + + +//@description Describes a prepaid Telegram Premium giveaway +//@id Unique identifier of the prepaid giveaway +//@winner_count Number of users which will receive Telegram Premium subscription gift codes +//@month_count Number of month the Telegram Premium subscription will be active after code activation +//@payment_date Point in time (Unix timestamp) when the giveaway was paid +prepaidPremiumGiveaway id:int64 winner_count:int32 month_count:int32 payment_date:int32 = PrepaidPremiumGiveaway; + +//@description Describes current boost status of a chat +//@boost_url An HTTP URL, which can be used to boost the chat +//@applied_slot_ids Identifiers of boost slots of the current user applied to the chat +//@level Current boost level of the chat +//@gift_code_boost_count The number of boosts received by the chat from created Telegram Premium gift codes and giveaways; always 0 if the current user isn't an administrator in the chat +//@boost_count The number of boosts received by the chat +//@current_level_boost_count The number of boosts added to reach the current level +//@next_level_boost_count The number of boosts needed to reach the next level; 0 if the next level isn't available +//@premium_member_count Approximate number of Telegram Premium subscribers joined the chat; always 0 if the current user isn't an administrator in the chat +//@premium_member_percentage A percentage of Telegram Premium subscribers joined the chat; always 0 if the current user isn't an administrator in the chat +//@prepaid_giveaways The list of prepaid giveaways available for the chat; only for chat administrators +chatBoostStatus boost_url:string applied_slot_ids:vector level:int32 gift_code_boost_count:int32 boost_count:int32 current_level_boost_count:int32 next_level_boost_count:int32 premium_member_count:int32 premium_member_percentage:double prepaid_giveaways:vector = ChatBoostStatus; + +//@description Describes a boost applied to a chat +//@id Unique identifier of the boost +//@count The number of identical boosts applied +//@source Source of the boost +//@start_date Point in time (Unix timestamp) when the chat was boosted +//@expiration_date Point in time (Unix timestamp) when the boost will expire +chatBoost id:string count:int32 source:ChatBoostSource start_date:int32 expiration_date:int32 = ChatBoost; + +//@description Contains a list of boosts applied to a chat @total_count Total number of boosts applied to the chat @boosts List of boosts @next_offset The offset for the next request. If empty, there are no more results +foundChatBoosts total_count:int32 boosts:vector next_offset:string = FoundChatBoosts; + +//@description Describes a slot for chat boost +//@slot_id Unique identifier of the slot +//@currently_boosted_chat_id Identifier of the currently boosted chat; 0 if none +//@start_date Point in time (Unix timestamp) when the chat was boosted; 0 if none +//@expiration_date Point in time (Unix timestamp) when the boost will expire +//@cooldown_until_date Point in time (Unix timestamp) after which the boost can be used for another chat +chatBoostSlot slot_id:int32 currently_boosted_chat_id:int53 start_date:int32 expiration_date:int32 cooldown_until_date:int32 = ChatBoostSlot; + +//@description Contains a list of chat boost slots @slots List of boost slots +chatBoostSlots slots:vector = ChatBoostSlots; + + //@class CallDiscardReason @description Describes the reason why a call was discarded //@description The call wasn't discarded, or the reason is unknown @@ -3053,7 +3590,7 @@ callDiscardReasonHungUp = CallDiscardReason; //@udp_p2p True, if UDP peer-to-peer connections are supported //@udp_reflector True, if connection through UDP reflectors is supported //@min_layer The minimum supported API layer; use 65 -//@max_layer The maximum supported API layer; use 65 +//@max_layer The maximum supported API layer; use 92 //@library_versions List of supported tgcalls versions callProtocol udp_p2p:Bool udp_reflector:Bool min_layer:int32 max_layer:int32 library_versions:vector = CallProtocol; @@ -3096,7 +3633,7 @@ callStatePending is_created:Bool is_received:Bool = CallState; callStateExchangingKeys = CallState; //@description The call is ready to use -//@protocol Call protocols supported by the peer +//@protocol Call protocols supported by the other call participant //@servers List of available call servers //@config A JSON-encoded call config //@encryption_key Call encryption key @@ -3108,7 +3645,7 @@ callStateReady protocol:callProtocol servers:vector config:string en callStateHangingUp = CallState; //@description The call has ended successfully -//@reason The reason, why the call has ended +//@reason The reason why the call has ended //@need_rating True, if the call rating must be sent to the server //@need_debug_information True, if the call debug information must be sent to the server //@need_log True, if the call log must be sent to the server @@ -3150,7 +3687,7 @@ groupCallRecentSpeaker participant_id:MessageSender is_speaking:Bool = GroupCall //@id Group call identifier //@title Group call title //@scheduled_start_date Point in time (Unix timestamp) when the group call is supposed to be started by an administrator; 0 if it is already active or was ended -//@enabled_start_notification True, if the group call is scheduled and the current user will receive a notification when the group call will start +//@enabled_start_notification True, if the group call is scheduled and the current user will receive a notification when the group call starts //@is_active True, if the call is active //@is_rtmp_stream True, if the chat is an RTMP stream instead of an ordinary video chat //@is_joined True, if the call is joined @@ -3233,7 +3770,7 @@ callProblemPixelatedVideo = CallProblem; //@description Describes a call //@id Call identifier, not persistent -//@user_id Peer user identifier +//@user_id User identifier of the other call participant //@is_outgoing True, if the call is outgoing //@is_video True, if the call is a video call //@state Call state @@ -3259,8 +3796,12 @@ firebaseAuthenticationSettingsIos device_token:string is_app_sandbox:Bool = Fire phoneNumberAuthenticationSettings allow_flash_call:Bool allow_missed_call:Bool is_current_phone_number:Bool allow_sms_retriever_api:Bool firebase_authentication_settings:FirebaseAuthenticationSettings authentication_tokens:vector = PhoneNumberAuthenticationSettings; -//@description Represents a reaction applied to a message @type Type of the reaction @sender_id Identifier of the chat member, applied the reaction @date Point in time (Unix timestamp) when the reaction was added -addedReaction type:ReactionType sender_id:MessageSender date:int32 = AddedReaction; +//@description Represents a reaction applied to a message +//@type Type of the reaction +//@sender_id Identifier of the chat member, applied the reaction +//@is_outgoing True, if the reaction was added by the current user +//@date Point in time (Unix timestamp) when the reaction was added +addedReaction type:ReactionType sender_id:MessageSender is_outgoing:Bool date:int32 = AddedReaction; //@description Represents a list of reactions added to a message @total_count The total number of found reactions @reactions The list of added reactions @next_offset The offset for the next request. If empty, there are no more results addedReactions total_count:int32 reactions:vector next_offset:string = AddedReactions; @@ -3321,37 +3862,58 @@ speechRecognitionResultPending partial_text:string = SpeechRecognitionResult; //@description The speech recognition successfully finished @text Recognized text speechRecognitionResultText text:string = SpeechRecognitionResult; -//@description The speech recognition failed @error Received error +//@description The speech recognition failed @error Recognition error. An error with a message "MSG_VOICE_TOO_LONG" is returned when media duration is too big to be recognized speechRecognitionResultError error:error = SpeechRecognitionResult; //@description Describes a color to highlight a bot added to attachment menu @light_color Color in the RGB24 format for light themes @dark_color Color in the RGB24 format for dark themes attachmentMenuBotColor light_color:int32 dark_color:int32 = AttachmentMenuBotColor; -//@description Represents a bot, which can be added to attachment menu -//@bot_user_id User identifier of the bot added to attachment menu +//@description Represents a bot, which can be added to attachment or side menu +//@bot_user_id User identifier of the bot //@supports_self_chat True, if the bot supports opening from attachment menu in the chat with the bot //@supports_user_chats True, if the bot supports opening from attachment menu in private chats with ordinary users //@supports_bot_chats True, if the bot supports opening from attachment menu in private chats with other bots //@supports_group_chats True, if the bot supports opening from attachment menu in basic group and supergroup chats //@supports_channel_chats True, if the bot supports opening from attachment menu in channel chats -//@supports_settings True, if the bot supports "settings_button_pressed" event -//@request_write_access True, if the user must be asked for the permission to the bot to send them messages +//@request_write_access True, if the user must be asked for the permission to send messages to the bot +//@is_added True, if the bot was explicitly added by the user. If the bot isn't added, then on the first bot launch toggleBotIsAddedToAttachmentMenu must be called and the bot must be added or removed +//@show_in_attachment_menu True, if the bot must be shown in the attachment menu +//@show_in_side_menu True, if the bot must be shown in the side menu +//@show_disclaimer_in_side_menu True, if a disclaimer, why the bot is shown in the side menu, is needed //@name Name for the bot in attachment menu //@name_color Color to highlight selected name of the bot if appropriate; may be null -//@default_icon Default attachment menu icon for the bot in SVG format; may be null -//@ios_static_icon Attachment menu icon for the bot in SVG format for the official iOS app; may be null -//@ios_animated_icon Attachment menu icon for the bot in TGS format for the official iOS app; may be null -//@android_icon Attachment menu icon for the bot in TGS format for the official Android app; may be null -//@macos_icon Attachment menu icon for the bot in TGS format for the official native macOS app; may be null +//@default_icon Default icon for the bot in SVG format; may be null +//@ios_static_icon Icon for the bot in SVG format for the official iOS app; may be null +//@ios_animated_icon Icon for the bot in TGS format for the official iOS app; may be null +//@ios_side_menu_icon Icon for the bot in PNG format for the official iOS app side menu; may be null +//@android_icon Icon for the bot in TGS format for the official Android app; may be null +//@android_side_menu_icon Icon for the bot in SVG format for the official Android app side menu; may be null +//@macos_icon Icon for the bot in TGS format for the official native macOS app; may be null +//@macos_side_menu_icon Icon for the bot in PNG format for the official macOS app side menu; may be null //@icon_color Color to highlight selected icon of the bot if appropriate; may be null //@web_app_placeholder Default placeholder for opened Web Apps in SVG format; may be null -attachmentMenuBot bot_user_id:int53 supports_self_chat:Bool supports_user_chats:Bool supports_bot_chats:Bool supports_group_chats:Bool supports_channel_chats:Bool supports_settings:Bool request_write_access:Bool name:string name_color:attachmentMenuBotColor default_icon:file ios_static_icon:file ios_animated_icon:file android_icon:file macos_icon:file icon_color:attachmentMenuBotColor web_app_placeholder:file = AttachmentMenuBot; +attachmentMenuBot bot_user_id:int53 supports_self_chat:Bool supports_user_chats:Bool supports_bot_chats:Bool supports_group_chats:Bool supports_channel_chats:Bool request_write_access:Bool is_added:Bool show_in_attachment_menu:Bool show_in_side_menu:Bool show_disclaimer_in_side_menu:Bool name:string name_color:attachmentMenuBotColor default_icon:file ios_static_icon:file ios_animated_icon:file ios_side_menu_icon:file android_icon:file android_side_menu_icon:file macos_icon:file macos_side_menu_icon:file icon_color:attachmentMenuBotColor web_app_placeholder:file = AttachmentMenuBot; //@description Information about the message sent by answerWebAppQuery @inline_message_id Identifier of the sent inline message, if known sentWebAppMessage inline_message_id:string = SentWebAppMessage; +//@class BotWriteAccessAllowReason @description Describes a reason why a bot was allowed to write messages to the current user + +//@description The user connected a website by logging in using Telegram Login Widget on it @domain_name Domain name of the connected website +botWriteAccessAllowReasonConnectedWebsite domain_name:string = BotWriteAccessAllowReason; + +//@description The user added the bot to attachment or side menu using toggleBotIsAddedToAttachmentMenu +botWriteAccessAllowReasonAddedToAttachmentMenu = BotWriteAccessAllowReason; + +//@description The user launched a Web App using getWebAppLinkUrl @web_app Information about the Web App +botWriteAccessAllowReasonLaunchedWebApp web_app:webApp = BotWriteAccessAllowReason; + +//@description The user accepted bot's request to send messages with allowBotToSendMessages +botWriteAccessAllowReasonAcceptedRequest = BotWriteAccessAllowReason; + + //@description Contains an HTTP URL @url The URL httpUrl url:string = HttpUrl; @@ -3643,8 +4205,8 @@ chatEventPollStopped message:message = ChatEventAction; //@description A new member joined the chat chatEventMemberJoined = ChatEventAction; -//@description A new member joined the chat via an invite link @invite_link Invite link used to join the chat -chatEventMemberJoinedByInviteLink invite_link:chatInviteLink = ChatEventAction; +//@description A new member joined the chat via an invite link @invite_link Invite link used to join the chat @via_chat_folder_invite_link True, if the user has joined the chat using an invite link for a chat folder +chatEventMemberJoinedByInviteLink invite_link:chatInviteLink via_chat_folder_invite_link:Bool = ChatEventAction; //@description A new member was accepted to the chat by an administrator @approver_user_id User identifier of the chat administrator, approved user join request @invite_link Invite link used to join the chat; may be null chatEventMemberJoinedByRequest approver_user_id:int53 invite_link:chatInviteLink = ChatEventAction; @@ -3697,6 +4259,12 @@ chatEventUsernameChanged old_username:string new_username:string = ChatEventActi //@description The chat active usernames were changed @old_usernames Previous list of active usernames @new_usernames New list of active usernames chatEventActiveUsernamesChanged old_usernames:vector new_usernames:vector = ChatEventAction; +//@description The chat accent color was changed @old_accent_color_id Previous identifier of chat accent color @new_accent_color_id New identifier of chat accent color +chatEventAccentColorChanged old_accent_color_id:int32 new_accent_color_id:int32 = ChatEventAction; + +//@description The chat's custom emoji for reply background was changed @old_background_custom_emoji_id Previous identifier of the custom emoji; 0 if none @new_background_custom_emoji_id New identifier of the custom emoji; 0 if none +chatEventBackgroundCustomEmojiChanged old_background_custom_emoji_id:int64 new_background_custom_emoji_id:int64 = ChatEventAction; + //@description The has_protected_content setting of a channel was toggled @has_protected_content New value of has_protected_content chatEventHasProtectedContentToggled has_protected_content:Bool = ChatEventAction; @@ -3845,11 +4413,11 @@ premiumLimitTypeSavedAnimationCount = PremiumLimitType; //@description The maximum number of favorite stickers premiumLimitTypeFavoriteStickerCount = PremiumLimitType; -//@description The maximum number of chat filters -premiumLimitTypeChatFilterCount = PremiumLimitType; +//@description The maximum number of chat folders +premiumLimitTypeChatFolderCount = PremiumLimitType; -//@description The maximum number of pinned and always included, or always excluded chats in a chat filter -premiumLimitTypeChatFilterChosenChatCount = PremiumLimitType; +//@description The maximum number of pinned and always included, or always excluded chats in a chat folder +premiumLimitTypeChatFolderChosenChatCount = PremiumLimitType; //@description The maximum number of pinned chats in the archive chat list premiumLimitTypePinnedArchivedChatCount = PremiumLimitType; @@ -3860,6 +4428,27 @@ premiumLimitTypeCaptionLength = PremiumLimitType; //@description The maximum length of the user's bio premiumLimitTypeBioLength = PremiumLimitType; +//@description The maximum number of invite links for a chat folder +premiumLimitTypeChatFolderInviteLinkCount = PremiumLimitType; + +//@description The maximum number of added shareable chat folders +premiumLimitTypeShareableChatFolderCount = PremiumLimitType; + +//@description The maximum number of active stories +premiumLimitTypeActiveStoryCount = PremiumLimitType; + +//@description The maximum number of stories sent per week +premiumLimitTypeWeeklySentStoryCount = PremiumLimitType; + +//@description The maximum number of stories sent per month +premiumLimitTypeMonthlySentStoryCount = PremiumLimitType; + +//@description The maximum length of captions of sent stories +premiumLimitTypeStoryCaptionLength = PremiumLimitType; + +//@description The maximum number of suggested reaction areas on a story +premiumLimitTypeStorySuggestedReactionAreaCount = PremiumLimitType; + //@class PremiumFeature @description Describes a feature available to Premium users @@ -3893,7 +4482,7 @@ premiumFeatureAdvancedChatManagement = PremiumFeature; //@description A badge in the user's profile premiumFeatureProfileBadge = PremiumFeature; -//@description A emoji status shown along with the user's name +//@description An emoji status shown along with the user's name premiumFeatureEmojiStatus = PremiumFeature; //@description Profile photo animation on message and chat screens @@ -3908,6 +4497,36 @@ premiumFeatureAppIcons = PremiumFeature; //@description Allowed to translate chat messages real-time premiumFeatureRealTimeChatTranslation = PremiumFeature; +//@description Allowed to use many additional features for stories +premiumFeatureUpgradedStories = PremiumFeature; + +//@description The ability to boost chats +premiumFeatureChatBoost = PremiumFeature; + +//@description The ability to choose accent color +premiumFeatureAccentColor = PremiumFeature; + + +//@class PremiumStoryFeature @description Describes a story feature available to Premium users + +//@description User stories are displayed before stories of non-premium contacts and channels +premiumStoryFeaturePriorityOrder = PremiumStoryFeature; + +//@description The ability to hide the fact that the user viewed other's stories +premiumStoryFeatureStealthMode = PremiumStoryFeature; + +//@description The ability to check who opened the current user's stories after they expire +premiumStoryFeaturePermanentViewsHistory = PremiumStoryFeature; + +//@description The ability to set custom expiration duration for stories +premiumStoryFeatureCustomExpirationDuration = PremiumStoryFeature; + +//@description The ability to save other's unprotected stories +premiumStoryFeatureSaveStories = PremiumStoryFeature; + +//@description The ability to use links and formatting in story caption +premiumStoryFeatureLinksAndFormatting = PremiumStoryFeature; + //@description Contains information about a limit, increased for Premium users @type The type of the limit @default_value Default value of the limit @premium_value Value of the limit for Premium users premiumLimit type:PremiumLimitType default_value:int32 premium_value:int32 = PremiumLimit; @@ -3927,6 +4546,9 @@ premiumSourceLimitExceeded limit_type:PremiumLimitType = PremiumSource; //@description A user tried to use a Premium feature @feature The used feature premiumSourceFeature feature:PremiumFeature = PremiumSource; +//@description A user tried to use a Premium story feature @feature The used feature +premiumSourceStoryFeature feature:PremiumStoryFeature = PremiumSource; + //@description A user opened an internal link of the type internalLinkTypePremiumFeatures @referrer The referrer from the link premiumSourceLink referrer:string = PremiumSource; @@ -3946,12 +4568,44 @@ premiumState state:formattedText payment_options:vector = StorePaymentPurpose; + +//@description The user creating a Telegram Premium giveaway for subscribers of channel chats; requires can_post_messages rights in the channels +//@parameters Giveaway parameters +//@currency ISO 4217 currency code of the payment currency +//@amount Paid amount, in the smallest units of the currency +storePaymentPurposePremiumGiveaway parameters:premiumGiveawayParameters currency:string amount:int53 = StorePaymentPurpose; + + +//@class TelegramPaymentPurpose @description Describes a purpose of a payment toward Telegram + +//@description The user creating Telegram Premium gift codes for other users +//@boosted_chat_id Identifier of the channel chat, which will be automatically boosted by the users for duration of the Premium subscription and which is administered by the user; 0 if none +//@currency ISO 4217 currency code of the payment currency +//@amount Paid amount, in the smallest units of the currency +//@user_ids Identifiers of the users which can activate the gift codes +//@month_count Number of month the Telegram Premium subscription will be active for the users +telegramPaymentPurposePremiumGiftCodes boosted_chat_id:int53 currency:string amount:int53 user_ids:vector month_count:int32 = TelegramPaymentPurpose; + +//@description The user creating a Telegram Premium giveaway for subscribers of channel chats; requires can_post_messages rights in the channels +//@parameters Giveaway parameters +//@currency ISO 4217 currency code of the payment currency +//@amount Paid amount, in the smallest units of the currency +//@winner_count Number of users which will be able to activate the gift codes +//@month_count Number of month the Telegram Premium subscription will be active for the users +telegramPaymentPurposePremiumGiveaway parameters:premiumGiveawayParameters currency:string amount:int53 winner_count:int32 month_count:int32 = TelegramPaymentPurpose; + //@class DeviceToken @description Represents a data needed to subscribe for push notifications through registerDevice method. //-To use specific push notification service, the correct application platform must be specified and a valid server authentication data must be uploaded at https://my.telegram.org @@ -4033,19 +4687,6 @@ backgroundTypePattern fill:BackgroundFill intensity:int32 is_inverted:Bool is_mo backgroundTypeFill fill:BackgroundFill = BackgroundType; -//@description Describes a chat background -//@id Unique background identifier -//@is_default True, if this is one of default backgrounds -//@is_dark True, if the background is dark and is recommended to be used with dark theme -//@name Unique background name -//@document Document with the background; may be null. Null only for filled backgrounds -//@type Type of the background -background id:int64 is_default:Bool is_dark:Bool name:string document:document type:BackgroundType = Background; - -//@description Contains a list of backgrounds @backgrounds A list of backgrounds -backgrounds backgrounds:vector = Backgrounds; - - //@class InputBackground @description Contains information about background to set //@description A background from a local file @@ -4055,6 +4696,9 @@ inputBackgroundLocal background:InputFile = InputBackground; //@description A background from the server @background_id The background identifier inputBackgroundRemote background_id:int64 = InputBackground; +//@description A background previously set in the chat; for chat backgrounds only @message_id Identifier of the message with the background +inputBackgroundPrevious message_id:int53 = InputBackground; + //@description Describes theme settings //@accent_color Theme accent color in ARGB format @@ -4076,6 +4720,27 @@ chatTheme name:string light_settings:themeSettings dark_settings:themeSettings = hashtags hashtags:vector = Hashtags; +//@class CanSendStoryResult @description Represents result of checking whether the current user can send a story in the specific chat + +//@description A story can be sent +canSendStoryResultOk = CanSendStoryResult; + +//@description The user must subscribe to Telegram Premium to be able to post stories +canSendStoryResultPremiumNeeded = CanSendStoryResult; + +//@description The channel chat must be boosted first by Telegram Premium subscribers to post more stories. Call getChatBoostStatus to get current boost status of the chat +canSendStoryResultBoostNeeded = CanSendStoryResult; + +//@description The limit for the number of active stories exceeded. The user can buy Telegram Premium, delete an active story, or wait for the oldest story to expire +canSendStoryResultActiveStoryLimitExceeded = CanSendStoryResult; + +//@description The weekly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time @retry_after Time left before the user can send the next story +canSendStoryResultWeeklyLimitExceeded retry_after:int32 = CanSendStoryResult; + +//@description The monthly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time @retry_after Time left before the user can send the next story +canSendStoryResultMonthlyLimitExceeded retry_after:int32 = CanSendStoryResult; + + //@class CanTransferOwnershipResult @description Represents result of checking whether the current session can be used to transfer a chat ownership to another user //@description The session can be used @@ -4193,6 +4858,15 @@ pushMessageContentPhoto photo:photo caption:string is_secret:Bool is_pinned:Bool //@is_pinned True, if the message is a pinned message with the specified content pushMessageContentPoll question:string is_regular:Bool is_pinned:Bool = PushMessageContent; +//@description A message with a Telegram Premium gift code created for the user @month_count Number of month the Telegram Premium subscription will be active after code activation +pushMessageContentPremiumGiftCode month_count:int32 = PushMessageContent; + +//@description A message with a Telegram Premium giveaway +//@winner_count Number of users which will receive Telegram Premium subscription gift codes; 0 for pinned message +//@month_count Number of month the Telegram Premium subscription will be active after code activation; 0 for pinned message +//@is_pinned True, if the message is a pinned message with the specified content +pushMessageContentPremiumGiveaway winner_count:int32 month_count:int32 is_pinned:Bool = PushMessageContent; + //@description A screenshot of a message in the chat has been taken pushMessageContentScreenshotTaken = PushMessageContent; @@ -4202,6 +4876,9 @@ pushMessageContentScreenshotTaken = PushMessageContent; //@is_pinned True, if the message is a pinned message with the specified content pushMessageContentSticker sticker:sticker emoji:string is_pinned:Bool = PushMessageContent; +//@description A message with a story @is_pinned True, if the message is a pinned message with the specified content +pushMessageContentStory is_pinned:Bool = PushMessageContent; + //@description A text message @text Message text @is_pinned True, if the message is a pinned message with the specified content pushMessageContentText text:string is_pinned:Bool = PushMessageContent; @@ -4233,6 +4910,9 @@ pushMessageContentChatChangePhoto = PushMessageContent; //@description A chat title was edited @title New chat title pushMessageContentChatChangeTitle title:string = PushMessageContent; +//@description A chat background was edited @is_same True, if the set background is the same as the background of the current user +pushMessageContentChatSetBackground is_same:Bool = PushMessageContent; + //@description A chat theme was edited @theme_name If non-empty, name of a new theme, set for the chat. Otherwise, the chat theme was reset to the default one pushMessageContentChatSetTheme theme_name:string = PushMessageContent; @@ -4248,7 +4928,7 @@ pushMessageContentChatJoinByLink = PushMessageContent; //@description A new member was accepted to the chat by an administrator pushMessageContentChatJoinByRequest = PushMessageContent; -//@description A new recurrent payment was made by the current user @amount The paid amount +//@description A new recurring payment was made by the current user @amount The paid amount pushMessageContentRecurringPayment amount:string = PushMessageContent; //@description A profile photo was suggested to the user @@ -4278,7 +4958,7 @@ notificationTypeNewSecretChat = NotificationType; notificationTypeNewCall call_id:int32 = NotificationType; //@description New message was received through a push notification -//@message_id The message identifier. The message will not be available in the chat history, but the ID can be used in viewMessages, or as reply_to_message_id +//@message_id The message identifier. The message will not be available in the chat history, but the identifier can be used in viewMessages, or as a message to be replied in the same chat //@sender_id Identifier of the sender of the message. Corresponding user or chat may be inaccessible //@sender_name Name of the sender //@is_outgoing True, if the message is outgoing @@ -4369,12 +5049,27 @@ jsonValueArray values:vector = JsonValue; jsonValueObject members:vector = JsonValue; -//@class UserPrivacySettingRule @description Represents a single rule for managing privacy settings +//@class StoryPrivacySettings @description Describes privacy settings of a story + +//@description The story can be viewed by everyone @except_user_ids Identifiers of the users that can't see the story; always unknown and empty for non-owned stories +storyPrivacySettingsEveryone except_user_ids:vector = StoryPrivacySettings; + +//@description The story can be viewed by all contacts except chosen users @except_user_ids User identifiers of the contacts that can't see the story; always unknown and empty for non-owned stories +storyPrivacySettingsContacts except_user_ids:vector = StoryPrivacySettings; + +//@description The story can be viewed by all close friends +storyPrivacySettingsCloseFriends = StoryPrivacySettings; + +//@description The story can be viewed by certain specified users @user_ids Identifiers of the users; always unknown and empty for non-owned stories +storyPrivacySettingsSelectedUsers user_ids:vector = StoryPrivacySettings; + + +//@class UserPrivacySettingRule @description Represents a single rule for managing user privacy settings //@description A rule to allow all users to do something userPrivacySettingRuleAllowAll = UserPrivacySettingRule; -//@description A rule to allow all of a user's contacts to do something +//@description A rule to allow all contacts of the user to do something userPrivacySettingRuleAllowContacts = UserPrivacySettingRule; //@description A rule to allow certain specified users to do something @user_ids The user identifiers, total number of users in all rules must not exceed 1000 @@ -4386,7 +5081,7 @@ userPrivacySettingRuleAllowChatMembers chat_ids:vector = UserPrivacySetti //@description A rule to restrict all users from doing something userPrivacySettingRuleRestrictAll = UserPrivacySettingRule; -//@description A rule to restrict all contacts of a user from doing something +//@description A rule to restrict all contacts of the user from doing something userPrivacySettingRuleRestrictContacts = UserPrivacySettingRule; //@description A rule to restrict all specified users from doing something @user_ids The user identifiers, total number of users in all rules must not exceed 1000 @@ -4398,6 +5093,7 @@ userPrivacySettingRuleRestrictChatMembers chat_ids:vector = UserPrivacySe //@description A list of privacy rules. Rules are matched in the specified order. The first matched rule defines the privacy setting for a given user. If no rule matches, the action is not allowed @rules A list of rules userPrivacySettingRules rules:vector = UserPrivacySettingRules; + //@class UserPrivacySetting @description Describes available user privacy settings //@description A privacy setting for managing whether the user's online status is visible @@ -4412,6 +5108,9 @@ userPrivacySettingShowLinkInForwardedMessages = UserPrivacySetting; //@description A privacy setting for managing whether the user's phone number is visible userPrivacySettingShowPhoneNumber = UserPrivacySetting; +//@description A privacy setting for managing whether the user's bio is visible +userPrivacySettingShowBio = UserPrivacySetting; + //@description A privacy setting for managing whether the user can be invited to chats userPrivacySettingAllowChatInvites = UserPrivacySetting; @@ -4494,6 +5193,7 @@ sessionTypeXbox = SessionType; //@id Session identifier //@is_current True, if this session is the current session //@is_password_pending True, if a 2-step verification password is needed to complete authorization of the session +//@is_unconfirmed True, if the session wasn't confirmed from another session //@can_accept_secret_chats True, if incoming secret chats can be accepted by the session //@can_accept_calls True, if incoming calls can be accepted by the session //@type Session type based on the system and application version, which can be used to display a corresponding icon @@ -4506,14 +5206,20 @@ sessionTypeXbox = SessionType; //@system_version Version of the operating system the application has been run or is running on, as provided by the application //@log_in_date Point in time (Unix timestamp) when the user has logged in //@last_active_date Point in time (Unix timestamp) when the session was last used -//@ip IP address from which the session was created, in human-readable format -//@country A two-letter country code for the country from which the session was created, based on the IP address -//@region Region code from which the session was created, based on the IP address -session id:int64 is_current:Bool is_password_pending:Bool can_accept_secret_chats:Bool can_accept_calls:Bool type:SessionType api_id:int32 application_name:string application_version:string is_official_application:Bool device_model:string platform:string system_version:string log_in_date:int32 last_active_date:int32 ip:string country:string region:string = Session; +//@ip_address IP address from which the session was created, in human-readable format +//@location A human-readable description of the location from which the session was created, based on the IP address +session id:int64 is_current:Bool is_password_pending:Bool is_unconfirmed:Bool can_accept_secret_chats:Bool can_accept_calls:Bool type:SessionType api_id:int32 application_name:string application_version:string is_official_application:Bool device_model:string platform:string system_version:string log_in_date:int32 last_active_date:int32 ip_address:string location:string = Session; //@description Contains a list of sessions @sessions List of sessions @inactive_session_ttl_days Number of days of inactivity before sessions will automatically be terminated; 1-366 days sessions sessions:vector inactive_session_ttl_days:int32 = Sessions; +//@description Contains information about an unconfirmed session +//@id Session identifier +//@log_in_date Point in time (Unix timestamp) when the user has logged in +//@device_model Model of the device that was used for the session creation, as provided by the application +//@location A human-readable description of the location from which the session was created, based on the IP address +unconfirmedSession id:int64 log_in_date:int32 device_model:string location:string = UnconfirmedSession; + //@description Contains information about one website the current user is logged in with Telegram //@id Website identifier @@ -4523,45 +5229,45 @@ sessions sessions:vector inactive_session_ttl_days:int32 = Sessions; //@platform Operating system the browser is running on //@log_in_date Point in time (Unix timestamp) when the user was logged in //@last_active_date Point in time (Unix timestamp) when obtained authorization was last used -//@ip IP address from which the user was logged in, in human-readable format +//@ip_address IP address from which the user was logged in, in human-readable format //@location Human-readable description of a country and a region from which the user was logged in, based on the IP address -connectedWebsite id:int64 domain_name:string bot_user_id:int53 browser:string platform:string log_in_date:int32 last_active_date:int32 ip:string location:string = ConnectedWebsite; +connectedWebsite id:int64 domain_name:string bot_user_id:int53 browser:string platform:string log_in_date:int32 last_active_date:int32 ip_address:string location:string = ConnectedWebsite; //@description Contains a list of websites the current user is logged in with Telegram @websites List of connected websites connectedWebsites websites:vector = ConnectedWebsites; -//@class ChatReportReason @description Describes the reason why a chat is reported +//@class ReportReason @description Describes the reason why a chat is reported //@description The chat contains spam messages -chatReportReasonSpam = ChatReportReason; +reportReasonSpam = ReportReason; //@description The chat promotes violence -chatReportReasonViolence = ChatReportReason; +reportReasonViolence = ReportReason; //@description The chat contains pornographic messages -chatReportReasonPornography = ChatReportReason; +reportReasonPornography = ReportReason; //@description The chat has child abuse related content -chatReportReasonChildAbuse = ChatReportReason; +reportReasonChildAbuse = ReportReason; //@description The chat contains copyrighted content -chatReportReasonCopyright = ChatReportReason; +reportReasonCopyright = ReportReason; //@description The location-based chat is unrelated to its stated location -chatReportReasonUnrelatedLocation = ChatReportReason; +reportReasonUnrelatedLocation = ReportReason; //@description The chat represents a fake account -chatReportReasonFake = ChatReportReason; +reportReasonFake = ReportReason; //@description The chat has illegal drugs related content -chatReportReasonIllegalDrugs = ChatReportReason; +reportReasonIllegalDrugs = ReportReason; //@description The chat contains messages with personal details -chatReportReasonPersonalDetails = ChatReportReason; +reportReasonPersonalDetails = ReportReason; //@description A custom reason provided by the user -chatReportReasonCustom = ChatReportReason; +reportReasonCustom = ReportReason; //@class TargetChat @description Describes the target chat to be opened @@ -4587,7 +5293,8 @@ internalLinkTypeActiveSessions = InternalLinkType; //@description The link is a link to an attachment menu bot to be opened in the specified or a chosen chat. Process given target_chat to open the chat. //-Then, call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then, use getAttachmentMenuBot to receive information about the bot. -//-If the bot isn't added to attachment menu, then user needs to confirm adding the bot to attachment menu. If user confirms adding, then use toggleBotIsAddedToAttachmentMenu to add it. +//-If the bot isn't added to attachment menu, then show a disclaimer about Mini Apps being a third-party apps, ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu. +//-If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. //-If the attachment menu bot can't be used in the opened chat, show an error to the user. If the bot is added to attachment menu and can be used in the chat, then use openWebApp with the given URL //@target_chat Target chat to be opened //@bot_username Username of the bot @@ -4628,6 +5335,18 @@ internalLinkTypeBotStartInGroup bot_username:string start_parameter:string admin //@description The link is a link to the change phone number section of the app internalLinkTypeChangePhoneNumber = InternalLinkType; +//@description The link is a link to boost a Telegram chat. Call getChatBoostLinkInfo with the given URL to process the link. +//-If the chat is found, then call getChatBoostStatus and getAvailableChatBoostSlots to get the current boost status and check whether the chat can be boosted. +//-If the user wants to boost the chat and the chat can be boosted, then call boostChat +//@url URL to be passed to getChatBoostLinkInfo +internalLinkTypeChatBoost url:string = InternalLinkType; + +//@description The link is an invite link to a chat folder. Call checkChatFolderInviteLink with the given invite link to process the link @invite_link Internal representation of the invite link +internalLinkTypeChatFolderInvite invite_link:string = InternalLinkType; + +//@description The link is a link to the folder section of the app settings +internalLinkTypeChatFolderSettings = InternalLinkType; + //@description The link is a chat invite link. Call checkChatInviteLink with the given invite link to process the link @invite_link Internal representation of the invite link internalLinkTypeChatInvite invite_link:string = InternalLinkType; @@ -4637,9 +5356,6 @@ internalLinkTypeDefaultMessageAutoDeleteTimerSettings = InternalLinkType; //@description The link is a link to the edit profile section of the app settings internalLinkTypeEditProfileSettings = InternalLinkType; -//@description The link is a link to the filter section of the app settings -internalLinkTypeFilterSettings = InternalLinkType; - //@description The link is a link to a game. Call searchPublicChat with the given bot username, check that the user is a bot, ask the current user to select a chat to send the game, and then call sendMessage with inputMessageGame //@bot_username Username of the bot that owns the game //@game_short_name Short name of the game @@ -4682,11 +5398,15 @@ internalLinkTypePhoneNumberConfirmation hash:string phone_number:string = Intern //@description The link is a link to the Premium features screen of the application from which the user can subscribe to Telegram Premium. Call getPremiumFeatures with the given referrer to process the link @referrer Referrer specified in the link internalLinkTypePremiumFeatures referrer:string = InternalLinkType; +//@description The link is a link with a Telegram Premium gift code. Call checkPremiumGiftCode with the given code to process the link. If the code is valid and the user wants to apply it, then call applyPremiumGiftCode +//@code The Telegram Premium gift code +internalLinkTypePremiumGiftCode code:string = InternalLinkType; + //@description The link is a link to the privacy and security section of the app settings internalLinkTypePrivacyAndSecuritySettings = InternalLinkType; //@description The link is a link to a proxy. Call addProxy with the given parameters to process the link and add the proxy -//@server Proxy server IP address +//@server Proxy server domain or IP address //@port Proxy server port //@type Type of the proxy internalLinkTypeProxy server:string port:int32 type:ProxyType = InternalLinkType; @@ -4704,11 +5424,24 @@ internalLinkTypeRestorePurchases = InternalLinkType; //@description The link is a link to application settings internalLinkTypeSettings = InternalLinkType; +//@description The link is a link to a bot, which can be installed to the side menu. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. +//-Then, use getAttachmentMenuBot to receive information about the bot. If the bot isn't added to side menu, then show a disclaimer about Mini Apps being a third-party apps, +//-ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. +//-If the bot is added to side menu, then use getWebAppUrl with the given URL +//@bot_username Username of the bot +//@url URL to be passed to getWebAppUrl +internalLinkTypeSideMenuBot bot_username:string url:string = InternalLinkType; + //@description The link is a link to a sticker set. Call searchStickerSet with the given sticker set name to process the link and show the sticker set //@sticker_set_name Name of the sticker set //@expect_custom_emoji True, if the sticker set is expected to contain custom emoji internalLinkTypeStickerSet sticker_set_name:string expect_custom_emoji:Bool = InternalLinkType; +//@description The link is a link to a story. Call searchPublicChat with the given sender username, then call getStory with the received chat identifier and the given story identifier +//@story_sender_username Username of the sender of the story +//@story_id Story identifier +internalLinkTypeStory story_sender_username:string story_id:int32 = InternalLinkType; + //@description The link is a link to a theme. TDLib has no theme support yet @theme_name Name of the theme internalLinkTypeTheme theme_name:string = InternalLinkType; @@ -4734,7 +5467,9 @@ internalLinkTypeUserToken token:string = InternalLinkType; internalLinkTypeVideoChat chat_username:string invite_hash:string is_live_stream:Bool = InternalLinkType; //@description The link is a link to a Web App. Call searchPublicChat with the given bot username, check that the user is a bot, then call searchWebApp with the received bot and the given web_app_short_name. -//-Process received foundWebApp by showing a confirmation dialog if needed, then calling getWebAppLinkUrl and opening the returned URL +//-Process received foundWebApp by showing a confirmation dialog if needed. If the bot can be added to attachment or side menu, but isn't added yet, then show a disclaimer about Mini Apps being a third-party apps +//-instead of the dialog and ask the user to accept their Terms of service. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. +//-Then, call getWebAppLinkUrl and open the returned URL as a Web App //@bot_username Username of the bot that owns the Web App //@web_app_short_name Short name of the Web App //@start_parameter Start parameter to be passed to getWebAppLinkUrl @@ -4749,11 +5484,29 @@ messageLink link:string is_public:Bool = MessageLink; //@chat_id If found, identifier of the chat to which the link points, 0 otherwise //@message_thread_id If found, identifier of the message thread in which to open the message, or a forum topic to open if the message is missing //@message If found, the linked message; may be null -//@media_timestamp Timestamp from which the video/audio/video note/voice note playing must start, in seconds; 0 if not specified. The media can be in the message content or in its web page preview +//@media_timestamp Timestamp from which the video/audio/video note/voice note/story playing must start, in seconds; 0 if not specified. The media can be in the message content or in its web page preview //@for_album True, if the whole media album to which the message belongs is linked messageLinkInfo is_public:Bool chat_id:int53 message_thread_id:int53 message:message media_timestamp:int32 for_album:Bool = MessageLinkInfo; +//@description Contains an HTTPS link to boost a chat @link The link @is_public True, if the link will work for non-members of the chat +chatBoostLink link:string is_public:Bool = ChatBoostLink; + +//@description Contains information about a link to boost a chat +//@is_public True, if the link will work for non-members of the chat +//@chat_id Identifier of the chat to which the link points; 0 if the chat isn't found +chatBoostLinkInfo is_public:Bool chat_id:int53 = ChatBoostLinkInfo; + + +//@class BlockList @description Describes a type of a block list + +//@description The main block list that disallows writing messages to the current user, receiving their status and photo, viewing of stories, and some other actions +blockListMain = BlockList; + +//@description The block list that disallows viewing of stories of the current user +blockListStories = BlockList; + + //@description Contains a part of a file @data File bytes filePart data:bytes = FilePart; @@ -4778,6 +5531,9 @@ fileTypeNotificationSound = FileType; //@description The file is a photo fileTypePhoto = FileType; +//@description The file is a photo published as a story +fileTypePhotoStory = FileType; + //@description The file is a profile photo fileTypeProfilePhoto = FileType; @@ -4805,6 +5561,9 @@ fileTypeVideo = FileType; //@description The file is a video note fileTypeVideoNote = FileType; +//@description The file is a video published as a story +fileTypeVideoStory = FileType; + //@description The file is a voice note fileTypeVoiceNote = FileType; @@ -4890,8 +5649,9 @@ networkStatistics since_date:int32 entries:vector = Netw //@video_upload_bitrate The maximum suggested bitrate for uploaded videos, in kbit/s //@preload_large_videos True, if the beginning of video files needs to be preloaded for instant playback //@preload_next_audio True, if the next audio track needs to be preloaded while the user is listening to an audio file +//@preload_stories True, if stories needs to be preloaded //@use_less_data_for_calls True, if "use less data for calls" option needs to be enabled -autoDownloadSettings is_auto_download_enabled:Bool max_photo_file_size:int32 max_video_file_size:int53 max_other_file_size:int53 video_upload_bitrate:int32 preload_large_videos:Bool preload_next_audio:Bool use_less_data_for_calls:Bool = AutoDownloadSettings; +autoDownloadSettings is_auto_download_enabled:Bool max_photo_file_size:int32 max_video_file_size:int53 max_other_file_size:int53 video_upload_bitrate:int32 preload_large_videos:Bool preload_next_audio:Bool preload_stories:Bool use_less_data_for_calls:Bool = AutoDownloadSettings; //@description Contains auto-download settings presets for the current user //@low Preset with lowest settings; supposed to be used by default when roaming @@ -4976,6 +5736,13 @@ topChatCategoryCalls = TopChatCategory; topChatCategoryForwardChats = TopChatCategory; +//@description Contains 0-based match position @position The position of the match +foundPosition position:int32 = FoundPosition; + +//@description Contains 0-based positions of matched objects @total_count Total number of matched objects @positions The positions of the matched objects +foundPositions total_count:int32 positions:vector = FoundPositions; + + //@class TMeUrlType @description Describes the type of a URL linking to an internal Telegram entity //@description A URL linking to a user @user_id Identifier of the user @@ -4999,7 +5766,7 @@ tMeUrls urls:vector = TMeUrls; //@class SuggestedAction @description Describes an action suggested to the current user -//@description Suggests the user to enable "archive_and_mute_new_chats_from_unknown_users" option +//@description Suggests the user to enable archive_and_mute_new_chats_from_unknown_users setting in archiveChatListSettings suggestedActionEnableArchiveAndMuteNewChats = SuggestedAction; //@description Suggests the user to check whether they still remember their 2-step verification password @@ -5021,6 +5788,9 @@ suggestedActionSetPassword authorization_delay:int32 = SuggestedAction; //@description Suggests the user to upgrade the Premium subscription from monthly payments to annual payments suggestedActionUpgradePremium = SuggestedAction; +//@description Suggests the user to restore a recently expired Premium subscription +suggestedActionRestorePremium = SuggestedAction; + //@description Suggests the user to subscribe to the Premium subscription with annual payments suggestedActionSubscribeToAnnualPremium = SuggestedAction; @@ -5066,7 +5836,7 @@ proxyTypeMtproto secret:string = ProxyType; //@description Contains information about a proxy server //@id Unique identifier of the proxy -//@server Proxy server IP address +//@server Proxy server domain or IP address //@port Proxy server port //@last_used_date Point in time (Unix timestamp) when the proxy was last used; 0 if never //@is_enabled True, if the proxy is enabled now @@ -5157,7 +5927,7 @@ chatStatisticsSupergroup period:dateRange member_count:statisticalValue message_ //@member_count Number of members in the chat //@mean_view_count Mean number of times the recently sent messages was viewed //@mean_share_count Mean number of times the recently sent messages was shared -//@enabled_notifications_percentage A percentage of users with enabled notifications for the chat +//@enabled_notifications_percentage A percentage of users with enabled notifications for the chat; 0-100 //@member_count_graph A graph containing number of members in the chat //@join_graph A graph containing number of members joined and left the chat //@mute_graph A graph containing number of members muted and unmuted the chat @@ -5220,8 +5990,8 @@ updateAuthorizationState authorization_state:AuthorizationState = Update; //@description A new message was received; can also be an outgoing message @message The new message updateNewMessage message:message = Update; -//@description A request to send a message has reached the Telegram server. This doesn't mean that the message will be sent successfully or even that the send message request will be processed. -//-This update will be sent only if the option "use_quick_ack" is set to true. This update may be sent multiple times for the same message +//@description A request to send a message has reached the Telegram server. This doesn't mean that the message will be sent successfully. +//-This update is sent only if the option "use_quick_ack" is set to true. This update may be sent multiple times for the same message //@chat_id The chat identifier of the sent message //@message_id A temporary message identifier updateMessageSendAcknowledged chat_id:int53 message_id:int53 = Update; @@ -5232,9 +6002,8 @@ updateMessageSendSucceeded message:message old_message_id:int53 = Update; //@description A message failed to send. Be aware that some messages being sent can be irrecoverably deleted, in which case updateDeleteMessages will be received instead of this update //@message The failed to send message //@old_message_id The previous temporary message identifier -//@error_code An error code -//@error_message Error message -updateMessageSendFailed message:message old_message_id:int53 error_code:int32 error_message:string = Update; +//@error The cause of the message sending failure +updateMessageSendFailed message:message old_message_id:int53 error:error = Update; //@description The message content has changed @chat_id Chat identifier @message_id Message identifier @new_content New message content updateMessageContent chat_id:int53 message_id:int53 new_content:MessageContent = Update; @@ -5279,12 +6048,18 @@ updateChatTitle chat_id:int53 title:string = Update; //@description A chat photo was changed @chat_id Chat identifier @photo The new chat photo; may be null updateChatPhoto chat_id:int53 photo:chatPhotoInfo = Update; +//@description A chat accent color has changed @chat_id Chat identifier @accent_color_id The new chat accent color identifier +updateChatAccentColor chat_id:int53 accent_color_id:int32 = Update; + +//@description A chat's custom emoji for reply background has changed @chat_id Chat identifier @background_custom_emoji_id The new identifier of a custom emoji to be shown on the reply header background; 0 if none +updateChatBackgroundCustomEmoji chat_id:int53 background_custom_emoji_id:int64 = Update; + //@description Chat permissions was changed @chat_id Chat identifier @permissions The new chat permissions updateChatPermissions chat_id:int53 permissions:chatPermissions = Update; -//@description The last message of a chat was changed. If last_message is null, then the last message in the chat became unknown. Some new unknown messages might be added to the chat in this case +//@description The last message of a chat was changed //@chat_id Chat identifier -//@last_message The new last message in the chat; may be null +//@last_message The new last message in the chat; may be null if the last message became unknown. While the last message is unknown, new messages can be added to the chat without corresponding updateNewMessage update //@positions The new chat positions in the chat lists updateChatLastMessage chat_id:int53 last_message:message positions:vector = Update; @@ -5328,6 +6103,9 @@ updateChatPendingJoinRequests chat_id:int53 pending_join_requests:chatJoinReques //@reply_markup_message_id Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat updateChatReplyMarkup chat_id:int53 reply_markup_message_id:int53 = Update; +//@description The chat background was changed @chat_id Chat identifier @background The new chat background; may be null if background was reset to default +updateChatBackground chat_id:int53 background:chatBackground = Update; + //@description The chat theme was changed @chat_id Chat identifier @theme_name The new name of the chat theme; may be empty if theme was reset to default updateChatTheme chat_id:int53 theme_name:string = Update; @@ -5352,17 +6130,17 @@ updateChatIsTranslatable chat_id:int53 is_translatable:Bool = Update; //@description A chat was marked as unread or was read @chat_id Chat identifier @is_marked_as_unread New value of is_marked_as_unread updateChatIsMarkedAsUnread chat_id:int53 is_marked_as_unread:Bool = Update; -//@description A chat was blocked or unblocked @chat_id Chat identifier @is_blocked New value of is_blocked -updateChatIsBlocked chat_id:int53 is_blocked:Bool = Update; +//@description A chat was blocked or unblocked @chat_id Chat identifier @block_list Block list to which the chat is added; may be null if none +updateChatBlockList chat_id:int53 block_list:BlockList = Update; //@description A chat's has_scheduled_messages field has changed @chat_id Chat identifier @has_scheduled_messages New value of has_scheduled_messages updateChatHasScheduledMessages chat_id:int53 has_scheduled_messages:Bool = Update; -//@description The list of chat filters or a chat filter has changed @chat_filters The new list of chat filters @main_chat_list_position Position of the main chat list among chat filters, 0-based -updateChatFilters chat_filters:vector main_chat_list_position:int32 = Update; +//@description The list of chat folders or a chat folder has changed @chat_folders The new list of chat folders @main_chat_list_position Position of the main chat list among chat folders, 0-based +updateChatFolders chat_folders:vector main_chat_list_position:int32 = Update; //@description The number of online group members has changed. This update with non-zero number of online group members is sent only for currently opened chats. -//-There is no guarantee that it will be sent just after the number of online users has changed +//-There is no guarantee that it is sent just after the number of online users has changed //@chat_id Identifier of the chat //@online_member_count New number of online members in the chat, or 0 if unknown updateChatOnlineMemberCount chat_id:int53 online_member_count:int32 = Update; @@ -5383,8 +6161,8 @@ updateNotification notification_group_id:int32 notification:notification = Updat //@notification_settings_chat_id Chat identifier, which notification settings must be applied to the added notifications //@notification_sound_id Identifier of the notification sound to be played; 0 if sound is disabled //@total_count Total number of unread notifications in the group, can be bigger than number of active notifications -//@added_notifications List of added group notifications, sorted by notification ID -//@removed_notification_ids Identifiers of removed group notifications, sorted by notification ID +//@added_notifications List of added group notifications, sorted by notification identifier +//@removed_notification_ids Identifiers of removed group notifications, sorted by notification identifier updateNotificationGroup notification_group_id:int32 type:NotificationGroupType chat_id:int53 notification_settings_chat_id:int53 notification_sound_id:int64 total_count:int32 added_notifications:vector removed_notification_ids:vector = Update; //@description Contains active notifications that was shown on previous application launches. This update is sent only if the message database is used. In that case it comes once before any updateNotification and updateNotificationGroup update @groups Lists of active notification groups @@ -5502,6 +6280,33 @@ updateUnreadMessageCount chat_list:ChatList unread_count:int32 unread_unmuted_co //@marked_as_unread_unmuted_count Total number of unmuted chats marked as unread updateUnreadChatCount chat_list:ChatList total_count:int32 unread_count:int32 unread_unmuted_count:int32 marked_as_unread_count:int32 marked_as_unread_unmuted_count:int32 = Update; +//@description A story was changed @story The new information about the story +updateStory story:story = Update; + +//@description A story became inaccessible @story_sender_chat_id Identifier of the chat that posted the story @story_id Story identifier +updateStoryDeleted story_sender_chat_id:int53 story_id:int32 = Update; + +//@description A story has been successfully sent @story The sent story @old_story_id The previous temporary story identifier +updateStorySendSucceeded story:story old_story_id:int32 = Update; + +//@description A story failed to send. If the story sending is canceled, then updateStoryDeleted will be received instead of this update +//@story The failed to send story +//@error The cause of the story sending failure +//@error_type Type of the error; may be null if unknown +updateStorySendFailed story:story error:error error_type:CanSendStoryResult = Update; + +//@description The list of active stories posted by a specific chat has changed +//@active_stories The new list of active stories +updateChatActiveStories active_stories:chatActiveStories = Update; + +//@description Number of chats in a story list has changed @story_list The story list @chat_count Approximate total number of chats with active stories in the list +updateStoryListChatCount story_list:StoryList chat_count:int32 = Update; + +//@description Story stealth mode settings have changed +//@active_until_date Point in time (Unix timestamp) until stealth mode is active; 0 if it is disabled +//@cooldown_until_date Point in time (Unix timestamp) when stealth mode can be enabled again; 0 if there is no active cooldown +updateStoryStealthMode active_until_date:int32 cooldown_until_date:int32 = Update; + //@description An option changed its value @name The option name @value The new option value updateOption name:string value:OptionValue = Update; @@ -5532,6 +6337,12 @@ updateSelectedBackground for_dark_theme:Bool background:background = Update; //@description The list of available chat themes has changed @chat_themes The new list of chat themes updateChatThemes chat_themes:vector = Update; +//@description The list of supported accent colors has changed +//@colors Information about supported colors; colors with identifiers 0 (red), 1 (orange), 2 (purple/violet), 3 (green), 4 (cyan), 5 (blue), 6 (pink) must always be supported +//-and aren't included in the list. The exact colors for the accent colors with identifiers 0-6 must be taken from the app theme +//@available_accent_color_ids The list of accent color identifiers, which can be set through setAccentColor and setChatAccentColor. The colors must be shown in the specififed order +updateAccentColors colors:vector available_accent_color_ids:vector = Update; + //@description Some language pack strings have been updated @localization_target Localization target to which the language pack belongs @language_pack_id Identifier of the updated language pack @strings List of changed language pack strings; empty if all strings have changed updateLanguagePackStrings localization_target:string language_pack_id:string strings:vector = Update; @@ -5544,7 +6355,10 @@ updateTermsOfService terms_of_service_id:string terms_of_service:termsOfService //@description The list of users nearby has changed. The update is guaranteed to be sent only 60 seconds after a successful searchChatsNearby request @users_nearby The new list of users nearby updateUsersNearby users_nearby:vector = Update; -//@description The list of bots added to attachment menu has changed @bots The new list of bots added to attachment menu. The bots must not be shown on scheduled messages screen +//@description The first unconfirmed session has changed @session The unconfirmed session; may be null if none +updateUnconfirmedSession session:unconfirmedSession = Update; + +//@description The list of bots added to attachment or side menu has changed @bots The new list of bots. The bots must not be shown on scheduled messages screen updateAttachmentMenuBots bots:vector = Update; //@description A message was sent by an opened Web App, so the Web App needs to be closed @web_app_launch_id Identifier of Web App launch @@ -5637,17 +6451,21 @@ updateNewCustomQuery id:int64 data:string timeout:int32 = Update; //@description A poll was updated; for bots only @poll New data about the poll updatePoll poll:poll = Update; -//@description A user changed the answer to a poll; for bots only @poll_id Unique poll identifier @user_id The user, who changed the answer to the poll @option_ids 0-based identifiers of answer options, chosen by the user -updatePollAnswer poll_id:int64 user_id:int53 option_ids:vector = Update; +//@description A user changed the answer to a poll; for bots only +//@poll_id Unique poll identifier +//@voter_id Identifier of the message sender that changed the answer to the poll +//@option_ids 0-based identifiers of answer options, chosen by the user +updatePollAnswer poll_id:int64 voter_id:MessageSender option_ids:vector = Update; //@description User rights changed in a chat; for bots only //@chat_id Chat identifier //@actor_user_id Identifier of the user, changing the rights //@date Point in time (Unix timestamp) when the user rights was changed //@invite_link If user has joined the chat using an invite link, the invite link; may be null +//@via_chat_folder_invite_link True, if the user has joined the chat using an invite link for a chat folder //@old_chat_member Previous chat member //@new_chat_member New chat member -updateChatMember chat_id:int53 actor_user_id:int53 date:int32 invite_link:chatInviteLink old_chat_member:chatMember new_chat_member:chatMember = Update; +updateChatMember chat_id:int53 actor_user_id:int53 date:int32 invite_link:chatInviteLink via_chat_folder_invite_link:Bool old_chat_member:chatMember new_chat_member:chatMember = Update; //@description A user sent a join request to a chat; for bots only //@chat_id Chat identifier @@ -5656,6 +6474,11 @@ updateChatMember chat_id:int53 actor_user_id:int53 date:int32 invite_link:chatIn //@invite_link The invite link, which was used to send join request; may be null updateNewChatJoinRequest chat_id:int53 request:chatJoinRequest user_chat_id:int53 invite_link:chatInviteLink = Update; +//@description A chat boost has changed; for bots only +//@chat_id Chat identifier +//@boost New information about the boost +updateChatBoost chat_id:int53 boost:chatBoost = Update; + //@description Contains a list of updates @updates List of updates updates updates:vector = Updates;