1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-22 08:13:47 +00:00

add support of stories rights

This commit is contained in:
InsanusMokrassar 2023-09-22 22:53:14 +06:00
parent 97a3901cb9
commit 5215e8a315
5 changed files with 26 additions and 2 deletions

View File

@ -275,6 +275,9 @@ const val correctOptionIdField = "correct_option_id"
const val allowsMultipleAnswersField = "allows_multiple_answers"
const val isAnonymousField = "is_anonymous"
const val canManageTopicsField = "can_manage_topics"
const val canPostStoriesField = "can_post_stories"
const val canEditStoriesField = "can_edit_stories"
const val canDeleteStoriesField = "can_delete_stories"
const val captionEntitiesField = "caption_entities"
const val hasSpoilerField = "has_spoiler"
const val loginUrlField = "login_url"

View File

@ -35,7 +35,13 @@ data class AdministratorChatMemberImpl(
@SerialName(customTitleField)
override val customTitle: String? = null,
@SerialName(canManageTopicsField)
override val canManageTopics: Boolean = false
override val canManageTopics: Boolean = false,
@SerialName(canPostStoriesField)
override val canPostStories: Boolean = false,
@SerialName(canEditStoriesField)
override val canEditStories: Boolean = false,
@SerialName(canDeleteStoriesField)
override val canDeleteStories: Boolean = false
) : AdministratorChatMember {
@SerialName(statusField)
@Required

View File

@ -16,4 +16,7 @@ sealed interface ChatAdministratorRights : SpecialChatAdministratorRights {
val canPromoteMembers: Boolean
val canPostMessages: Boolean
val canEditMessages: Boolean
val canPostStories: Boolean
val canEditStories: Boolean
val canDeleteStories: Boolean
}

View File

@ -29,5 +29,11 @@ data class ChatAdministratorRightsImpl(
@SerialName(isAnonymousField)
override val isAnonymous: Boolean = false,
@SerialName(canManageTopicsField)
override val canManageTopics: Boolean = false
override val canManageTopics: Boolean = false,
@SerialName(canPostStoriesField)
override val canPostStories: Boolean = false,
@SerialName(canEditStoriesField)
override val canEditStories: Boolean = false,
@SerialName(canDeleteStoriesField)
override val canDeleteStories: Boolean = false
) : ChatAdministratorRights

View File

@ -36,6 +36,12 @@ data class OwnerChatMember(
override val canManageChat: Boolean = true
@Transient
override val canManageTopics: Boolean = true
@Transient
override val canPostStories: Boolean = true
@Transient
override val canEditStories: Boolean = true
@Transient
override val canDeleteStories: Boolean = true
@SerialName(statusField)
@Required
private val type: String = "creator"