From bb9b8cfc67385002306c79632e7470b5e7867aad Mon Sep 17 00:00:00 2001 From: ilopatin Date: Sun, 24 Sep 2023 13:00:09 +0200 Subject: [PATCH] Telegram Bot API September 22, 2023 updates (v6.9) --- README.md | 2 +- build.sbt | 2 +- .../main/scala/telegramium/bots/Chat.scala | 4 +-- .../bots/ChatAdministratorRights.scala | 17 +++++++--- .../scala/telegramium/bots/ChatMember.scala | 21 ++++++++---- .../main/scala/telegramium/bots/Message.scala | 4 ++- .../telegramium/bots/WriteAccessAllowed.scala | 18 ++++++++--- .../bots/client/BanChatMemberReq.scala | 2 +- .../telegramium/bots/client/Methods.scala | 26 +++++++++++---- .../bots/client/PromoteChatMemberReq.scala | 19 ++++++++--- .../bots/client/RestrictChatMemberReq.scala | 2 +- .../telegramium/bots/client/package.scala | 9 ++++++ .../main/scala/telegramium/bots/package.scala | 32 +++++++++++++++++-- 13 files changed, 122 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 473572d5..0364392d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # F[Tg] - Telegramium -[![Telegram](https://img.shields.io/badge/Telegram%20Bot%20API-6.8%20(August%2018%2C%202023)-blue)](https://core.telegram.org/bots/api#recent-changes) +[![Telegram](https://img.shields.io/badge/Telegram%20Bot%20API-6.9%20(September%2022%2C%202023)-blue)](https://core.telegram.org/bots/api#recent-changes) [![Scala Steward badge](https://img.shields.io/badge/Scala_Steward-helping-blue.svg?style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAQCAMAAAARSr4IAAAAVFBMVEUAAACHjojlOy5NWlrKzcYRKjGFjIbp293YycuLa3pYY2LSqql4f3pCUFTgSjNodYRmcXUsPD/NTTbjRS+2jomhgnzNc223cGvZS0HaSD0XLjbaSjElhIr+AAAAAXRSTlMAQObYZgAAAHlJREFUCNdNyosOwyAIhWHAQS1Vt7a77/3fcxxdmv0xwmckutAR1nkm4ggbyEcg/wWmlGLDAA3oL50xi6fk5ffZ3E2E3QfZDCcCN2YtbEWZt+Drc6u6rlqv7Uk0LdKqqr5rk2UCRXOk0vmQKGfc94nOJyQjouF9H/wCc9gECEYfONoAAAAASUVORK5CYII=)](https://scala-steward.org) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.github.apimorphism/telegramium-core_2.13/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.github.apimorphism/telegramium-core_2.13) diff --git a/build.sbt b/build.sbt index 49f5b6ab..ef26131d 100644 --- a/build.sbt +++ b/build.sbt @@ -1,7 +1,7 @@ enablePlugins(GitPlugin) ThisBuild / version := Version.mkVersion( - "8.68.0", + "8.69.0", git.gitCurrentBranch.value, git.gitDescribedVersion.value, git.gitUncommittedChanges.value diff --git a/telegramium-core/src/main/scala/telegramium/bots/Chat.scala b/telegramium-core/src/main/scala/telegramium/bots/Chat.scala index 7560ceca..84be3d79 100644 --- a/telegramium-core/src/main/scala/telegramium/bots/Chat.scala +++ b/telegramium-core/src/main/scala/telegramium/bots/Chat.scala @@ -26,8 +26,8 @@ package telegramium.bots * @param emojiStatusCustomEmojiId * Optional. Custom emoji identifier of emoji status of the other party in a private chat. Returned only in getChat. * @param emojiStatusExpirationDate - * Optional. Expiration date of the emoji status of the other party in a private chat, if any. Returned only in - * getChat. + * Optional. Expiration date of the emoji status of the other party in a private chat in Unix time, if any. Returned + * only in getChat. * @param bio * Optional. Bio of the other party in a private chat. Returned only in getChat. * @param hasPrivateForwards diff --git a/telegramium-core/src/main/scala/telegramium/bots/ChatAdministratorRights.scala b/telegramium-core/src/main/scala/telegramium/bots/ChatAdministratorRights.scala index 8dfe08a3..85541d60 100644 --- a/telegramium-core/src/main/scala/telegramium/bots/ChatAdministratorRights.scala +++ b/telegramium-core/src/main/scala/telegramium/bots/ChatAdministratorRights.scala @@ -5,9 +5,9 @@ package telegramium.bots * @param isAnonymous * True, if the user's presence in the chat is hidden * @param canManageChat - * 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, chat statistics, boost list in channels, message + * statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. + * Implied by any other administrator privilege * @param canDeleteMessages * True, if the administrator can delete messages of other users * @param canManageVideoChats @@ -23,11 +23,17 @@ package telegramium.bots * @param canInviteUsers * True, if the user is allowed to invite new users to the chat * @param canPostMessages - * Optional. True, if the administrator can post in the channel; channels only + * Optional. True, if the administrator can post messages in the channel; channels only * @param canEditMessages * Optional. True, if the administrator can edit messages of other users and can pin messages; channels only * @param canPinMessages * Optional. True, if the user is allowed to pin messages; groups and supergroups only + * @param canPostStories + * Optional. True, if the administrator can post stories in the channel; channels only + * @param canEditStories + * Optional. True, if the administrator can edit stories posted by other users; channels only + * @param canDeleteStories + * Optional. True, if the administrator can delete stories posted by other users; channels only * @param canManageTopics * Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only */ @@ -43,5 +49,8 @@ final case class ChatAdministratorRights( canPostMessages: Option[Boolean] = Option.empty, canEditMessages: Option[Boolean] = Option.empty, canPinMessages: Option[Boolean] = Option.empty, + canPostStories: Option[Boolean] = Option.empty, + canEditStories: Option[Boolean] = Option.empty, + canDeleteStories: Option[Boolean] = Option.empty, canManageTopics: Option[Boolean] = Option.empty ) diff --git a/telegramium-core/src/main/scala/telegramium/bots/ChatMember.scala b/telegramium-core/src/main/scala/telegramium/bots/ChatMember.scala index c6f28a35..8f102fd1 100644 --- a/telegramium-core/src/main/scala/telegramium/bots/ChatMember.scala +++ b/telegramium-core/src/main/scala/telegramium/bots/ChatMember.scala @@ -31,9 +31,9 @@ final case class ChatMemberOwner( * @param isAnonymous * True, if the user's presence in the chat is hidden * @param canManageChat - * 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, chat statistics, boost list in channels, message + * statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. + * Implied by any other administrator privilege * @param canDeleteMessages * True, if the administrator can delete messages of other users * @param canManageVideoChats @@ -49,11 +49,17 @@ final case class ChatMemberOwner( * @param canInviteUsers * True, if the user is allowed to invite new users to the chat * @param canPostMessages - * Optional. True, if the administrator can post in the channel; channels only + * Optional. True, if the administrator can post messages in the channel; channels only * @param canEditMessages * Optional. True, if the administrator can edit messages of other users and can pin messages; channels only * @param canPinMessages * Optional. True, if the user is allowed to pin messages; groups and supergroups only + * @param canPostStories + * Optional. True, if the administrator can post stories in the channel; channels only + * @param canEditStories + * Optional. True, if the administrator can edit stories posted by other users; channels only + * @param canDeleteStories + * Optional. True, if the administrator can delete stories posted by other users; channels only * @param canManageTopics * Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only * @param customTitle @@ -74,6 +80,9 @@ final case class ChatMemberAdministrator( canPostMessages: Option[Boolean] = Option.empty, canEditMessages: Option[Boolean] = Option.empty, canPinMessages: Option[Boolean] = Option.empty, + canPostStories: Option[Boolean] = Option.empty, + canEditStories: Option[Boolean] = Option.empty, + canDeleteStories: Option[Boolean] = Option.empty, canManageTopics: Option[Boolean] = Option.empty, customTitle: Option[String] = Option.empty ) extends ChatMember @@ -103,7 +112,7 @@ final case class ChatMemberMember(status: String, user: User) extends ChatMember * @param user * Information about the user * @param untilDate - * 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 */ final case class ChatMemberBanned(status: String, user: User, untilDate: Int) extends ChatMember @@ -144,7 +153,7 @@ final case class ChatMemberBanned(status: String, user: User, untilDate: Int) ex * @param canManageTopics * True, if the user is allowed to create forum topics * @param untilDate - * 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 */ final case class ChatMemberRestricted( status: String, diff --git a/telegramium-core/src/main/scala/telegramium/bots/Message.scala b/telegramium-core/src/main/scala/telegramium/bots/Message.scala index 76dc69b0..987eb536 100644 --- a/telegramium-core/src/main/scala/telegramium/bots/Message.scala +++ b/telegramium-core/src/main/scala/telegramium/bots/Message.scala @@ -142,7 +142,9 @@ package telegramium.bots * @param connectedWebsite * Optional. The domain name of the website on which the user has logged in. * @param writeAccessAllowed - * Optional. Service message: the user allowed the bot added to the attachment menu to write messages + * Optional. 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 * @param passportData * Optional. Telegram Passport data * @param proximityAlertTriggered diff --git a/telegramium-core/src/main/scala/telegramium/bots/WriteAccessAllowed.scala b/telegramium-core/src/main/scala/telegramium/bots/WriteAccessAllowed.scala index f0a2d7c4..3b5ede64 100644 --- a/telegramium-core/src/main/scala/telegramium/bots/WriteAccessAllowed.scala +++ b/telegramium-core/src/main/scala/telegramium/bots/WriteAccessAllowed.scala @@ -1,9 +1,19 @@ package telegramium.bots -/** 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. * + * @param fromRequest + * Optional. True, if the access was granted after the user accepted an explicit request from a Web App sent by the + * method requestWriteAccess * @param webAppName - * Optional. Name of the Web App which was launched from a link + * Optional. Name of the Web App, if the access was granted when the Web App was launched from a link + * @param fromAttachmentMenu + * Optional. True, if the access was granted when the bot was added to the attachment or side menu */ -final case class WriteAccessAllowed(webAppName: Option[String] = Option.empty) +final case class WriteAccessAllowed( + fromRequest: Option[Boolean] = Option.empty, + webAppName: Option[String] = Option.empty, + fromAttachmentMenu: Option[Boolean] = Option.empty +) diff --git a/telegramium-core/src/main/scala/telegramium/bots/client/BanChatMemberReq.scala b/telegramium-core/src/main/scala/telegramium/bots/client/BanChatMemberReq.scala index 06661efb..dc42ef3e 100644 --- a/telegramium-core/src/main/scala/telegramium/bots/client/BanChatMemberReq.scala +++ b/telegramium-core/src/main/scala/telegramium/bots/client/BanChatMemberReq.scala @@ -8,7 +8,7 @@ import telegramium.bots.ChatId * @param userId * Unique identifier of the target user * @param untilDate - * Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds + * 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. * @param revokeMessages * Pass True to delete all messages from the chat for the user that is being removed. If False, the user will be able diff --git a/telegramium-core/src/main/scala/telegramium/bots/client/Methods.scala b/telegramium-core/src/main/scala/telegramium/bots/client/Methods.scala index e4e561e5..a1f74854 100644 --- a/telegramium-core/src/main/scala/telegramium/bots/client/Methods.scala +++ b/telegramium-core/src/main/scala/telegramium/bots/client/Methods.scala @@ -1995,7 +1995,7 @@ trait Methods { * can_send_photos, can_send_videos, can_send_video_notes, and can_send_voice_notes permissions; the can_send_polls * permission will imply the can_send_messages permission. * @param untilDate - * Date when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or + * 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 */ def restrictChatMember( @@ -2105,7 +2105,7 @@ trait Methods { * @param userId * Unique identifier of the target user * @param untilDate - * Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds + * 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. * @param revokeMessages * Pass True to delete all messages from the chat for the user that is being removed. If False, the user will be @@ -2220,15 +2220,21 @@ trait Methods { * @param isAnonymous * Pass True if the administrator's presence in the chat is hidden * @param canManageChat - * 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 + * Pass True if the administrator can access the chat event log, chat statistics, boost list in channels, message + * statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. + * Implied by any other administrator privilege * @param canPostMessages - * Pass True if the administrator can create channel posts, channels only + * Pass True if the administrator can post messages in the channel; channels only * @param canEditMessages - * Pass True if the administrator can edit messages of other users and can pin messages, channels only + * Pass True if the administrator can edit messages of other users and can pin messages; channels only * @param canDeleteMessages * Pass True if the administrator can delete messages of other users + * @param canPostStories + * Pass True if the administrator can post stories in the channel; channels only + * @param canEditStories + * Pass True if the administrator can edit stories posted by other users; channels only + * @param canDeleteStories + * Pass True if the administrator can delete stories posted by other users; channels only * @param canManageVideoChats * Pass True if the administrator can manage video chats * @param canRestrictMembers @@ -2254,6 +2260,9 @@ trait Methods { canPostMessages: Option[Boolean] = Option.empty, canEditMessages: Option[Boolean] = Option.empty, canDeleteMessages: Option[Boolean] = Option.empty, + canPostStories: Option[Boolean] = Option.empty, + canEditStories: Option[Boolean] = Option.empty, + canDeleteStories: Option[Boolean] = Option.empty, canManageVideoChats: Option[Boolean] = Option.empty, canRestrictMembers: Option[Boolean] = Option.empty, canPromoteMembers: Option[Boolean] = Option.empty, @@ -2270,6 +2279,9 @@ trait Methods { canPostMessages, canEditMessages, canDeleteMessages, + canPostStories, + canEditStories, + canDeleteStories, canManageVideoChats, canRestrictMembers, canPromoteMembers, diff --git a/telegramium-core/src/main/scala/telegramium/bots/client/PromoteChatMemberReq.scala b/telegramium-core/src/main/scala/telegramium/bots/client/PromoteChatMemberReq.scala index e0350883..9f488004 100644 --- a/telegramium-core/src/main/scala/telegramium/bots/client/PromoteChatMemberReq.scala +++ b/telegramium-core/src/main/scala/telegramium/bots/client/PromoteChatMemberReq.scala @@ -9,15 +9,21 @@ import telegramium.bots.ChatId * @param isAnonymous * Pass True if the administrator's presence in the chat is hidden * @param canManageChat - * 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 + * Pass True if the administrator can access the chat event log, chat statistics, boost list in channels, message + * statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. + * Implied by any other administrator privilege * @param canPostMessages - * Pass True if the administrator can create channel posts, channels only + * Pass True if the administrator can post messages in the channel; channels only * @param canEditMessages - * Pass True if the administrator can edit messages of other users and can pin messages, channels only + * Pass True if the administrator can edit messages of other users and can pin messages; channels only * @param canDeleteMessages * Pass True if the administrator can delete messages of other users + * @param canPostStories + * Pass True if the administrator can post stories in the channel; channels only + * @param canEditStories + * Pass True if the administrator can edit stories posted by other users; channels only + * @param canDeleteStories + * Pass True if the administrator can delete stories posted by other users; channels only * @param canManageVideoChats * Pass True if the administrator can manage video chats * @param canRestrictMembers @@ -43,6 +49,9 @@ final case class PromoteChatMemberReq( canPostMessages: Option[Boolean] = Option.empty, canEditMessages: Option[Boolean] = Option.empty, canDeleteMessages: Option[Boolean] = Option.empty, + canPostStories: Option[Boolean] = Option.empty, + canEditStories: Option[Boolean] = Option.empty, + canDeleteStories: Option[Boolean] = Option.empty, canManageVideoChats: Option[Boolean] = Option.empty, canRestrictMembers: Option[Boolean] = Option.empty, canPromoteMembers: Option[Boolean] = Option.empty, diff --git a/telegramium-core/src/main/scala/telegramium/bots/client/RestrictChatMemberReq.scala b/telegramium-core/src/main/scala/telegramium/bots/client/RestrictChatMemberReq.scala index 26ea962a..f41517b2 100644 --- a/telegramium-core/src/main/scala/telegramium/bots/client/RestrictChatMemberReq.scala +++ b/telegramium-core/src/main/scala/telegramium/bots/client/RestrictChatMemberReq.scala @@ -16,7 +16,7 @@ import telegramium.bots.ChatPermissions * can_send_photos, can_send_videos, can_send_video_notes, and can_send_voice_notes permissions; the can_send_polls * permission will imply the can_send_messages permission. * @param untilDate - * Date when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or + * 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 */ final case class RestrictChatMemberReq( diff --git a/telegramium-core/src/main/scala/telegramium/bots/client/package.scala b/telegramium-core/src/main/scala/telegramium/bots/client/package.scala index 1a6ff9d3..7fb53e25 100644 --- a/telegramium-core/src/main/scala/telegramium/bots/client/package.scala +++ b/telegramium-core/src/main/scala/telegramium/bots/client/package.scala @@ -2358,6 +2358,9 @@ object CirceImplicits { "can_post_messages" -> x.canPostMessages.asJson, "can_edit_messages" -> x.canEditMessages.asJson, "can_delete_messages" -> x.canDeleteMessages.asJson, + "can_post_stories" -> x.canPostStories.asJson, + "can_edit_stories" -> x.canEditStories.asJson, + "can_delete_stories" -> x.canDeleteStories.asJson, "can_manage_video_chats" -> x.canManageVideoChats.asJson, "can_restrict_members" -> x.canRestrictMembers.asJson, "can_promote_members" -> x.canPromoteMembers.asJson, @@ -2380,6 +2383,9 @@ object CirceImplicits { _canPostMessages <- h.get[Option[Boolean]]("can_post_messages") _canEditMessages <- h.get[Option[Boolean]]("can_edit_messages") _canDeleteMessages <- h.get[Option[Boolean]]("can_delete_messages") + _canPostStories <- h.get[Option[Boolean]]("can_post_stories") + _canEditStories <- h.get[Option[Boolean]]("can_edit_stories") + _canDeleteStories <- h.get[Option[Boolean]]("can_delete_stories") _canManageVideoChats <- h.get[Option[Boolean]]("can_manage_video_chats") _canRestrictMembers <- h.get[Option[Boolean]]("can_restrict_members") _canPromoteMembers <- h.get[Option[Boolean]]("can_promote_members") @@ -2396,6 +2402,9 @@ object CirceImplicits { canPostMessages = _canPostMessages, canEditMessages = _canEditMessages, canDeleteMessages = _canDeleteMessages, + canPostStories = _canPostStories, + canEditStories = _canEditStories, + canDeleteStories = _canDeleteStories, canManageVideoChats = _canManageVideoChats, canRestrictMembers = _canRestrictMembers, canPromoteMembers = _canPromoteMembers, diff --git a/telegramium-core/src/main/scala/telegramium/bots/package.scala b/telegramium-core/src/main/scala/telegramium/bots/package.scala index d6705658..74b352c5 100644 --- a/telegramium-core/src/main/scala/telegramium/bots/package.scala +++ b/telegramium-core/src/main/scala/telegramium/bots/package.scala @@ -272,6 +272,9 @@ object CirceImplicits { "can_post_messages" -> x.canPostMessages.asJson, "can_edit_messages" -> x.canEditMessages.asJson, "can_pin_messages" -> x.canPinMessages.asJson, + "can_post_stories" -> x.canPostStories.asJson, + "can_edit_stories" -> x.canEditStories.asJson, + "can_delete_stories" -> x.canDeleteStories.asJson, "can_manage_topics" -> x.canManageTopics.asJson, "custom_title" -> x.customTitle.asJson ).filter(!_._2.isNull) @@ -295,6 +298,9 @@ object CirceImplicits { _canPostMessages <- h.get[Option[Boolean]]("can_post_messages") _canEditMessages <- h.get[Option[Boolean]]("can_edit_messages") _canPinMessages <- h.get[Option[Boolean]]("can_pin_messages") + _canPostStories <- h.get[Option[Boolean]]("can_post_stories") + _canEditStories <- h.get[Option[Boolean]]("can_edit_stories") + _canDeleteStories <- h.get[Option[Boolean]]("can_delete_stories") _canManageTopics <- h.get[Option[Boolean]]("can_manage_topics") _customTitle <- h.get[Option[String]]("custom_title") } yield { @@ -313,6 +319,9 @@ object CirceImplicits { canPostMessages = _canPostMessages, canEditMessages = _canEditMessages, canPinMessages = _canPinMessages, + canPostStories = _canPostStories, + canEditStories = _canEditStories, + canDeleteStories = _canDeleteStories, canManageTopics = _canManageTopics, customTitle = _customTitle ) @@ -3200,7 +3209,9 @@ object CirceImplicits { (x: WriteAccessAllowed) => { Json.fromFields( List( - "web_app_name" -> x.webAppName.asJson + "from_request" -> x.fromRequest.asJson, + "web_app_name" -> x.webAppName.asJson, + "from_attachment_menu" -> x.fromAttachmentMenu.asJson ).filter(!_._2.isNull) ) } @@ -3208,9 +3219,15 @@ object CirceImplicits { implicit lazy val writeaccessallowedDecoder: Decoder[WriteAccessAllowed] = Decoder.instance { h => for { - _webAppName <- h.get[Option[String]]("web_app_name") + _fromRequest <- h.get[Option[Boolean]]("from_request") + _webAppName <- h.get[Option[String]]("web_app_name") + _fromAttachmentMenu <- h.get[Option[Boolean]]("from_attachment_menu") } yield { - WriteAccessAllowed(webAppName = _webAppName) + WriteAccessAllowed( + fromRequest = _fromRequest, + webAppName = _webAppName, + fromAttachmentMenu = _fromAttachmentMenu + ) } } @@ -4822,6 +4839,9 @@ object CirceImplicits { "can_post_messages" -> x.canPostMessages.asJson, "can_edit_messages" -> x.canEditMessages.asJson, "can_pin_messages" -> x.canPinMessages.asJson, + "can_post_stories" -> x.canPostStories.asJson, + "can_edit_stories" -> x.canEditStories.asJson, + "can_delete_stories" -> x.canDeleteStories.asJson, "can_manage_topics" -> x.canManageTopics.asJson ).filter(!_._2.isNull) ) @@ -4841,6 +4861,9 @@ object CirceImplicits { _canPostMessages <- h.get[Option[Boolean]]("can_post_messages") _canEditMessages <- h.get[Option[Boolean]]("can_edit_messages") _canPinMessages <- h.get[Option[Boolean]]("can_pin_messages") + _canPostStories <- h.get[Option[Boolean]]("can_post_stories") + _canEditStories <- h.get[Option[Boolean]]("can_edit_stories") + _canDeleteStories <- h.get[Option[Boolean]]("can_delete_stories") _canManageTopics <- h.get[Option[Boolean]]("can_manage_topics") } yield { ChatAdministratorRights( @@ -4855,6 +4878,9 @@ object CirceImplicits { canPostMessages = _canPostMessages, canEditMessages = _canEditMessages, canPinMessages = _canPinMessages, + canPostStories = _canPostStories, + canEditStories = _canEditStories, + canDeleteStories = _canDeleteStories, canManageTopics = _canManageTopics ) }