1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-22 08:13:47 +00:00
This commit is contained in:
InsanusMokrassar 2021-06-30 11:26:31 +06:00
parent 6ba9a31fb9
commit 4f920abb61
5 changed files with 12 additions and 3 deletions

View File

@ -11,6 +11,7 @@
* New extensions `TextSourcesList#make*String` for all parse modes
* All `MessageContent` subclasses now serializable
* `ChosenInlineResult` was replaced and modified to be sealed
* `ChosenInlineResult` now extends `FromUser`
* Added `Update#sourceUser` method
* More types assumed as sent by user types now implements `FromUser` interface
* Added `Any#whenFromUser`, `Any#asFromUser` and`Any#requireFromUser` extensions

View File

@ -1,9 +1,13 @@
package dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult
import dev.inmo.tgbotapi.types.*
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
data class BaseChosenInlineResult(
override val resultId: InlineQueryIdentifier,
@SerialName(fromField)
override val user: User,
override val inlineMessageId: InlineMessageIdentifier?,
override val query: String

View File

@ -1,10 +1,10 @@
package dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult
import dev.inmo.tgbotapi.CommonAbstracts.FromUser
import dev.inmo.tgbotapi.types.*
sealed interface ChosenInlineResult {
sealed interface ChosenInlineResult : FromUser {
val resultId: InlineQueryIdentifier //chosen temporary, can be changed
val user: User
val inlineMessageId: InlineMessageIdentifier?
val query: String
}

View File

@ -2,9 +2,13 @@ package dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.location.StaticLocation
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
data class LocationChosenInlineResult(
override val resultId: InlineQueryIdentifier,
@SerialName(fromField)
override val user: User,
val location: StaticLocation,
override val inlineMessageId: InlineMessageIdentifier?,