mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-12-23 00:57:13 +00:00
inline messages edit result fixes
This commit is contained in:
parent
3c83362283
commit
983e5edf7b
@ -8,6 +8,7 @@
|
||||
* Added `InputMessageContent`
|
||||
* Update some types and requests according to abstractions replacing
|
||||
* Add all `InlineQueryResult`, `InputMessageContent` and other inline mode types
|
||||
* Fixes in edition of inline messages and their result types
|
||||
|
||||
## 0.9.0
|
||||
|
||||
|
@ -6,7 +6,6 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMa
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
|
||||
import kotlinx.serialization.*
|
||||
|
||||
// TODO:: Replace return type by RawMessage or Boolean (as in documentation)
|
||||
@Serializable
|
||||
data class EditChatMessageLiveLocation(
|
||||
@SerialName(chatIdField)
|
||||
|
@ -5,8 +5,8 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
|
||||
import kotlinx.serialization.*
|
||||
import kotlinx.serialization.internal.BooleanSerializer
|
||||
|
||||
// TODO:: Replace return type by RawMessage or Boolean (as in documentation)
|
||||
@Serializable
|
||||
data class EditInlineMessageLiveLocation(
|
||||
@SerialName(inlineMessageIdField)
|
||||
@ -20,5 +20,4 @@ data class EditInlineMessageLiveLocation(
|
||||
override val replyMarkup: InlineKeyboardMarkup? = null
|
||||
) : EditInlineMessage, EditReplyMessage, EditLocationMessage {
|
||||
override fun method(): String = "editMessageLiveLocation"
|
||||
override fun resultSerializer(): KSerializer<RawMessage> = RawMessage.serializer()
|
||||
}
|
||||
|
@ -7,7 +7,6 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMa
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
|
||||
import kotlinx.serialization.*
|
||||
|
||||
// TODO:: Replace return type by RawMessage or Boolean (as in documentation)
|
||||
@Serializable
|
||||
data class StopChatMessageLiveLocation(
|
||||
@SerialName(chatIdField)
|
||||
|
@ -7,7 +7,6 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMa
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
|
||||
import kotlinx.serialization.*
|
||||
|
||||
// TODO:: Replace return type by RawMessage or Boolean (as in documentation)
|
||||
@Serializable
|
||||
data class StopInlineMessageLiveLocation(
|
||||
@SerialName(inlineMessageIdField)
|
||||
@ -17,5 +16,4 @@ data class StopInlineMessageLiveLocation(
|
||||
override val replyMarkup: InlineKeyboardMarkup? = null
|
||||
) : EditInlineMessage, EditReplyMessage {
|
||||
override fun method(): String = "stopMessageLiveLocation"
|
||||
override fun resultSerializer(): KSerializer<RawMessage> = RawMessage.serializer()
|
||||
}
|
||||
|
@ -15,7 +15,5 @@ data class EditInlineMessageReplyMarkup(
|
||||
@Optional
|
||||
override val replyMarkup: InlineKeyboardMarkup? = null
|
||||
) : EditInlineMessage, EditReplyMessage {
|
||||
|
||||
override fun method(): String = editMessageReplyMarkupMethod
|
||||
override fun resultSerializer(): KSerializer<RawMessage> = RawMessage.serializer()
|
||||
}
|
||||
|
@ -3,7 +3,10 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineMessageIdentifier
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
|
||||
import kotlinx.serialization.KSerializer
|
||||
import kotlinx.serialization.internal.BooleanSerializer
|
||||
|
||||
interface EditInlineMessage : SimpleRequest<RawMessage> {
|
||||
interface EditInlineMessage : SimpleRequest<Boolean> {
|
||||
val inlineMessageId: InlineMessageIdentifier
|
||||
override fun resultSerializer(): KSerializer<Boolean> = BooleanSerializer
|
||||
}
|
@ -1,10 +1,8 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
|
||||
|
||||
interface EditTextChatMessage : SimpleRequest<RawMessage> {
|
||||
interface EditTextChatMessage {
|
||||
val text: String
|
||||
val parseMode: ParseMode?
|
||||
}
|
@ -21,7 +21,5 @@ data class EditInlineMessageCaption(
|
||||
@Optional
|
||||
override val replyMarkup: InlineKeyboardMarkup? = null
|
||||
) : EditInlineMessage, EditTextChatMessage, EditReplyMessage {
|
||||
|
||||
override fun method(): String = editMessageCaptionMethod
|
||||
override fun resultSerializer(): KSerializer<RawMessage> = RawMessage.serializer()
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.text
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.media
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.MultipartFile
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.*
|
||||
@ -27,5 +27,4 @@ data class EditInlineMessageMedia(
|
||||
}
|
||||
|
||||
override fun method(): String = editMessageMediaMethod
|
||||
override fun resultSerializer(): KSerializer<RawMessage> = RawMessage.serializer()
|
||||
}
|
||||
|
@ -25,7 +25,5 @@ data class EditInlineMessageText(
|
||||
@Optional
|
||||
override val replyMarkup: InlineKeyboardMarkup? = null
|
||||
) : EditInlineMessage, EditTextChatMessage, EditReplyMessage, EditDisableWebPagePreviewMessage {
|
||||
|
||||
override fun method(): String = editMessageMediaMethod
|
||||
override fun resultSerializer(): KSerializer<RawMessage> = RawMessage.serializer()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user