1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-22 00:03:48 +00:00

update live/static locations

This commit is contained in:
InsanusMokrassar 2024-07-15 02:19:50 +06:00
parent f767362c41
commit 8a6e06bbf0
13 changed files with 240 additions and 121 deletions

View File

@ -17,6 +17,7 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.location.LiveLocation
import dev.inmo.tgbotapi.types.location.Location
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.content.LiveLocationContent
import dev.inmo.tgbotapi.types.message.content.LocationContent
import kotlinx.coroutines.CoroutineStart
import kotlinx.coroutines.currentCoroutineContext
@ -54,9 +55,9 @@ public suspend fun TelegramBot.handleLiveLocation(
protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
sentMessageFlow: FlowCollector<ContentMessage<LocationContent>>? = null
sentMessageFlow: FlowCollector<ContentMessage<LiveLocationContent>>? = null
) {
var currentLiveLocationMessage: ContentMessage<LocationContent>? = null
var currentLiveLocationMessage: ContentMessage<LiveLocationContent>? = null
val updateMessageJob = if (liveTimeMillis == indefiniteLivePeriodDelayMillis) { // do not launch refreshing of message for indefinite live locations
null
} else {
@ -127,7 +128,7 @@ public suspend fun TelegramBot.handleLiveLocation(
protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
sentMessageFlow: FlowCollector<ContentMessage<LocationContent>>? = null
sentMessageFlow: FlowCollector<ContentMessage<LiveLocationContent>>? = null
) {
handleLiveLocation(
chatId = chatId,
@ -168,7 +169,7 @@ public suspend fun TelegramBot.handleLiveLocation(
protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
sentMessageFlow: FlowCollector<ContentMessage<LocationContent>>? = null
sentMessageFlow: FlowCollector<ContentMessage<LiveLocationContent>>? = null
) {
handleLiveLocation(
chatId = chatId,

View File

@ -66,7 +66,7 @@ public suspend fun TelegramBot.edit(
proximityAlertRadius: Meters? = null,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null
): ContentMessage<LocationContent> = editLiveLocation(chatId, messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup)
): ContentMessage<LiveLocationContent> = editLiveLocation(chatId, messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@ -83,7 +83,7 @@ public suspend fun TelegramBot.edit(
proximityAlertRadius: Meters? = null,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null
): ContentMessage<LocationContent> = editLiveLocation(chat, messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup)
): ContentMessage<LiveLocationContent> = editLiveLocation(chat, messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@ -99,7 +99,7 @@ public suspend fun TelegramBot.edit(
proximityAlertRadius: Meters? = null,
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null
): ContentMessage<LocationContent> = editLiveLocation(message, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup)
): ContentMessage<LiveLocationContent> = editLiveLocation(message, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@ -111,7 +111,7 @@ public suspend fun TelegramBot.edit(
location: LiveLocation,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null
): ContentMessage<LocationContent> = editLiveLocation(
): ContentMessage<LiveLocationContent> = editLiveLocation(
chatId, messageId, location, businessConnectionId, replyMarkup
)
@ -125,7 +125,7 @@ public suspend fun TelegramBot.edit(
location: LiveLocation,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null
): ContentMessage<LocationContent> = editLiveLocation(chat, messageId, location, businessConnectionId, replyMarkup)
): ContentMessage<LiveLocationContent> = editLiveLocation(chat, messageId, location, businessConnectionId, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@ -136,7 +136,7 @@ public suspend fun TelegramBot.edit(
location: LiveLocation,
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null
): ContentMessage<LocationContent> = editLiveLocation(message, location, businessConnectionId, replyMarkup)
): ContentMessage<LiveLocationContent> = editLiveLocation(message, location, businessConnectionId, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]

View File

@ -8,6 +8,7 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.location.LiveLocation
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.content.LiveLocationContent
import dev.inmo.tgbotapi.types.message.content.LocationContent
/**
@ -25,7 +26,7 @@ public suspend fun TelegramBot.editLiveLocation(
proximityAlertRadius: Meters? = null,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null
): ContentMessage<LocationContent> = execute(
): ContentMessage<LiveLocationContent> = execute(
EditChatMessageLiveLocation(
chatId, messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup
)
@ -46,7 +47,7 @@ public suspend fun TelegramBot.editLiveLocation(
proximityAlertRadius: Meters? = null,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null
): ContentMessage<LocationContent> = editLiveLocation(chat.id, messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup)
): ContentMessage<LiveLocationContent> = editLiveLocation(chat.id, messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@ -62,7 +63,7 @@ public suspend fun TelegramBot.editLiveLocation(
proximityAlertRadius: Meters? = null,
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null
): ContentMessage<LocationContent> = editLiveLocation(message.chat, message.messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup)
): ContentMessage<LiveLocationContent> = editLiveLocation(message.chat, message.messageId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, businessConnectionId, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@ -74,7 +75,7 @@ public suspend fun TelegramBot.editLiveLocation(
location: LiveLocation,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null
): ContentMessage<LocationContent> = execute(
): ContentMessage<LiveLocationContent> = execute(
EditChatMessageLiveLocation(
chatId, messageId, location.latitude, location.longitude, location.livePeriod, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, businessConnectionId, replyMarkup
)
@ -90,7 +91,7 @@ public suspend fun TelegramBot.editLiveLocation(
location: LiveLocation,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null
): ContentMessage<LocationContent> = editLiveLocation(chat.id, messageId, location.latitude, location.longitude, location.livePeriod, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, businessConnectionId, replyMarkup)
): ContentMessage<LiveLocationContent> = editLiveLocation(chat.id, messageId, location.latitude, location.longitude, location.livePeriod, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, businessConnectionId, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@ -101,4 +102,4 @@ public suspend fun TelegramBot.editLiveLocation(
location: LiveLocation,
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null
): ContentMessage<LocationContent> = editLiveLocation(message.chat, message.messageId, location.latitude, location.longitude, location.livePeriod, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, businessConnectionId, replyMarkup)
): ContentMessage<LiveLocationContent> = editLiveLocation(message.chat, message.messageId, location.latitude, location.longitude, location.livePeriod, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, businessConnectionId, replyMarkup)

View File

@ -10,6 +10,7 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.content.LocationContent
import dev.inmo.tgbotapi.types.message.content.StaticLocationContent
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@ -20,7 +21,7 @@ public suspend fun TelegramBot.stopLiveLocation(
messageId: MessageId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null
): ContentMessage<LocationContent> = execute(
): ContentMessage<StaticLocationContent> = execute(
StopChatMessageLiveLocation(
chatId, messageId, businessConnectionId, replyMarkup
)
@ -35,7 +36,7 @@ public suspend fun TelegramBot.stopLiveLocation(
messageId: MessageId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null
): ContentMessage<LocationContent> = stopLiveLocation(chat.id, messageId, businessConnectionId, replyMarkup)
): ContentMessage<StaticLocationContent> = stopLiveLocation(chat.id, messageId, businessConnectionId, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
@ -45,4 +46,4 @@ public suspend fun TelegramBot.stopLiveLocation(
message: ContentMessage<LocationContent>,
businessConnectionId: BusinessConnectionId? = message.chat.id.businessConnectionId,
replyMarkup: InlineKeyboardMarkup? = null
): ContentMessage<LocationContent> = stopLiveLocation(message.chat, message.messageId, businessConnectionId, replyMarkup)
): ContentMessage<StaticLocationContent> = stopLiveLocation(message.chat, message.messageId, businessConnectionId, replyMarkup)

View File

@ -153,7 +153,7 @@ public suspend inline fun TelegramBot.reply(
effectId: EffectId? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): ContentMessage<LocationContent> = sendLocation(
): ContentMessage<StaticLocationContent> = sendLocation(
replyInChatId,
latitude,
longitude,
@ -181,7 +181,7 @@ public suspend inline fun TelegramBot.reply(
effectId: EffectId? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): ContentMessage<LocationContent> = sendLocation(
): ContentMessage<StaticLocationContent> = sendLocation(
replyInChatId,
location,
replyInThreadId,

View File

@ -161,7 +161,7 @@ public suspend inline fun TelegramBot.reply(
effectId: EffectId? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): ContentMessage<LocationContent> = sendLocation(
): ContentMessage<StaticLocationContent> = sendLocation(
replyInChatId,
latitude,
longitude,
@ -190,7 +190,7 @@ public suspend inline fun TelegramBot.reply(
effectId: EffectId? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): ContentMessage<LocationContent> = sendLocation(
): ContentMessage<StaticLocationContent> = sendLocation(
replyInChatId,
location,
replyInThreadId,

View File

@ -8,6 +8,7 @@ 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.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.content.LiveLocationContent
import dev.inmo.tgbotapi.types.message.content.LocationContent
/**
@ -29,7 +30,7 @@ public suspend fun TelegramBot.sendLocation(
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
): ContentMessage<LocationContent> = execute(
): ContentMessage<LiveLocationContent> = execute(
SendLiveLocation(
chatId,
latitude,
@ -66,7 +67,7 @@ public suspend fun TelegramBot.sendLocation(
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
): ContentMessage<LocationContent> = sendLocation(
): ContentMessage<LiveLocationContent> = sendLocation(
chatId,
location.latitude,
location.longitude,
@ -102,7 +103,7 @@ public suspend fun TelegramBot.sendLocation(
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
): ContentMessage<LocationContent> = sendLocation(
): ContentMessage<LiveLocationContent> = sendLocation(
chat.id,
latitude,
longitude,
@ -137,7 +138,7 @@ public suspend fun TelegramBot.sendLocation(
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
): ContentMessage<LocationContent> = sendLocation(
): ContentMessage<LiveLocationContent> = sendLocation(
chatId = chat.id,
latitude = location.latitude,
longitude = location.longitude,
@ -173,7 +174,7 @@ public suspend fun TelegramBot.sendLiveLocation(
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
): ContentMessage<LocationContent> = sendLocation(chatId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
): ContentMessage<LiveLocationContent> = sendLocation(chatId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -193,7 +194,7 @@ public suspend fun TelegramBot.sendLiveLocation(
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
): ContentMessage<LocationContent> = sendLocation(chatId, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
): ContentMessage<LiveLocationContent> = sendLocation(chatId, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -214,7 +215,7 @@ public suspend fun TelegramBot.sendLiveLocation(
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
): ContentMessage<LocationContent> = sendLocation(chat.id, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
): ContentMessage<LiveLocationContent> = sendLocation(chat.id, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -234,4 +235,4 @@ public suspend fun TelegramBot.sendLiveLocation(
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
): ContentMessage<LocationContent> = sendLocation(chat.id, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
): ContentMessage<LiveLocationContent> = sendLocation(chat.id, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)

View File

@ -9,6 +9,7 @@ import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.location.Location
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.content.LocationContent
import dev.inmo.tgbotapi.types.message.content.StaticLocationContent
/**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -25,7 +26,7 @@ public suspend fun TelegramBot.sendLocation(
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
): ContentMessage<LocationContent> = execute(
): ContentMessage<StaticLocationContent> = execute(
SendStaticLocation(
chatId,
latitude,
@ -54,7 +55,7 @@ public suspend fun TelegramBot.sendLocation(
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
): ContentMessage<LocationContent> = sendLocation(
): ContentMessage<StaticLocationContent> = sendLocation(
chatId,
location.latitude,
location.longitude,
@ -82,7 +83,7 @@ public suspend fun TelegramBot.sendLocation(
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
): ContentMessage<LocationContent> = sendLocation(
): ContentMessage<StaticLocationContent> = sendLocation(
chat.id,
latitude,
longitude,
@ -109,7 +110,7 @@ public suspend fun TelegramBot.sendLocation(
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
): ContentMessage<LocationContent> = sendLocation(
): ContentMessage<StaticLocationContent> = sendLocation(
chat.id,
location.latitude,
location.longitude,
@ -137,7 +138,7 @@ public suspend fun TelegramBot.sendStaticLocation(
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
): ContentMessage<LocationContent> = sendLocation(chatId, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
): ContentMessage<StaticLocationContent> = sendLocation(chatId, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -153,7 +154,7 @@ public suspend fun TelegramBot.sendStaticLocation(
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
): ContentMessage<LocationContent> = sendLocation(chatId, location.latitude, location.longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
): ContentMessage<StaticLocationContent> = sendLocation(chatId, location.latitude, location.longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -170,7 +171,7 @@ public suspend fun TelegramBot.sendStaticLocation(
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
): ContentMessage<LocationContent> = sendLocation(chat.id, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
): ContentMessage<StaticLocationContent> = sendLocation(chat.id, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
@ -186,4 +187,4 @@ public suspend fun TelegramBot.sendStaticLocation(
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
): ContentMessage<LocationContent> = sendLocation(chat.id, location.latitude, location.longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
): ContentMessage<StaticLocationContent> = sendLocation(chat.id, location.latitude, location.longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)

View File

@ -517,7 +517,7 @@ public suspend fun TelegramBot.send(
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
): ContentMessage<LocationContent> = sendStaticLocation(chatId, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
): ContentMessage<StaticLocationContent> = sendStaticLocation(chatId, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/**
* Will execute [sendStaticLocation] request
@ -534,7 +534,7 @@ public suspend fun TelegramBot.send(
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
): ContentMessage<LocationContent> = sendStaticLocation(chatId, location, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
): ContentMessage<StaticLocationContent> = sendStaticLocation(chatId, location, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/**
* Will execute [sendStaticLocation] request
@ -552,7 +552,7 @@ public suspend fun TelegramBot.send(
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
): ContentMessage<LocationContent> = sendStaticLocation(chat, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
): ContentMessage<StaticLocationContent> = sendStaticLocation(chat, latitude, longitude, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/**
* Will execute [sendStaticLocation] request
@ -569,7 +569,7 @@ public suspend fun TelegramBot.send(
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
): ContentMessage<LocationContent> = sendStaticLocation(chat, location, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
): ContentMessage<StaticLocationContent> = sendStaticLocation(chat, location, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup)
/**
* Will execute [sendTextMessage] request
@ -1581,7 +1581,7 @@ public suspend fun TelegramBot.send(
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
): ContentMessage<LocationContent> = sendLiveLocation(
): ContentMessage<LiveLocationContent> = sendLiveLocation(
chatId = chatId,
latitude = latitude,
longitude = longitude,
@ -1617,7 +1617,7 @@ public suspend fun TelegramBot.send(
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
): ContentMessage<LocationContent> = sendLiveLocation(
): ContentMessage<LiveLocationContent> = sendLiveLocation(
chatId, location, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
)
@ -1641,7 +1641,7 @@ public suspend fun TelegramBot.send(
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
): ContentMessage<LocationContent> = sendLiveLocation(
): ContentMessage<LiveLocationContent> = sendLiveLocation(
chat, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
)
@ -1662,9 +1662,9 @@ public suspend fun TelegramBot.send(
disableNotification: Boolean = false,
protectContent: Boolean = false,
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
): ContentMessage<LocationContent> = sendLiveLocation(
): ContentMessage<LiveLocationContent> = sendLiveLocation(
chat, location, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters, replyMarkup
)

View File

@ -4684,9 +4684,24 @@ public final class dev/inmo/tgbotapi/requests/send/SendDice$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public final class dev/inmo/tgbotapi/requests/send/SendLocation : dev/inmo/tgbotapi/abstracts/Headed, dev/inmo/tgbotapi/abstracts/HorizontallyAccured, dev/inmo/tgbotapi/abstracts/Livable, dev/inmo/tgbotapi/abstracts/ProximityAlertable, dev/inmo/tgbotapi/requests/send/abstracts/PositionedSendMessageRequest, dev/inmo/tgbotapi/requests/send/abstracts/ReplyingMarkupSendMessageRequest, dev/inmo/tgbotapi/requests/send/abstracts/SendContentMessageRequest {
public abstract interface class dev/inmo/tgbotapi/requests/send/SendLocation : dev/inmo/tgbotapi/abstracts/Headed, dev/inmo/tgbotapi/abstracts/HorizontallyAccured, dev/inmo/tgbotapi/abstracts/Livable, dev/inmo/tgbotapi/abstracts/ProximityAlertable, dev/inmo/tgbotapi/requests/send/abstracts/PositionedSendMessageRequest, dev/inmo/tgbotapi/requests/send/abstracts/ReplyingMarkupSendMessageRequest, dev/inmo/tgbotapi/requests/send/abstracts/SendContentMessageRequest {
public static final field Companion Ldev/inmo/tgbotapi/requests/send/SendLocation$Companion;
public synthetic fun <init> (Ldev/inmo/tgbotapi/types/ChatIdentifier;DDLjava/lang/Integer;Ljava/lang/Float;Ljava/lang/Integer;Ljava/lang/Float;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public abstract fun method ()Ljava/lang/String;
}
public final class dev/inmo/tgbotapi/requests/send/SendLocation$Companion {
public final fun serializer (Lkotlinx/serialization/KSerializer;)Lkotlinx/serialization/KSerializer;
}
public final class dev/inmo/tgbotapi/requests/send/SendLocation$DefaultImpls {
public static fun getAllowSendingWithoutReply (Ldev/inmo/tgbotapi/requests/send/SendLocation;)Ljava/lang/Boolean;
public static fun getReplyToMessageId-CigXjpw (Ldev/inmo/tgbotapi/requests/send/SendLocation;)Ldev/inmo/tgbotapi/types/MessageId;
public static fun method (Ldev/inmo/tgbotapi/requests/send/SendLocation;)Ljava/lang/String;
}
public final class dev/inmo/tgbotapi/requests/send/SendLocation$Live : dev/inmo/tgbotapi/requests/send/SendLocation {
public static final field Companion Ldev/inmo/tgbotapi/requests/send/SendLocation$Live$Companion;
public synthetic fun <init> (Ldev/inmo/tgbotapi/types/ChatIdentifier;DDILjava/lang/Float;Ljava/lang/Integer;Ljava/lang/Float;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun component1 ()Ldev/inmo/tgbotapi/types/ChatIdentifier;
public final fun component10 ()Z
public final fun component11 ()Z
@ -4695,14 +4710,14 @@ public final class dev/inmo/tgbotapi/requests/send/SendLocation : dev/inmo/tgbot
public final fun component14 ()Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;
public final fun component2 ()D
public final fun component3 ()D
public final fun component4 ()Ljava/lang/Integer;
public final fun component4 ()I
public final fun component5 ()Ljava/lang/Float;
public final fun component6 ()Ljava/lang/Integer;
public final fun component7 ()Ljava/lang/Float;
public final fun component8-S3HF-10 ()Ldev/inmo/tgbotapi/types/MessageThreadId;
public final fun component9-nXr5wdE ()Ljava/lang/String;
public final fun copy-3sgDXH4 (Ldev/inmo/tgbotapi/types/ChatIdentifier;DDLjava/lang/Integer;Ljava/lang/Float;Ljava/lang/Integer;Ljava/lang/Float;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;)Ldev/inmo/tgbotapi/requests/send/SendLocation;
public static synthetic fun copy-3sgDXH4$default (Ldev/inmo/tgbotapi/requests/send/SendLocation;Ldev/inmo/tgbotapi/types/ChatIdentifier;DDLjava/lang/Integer;Ljava/lang/Float;Ljava/lang/Integer;Ljava/lang/Float;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;ILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/send/SendLocation;
public final fun copy-3sgDXH4 (Ldev/inmo/tgbotapi/types/ChatIdentifier;DDILjava/lang/Float;Ljava/lang/Integer;Ljava/lang/Float;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;)Ldev/inmo/tgbotapi/requests/send/SendLocation$Live;
public static synthetic fun copy-3sgDXH4$default (Ldev/inmo/tgbotapi/requests/send/SendLocation$Live;Ldev/inmo/tgbotapi/types/ChatIdentifier;DDILjava/lang/Float;Ljava/lang/Integer;Ljava/lang/Float;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;ILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/send/SendLocation$Live;
public fun equals (Ljava/lang/Object;)Z
public fun getAllowSendingWithoutReply ()Ljava/lang/Boolean;
public fun getBusinessConnectionId-nXr5wdE ()Ljava/lang/String;
@ -4727,28 +4742,82 @@ public final class dev/inmo/tgbotapi/requests/send/SendLocation : dev/inmo/tgbot
public fun toString ()Ljava/lang/String;
}
public final class dev/inmo/tgbotapi/requests/send/SendLocation$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
public static final field INSTANCE Ldev/inmo/tgbotapi/requests/send/SendLocation$$serializer;
public final class dev/inmo/tgbotapi/requests/send/SendLocation$Live$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
public static final field INSTANCE Ldev/inmo/tgbotapi/requests/send/SendLocation$Live$$serializer;
public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/requests/send/SendLocation;
public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/requests/send/SendLocation$Live;
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/requests/send/SendLocation;)V
public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/requests/send/SendLocation$Live;)V
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
}
public final class dev/inmo/tgbotapi/requests/send/SendLocation$Companion {
public final class dev/inmo/tgbotapi/requests/send/SendLocation$Live$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public final class dev/inmo/tgbotapi/requests/send/SendLocation$Static : dev/inmo/tgbotapi/requests/send/SendLocation {
public static final field Companion Ldev/inmo/tgbotapi/requests/send/SendLocation$Static$Companion;
public synthetic fun <init> (Ldev/inmo/tgbotapi/types/ChatIdentifier;DDLdev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun component1 ()Ldev/inmo/tgbotapi/types/ChatIdentifier;
public final fun component10 ()Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;
public final fun component2 ()D
public final fun component3 ()D
public final fun component4-S3HF-10 ()Ldev/inmo/tgbotapi/types/MessageThreadId;
public final fun component5-nXr5wdE ()Ljava/lang/String;
public final fun component6 ()Z
public final fun component7 ()Z
public final fun component8-Ts0V7ak ()Ljava/lang/String;
public final fun component9 ()Ldev/inmo/tgbotapi/types/ReplyParameters;
public final fun copy-H0gMNAo (Ldev/inmo/tgbotapi/types/ChatIdentifier;DDLdev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;)Ldev/inmo/tgbotapi/requests/send/SendLocation$Static;
public static synthetic fun copy-H0gMNAo$default (Ldev/inmo/tgbotapi/requests/send/SendLocation$Static;Ldev/inmo/tgbotapi/types/ChatIdentifier;DDLdev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;ILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/send/SendLocation$Static;
public fun equals (Ljava/lang/Object;)Z
public fun getAllowSendingWithoutReply ()Ljava/lang/Boolean;
public fun getBusinessConnectionId-nXr5wdE ()Ljava/lang/String;
public fun getChatId ()Ldev/inmo/tgbotapi/types/ChatIdentifier;
public fun getDisableNotification ()Z
public fun getEffectId-Ts0V7ak ()Ljava/lang/String;
public fun getHeading ()Ljava/lang/Integer;
public fun getHorizontalAccuracy ()Ljava/lang/Float;
public fun getLatitude ()D
public fun getLivePeriod ()Ljava/lang/Integer;
public fun getLongitude ()D
public fun getProtectContent ()Z
public fun getProximityAlertRadius ()Ljava/lang/Float;
public fun getReplyMarkup ()Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;
public fun getReplyParameters ()Ldev/inmo/tgbotapi/types/ReplyParameters;
public fun getReplyToMessageId-CigXjpw ()Ldev/inmo/tgbotapi/types/MessageId;
public fun getRequestSerializer ()Lkotlinx/serialization/SerializationStrategy;
public fun getResultDeserializer ()Lkotlinx/serialization/DeserializationStrategy;
public fun getThreadId-S3HF-10 ()Ldev/inmo/tgbotapi/types/MessageThreadId;
public fun hashCode ()I
public fun method ()Ljava/lang/String;
public fun toString ()Ljava/lang/String;
}
public final class dev/inmo/tgbotapi/requests/send/SendLocation$Static$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
public static final field INSTANCE Ldev/inmo/tgbotapi/requests/send/SendLocation$Static$$serializer;
public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/requests/send/SendLocation$Static;
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/requests/send/SendLocation$Static;)V
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
}
public final class dev/inmo/tgbotapi/requests/send/SendLocation$Static$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public final class dev/inmo/tgbotapi/requests/send/SendLocationKt {
public static final fun SendLiveLocation-3sgDXH4 (Ldev/inmo/tgbotapi/types/ChatIdentifier;DDILjava/lang/Float;Ljava/lang/Integer;Ljava/lang/Float;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;)Ldev/inmo/tgbotapi/requests/send/SendLocation;
public static synthetic fun SendLiveLocation-3sgDXH4$default (Ldev/inmo/tgbotapi/types/ChatIdentifier;DDILjava/lang/Float;Ljava/lang/Integer;Ljava/lang/Float;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;ILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/send/SendLocation;
public static final fun SendLocation-H0gMNAo (Ldev/inmo/tgbotapi/types/ChatIdentifier;DDLdev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;)Ldev/inmo/tgbotapi/requests/send/SendLocation;
public static synthetic fun SendLocation-H0gMNAo$default (Ldev/inmo/tgbotapi/types/ChatIdentifier;DDLdev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;ILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/send/SendLocation;
public static final fun SendStaticLocation-H0gMNAo (Ldev/inmo/tgbotapi/types/ChatIdentifier;DDLdev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;)Ldev/inmo/tgbotapi/requests/send/SendLocation;
public static synthetic fun SendStaticLocation-H0gMNAo$default (Ldev/inmo/tgbotapi/types/ChatIdentifier;DDLdev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;ILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/send/SendLocation;
public static final fun SendLiveLocation-3sgDXH4 (Ldev/inmo/tgbotapi/types/ChatIdentifier;DDILjava/lang/Float;Ljava/lang/Integer;Ljava/lang/Float;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;)Ldev/inmo/tgbotapi/requests/send/SendLocation$Live;
public static synthetic fun SendLiveLocation-3sgDXH4$default (Ldev/inmo/tgbotapi/types/ChatIdentifier;DDILjava/lang/Float;Ljava/lang/Integer;Ljava/lang/Float;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;ILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/send/SendLocation$Live;
public static final fun SendLocation-H0gMNAo (Ldev/inmo/tgbotapi/types/ChatIdentifier;DDLdev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;)Ldev/inmo/tgbotapi/requests/send/SendLocation$Static;
public static synthetic fun SendLocation-H0gMNAo$default (Ldev/inmo/tgbotapi/types/ChatIdentifier;DDLdev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;ILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/send/SendLocation$Static;
public static final fun SendStaticLocation-H0gMNAo (Ldev/inmo/tgbotapi/types/ChatIdentifier;DDLdev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;)Ldev/inmo/tgbotapi/requests/send/SendLocation$Static;
public static synthetic fun SendStaticLocation-H0gMNAo$default (Ldev/inmo/tgbotapi/types/ChatIdentifier;DDLdev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;ILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/send/SendLocation$Static;
}
public final class dev/inmo/tgbotapi/requests/send/SendMessageKt {

View File

@ -7,11 +7,12 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.location.LiveLocation
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
import dev.inmo.tgbotapi.types.message.content.LiveLocationContent
import dev.inmo.tgbotapi.types.message.content.LocationContent
import dev.inmo.tgbotapi.utils.throwRangeError
import kotlinx.serialization.*
private val commonResultDeserializer = TelegramBotAPIMessageDeserializationStrategyClass<ContentMessage<LocationContent>>()
private val commonResultDeserializer = TelegramBotAPIMessageDeserializationStrategyClass<ContentMessage<LiveLocationContent>>()
const val editMessageLiveLocationMethod = "editMessageLiveLocation"
@Serializable
@ -36,9 +37,9 @@ data class EditChatMessageLiveLocation(
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(replyMarkupField)
override val replyMarkup: InlineKeyboardMarkup? = null
) : EditChatMessage<LocationContent>, EditReplyMessage, EditLocationMessage {
) : EditChatMessage<LiveLocationContent>, EditReplyMessage, EditLocationMessage {
override fun method(): String = editMessageLiveLocationMethod
override val resultDeserializer: DeserializationStrategy<ContentMessage<LocationContent>>
override val resultDeserializer: DeserializationStrategy<ContentMessage<LiveLocationContent>>
get() = commonResultDeserializer
override val requestSerializer: SerializationStrategy<*>
get() = serializer()

View File

@ -8,9 +8,10 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
import dev.inmo.tgbotapi.types.message.content.LocationContent
import dev.inmo.tgbotapi.types.message.content.StaticLocationContent
import kotlinx.serialization.*
private val commonResultDeserializer = TelegramBotAPIMessageDeserializationStrategyClass<ContentMessage<LocationContent>>()
private val commonResultDeserializer = TelegramBotAPIMessageDeserializationStrategyClass<ContentMessage<StaticLocationContent>>()
const val stopMessageLiveLocationMethod = "stopMessageLiveLocation"
@Serializable
@ -23,9 +24,9 @@ data class StopChatMessageLiveLocation(
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(replyMarkupField)
override val replyMarkup: InlineKeyboardMarkup? = null
) : EditChatMessage<LocationContent>, EditReplyMessage {
) : EditChatMessage<StaticLocationContent>, EditReplyMessage {
override fun method(): String = stopMessageLiveLocationMethod
override val resultDeserializer: DeserializationStrategy<ContentMessage<LocationContent>>
override val resultDeserializer: DeserializationStrategy<ContentMessage<StaticLocationContent>>
get() = commonResultDeserializer
override val requestSerializer: SerializationStrategy<*>
get() = serializer()

View File

@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.requests.send.abstracts.*
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.location.LiveLocation
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
import dev.inmo.tgbotapi.types.message.content.*
@ -15,6 +16,12 @@ import kotlinx.serialization.*
private val commonResultDeserializer: DeserializationStrategy<ContentMessage<LocationContent>>
= TelegramBotAPIMessageDeserializationStrategyClass()
private val liveResultDeserializer: DeserializationStrategy<ContentMessage<LiveLocationContent>>
= TelegramBotAPIMessageDeserializationStrategyClass()
private val staticResultDeserializer: DeserializationStrategy<ContentMessage<StaticLocationContent>>
= TelegramBotAPIMessageDeserializationStrategyClass()
fun SendLocation(
chatId: ChatIdentifier,
latitude: Double,
@ -26,14 +33,10 @@ fun SendLocation(
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
) = SendLocation(
) = SendLocation.Static(
chatId,
latitude,
longitude,
null,
null,
null,
null,
threadId,
businessConnectionId,
disableNotification,
@ -54,7 +57,7 @@ fun SendStaticLocation(
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
) = SendLocation(
) = SendLocation.Static(
chatId = chatId,
latitude = latitude,
longitude = longitude,
@ -82,7 +85,7 @@ fun SendLiveLocation(
effectId: EffectId? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
) = SendLocation(
) = SendLocation.Live(
chatId = chatId,
latitude = latitude,
longitude = longitude,
@ -100,55 +103,95 @@ fun SendLiveLocation(
)
@Serializable
data class SendLocation internal constructor(
@SerialName(chatIdField)
override val chatId: ChatIdentifier,
@SerialName(latitudeField)
override val latitude: Double,
@SerialName(longitudeField)
override val longitude: Double,
@SerialName(livePeriodField)
override val livePeriod: Seconds? = null,
@SerialName(horizontalAccuracyField)
override val horizontalAccuracy: Meters? = null,
@SerialName(headingField)
override val heading: Degrees? = null,
@SerialName(proximityAlertRadiusField)
override val proximityAlertRadius: Meters? = null,
@SerialName(messageThreadIdField)
override val threadId: MessageThreadId? = chatId.threadId,
@SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField)
override val disableNotification: Boolean = false,
@SerialName(protectContentField)
override val protectContent: Boolean = false,
@SerialName(messageEffectIdField)
override val effectId: EffectId? = null,
@SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField)
override val replyMarkup: KeyboardMarkup? = null
) : SendContentMessageRequest<ContentMessage<LocationContent>>,
ReplyingMarkupSendMessageRequest<ContentMessage<LocationContent>>,
PositionedSendMessageRequest<ContentMessage<LocationContent>>,
sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<ContentMessage<T>>,
ReplyingMarkupSendMessageRequest<ContentMessage<T>>,
PositionedSendMessageRequest<ContentMessage<T>>,
HorizontallyAccured,
Livable,
ProximityAlertable,
Headed
{
Headed {
override fun method(): String = "sendLocation"
override val resultDeserializer: DeserializationStrategy<ContentMessage<LocationContent>>
get() = commonResultDeserializer
override val requestSerializer: SerializationStrategy<*>
get() = serializer()
init {
if (livePeriod != null && livePeriod !in livePeriodLimit) {
error("Live period for sending location must be in $livePeriodLimit, but was $livePeriod")
}
if (horizontalAccuracy != null && horizontalAccuracy !in horizontalAccuracyLimit) {
throwRangeError("horizontalAccuracy", horizontalAccuracyLimit, horizontalAccuracy)
@Serializable
data class Live internal constructor(
@SerialName(chatIdField)
override val chatId: ChatIdentifier,
@SerialName(latitudeField)
override val latitude: Double,
@SerialName(longitudeField)
override val longitude: Double,
@SerialName(livePeriodField)
override val livePeriod: Seconds = LiveLocation.INDEFINITE_LIVE_PERIOD,
@SerialName(horizontalAccuracyField)
override val horizontalAccuracy: Meters? = null,
@SerialName(headingField)
override val heading: Degrees? = null,
@SerialName(proximityAlertRadiusField)
override val proximityAlertRadius: Meters? = null,
@SerialName(messageThreadIdField)
override val threadId: MessageThreadId? = chatId.threadId,
@SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField)
override val disableNotification: Boolean = false,
@SerialName(protectContentField)
override val protectContent: Boolean = false,
@SerialName(messageEffectIdField)
override val effectId: EffectId? = null,
@SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField)
override val replyMarkup: KeyboardMarkup? = null
) : SendLocation<LiveLocationContent> {
override val resultDeserializer: DeserializationStrategy<ContentMessage<LiveLocationContent>>
get() = liveResultDeserializer
override val requestSerializer: SerializationStrategy<*>
get() = Live.serializer()
init {
if (livePeriod !in livePeriodLimit) {
error("Live period for sending location must be in $livePeriodLimit, but was $livePeriod")
}
if (horizontalAccuracy != null && horizontalAccuracy !in horizontalAccuracyLimit) {
throwRangeError("horizontalAccuracy", horizontalAccuracyLimit, horizontalAccuracy)
}
}
}
@Serializable
data class Static internal constructor(
@SerialName(chatIdField)
override val chatId: ChatIdentifier,
@SerialName(latitudeField)
override val latitude: Double,
@SerialName(longitudeField)
override val longitude: Double,
@SerialName(messageThreadIdField)
override val threadId: MessageThreadId? = chatId.threadId,
@SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField)
override val disableNotification: Boolean = false,
@SerialName(protectContentField)
override val protectContent: Boolean = false,
@SerialName(messageEffectIdField)
override val effectId: EffectId? = null,
@SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField)
override val replyMarkup: KeyboardMarkup? = null
) : SendLocation<StaticLocationContent> {
override val livePeriod: Seconds?
get() = null
override val horizontalAccuracy: Meters?
get() = null
override val heading: Degrees?
get() = null
override val proximityAlertRadius: Meters?
get() = null
override val resultDeserializer: DeserializationStrategy<ContentMessage<StaticLocationContent>>
get() = staticResultDeserializer
override val requestSerializer: SerializationStrategy<*>
get() = serializer()
}
}