1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-12-26 10:37:13 +00:00

include revokeMessages in kickChatMember

This commit is contained in:
InsanusMokrassar 2021-03-09 19:33:05 +06:00
parent 53524abcbb
commit 9902b00e85
3 changed files with 16 additions and 9 deletions

View File

@ -13,7 +13,9 @@ data class KickChatMember(
@SerialName(userIdField)
override val userId: UserId,
@SerialName(untilDateField)
override val untilDate: TelegramDate? = null
override val untilDate: TelegramDate? = null,
@SerialName(revokeMessagesField)
val revokeMessages: Boolean? = null
) : ChatMemberRequest<Boolean>, UntilDate {
override fun method(): String = "kickChatMember"
override val resultDeserializer: DeserializationStrategy<Boolean>

View File

@ -162,6 +162,7 @@ const val optionIdsField = "option_ids"
const val ipAddressField = "ip_address"
const val linkedChatIdField = "linked_chat_id"
const val horizontalAccuracyField = "horizontal_accuracy"
const val revokeMessagesField = "revoke_messages"
const val requestContactField = "request_contact"
const val requestLocationField = "request_location"

View File

@ -8,23 +8,27 @@ import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
suspend fun TelegramBot.kickChatMember(
chatId: ChatIdentifier,
userId: UserId,
untilDate: TelegramDate? = null
) = execute(KickChatMember(chatId, userId, untilDate))
untilDate: TelegramDate? = null,
revokeMessages: Boolean? = null
) = execute(KickChatMember(chatId, userId, untilDate, revokeMessages))
suspend fun TelegramBot.kickChatMember(
chat: PublicChat,
userId: UserId,
untilDate: TelegramDate? = null
) = kickChatMember(chat.id, userId, untilDate)
untilDate: TelegramDate? = null,
revokeMessages: Boolean? = null
) = kickChatMember(chat.id, userId, untilDate, revokeMessages)
suspend fun TelegramBot.kickChatMember(
chatId: ChatId,
user: User,
untilDate: TelegramDate? = null
) = kickChatMember(chatId, user.id, untilDate)
untilDate: TelegramDate? = null,
revokeMessages: Boolean? = null
) = kickChatMember(chatId, user.id, untilDate, revokeMessages)
suspend fun TelegramBot.kickChatMember(
chat: PublicChat,
user: User,
untilDate: TelegramDate? = null
) = kickChatMember(chat.id, user.id, untilDate)
untilDate: TelegramDate? = null,
revokeMessages: Boolean? = null
) = kickChatMember(chat.id, user.id, untilDate, revokeMessages)