mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-09-15 21:29:25 +00:00
update live/static locations
This commit is contained in:
@@ -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 {
|
||||
|
@@ -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()
|
||||
|
@@ -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()
|
||||
|
@@ -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()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user