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

add suport of unpinAllGeneralForumTopicMessages

This commit is contained in:
InsanusMokrassar 2023-08-18 23:34:44 +06:00
parent 0840d2e083
commit 4b5baaff8c
2 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,21 @@
package dev.inmo.tgbotapi.extensions.api.chat.forum
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.forum.UnpinAllForumTopicMessages
import dev.inmo.tgbotapi.requests.chat.forum.UnpinAllGeneralForumTopicMessages
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.ForumTopic
import dev.inmo.tgbotapi.types.MessageThreadId
import dev.inmo.tgbotapi.types.chat.Chat
suspend fun TelegramBot.unpinAllGeneralForumTopicMessages(
chatId: ChatIdentifier
) = execute(
UnpinAllGeneralForumTopicMessages(
chatId
)
)
suspend fun TelegramBot.unpinAllGeneralForumTopicMessages(
chat: Chat
) = unpinAllGeneralForumTopicMessages(chat.id)

View File

@ -0,0 +1,14 @@
package dev.inmo.tgbotapi.requests.chat.forum
import dev.inmo.tgbotapi.types.*
import kotlinx.serialization.*
@Serializable
data class UnpinAllGeneralForumTopicMessages (
@SerialName(chatIdField)
override val chatId: ChatIdentifier,
): ModifyForumRequest {
override fun method(): String = "unpinAllGeneralForumTopicMessages"
override val requestSerializer: SerializationStrategy<*>
get() = serializer()
}