From 1802725316c1a842e257dde66ea002a93946fabe Mon Sep 17 00:00:00 2001 From: Nikolay M Date: Mon, 23 Oct 2023 17:57:45 +0400 Subject: [PATCH] Update to API 6.9 (#62) --- src/Funogram.Generator/out/methods.json | 85 ++++++++---- src/Funogram.Generator/out/types.json | 131 ++++++++++++++++--- src/Funogram.Telegram/Bot.fs | 12 +- src/Funogram.Telegram/Directory.Build.props | 2 +- src/Funogram.Telegram/RequestsTypes.fs | 39 ++++-- src/Funogram.Telegram/Types.fs | 138 +++++++++++++------- 6 files changed, 308 insertions(+), 99 deletions(-) diff --git a/src/Funogram.Generator/out/methods.json b/src/Funogram.Generator/out/methods.json index fbc0d33..923d29b 100644 --- a/src/Funogram.Generator/out/methods.json +++ b/src/Funogram.Generator/out/methods.json @@ -31,7 +31,7 @@ { "OriginalName": "allowed_updates", "ConvertedName": "AllowedUpdates", - "Description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [\u201Cmessage\u201D, \u201Cedited_channel_post\u201D, \u201Ccallback_query\u201D] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.\n\nPlease note that this parameter doesn\u0027t affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.", + "Description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [\u0022message\u0022, \u0022edited_channel_post\u0022, \u0022callback_query\u0022] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.\n\nPlease note that this parameter doesn\u0027t affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.", "OriginalFieldType": "Array of String", "ConvertedFieldType": "string[]", "Optional": true @@ -80,7 +80,7 @@ { "OriginalName": "allowed_updates", "ConvertedName": "AllowedUpdates", - "Description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [\u201Cmessage\u201D, \u201Cedited_channel_post\u201D, \u201Ccallback_query\u201D] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.\nPlease note that this parameter doesn\u0027t affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time.", + "Description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [\u0022message\u0022, \u0022edited_channel_post\u0022, \u0022callback_query\u0022] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.\nPlease note that this parameter doesn\u0027t affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time.", "OriginalFieldType": "Array of String", "ConvertedFieldType": "string[]", "Optional": true @@ -1989,7 +1989,7 @@ { "OriginalName": "until_date", "ConvertedName": "UntilDate", - "Description": "Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only.", + "Description": "Date when the user will be unbanned; Unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only.", "OriginalFieldType": "Integer", "ConvertedFieldType": "int64", "Optional": true @@ -2079,7 +2079,7 @@ { "OriginalName": "until_date", "ConvertedName": "UntilDate", - "Description": "Date when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever", + "Description": "Date when restrictions will be lifted for the user; Unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever", "OriginalFieldType": "Integer", "ConvertedFieldType": "int64", "Optional": true @@ -2120,23 +2120,7 @@ { "OriginalName": "can_manage_chat", "ConvertedName": "CanManageChat", - "Description": "Pass True if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege", - "OriginalFieldType": "Boolean", - "ConvertedFieldType": "bool", - "Optional": true - }, - { - "OriginalName": "can_post_messages", - "ConvertedName": "CanPostMessages", - "Description": "Pass True if the administrator can create channel posts, channels only", - "OriginalFieldType": "Boolean", - "ConvertedFieldType": "bool", - "Optional": true - }, - { - "OriginalName": "can_edit_messages", - "ConvertedName": "CanEditMessages", - "Description": "Pass True if the administrator can edit messages of other users and can pin messages, channels only", + "Description": "Pass True if the administrator can access the chat event log, boost list in channels, see channel members, report spam messages, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege", "OriginalFieldType": "Boolean", "ConvertedFieldType": "bool", "Optional": true @@ -2160,7 +2144,7 @@ { "OriginalName": "can_restrict_members", "ConvertedName": "CanRestrictMembers", - "Description": "Pass True if the administrator can restrict, ban or unban chat members", + "Description": "Pass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics", "OriginalFieldType": "Boolean", "ConvertedFieldType": "bool", "Optional": true @@ -2189,6 +2173,22 @@ "ConvertedFieldType": "bool", "Optional": true }, + { + "OriginalName": "can_post_messages", + "ConvertedName": "CanPostMessages", + "Description": "Pass True if the administrator can post messages in the channel, or access channel statistics; channels only", + "OriginalFieldType": "Boolean", + "ConvertedFieldType": "bool", + "Optional": true + }, + { + "OriginalName": "can_edit_messages", + "ConvertedName": "CanEditMessages", + "Description": "Pass True if the administrator can edit messages of other users and can pin messages; channels only", + "OriginalFieldType": "Boolean", + "ConvertedFieldType": "bool", + "Optional": true + }, { "OriginalName": "can_pin_messages", "ConvertedName": "CanPinMessages", @@ -2197,6 +2197,30 @@ "ConvertedFieldType": "bool", "Optional": true }, + { + "OriginalName": "can_post_stories", + "ConvertedName": "CanPostStories", + "Description": "Pass True if the administrator can post stories in the channel; channels only", + "OriginalFieldType": "Boolean", + "ConvertedFieldType": "bool", + "Optional": true + }, + { + "OriginalName": "can_edit_stories", + "ConvertedName": "CanEditStories", + "Description": "Pass True if the administrator can edit stories posted by other users; channels only", + "OriginalFieldType": "Boolean", + "ConvertedFieldType": "bool", + "Optional": true + }, + { + "OriginalName": "can_delete_stories", + "ConvertedName": "CanDeleteStories", + "Description": "Pass True if the administrator can delete stories posted by other users; channels only", + "OriginalFieldType": "Boolean", + "ConvertedFieldType": "bool", + "Optional": true + }, { "OriginalName": "can_manage_topics", "ConvertedName": "CanManageTopics", @@ -3108,6 +3132,23 @@ "OriginalReturnType": "True", "ConvertedReturnType": "bool" }, + { + "OriginalName": "unpinAllGeneralForumTopicMessages", + "ConvertedName": "UnpinAllGeneralForumTopicMessages", + "Description": "Use this method to clear the list of pinned messages in a General forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.", + "Fields": [ + { + "OriginalName": "chat_id", + "ConvertedName": "ChatId", + "Description": "Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)", + "OriginalFieldType": "Integer or String", + "ConvertedFieldType": "ChatId", + "Optional": false + } + ], + "OriginalReturnType": "True", + "ConvertedReturnType": "bool" + }, { "OriginalName": "answerCallbackQuery", "ConvertedName": "AnswerCallbackQuery", diff --git a/src/Funogram.Generator/out/types.json b/src/Funogram.Generator/out/types.json index da2218c..a6ac59d 100644 --- a/src/Funogram.Generator/out/types.json +++ b/src/Funogram.Generator/out/types.json @@ -113,7 +113,7 @@ { "OriginalName": "chat_member", "ConvertedName": "ChatMember", - "Description": "A chat member\u0027s status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify \u201Cchat_member\u201D in the list of allowed_updates to receive these updates.", + "Description": "A chat member\u0027s status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify \u0022chat_member\u0022 in the list of allowed_updates to receive these updates.", "OriginalFieldType": "ChatMemberUpdated", "ConvertedFieldType": "ChatMemberUpdated", "Optional": true @@ -399,6 +399,14 @@ "ConvertedFieldType": "string", "Optional": true }, + { + "OriginalName": "emoji_status_expiration_date", + "ConvertedName": "EmojiStatusExpirationDate", + "Description": "Expiration date of the emoji status of the other party in a private chat in Unix time, if any. Returned only in getChat.", + "OriginalFieldType": "Integer", + "ConvertedFieldType": "int64", + "Optional": true + }, { "OriginalName": "bio", "ConvertedName": "Bio", @@ -770,6 +778,14 @@ "ConvertedFieldType": "Sticker", "Optional": true }, + { + "OriginalName": "story", + "ConvertedName": "Story", + "Description": "Message is a forwarded story", + "OriginalFieldType": "Story", + "ConvertedFieldType": "Story", + "Optional": true + }, { "OriginalName": "video", "ConvertedName": "Video", @@ -1005,7 +1021,7 @@ { "OriginalName": "write_access_allowed", "ConvertedName": "WriteAccessAllowed", - "Description": "Service message: the user allowed the bot added to the attachment menu to write messages", + "Description": "Service message: the user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess", "OriginalFieldType": "WriteAccessAllowed", "ConvertedFieldType": "WriteAccessAllowed", "Optional": true @@ -1488,6 +1504,13 @@ ] } }, + { + "Name": "Story", + "Description": "This object represents a message about a forwarded story in the chat. Currently holds no information.", + "Kind": { + "Case": "Stub" + } + }, { "Name": "Video", "Description": "This object represents a video file.", @@ -1801,18 +1824,26 @@ "ConvertedFieldType": "string", "Optional": false }, + { + "OriginalName": "voter_chat", + "ConvertedName": "VoterChat", + "Description": "The chat that changed the answer to the poll, if the voter is anonymous", + "OriginalFieldType": "Chat", + "ConvertedFieldType": "Chat", + "Optional": true + }, { "OriginalName": "user", "ConvertedName": "User", - "Description": "The user, who changed the answer to the poll", + "Description": "The user that changed the answer to the poll, if the voter isn\u0027t anonymous", "OriginalFieldType": "User", "ConvertedFieldType": "User", - "Optional": false + "Optional": true }, { "OriginalName": "option_ids", "ConvertedName": "OptionIds", - "Description": "0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote.", + "Description": "0-based identifiers of chosen answer options. May be empty if the vote was retracted.", "OriginalFieldType": "Array of Integer", "ConvertedFieldType": "int64[]", "Optional": false @@ -2289,18 +2320,34 @@ }, { "Name": "WriteAccessAllowed", - "Description": "This object represents a service message about a user allowing a bot to write messages after adding the bot to the attachment menu or launching a Web App from a link.", + "Description": "This object represents a service message about a user allowing a bot to write messages after adding it to the attachment menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess.", "Kind": { "Case": "Fields", "Fields": [ [ + { + "OriginalName": "from_request", + "ConvertedName": "FromRequest", + "Description": "True, if the access was granted after the user accepted an explicit request from a Web App sent by the method requestWriteAccess", + "OriginalFieldType": "Boolean", + "ConvertedFieldType": "bool", + "Optional": true + }, { "OriginalName": "web_app_name", "ConvertedName": "WebAppName", - "Description": "Name of the Web App which was launched from a link", + "Description": "Name of the Web App, if the access was granted when the Web App was launched from a link", "OriginalFieldType": "String", "ConvertedFieldType": "string", "Optional": true + }, + { + "OriginalName": "from_attachment_menu", + "ConvertedName": "FromAttachmentMenu", + "Description": "True, if the access was granted when the bot was added to the attachment or side menu", + "OriginalFieldType": "Boolean", + "ConvertedFieldType": "bool", + "Optional": true } ] ] @@ -2810,7 +2857,7 @@ { "OriginalName": "switch_inline_query", "ConvertedName": "SwitchInlineQuery", - "Description": "If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot\u0027s username and the specified inline query in the input field. May be empty, in which case just the bot\u0027s username will be inserted.\n\nNote: This offers an easy way for users to start using your bot in inline mode when they are currently in a private chat with it. Especially useful when combined with switch_pm\u2026 actions - in this case the user will be automatically returned to the chat they switched from, skipping the chat selection screen.", + "Description": "If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot\u0027s username and the specified inline query in the input field. May be empty, in which case just the bot\u0027s username will be inserted.", "OriginalFieldType": "String", "ConvertedFieldType": "string", "Optional": true @@ -3191,7 +3238,7 @@ { "OriginalName": "can_manage_chat", "ConvertedName": "CanManageChat", - "Description": "True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege", + "Description": "True, if the administrator can access the chat event log, boost list in channels, see channel members, report spam messages, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege", "OriginalFieldType": "Boolean", "ConvertedFieldType": "bool", "Optional": false @@ -3215,7 +3262,7 @@ { "OriginalName": "can_restrict_members", "ConvertedName": "CanRestrictMembers", - "Description": "True, if the administrator can restrict, ban or unban chat members", + "Description": "True, if the administrator can restrict, ban or unban chat members, or access supergroup statistics", "OriginalFieldType": "Boolean", "ConvertedFieldType": "bool", "Optional": false @@ -3247,7 +3294,7 @@ { "OriginalName": "can_post_messages", "ConvertedName": "CanPostMessages", - "Description": "True, if the administrator can post in the channel; channels only", + "Description": "True, if the administrator can post messages in the channel, or access channel statistics; channels only", "OriginalFieldType": "Boolean", "ConvertedFieldType": "bool", "Optional": true @@ -3268,6 +3315,30 @@ "ConvertedFieldType": "bool", "Optional": true }, + { + "OriginalName": "can_post_stories", + "ConvertedName": "CanPostStories", + "Description": "True, if the administrator can post stories in the channel; channels only", + "OriginalFieldType": "Boolean", + "ConvertedFieldType": "bool", + "Optional": true + }, + { + "OriginalName": "can_edit_stories", + "ConvertedName": "CanEditStories", + "Description": "True, if the administrator can edit stories posted by other users; channels only", + "OriginalFieldType": "Boolean", + "ConvertedFieldType": "bool", + "Optional": true + }, + { + "OriginalName": "can_delete_stories", + "ConvertedName": "CanDeleteStories", + "Description": "True, if the administrator can delete stories posted by other users; channels only", + "OriginalFieldType": "Boolean", + "ConvertedFieldType": "bool", + "Optional": true + }, { "OriginalName": "can_manage_topics", "ConvertedName": "CanManageTopics", @@ -3408,7 +3479,7 @@ { "OriginalName": "can_manage_chat", "ConvertedName": "CanManageChat", - "Description": "True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege", + "Description": "True, if the administrator can access the chat event log, boost list in channels, see channel members, report spam messages, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege", "OriginalFieldType": "Boolean", "ConvertedFieldType": "bool", "Optional": false @@ -3432,7 +3503,7 @@ { "OriginalName": "can_restrict_members", "ConvertedName": "CanRestrictMembers", - "Description": "True, if the administrator can restrict, ban or unban chat members", + "Description": "True, if the administrator can restrict, ban or unban chat members, or access supergroup statistics", "OriginalFieldType": "Boolean", "ConvertedFieldType": "bool", "Optional": false @@ -3464,7 +3535,7 @@ { "OriginalName": "can_post_messages", "ConvertedName": "CanPostMessages", - "Description": "True, if the administrator can post in the channel; channels only", + "Description": "True, if the administrator can post messages in the channel, or access channel statistics; channels only", "OriginalFieldType": "Boolean", "ConvertedFieldType": "bool", "Optional": true @@ -3485,6 +3556,30 @@ "ConvertedFieldType": "bool", "Optional": true }, + { + "OriginalName": "can_post_stories", + "ConvertedName": "CanPostStories", + "Description": "True, if the administrator can post stories in the channel; channels only", + "OriginalFieldType": "Boolean", + "ConvertedFieldType": "bool", + "Optional": true + }, + { + "OriginalName": "can_edit_stories", + "ConvertedName": "CanEditStories", + "Description": "True, if the administrator can edit stories posted by other users; channels only", + "OriginalFieldType": "Boolean", + "ConvertedFieldType": "bool", + "Optional": true + }, + { + "OriginalName": "can_delete_stories", + "ConvertedName": "CanDeleteStories", + "Description": "True, if the administrator can delete stories posted by other users; channels only", + "OriginalFieldType": "Boolean", + "ConvertedFieldType": "bool", + "Optional": true + }, { "OriginalName": "can_manage_topics", "ConvertedName": "CanManageTopics", @@ -3686,7 +3781,7 @@ { "OriginalName": "until_date", "ConvertedName": "UntilDate", - "Description": "Date when restrictions will be lifted for this user; unix time. If 0, then the user is restricted forever", + "Description": "Date when restrictions will be lifted for this user; Unix time. If 0, then the user is restricted forever", "OriginalFieldType": "Integer", "ConvertedFieldType": "DateTime", "Optional": false @@ -3748,7 +3843,7 @@ { "OriginalName": "until_date", "ConvertedName": "UntilDate", - "Description": "Date when restrictions will be lifted for this user; unix time. If 0, then the user is banned forever", + "Description": "Date when restrictions will be lifted for this user; Unix time. If 0, then the user is banned forever", "OriginalFieldType": "Integer", "ConvertedFieldType": "DateTime", "Optional": false @@ -3850,7 +3945,7 @@ { "OriginalName": "user_chat_id", "ConvertedName": "UserChatId", - "Description": "Identifier of a private chat with the user who sent the join request. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot can use this identifier for 24 hours to send messages until the join request is processed, assuming no other administrator contacted the user.", + "Description": "Identifier of a private chat with the user who sent the join request. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot can use this identifier for 5 minutes to send messages until the join request is processed, assuming no other administrator contacted the user.", "OriginalFieldType": "Integer", "ConvertedFieldType": "int64", "Optional": false @@ -5285,7 +5380,7 @@ { "OriginalName": "web_app", "ConvertedName": "WebApp", - "Description": "Description of the Web App that will be launched when the user presses the button. The Web App will be able to switch back to the inline mode using the method web_app_switch_inline_query inside the Web App.", + "Description": "Description of the Web App that will be launched when the user presses the button. The Web App will be able to switch back to the inline mode using the method switchInlineQuery inside the Web App.", "OriginalFieldType": "WebAppInfo", "ConvertedFieldType": "WebAppInfo", "Optional": true diff --git a/src/Funogram.Telegram/Bot.fs b/src/Funogram.Telegram/Bot.fs index c351190..dd61f1a 100644 --- a/src/Funogram.Telegram/Bot.fs +++ b/src/Funogram.Telegram/Bot.fs @@ -3,6 +3,7 @@ open System open System.IO open System.Net.Http +open System.Net.Sockets open Funogram.Telegram open Funogram.Telegram.Sscanf open Funogram.Telegram.Types @@ -116,12 +117,12 @@ let private runBot config me updateArrived updatesArrived = return! loopAsync offset // send new offset | Error e -> config.OnError (e.AsException() :> Exception) - + // add delay in case of HTTP error // for example: the server may be "busy" if e.Description = "HTTP_ERROR" then do! Async.Sleep 1000 - + return! loopAsync offset | _ -> return! loopAsync offset @@ -131,7 +132,12 @@ let private runBot config me updateArrived updatesArrived = config.OnError e do! Async.Sleep 1000 return! loopAsync offset - + + | :? AggregateException as e when e.InnerExceptions <> null && e.InnerExceptions |> Seq.exists (fun x -> (x :? HttpRequestException) || (x :? SocketException)) -> + config.OnError e + do! Async.Sleep 1000 + return! loopAsync offset + | ex -> config.OnError ex // in case of "general" error we should increment offset to skip problematic update diff --git a/src/Funogram.Telegram/Directory.Build.props b/src/Funogram.Telegram/Directory.Build.props index 11d388a..46ea3d0 100644 --- a/src/Funogram.Telegram/Directory.Build.props +++ b/src/Funogram.Telegram/Directory.Build.props @@ -1,6 +1,6 @@ - 6.7.0.0 + 6.9.0.0 Nikolay Matyushin Funogram.Telegram Funogram.Telegram diff --git a/src/Funogram.Telegram/RequestsTypes.fs b/src/Funogram.Telegram/RequestsTypes.fs index 9fa7919..bce16a0 100644 --- a/src/Funogram.Telegram/RequestsTypes.fs +++ b/src/Funogram.Telegram/RequestsTypes.fs @@ -794,38 +794,44 @@ type PromoteChatMember = UserId: int64 IsAnonymous: bool option CanManageChat: bool option - CanPostMessages: bool option - CanEditMessages: bool option CanDeleteMessages: bool option CanManageVideoChats: bool option CanRestrictMembers: bool option CanPromoteMembers: bool option CanChangeInfo: bool option CanInviteUsers: bool option + CanPostMessages: bool option + CanEditMessages: bool option CanPinMessages: bool option + CanPostStories: bool option + CanEditStories: bool option + CanDeleteStories: bool option CanManageTopics: bool option } - static member Make(chatId: ChatId, userId: int64, ?isAnonymous: bool, ?canManageChat: bool, ?canPostMessages: bool, ?canEditMessages: bool, ?canDeleteMessages: bool, ?canManageVideoChats: bool, ?canRestrictMembers: bool, ?canPromoteMembers: bool, ?canChangeInfo: bool, ?canInviteUsers: bool, ?canPinMessages: bool, ?canManageTopics: bool) = + static member Make(chatId: ChatId, userId: int64, ?canEditStories: bool, ?canPostStories: bool, ?canPinMessages: bool, ?canEditMessages: bool, ?canPostMessages: bool, ?canInviteUsers: bool, ?canChangeInfo: bool, ?canPromoteMembers: bool, ?canRestrictMembers: bool, ?canManageVideoChats: bool, ?canDeleteMessages: bool, ?canManageChat: bool, ?isAnonymous: bool, ?canDeleteStories: bool, ?canManageTopics: bool) = { ChatId = chatId UserId = userId IsAnonymous = isAnonymous CanManageChat = canManageChat - CanPostMessages = canPostMessages - CanEditMessages = canEditMessages CanDeleteMessages = canDeleteMessages CanManageVideoChats = canManageVideoChats CanRestrictMembers = canRestrictMembers CanPromoteMembers = canPromoteMembers CanChangeInfo = canChangeInfo CanInviteUsers = canInviteUsers + CanPostMessages = canPostMessages + CanEditMessages = canEditMessages CanPinMessages = canPinMessages + CanPostStories = canPostStories + CanEditStories = canEditStories + CanDeleteStories = canDeleteStories CanManageTopics = canManageTopics } - static member Make(chatId: int64, userId: int64, ?isAnonymous: bool, ?canManageChat: bool, ?canPostMessages: bool, ?canEditMessages: bool, ?canDeleteMessages: bool, ?canManageVideoChats: bool, ?canRestrictMembers: bool, ?canPromoteMembers: bool, ?canChangeInfo: bool, ?canInviteUsers: bool, ?canPinMessages: bool, ?canManageTopics: bool) = - PromoteChatMember.Make(ChatId.Int chatId, userId, ?isAnonymous = isAnonymous, ?canManageChat = canManageChat, ?canPostMessages = canPostMessages, ?canEditMessages = canEditMessages, ?canDeleteMessages = canDeleteMessages, ?canManageVideoChats = canManageVideoChats, ?canRestrictMembers = canRestrictMembers, ?canPromoteMembers = canPromoteMembers, ?canChangeInfo = canChangeInfo, ?canInviteUsers = canInviteUsers, ?canPinMessages = canPinMessages, ?canManageTopics = canManageTopics) - static member Make(chatId: string, userId: int64, ?isAnonymous: bool, ?canManageChat: bool, ?canPostMessages: bool, ?canEditMessages: bool, ?canDeleteMessages: bool, ?canManageVideoChats: bool, ?canRestrictMembers: bool, ?canPromoteMembers: bool, ?canChangeInfo: bool, ?canInviteUsers: bool, ?canPinMessages: bool, ?canManageTopics: bool) = - PromoteChatMember.Make(ChatId.String chatId, userId, ?isAnonymous = isAnonymous, ?canManageChat = canManageChat, ?canPostMessages = canPostMessages, ?canEditMessages = canEditMessages, ?canDeleteMessages = canDeleteMessages, ?canManageVideoChats = canManageVideoChats, ?canRestrictMembers = canRestrictMembers, ?canPromoteMembers = canPromoteMembers, ?canChangeInfo = canChangeInfo, ?canInviteUsers = canInviteUsers, ?canPinMessages = canPinMessages, ?canManageTopics = canManageTopics) + static member Make(chatId: int64, userId: int64, ?canEditStories: bool, ?canPostStories: bool, ?canPinMessages: bool, ?canEditMessages: bool, ?canPostMessages: bool, ?canInviteUsers: bool, ?canChangeInfo: bool, ?canPromoteMembers: bool, ?canRestrictMembers: bool, ?canManageVideoChats: bool, ?canDeleteMessages: bool, ?canManageChat: bool, ?isAnonymous: bool, ?canDeleteStories: bool, ?canManageTopics: bool) = + PromoteChatMember.Make(ChatId.Int chatId, userId, ?canEditStories = canEditStories, ?canPostStories = canPostStories, ?canPinMessages = canPinMessages, ?canEditMessages = canEditMessages, ?canPostMessages = canPostMessages, ?canInviteUsers = canInviteUsers, ?canChangeInfo = canChangeInfo, ?canPromoteMembers = canPromoteMembers, ?canRestrictMembers = canRestrictMembers, ?canManageVideoChats = canManageVideoChats, ?canDeleteMessages = canDeleteMessages, ?canManageChat = canManageChat, ?isAnonymous = isAnonymous, ?canDeleteStories = canDeleteStories, ?canManageTopics = canManageTopics) + static member Make(chatId: string, userId: int64, ?canEditStories: bool, ?canPostStories: bool, ?canPinMessages: bool, ?canEditMessages: bool, ?canPostMessages: bool, ?canInviteUsers: bool, ?canChangeInfo: bool, ?canPromoteMembers: bool, ?canRestrictMembers: bool, ?canManageVideoChats: bool, ?canDeleteMessages: bool, ?canManageChat: bool, ?isAnonymous: bool, ?canDeleteStories: bool, ?canManageTopics: bool) = + PromoteChatMember.Make(ChatId.String chatId, userId, ?canEditStories = canEditStories, ?canPostStories = canPostStories, ?canPinMessages = canPinMessages, ?canEditMessages = canEditMessages, ?canPostMessages = canPostMessages, ?canInviteUsers = canInviteUsers, ?canChangeInfo = canChangeInfo, ?canPromoteMembers = canPromoteMembers, ?canRestrictMembers = canRestrictMembers, ?canManageVideoChats = canManageVideoChats, ?canDeleteMessages = canDeleteMessages, ?canManageChat = canManageChat, ?isAnonymous = isAnonymous, ?canDeleteStories = canDeleteStories, ?canManageTopics = canManageTopics) interface IRequestBase with member _.MethodName = "promoteChatMember" @@ -1433,6 +1439,21 @@ type UnhideGeneralForumTopic = interface IRequestBase with member _.MethodName = "unhideGeneralForumTopic" +type UnpinAllGeneralForumTopicMessages = + { + ChatId: ChatId + } + static member Make(chatId: ChatId) = + { + ChatId = chatId + } + static member Make(chatId: int64) = + UnpinAllGeneralForumTopicMessages.Make(ChatId.Int chatId) + static member Make(chatId: string) = + UnpinAllGeneralForumTopicMessages.Make(ChatId.String chatId) + interface IRequestBase with + member _.MethodName = "unpinAllGeneralForumTopicMessages" + type AnswerCallbackQuery = { CallbackQueryId: string diff --git a/src/Funogram.Telegram/Types.fs b/src/Funogram.Telegram/Types.fs index 72eac75..9fe6bf8 100644 --- a/src/Funogram.Telegram/Types.fs +++ b/src/Funogram.Telegram/Types.fs @@ -113,7 +113,7 @@ and [] Update = /// The bot's chat member status was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user. [] MyChatMember: ChatMemberUpdated option - /// A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify “chat_member” in the list of allowed_updates to receive these updates. + /// A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify "chat_member" in the list of allowed_updates to receive these updates. [] ChatMember: ChatMemberUpdated option /// A request to join the chat has been sent. The bot must have the can_invite_users administrator right in the chat to receive these updates. @@ -270,6 +270,9 @@ and [] Chat = /// Custom emoji identifier of emoji status of the other party in a private chat. Returned only in getChat. [] EmojiStatusCustomEmojiId: string option + /// Expiration date of the emoji status of the other party in a private chat in Unix time, if any. Returned only in getChat. + [] + EmojiStatusExpirationDate: int64 option /// Bio of the other party in a private chat. Returned only in getChat. [] Bio: string option @@ -325,7 +328,7 @@ and [] Chat = [] Location: ChatLocation option } - static member Create(id: int64, ``type``: ChatType, ?canSetStickerSet: bool, ?stickerSetName: string, ?hasProtectedContent: bool, ?hasHiddenMembers: bool, ?hasAggressiveAntiSpamEnabled: bool, ?messageAutoDeleteTime: int64, ?slowModeDelay: int64, ?permissions: ChatPermissions, ?pinnedMessage: Message, ?inviteLink: string, ?description: string, ?joinByRequest: bool, ?joinToSendMessages: bool, ?hasRestrictedVoiceAndVideoMessages: bool, ?hasPrivateForwards: bool, ?bio: string, ?emojiStatusCustomEmojiId: string, ?activeUsernames: string[], ?photo: ChatPhoto, ?isForum: bool, ?lastName: string, ?firstName: string, ?username: string, ?title: string, ?linkedChatId: int64, ?location: ChatLocation) = + static member Create(id: int64, ``type``: ChatType, ?canSetStickerSet: bool, ?stickerSetName: string, ?hasProtectedContent: bool, ?hasHiddenMembers: bool, ?hasAggressiveAntiSpamEnabled: bool, ?messageAutoDeleteTime: int64, ?slowModeDelay: int64, ?permissions: ChatPermissions, ?pinnedMessage: Message, ?inviteLink: string, ?description: string, ?joinByRequest: bool, ?joinToSendMessages: bool, ?hasRestrictedVoiceAndVideoMessages: bool, ?hasPrivateForwards: bool, ?bio: string, ?emojiStatusExpirationDate: int64, ?emojiStatusCustomEmojiId: string, ?activeUsernames: string[], ?photo: ChatPhoto, ?isForum: bool, ?lastName: string, ?firstName: string, ?username: string, ?title: string, ?linkedChatId: int64, ?location: ChatLocation) = { Id = id Type = ``type`` @@ -345,6 +348,7 @@ and [] Chat = HasRestrictedVoiceAndVideoMessages = hasRestrictedVoiceAndVideoMessages HasPrivateForwards = hasPrivateForwards Bio = bio + EmojiStatusExpirationDate = emojiStatusExpirationDate EmojiStatusCustomEmojiId = emojiStatusCustomEmojiId ActiveUsernames = activeUsernames Photo = photo @@ -441,6 +445,9 @@ and [] Message = /// Message is a sticker, information about the sticker [] Sticker: Sticker option + /// Message is a forwarded story + [] + Story: Story option /// Message is a video, information about the video [] Video: Video option @@ -528,7 +535,7 @@ and [] Message = /// The domain name of the website on which the user has logged in. More about Telegram Login » [] ConnectedWebsite: string option - /// Service message: the user allowed the bot added to the attachment menu to write messages + /// Service message: the user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess [] WriteAccessAllowed: WriteAccessAllowed option /// Telegram Passport data @@ -574,7 +581,7 @@ and [] Message = [] ReplyMarkup: InlineKeyboardMarkup option } - static member Create(messageId: int64, date: DateTime, chat: Chat, ?pinnedMessage: Message, ?migrateFromChatId: int64, ?migrateToChatId: int64, ?messageAutoDeleteTimerChanged: MessageAutoDeleteTimerChanged, ?channelChatCreated: bool, ?supergroupChatCreated: bool, ?deleteChatPhoto: bool, ?invoice: Invoice, ?newChatPhoto: PhotoSize[], ?newChatTitle: string, ?leftChatMember: User, ?newChatMembers: User[], ?location: Location, ?groupChatCreated: bool, ?successfulPayment: SuccessfulPayment, ?chatShared: ChatShared, ?venue: Venue, ?videoChatParticipantsInvited: VideoChatParticipantsInvited, ?videoChatEnded: VideoChatEnded, ?videoChatStarted: VideoChatStarted, ?videoChatScheduled: VideoChatScheduled, ?generalForumTopicUnhidden: GeneralForumTopicUnhidden, ?generalForumTopicHidden: GeneralForumTopicHidden, ?userShared: UserShared, ?forumTopicReopened: ForumTopicReopened, ?forumTopicEdited: ForumTopicEdited, ?forumTopicCreated: ForumTopicCreated, ?proximityAlertTriggered: ProximityAlertTriggered, ?passportData: PassportData, ?writeAccessAllowed: WriteAccessAllowed, ?connectedWebsite: string, ?forumTopicClosed: ForumTopicClosed, ?poll: Poll, ?game: Game, ?dice: Dice, ?messageThreadId: int64, ?from: User, ?senderChat: Chat, ?forwardFrom: User, ?forwardFromChat: Chat, ?forwardFromMessageId: int64, ?forwardSignature: string, ?forwardSenderName: string, ?forwardDate: DateTime, ?isTopicMessage: bool, ?isAutomaticForward: bool, ?replyToMessage: Message, ?viaBot: User, ?editDate: int64, ?hasProtectedContent: bool, ?mediaGroupId: string, ?authorSignature: string, ?contact: Contact, ?hasMediaSpoiler: bool, ?captionEntities: MessageEntity[], ?caption: string, ?voice: Voice, ?videoNote: VideoNote, ?webAppData: WebAppData, ?video: Video, ?photo: PhotoSize[], ?document: Document, ?audio: Audio, ?animation: Animation, ?entities: MessageEntity[], ?text: string, ?sticker: Sticker, ?replyMarkup: InlineKeyboardMarkup) = + static member Create(messageId: int64, date: DateTime, chat: Chat, ?pinnedMessage: Message, ?migrateFromChatId: int64, ?migrateToChatId: int64, ?messageAutoDeleteTimerChanged: MessageAutoDeleteTimerChanged, ?channelChatCreated: bool, ?supergroupChatCreated: bool, ?deleteChatPhoto: bool, ?invoice: Invoice, ?newChatPhoto: PhotoSize[], ?newChatTitle: string, ?leftChatMember: User, ?newChatMembers: User[], ?location: Location, ?groupChatCreated: bool, ?successfulPayment: SuccessfulPayment, ?chatShared: ChatShared, ?venue: Venue, ?videoChatParticipantsInvited: VideoChatParticipantsInvited, ?videoChatEnded: VideoChatEnded, ?videoChatStarted: VideoChatStarted, ?videoChatScheduled: VideoChatScheduled, ?generalForumTopicUnhidden: GeneralForumTopicUnhidden, ?generalForumTopicHidden: GeneralForumTopicHidden, ?userShared: UserShared, ?forumTopicReopened: ForumTopicReopened, ?forumTopicEdited: ForumTopicEdited, ?forumTopicCreated: ForumTopicCreated, ?proximityAlertTriggered: ProximityAlertTriggered, ?passportData: PassportData, ?writeAccessAllowed: WriteAccessAllowed, ?connectedWebsite: string, ?forumTopicClosed: ForumTopicClosed, ?poll: Poll, ?dice: Dice, ?webAppData: WebAppData, ?editDate: int64, ?viaBot: User, ?replyToMessage: Message, ?isAutomaticForward: bool, ?isTopicMessage: bool, ?forwardDate: DateTime, ?hasProtectedContent: bool, ?forwardSenderName: string, ?forwardFromMessageId: int64, ?forwardFromChat: Chat, ?forwardFrom: User, ?senderChat: Chat, ?from: User, ?messageThreadId: int64, ?forwardSignature: string, ?game: Game, ?mediaGroupId: string, ?text: string, ?contact: Contact, ?hasMediaSpoiler: bool, ?captionEntities: MessageEntity[], ?caption: string, ?voice: Voice, ?videoNote: VideoNote, ?authorSignature: string, ?video: Video, ?sticker: Sticker, ?photo: PhotoSize[], ?document: Document, ?audio: Audio, ?animation: Animation, ?entities: MessageEntity[], ?story: Story, ?replyMarkup: InlineKeyboardMarkup) = { MessageId = messageId Date = date @@ -612,40 +619,41 @@ and [] Message = ConnectedWebsite = connectedWebsite ForumTopicClosed = forumTopicClosed Poll = poll - Game = game Dice = dice - MessageThreadId = messageThreadId - From = from - SenderChat = senderChat - ForwardFrom = forwardFrom - ForwardFromChat = forwardFromChat - ForwardFromMessageId = forwardFromMessageId - ForwardSignature = forwardSignature - ForwardSenderName = forwardSenderName - ForwardDate = forwardDate - IsTopicMessage = isTopicMessage - IsAutomaticForward = isAutomaticForward - ReplyToMessage = replyToMessage - ViaBot = viaBot + WebAppData = webAppData EditDate = editDate + ViaBot = viaBot + ReplyToMessage = replyToMessage + IsAutomaticForward = isAutomaticForward + IsTopicMessage = isTopicMessage + ForwardDate = forwardDate HasProtectedContent = hasProtectedContent + ForwardSenderName = forwardSenderName + ForwardFromMessageId = forwardFromMessageId + ForwardFromChat = forwardFromChat + ForwardFrom = forwardFrom + SenderChat = senderChat + From = from + MessageThreadId = messageThreadId + ForwardSignature = forwardSignature + Game = game MediaGroupId = mediaGroupId - AuthorSignature = authorSignature + Text = text Contact = contact HasMediaSpoiler = hasMediaSpoiler CaptionEntities = captionEntities Caption = caption Voice = voice VideoNote = videoNote - WebAppData = webAppData + AuthorSignature = authorSignature Video = video + Sticker = sticker Photo = photo Document = document Audio = audio Animation = animation Entities = entities - Text = text - Sticker = sticker + Story = story ReplyMarkup = replyMarkup } @@ -845,6 +853,10 @@ and [] Document = FileSize = fileSize } +/// This object represents a message about a forwarded story in the chat. Currently holds no information. +and Story = + new() = {} + /// This object represents a video file. and [] Video = { @@ -1015,18 +1027,22 @@ and [] PollAnswer = /// Unique poll identifier [] PollId: string - /// The user, who changed the answer to the poll + /// The chat that changed the answer to the poll, if the voter is anonymous + [] + VoterChat: Chat option + /// The user that changed the answer to the poll, if the voter isn't anonymous [] - User: User - /// 0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote. + User: User option + /// 0-based identifiers of chosen answer options. May be empty if the vote was retracted. [] OptionIds: int64[] } - static member Create(pollId: string, user: User, optionIds: int64[]) = + static member Create(pollId: string, optionIds: int64[], ?voterChat: Chat, ?user: User) = { PollId = pollId - User = user OptionIds = optionIds + VoterChat = voterChat + User = user } /// This object contains information about a poll. @@ -1289,16 +1305,24 @@ and [] ChatShared = ChatId = chatId } -/// This object represents a service message about a user allowing a bot to write messages after adding the bot to the attachment menu or launching a Web App from a link. +/// This object represents a service message about a user allowing a bot to write messages after adding it to the attachment menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess. and [] WriteAccessAllowed = { - /// Name of the Web App which was launched from a link + /// True, if the access was granted after the user accepted an explicit request from a Web App sent by the method requestWriteAccess + [] + FromRequest: bool option + /// Name of the Web App, if the access was granted when the Web App was launched from a link [] WebAppName: string option + /// True, if the access was granted when the bot was added to the attachment or side menu + [] + FromAttachmentMenu: bool option } - static member Create(?webAppName: string) = + static member Create(?fromRequest: bool, ?webAppName: string, ?fromAttachmentMenu: bool) = { + FromRequest = fromRequest WebAppName = webAppName + FromAttachmentMenu = fromAttachmentMenu } /// This object represents a service message about a video chat scheduled in the chat. @@ -1589,8 +1613,6 @@ and [] InlineKeyboardButton = [] LoginUrl: LoginUrl option /// If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted. - /// - /// Note: This offers an easy way for users to start using your bot in inline mode when they are currently in a private chat with it. Especially useful when combined with switch_pm… actions - in this case the user will be automatically returned to the chat they switched from, skipping the chat selection screen. [] SwitchInlineQuery: string option /// If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. May be empty, in which case only the bot's username will be inserted. @@ -1811,7 +1833,7 @@ and [] ChatAdministratorRights = /// True, if the user's presence in the chat is hidden [] IsAnonymous: bool - /// True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege + /// True, if the administrator can access the chat event log, boost list in channels, see channel members, report spam messages, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege [] CanManageChat: bool /// True, if the administrator can delete messages of other users @@ -1820,7 +1842,7 @@ and [] ChatAdministratorRights = /// True, if the administrator can manage video chats [] CanManageVideoChats: bool - /// True, if the administrator can restrict, ban or unban chat members + /// True, if the administrator can restrict, ban or unban chat members, or access supergroup statistics [] CanRestrictMembers: bool /// True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user) @@ -1832,7 +1854,7 @@ and [] ChatAdministratorRights = /// True, if the user is allowed to invite new users to the chat [] CanInviteUsers: bool - /// True, if the administrator can post in the channel; channels only + /// True, if the administrator can post messages in the channel, or access channel statistics; channels only [] CanPostMessages: bool option /// True, if the administrator can edit messages of other users and can pin messages; channels only @@ -1841,6 +1863,15 @@ and [] ChatAdministratorRights = /// True, if the user is allowed to pin messages; groups and supergroups only [] CanPinMessages: bool option + /// True, if the administrator can post stories in the channel; channels only + [] + CanPostStories: bool option + /// True, if the administrator can edit stories posted by other users; channels only + [] + CanEditStories: bool option + /// True, if the administrator can delete stories posted by other users; channels only + [] + CanDeleteStories: bool option /// True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only [] CanManageTopics: bool option @@ -1848,7 +1879,7 @@ and [] ChatAdministratorRights = [] CanManageVoiceChats: bool option } - static member Create(isAnonymous: bool, canManageChat: bool, canDeleteMessages: bool, canManageVideoChats: bool, canRestrictMembers: bool, canPromoteMembers: bool, canChangeInfo: bool, canInviteUsers: bool, ?canPostMessages: bool, ?canEditMessages: bool, ?canPinMessages: bool, ?canManageTopics: bool, ?canManageVoiceChats: bool) = + static member Create(isAnonymous: bool, canManageChat: bool, canDeleteMessages: bool, canManageVideoChats: bool, canRestrictMembers: bool, canPromoteMembers: bool, canChangeInfo: bool, canInviteUsers: bool, ?canPostMessages: bool, ?canEditMessages: bool, ?canPinMessages: bool, ?canPostStories: bool, ?canEditStories: bool, ?canDeleteStories: bool, ?canManageTopics: bool, ?canManageVoiceChats: bool) = { IsAnonymous = isAnonymous CanManageChat = canManageChat @@ -1861,6 +1892,9 @@ and [] ChatAdministratorRights = CanPostMessages = canPostMessages CanEditMessages = canEditMessages CanPinMessages = canPinMessages + CanPostStories = canPostStories + CanEditStories = canEditStories + CanDeleteStories = canDeleteStories CanManageTopics = canManageTopics CanManageVoiceChats = canManageVoiceChats } @@ -1913,7 +1947,7 @@ and [] ChatMemberAdministrator = /// True, if the user's presence in the chat is hidden [] IsAnonymous: bool - /// True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege + /// True, if the administrator can access the chat event log, boost list in channels, see channel members, report spam messages, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege [] CanManageChat: bool /// True, if the administrator can delete messages of other users @@ -1922,7 +1956,7 @@ and [] ChatMemberAdministrator = /// True, if the administrator can manage video chats [] CanManageVideoChats: bool - /// True, if the administrator can restrict, ban or unban chat members + /// True, if the administrator can restrict, ban or unban chat members, or access supergroup statistics [] CanRestrictMembers: bool /// True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user) @@ -1934,7 +1968,7 @@ and [] ChatMemberAdministrator = /// True, if the user is allowed to invite new users to the chat [] CanInviteUsers: bool - /// True, if the administrator can post in the channel; channels only + /// True, if the administrator can post messages in the channel, or access channel statistics; channels only [] CanPostMessages: bool option /// True, if the administrator can edit messages of other users and can pin messages; channels only @@ -1943,6 +1977,15 @@ and [] ChatMemberAdministrator = /// True, if the user is allowed to pin messages; groups and supergroups only [] CanPinMessages: bool option + /// True, if the administrator can post stories in the channel; channels only + [] + CanPostStories: bool option + /// True, if the administrator can edit stories posted by other users; channels only + [] + CanEditStories: bool option + /// True, if the administrator can delete stories posted by other users; channels only + [] + CanDeleteStories: bool option /// True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only [] CanManageTopics: bool option @@ -1953,14 +1996,14 @@ and [] ChatMemberAdministrator = [] CanManageVoiceChats: bool option } - static member Create(status: string, canInviteUsers: bool, canChangeInfo: bool, canRestrictMembers: bool, canManageVideoChats: bool, canPromoteMembers: bool, canManageChat: bool, isAnonymous: bool, canBeEdited: bool, user: User, canDeleteMessages: bool, ?customTitle: string, ?canPostMessages: bool, ?canEditMessages: bool, ?canPinMessages: bool, ?canManageTopics: bool, ?canManageVoiceChats: bool) = + static member Create(status: string, canInviteUsers: bool, canPromoteMembers: bool, canRestrictMembers: bool, canManageVideoChats: bool, canChangeInfo: bool, canManageChat: bool, isAnonymous: bool, canBeEdited: bool, user: User, canDeleteMessages: bool, ?customTitle: string, ?canPostMessages: bool, ?canEditMessages: bool, ?canPinMessages: bool, ?canPostStories: bool, ?canEditStories: bool, ?canDeleteStories: bool, ?canManageTopics: bool, ?canManageVoiceChats: bool) = { Status = status CanInviteUsers = canInviteUsers - CanChangeInfo = canChangeInfo + CanPromoteMembers = canPromoteMembers CanRestrictMembers = canRestrictMembers CanManageVideoChats = canManageVideoChats - CanPromoteMembers = canPromoteMembers + CanChangeInfo = canChangeInfo CanManageChat = canManageChat IsAnonymous = isAnonymous CanBeEdited = canBeEdited @@ -1970,6 +2013,9 @@ and [] ChatMemberAdministrator = CanPostMessages = canPostMessages CanEditMessages = canEditMessages CanPinMessages = canPinMessages + CanPostStories = canPostStories + CanEditStories = canEditStories + CanDeleteStories = canDeleteStories CanManageTopics = canManageTopics CanManageVoiceChats = canManageVoiceChats } @@ -2044,7 +2090,7 @@ and [] ChatMemberRestricted = /// True, if the user is allowed to create forum topics [] CanManageTopics: bool - /// Date when restrictions will be lifted for this user; unix time. If 0, then the user is restricted forever + /// Date when restrictions will be lifted for this user; Unix time. If 0, then the user is restricted forever [] UntilDate: DateTime } @@ -2095,7 +2141,7 @@ and [] ChatMemberBanned = /// Information about the user [] User: User - /// Date when restrictions will be lifted for this user; unix time. If 0, then the user is banned forever + /// Date when restrictions will be lifted for this user; Unix time. If 0, then the user is banned forever [] UntilDate: DateTime } @@ -2151,7 +2197,7 @@ and [] ChatJoinRequest = /// User that sent the join request [] From: User - /// Identifier of a private chat with the user who sent the join request. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot can use this identifier for 24 hours to send messages until the join request is processed, assuming no other administrator contacted the user. + /// Identifier of a private chat with the user who sent the join request. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot can use this identifier for 5 minutes to send messages until the join request is processed, assuming no other administrator contacted the user. [] UserChatId: int64 /// Date the request was sent in Unix time @@ -2917,7 +2963,7 @@ and [] InlineQueryResultsButton = /// Label text on the button [] Text: string - /// Description of the Web App that will be launched when the user presses the button. The Web App will be able to switch back to the inline mode using the method web_app_switch_inline_query inside the Web App. + /// Description of the Web App that will be launched when the user presses the button. The Web App will be able to switch back to the inline mode using the method switchInlineQuery inside the Web App. [] WebApp: WebAppInfo option /// Deep-linking parameter for the /start message sent to the bot when a user presses the button. 1-64 characters, only A-Z, a-z, 0-9, _ and - are allowed.