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

140 lines
5.0 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
2020-11-05 17:48:23 +00:00
import dev.inmo.tgbotapi.requests.send.SendStaticLocation
2020-11-05 18:12:14 +00:00
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.MessageIdentifier
2020-10-04 11:06:30 +00:00
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
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,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
replyMarkup: KeyboardMarkup? = null
) = execute(
2020-11-05 17:48:23 +00:00
SendStaticLocation(
2020-02-15 09:33:04 +00:00
chatId,
latitude,
longitude,
disableNotification = disableNotification,
replyToMessageId = replyToMessageId,
replyMarkup = 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
chatId: ChatIdentifier,
2020-11-04 19:12:14 +00:00
location: StaticLocation,
2020-02-15 09:33:04 +00:00
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
replyMarkup: KeyboardMarkup? = null
) = sendLocation(
chatId,
location.latitude,
location.longitude,
disableNotification,
replyToMessageId,
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,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
replyMarkup: KeyboardMarkup? = null
) = sendLocation(
chat.id,
latitude,
longitude,
disableNotification,
replyToMessageId,
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,
2020-11-04 19:12:14 +00:00
location: StaticLocation,
2020-02-15 09:33:04 +00:00
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
replyMarkup: KeyboardMarkup? = null
) = sendLocation(
chat.id,
location.latitude,
location.longitude,
disableNotification,
replyToMessageId,
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
*/
2020-11-05 17:48:23 +00:00
suspend fun TelegramBot.sendStaticLocation(
chatId: ChatIdentifier,
latitude: Double,
longitude: Double,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
replyMarkup: KeyboardMarkup? = null
) = sendLocation(chatId, latitude, longitude, disableNotification, replyToMessageId, 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
*/
2020-11-05 17:48:23 +00:00
suspend fun TelegramBot.sendStaticLocation(
chatId: ChatIdentifier,
location: StaticLocation,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
replyMarkup: KeyboardMarkup? = null
) = sendLocation(chatId, location.latitude, location.longitude, disableNotification, replyToMessageId, 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
*/
2020-11-05 17:48:23 +00:00
suspend fun TelegramBot.sendStaticLocation(
chat: Chat,
latitude: Double,
longitude: Double,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
replyMarkup: KeyboardMarkup? = null
) = sendLocation(chat.id, latitude, longitude, disableNotification, replyToMessageId, 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
*/
2020-11-05 17:48:23 +00:00
suspend fun TelegramBot.sendStaticLocation(
chat: Chat,
location: StaticLocation,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
replyMarkup: KeyboardMarkup? = null
) = sendLocation(chat.id, location.latitude, location.longitude, disableNotification, replyToMessageId, replyMarkup)