tgbotapi/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendLiveLocation.kt

213 lines
7.6 KiB
Kotlin
Raw Normal View History

package dev.inmo.tgbotapi.extensions.api.send
2020-02-15 09:33:04 +00:00
2020-10-04 11:06:30 +00:00
import dev.inmo.tgbotapi.bot.TelegramBot
2022-08-05 05:47:39 +00:00
import dev.inmo.tgbotapi.requests.send.SendLiveLocation
2020-11-05 17:48:23 +00:00
import dev.inmo.tgbotapi.requests.send.SendStaticLocation
2022-08-05 05:47:39 +00:00
import dev.inmo.tgbotapi.types.*
2020-10-04 11:06:30 +00:00
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
2022-04-21 18:16:41 +00:00
import dev.inmo.tgbotapi.types.chat.Chat
2022-08-05 05:47:39 +00:00
import dev.inmo.tgbotapi.types.location.Location
2020-11-04 19:12:14 +00:00
import dev.inmo.tgbotapi.types.location.StaticLocation
2020-02-15 09:33:04 +00:00
2021-10-01 13:38:22 +00:00
/**
* @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(
2020-02-15 09:33:04 +00:00
chatId: ChatIdentifier,
latitude: Double,
longitude: Double,
2022-08-05 05:47:39 +00:00
livePeriod: Seconds,
horizontalAccuracy: Meters? = null,
heading: Degrees? = null,
proximityAlertRadius: Meters? = null,
2020-02-15 09:33:04 +00:00
disableNotification: Boolean = false,
2022-01-01 14:13:22 +00:00
protectContent: Boolean = false,
2020-02-15 09:33:04 +00:00
replyToMessageId: MessageIdentifier? = null,
2022-08-05 05:47:39 +00:00
allowSendingWithoutReply: Boolean? = null,
2020-02-15 09:33:04 +00:00
replyMarkup: KeyboardMarkup? = null
) = execute(
2022-08-05 05:47:39 +00:00
SendLiveLocation(
2020-02-15 09:33:04 +00:00
chatId,
latitude,
longitude,
2022-08-05 05:47:39 +00:00
livePeriod,
horizontalAccuracy,
heading,
proximityAlertRadius,
disableNotification,
protectContent,
replyToMessageId,
allowSendingWithoutReply,
replyMarkup
2020-02-15 09:33:04 +00:00
)
)
2021-10-01 13:38:22 +00:00
/**
* @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(
2020-02-15 09:33:04 +00:00
chatId: ChatIdentifier,
2022-08-05 05:47:39 +00:00
location: Location,
livePeriod: Seconds,
horizontalAccuracy: Meters? = null,
heading: Degrees? = null,
proximityAlertRadius: Meters? = null,
2020-02-15 09:33:04 +00:00
disableNotification: Boolean = false,
2022-01-01 14:13:22 +00:00
protectContent: Boolean = false,
2020-02-15 09:33:04 +00:00
replyToMessageId: MessageIdentifier? = null,
2022-08-05 05:47:39 +00:00
allowSendingWithoutReply: Boolean? = null,
2020-02-15 09:33:04 +00:00
replyMarkup: KeyboardMarkup? = null
) = sendLocation(
chatId,
location.latitude,
location.longitude,
2022-08-05 05:47:39 +00:00
livePeriod,
horizontalAccuracy,
heading,
proximityAlertRadius,
2020-02-15 09:33:04 +00:00
disableNotification,
2022-01-01 14:13:22 +00:00
protectContent,
2020-02-15 09:33:04 +00:00
replyToMessageId,
2022-08-05 05:47:39 +00:00
allowSendingWithoutReply,
2020-02-15 09:33:04 +00:00
replyMarkup
)
2021-10-01 13:38:22 +00:00
/**
* @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(
2020-02-15 09:33:04 +00:00
chat: Chat,
latitude: Double,
longitude: Double,
2022-08-05 05:47:39 +00:00
livePeriod: Seconds,
horizontalAccuracy: Meters? = null,
heading: Degrees? = null,
proximityAlertRadius: Meters? = null,
2020-02-15 09:33:04 +00:00
disableNotification: Boolean = false,
2022-01-01 14:13:22 +00:00
protectContent: Boolean = false,
2020-02-15 09:33:04 +00:00
replyToMessageId: MessageIdentifier? = null,
2022-08-05 05:47:39 +00:00
allowSendingWithoutReply: Boolean? = null,
2020-02-15 09:33:04 +00:00
replyMarkup: KeyboardMarkup? = null
) = sendLocation(
chat.id,
latitude,
longitude,
2022-08-05 05:47:39 +00:00
livePeriod,
horizontalAccuracy,
heading,
proximityAlertRadius,
2020-02-15 09:33:04 +00:00
disableNotification,
2022-01-01 14:13:22 +00:00
protectContent,
2020-02-15 09:33:04 +00:00
replyToMessageId,
2022-08-05 05:47:39 +00:00
allowSendingWithoutReply,
2020-02-15 09:33:04 +00:00
replyMarkup
)
2021-10-01 13:38:22 +00:00
/**
* @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(
2020-02-15 09:33:04 +00:00
chat: Chat,
2022-08-05 05:47:39 +00:00
location: Location,
livePeriod: Seconds,
horizontalAccuracy: Meters? = null,
heading: Degrees? = null,
proximityAlertRadius: Meters? = null,
2020-02-15 09:33:04 +00:00
disableNotification: Boolean = false,
2022-01-01 14:13:22 +00:00
protectContent: Boolean = false,
2020-02-15 09:33:04 +00:00
replyToMessageId: MessageIdentifier? = null,
2022-08-05 05:47:39 +00:00
allowSendingWithoutReply: Boolean? = null,
2020-02-15 09:33:04 +00:00
replyMarkup: KeyboardMarkup? = null
) = sendLocation(
chat.id,
location.latitude,
location.longitude,
2022-08-05 05:47:39 +00:00
livePeriod,
horizontalAccuracy,
heading,
proximityAlertRadius,
2020-02-15 09:33:04 +00:00
disableNotification,
2022-01-01 14:13:22 +00:00
protectContent,
2020-02-15 09:33:04 +00:00
replyToMessageId,
2022-08-05 05:47:39 +00:00
allowSendingWithoutReply,
2020-02-15 09:33:04 +00:00
replyMarkup
)
2020-10-04 10:47:30 +00:00
2021-10-01 13:38:22 +00:00
/**
* @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
*/
2022-08-05 05:47:39 +00:00
suspend fun TelegramBot.sendLiveLocation(
2020-11-05 17:48:23 +00:00
chatId: ChatIdentifier,
latitude: Double,
longitude: Double,
2022-08-05 05:47:39 +00:00
livePeriod: Seconds,
horizontalAccuracy: Meters? = null,
heading: Degrees? = null,
proximityAlertRadius: Meters? = null,
2020-11-05 17:48:23 +00:00
disableNotification: Boolean = false,
2022-01-01 14:13:22 +00:00
protectContent: Boolean = false,
2020-11-05 17:48:23 +00:00
replyToMessageId: MessageIdentifier? = null,
2022-08-05 05:47:39 +00:00
allowSendingWithoutReply: Boolean? = null,
2020-11-05 17:48:23 +00:00
replyMarkup: KeyboardMarkup? = null
2022-08-05 05:47:39 +00:00
) = sendLocation(chatId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
2020-11-05 17:48:23 +00:00
2021-10-01 13:38:22 +00:00
/**
* @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
*/
2022-08-05 05:47:39 +00:00
suspend fun TelegramBot.sendLiveLocation(
2020-11-05 17:48:23 +00:00
chatId: ChatIdentifier,
2022-08-05 05:47:39 +00:00
location: Location,
livePeriod: Seconds,
horizontalAccuracy: Meters? = null,
heading: Degrees? = null,
proximityAlertRadius: Meters? = null,
2020-11-05 17:48:23 +00:00
disableNotification: Boolean = false,
2022-01-01 14:13:22 +00:00
protectContent: Boolean = false,
2020-11-05 17:48:23 +00:00
replyToMessageId: MessageIdentifier? = null,
2022-08-05 05:47:39 +00:00
allowSendingWithoutReply: Boolean? = null,
2020-11-05 17:48:23 +00:00
replyMarkup: KeyboardMarkup? = null
2022-08-05 05:47:39 +00:00
) = sendLocation(chatId, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
2020-11-05 17:48:23 +00:00
2021-10-01 13:38:22 +00:00
/**
* @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
*/
2022-08-05 05:47:39 +00:00
suspend fun TelegramBot.sendLiveLocation(
2020-11-05 17:48:23 +00:00
chat: Chat,
latitude: Double,
longitude: Double,
2022-08-05 05:47:39 +00:00
livePeriod: Seconds,
horizontalAccuracy: Meters? = null,
heading: Degrees? = null,
proximityAlertRadius: Meters? = null,
2020-11-05 17:48:23 +00:00
disableNotification: Boolean = false,
2022-01-01 14:13:22 +00:00
protectContent: Boolean = false,
2020-11-05 17:48:23 +00:00
replyToMessageId: MessageIdentifier? = null,
2022-08-05 05:47:39 +00:00
allowSendingWithoutReply: Boolean? = null,
2020-11-05 17:48:23 +00:00
replyMarkup: KeyboardMarkup? = null
2022-08-05 05:47:39 +00:00
) = sendLocation(chat.id, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
2020-11-05 17:48:23 +00:00
2021-10-01 13:38:22 +00:00
/**
* @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
*/
2022-08-05 05:47:39 +00:00
suspend fun TelegramBot.sendLiveLocation(
2020-11-05 17:48:23 +00:00
chat: Chat,
2022-08-05 05:47:39 +00:00
location: Location,
livePeriod: Seconds,
horizontalAccuracy: Meters? = null,
heading: Degrees? = null,
proximityAlertRadius: Meters? = null,
2020-11-05 17:48:23 +00:00
disableNotification: Boolean = false,
2022-01-01 14:13:22 +00:00
protectContent: Boolean = false,
2020-11-05 17:48:23 +00:00
replyToMessageId: MessageIdentifier? = null,
2022-08-05 05:47:39 +00:00
allowSendingWithoutReply: Boolean? = null,
2020-11-05 17:48:23 +00:00
replyMarkup: KeyboardMarkup? = null
2022-08-05 05:47:39 +00:00
) = sendLocation(chat.id, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)