eu.vendeli.tgbot.api.forum.CloseForumTopic.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of telegram-bot Show documentation
Show all versions of telegram-bot Show documentation
Telegram Bot API wrapper, with handy Kotlin DSL.
@file:Suppress("MatchingDeclarationName")
package eu.vendeli.tgbot.api.forum
import eu.vendeli.tgbot.interfaces.ActionState
import eu.vendeli.tgbot.interfaces.SimpleAction
import eu.vendeli.tgbot.interfaces.TgAction
import eu.vendeli.tgbot.types.internal.TgMethod
import eu.vendeli.tgbot.utils.getReturnType
/**
* Use this method to close an open topic in a forum supergroup chat.
* The bot must be an administrator in the chat for this to work and must have the canManageTopics administrator rights,
* unless it is the creator of the topic. Returns True on success.
*/
class CloseForumTopicAction(messageThreadId: Int) : SimpleAction, ActionState() {
override val TgAction.method: TgMethod
get() = TgMethod("closeForumTopic")
override val TgAction.returnType: Class
get() = getReturnType()
init {
parameters["message_thread_id"] = messageThreadId
}
}
/**
* Use this method to close an open topic in a forum supergroup chat.
* The bot must be an administrator in the chat for this to work and must have the canManageTopics administrator rights,
* unless it is the creator of the topic. Returns True on success.
*/
fun closeForumTopic(messageThreadId: Int) = CloseForumTopicAction(messageThreadId)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy