mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-30 14:08:44 +00:00
include canManageChat
This commit is contained in:
parent
80200d78ef
commit
3c5abac669
@ -33,7 +33,9 @@ data class PromoteChatMember(
|
|||||||
@SerialName(canPromoteMembersField)
|
@SerialName(canPromoteMembersField)
|
||||||
private val canPromoteMembers: Boolean? = null,
|
private val canPromoteMembers: Boolean? = null,
|
||||||
@SerialName(canManageVoiceChatsField)
|
@SerialName(canManageVoiceChatsField)
|
||||||
private val canManageVoiceChats: Boolean? = null
|
private val canManageVoiceChats: Boolean? = null,
|
||||||
|
@SerialName(canManageChatField)
|
||||||
|
private val canManageChat: Boolean? = null
|
||||||
) : ChatMemberRequest<Boolean>, UntilDate {
|
) : ChatMemberRequest<Boolean>, UntilDate {
|
||||||
override fun method(): String = "promoteChatMember"
|
override fun method(): String = "promoteChatMember"
|
||||||
override val resultDeserializer: DeserializationStrategy<Boolean>
|
override val resultDeserializer: DeserializationStrategy<Boolean>
|
||||||
|
@ -28,6 +28,8 @@ data class AdministratorChatMemberImpl(
|
|||||||
override val canPromoteMembers: Boolean = false,
|
override val canPromoteMembers: Boolean = false,
|
||||||
@SerialName(canManageVoiceChatsField)
|
@SerialName(canManageVoiceChatsField)
|
||||||
override val canManageVoiceChats: Boolean = false,
|
override val canManageVoiceChats: Boolean = false,
|
||||||
|
@SerialName(canManageChatField)
|
||||||
|
override val canManageChat: Boolean = false,
|
||||||
@SerialName(isAnonymousField)
|
@SerialName(isAnonymousField)
|
||||||
override val isAnonymous: Boolean = false,
|
override val isAnonymous: Boolean = false,
|
||||||
@SerialName(customTitleField)
|
@SerialName(customTitleField)
|
||||||
|
@ -32,6 +32,8 @@ data class CreatorChatMember(
|
|||||||
override val canPromoteMembers: Boolean = true
|
override val canPromoteMembers: Boolean = true
|
||||||
@Transient
|
@Transient
|
||||||
override val canManageVoiceChats: Boolean = true
|
override val canManageVoiceChats: Boolean = true
|
||||||
|
@Transient
|
||||||
|
override val canManageChat: Boolean = true
|
||||||
@SerialName(statusField)
|
@SerialName(statusField)
|
||||||
@Required
|
@Required
|
||||||
private val type: String = "creator"
|
private val type: String = "creator"
|
||||||
|
@ -14,6 +14,7 @@ interface AdministratorChatMember : SpecialRightsChatMember {
|
|||||||
val canRestrictMembers: Boolean
|
val canRestrictMembers: Boolean
|
||||||
val canPromoteMembers: Boolean
|
val canPromoteMembers: Boolean
|
||||||
val canManageVoiceChats: Boolean
|
val canManageVoiceChats: Boolean
|
||||||
|
val canManageChat: Boolean
|
||||||
val isAnonymous: Boolean
|
val isAnonymous: Boolean
|
||||||
val customTitle: String?
|
val customTitle: String?
|
||||||
}
|
}
|
||||||
|
@ -240,6 +240,7 @@ const val canRestrictMembersField = "can_restrict_members"
|
|||||||
const val canPinMessagesField = "can_pin_messages"
|
const val canPinMessagesField = "can_pin_messages"
|
||||||
const val canPromoteMembersField = "can_promote_members"
|
const val canPromoteMembersField = "can_promote_members"
|
||||||
const val canManageVoiceChatsField = "can_manage_voice_chats"
|
const val canManageVoiceChatsField = "can_manage_voice_chats"
|
||||||
|
const val canManageChatField = "can_manage_chat"
|
||||||
const val pngStickerField = "png_sticker"
|
const val pngStickerField = "png_sticker"
|
||||||
const val tgsStickerField = "tgs_sticker"
|
const val tgsStickerField = "tgs_sticker"
|
||||||
|
|
||||||
|
@ -18,7 +18,8 @@ suspend fun TelegramBot.promoteChatMember(
|
|||||||
canRestrictMembers: Boolean? = null,
|
canRestrictMembers: Boolean? = null,
|
||||||
canPinMessages: Boolean? = null,
|
canPinMessages: Boolean? = null,
|
||||||
canPromoteMembers: Boolean? = null,
|
canPromoteMembers: Boolean? = null,
|
||||||
canManageVoiceChats: Boolean? = null
|
canManageVoiceChats: Boolean? = null,
|
||||||
|
canManageChat: Boolean?
|
||||||
) = execute(
|
) = execute(
|
||||||
PromoteChatMember(
|
PromoteChatMember(
|
||||||
chatId,
|
chatId,
|
||||||
@ -33,7 +34,8 @@ suspend fun TelegramBot.promoteChatMember(
|
|||||||
canRestrictMembers,
|
canRestrictMembers,
|
||||||
canPinMessages,
|
canPinMessages,
|
||||||
canPromoteMembers,
|
canPromoteMembers,
|
||||||
canManageVoiceChats
|
canManageVoiceChats,
|
||||||
|
canManageChat
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -50,7 +52,8 @@ suspend fun TelegramBot.promoteChatMember(
|
|||||||
canRestrictMembers: Boolean? = null,
|
canRestrictMembers: Boolean? = null,
|
||||||
canPinMessages: Boolean? = null,
|
canPinMessages: Boolean? = null,
|
||||||
canPromoteMembers: Boolean? = null,
|
canPromoteMembers: Boolean? = null,
|
||||||
canManageVoiceChats: Boolean?
|
canManageVoiceChats: Boolean? = null,
|
||||||
|
canManageChat: Boolean? = null
|
||||||
) = promoteChatMember(
|
) = promoteChatMember(
|
||||||
chat.id,
|
chat.id,
|
||||||
userId,
|
userId,
|
||||||
@ -64,7 +67,8 @@ suspend fun TelegramBot.promoteChatMember(
|
|||||||
canRestrictMembers,
|
canRestrictMembers,
|
||||||
canPinMessages,
|
canPinMessages,
|
||||||
canPromoteMembers,
|
canPromoteMembers,
|
||||||
canManageVoiceChats
|
canManageVoiceChats,
|
||||||
|
canManageChat
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.promoteChatMember(
|
suspend fun TelegramBot.promoteChatMember(
|
||||||
@ -80,7 +84,8 @@ suspend fun TelegramBot.promoteChatMember(
|
|||||||
canRestrictMembers: Boolean? = null,
|
canRestrictMembers: Boolean? = null,
|
||||||
canPinMessages: Boolean? = null,
|
canPinMessages: Boolean? = null,
|
||||||
canPromoteMembers: Boolean? = null,
|
canPromoteMembers: Boolean? = null,
|
||||||
canManageVoiceChats: Boolean?
|
canManageVoiceChats: Boolean? = null,
|
||||||
|
canManageChat: Boolean? = null
|
||||||
) = promoteChatMember(
|
) = promoteChatMember(
|
||||||
chatId,
|
chatId,
|
||||||
user.id,
|
user.id,
|
||||||
@ -94,7 +99,8 @@ suspend fun TelegramBot.promoteChatMember(
|
|||||||
canRestrictMembers,
|
canRestrictMembers,
|
||||||
canPinMessages,
|
canPinMessages,
|
||||||
canPromoteMembers,
|
canPromoteMembers,
|
||||||
canManageVoiceChats
|
canManageVoiceChats,
|
||||||
|
canManageChat
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.promoteChatMember(
|
suspend fun TelegramBot.promoteChatMember(
|
||||||
@ -110,7 +116,8 @@ suspend fun TelegramBot.promoteChatMember(
|
|||||||
canRestrictMembers: Boolean? = null,
|
canRestrictMembers: Boolean? = null,
|
||||||
canPinMessages: Boolean? = null,
|
canPinMessages: Boolean? = null,
|
||||||
canPromoteMembers: Boolean? = null,
|
canPromoteMembers: Boolean? = null,
|
||||||
canManageVoiceChats: Boolean?
|
canManageVoiceChats: Boolean? = null,
|
||||||
|
canManageChat: Boolean? = null
|
||||||
) = promoteChatMember(
|
) = promoteChatMember(
|
||||||
chat.id,
|
chat.id,
|
||||||
user.id,
|
user.id,
|
||||||
@ -124,5 +131,6 @@ suspend fun TelegramBot.promoteChatMember(
|
|||||||
canRestrictMembers,
|
canRestrictMembers,
|
||||||
canPinMessages,
|
canPinMessages,
|
||||||
canPromoteMembers,
|
canPromoteMembers,
|
||||||
canManageVoiceChats
|
canManageVoiceChats,
|
||||||
|
canManageChat
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user