1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-06-03 00:15:27 +00:00
tgbotapi/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendStaticLocation.kt

163 lines
5.8 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
2024-01-07 16:42:46 +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-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,
threadId: MessageThreadId? = chatId.threadId,
2020-02-15 09:33:04 +00:00
disableNotification: Boolean = false,
2022-01-01 14:13:22 +00:00
protectContent: Boolean = false,
2024-01-07 16:42:46 +00:00
replyParameters: ReplyParameters? = null,
2020-02-15 09:33:04 +00:00
replyMarkup: KeyboardMarkup? = null
) = execute(
2020-11-05 17:48:23 +00:00
SendStaticLocation(
2020-02-15 09:33:04 +00:00
chatId,
latitude,
longitude,
2022-11-07 18:11:14 +00:00
threadId = threadId,
2020-02-15 09:33:04 +00:00
disableNotification = disableNotification,
2022-01-01 14:13:22 +00:00
protectContent = protectContent,
2024-01-07 16:42:46 +00:00
replyParameters = replyParameters,
2020-02-15 09:33:04 +00:00
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,
2022-08-05 05:47:39 +00:00
location: Location,
threadId: MessageThreadId? = chatId.threadId,
2020-02-15 09:33:04 +00:00
disableNotification: Boolean = false,
2022-01-01 14:13:22 +00:00
protectContent: Boolean = false,
2024-01-07 16:42:46 +00:00
replyParameters: ReplyParameters? = null,
2020-02-15 09:33:04 +00:00
replyMarkup: KeyboardMarkup? = null
) = sendLocation(
chatId,
location.latitude,
location.longitude,
2022-11-07 18:11:14 +00:00
threadId,
2020-02-15 09:33:04 +00:00
disableNotification,
2022-01-01 14:13:22 +00:00
protectContent,
2024-01-07 16:42:46 +00:00
replyParameters,
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,
threadId: MessageThreadId? = chat.id.threadId,
2020-02-15 09:33:04 +00:00
disableNotification: Boolean = false,
2022-01-01 14:13:22 +00:00
protectContent: Boolean = false,
2024-01-07 16:42:46 +00:00
replyParameters: ReplyParameters? = null,
2020-02-15 09:33:04 +00:00
replyMarkup: KeyboardMarkup? = null
) = sendLocation(
chat.id,
latitude,
longitude,
2022-11-07 18:11:14 +00:00
threadId,
2020-02-15 09:33:04 +00:00
disableNotification,
2022-01-01 14:13:22 +00:00
protectContent,
2024-01-07 16:42:46 +00:00
replyParameters,
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,
threadId: MessageThreadId? = chat.id.threadId,
2020-02-15 09:33:04 +00:00
disableNotification: Boolean = false,
2022-01-01 14:13:22 +00:00
protectContent: Boolean = false,
2024-01-07 16:42:46 +00:00
replyParameters: ReplyParameters? = null,
2020-02-15 09:33:04 +00:00
replyMarkup: KeyboardMarkup? = null
) = sendLocation(
chat.id,
location.latitude,
location.longitude,
2022-11-07 18:11:14 +00:00
threadId,
2020-02-15 09:33:04 +00:00
disableNotification,
2022-01-01 14:13:22 +00:00
protectContent,
2024-01-07 16:42:46 +00:00
replyParameters,
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
*/
2020-11-05 17:48:23 +00:00
suspend fun TelegramBot.sendStaticLocation(
chatId: ChatIdentifier,
latitude: Double,
longitude: Double,
threadId: MessageThreadId? = chatId.threadId,
2020-11-05 17:48:23 +00:00
disableNotification: Boolean = false,
2022-01-01 14:13:22 +00:00
protectContent: Boolean = false,
2024-01-07 16:42:46 +00:00
replyParameters: ReplyParameters? = null,
2020-11-05 17:48:23 +00:00
replyMarkup: KeyboardMarkup? = null
2024-01-07 16:42:46 +00:00
) = sendLocation(chatId, latitude, longitude, threadId, disableNotification, protectContent, replyParameters, 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
*/
2020-11-05 17:48:23 +00:00
suspend fun TelegramBot.sendStaticLocation(
chatId: ChatIdentifier,
2022-08-05 05:47:39 +00:00
location: Location,
threadId: MessageThreadId? = chatId.threadId,
2020-11-05 17:48:23 +00:00
disableNotification: Boolean = false,
2022-01-01 14:13:22 +00:00
protectContent: Boolean = false,
2024-01-07 16:42:46 +00:00
replyParameters: ReplyParameters? = null,
2020-11-05 17:48:23 +00:00
replyMarkup: KeyboardMarkup? = null
2024-01-07 16:42:46 +00:00
) = sendLocation(chatId, location.latitude, location.longitude, threadId, disableNotification, protectContent, replyParameters, 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
*/
2020-11-05 17:48:23 +00:00
suspend fun TelegramBot.sendStaticLocation(
chat: Chat,
latitude: Double,
longitude: Double,
threadId: MessageThreadId? = chat.id.threadId,
2020-11-05 17:48:23 +00:00
disableNotification: Boolean = false,
2022-01-01 14:13:22 +00:00
protectContent: Boolean = false,
2024-01-07 16:42:46 +00:00
replyParameters: ReplyParameters? = null,
2020-11-05 17:48:23 +00:00
replyMarkup: KeyboardMarkup? = null
2024-01-07 16:42:46 +00:00
) = sendLocation(chat.id, latitude, longitude, threadId, disableNotification, protectContent, replyParameters, 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
*/
2020-11-05 17:48:23 +00:00
suspend fun TelegramBot.sendStaticLocation(
chat: Chat,
2022-08-05 05:47:39 +00:00
location: Location,
threadId: MessageThreadId? = chat.id.threadId,
2020-11-05 17:48:23 +00:00
disableNotification: Boolean = false,
2022-01-01 14:13:22 +00:00
protectContent: Boolean = false,
2024-01-07 16:42:46 +00:00
replyParameters: ReplyParameters? = null,
2020-11-05 17:48:23 +00:00
replyMarkup: KeyboardMarkup? = null
2024-01-07 16:42:46 +00:00
) = sendLocation(chat.id, location.latitude, location.longitude, threadId, disableNotification, protectContent, replyParameters, replyMarkup)