1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-22 08:13:47 +00:00

Merge pull request #730 from InsanusMokrassar/6.0.3

6.0.3
This commit is contained in:
InsanusMokrassar 2023-03-02 23:28:16 +06:00 committed by GitHub
commit 6532bf255b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 26 additions and 6 deletions

View File

@ -1,5 +1,15 @@
# TelegramBotAPI changelog
## 6.0.3
* `Versions`:
* `MicroUtils`: `0.17.1` -> `0.17.2`
* `Core`:
* `User` in `CallbackQuery` now is `CommonUser` as well as in `from`
* `User` in `InlineQuery` now is `CommonUser` as well as in `from`
* `BehaviourBuilder`:
* Fixes in `DeepLink` triggers and waiters
## 6.0.2
* `Core`:

View File

@ -6,4 +6,4 @@ kotlin.incremental=true
kotlin.incremental.js=true
library_group=dev.inmo
library_version=6.0.2
library_version=6.0.3

View File

@ -13,7 +13,7 @@ ktor = "2.2.4"
ksp = "1.8.10-1.0.9"
kotlin-poet = "1.12.0"
microutils = "0.17.1"
microutils = "0.17.2"
github-release-plugin = "2.4.1"
dokka = "1.7.20"

View File

@ -38,7 +38,7 @@ suspend fun <BC : BehaviourContext> BC.onDeepLink(
scenarioReceiver,
) {
(it.messageUpdateOrNull()) ?.data ?.commonMessageOrNull() ?.withContentOrNull<TextContent>() ?.let { message ->
message to message.content.textSources[1].source.removePrefix(" ").decodeURLQueryComponent()
message to (message.content.textSources.getOrNull(1) ?.source ?.removePrefix(" ") ?.decodeURLQueryComponent() ?: return@let null)
} ?.let(::listOfNotNull)
}.also {
triggersHolder.handleableCommandsHolder.registerHandleable(startRegex)

View File

@ -3,10 +3,11 @@ package dev.inmo.tgbotapi.types.InlineQueries.query
import dev.inmo.tgbotapi.types.InlineQueryIdentifier
import dev.inmo.tgbotapi.types.chat.User
import dev.inmo.tgbotapi.types.chat.ChatType
import dev.inmo.tgbotapi.types.chat.CommonUser
data class BaseInlineQuery(
override val id: InlineQueryIdentifier,
override val from: User,
override val from: CommonUser,
override val query: String,
override val offset: String,
override val chatType: ChatType?

View File

@ -3,10 +3,16 @@ package dev.inmo.tgbotapi.types.InlineQueries.query
import dev.inmo.tgbotapi.abstracts.FromUser
import dev.inmo.tgbotapi.types.InlineQueryIdentifier
import dev.inmo.tgbotapi.types.chat.ChatType
import dev.inmo.tgbotapi.types.chat.CommonUser
import dev.inmo.tgbotapi.types.chat.User
sealed interface InlineQuery : FromUser {
val id: InlineQueryIdentifier
val query: String
val offset: String
val chatType: ChatType?
override val from: CommonUser
override val user: CommonUser
get() = from
}

View File

@ -3,11 +3,12 @@ package dev.inmo.tgbotapi.types.InlineQueries.query
import dev.inmo.tgbotapi.types.InlineQueryIdentifier
import dev.inmo.tgbotapi.types.chat.User
import dev.inmo.tgbotapi.types.chat.ChatType
import dev.inmo.tgbotapi.types.chat.CommonUser
import dev.inmo.tgbotapi.types.location.Location
data class LocationInlineQuery(
override val id: InlineQueryIdentifier,
override val from: User,
override val from: CommonUser,
override val query: String,
override val offset: String,
override val chatType: ChatType?,

View File

@ -12,7 +12,7 @@ internal data class RawInlineQuery(
@SerialName(idField)
val id: InlineQueryIdentifier,
@SerialName(fromField)
val from: User,
val from: CommonUser,
@SerialName(queryField)
val query: String,
@SerialName(offsetField)

View File

@ -9,6 +9,8 @@ sealed interface CallbackQuery : FromUser {
val id: CallbackQueryIdentifier
val chatInstance: String
override val from: CommonUser
override val user: CommonUser
get() = from
}
data class UnknownCallbackQueryType(