diff --git a/CHANGELOG.md b/CHANGELOG.md index 4006c7c608..81c8c33231 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,17 @@ # TelegramBotAPI changelog +## 5.2.1 + +* `Core`: + * All the `CallbackQuery`es now will receive `CommonUser` instead of `User` due inability of bots to trigger any + inline interaction with others bots +* `API`: + * Now `sentMessageFlow` will take each sent message in `handleLiveLocation` + ## 5.2.0 * `Versions`: - * `MicroUtils`: `0.16.8` -> `0.16.10` + * `MicroUtils`: `0.16.8` -> `0.16.10` ## 5.1.1 diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/queries/callback/CallbackQuery.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/queries/callback/CallbackQuery.kt index e59944276d..66a0fb494b 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/queries/callback/CallbackQuery.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/queries/callback/CallbackQuery.kt @@ -2,16 +2,18 @@ package dev.inmo.tgbotapi.types.queries.callback import dev.inmo.tgbotapi.abstracts.FromUser import dev.inmo.tgbotapi.types.CallbackQueryIdentifier +import dev.inmo.tgbotapi.types.chat.CommonUser import dev.inmo.tgbotapi.types.chat.User sealed interface CallbackQuery : FromUser { val id: CallbackQueryIdentifier val chatInstance: String + override val from: CommonUser } data class UnknownCallbackQueryType( override val id: CallbackQueryIdentifier, - override val from: User, + override val from: CommonUser, override val chatInstance: String, val raw: String ) : CallbackQuery diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/queries/callback/InlineMessageIdDataCallbackQuery.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/queries/callback/InlineMessageIdDataCallbackQuery.kt index c448cb36b9..fccd6cd5b8 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/queries/callback/InlineMessageIdDataCallbackQuery.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/queries/callback/InlineMessageIdDataCallbackQuery.kt @@ -1,11 +1,14 @@ package dev.inmo.tgbotapi.types.queries.callback import dev.inmo.tgbotapi.types.* +import dev.inmo.tgbotapi.types.chat.CommonUser import dev.inmo.tgbotapi.types.chat.User +import kotlinx.serialization.Serializable +@Serializable data class InlineMessageIdDataCallbackQuery( override val id: CallbackQueryIdentifier, - override val from: User, + override val from: CommonUser, override val chatInstance: String, override val inlineMessageId: InlineMessageIdentifier, override val data: String diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/queries/callback/InlineMessageIdGameShortNameCallbackQuery.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/queries/callback/InlineMessageIdGameShortNameCallbackQuery.kt index 0d54383a16..b1b9d08381 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/queries/callback/InlineMessageIdGameShortNameCallbackQuery.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/queries/callback/InlineMessageIdGameShortNameCallbackQuery.kt @@ -1,11 +1,12 @@ package dev.inmo.tgbotapi.types.queries.callback import dev.inmo.tgbotapi.types.* +import dev.inmo.tgbotapi.types.chat.CommonUser import dev.inmo.tgbotapi.types.chat.User data class InlineMessageIdGameShortNameCallbackQuery( override val id: CallbackQueryIdentifier, - override val from: User, + override val from: CommonUser, override val chatInstance: String, override val inlineMessageId: InlineMessageIdentifier, override val gameShortName: String diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/queries/callback/MessageDataCallbackQuery.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/queries/callback/MessageDataCallbackQuery.kt index 767c02e671..2a8e5e21e0 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/queries/callback/MessageDataCallbackQuery.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/queries/callback/MessageDataCallbackQuery.kt @@ -1,13 +1,14 @@ package dev.inmo.tgbotapi.types.queries.callback import dev.inmo.tgbotapi.types.CallbackQueryIdentifier +import dev.inmo.tgbotapi.types.chat.CommonUser import dev.inmo.tgbotapi.types.chat.User import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.content.MessageContent data class MessageDataCallbackQuery( override val id: CallbackQueryIdentifier, - override val from: User, + override val from: CommonUser, override val chatInstance: String, override val message: ContentMessage, override val data: String diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/queries/callback/MessageGameShortNameCallbackQuery.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/queries/callback/MessageGameShortNameCallbackQuery.kt index f17b69c416..ae89923be1 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/queries/callback/MessageGameShortNameCallbackQuery.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/queries/callback/MessageGameShortNameCallbackQuery.kt @@ -1,13 +1,14 @@ package dev.inmo.tgbotapi.types.queries.callback import dev.inmo.tgbotapi.types.CallbackQueryIdentifier +import dev.inmo.tgbotapi.types.chat.CommonUser import dev.inmo.tgbotapi.types.chat.User import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.content.MessageContent data class MessageGameShortNameCallbackQuery( override val id: CallbackQueryIdentifier, - override val from: User, + override val from: CommonUser, override val chatInstance: String, override val message: ContentMessage, override val gameShortName: String diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/queries/callback/RawCallbackQuery.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/queries/callback/RawCallbackQuery.kt index 39e77a7340..804a0a54a8 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/queries/callback/RawCallbackQuery.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/queries/callback/RawCallbackQuery.kt @@ -1,6 +1,7 @@ package dev.inmo.tgbotapi.types.queries.callback import dev.inmo.tgbotapi.types.* +import dev.inmo.tgbotapi.types.chat.CommonUser import dev.inmo.tgbotapi.types.chat.User import dev.inmo.tgbotapi.types.message.abstracts.* import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializeOnlySerializer @@ -13,7 +14,7 @@ internal data class RawCallbackQuery( @SerialName(idField) val id: CallbackQueryIdentifier, @SerialName(fromField) - val from: User, + val from: CommonUser, @Serializable(TelegramBotAPIMessageDeserializeOnlySerializer::class) val message: ContentMessage? = null, @SerialName(inlineMessageIdField)