213 lines
7.6 KiB
Kotlin
213 lines
7.6 KiB
Kotlin
package dev.inmo.tgbotapi.extensions.api.send
|
|
|
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
|
import dev.inmo.tgbotapi.requests.send.SendLiveLocation
|
|
import dev.inmo.tgbotapi.requests.send.SendStaticLocation
|
|
import dev.inmo.tgbotapi.types.*
|
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
|
import dev.inmo.tgbotapi.types.chat.Chat
|
|
import dev.inmo.tgbotapi.types.location.Location
|
|
import dev.inmo.tgbotapi.types.location.StaticLocation
|
|
|
|
/**
|
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
*/
|
|
suspend fun TelegramBot.sendLocation(
|
|
chatId: ChatIdentifier,
|
|
latitude: Double,
|
|
longitude: Double,
|
|
livePeriod: Seconds,
|
|
horizontalAccuracy: Meters? = null,
|
|
heading: Degrees? = null,
|
|
proximityAlertRadius: Meters? = null,
|
|
disableNotification: Boolean = false,
|
|
protectContent: Boolean = false,
|
|
replyToMessageId: MessageIdentifier? = null,
|
|
allowSendingWithoutReply: Boolean? = null,
|
|
replyMarkup: KeyboardMarkup? = null
|
|
) = execute(
|
|
SendLiveLocation(
|
|
chatId,
|
|
latitude,
|
|
longitude,
|
|
livePeriod,
|
|
horizontalAccuracy,
|
|
heading,
|
|
proximityAlertRadius,
|
|
disableNotification,
|
|
protectContent,
|
|
replyToMessageId,
|
|
allowSendingWithoutReply,
|
|
replyMarkup
|
|
)
|
|
)
|
|
|
|
/**
|
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
*/
|
|
suspend fun TelegramBot.sendLocation(
|
|
chatId: ChatIdentifier,
|
|
location: Location,
|
|
livePeriod: Seconds,
|
|
horizontalAccuracy: Meters? = null,
|
|
heading: Degrees? = null,
|
|
proximityAlertRadius: Meters? = null,
|
|
disableNotification: Boolean = false,
|
|
protectContent: Boolean = false,
|
|
replyToMessageId: MessageIdentifier? = null,
|
|
allowSendingWithoutReply: Boolean? = null,
|
|
replyMarkup: KeyboardMarkup? = null
|
|
) = sendLocation(
|
|
chatId,
|
|
location.latitude,
|
|
location.longitude,
|
|
livePeriod,
|
|
horizontalAccuracy,
|
|
heading,
|
|
proximityAlertRadius,
|
|
disableNotification,
|
|
protectContent,
|
|
replyToMessageId,
|
|
allowSendingWithoutReply,
|
|
replyMarkup
|
|
)
|
|
|
|
/**
|
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
*/
|
|
suspend fun TelegramBot.sendLocation(
|
|
chat: Chat,
|
|
latitude: Double,
|
|
longitude: Double,
|
|
livePeriod: Seconds,
|
|
horizontalAccuracy: Meters? = null,
|
|
heading: Degrees? = null,
|
|
proximityAlertRadius: Meters? = null,
|
|
disableNotification: Boolean = false,
|
|
protectContent: Boolean = false,
|
|
replyToMessageId: MessageIdentifier? = null,
|
|
allowSendingWithoutReply: Boolean? = null,
|
|
replyMarkup: KeyboardMarkup? = null
|
|
) = sendLocation(
|
|
chat.id,
|
|
latitude,
|
|
longitude,
|
|
livePeriod,
|
|
horizontalAccuracy,
|
|
heading,
|
|
proximityAlertRadius,
|
|
disableNotification,
|
|
protectContent,
|
|
replyToMessageId,
|
|
allowSendingWithoutReply,
|
|
replyMarkup
|
|
)
|
|
|
|
/**
|
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
*/
|
|
suspend fun TelegramBot.sendLocation(
|
|
chat: Chat,
|
|
location: Location,
|
|
livePeriod: Seconds,
|
|
horizontalAccuracy: Meters? = null,
|
|
heading: Degrees? = null,
|
|
proximityAlertRadius: Meters? = null,
|
|
disableNotification: Boolean = false,
|
|
protectContent: Boolean = false,
|
|
replyToMessageId: MessageIdentifier? = null,
|
|
allowSendingWithoutReply: Boolean? = null,
|
|
replyMarkup: KeyboardMarkup? = null
|
|
) = sendLocation(
|
|
chat.id,
|
|
location.latitude,
|
|
location.longitude,
|
|
livePeriod,
|
|
horizontalAccuracy,
|
|
heading,
|
|
proximityAlertRadius,
|
|
disableNotification,
|
|
protectContent,
|
|
replyToMessageId,
|
|
allowSendingWithoutReply,
|
|
replyMarkup
|
|
)
|
|
|
|
/**
|
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
*/
|
|
suspend fun TelegramBot.sendLiveLocation(
|
|
chatId: ChatIdentifier,
|
|
latitude: Double,
|
|
longitude: Double,
|
|
livePeriod: Seconds,
|
|
horizontalAccuracy: Meters? = null,
|
|
heading: Degrees? = null,
|
|
proximityAlertRadius: Meters? = null,
|
|
disableNotification: Boolean = false,
|
|
protectContent: Boolean = false,
|
|
replyToMessageId: MessageIdentifier? = null,
|
|
allowSendingWithoutReply: Boolean? = null,
|
|
replyMarkup: KeyboardMarkup? = null
|
|
) = sendLocation(chatId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
|
|
|
/**
|
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
*/
|
|
suspend fun TelegramBot.sendLiveLocation(
|
|
chatId: ChatIdentifier,
|
|
location: Location,
|
|
livePeriod: Seconds,
|
|
horizontalAccuracy: Meters? = null,
|
|
heading: Degrees? = null,
|
|
proximityAlertRadius: Meters? = null,
|
|
disableNotification: Boolean = false,
|
|
protectContent: Boolean = false,
|
|
replyToMessageId: MessageIdentifier? = null,
|
|
allowSendingWithoutReply: Boolean? = null,
|
|
replyMarkup: KeyboardMarkup? = null
|
|
) = sendLocation(chatId, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
|
|
|
/**
|
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
*/
|
|
suspend fun TelegramBot.sendLiveLocation(
|
|
chat: Chat,
|
|
latitude: Double,
|
|
longitude: Double,
|
|
livePeriod: Seconds,
|
|
horizontalAccuracy: Meters? = null,
|
|
heading: Degrees? = null,
|
|
proximityAlertRadius: Meters? = null,
|
|
disableNotification: Boolean = false,
|
|
protectContent: Boolean = false,
|
|
replyToMessageId: MessageIdentifier? = null,
|
|
allowSendingWithoutReply: Boolean? = null,
|
|
replyMarkup: KeyboardMarkup? = null
|
|
) = sendLocation(chat.id, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
|
|
|
/**
|
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
*/
|
|
suspend fun TelegramBot.sendLiveLocation(
|
|
chat: Chat,
|
|
location: Location,
|
|
livePeriod: Seconds,
|
|
horizontalAccuracy: Meters? = null,
|
|
heading: Degrees? = null,
|
|
proximityAlertRadius: Meters? = null,
|
|
disableNotification: Boolean = false,
|
|
protectContent: Boolean = false,
|
|
replyToMessageId: MessageIdentifier? = null,
|
|
allowSendingWithoutReply: Boolean? = null,
|
|
replyMarkup: KeyboardMarkup? = null
|
|
) = sendLocation(chat.id, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|