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