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

eu.vendeli.tgbot.api.EditMessageLiveLocation.kt Maven / Gradle / Ivy

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

package eu.vendeli.tgbot.api

import eu.vendeli.tgbot.interfaces.Action
import eu.vendeli.tgbot.interfaces.ActionState
import eu.vendeli.tgbot.interfaces.InlineMode
import eu.vendeli.tgbot.interfaces.TgAction
import eu.vendeli.tgbot.interfaces.features.MarkupFeature
import eu.vendeli.tgbot.interfaces.features.OptionsFeature
import eu.vendeli.tgbot.types.Message
import eu.vendeli.tgbot.types.internal.TgMethod
import eu.vendeli.tgbot.types.internal.options.EditMessageLiveLocationOptions
import eu.vendeli.tgbot.utils.getReturnType

class EditMessageLiveLocationAction :
    Action,
    ActionState,
    InlineMode,
    OptionsFeature,
    MarkupFeature {
    override val TgAction.method: TgMethod
        get() = TgMethod("editMessageLiveLocation")
    override val TgAction.returnType: Class
        get() = getReturnType()
    override val OptionsFeature.options
        get() = EditMessageLiveLocationOptions()

    constructor(messageId: Long, latitude: Float, longitude: Float) {
        parameters["message_id"] = messageId
        parameters["latitude"] = latitude
        parameters["longitude"] = longitude
    }

    constructor(latitude: Float, longitude: Float) {
        parameters["latitude"] = latitude
        parameters["longitude"] = longitude
    }
}

fun editMessageLiveLocation(messageId: Long, latitude: Float, longitude: Float) =
    EditMessageLiveLocationAction(messageId, latitude, longitude)

fun editMessageLiveLocation(latitude: Float, longitude: Float) = EditMessageLiveLocationAction(latitude, longitude)




© 2015 - 2025 Weber Informatics LLC | Privacy Policy