eu.vendeli.tgbot.api.Location.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
import eu.vendeli.tgbot.interfaces.Action
import eu.vendeli.tgbot.interfaces.ActionState
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.LocationOptions
import eu.vendeli.tgbot.utils.getReturnType
class SendLocationAction(
latitude: Float,
longitude: Float,
) : Action,
ActionState(),
OptionsFeature,
MarkupFeature {
override val TgAction.method: TgMethod
get() = TgMethod("sendLocation")
override val TgAction.returnType: Class
get() = getReturnType()
override val OptionsFeature.options: LocationOptions
get() = LocationOptions()
init {
parameters["latitude"] = latitude
parameters["longitude"] = longitude
}
}
fun location(latitude: Float, longitude: Float) = SendLocationAction(latitude, longitude)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy