All Downloads are FREE. Search and download functionalities are using the official Maven repository.

eu.vendeli.tgbot.api.chat.BanChatMember.kt Maven / Gradle / Ivy

There is a newer version: 6.6.0
Show newest version
@file:Suppress("MatchingDeclarationName")

package eu.vendeli.tgbot.api.chat

import eu.vendeli.tgbot.interfaces.Action
import eu.vendeli.tgbot.interfaces.ActionState
import eu.vendeli.tgbot.interfaces.TgAction
import eu.vendeli.tgbot.types.internal.TgMethod
import eu.vendeli.tgbot.utils.getReturnType

class BanChatMemberAction(
    userId: Long,
    untilDate: Int? = null,
    revokeMessages: Boolean? = null,
) : Action, ActionState() {
    override val TgAction.method: TgMethod
        get() = TgMethod("banChatMember")
    override val TgAction.returnType: Class
        get() = getReturnType()

    init {
        parameters["user_id"] = userId
        if (untilDate != null) parameters["until_date"] = untilDate
        if (revokeMessages != null) parameters["revoke_messages"] = revokeMessages
    }
}

fun banChatMember(userId: Long, untilDate: Int?, revokeMessages: Boolean?) =
    BanChatMemberAction(userId, untilDate, revokeMessages)




© 2015 - 2025 Weber Informatics LLC | Privacy Policy