diff --git a/.github/workflows/ci.build.yml b/.github/workflows/ci.build.yml index d55afd7303..6a815f0cc1 100644 --- a/.github/workflows/ci.build.yml +++ b/.github/workflows/ci.build.yml @@ -78,7 +78,7 @@ jobs: run: ./gradlew koverXmlReport - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v5 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: diff --git a/CHANGELOG.md b/CHANGELOG.md index 02596a2292..7a59c01cec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Telegram-bot (KtGram) Changelog +## 7.5.0 + +* Supported Telegram API [8.0](https://core.telegram.org/bots/api-changelog#november-17-2024). +* Extend/add annotations for utility handler mechanisms (guard, rateLimits, argParser), add ability to tag a class to + affect all methods within it. +* Added `autoAnswer` to `@CommandHandler.CallbackQuery`, to answer callback queries automatically before handler. +* Logging has been moved to the ktor logging utility (nothing much has changed, just removed some unnecessary + dependencies). +* `WebApp.initData` check `String` extension function moved to `ktgram-utils` module. + ### 7.4.1 * Fixed KSP processor exception that was caused by new `KotlinPoet` version update. diff --git a/buildSrc/src/main/resources/api.json b/buildSrc/src/main/resources/api.json index cc884293da..66676f9892 100644 --- a/buildSrc/src/main/resources/api.json +++ b/buildSrc/src/main/resources/api.json @@ -1,7 +1,7 @@ { - "version": "Bot API 7.11", - "release_date": "October 31, 2024", - "changelog": "https://core.telegram.org/bots/api#october-31-2024", + "version": "Bot API 8.0", + "release_date": "November 17, 2024", + "changelog": "https://core.telegram.org/bots/api#november-17-2024", "methods": { "getUpdates": { "name": "getUpdates", @@ -2687,6 +2687,42 @@ } ] }, + "setUserEmojiStatus": { + "name": "setUserEmojiStatus", + "href": "https://core.telegram.org/bots/api#setuseremojistatus", + "description": [ + "Changes the emoji status for a given user that previously allowed the bot to manage their emoji status via the Mini App method requestEmojiStatusAccess. Returns True on success." + ], + "returns": [ + "Boolean" + ], + "fields": [ + { + "name": "user_id", + "types": [ + "Integer" + ], + "required": true, + "description": "Unique identifier of the target user" + }, + { + "name": "emoji_status_custom_emoji_id", + "types": [ + "String" + ], + "required": false, + "description": "Custom emoji identifier of the emoji status to set. Pass an empty string to remove the status." + }, + { + "name": "emoji_status_expiration_date", + "types": [ + "Integer" + ], + "required": false, + "description": "Expiration date of the emoji status, if any" + } + ] + }, "getFile": { "name": "getFile", "href": "https://core.telegram.org/bots/api#getfile", @@ -5715,6 +5751,68 @@ } ] }, + "getAvailableGifts": { + "name": "getAvailableGifts", + "href": "https://core.telegram.org/bots/api#getavailablegifts", + "description": [ + "Returns the list of gifts that can be sent by the bot to users. Requires no parameters. Returns a Gifts object." + ], + "returns": [ + "Gifts" + ] + }, + "sendGift": { + "name": "sendGift", + "href": "https://core.telegram.org/bots/api#sendgift", + "description": [ + "Sends a gift to the given user. The gift can't be converted to Telegram Stars by the user. Returns True on success." + ], + "returns": [ + "Boolean" + ], + "fields": [ + { + "name": "user_id", + "types": [ + "Integer" + ], + "required": true, + "description": "Unique identifier of the target user that will receive the gift" + }, + { + "name": "gift_id", + "types": [ + "String" + ], + "required": true, + "description": "Identifier of the gift" + }, + { + "name": "text", + "types": [ + "String" + ], + "required": false, + "description": "Text that will be shown along with the gift; 0-255 characters" + }, + { + "name": "text_parse_mode", + "types": [ + "String" + ], + "required": false, + "description": "Mode for parsing entities in the text. See formatting options for more details. Entities other than \"bold\", \"italic\", \"underline\", \"strikethrough\", \"spoiler\", and \"custom_emoji\" are ignored." + }, + { + "name": "text_entities", + "types": [ + "Array of MessageEntity" + ], + "required": false, + "description": "A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than \"bold\", \"italic\", \"underline\", \"strikethrough\", \"spoiler\", and \"custom_emoji\" are ignored." + } + ] + }, "answerInlineQuery": { "name": "answerInlineQuery", "href": "https://core.telegram.org/bots/api#answerinlinequery", @@ -5804,6 +5902,66 @@ } ] }, + "savePreparedInlineMessage": { + "name": "savePreparedInlineMessage", + "href": "https://core.telegram.org/bots/api#savepreparedinlinemessage", + "description": [ + "Stores a message that can be sent by a user of a Mini App. Returns a PreparedInlineMessage object." + ], + "returns": [ + "PreparedInlineMessage" + ], + "fields": [ + { + "name": "user_id", + "types": [ + "Integer" + ], + "required": true, + "description": "Unique identifier of the target user that can use the prepared message" + }, + { + "name": "result", + "types": [ + "InlineQueryResult" + ], + "required": true, + "description": "A JSON-serialized object describing the message to be sent" + }, + { + "name": "allow_user_chats", + "types": [ + "Boolean" + ], + "required": false, + "description": "Pass True if the message can be sent to private chats with users" + }, + { + "name": "allow_bot_chats", + "types": [ + "Boolean" + ], + "required": false, + "description": "Pass True if the message can be sent to private chats with bots" + }, + { + "name": "allow_group_chats", + "types": [ + "Boolean" + ], + "required": false, + "description": "Pass True if the message can be sent to group and supergroup chats" + }, + { + "name": "allow_channel_chats", + "types": [ + "Boolean" + ], + "required": false, + "description": "Pass True if the message can be sent to channel chats" + } + ] + }, "sendInvoice": { "name": "sendInvoice", "href": "https://core.telegram.org/bots/api#sendinvoice", @@ -6059,6 +6217,14 @@ "String" ], "fields": [ + { + "name": "business_connection_id", + "types": [ + "String" + ], + "required": false, + "description": "Unique identifier of the business connection on behalf of which the link will be created" + }, { "name": "title", "types": [ @@ -6107,6 +6273,14 @@ "required": true, "description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars." }, + { + "name": "subscription_period", + "types": [ + "Integer" + ], + "required": false, + "description": "The number of seconds the subscription will be active for before the next payment. The currency must be set to \"XTR\" (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified." + }, { "name": "max_tip_amount", "types": [ @@ -6357,6 +6531,42 @@ } ] }, + "editUserStarSubscription": { + "name": "editUserStarSubscription", + "href": "https://core.telegram.org/bots/api#edituserstarsubscription", + "description": [ + "Allows the bot to cancel or re-enable extension of a subscription paid in Telegram Stars. Returns True on success." + ], + "returns": [ + "Boolean" + ], + "fields": [ + { + "name": "user_id", + "types": [ + "Integer" + ], + "required": true, + "description": "Identifier of the user whose subscription will be edited" + }, + { + "name": "telegram_payment_charge_id", + "types": [ + "String" + ], + "required": true, + "description": "Telegram payment identifier for the subscription" + }, + { + "name": "is_canceled", + "types": [ + "Boolean" + ], + "required": true, + "description": "Pass True to cancel extension of the user subscription; the subscription must be active up to the end of the current subscription period. Pass False to allow the user to re-enable a subscription that was previously canceled by the bot." + } + ] + }, "setPassportDataErrors": { "name": "setPassportDataErrors", "href": "https://core.telegram.org/bots/api#setpassportdataerrors", @@ -14512,6 +14722,72 @@ } ] }, + "Gift": { + "name": "Gift", + "href": "https://core.telegram.org/bots/api#gift", + "description": [ + "This object represents a gift that can be sent by the bot." + ], + "fields": [ + { + "name": "id", + "types": [ + "String" + ], + "required": true, + "description": "Unique identifier of the gift" + }, + { + "name": "sticker", + "types": [ + "Sticker" + ], + "required": true, + "description": "The sticker that represents the gift" + }, + { + "name": "star_count", + "types": [ + "Integer" + ], + "required": true, + "description": "The number of Telegram Stars that must be paid to send the sticker" + }, + { + "name": "total_count", + "types": [ + "Integer" + ], + "required": false, + "description": "Optional. The total number of the gifts of this type that can be sent; for limited gifts only" + }, + { + "name": "remaining_count", + "types": [ + "Integer" + ], + "required": false, + "description": "Optional. The number of remaining gifts of this type that can be sent; for limited gifts only" + } + ] + }, + "Gifts": { + "name": "Gifts", + "href": "https://core.telegram.org/bots/api#gifts", + "description": [ + "This object represent a list of gifts." + ], + "fields": [ + { + "name": "gifts", + "types": [ + "Array of Gift" + ], + "required": true, + "description": "The list of gifts" + } + ] + }, "InlineQuery": { "name": "InlineQuery", "href": "https://core.telegram.org/bots/api#inlinequery", @@ -17166,6 +17442,31 @@ } ] }, + "PreparedInlineMessage": { + "name": "PreparedInlineMessage", + "href": "https://core.telegram.org/bots/api#preparedinlinemessage", + "description": [ + "Describes an inline message to be sent by a user of a Mini App." + ], + "fields": [ + { + "name": "id", + "types": [ + "String" + ], + "required": true, + "description": "Unique identifier of the prepared message" + }, + { + "name": "expiration_date", + "types": [ + "Integer" + ], + "required": true, + "description": "Expiration date of the prepared message, in Unix time. Expired prepared messages can no longer be used" + } + ] + }, "LabeledPrice": { "name": "LabeledPrice", "href": "https://core.telegram.org/bots/api#labeledprice", @@ -17402,6 +17703,30 @@ "required": true, "description": "Bot-specified invoice payload" }, + { + "name": "subscription_expiration_date", + "types": [ + "Integer" + ], + "required": false, + "description": "Optional. Expiration date of the subscription, in Unix time; for recurring payments only" + }, + { + "name": "is_recurring", + "types": [ + "Boolean" + ], + "required": false, + "description": "Optional. True, if the payment is a recurring payment for a subscription" + }, + { + "name": "is_first_recurring", + "types": [ + "Boolean" + ], + "required": false, + "description": "Optional. True, if the payment is the first payment for a subscription" + }, { "name": "shipping_option_id", "types": [ @@ -17757,6 +18082,14 @@ "required": false, "description": "Optional. Bot-specified invoice payload" }, + { + "name": "subscription_period", + "types": [ + "Integer" + ], + "required": false, + "description": "Optional. The duration of the paid subscription" + }, { "name": "paid_media", "types": [ @@ -17772,6 +18105,14 @@ ], "required": false, "description": "Optional. Bot-specified paid media payload" + }, + { + "name": "gift", + "types": [ + "String" + ], + "required": false, + "description": "Optional. The gift sent to the user by the bot" } ], "subtype_of": [ diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index adbdc66508..d8be648d12 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,7 +1,6 @@ [versions] ktor = "3.0.1" redis = "0.1.7" -logging = "2.0.4" logback = "1.5.12" datetime = "0.6.0" @@ -11,7 +10,7 @@ stately = "2.1.0" kotlin = "2.0.21" coroutines = "1.9.0" dokka = "1.9.20" -kotlinter = "4.4.1" +kotlinter = "4.5.0" deteKT = "1.23.7" toml = "0.4.0" @@ -19,11 +18,12 @@ kotest = "5.9.1" mockk = "1.13.13" kover = "0.8.3" krypto = "4.0.10" +urlencoder = "1.6.0" sslcontext = "8.3.7" spring = "3.3.5" -ksp = "2.0.21-1.0.26" -poet = "1.18.1" +ksp = "2.0.21-1.0.28" +poet = "2.0.0" binvalid = "0.16.3" publisher = "0.30.0" @@ -42,15 +42,15 @@ ktor-client-js = { module = "io.ktor:ktor-client-js", version.ref = "ktor" } ktor-server-core = { module = "io.ktor:ktor-server-core", version.ref = "ktor" } ktor-server-netty = { module = "io.ktor:ktor-server-netty", version.ref = "ktor" } -# logging -logging = { module = "co.touchlab:kermit", version.ref = "logging" } logback = { module = "ch.qos.logback:logback-classic", version.ref = "logback" } kotlin-serialization = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "serialization" } kotlin-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "datetime" } kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" } stately = { module = "co.touchlab:stately-concurrent-collections", version.ref = "stately" } + krypto = { module = "com.soywiz.korlibs.krypto:krypto", version.ref = "krypto" } +urlencoder = { module = "net.thauvin.erik.urlencoder:urlencoder-lib", version.ref = "urlencoder" } # test test-kotest-junit5 = { module = "io.kotest:kotest-runner-junit5", version.ref = "kotest" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index df97d72b8b..94113f200e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/helper/src/jvmMain/kotlin/eu/vendeli/ksp/ApiProcessor.kt b/helper/src/jvmMain/kotlin/eu/vendeli/ksp/ApiProcessor.kt index 8a53d26356..a4fd464de5 100644 --- a/helper/src/jvmMain/kotlin/eu/vendeli/ksp/ApiProcessor.kt +++ b/helper/src/jvmMain/kotlin/eu/vendeli/ksp/ApiProcessor.kt @@ -86,10 +86,12 @@ class ApiProcessor( val parameters = declaration.parameters.mapIndexed { _, it -> val isFunType = it.type.resolve().isFunctionType when { - isFunType -> ParameterSpec(it.name!!.getShortName(), it.type.toTypeName(), KModifier.NOINLINE) - it.isVararg -> ParameterSpec(it.name!!.getShortName(), it.type.toTypeName(), KModifier.VARARG) - else -> ParameterSpec(it.name!!.getShortName(), it.type.toTypeName()) - } + isFunType -> ParameterSpec.builder(it.name!!.getShortName(), it.type.toTypeName(), KModifier.NOINLINE) + it.isVararg -> ParameterSpec.builder(it.name!!.getShortName(), it.type.toTypeName(), KModifier.VARARG) + else -> ParameterSpec.builder(it.name!!.getShortName(), it.type.toTypeName()) + }.apply { + if (it.type.resolve().isMarkedNullable) defaultValue("null") + }.build() } val parametersInlined = parameters.joinToString { (if (KModifier.VARARG in it.modifiers) "${it.name} = " else "") + it.name diff --git a/helper/src/jvmMain/kotlin/eu/vendeli/ksp/ApiValidator.kt b/helper/src/jvmMain/kotlin/eu/vendeli/ksp/ApiValidator.kt index 3dd2d2a52b..574bf7b80e 100644 --- a/helper/src/jvmMain/kotlin/eu/vendeli/ksp/ApiValidator.kt +++ b/helper/src/jvmMain/kotlin/eu/vendeli/ksp/ApiValidator.kt @@ -65,10 +65,10 @@ internal fun ApiProcessor.validateApi(classes: Sequence, api ?.let { parameters.putAll(it) } // add parameters that represented in features/etc - cls.superTypes.forEach { + cls.superTypes.forEach { type -> + val sType = type.resolve() when ( - it - .resolve() + sType .declaration.qualifiedName!! .asString() ) { @@ -77,7 +77,17 @@ internal fun ApiProcessor.validateApi(classes: Sequence, api parameters["captionEntities"] = entitiesType } - EntitiesFeature::class.fqName -> parameters["entities"] = entitiesType + EntitiesFeature::class.fqName -> { + val paramName = sType.annotations + .firstOrNull { + it.shortName.getShortName() == "Name" + }?.arguments + ?.first() + ?.value + ?.safeCast() ?: "entities" + parameters[paramName] = entitiesType + } + MarkupFeature::class.fqName -> parameters["replyMarkup"] = replyMarkupType BusinessActionExt::class.fqName -> parameters["businessConnectionId"] = STRING InlineActionExt::class.fqName -> parameters["inlineMessageId"] = STRING diff --git a/helper/src/jvmMain/kotlin/eu/vendeli/ksp/Utils.kt b/helper/src/jvmMain/kotlin/eu/vendeli/ksp/Utils.kt index 6ab46125e1..7eea0a9d47 100644 --- a/helper/src/jvmMain/kotlin/eu/vendeli/ksp/Utils.kt +++ b/helper/src/jvmMain/kotlin/eu/vendeli/ksp/Utils.kt @@ -16,6 +16,9 @@ import java.io.FileFilter internal val replyMarkupType = Keyboard::class.asTypeName() internal val entitiesType = LIST.parameterizedBy(MessageEntity::class.asTypeName()) +@Suppress("UNCHECKED_CAST", "NOTHING_TO_INLINE") +internal inline fun Any?.safeCast(): R? = this as? R + internal inline fun KSPLogger.invalid(message: () -> String) = exception(IllegalStateException(message())) internal fun String.beginWithUpperCase(): String = when (this.length) { diff --git a/ksp/src/jvmMain/kotlin/eu/vendeli/ksp/ActivityCollectors.kt b/ksp/src/jvmMain/kotlin/eu/vendeli/ksp/ActivityCollectors.kt index 006455de54..f713876417 100644 --- a/ksp/src/jvmMain/kotlin/eu/vendeli/ksp/ActivityCollectors.kt +++ b/ksp/src/jvmMain/kotlin/eu/vendeli/ksp/ActivityCollectors.kt @@ -12,11 +12,15 @@ import com.squareup.kotlinpoet.TypeVariableName import com.squareup.kotlinpoet.asTypeName import com.squareup.kotlinpoet.buildCodeBlock import eu.vendeli.ksp.dto.CollectorsContext +import eu.vendeli.ksp.dto.CommandHandlerParams.CallbackQueryAutoAnswer import eu.vendeli.ksp.dto.CommonAnnotationData import eu.vendeli.ksp.utils.addMap import eu.vendeli.ksp.utils.buildMeta import eu.vendeli.ksp.utils.commonMatcherClass import eu.vendeli.ksp.utils.invocableType +import eu.vendeli.ksp.utils.parseAnnotatedArgParser +import eu.vendeli.ksp.utils.parseAnnotatedGuard +import eu.vendeli.ksp.utils.parseAnnotatedRateLimits import eu.vendeli.ksp.utils.parseAsCommandHandler import eu.vendeli.ksp.utils.parseAsInputHandler import eu.vendeli.ksp.utils.parseAsUpdateHandler @@ -56,6 +60,12 @@ internal fun collectCommandActivities( }.arguments .parseAsCommandHandler(isCallbackQAnnotation) + // priority while looking for util annotations: function > class > handler param + val guardAnnotationData = function.parseAnnotatedGuard() + val rateLimitsAnnotationData = function.parseAnnotatedRateLimits() + val argParserAnnotationData = function.parseAnnotatedArgParser() + val params = if (annotationData.isAutoAnswer) listOf(CallbackQueryAutoAnswer) else emptyList() + annotationData.value.forEach { annotationData.scope.forEach { updT -> logger.info("Command: $it UpdateType: ${updT.name} --> ${function.qualifiedName?.asString()}") @@ -70,10 +80,11 @@ internal fun collectCommandActivities( buildMeta( qualifier = function.qualifiedName!!.getQualifier(), function = function.simpleName.asString(), - rateLimits = annotationData.rateLimits.toRateLimits(), - guardClass = annotationData.guardClass, - argParserClass = annotationData.argParserClass, + rateLimits = rateLimitsAnnotationData ?: annotationData.rateLimits.toRateLimits(), + guardClass = guardAnnotationData ?: annotationData.guardClass, + argParserClass = argParserAnnotationData ?: annotationData.argParserClass, ), + params, ), ) } @@ -100,6 +111,11 @@ internal fun collectInputActivities( it.shortName.asString() == InputHandler::class.simpleName!! }.arguments .parseAsInputHandler() + + // priority while looking for util annotations: function > class > handler param + val guardAnnotationData = function.parseAnnotatedGuard() + val rateLimitsAnnotationData = function.parseAnnotatedRateLimits() + annotationData.first.forEach { logger.info("Input: $it --> ${function.qualifiedName?.asString()}") @@ -112,8 +128,8 @@ internal fun collectInputActivities( buildMeta( qualifier = function.qualifiedName!!.getQualifier(), function = function.simpleName.asString(), - rateLimits = annotationData.second.toRateLimits(), - guardClass = annotationData.third, + rateLimits = rateLimitsAnnotationData ?: annotationData.second.toRateLimits(), + guardClass = guardAnnotationData ?: annotationData.third, argParserClass = null, ), ), @@ -166,19 +182,28 @@ internal fun collectCommonActivities( .builder() .apply { add("mapOf(\n") - data.forEach { + data.forEach { commonAnnotationData -> + // priority while looking for util annotations: function > class > handler param + val rateLimitsAnnotationData = + commonAnnotationData.funDeclaration.parseAnnotatedRateLimits() + val argParserAnnotationData = + commonAnnotationData.funDeclaration.parseAnnotatedArgParser() + addStatement( "%L to %L,", - it.value.toCommonMatcher(it.filter, it.scope), + commonAnnotationData.value.toCommonMatcher( + commonAnnotationData.filter, + commonAnnotationData.scope, + ), activitiesFile.buildInvocationLambdaCodeBlock( - it.funDeclaration, + commonAnnotationData.funDeclaration, injectableTypes, pkg, buildMeta( - qualifier = it.funQualifier, - function = it.funSimpleName, - rateLimits = it.rateLimits, - argParserClass = it.argParser, + qualifier = commonAnnotationData.funQualifier, + function = commonAnnotationData.funSimpleName, + rateLimits = rateLimitsAnnotationData ?: commonAnnotationData.rateLimits, + argParserClass = argParserAnnotationData ?: commonAnnotationData.argParser, guardClass = null, ), ), diff --git a/ksp/src/jvmMain/kotlin/eu/vendeli/ksp/ActivityProcessor.kt b/ksp/src/jvmMain/kotlin/eu/vendeli/ksp/ActivityProcessor.kt index fc4c5fb319..e3e11b5b54 100644 --- a/ksp/src/jvmMain/kotlin/eu/vendeli/ksp/ActivityProcessor.kt +++ b/ksp/src/jvmMain/kotlin/eu/vendeli/ksp/ActivityProcessor.kt @@ -24,7 +24,7 @@ import eu.vendeli.ksp.dto.CollectorsContext import eu.vendeli.ksp.utils.CommonAnnotationHandler import eu.vendeli.ksp.utils.FileBuilder import eu.vendeli.ksp.utils.activitiesType -import eu.vendeli.ksp.utils.autoWiringClassName +import eu.vendeli.ksp.utils.autowiringFQName import eu.vendeli.ksp.utils.getAnnotatedClassSymbols import eu.vendeli.ksp.utils.getAnnotatedFnSymbols import eu.vendeli.tgbot.annotations.CommandHandler @@ -130,8 +130,9 @@ class ActivityProcessor( val injectableTypes = resolver.getAnnotatedClassSymbols(Injectable::class, pkg).associate { c -> c .getAllSuperTypes() - .first { it.toClassName() == autoWiringClassName } - .arguments + .first { + it.declaration.qualifiedName!!.asString() == autowiringFQName + }.arguments .first() .toTypeName() to c.toClassName() diff --git a/ksp/src/jvmMain/kotlin/eu/vendeli/ksp/InvocationLambdaBuilder.kt b/ksp/src/jvmMain/kotlin/eu/vendeli/ksp/InvocationLambdaBuilder.kt index e0f1fc76a8..60417c21fe 100644 --- a/ksp/src/jvmMain/kotlin/eu/vendeli/ksp/InvocationLambdaBuilder.kt +++ b/ksp/src/jvmMain/kotlin/eu/vendeli/ksp/InvocationLambdaBuilder.kt @@ -14,6 +14,8 @@ import com.squareup.kotlinpoet.STRING import com.squareup.kotlinpoet.TypeName import com.squareup.kotlinpoet.buildCodeBlock import com.squareup.kotlinpoet.ksp.toTypeName +import eu.vendeli.ksp.dto.CommandHandlerParams +import eu.vendeli.ksp.dto.LambdaParameters import eu.vendeli.ksp.utils.FileBuilder import eu.vendeli.ksp.utils.botClass import eu.vendeli.ksp.utils.businessConnectionUpdateClass @@ -78,6 +80,7 @@ internal fun FileBuilder.buildInvocationLambdaCodeBlock( injectableTypes: Map, pkg: String? = null, meta: Pair>? = null, + parameters: List = emptyList(), ) = buildCodeBlock { val isTopLvl = function.functionKind == FunctionKind.TOP_LEVEL val funQualifier = function.qualifiedName!!.getQualifier() @@ -102,8 +105,7 @@ internal fun FileBuilder.buildInvocationLambdaCodeBlock( if (!isTopLvl && !isObject && function.functionKind != FunctionKind.STATIC) { parametersEnumeration = "inst, " add( - "val inst = classManager.getInstance(%L::class) as %L\n", - funQualifier, + "val inst = classManager.getInstance<%L>()!!\n", funQualifier, ) } @@ -181,6 +183,13 @@ internal fun FileBuilder.buildInvocationLambdaCodeBlock( funQualifier, pkg, ) + + if (parameters.contains(CommandHandlerParams.CallbackQueryAutoAnswer)) { + addImport("eu.vendeli.tgbot.api.answer", "answerCallbackQuery") + addImport("eu.vendeli.tgbot.types.internal", "CallbackQueryUpdate", "getUser") + add("answerCallbackQuery((update as CallbackQueryUpdate).callbackQuery.id).send(update.getUser(), bot)") + } + add("\n%L.invoke(\n\t%L\n)\n", funName, parametersEnumeration) }.endControlFlow() .build() diff --git a/ksp/src/jvmMain/kotlin/eu/vendeli/ksp/dto/AnnotationData.kt b/ksp/src/jvmMain/kotlin/eu/vendeli/ksp/dto/AnnotationData.kt index 4f0f22a1e1..e3c3b0fa95 100644 --- a/ksp/src/jvmMain/kotlin/eu/vendeli/ksp/dto/AnnotationData.kt +++ b/ksp/src/jvmMain/kotlin/eu/vendeli/ksp/dto/AnnotationData.kt @@ -8,4 +8,5 @@ internal data class AnnotationData( val scope: List, val guardClass: String, val argParserClass: String, + val isAutoAnswer: Boolean, ) diff --git a/ksp/src/jvmMain/kotlin/eu/vendeli/ksp/dto/CommonAnnotationData.kt b/ksp/src/jvmMain/kotlin/eu/vendeli/ksp/dto/CommonAnnotationData.kt index 6ce7caddf5..f28822bebc 100644 --- a/ksp/src/jvmMain/kotlin/eu/vendeli/ksp/dto/CommonAnnotationData.kt +++ b/ksp/src/jvmMain/kotlin/eu/vendeli/ksp/dto/CommonAnnotationData.kt @@ -1,8 +1,11 @@ package eu.vendeli.ksp.dto import com.google.devtools.ksp.symbol.KSFunctionDeclaration +import eu.vendeli.ksp.utils.messageList +import eu.vendeli.tgbot.implementations.DefaultFilter import eu.vendeli.tgbot.types.internal.UpdateType import eu.vendeli.tgbot.types.internal.configuration.RateLimits +import eu.vendeli.tgbot.utils.fqName sealed class CommonAnnotationValue { abstract val value: Any @@ -14,12 +17,18 @@ sealed class CommonAnnotationValue { override val value: kotlin.text.Regex, ) : CommonAnnotationValue() - internal fun toCommonMatcher(filter: kotlin.String, scope: List) = when (this) { - is String -> "CommonMatcher.String(value = \"$value\", filter = $filter::class, setOf(${scope.joinToString()}))" - is Regex -> - "CommonMatcher.Regex(value = Regex(\"$value\"${ - value.options.takeIf { it.isNotEmpty() }?.joinToString(prefix = " ,") { "RegexOption.$it" } ?: "" - }), filter = $filter::class, setOf(${scope.joinToString()}))" + internal fun toCommonMatcher(filter: kotlin.String, scope: List): kotlin.String { + val parametersString = buildString { + if (filter != DefaultFilter::class.fqName) append(", filter = $filter::class") + if (scope != messageList) append(", scope = setOf(${scope.joinToString()})") + } + return when (this) { + is String -> "CommonMatcher.String(value = \"$value\"$parametersString)" + is Regex -> + "CommonMatcher.Regex(value = Regex(\"$value\"${ + value.options.takeIf { it.isNotEmpty() }?.joinToString(prefix = " ,") { "RegexOption.$it" } ?: "" + })$parametersString)" + } } } diff --git a/ksp/src/jvmMain/kotlin/eu/vendeli/ksp/dto/LambdaParameters.kt b/ksp/src/jvmMain/kotlin/eu/vendeli/ksp/dto/LambdaParameters.kt new file mode 100644 index 0000000000..3dc3d88315 --- /dev/null +++ b/ksp/src/jvmMain/kotlin/eu/vendeli/ksp/dto/LambdaParameters.kt @@ -0,0 +1,7 @@ +package eu.vendeli.ksp.dto + +sealed class LambdaParameters + +sealed class CommandHandlerParams : LambdaParameters() { + data object CallbackQueryAutoAnswer : CommandHandlerParams() +} diff --git a/ksp/src/jvmMain/kotlin/eu/vendeli/ksp/utils/HelperUtils.kt b/ksp/src/jvmMain/kotlin/eu/vendeli/ksp/utils/HelperUtils.kt index b5c0eab500..360705ee2b 100644 --- a/ksp/src/jvmMain/kotlin/eu/vendeli/ksp/utils/HelperUtils.kt +++ b/ksp/src/jvmMain/kotlin/eu/vendeli/ksp/utils/HelperUtils.kt @@ -15,7 +15,6 @@ import com.squareup.kotlinpoet.PropertySpec import com.squareup.kotlinpoet.STRING import com.squareup.kotlinpoet.TypeName import com.squareup.kotlinpoet.TypeVariableName -import com.squareup.kotlinpoet.asClassName import com.squareup.kotlinpoet.asTypeName import eu.vendeli.tgbot.TelegramBot import eu.vendeli.tgbot.implementations.ClassDataImpl @@ -67,7 +66,7 @@ internal val activitiesType = Map::class.asTypeName().parameterizedBy( ) internal val invocableType = TypeVariableName("Invocable") internal val linkQName = Link::class.fqName -internal val autoWiringClassName = Autowiring::class.asClassName() +internal val autowiringFQName = Autowiring::class.fqName internal val intPrimitiveType = TypeVariableName("int") internal val longPrimitiveType = TypeVariableName("long") diff --git a/ksp/src/jvmMain/kotlin/eu/vendeli/ksp/utils/ParseUtils.kt b/ksp/src/jvmMain/kotlin/eu/vendeli/ksp/utils/ParseUtils.kt index 6ca285e781..2e09d0ee9d 100644 --- a/ksp/src/jvmMain/kotlin/eu/vendeli/ksp/utils/ParseUtils.kt +++ b/ksp/src/jvmMain/kotlin/eu/vendeli/ksp/utils/ParseUtils.kt @@ -1,5 +1,6 @@ package eu.vendeli.ksp.utils +import com.google.devtools.ksp.closestClassDeclaration import com.google.devtools.ksp.symbol.KSAnnotation import com.google.devtools.ksp.symbol.KSClassDeclaration import com.google.devtools.ksp.symbol.KSFunctionDeclaration @@ -8,6 +9,8 @@ import com.google.devtools.ksp.symbol.KSValueArgument import eu.vendeli.ksp.dto.AnnotationData import eu.vendeli.ksp.dto.CommonAnnotationData import eu.vendeli.ksp.dto.CommonAnnotationValue +import eu.vendeli.tgbot.annotations.ArgParser +import eu.vendeli.tgbot.annotations.Guard import eu.vendeli.tgbot.implementations.DefaultArgParser import eu.vendeli.tgbot.implementations.DefaultFilter import eu.vendeli.tgbot.implementations.DefaultGuard @@ -20,6 +23,7 @@ internal fun List.parseAsCommandHandler(isCallbackQ: Boolean) = scope = parseScopes() ?: if (isCallbackQ) callbackQueryList else messageList, guardClass = parseGuard(), argParserClass = parseArgParser(), + isAutoAnswer = firstOrNull { it.name?.asString() == "autoAnswer" }?.value?.safeCast() ?: false, ) internal fun List.parseAsInputHandler() = Triple( @@ -85,6 +89,42 @@ object CommonAnnotationHandler { } } +internal fun KSFunctionDeclaration.parseAnnotatedGuard(): String? = annotations + .firstOrNull { + it.shortName.asString() == Guard::class.simpleName!! + }?.arguments + ?.parseGuard() + ?: closestClassDeclaration() + ?.annotations + ?.firstOrNull { + it.shortName.asString() == Guard::class.simpleName!! + }?.arguments + ?.parseGuard() + +internal fun KSFunctionDeclaration.parseAnnotatedRateLimits(): RateLimits? = annotations + .firstOrNull { + it.shortName.asString() == eu.vendeli.tgbot.annotations.RateLimits::class.simpleName!! + }?.arguments + ?.parseRateLimitsAnnotation() + ?: closestClassDeclaration() + ?.annotations + ?.firstOrNull { + it.shortName.asString() == eu.vendeli.tgbot.annotations.RateLimits::class.simpleName!! + }?.arguments + ?.parseRateLimitsAnnotation() + +internal fun KSFunctionDeclaration.parseAnnotatedArgParser(): String? = annotations + .firstOrNull { + it.shortName.asString() == ArgParser::class.simpleName!! + }?.arguments + ?.parseArgParser() + ?: closestClassDeclaration() + ?.annotations + ?.firstOrNull { + it.shortName.asString() == ArgParser::class.simpleName!! + }?.arguments + ?.parseArgParser() + /* argument parsers: */ @@ -131,6 +171,9 @@ internal fun List.parseAsUpdateHandler() = first().value.cast.parseRateLimitsAnnotation(): RateLimits = + ((firstOrNull()?.value?.safeCast() ?: 0) to (lastOrNull()?.value?.safeCast() ?: 0)).toRateLimits() + internal fun List.parseRateLimits(): Pair = firstOrNull { it.name?.asString() == "rateLimits" }?.value?.safeCast()?.arguments?.let { diff --git a/ktgram-utils/build.gradle.kts b/ktgram-utils/build.gradle.kts index a0f6b38072..59b819f252 100644 --- a/ktgram-utils/build.gradle.kts +++ b/ktgram-utils/build.gradle.kts @@ -6,6 +6,8 @@ configuredKotlin { sourceSets { commonMain.dependencies { implementation(project(":telegram-bot")) + implementation(libs.urlencoder) + implementation(libs.krypto) } } } diff --git a/ktgram-utils/src/commonMain/kotlin/eu/vendeli/ktgram/extutils/TelegramBotSc.kt b/ktgram-utils/src/commonMain/kotlin/eu/vendeli/ktgram/extutils/TelegramBotSc.kt index d02d22dd05..32a30e67d3 100644 --- a/ktgram-utils/src/commonMain/kotlin/eu/vendeli/ktgram/extutils/TelegramBotSc.kt +++ b/ktgram-utils/src/commonMain/kotlin/eu/vendeli/ktgram/extutils/TelegramBotSc.kt @@ -28,6 +28,8 @@ import eu.vendeli.tgbot.api.botactions.CloseAction import eu.vendeli.tgbot.api.botactions.CreateInvoiceLinkAction import eu.vendeli.tgbot.api.botactions.DeleteMyCommandsAction import eu.vendeli.tgbot.api.botactions.DeleteWebhookAction +import eu.vendeli.tgbot.api.botactions.EditUserStarSubscriptionAction +import eu.vendeli.tgbot.api.botactions.GetAvailableGiftsAction import eu.vendeli.tgbot.api.botactions.GetBusinessConnectionAction import eu.vendeli.tgbot.api.botactions.GetMeAction import eu.vendeli.tgbot.api.botactions.GetMyCommandsAction @@ -40,11 +42,14 @@ import eu.vendeli.tgbot.api.botactions.GetUpdatesAction import eu.vendeli.tgbot.api.botactions.GetWebhookInfoAction import eu.vendeli.tgbot.api.botactions.LogOutAction import eu.vendeli.tgbot.api.botactions.RefundStarPaymentAction +import eu.vendeli.tgbot.api.botactions.SavePreparedInlineMessageAction +import eu.vendeli.tgbot.api.botactions.SendGiftAction import eu.vendeli.tgbot.api.botactions.SetMyCommandsAction import eu.vendeli.tgbot.api.botactions.SetMyDefaultAdministratorRightsAction import eu.vendeli.tgbot.api.botactions.SetMyDescriptionAction import eu.vendeli.tgbot.api.botactions.SetMyNameAction import eu.vendeli.tgbot.api.botactions.SetMyShortDescriptionAction +import eu.vendeli.tgbot.api.botactions.SetUserEmojiStatusAction import eu.vendeli.tgbot.api.botactions.SetWebhookAction import eu.vendeli.tgbot.api.chat.ApproveChatJoinRequestAction import eu.vendeli.tgbot.api.chat.BanChatMemberAction @@ -129,6 +134,7 @@ import eu.vendeli.tgbot.api.stickerset.SetStickerPositionInSetAction import eu.vendeli.tgbot.api.stickerset.SetStickerSetThumbnailAction import eu.vendeli.tgbot.api.stickerset.SetStickerSetTitleAction import eu.vendeli.tgbot.api.stickerset.UploadStickerFileAction +import eu.vendeli.tgbot.types.ParseMode import eu.vendeli.tgbot.types.ReactionType import eu.vendeli.tgbot.types.User import eu.vendeli.tgbot.types.`inline`.InlineQueryResult @@ -176,10 +182,10 @@ public inline fun TelegramBot.contact(firstName: String, phoneNumber: String): S public inline fun TelegramBot.sendContact(firstName: String, phoneNumber: String): SendContactAction = eu.vendeli.tgbot.api.sendContact(firstName, phoneNumber) @Suppress("NOTHING_TO_INLINE") -public inline fun TelegramBot.sendDice(emoji: String?): SendDiceAction = eu.vendeli.tgbot.api.sendDice(emoji) +public inline fun TelegramBot.sendDice(emoji: String? = null): SendDiceAction = eu.vendeli.tgbot.api.sendDice(emoji) @Suppress("NOTHING_TO_INLINE") -public inline fun TelegramBot.dice(emoji: String?): SendDiceAction = eu.vendeli.tgbot.api.dice(emoji) +public inline fun TelegramBot.dice(emoji: String? = null): SendDiceAction = eu.vendeli.tgbot.api.dice(emoji) @Suppress("NOTHING_TO_INLINE") public inline fun TelegramBot.sendGame(gameShortName: String): SendGameAction = eu.vendeli.tgbot.api.sendGame(gameShortName) @@ -211,15 +217,15 @@ public inline fun TelegramBot.getUserChatBoosts(user: User): GetUserChatBoostsAc @Suppress("NOTHING_TO_INLINE") public inline fun TelegramBot.getUserProfilePhotos( userId: Long, - offset: Int?, - limit: Int?, + offset: Int? = null, + limit: Int? = null, ): GetUserProfilePhotosAction = eu.vendeli.tgbot.api.getUserProfilePhotos(userId, offset, limit) @Suppress("NOTHING_TO_INLINE") public inline fun TelegramBot.getUserProfilePhotos( user: User, - offset: Int?, - limit: Int?, + offset: Int? = null, + limit: Int? = null, ): GetUserProfilePhotosAction = eu.vendeli.tgbot.api.getUserProfilePhotos(user, offset, limit) @Suppress("NOTHING_TO_INLINE") @@ -227,7 +233,7 @@ public inline fun TelegramBot.invoice( title: String, description: String, payload: String, - providerToken: String?, + providerToken: String? = null, currency: Currency, prices: List, ): SendInvoiceAction = eu.vendeli.tgbot.api.invoice(title, description, payload, providerToken, currency, prices) @@ -236,7 +242,7 @@ public inline fun TelegramBot.invoice( public inline fun TelegramBot.invoice( title: String, description: String, - providerToken: String?, + providerToken: String? = null, currency: Currency, vararg prices: LabeledPrice, noinline payload: () -> String, @@ -247,7 +253,7 @@ public inline fun TelegramBot.sendInvoice( title: String, description: String, payload: String, - providerToken: String?, + providerToken: String? = null, currency: Currency, prices: List, ): SendInvoiceAction = eu.vendeli.tgbot.api.sendInvoice(title, description, payload, providerToken, currency, prices) @@ -293,21 +299,21 @@ public inline fun TelegramBot.setGameScore( @Suppress("NOTHING_TO_INLINE") public inline fun TelegramBot.setMessageReaction( messageId: Long, - reaction: List?, - isBig: Boolean?, + reaction: List? = null, + isBig: Boolean? = null, ): SetMessageReactionAction = eu.vendeli.tgbot.api.setMessageReaction(messageId, reaction, isBig) @Suppress("NOTHING_TO_INLINE") public inline fun TelegramBot.setMessageReaction( messageId: Long, vararg reaction: ReactionType, - isBig: Boolean?, + isBig: Boolean? = null, ): SetMessageReactionAction = eu.vendeli.tgbot.api.setMessageReaction(messageId, reaction = reaction, isBig) @Suppress("NOTHING_TO_INLINE") public inline fun TelegramBot.setMessageReaction( messageId: Long, - isBig: Boolean?, + isBig: Boolean? = null, noinline reaction: ListingBuilder.() -> Unit, ): SetMessageReactionAction = eu.vendeli.tgbot.api.setMessageReaction(messageId, isBig, reaction) @@ -361,22 +367,22 @@ public inline fun TelegramBot.answerInlineQuery(inlineQueryId: String, vararg re public inline fun TelegramBot.answerPreCheckoutQuery( preCheckoutQueryId: String, ok: Boolean, - errorMessage: String?, + errorMessage: String? = null, ): AnswerPreCheckoutQueryAction = eu.vendeli.tgbot.api.answer.answerPreCheckoutQuery(preCheckoutQueryId, ok, errorMessage) @Suppress("NOTHING_TO_INLINE") public inline fun TelegramBot.answerShippingQuery( shippingQueryId: String, ok: Boolean, - shippingOptions: List?, - errorMessage: String?, + shippingOptions: List? = null, + errorMessage: String? = null, ): AnswerShippingQueryAction = eu.vendeli.tgbot.api.answer.answerShippingQuery(shippingQueryId, ok, shippingOptions, errorMessage) @Suppress("NOTHING_TO_INLINE") public inline fun TelegramBot.answerShippingQuery( shippingQueryId: String, ok: Boolean, - errorMessage: String?, + errorMessage: String? = null, noinline shippingOptions: ListingBuilder.() -> Unit, ): AnswerShippingQueryAction = eu.vendeli.tgbot.api.answer.answerShippingQuery(shippingQueryId, ok, errorMessage, shippingOptions) @@ -384,7 +390,7 @@ public inline fun TelegramBot.answerShippingQuery( public inline fun TelegramBot.answerShippingQuery( shippingQueryId: String, ok: Boolean, - errorMessage: String?, + errorMessage: String? = null, vararg shippingOption: ShippingOption, ): AnswerShippingQueryAction = eu.vendeli.tgbot.api.answer.answerShippingQuery(shippingQueryId, ok, errorMessage, shippingOption = shippingOption) @@ -399,27 +405,35 @@ public inline fun TelegramBot.createInvoiceLink( title: String, description: String, payload: String, - providerToken: String, currency: Currency, prices: List, -): CreateInvoiceLinkAction = eu.vendeli.tgbot.api.botactions.createInvoiceLink(title, description, payload, providerToken, currency, prices) +): CreateInvoiceLinkAction = eu.vendeli.tgbot.api.botactions.createInvoiceLink(title, description, payload, currency, prices) @Suppress("NOTHING_TO_INLINE") public inline fun TelegramBot.createInvoiceLink( title: String, description: String, - providerToken: String, currency: Currency, vararg prices: LabeledPrice, noinline payload: () -> String, -): CreateInvoiceLinkAction = eu.vendeli.tgbot.api.botactions.createInvoiceLink(title, description, providerToken, currency, prices = prices, payload) +): CreateInvoiceLinkAction = eu.vendeli.tgbot.api.botactions.createInvoiceLink(title, description, currency, prices = prices, payload) @Suppress("NOTHING_TO_INLINE") -public inline fun TelegramBot.deleteMyCommands(languageCode: String?, scope: BotCommandScope?): DeleteMyCommandsAction = eu.vendeli.tgbot.api.botactions.deleteMyCommands(languageCode, scope) +public inline fun TelegramBot.deleteMyCommands(languageCode: String? = null, scope: BotCommandScope? = null): DeleteMyCommandsAction = eu.vendeli.tgbot.api.botactions.deleteMyCommands(languageCode, scope) @Suppress("NOTHING_TO_INLINE") public inline fun TelegramBot.deleteWebhook(dropPendingUpdates: Boolean): DeleteWebhookAction = eu.vendeli.tgbot.api.botactions.deleteWebhook(dropPendingUpdates) +@Suppress("NOTHING_TO_INLINE") +public inline fun TelegramBot.editUserStarSubscription( + userId: Long, + telegramPaymentChargeId: String, + isCanceled: Boolean, +): EditUserStarSubscriptionAction = eu.vendeli.tgbot.api.botactions.editUserStarSubscription(userId, telegramPaymentChargeId, isCanceled) + +@Suppress("NOTHING_TO_INLINE") +public inline fun TelegramBot.getAvailableGifts(): GetAvailableGiftsAction = eu.vendeli.tgbot.api.botactions.getAvailableGifts() + @Suppress("NOTHING_TO_INLINE") public inline fun TelegramBot.getBusinessConnection(businessConnectionId: String): GetBusinessConnectionAction = eu.vendeli.tgbot.api.botactions.getBusinessConnection(businessConnectionId) @@ -427,22 +441,22 @@ public inline fun TelegramBot.getBusinessConnection(businessConnectionId: String public inline fun TelegramBot.getMe(): GetMeAction = eu.vendeli.tgbot.api.botactions.getMe() @Suppress("NOTHING_TO_INLINE") -public inline fun TelegramBot.getMyCommands(languageCode: String?, scope: BotCommandScope?): GetMyCommandsAction = eu.vendeli.tgbot.api.botactions.getMyCommands(languageCode, scope) +public inline fun TelegramBot.getMyCommands(languageCode: String? = null, scope: BotCommandScope? = null): GetMyCommandsAction = eu.vendeli.tgbot.api.botactions.getMyCommands(languageCode, scope) @Suppress("NOTHING_TO_INLINE") -public inline fun TelegramBot.getMyDefaultAdministratorRights(forChannel: Boolean?): GetMyDefaultAdministratorRightsAction = eu.vendeli.tgbot.api.botactions.getMyDefaultAdministratorRights(forChannel) +public inline fun TelegramBot.getMyDefaultAdministratorRights(forChannel: Boolean? = null): GetMyDefaultAdministratorRightsAction = eu.vendeli.tgbot.api.botactions.getMyDefaultAdministratorRights(forChannel) @Suppress("NOTHING_TO_INLINE") -public inline fun TelegramBot.getMyDescription(languageCode: String?): GetMyDescriptionAction = eu.vendeli.tgbot.api.botactions.getMyDescription(languageCode) +public inline fun TelegramBot.getMyDescription(languageCode: String? = null): GetMyDescriptionAction = eu.vendeli.tgbot.api.botactions.getMyDescription(languageCode) @Suppress("NOTHING_TO_INLINE") -public inline fun TelegramBot.getMyName(languageCode: String?): GetMyNameAction = eu.vendeli.tgbot.api.botactions.getMyName(languageCode) +public inline fun TelegramBot.getMyName(languageCode: String? = null): GetMyNameAction = eu.vendeli.tgbot.api.botactions.getMyName(languageCode) @Suppress("NOTHING_TO_INLINE") -public inline fun TelegramBot.getMyShortDescription(languageCode: String?): GetMyShortDescriptionAction = eu.vendeli.tgbot.api.botactions.getMyShortDescription(languageCode) +public inline fun TelegramBot.getMyShortDescription(languageCode: String? = null): GetMyShortDescriptionAction = eu.vendeli.tgbot.api.botactions.getMyShortDescription(languageCode) @Suppress("NOTHING_TO_INLINE") -public inline fun TelegramBot.getStarTransactions(offset: Int?, limit: Int?): GetStarTransactionsAction = eu.vendeli.tgbot.api.botactions.getStarTransactions(offset, limit) +public inline fun TelegramBot.getStarTransactions(offset: Int? = null, limit: Int? = null): GetStarTransactionsAction = eu.vendeli.tgbot.api.botactions.getStarTransactions(offset, limit) @Suppress("NOTHING_TO_INLINE") public inline fun TelegramBot.getUpdates(): GetUpdatesAction = eu.vendeli.tgbot.api.botactions.getUpdates() @@ -456,38 +470,56 @@ public inline fun TelegramBot.logOut(): LogOutAction = eu.vendeli.tgbot.api.bota @Suppress("NOTHING_TO_INLINE") public inline fun TelegramBot.refundStarPayment(telegramPaymentChargeId: String, userId: Long): RefundStarPaymentAction = eu.vendeli.tgbot.api.botactions.refundStarPayment(telegramPaymentChargeId, userId) +@Suppress("NOTHING_TO_INLINE") +public inline fun TelegramBot.savePreparedInlineMessage(userId: Long, result: InlineQueryResult): SavePreparedInlineMessageAction = eu.vendeli.tgbot.api.botactions.savePreparedInlineMessage(userId, result) + +@Suppress("NOTHING_TO_INLINE") +public inline fun TelegramBot.sendGift( + userId: Long, + giftId: String, + textParseMode: ParseMode? = null, + noinline text: (() -> String)? = null, +): SendGiftAction = eu.vendeli.tgbot.api.botactions.sendGift(userId, giftId, textParseMode, text) + @Suppress("NOTHING_TO_INLINE") public inline fun TelegramBot.setMyCommands( - languageCode: String?, - scope: BotCommandScope?, + languageCode: String? = null, + scope: BotCommandScope? = null, command: List, ): SetMyCommandsAction = eu.vendeli.tgbot.api.botactions.setMyCommands(languageCode, scope, command) @Suppress("NOTHING_TO_INLINE") public inline fun TelegramBot.setMyCommands( - languageCode: String?, - scope: BotCommandScope?, + languageCode: String? = null, + scope: BotCommandScope? = null, vararg command: BotCommand, ): SetMyCommandsAction = eu.vendeli.tgbot.api.botactions.setMyCommands(languageCode, scope, command = command) @Suppress("NOTHING_TO_INLINE") public inline fun TelegramBot.setMyCommands( - languageCode: String?, - scope: BotCommandScope?, + languageCode: String? = null, + scope: BotCommandScope? = null, noinline block: BotCommandsBuilder.() -> Unit, ): SetMyCommandsAction = eu.vendeli.tgbot.api.botactions.setMyCommands(languageCode, scope, block) @Suppress("NOTHING_TO_INLINE") -public inline fun TelegramBot.setMyDefaultAdministratorRights(rights: ChatAdministratorRights?, forChannel: Boolean?): SetMyDefaultAdministratorRightsAction = eu.vendeli.tgbot.api.botactions.setMyDefaultAdministratorRights(rights, forChannel) +public inline fun TelegramBot.setMyDefaultAdministratorRights(rights: ChatAdministratorRights? = null, forChannel: Boolean? = null): SetMyDefaultAdministratorRightsAction = eu.vendeli.tgbot.api.botactions.setMyDefaultAdministratorRights(rights, forChannel) @Suppress("NOTHING_TO_INLINE") -public inline fun TelegramBot.setMyDescription(description: String?, languageCode: String?): SetMyDescriptionAction = eu.vendeli.tgbot.api.botactions.setMyDescription(description, languageCode) +public inline fun TelegramBot.setMyDescription(description: String? = null, languageCode: String? = null): SetMyDescriptionAction = eu.vendeli.tgbot.api.botactions.setMyDescription(description, languageCode) @Suppress("NOTHING_TO_INLINE") -public inline fun TelegramBot.setMyName(name: String?, languageCode: String?): SetMyNameAction = eu.vendeli.tgbot.api.botactions.setMyName(name, languageCode) +public inline fun TelegramBot.setMyName(name: String? = null, languageCode: String? = null): SetMyNameAction = eu.vendeli.tgbot.api.botactions.setMyName(name, languageCode) @Suppress("NOTHING_TO_INLINE") -public inline fun TelegramBot.setMyShortDescription(description: String?, languageCode: String?): SetMyShortDescriptionAction = eu.vendeli.tgbot.api.botactions.setMyShortDescription(description, languageCode) +public inline fun TelegramBot.setMyShortDescription(description: String? = null, languageCode: String? = null): SetMyShortDescriptionAction = eu.vendeli.tgbot.api.botactions.setMyShortDescription(description, languageCode) + +@Suppress("NOTHING_TO_INLINE") +public inline fun TelegramBot.setUserEmojiStatus( + userId: Long, + emojiStatusCustomEmojiId: String? = null, + emojiStatusExpirationDate: Instant? = null, +): SetUserEmojiStatusAction = eu.vendeli.tgbot.api.botactions.setUserEmojiStatus(userId, emojiStatusCustomEmojiId, emojiStatusExpirationDate) @Suppress("NOTHING_TO_INLINE") public inline fun TelegramBot.setWebhook(url: String): SetWebhookAction = eu.vendeli.tgbot.api.botactions.setWebhook(url) @@ -501,15 +533,15 @@ public inline fun TelegramBot.approveChatJoinRequest(user: User): ApproveChatJoi @Suppress("NOTHING_TO_INLINE") public inline fun TelegramBot.banChatMember( userId: Long, - untilDate: Instant?, - revokeMessages: Boolean?, + untilDate: Instant? = null, + revokeMessages: Boolean? = null, ): BanChatMemberAction = eu.vendeli.tgbot.api.chat.banChatMember(userId, untilDate, revokeMessages) @Suppress("NOTHING_TO_INLINE") public inline fun TelegramBot.banChatMember( user: User, - untilDate: Instant?, - revokeMessages: Boolean?, + untilDate: Instant? = null, + revokeMessages: Boolean? = null, ): BanChatMemberAction = eu.vendeli.tgbot.api.chat.banChatMember(user, untilDate, revokeMessages) @Suppress("NOTHING_TO_INLINE") @@ -522,16 +554,16 @@ public inline fun TelegramBot.banChatSenderChat(senderChatId: Chat): BanChatSend public inline fun TelegramBot.banChatSenderChat(senderChatId: User): BanChatSenderChatAction = eu.vendeli.tgbot.api.chat.banChatSenderChat(senderChatId) @Suppress("NOTHING_TO_INLINE") -public inline fun TelegramBot.chatAction(action: ChatAction, messageThreadId: Int?): SendChatActionAction = eu.vendeli.tgbot.api.chat.chatAction(action, messageThreadId) +public inline fun TelegramBot.chatAction(action: ChatAction, messageThreadId: Int? = null): SendChatActionAction = eu.vendeli.tgbot.api.chat.chatAction(action, messageThreadId) @Suppress("NOTHING_TO_INLINE") -public inline fun TelegramBot.chatAction(messageThreadId: Int?, noinline block: () -> ChatAction): SendChatActionAction = eu.vendeli.tgbot.api.chat.chatAction(messageThreadId, block) +public inline fun TelegramBot.chatAction(messageThreadId: Int? = null, noinline block: () -> ChatAction): SendChatActionAction = eu.vendeli.tgbot.api.chat.chatAction(messageThreadId, block) @Suppress("NOTHING_TO_INLINE") -public inline fun TelegramBot.sendChatAction(messageThreadId: Int?, noinline block: () -> ChatAction): SendChatActionAction = eu.vendeli.tgbot.api.chat.sendChatAction(messageThreadId, block) +public inline fun TelegramBot.sendChatAction(messageThreadId: Int? = null, noinline block: () -> ChatAction): SendChatActionAction = eu.vendeli.tgbot.api.chat.sendChatAction(messageThreadId, block) @Suppress("NOTHING_TO_INLINE") -public inline fun TelegramBot.sendChatAction(action: ChatAction, messageThreadId: Int?): SendChatActionAction = eu.vendeli.tgbot.api.chat.sendChatAction(action, messageThreadId) +public inline fun TelegramBot.sendChatAction(action: ChatAction, messageThreadId: Int? = null): SendChatActionAction = eu.vendeli.tgbot.api.chat.sendChatAction(action, messageThreadId) @Suppress("NOTHING_TO_INLINE") public inline fun TelegramBot.createChatInviteLink(): CreateChatInviteLinkAction = eu.vendeli.tgbot.api.chat.createChatInviteLink() @@ -539,7 +571,7 @@ public inline fun TelegramBot.createChatInviteLink(): CreateChatInviteLinkAction @Suppress("NOTHING_TO_INLINE") public inline fun TelegramBot.createChatSubscriptionInviteLink( subscriptionPrice: Int, - name: String?, + name: String? = null, subscriptionPeriod: Duration, ): CreateChatSubscriptionInviteLinkAction = eu.vendeli.tgbot.api.chat.createChatSubscriptionInviteLink(subscriptionPrice, name, subscriptionPeriod) @@ -559,7 +591,7 @@ public inline fun TelegramBot.deleteChatStickerSet(): DeleteChatStickerSetAction public inline fun TelegramBot.editChatInviteLink(inviteLink: String): EditChatInviteLinkAction = eu.vendeli.tgbot.api.chat.editChatInviteLink(inviteLink) @Suppress("NOTHING_TO_INLINE") -public inline fun TelegramBot.editChatSubscriptionInviteLink(inviteLink: String, name: String?): EditChatSubscriptionInviteLinkAction = eu.vendeli.tgbot.api.chat.editChatSubscriptionInviteLink(inviteLink, name) +public inline fun TelegramBot.editChatSubscriptionInviteLink(inviteLink: String, name: String? = null): EditChatSubscriptionInviteLinkAction = eu.vendeli.tgbot.api.chat.editChatSubscriptionInviteLink(inviteLink, name) @Suppress("NOTHING_TO_INLINE") public inline fun TelegramBot.exportChatInviteLink(): ExportChatInviteLinkAction = eu.vendeli.tgbot.api.chat.exportChatInviteLink() @@ -586,7 +618,7 @@ public inline fun TelegramBot.getChatMenuButton(): GetChatMenuButtonAction = eu. public inline fun TelegramBot.leaveChat(): LeaveChatAction = eu.vendeli.tgbot.api.chat.leaveChat() @Suppress("NOTHING_TO_INLINE") -public inline fun TelegramBot.pinChatMessage(messageId: Long, disableNotification: Boolean?): PinChatMessageAction = eu.vendeli.tgbot.api.chat.pinChatMessage(messageId, disableNotification) +public inline fun TelegramBot.pinChatMessage(messageId: Long, disableNotification: Boolean? = null): PinChatMessageAction = eu.vendeli.tgbot.api.chat.pinChatMessage(messageId, disableNotification) @Suppress("NOTHING_TO_INLINE") public inline fun TelegramBot.promoteChatMember(userId: Long): PromoteChatMemberAction = eu.vendeli.tgbot.api.chat.promoteChatMember(userId) @@ -597,8 +629,8 @@ public inline fun TelegramBot.promoteChatMember(user: User): PromoteChatMemberAc @Suppress("NOTHING_TO_INLINE") public inline fun TelegramBot.restrictChatMember( userId: Long, - untilDate: Instant?, - useIndependentChatPermissions: Boolean?, + untilDate: Instant? = null, + useIndependentChatPermissions: Boolean? = null, noinline chatPermissions: ChatPermissions.() -> Unit, ): RestrictChatMemberAction = eu.vendeli.tgbot.api.chat.restrictChatMember(userId, untilDate, useIndependentChatPermissions, chatPermissions) @@ -606,15 +638,15 @@ public inline fun TelegramBot.restrictChatMember( public inline fun TelegramBot.restrictChatMember( userId: Long, chatPermissions: ChatPermissions, - untilDate: Instant?, - useIndependentChatPermissions: Boolean?, + untilDate: Instant? = null, + useIndependentChatPermissions: Boolean? = null, ): RestrictChatMemberAction = eu.vendeli.tgbot.api.chat.restrictChatMember(userId, chatPermissions, untilDate, useIndependentChatPermissions) @Suppress("NOTHING_TO_INLINE") public inline fun TelegramBot.restrictChatMember( user: User, - untilDate: Instant?, - useIndependentChatPermissions: Boolean?, + untilDate: Instant? = null, + useIndependentChatPermissions: Boolean? = null, noinline chatPermissions: ChatPermissions.() -> Unit, ): RestrictChatMemberAction = eu.vendeli.tgbot.api.chat.restrictChatMember(user, untilDate, useIndependentChatPermissions, chatPermissions) @@ -622,8 +654,8 @@ public inline fun TelegramBot.restrictChatMember( public inline fun TelegramBot.restrictChatMember( user: User, chatPermissions: ChatPermissions, - untilDate: Instant?, - useIndependentChatPermissions: Boolean?, + untilDate: Instant? = null, + useIndependentChatPermissions: Boolean? = null, ): RestrictChatMemberAction = eu.vendeli.tgbot.api.chat.restrictChatMember(user, chatPermissions, untilDate, useIndependentChatPermissions) @Suppress("NOTHING_TO_INLINE") @@ -636,16 +668,16 @@ public inline fun TelegramBot.setChatAdministratorCustomTitle(userId: Long, cust public inline fun TelegramBot.setChatAdministratorCustomTitle(user: User, customTitle: String): SetChatAdministratorCustomTitleAction = eu.vendeli.tgbot.api.chat.setChatAdministratorCustomTitle(user, customTitle) @Suppress("NOTHING_TO_INLINE") -public inline fun TelegramBot.setChatDescription(title: String?): SetChatDescriptionAction = eu.vendeli.tgbot.api.chat.setChatDescription(title) +public inline fun TelegramBot.setChatDescription(title: String? = null): SetChatDescriptionAction = eu.vendeli.tgbot.api.chat.setChatDescription(title) @Suppress("NOTHING_TO_INLINE") public inline fun TelegramBot.setChatMenuButton(menuButton: MenuButton): SetChatMenuButtonAction = eu.vendeli.tgbot.api.chat.setChatMenuButton(menuButton) @Suppress("NOTHING_TO_INLINE") -public inline fun TelegramBot.setChatPermissions(permissions: ChatPermissions, useIndependentChatPermissions: Boolean?): SetChatPermissionsAction = eu.vendeli.tgbot.api.chat.setChatPermissions(permissions, useIndependentChatPermissions) +public inline fun TelegramBot.setChatPermissions(permissions: ChatPermissions, useIndependentChatPermissions: Boolean? = null): SetChatPermissionsAction = eu.vendeli.tgbot.api.chat.setChatPermissions(permissions, useIndependentChatPermissions) @Suppress("NOTHING_TO_INLINE") -public inline fun TelegramBot.setChatPermissions(useIndependentChatPermissions: Boolean?, noinline permissions: ChatPermissions.() -> Unit): SetChatPermissionsAction = eu.vendeli.tgbot.api.chat.setChatPermissions(useIndependentChatPermissions, permissions) +public inline fun TelegramBot.setChatPermissions(useIndependentChatPermissions: Boolean? = null, noinline permissions: ChatPermissions.() -> Unit): SetChatPermissionsAction = eu.vendeli.tgbot.api.chat.setChatPermissions(useIndependentChatPermissions, permissions) @Suppress("NOTHING_TO_INLINE") public inline fun TelegramBot.setChatPhoto(`file`: ImplicitFile): SetChatPhotoAction = eu.vendeli.tgbot.api.chat.setChatPhoto(file) @@ -663,10 +695,10 @@ public inline fun TelegramBot.setChatStickerSet(stickerSetName: String): SetChat public inline fun TelegramBot.setChatTitle(title: String): SetChatTitleAction = eu.vendeli.tgbot.api.chat.setChatTitle(title) @Suppress("NOTHING_TO_INLINE") -public inline fun TelegramBot.unbanChatMember(userId: Long, onlyIfBanned: Boolean?): UnbanChatMemberAction = eu.vendeli.tgbot.api.chat.unbanChatMember(userId, onlyIfBanned) +public inline fun TelegramBot.unbanChatMember(userId: Long, onlyIfBanned: Boolean? = null): UnbanChatMemberAction = eu.vendeli.tgbot.api.chat.unbanChatMember(userId, onlyIfBanned) @Suppress("NOTHING_TO_INLINE") -public inline fun TelegramBot.unbanChatMember(user: User, onlyIfBanned: Boolean?): UnbanChatMemberAction = eu.vendeli.tgbot.api.chat.unbanChatMember(user, onlyIfBanned) +public inline fun TelegramBot.unbanChatMember(user: User, onlyIfBanned: Boolean? = null): UnbanChatMemberAction = eu.vendeli.tgbot.api.chat.unbanChatMember(user, onlyIfBanned) @Suppress("NOTHING_TO_INLINE") public inline fun TelegramBot.unbanChatSenderChat(senderChatId: Long): UnbanChatSenderChatAction = eu.vendeli.tgbot.api.chat.unbanChatSenderChat(senderChatId) @@ -692,8 +724,8 @@ public inline fun TelegramBot.closeGeneralForumTopic(): CloseGeneralForumTopicAc @Suppress("NOTHING_TO_INLINE") public inline fun TelegramBot.createForumTopic( name: String, - iconColor: IconColor?, - iconCustomEmojiId: String?, + iconColor: IconColor? = null, + iconCustomEmojiId: String? = null, ): CreateForumTopicAction = eu.vendeli.tgbot.api.forum.createForumTopic(name, iconColor, iconCustomEmojiId) @Suppress("NOTHING_TO_INLINE") @@ -702,8 +734,8 @@ public inline fun TelegramBot.deleteForumTopic(messageThreadId: Int): DeleteForu @Suppress("NOTHING_TO_INLINE") public inline fun TelegramBot.editForumTopic( messageThreadId: Int, - name: String?, - iconCustomEmojiId: String?, + name: String? = null, + iconCustomEmojiId: String? = null, ): EditForumTopicAction = eu.vendeli.tgbot.api.forum.editForumTopic(messageThreadId, name, iconCustomEmojiId) @Suppress("NOTHING_TO_INLINE") @@ -1086,16 +1118,16 @@ public inline fun TelegramBot.replaceStickerInSet( ): ReplaceStickerInSetAction = eu.vendeli.tgbot.api.stickerset.replaceStickerInSet(userId, name, oldSticker, sticker) @Suppress("NOTHING_TO_INLINE") -public inline fun TelegramBot.setCustomEmojiStickerSetThumbnail(name: String, customEmojiId: String?): SetCustomEmojiStickerSetThumbnailAction = eu.vendeli.tgbot.api.stickerset.setCustomEmojiStickerSetThumbnail(name, customEmojiId) +public inline fun TelegramBot.setCustomEmojiStickerSetThumbnail(name: String, customEmojiId: String? = null): SetCustomEmojiStickerSetThumbnailAction = eu.vendeli.tgbot.api.stickerset.setCustomEmojiStickerSetThumbnail(name, customEmojiId) @Suppress("NOTHING_TO_INLINE") public inline fun TelegramBot.setStickerEmojiList(sticker: String, emojiList: List): SetStickerEmojiListAction = eu.vendeli.tgbot.api.stickerset.setStickerEmojiList(sticker, emojiList) @Suppress("NOTHING_TO_INLINE") -public inline fun TelegramBot.setStickerKeywords(sticker: String, keywords: List?): SetStickerKeywordsAction = eu.vendeli.tgbot.api.stickerset.setStickerKeywords(sticker, keywords) +public inline fun TelegramBot.setStickerKeywords(sticker: String, keywords: List? = null): SetStickerKeywordsAction = eu.vendeli.tgbot.api.stickerset.setStickerKeywords(sticker, keywords) @Suppress("NOTHING_TO_INLINE") -public inline fun TelegramBot.setStickerMaskPosition(sticker: String, maskPosition: MaskPosition?): SetStickerMaskPositionAction = eu.vendeli.tgbot.api.stickerset.setStickerMaskPosition(sticker, maskPosition) +public inline fun TelegramBot.setStickerMaskPosition(sticker: String, maskPosition: MaskPosition? = null): SetStickerMaskPositionAction = eu.vendeli.tgbot.api.stickerset.setStickerMaskPosition(sticker, maskPosition) @Suppress("NOTHING_TO_INLINE") public inline fun TelegramBot.setStickerPositionInSet(sticker: String, position: Int): SetStickerPositionInSetAction = eu.vendeli.tgbot.api.stickerset.setStickerPositionInSet(sticker, position) @@ -1105,7 +1137,7 @@ public inline fun TelegramBot.setStickerSetThumbnail( name: String, userId: Long, format: StickerFormat, - thumbnail: ImplicitFile?, + thumbnail: ImplicitFile? = null, ): SetStickerSetThumbnailAction = eu.vendeli.tgbot.api.stickerset.setStickerSetThumbnail(name, userId, format, thumbnail) @Suppress("NOTHING_TO_INLINE") diff --git a/ktgram-utils/src/commonMain/kotlin/eu/vendeli/ktgram/extutils/WebAppUtils.kt b/ktgram-utils/src/commonMain/kotlin/eu/vendeli/ktgram/extutils/WebAppUtils.kt new file mode 100644 index 0000000000..32dd0ef3fd --- /dev/null +++ b/ktgram-utils/src/commonMain/kotlin/eu/vendeli/ktgram/extutils/WebAppUtils.kt @@ -0,0 +1,21 @@ +package eu.vendeli.ktgram.extutils + +import korlibs.crypto.HMAC +import net.thauvin.erik.urlencoder.UrlEncoderUtil.decode + +/** + * Function to check is web app data is safe. + * + * @param botToken bot token. + * @param hash hash from webapp + */ +fun String.checkIsInitDataSafe(botToken: String, hash: String): Boolean { + val secretKey = HMAC.hmacSHA256(botToken.encodeToByteArray(), "WebAppData".encodeToByteArray()) + val decodedData = decode(this) + .split("&") + .filterNot { it.startsWith("hash=") } + .sorted() + .joinToString("\n") + + return HMAC.hmacSHA256(secretKey.bytes, decodedData.encodeToByteArray()).hexLower == hash.lowercase() +} diff --git a/telegram-bot/api/telegram-bot.api b/telegram-bot/api/telegram-bot.api index 6700e57081..8305f09933 100644 --- a/telegram-bot/api/telegram-bot.api +++ b/telegram-bot/api/telegram-bot.api @@ -19,6 +19,10 @@ public final class eu/vendeli/tgbot/TelegramBot { public final class eu/vendeli/tgbot/TelegramBot$Companion { } +public abstract interface annotation class eu/vendeli/tgbot/annotations/ArgParser : java/lang/annotation/Annotation { + public abstract fun argParser ()Ljava/lang/Class; +} + public abstract interface annotation class eu/vendeli/tgbot/annotations/CommandHandler : java/lang/annotation/Annotation { public abstract fun argParser ()Ljava/lang/Class; public abstract fun guard ()Ljava/lang/Class; @@ -29,6 +33,7 @@ public abstract interface annotation class eu/vendeli/tgbot/annotations/CommandH public abstract interface annotation class eu/vendeli/tgbot/annotations/CommandHandler$CallbackQuery : java/lang/annotation/Annotation { public abstract fun argParser ()Ljava/lang/Class; + public abstract fun autoAnswer ()Z public abstract fun guard ()Ljava/lang/Class; public abstract fun rateLimits ()Leu/vendeli/tgbot/annotations/RateLimits; public abstract fun value ()[Ljava/lang/String; @@ -59,6 +64,10 @@ public abstract interface annotation class eu/vendeli/tgbot/annotations/CommonHa public abstract interface annotation class eu/vendeli/tgbot/annotations/CtxProvider : java/lang/annotation/Annotation { } +public abstract interface annotation class eu/vendeli/tgbot/annotations/Guard : java/lang/annotation/Annotation { + public abstract fun guard ()Ljava/lang/Class; +} + public abstract interface annotation class eu/vendeli/tgbot/annotations/Injectable : java/lang/annotation/Annotation { } @@ -289,8 +298,12 @@ public final class eu/vendeli/tgbot/api/SendLocationAction : eu/vendeli/tgbot/in public fun sendBusinessAsync (JLjava/lang/String;Leu/vendeli/tgbot/TelegramBot;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; } -public final class eu/vendeli/tgbot/api/SendPollAction : eu/vendeli/tgbot/interfaces/action/Action, eu/vendeli/tgbot/interfaces/action/BusinessActionExt, eu/vendeli/tgbot/interfaces/features/MarkupFeature, eu/vendeli/tgbot/interfaces/features/OptionsFeature { +public final class eu/vendeli/tgbot/api/SendPollAction : eu/vendeli/tgbot/interfaces/action/Action, eu/vendeli/tgbot/interfaces/action/BusinessActionExt, eu/vendeli/tgbot/interfaces/features/EntitiesFeature, eu/vendeli/tgbot/interfaces/features/MarkupFeature, eu/vendeli/tgbot/interfaces/features/OptionsFeature { public fun (Ljava/lang/String;Ljava/util/List;)V + public fun entities (Ljava/util/List;)Leu/vendeli/tgbot/api/SendPollAction; + public synthetic fun entities (Ljava/util/List;)Leu/vendeli/tgbot/interfaces/action/TgAction; + public fun entities (Lkotlin/jvm/functions/Function1;)Leu/vendeli/tgbot/api/SendPollAction; + public synthetic fun entities (Lkotlin/jvm/functions/Function1;)Leu/vendeli/tgbot/interfaces/action/TgAction; public fun forceReply (Ljava/lang/String;Ljava/lang/Boolean;)Leu/vendeli/tgbot/api/SendPollAction; public synthetic fun forceReply (Ljava/lang/String;Ljava/lang/Boolean;)Leu/vendeli/tgbot/interfaces/action/TgAction; public synthetic fun getOptions$telegram_bot ()Leu/vendeli/tgbot/types/internal/options/Options; @@ -489,16 +502,18 @@ public final class eu/vendeli/tgbot/api/botactions/CloseKt { public static final fun close ()Leu/vendeli/tgbot/api/botactions/CloseAction; } -public final class eu/vendeli/tgbot/api/botactions/CreateInvoiceLinkAction : eu/vendeli/tgbot/interfaces/action/SimpleAction, eu/vendeli/tgbot/interfaces/features/OptionsFeature { - public fun (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Leu/vendeli/tgbot/types/internal/Currency;Ljava/util/List;)V +public final class eu/vendeli/tgbot/api/botactions/CreateInvoiceLinkAction : eu/vendeli/tgbot/interfaces/action/SimpleAction, eu/vendeli/tgbot/interfaces/action/BusinessActionExt, eu/vendeli/tgbot/interfaces/features/OptionsFeature { + public fun (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Leu/vendeli/tgbot/types/internal/Currency;Ljava/util/List;)V public synthetic fun getOptions$telegram_bot ()Leu/vendeli/tgbot/types/internal/options/Options; public fun options (Lkotlin/jvm/functions/Function1;)Leu/vendeli/tgbot/api/botactions/CreateInvoiceLinkAction; public synthetic fun options (Lkotlin/jvm/functions/Function1;)Leu/vendeli/tgbot/interfaces/action/TgAction; + public fun sendBusiness (JLjava/lang/String;Leu/vendeli/tgbot/TelegramBot;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun sendBusinessAsync (JLjava/lang/String;Leu/vendeli/tgbot/TelegramBot;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; } public final class eu/vendeli/tgbot/api/botactions/CreateInvoiceLinkKt { - public static final fun createInvoiceLink (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Leu/vendeli/tgbot/types/internal/Currency;[Leu/vendeli/tgbot/types/payment/LabeledPrice;Lkotlin/jvm/functions/Function0;)Leu/vendeli/tgbot/api/botactions/CreateInvoiceLinkAction; - public static final fun createInvoiceLink (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Leu/vendeli/tgbot/types/internal/Currency;Ljava/util/List;)Leu/vendeli/tgbot/api/botactions/CreateInvoiceLinkAction; + public static final fun createInvoiceLink (Ljava/lang/String;Ljava/lang/String;Leu/vendeli/tgbot/types/internal/Currency;[Leu/vendeli/tgbot/types/payment/LabeledPrice;Lkotlin/jvm/functions/Function0;)Leu/vendeli/tgbot/api/botactions/CreateInvoiceLinkAction; + public static final fun createInvoiceLink (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Leu/vendeli/tgbot/types/internal/Currency;Ljava/util/List;)Leu/vendeli/tgbot/api/botactions/CreateInvoiceLinkAction; } public final class eu/vendeli/tgbot/api/botactions/DeleteMyCommandsAction : eu/vendeli/tgbot/interfaces/action/SimpleAction { @@ -523,6 +538,22 @@ public final class eu/vendeli/tgbot/api/botactions/DeleteWebhookKt { public static synthetic fun deleteWebhook$default (ZILjava/lang/Object;)Leu/vendeli/tgbot/api/botactions/DeleteWebhookAction; } +public final class eu/vendeli/tgbot/api/botactions/EditUserStarSubscriptionAction : eu/vendeli/tgbot/interfaces/action/SimpleAction { + public fun (JLjava/lang/String;Z)V +} + +public final class eu/vendeli/tgbot/api/botactions/EditUserStarSubscriptionKt { + public static final fun editUserStarSubscription (JLjava/lang/String;Z)Leu/vendeli/tgbot/api/botactions/EditUserStarSubscriptionAction; +} + +public final class eu/vendeli/tgbot/api/botactions/GetAvailableGiftsAction : eu/vendeli/tgbot/interfaces/action/SimpleAction { + public fun ()V +} + +public final class eu/vendeli/tgbot/api/botactions/GetAvailableGiftsKt { + public static final fun getAvailableGifts ()Leu/vendeli/tgbot/api/botactions/GetAvailableGiftsAction; +} + public final class eu/vendeli/tgbot/api/botactions/GetBusinessConnectionAction : eu/vendeli/tgbot/interfaces/action/SimpleAction { public fun (Ljava/lang/String;)V } @@ -640,6 +671,31 @@ public final class eu/vendeli/tgbot/api/botactions/RefundStarPaymentKt { public static final fun refundStarPayment (Ljava/lang/String;J)Leu/vendeli/tgbot/api/botactions/RefundStarPaymentAction; } +public final class eu/vendeli/tgbot/api/botactions/SavePreparedInlineMessageAction : eu/vendeli/tgbot/interfaces/action/SimpleAction, eu/vendeli/tgbot/interfaces/features/OptionsFeature { + public fun (JLeu/vendeli/tgbot/types/inline/InlineQueryResult;)V + public synthetic fun getOptions$telegram_bot ()Leu/vendeli/tgbot/types/internal/options/Options; + public fun options (Lkotlin/jvm/functions/Function1;)Leu/vendeli/tgbot/api/botactions/SavePreparedInlineMessageAction; + public synthetic fun options (Lkotlin/jvm/functions/Function1;)Leu/vendeli/tgbot/interfaces/action/TgAction; +} + +public final class eu/vendeli/tgbot/api/botactions/SavePreparedInlineMessageKt { + public static final fun savePreparedInlineMessage (JLeu/vendeli/tgbot/types/inline/InlineQueryResult;)Leu/vendeli/tgbot/api/botactions/SavePreparedInlineMessageAction; +} + +public final class eu/vendeli/tgbot/api/botactions/SendGiftAction : eu/vendeli/tgbot/interfaces/action/SimpleAction, eu/vendeli/tgbot/interfaces/features/EntitiesFeature { + public fun (JLjava/lang/String;Leu/vendeli/tgbot/types/ParseMode;Lkotlin/jvm/functions/Function0;)V + public synthetic fun (JLjava/lang/String;Leu/vendeli/tgbot/types/ParseMode;Lkotlin/jvm/functions/Function0;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun entities (Ljava/util/List;)Leu/vendeli/tgbot/api/botactions/SendGiftAction; + public synthetic fun entities (Ljava/util/List;)Leu/vendeli/tgbot/interfaces/action/TgAction; + public fun entities (Lkotlin/jvm/functions/Function1;)Leu/vendeli/tgbot/api/botactions/SendGiftAction; + public synthetic fun entities (Lkotlin/jvm/functions/Function1;)Leu/vendeli/tgbot/interfaces/action/TgAction; +} + +public final class eu/vendeli/tgbot/api/botactions/SendGiftKt { + public static final fun sendGift (JLjava/lang/String;Leu/vendeli/tgbot/types/ParseMode;Lkotlin/jvm/functions/Function0;)Leu/vendeli/tgbot/api/botactions/SendGiftAction; + public static synthetic fun sendGift$default (JLjava/lang/String;Leu/vendeli/tgbot/types/ParseMode;Lkotlin/jvm/functions/Function0;ILjava/lang/Object;)Leu/vendeli/tgbot/api/botactions/SendGiftAction; +} + public final class eu/vendeli/tgbot/api/botactions/SetMyCommandsAction : eu/vendeli/tgbot/interfaces/action/SimpleAction { public fun (Ljava/lang/String;Leu/vendeli/tgbot/types/bot/BotCommandScope;Ljava/util/List;)V public synthetic fun (Ljava/lang/String;Leu/vendeli/tgbot/types/bot/BotCommandScope;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V @@ -698,6 +754,16 @@ public final class eu/vendeli/tgbot/api/botactions/SetMyShortDescriptionKt { public static synthetic fun setMyShortDescription$default (Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Leu/vendeli/tgbot/api/botactions/SetMyShortDescriptionAction; } +public final class eu/vendeli/tgbot/api/botactions/SetUserEmojiStatusAction : eu/vendeli/tgbot/interfaces/action/SimpleAction { + public fun (JLjava/lang/String;Lkotlinx/datetime/Instant;)V + public synthetic fun (JLjava/lang/String;Lkotlinx/datetime/Instant;ILkotlin/jvm/internal/DefaultConstructorMarker;)V +} + +public final class eu/vendeli/tgbot/api/botactions/SetUserEmojiStatusKt { + public static final fun setUserEmojiStatus (JLjava/lang/String;Lkotlinx/datetime/Instant;)Leu/vendeli/tgbot/api/botactions/SetUserEmojiStatusAction; + public static synthetic fun setUserEmojiStatus$default (JLjava/lang/String;Lkotlinx/datetime/Instant;ILjava/lang/Object;)Leu/vendeli/tgbot/api/botactions/SetUserEmojiStatusAction; +} + public final class eu/vendeli/tgbot/api/botactions/SetWebhookAction : eu/vendeli/tgbot/interfaces/action/SimpleAction, eu/vendeli/tgbot/interfaces/features/OptionsFeature { public fun (Ljava/lang/String;)V public synthetic fun getOptions$telegram_bot ()Leu/vendeli/tgbot/types/internal/options/Options; @@ -2540,10 +2606,6 @@ public final class eu/vendeli/tgbot/interfaces/helper/ImplicitMediaData$DefaultI public static fun setThumbnail (Leu/vendeli/tgbot/interfaces/helper/ImplicitMediaData;Leu/vendeli/tgbot/types/internal/ImplicitFile;)V } -public abstract interface class eu/vendeli/tgbot/interfaces/helper/Logger { - public abstract fun log (Leu/vendeli/tgbot/types/internal/LogLvl;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; -} - public abstract interface class eu/vendeli/tgbot/interfaces/helper/RateLimitMechanism { public abstract fun isLimited (Leu/vendeli/tgbot/types/internal/configuration/RateLimits;JLjava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; } @@ -7275,6 +7337,7 @@ public abstract class eu/vendeli/tgbot/types/internal/CommonMatcher { public final class eu/vendeli/tgbot/types/internal/CommonMatcher$Regex : eu/vendeli/tgbot/types/internal/CommonMatcher { public fun (Lkotlin/text/Regex;Lkotlin/reflect/KClass;Ljava/util/Set;)V + public synthetic fun (Lkotlin/text/Regex;Lkotlin/reflect/KClass;Ljava/util/Set;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public synthetic fun getValue ()Ljava/lang/Object; public fun getValue ()Lkotlin/text/Regex; public fun match (Ljava/lang/String;Leu/vendeli/tgbot/types/internal/ProcessedUpdate;Leu/vendeli/tgbot/TelegramBot;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -7282,6 +7345,7 @@ public final class eu/vendeli/tgbot/types/internal/CommonMatcher$Regex : eu/vend public final class eu/vendeli/tgbot/types/internal/CommonMatcher$String : eu/vendeli/tgbot/types/internal/CommonMatcher { public fun (Ljava/lang/String;Lkotlin/reflect/KClass;Ljava/util/Set;)V + public synthetic fun (Ljava/lang/String;Lkotlin/reflect/KClass;Ljava/util/Set;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public synthetic fun getValue ()Ljava/lang/Object; public fun getValue ()Ljava/lang/String; public fun match (Ljava/lang/String;Leu/vendeli/tgbot/types/internal/ProcessedUpdate;Leu/vendeli/tgbot/TelegramBot;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -7692,7 +7756,6 @@ public final class eu/vendeli/tgbot/types/internal/LogLvl : java/lang/Enum { public static final field TRACE Leu/vendeli/tgbot/types/internal/LogLvl; public static final field WARN Leu/vendeli/tgbot/types/internal/LogLvl; public static fun getEntries ()Lkotlin/enums/EnumEntries; - public final fun getInt ()I public static fun valueOf (Ljava/lang/String;)Leu/vendeli/tgbot/types/internal/LogLvl; public static fun values ()[Leu/vendeli/tgbot/types/internal/LogLvl; } @@ -8278,21 +8341,18 @@ public final class eu/vendeli/tgbot/types/internal/configuration/HttpConfigurati public final class eu/vendeli/tgbot/types/internal/configuration/LoggingConfiguration { public static final field Companion Leu/vendeli/tgbot/types/internal/configuration/LoggingConfiguration$Companion; public fun ()V - public fun (Leu/vendeli/tgbot/interfaces/helper/Logger;Leu/vendeli/tgbot/types/internal/LogLvl;Leu/vendeli/tgbot/types/internal/HttpLogLevel;)V - public synthetic fun (Leu/vendeli/tgbot/interfaces/helper/Logger;Leu/vendeli/tgbot/types/internal/LogLvl;Leu/vendeli/tgbot/types/internal/HttpLogLevel;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun component1 ()Leu/vendeli/tgbot/interfaces/helper/Logger; - public final fun component2 ()Leu/vendeli/tgbot/types/internal/LogLvl; - public final fun component3 ()Leu/vendeli/tgbot/types/internal/HttpLogLevel; - public final fun copy (Leu/vendeli/tgbot/interfaces/helper/Logger;Leu/vendeli/tgbot/types/internal/LogLvl;Leu/vendeli/tgbot/types/internal/HttpLogLevel;)Leu/vendeli/tgbot/types/internal/configuration/LoggingConfiguration; - public static synthetic fun copy$default (Leu/vendeli/tgbot/types/internal/configuration/LoggingConfiguration;Leu/vendeli/tgbot/interfaces/helper/Logger;Leu/vendeli/tgbot/types/internal/LogLvl;Leu/vendeli/tgbot/types/internal/HttpLogLevel;ILjava/lang/Object;)Leu/vendeli/tgbot/types/internal/configuration/LoggingConfiguration; + public fun (Leu/vendeli/tgbot/types/internal/LogLvl;Leu/vendeli/tgbot/types/internal/HttpLogLevel;)V + public synthetic fun (Leu/vendeli/tgbot/types/internal/LogLvl;Leu/vendeli/tgbot/types/internal/HttpLogLevel;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Leu/vendeli/tgbot/types/internal/LogLvl; + public final fun component2 ()Leu/vendeli/tgbot/types/internal/HttpLogLevel; + public final fun copy (Leu/vendeli/tgbot/types/internal/LogLvl;Leu/vendeli/tgbot/types/internal/HttpLogLevel;)Leu/vendeli/tgbot/types/internal/configuration/LoggingConfiguration; + public static synthetic fun copy$default (Leu/vendeli/tgbot/types/internal/configuration/LoggingConfiguration;Leu/vendeli/tgbot/types/internal/LogLvl;Leu/vendeli/tgbot/types/internal/HttpLogLevel;ILjava/lang/Object;)Leu/vendeli/tgbot/types/internal/configuration/LoggingConfiguration; public fun equals (Ljava/lang/Object;)Z public final fun getBotLogLevel ()Leu/vendeli/tgbot/types/internal/LogLvl; public final fun getHttpLogLevel ()Leu/vendeli/tgbot/types/internal/HttpLogLevel; - public final fun getLogger ()Leu/vendeli/tgbot/interfaces/helper/Logger; public fun hashCode ()I public final fun setBotLogLevel (Leu/vendeli/tgbot/types/internal/LogLvl;)V public final fun setHttpLogLevel (Leu/vendeli/tgbot/types/internal/HttpLogLevel;)V - public final fun setLogger (Leu/vendeli/tgbot/interfaces/helper/Logger;)V public fun toString ()Ljava/lang/String; } @@ -8783,25 +8843,26 @@ public final class eu/vendeli/tgbot/types/internal/options/CopyMessagesOptions$C public final class eu/vendeli/tgbot/types/internal/options/CreateInvoiceLinkOptions : eu/vendeli/tgbot/types/internal/options/Options { public static final field Companion Leu/vendeli/tgbot/types/internal/options/CreateInvoiceLinkOptions$Companion; - public fun ()V - public fun (Ljava/lang/Integer;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;)V - public synthetic fun (Ljava/lang/Integer;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun component1 ()Ljava/lang/Integer; - public final fun component10 ()Ljava/lang/Boolean; + public synthetic fun (Ljava/lang/String;Ljava/lang/Integer;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Boolean;Lkotlin/time/Duration;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Ljava/lang/String;Ljava/lang/Integer;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Boolean;Lkotlin/time/Duration;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component10-FghU774 ()Lkotlin/time/Duration; public final fun component11 ()Ljava/lang/Boolean; public final fun component12 ()Ljava/lang/Boolean; public final fun component13 ()Ljava/lang/Boolean; public final fun component14 ()Ljava/lang/Boolean; - public final fun component2 ()Ljava/util/List; - public final fun component3 ()Ljava/lang/String; + public final fun component15 ()Ljava/lang/Boolean; + public final fun component16 ()Ljava/lang/Boolean; + public final fun component2 ()Ljava/lang/Integer; + public final fun component3 ()Ljava/util/List; public final fun component4 ()Ljava/lang/String; - public final fun component5 ()Ljava/lang/Long; - public final fun component6 ()Ljava/lang/Integer; + public final fun component5 ()Ljava/lang/String; + public final fun component6 ()Ljava/lang/Long; public final fun component7 ()Ljava/lang/Integer; - public final fun component8 ()Ljava/lang/Boolean; + public final fun component8 ()Ljava/lang/Integer; public final fun component9 ()Ljava/lang/Boolean; - public final fun copy (Ljava/lang/Integer;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;)Leu/vendeli/tgbot/types/internal/options/CreateInvoiceLinkOptions; - public static synthetic fun copy$default (Leu/vendeli/tgbot/types/internal/options/CreateInvoiceLinkOptions;Ljava/lang/Integer;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;ILjava/lang/Object;)Leu/vendeli/tgbot/types/internal/options/CreateInvoiceLinkOptions; + public final fun copy-ivl2Zio (Ljava/lang/String;Ljava/lang/Integer;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Boolean;Lkotlin/time/Duration;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;)Leu/vendeli/tgbot/types/internal/options/CreateInvoiceLinkOptions; + public static synthetic fun copy-ivl2Zio$default (Leu/vendeli/tgbot/types/internal/options/CreateInvoiceLinkOptions;Ljava/lang/String;Ljava/lang/Integer;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Boolean;Lkotlin/time/Duration;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;ILjava/lang/Object;)Leu/vendeli/tgbot/types/internal/options/CreateInvoiceLinkOptions; public fun equals (Ljava/lang/Object;)Z public final fun getMaxTipAmount ()Ljava/lang/Integer; public final fun getNeedEmail ()Ljava/lang/Boolean; @@ -8813,8 +8874,10 @@ public final class eu/vendeli/tgbot/types/internal/options/CreateInvoiceLinkOpti public final fun getPhotoUrl ()Ljava/lang/String; public final fun getPhotoWidth ()Ljava/lang/Integer; public final fun getProviderData ()Ljava/lang/String; + public final fun getProviderToken ()Ljava/lang/String; public final fun getSendEmailToProvider ()Ljava/lang/Boolean; public final fun getSendPhoneNumberToProvider ()Ljava/lang/Boolean; + public final fun getSubscriptionPeriod-FghU774 ()Lkotlin/time/Duration; public final fun getSuggestedTipAmounts ()Ljava/util/List; public fun hashCode ()I public final fun isFlexible ()Ljava/lang/Boolean; @@ -8829,8 +8892,10 @@ public final class eu/vendeli/tgbot/types/internal/options/CreateInvoiceLinkOpti public final fun setPhotoUrl (Ljava/lang/String;)V public final fun setPhotoWidth (Ljava/lang/Integer;)V public final fun setProviderData (Ljava/lang/String;)V + public final fun setProviderToken (Ljava/lang/String;)V public final fun setSendEmailToProvider (Ljava/lang/Boolean;)V public final fun setSendPhoneNumberToProvider (Ljava/lang/Boolean;)V + public final fun setSubscriptionPeriod-BwNAW2A (Lkotlin/time/Duration;)V public final fun setSuggestedTipAmounts (Ljava/util/List;)V public fun toString ()Ljava/lang/String; } @@ -9088,7 +9153,7 @@ public final class eu/vendeli/tgbot/types/internal/options/EditMessageOptions$Co public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public abstract interface class eu/vendeli/tgbot/types/internal/options/ForumProps { +public abstract interface class eu/vendeli/tgbot/types/internal/options/ForumProps : eu/vendeli/tgbot/types/internal/options/Options { public abstract fun getMessageThreadId ()Ljava/lang/Integer; public abstract fun setMessageThreadId (Ljava/lang/Integer;)V } @@ -9309,7 +9374,7 @@ public final class eu/vendeli/tgbot/types/internal/options/InvoiceOptions$Compan public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public abstract interface class eu/vendeli/tgbot/types/internal/options/LinkPreviewProp { +public abstract interface class eu/vendeli/tgbot/types/internal/options/LinkPreviewProp : eu/vendeli/tgbot/types/internal/options/Options { public abstract fun disableWebPagePreview ()V public abstract fun getLinkPreviewOptions ()Leu/vendeli/tgbot/types/LinkPreviewOptions; public abstract fun linkPreviewOptions (Lkotlin/jvm/functions/Function1;)V @@ -9434,7 +9499,7 @@ public abstract interface class eu/vendeli/tgbot/types/internal/options/MediaSpo public abstract fun setHasSpoiler (Ljava/lang/Boolean;)V } -public abstract interface class eu/vendeli/tgbot/types/internal/options/MessageEffectIdProp { +public abstract interface class eu/vendeli/tgbot/types/internal/options/MessageEffectIdProp : eu/vendeli/tgbot/types/internal/options/Options { public abstract fun getMessageEffectId ()Ljava/lang/String; public abstract fun setMessageEffectId (Ljava/lang/String;)V } @@ -9644,18 +9709,17 @@ public final class eu/vendeli/tgbot/types/internal/options/PhotoOptions$Companio public final class eu/vendeli/tgbot/types/internal/options/PollOptions : eu/vendeli/tgbot/types/internal/options/ForumProps, eu/vendeli/tgbot/types/internal/options/MessageEffectIdProp, eu/vendeli/tgbot/types/internal/options/OptionsCommon { public static final field Companion Leu/vendeli/tgbot/types/internal/options/PollOptions$Companion; - public synthetic fun (Ljava/lang/Boolean;Leu/vendeli/tgbot/types/poll/PollType;Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/lang/String;Leu/vendeli/tgbot/types/ParseMode;Ljava/util/List;Lkotlin/time/Duration;Lkotlinx/datetime/Instant;Ljava/lang/Boolean;Leu/vendeli/tgbot/types/ParseMode;Ljava/util/List;Ljava/lang/Boolean;Leu/vendeli/tgbot/types/ReplyParameters;Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Boolean;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public synthetic fun (Ljava/lang/Boolean;Leu/vendeli/tgbot/types/poll/PollType;Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/lang/String;Leu/vendeli/tgbot/types/ParseMode;Ljava/util/List;Lkotlin/time/Duration;Lkotlinx/datetime/Instant;Ljava/lang/Boolean;Leu/vendeli/tgbot/types/ParseMode;Ljava/util/List;Ljava/lang/Boolean;Leu/vendeli/tgbot/types/ReplyParameters;Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Boolean;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Ljava/lang/Boolean;Leu/vendeli/tgbot/types/poll/PollType;Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/lang/String;Leu/vendeli/tgbot/types/ParseMode;Ljava/util/List;Lkotlin/time/Duration;Lkotlinx/datetime/Instant;Ljava/lang/Boolean;Leu/vendeli/tgbot/types/ParseMode;Ljava/lang/Boolean;Leu/vendeli/tgbot/types/ReplyParameters;Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Boolean;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Ljava/lang/Boolean;Leu/vendeli/tgbot/types/poll/PollType;Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/lang/String;Leu/vendeli/tgbot/types/ParseMode;Ljava/util/List;Lkotlin/time/Duration;Lkotlinx/datetime/Instant;Ljava/lang/Boolean;Leu/vendeli/tgbot/types/ParseMode;Ljava/lang/Boolean;Leu/vendeli/tgbot/types/ReplyParameters;Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Boolean;Lkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ljava/lang/Boolean; public final fun component10 ()Ljava/lang/Boolean; public final fun component11 ()Leu/vendeli/tgbot/types/ParseMode; - public final fun component12 ()Ljava/util/List; - public final fun component13 ()Ljava/lang/Boolean; - public final fun component14 ()Leu/vendeli/tgbot/types/ReplyParameters; - public final fun component15 ()Ljava/lang/Boolean; - public final fun component16 ()Ljava/lang/Integer; - public final fun component17 ()Ljava/lang/String; - public final fun component18 ()Ljava/lang/Boolean; + public final fun component12 ()Ljava/lang/Boolean; + public final fun component13 ()Leu/vendeli/tgbot/types/ReplyParameters; + public final fun component14 ()Ljava/lang/Boolean; + public final fun component15 ()Ljava/lang/Integer; + public final fun component16 ()Ljava/lang/String; + public final fun component17 ()Ljava/lang/Boolean; public final fun component2 ()Leu/vendeli/tgbot/types/poll/PollType; public final fun component3 ()Ljava/lang/Boolean; public final fun component4 ()Ljava/lang/Integer; @@ -9664,8 +9728,8 @@ public final class eu/vendeli/tgbot/types/internal/options/PollOptions : eu/vend public final fun component7 ()Ljava/util/List; public final fun component8-FghU774 ()Lkotlin/time/Duration; public final fun component9 ()Lkotlinx/datetime/Instant; - public final fun copy-prD4G00 (Ljava/lang/Boolean;Leu/vendeli/tgbot/types/poll/PollType;Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/lang/String;Leu/vendeli/tgbot/types/ParseMode;Ljava/util/List;Lkotlin/time/Duration;Lkotlinx/datetime/Instant;Ljava/lang/Boolean;Leu/vendeli/tgbot/types/ParseMode;Ljava/util/List;Ljava/lang/Boolean;Leu/vendeli/tgbot/types/ReplyParameters;Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Boolean;)Leu/vendeli/tgbot/types/internal/options/PollOptions; - public static synthetic fun copy-prD4G00$default (Leu/vendeli/tgbot/types/internal/options/PollOptions;Ljava/lang/Boolean;Leu/vendeli/tgbot/types/poll/PollType;Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/lang/String;Leu/vendeli/tgbot/types/ParseMode;Ljava/util/List;Lkotlin/time/Duration;Lkotlinx/datetime/Instant;Ljava/lang/Boolean;Leu/vendeli/tgbot/types/ParseMode;Ljava/util/List;Ljava/lang/Boolean;Leu/vendeli/tgbot/types/ReplyParameters;Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Boolean;ILjava/lang/Object;)Leu/vendeli/tgbot/types/internal/options/PollOptions; + public final fun copy--jGinlM (Ljava/lang/Boolean;Leu/vendeli/tgbot/types/poll/PollType;Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/lang/String;Leu/vendeli/tgbot/types/ParseMode;Ljava/util/List;Lkotlin/time/Duration;Lkotlinx/datetime/Instant;Ljava/lang/Boolean;Leu/vendeli/tgbot/types/ParseMode;Ljava/lang/Boolean;Leu/vendeli/tgbot/types/ReplyParameters;Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Boolean;)Leu/vendeli/tgbot/types/internal/options/PollOptions; + public static synthetic fun copy--jGinlM$default (Leu/vendeli/tgbot/types/internal/options/PollOptions;Ljava/lang/Boolean;Leu/vendeli/tgbot/types/poll/PollType;Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/lang/String;Leu/vendeli/tgbot/types/ParseMode;Ljava/util/List;Lkotlin/time/Duration;Lkotlinx/datetime/Instant;Ljava/lang/Boolean;Leu/vendeli/tgbot/types/ParseMode;Ljava/lang/Boolean;Leu/vendeli/tgbot/types/ReplyParameters;Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Boolean;ILjava/lang/Object;)Leu/vendeli/tgbot/types/internal/options/PollOptions; public fun equals (Ljava/lang/Object;)Z public fun getAllowPaidBroadcast ()Ljava/lang/Boolean; public final fun getAllowsMultipleAnswers ()Ljava/lang/Boolean; @@ -9679,7 +9743,6 @@ public final class eu/vendeli/tgbot/types/internal/options/PollOptions : eu/vend public fun getMessageThreadId ()Ljava/lang/Integer; public final fun getOpenPeriod-FghU774 ()Lkotlin/time/Duration; public fun getProtectContent ()Ljava/lang/Boolean; - public final fun getQuestionEntities ()Ljava/util/List; public final fun getQuestionParseMode ()Leu/vendeli/tgbot/types/ParseMode; public fun getReplyParameters ()Leu/vendeli/tgbot/types/ReplyParameters; public fun getReplyToMessageId ()Ljava/lang/Long; @@ -9702,7 +9765,6 @@ public final class eu/vendeli/tgbot/types/internal/options/PollOptions : eu/vend public fun setMessageThreadId (Ljava/lang/Integer;)V public final fun setOpenPeriod-BwNAW2A (Lkotlin/time/Duration;)V public fun setProtectContent (Ljava/lang/Boolean;)V - public final fun setQuestionEntities (Ljava/util/List;)V public final fun setQuestionParseMode (Leu/vendeli/tgbot/types/ParseMode;)V public fun setReplyParameters (Leu/vendeli/tgbot/types/ReplyParameters;)V public fun setReplyToMessageId (Ljava/lang/Long;)V @@ -9767,13 +9829,16 @@ public final class eu/vendeli/tgbot/types/internal/options/PromoteChatMemberOpti public final fun setAnonymous (Ljava/lang/Boolean;)V public final fun setCanChangeInfo (Ljava/lang/Boolean;)V public final fun setCanDeleteMessages (Ljava/lang/Boolean;)V + public final fun setCanDeleteStories (Ljava/lang/Boolean;)V public final fun setCanEditMessages (Ljava/lang/Boolean;)V + public final fun setCanEditStories (Ljava/lang/Boolean;)V public final fun setCanInviteUsers (Ljava/lang/Boolean;)V public final fun setCanManageChat (Ljava/lang/Boolean;)V public final fun setCanManageTopics (Ljava/lang/Boolean;)V public final fun setCanManageVideoChats (Ljava/lang/Boolean;)V public final fun setCanPinMessages (Ljava/lang/Boolean;)V public final fun setCanPostMessages (Ljava/lang/Boolean;)V + public final fun setCanPostStories (Ljava/lang/Boolean;)V public final fun setCanPromoteMembers (Ljava/lang/Boolean;)V public final fun setCanRestrictMembers (Ljava/lang/Boolean;)V public fun toString ()Ljava/lang/String; @@ -9836,6 +9901,29 @@ public final class eu/vendeli/tgbot/types/internal/options/ReplyKeyboardMarkupOp public final fun serializer ()Lkotlinx/serialization/KSerializer; } +public final class eu/vendeli/tgbot/types/internal/options/SavePreparedInlineMessageOptions : eu/vendeli/tgbot/types/internal/options/Options { + public fun ()V + public fun (Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;)V + public synthetic fun (Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/Boolean; + public final fun component2 ()Ljava/lang/Boolean; + public final fun component3 ()Ljava/lang/Boolean; + public final fun component4 ()Ljava/lang/Boolean; + public final fun copy (Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;)Leu/vendeli/tgbot/types/internal/options/SavePreparedInlineMessageOptions; + public static synthetic fun copy$default (Leu/vendeli/tgbot/types/internal/options/SavePreparedInlineMessageOptions;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;ILjava/lang/Object;)Leu/vendeli/tgbot/types/internal/options/SavePreparedInlineMessageOptions; + public fun equals (Ljava/lang/Object;)Z + public final fun getAllowBotChats ()Ljava/lang/Boolean; + public final fun getAllowChannelChats ()Ljava/lang/Boolean; + public final fun getAllowGroupChats ()Ljava/lang/Boolean; + public final fun getAllowUserChats ()Ljava/lang/Boolean; + public fun hashCode ()I + public final fun setAllowBotChats (Ljava/lang/Boolean;)V + public final fun setAllowChannelChats (Ljava/lang/Boolean;)V + public final fun setAllowGroupChats (Ljava/lang/Boolean;)V + public final fun setAllowUserChats (Ljava/lang/Boolean;)V + public fun toString ()Ljava/lang/String; +} + public final class eu/vendeli/tgbot/types/internal/options/SetGameScoreOptions : eu/vendeli/tgbot/types/internal/options/Options { public static final field Companion Leu/vendeli/tgbot/types/internal/options/SetGameScoreOptions$Companion; public fun ()V @@ -9914,7 +10002,7 @@ public final class eu/vendeli/tgbot/types/internal/options/SetWebhookOptions$Com public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public abstract interface class eu/vendeli/tgbot/types/internal/options/ShowCaptionAboveMediaProp { +public abstract interface class eu/vendeli/tgbot/types/internal/options/ShowCaptionAboveMediaProp : eu/vendeli/tgbot/types/internal/options/Options { public abstract fun getShowCaptionAboveMedia ()Ljava/lang/Boolean; public abstract fun setShowCaptionAboveMedia (Ljava/lang/Boolean;)V } @@ -9946,6 +10034,7 @@ public final class eu/vendeli/tgbot/types/internal/options/StickerOptions : eu/v public fun replyParameters (JLkotlin/jvm/functions/Function1;)V public fun setAllowPaidBroadcast (Ljava/lang/Boolean;)V public fun setDisableNotification (Ljava/lang/Boolean;)V + public final fun setEmoji (Ljava/lang/String;)V public fun setMessageEffectId (Ljava/lang/String;)V public fun setMessageThreadId (Ljava/lang/Integer;)V public fun setProtectContent (Ljava/lang/Boolean;)V @@ -9969,7 +10058,7 @@ public final class eu/vendeli/tgbot/types/internal/options/StickerOptions$Compan public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public abstract interface class eu/vendeli/tgbot/types/internal/options/ThumbnailProp { +public abstract interface class eu/vendeli/tgbot/types/internal/options/ThumbnailProp : eu/vendeli/tgbot/types/internal/options/Options { public abstract fun getThumbnail ()Leu/vendeli/tgbot/types/internal/ImplicitFile; public abstract fun setThumbnail (Leu/vendeli/tgbot/types/internal/ImplicitFile;)V } @@ -12461,6 +12550,35 @@ public final class eu/vendeli/tgbot/types/msg/MessageReactionUpdated$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } +public final class eu/vendeli/tgbot/types/msg/PreparedInlineMessage { + public static final field Companion Leu/vendeli/tgbot/types/msg/PreparedInlineMessage$Companion; + public fun (Ljava/lang/String;Lkotlinx/datetime/Instant;)V + public final fun component1 ()Ljava/lang/String; + public final fun component2 ()Lkotlinx/datetime/Instant; + public final fun copy (Ljava/lang/String;Lkotlinx/datetime/Instant;)Leu/vendeli/tgbot/types/msg/PreparedInlineMessage; + public static synthetic fun copy$default (Leu/vendeli/tgbot/types/msg/PreparedInlineMessage;Ljava/lang/String;Lkotlinx/datetime/Instant;ILjava/lang/Object;)Leu/vendeli/tgbot/types/msg/PreparedInlineMessage; + public fun equals (Ljava/lang/Object;)Z + public final fun getExpirationDate ()Lkotlinx/datetime/Instant; + public final fun getId ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class eu/vendeli/tgbot/types/msg/PreparedInlineMessage$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Leu/vendeli/tgbot/types/msg/PreparedInlineMessage$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Leu/vendeli/tgbot/types/msg/PreparedInlineMessage; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Leu/vendeli/tgbot/types/msg/PreparedInlineMessage;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class eu/vendeli/tgbot/types/msg/PreparedInlineMessage$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + public final class eu/vendeli/tgbot/types/passport/EncryptedCredentials { public static final field Companion Leu/vendeli/tgbot/types/passport/EncryptedCredentials$Companion; public fun (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V @@ -13195,26 +13313,32 @@ public final class eu/vendeli/tgbot/types/payment/ShippingQuery$Companion { public final class eu/vendeli/tgbot/types/payment/SuccessfulPayment { public static final field Companion Leu/vendeli/tgbot/types/payment/SuccessfulPayment$Companion; - public fun (Leu/vendeli/tgbot/types/internal/Currency;ILjava/lang/String;Ljava/lang/String;Leu/vendeli/tgbot/types/payment/OrderInfo;Ljava/lang/String;Ljava/lang/String;)V - public synthetic fun (Leu/vendeli/tgbot/types/internal/Currency;ILjava/lang/String;Ljava/lang/String;Leu/vendeli/tgbot/types/payment/OrderInfo;Ljava/lang/String;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun (Leu/vendeli/tgbot/types/internal/Currency;ILjava/lang/String;Ljava/lang/String;Leu/vendeli/tgbot/types/payment/OrderInfo;Lkotlinx/datetime/Instant;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/String;)V + public synthetic fun (Leu/vendeli/tgbot/types/internal/Currency;ILjava/lang/String;Ljava/lang/String;Leu/vendeli/tgbot/types/payment/OrderInfo;Lkotlinx/datetime/Instant;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Leu/vendeli/tgbot/types/internal/Currency; + public final fun component10 ()Ljava/lang/String; public final fun component2 ()I public final fun component3 ()Ljava/lang/String; public final fun component4 ()Ljava/lang/String; public final fun component5 ()Leu/vendeli/tgbot/types/payment/OrderInfo; - public final fun component6 ()Ljava/lang/String; - public final fun component7 ()Ljava/lang/String; - public final fun copy (Leu/vendeli/tgbot/types/internal/Currency;ILjava/lang/String;Ljava/lang/String;Leu/vendeli/tgbot/types/payment/OrderInfo;Ljava/lang/String;Ljava/lang/String;)Leu/vendeli/tgbot/types/payment/SuccessfulPayment; - public static synthetic fun copy$default (Leu/vendeli/tgbot/types/payment/SuccessfulPayment;Leu/vendeli/tgbot/types/internal/Currency;ILjava/lang/String;Ljava/lang/String;Leu/vendeli/tgbot/types/payment/OrderInfo;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Leu/vendeli/tgbot/types/payment/SuccessfulPayment; + public final fun component6 ()Lkotlinx/datetime/Instant; + public final fun component7 ()Ljava/lang/Boolean; + public final fun component8 ()Ljava/lang/Boolean; + public final fun component9 ()Ljava/lang/String; + public final fun copy (Leu/vendeli/tgbot/types/internal/Currency;ILjava/lang/String;Ljava/lang/String;Leu/vendeli/tgbot/types/payment/OrderInfo;Lkotlinx/datetime/Instant;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/String;)Leu/vendeli/tgbot/types/payment/SuccessfulPayment; + public static synthetic fun copy$default (Leu/vendeli/tgbot/types/payment/SuccessfulPayment;Leu/vendeli/tgbot/types/internal/Currency;ILjava/lang/String;Ljava/lang/String;Leu/vendeli/tgbot/types/payment/OrderInfo;Lkotlinx/datetime/Instant;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Leu/vendeli/tgbot/types/payment/SuccessfulPayment; public fun equals (Ljava/lang/Object;)Z public final fun getCurrency ()Leu/vendeli/tgbot/types/internal/Currency; public final fun getInvoicePayload ()Ljava/lang/String; public final fun getOrderInfo ()Leu/vendeli/tgbot/types/payment/OrderInfo; public final fun getProviderPaymentChargeId ()Ljava/lang/String; public final fun getShippingOptionId ()Ljava/lang/String; + public final fun getSubscriptionExpirationDate ()Lkotlinx/datetime/Instant; public final fun getTelegramPaymentChargeId ()Ljava/lang/String; public final fun getTotalAmount ()I public fun hashCode ()I + public final fun isFirstRecurring ()Ljava/lang/Boolean; + public final fun isRecurring ()Ljava/lang/Boolean; public fun toString ()Ljava/lang/String; } @@ -13570,18 +13694,22 @@ public final class eu/vendeli/tgbot/types/stars/TransactionPartner$TelegramApi$C public final class eu/vendeli/tgbot/types/stars/TransactionPartner$UserPartner : eu/vendeli/tgbot/types/stars/TransactionPartner { public static final field Companion Leu/vendeli/tgbot/types/stars/TransactionPartner$UserPartner$Companion; - public fun (Leu/vendeli/tgbot/types/User;Ljava/lang/String;Ljava/util/List;Ljava/lang/String;)V - public synthetic fun (Leu/vendeli/tgbot/types/User;Ljava/lang/String;Ljava/util/List;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Leu/vendeli/tgbot/types/User;Ljava/lang/String;Ljava/util/List;Ljava/lang/String;Lkotlin/time/Duration;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Leu/vendeli/tgbot/types/User;Ljava/lang/String;Ljava/util/List;Ljava/lang/String;Lkotlin/time/Duration;Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Leu/vendeli/tgbot/types/User; public final fun component2 ()Ljava/lang/String; public final fun component3 ()Ljava/util/List; public final fun component4 ()Ljava/lang/String; - public final fun copy (Leu/vendeli/tgbot/types/User;Ljava/lang/String;Ljava/util/List;Ljava/lang/String;)Leu/vendeli/tgbot/types/stars/TransactionPartner$UserPartner; - public static synthetic fun copy$default (Leu/vendeli/tgbot/types/stars/TransactionPartner$UserPartner;Leu/vendeli/tgbot/types/User;Ljava/lang/String;Ljava/util/List;Ljava/lang/String;ILjava/lang/Object;)Leu/vendeli/tgbot/types/stars/TransactionPartner$UserPartner; + public final fun component5-FghU774 ()Lkotlin/time/Duration; + public final fun component6 ()Ljava/lang/String; + public final fun copy-yV_PMig (Leu/vendeli/tgbot/types/User;Ljava/lang/String;Ljava/util/List;Ljava/lang/String;Lkotlin/time/Duration;Ljava/lang/String;)Leu/vendeli/tgbot/types/stars/TransactionPartner$UserPartner; + public static synthetic fun copy-yV_PMig$default (Leu/vendeli/tgbot/types/stars/TransactionPartner$UserPartner;Leu/vendeli/tgbot/types/User;Ljava/lang/String;Ljava/util/List;Ljava/lang/String;Lkotlin/time/Duration;Ljava/lang/String;ILjava/lang/Object;)Leu/vendeli/tgbot/types/stars/TransactionPartner$UserPartner; public fun equals (Ljava/lang/Object;)Z + public final fun getGift ()Ljava/lang/String; public final fun getInvoicePayload ()Ljava/lang/String; public final fun getPaidMedia ()Ljava/util/List; public final fun getPaidMediaPayload ()Ljava/lang/String; + public final fun getSubscriptionPeriod-FghU774 ()Lkotlin/time/Duration; public final fun getUser ()Leu/vendeli/tgbot/types/User; public fun hashCode ()I public fun toString ()Ljava/lang/String; @@ -13602,6 +13730,69 @@ public final class eu/vendeli/tgbot/types/stars/TransactionPartner$UserPartner$C public final fun serializer ()Lkotlinx/serialization/KSerializer; } +public final class eu/vendeli/tgbot/types/user/Gift { + public static final field Companion Leu/vendeli/tgbot/types/user/Gift$Companion; + public fun (Ljava/lang/String;Leu/vendeli/tgbot/types/media/Sticker;ILjava/lang/Integer;Ljava/lang/Integer;)V + public synthetic fun (Ljava/lang/String;Leu/vendeli/tgbot/types/media/Sticker;ILjava/lang/Integer;Ljava/lang/Integer;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component2 ()Leu/vendeli/tgbot/types/media/Sticker; + public final fun component3 ()I + public final fun component4 ()Ljava/lang/Integer; + public final fun component5 ()Ljava/lang/Integer; + public final fun copy (Ljava/lang/String;Leu/vendeli/tgbot/types/media/Sticker;ILjava/lang/Integer;Ljava/lang/Integer;)Leu/vendeli/tgbot/types/user/Gift; + public static synthetic fun copy$default (Leu/vendeli/tgbot/types/user/Gift;Ljava/lang/String;Leu/vendeli/tgbot/types/media/Sticker;ILjava/lang/Integer;Ljava/lang/Integer;ILjava/lang/Object;)Leu/vendeli/tgbot/types/user/Gift; + public fun equals (Ljava/lang/Object;)Z + public final fun getId ()Ljava/lang/String; + public final fun getRemainingCount ()Ljava/lang/Integer; + public final fun getStarCount ()I + public final fun getSticker ()Leu/vendeli/tgbot/types/media/Sticker; + public final fun getTotalCount ()Ljava/lang/Integer; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class eu/vendeli/tgbot/types/user/Gift$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Leu/vendeli/tgbot/types/user/Gift$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Leu/vendeli/tgbot/types/user/Gift; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Leu/vendeli/tgbot/types/user/Gift;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class eu/vendeli/tgbot/types/user/Gift$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class eu/vendeli/tgbot/types/user/Gifts { + public static final field Companion Leu/vendeli/tgbot/types/user/Gifts$Companion; + public fun (Ljava/util/List;)V + public final fun component1 ()Ljava/util/List; + public final fun copy (Ljava/util/List;)Leu/vendeli/tgbot/types/user/Gifts; + public static synthetic fun copy$default (Leu/vendeli/tgbot/types/user/Gifts;Ljava/util/List;ILjava/lang/Object;)Leu/vendeli/tgbot/types/user/Gifts; + public fun equals (Ljava/lang/Object;)Z + public final fun getGifts ()Ljava/util/List; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class eu/vendeli/tgbot/types/user/Gifts$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Leu/vendeli/tgbot/types/user/Gifts$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Leu/vendeli/tgbot/types/user/Gifts; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Leu/vendeli/tgbot/types/user/Gifts;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class eu/vendeli/tgbot/types/user/Gifts$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + public final class eu/vendeli/tgbot/utils/BotUtils_jvmKt { public static final fun getFqName (Lkotlin/reflect/KClass;)Ljava/lang/String; public static final fun get_OperatingActivities ()Ljava/util/Map; @@ -13614,7 +13805,6 @@ public final class eu/vendeli/tgbot/utils/CONSTKt { } public final class eu/vendeli/tgbot/utils/CommonExtenstionsKt { - public static final fun checkIsInitDataSafe (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z public static final fun runExceptionHandler (Leu/vendeli/tgbot/core/TgUpdateHandler;Lkotlinx/coroutines/CoroutineDispatcher;JLeu/vendeli/tgbot/interfaces/helper/ExceptionHandler;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static synthetic fun runExceptionHandler$default (Leu/vendeli/tgbot/core/TgUpdateHandler;Lkotlinx/coroutines/CoroutineDispatcher;JLeu/vendeli/tgbot/interfaces/helper/ExceptionHandler;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static final fun setChain (Leu/vendeli/tgbot/interfaces/ctx/InputListener;Leu/vendeli/tgbot/types/User;Leu/vendeli/tgbot/types/internal/chain/Link;)V @@ -13662,15 +13852,12 @@ public final class eu/vendeli/tgbot/utils/FunctionalDSLUtilsKt { public static final fun onShippingQuery (Leu/vendeli/tgbot/core/FunctionalHandlingDsl;Lkotlin/jvm/functions/Function2;)V } -public final class eu/vendeli/tgbot/utils/LoggingWrapper { - public fun (Leu/vendeli/tgbot/types/internal/configuration/LoggingConfiguration;Ljava/lang/String;)V - public synthetic fun (Leu/vendeli/tgbot/types/internal/configuration/LoggingConfiguration;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun debug (Lkotlin/jvm/functions/Function0;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public final fun error (Ljava/lang/Throwable;Lkotlin/jvm/functions/Function0;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public static synthetic fun error$default (Leu/vendeli/tgbot/utils/LoggingWrapper;Ljava/lang/Throwable;Lkotlin/jvm/functions/Function0;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; - public final fun info (Lkotlin/jvm/functions/Function0;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public final fun trace (Lkotlin/jvm/functions/Function0;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public final fun warn (Lkotlin/jvm/functions/Function0;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; +public final class eu/vendeli/tgbot/utils/LoggingUtilsKt { + public static final fun debug (Lorg/slf4j/Logger;Lkotlin/jvm/functions/Function0;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun error (Lorg/slf4j/Logger;Ljava/lang/Throwable;Lkotlin/jvm/functions/Function0;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun error$default (Lorg/slf4j/Logger;Ljava/lang/Throwable;Lkotlin/jvm/functions/Function0;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final fun info (Lorg/slf4j/Logger;Lkotlin/jvm/functions/Function0;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun warn (Lorg/slf4j/Logger;Lkotlin/jvm/functions/Function0;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; } public class eu/vendeli/tgbot/utils/TgException : java/lang/RuntimeException { diff --git a/telegram-bot/api/telegram-bot.klib.api b/telegram-bot/api/telegram-bot.klib.api index 2234fa2c54..f3dc2e607e 100644 --- a/telegram-bot/api/telegram-bot.klib.api +++ b/telegram-bot/api/telegram-bot.klib.api @@ -26,6 +26,13 @@ open annotation class eu.vendeli.tgbot.annotations.internal/TgAPI : kotlin/Annot } } +open annotation class eu.vendeli.tgbot.annotations/ArgParser : kotlin/Annotation { // eu.vendeli.tgbot.annotations/ArgParser|null[0] + constructor (kotlin.reflect/KClass = ...) // eu.vendeli.tgbot.annotations/ArgParser.|(kotlin.reflect.KClass){}[0] + + final val argParser // eu.vendeli.tgbot.annotations/ArgParser.argParser|{}argParser[0] + final fun (): kotlin.reflect/KClass // eu.vendeli.tgbot.annotations/ArgParser.argParser.|(){}[0] +} + open annotation class eu.vendeli.tgbot.annotations/CommandHandler : kotlin/Annotation { // eu.vendeli.tgbot.annotations/CommandHandler|null[0] constructor (kotlin/Array, eu.vendeli.tgbot.annotations/RateLimits = ..., kotlin/Array = ..., kotlin.reflect/KClass = ..., kotlin.reflect/KClass = ...) // eu.vendeli.tgbot.annotations/CommandHandler.|(kotlin.Array;eu.vendeli.tgbot.annotations.RateLimits;kotlin.Array;kotlin.reflect.KClass;kotlin.reflect.KClass){}[0] @@ -41,10 +48,12 @@ open annotation class eu.vendeli.tgbot.annotations/CommandHandler : kotlin/Annot final fun (): kotlin/Array // eu.vendeli.tgbot.annotations/CommandHandler.value.|(){}[0] open annotation class CallbackQuery : kotlin/Annotation { // eu.vendeli.tgbot.annotations/CommandHandler.CallbackQuery|null[0] - constructor (kotlin/Array, eu.vendeli.tgbot.annotations/RateLimits = ..., kotlin.reflect/KClass = ..., kotlin.reflect/KClass = ...) // eu.vendeli.tgbot.annotations/CommandHandler.CallbackQuery.|(kotlin.Array;eu.vendeli.tgbot.annotations.RateLimits;kotlin.reflect.KClass;kotlin.reflect.KClass){}[0] + constructor (kotlin/Array, kotlin/Boolean = ..., eu.vendeli.tgbot.annotations/RateLimits = ..., kotlin.reflect/KClass = ..., kotlin.reflect/KClass = ...) // eu.vendeli.tgbot.annotations/CommandHandler.CallbackQuery.|(kotlin.Array;kotlin.Boolean;eu.vendeli.tgbot.annotations.RateLimits;kotlin.reflect.KClass;kotlin.reflect.KClass){}[0] final val argParser // eu.vendeli.tgbot.annotations/CommandHandler.CallbackQuery.argParser|{}argParser[0] final fun (): kotlin.reflect/KClass // eu.vendeli.tgbot.annotations/CommandHandler.CallbackQuery.argParser.|(){}[0] + final val autoAnswer // eu.vendeli.tgbot.annotations/CommandHandler.CallbackQuery.autoAnswer|{}autoAnswer[0] + final fun (): kotlin/Boolean // eu.vendeli.tgbot.annotations/CommandHandler.CallbackQuery.autoAnswer.|(){}[0] final val guard // eu.vendeli.tgbot.annotations/CommandHandler.CallbackQuery.guard|{}guard[0] final fun (): kotlin.reflect/KClass // eu.vendeli.tgbot.annotations/CommandHandler.CallbackQuery.guard.|(){}[0] final val rateLimits // eu.vendeli.tgbot.annotations/CommandHandler.CallbackQuery.rateLimits|{}rateLimits[0] @@ -98,6 +107,13 @@ open annotation class eu.vendeli.tgbot.annotations/CtxProvider : kotlin/Annotati constructor () // eu.vendeli.tgbot.annotations/CtxProvider.|(){}[0] } +open annotation class eu.vendeli.tgbot.annotations/Guard : kotlin/Annotation { // eu.vendeli.tgbot.annotations/Guard|null[0] + constructor (kotlin.reflect/KClass = ...) // eu.vendeli.tgbot.annotations/Guard.|(kotlin.reflect.KClass){}[0] + + final val guard // eu.vendeli.tgbot.annotations/Guard.guard|{}guard[0] + final fun (): kotlin.reflect/KClass // eu.vendeli.tgbot.annotations/Guard.guard.|(){}[0] +} + open annotation class eu.vendeli.tgbot.annotations/Injectable : kotlin/Annotation { // eu.vendeli.tgbot.annotations/Injectable|null[0] constructor () // eu.vendeli.tgbot.annotations/Injectable.|(){}[0] } @@ -335,8 +351,6 @@ final enum class eu.vendeli.tgbot.types.internal/LogLvl : kotlin/Enum(): kotlin.enums/EnumEntries // eu.vendeli.tgbot.types.internal/LogLvl.entries.|#static(){}[0] - final val int // eu.vendeli.tgbot.types.internal/LogLvl.int|{}int[0] - final fun (): kotlin/Int // eu.vendeli.tgbot.types.internal/LogLvl.int.|(){}[0] final fun valueOf(kotlin/String): eu.vendeli.tgbot.types.internal/LogLvl // eu.vendeli.tgbot.types.internal/LogLvl.valueOf|valueOf#static(kotlin.String){}[0] final fun values(): kotlin/Array // eu.vendeli.tgbot.types.internal/LogLvl.values|values#static(){}[0] @@ -630,10 +644,6 @@ abstract fun interface eu.vendeli.tgbot.interfaces.helper/Guard { // eu.vendeli. abstract suspend fun condition(eu.vendeli.tgbot.types/User?, eu.vendeli.tgbot.types.internal/ProcessedUpdate, eu.vendeli.tgbot/TelegramBot): kotlin/Boolean // eu.vendeli.tgbot.interfaces.helper/Guard.condition|condition(eu.vendeli.tgbot.types.User?;eu.vendeli.tgbot.types.internal.ProcessedUpdate;eu.vendeli.tgbot.TelegramBot){}[0] } -abstract fun interface eu.vendeli.tgbot.interfaces.helper/Logger { // eu.vendeli.tgbot.interfaces.helper/Logger|null[0] - abstract suspend fun log(eu.vendeli.tgbot.types.internal/LogLvl, kotlin/String?, kotlin/String, kotlin/Throwable?) // eu.vendeli.tgbot.interfaces.helper/Logger.log|log(eu.vendeli.tgbot.types.internal.LogLvl;kotlin.String?;kotlin.String;kotlin.Throwable?){}[0] -} - abstract fun interface eu.vendeli.tgbot.interfaces.helper/RateLimitMechanism { // eu.vendeli.tgbot.interfaces.helper/RateLimitMechanism|null[0] abstract suspend fun isLimited(eu.vendeli.tgbot.types.internal.configuration/RateLimits, kotlin/Long, kotlin/String?): kotlin/Boolean // eu.vendeli.tgbot.interfaces.helper/RateLimitMechanism.isLimited|isLimited(eu.vendeli.tgbot.types.internal.configuration.RateLimits;kotlin.Long;kotlin.String?){}[0] } @@ -787,13 +797,13 @@ abstract interface eu.vendeli.tgbot.interfaces.marker/Keyboard { // eu.vendeli.t abstract interface eu.vendeli.tgbot.interfaces.marker/MultipleResponse // eu.vendeli.tgbot.interfaces.marker/MultipleResponse|null[0] -abstract interface eu.vendeli.tgbot.types.internal.options/ForumProps { // eu.vendeli.tgbot.types.internal.options/ForumProps|null[0] +abstract interface eu.vendeli.tgbot.types.internal.options/ForumProps : eu.vendeli.tgbot.types.internal.options/Options { // eu.vendeli.tgbot.types.internal.options/ForumProps|null[0] abstract var messageThreadId // eu.vendeli.tgbot.types.internal.options/ForumProps.messageThreadId|{}messageThreadId[0] abstract fun (): kotlin/Int? // eu.vendeli.tgbot.types.internal.options/ForumProps.messageThreadId.|(){}[0] abstract fun (kotlin/Int?) // eu.vendeli.tgbot.types.internal.options/ForumProps.messageThreadId.|(kotlin.Int?){}[0] } -abstract interface eu.vendeli.tgbot.types.internal.options/LinkPreviewProp { // eu.vendeli.tgbot.types.internal.options/LinkPreviewProp|null[0] +abstract interface eu.vendeli.tgbot.types.internal.options/LinkPreviewProp : eu.vendeli.tgbot.types.internal.options/Options { // eu.vendeli.tgbot.types.internal.options/LinkPreviewProp|null[0] abstract var linkPreviewOptions // eu.vendeli.tgbot.types.internal.options/LinkPreviewProp.linkPreviewOptions|{}linkPreviewOptions[0] abstract fun (): eu.vendeli.tgbot.types/LinkPreviewOptions? // eu.vendeli.tgbot.types.internal.options/LinkPreviewProp.linkPreviewOptions.|(){}[0] abstract fun (eu.vendeli.tgbot.types/LinkPreviewOptions?) // eu.vendeli.tgbot.types.internal.options/LinkPreviewProp.linkPreviewOptions.|(eu.vendeli.tgbot.types.LinkPreviewOptions?){}[0] @@ -808,7 +818,7 @@ abstract interface eu.vendeli.tgbot.types.internal.options/MediaSpoiler : eu.ven abstract fun (kotlin/Boolean?) // eu.vendeli.tgbot.types.internal.options/MediaSpoiler.hasSpoiler.|(kotlin.Boolean?){}[0] } -abstract interface eu.vendeli.tgbot.types.internal.options/MessageEffectIdProp { // eu.vendeli.tgbot.types.internal.options/MessageEffectIdProp|null[0] +abstract interface eu.vendeli.tgbot.types.internal.options/MessageEffectIdProp : eu.vendeli.tgbot.types.internal.options/Options { // eu.vendeli.tgbot.types.internal.options/MessageEffectIdProp|null[0] abstract var messageEffectId // eu.vendeli.tgbot.types.internal.options/MessageEffectIdProp.messageEffectId|{}messageEffectId[0] abstract fun (): kotlin/String? // eu.vendeli.tgbot.types.internal.options/MessageEffectIdProp.messageEffectId.|(){}[0] abstract fun (kotlin/String?) // eu.vendeli.tgbot.types.internal.options/MessageEffectIdProp.messageEffectId.|(kotlin.String?){}[0] @@ -820,13 +830,13 @@ abstract interface eu.vendeli.tgbot.types.internal.options/OptionsParseMode : eu abstract fun (eu.vendeli.tgbot.types/ParseMode?) // eu.vendeli.tgbot.types.internal.options/OptionsParseMode.parseMode.|(eu.vendeli.tgbot.types.ParseMode?){}[0] } -abstract interface eu.vendeli.tgbot.types.internal.options/ShowCaptionAboveMediaProp { // eu.vendeli.tgbot.types.internal.options/ShowCaptionAboveMediaProp|null[0] +abstract interface eu.vendeli.tgbot.types.internal.options/ShowCaptionAboveMediaProp : eu.vendeli.tgbot.types.internal.options/Options { // eu.vendeli.tgbot.types.internal.options/ShowCaptionAboveMediaProp|null[0] abstract var showCaptionAboveMedia // eu.vendeli.tgbot.types.internal.options/ShowCaptionAboveMediaProp.showCaptionAboveMedia|{}showCaptionAboveMedia[0] abstract fun (): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/ShowCaptionAboveMediaProp.showCaptionAboveMedia.|(){}[0] abstract fun (kotlin/Boolean?) // eu.vendeli.tgbot.types.internal.options/ShowCaptionAboveMediaProp.showCaptionAboveMedia.|(kotlin.Boolean?){}[0] } -abstract interface eu.vendeli.tgbot.types.internal.options/ThumbnailProp { // eu.vendeli.tgbot.types.internal.options/ThumbnailProp|null[0] +abstract interface eu.vendeli.tgbot.types.internal.options/ThumbnailProp : eu.vendeli.tgbot.types.internal.options/Options { // eu.vendeli.tgbot.types.internal.options/ThumbnailProp|null[0] abstract var thumbnail // eu.vendeli.tgbot.types.internal.options/ThumbnailProp.thumbnail|{}thumbnail[0] abstract fun (): eu.vendeli.tgbot.types.internal/ImplicitFile? // eu.vendeli.tgbot.types.internal.options/ThumbnailProp.thumbnail.|(){}[0] abstract fun (eu.vendeli.tgbot.types.internal/ImplicitFile?) // eu.vendeli.tgbot.types.internal.options/ThumbnailProp.thumbnail.|(eu.vendeli.tgbot.types.internal.ImplicitFile?){}[0] @@ -1069,8 +1079,8 @@ final class eu.vendeli.tgbot.api.botactions/CloseAction : eu.vendeli.tgbot.inter constructor () // eu.vendeli.tgbot.api.botactions/CloseAction.|(){}[0] } -final class eu.vendeli.tgbot.api.botactions/CreateInvoiceLinkAction : eu.vendeli.tgbot.interfaces.action/SimpleAction, eu.vendeli.tgbot.interfaces.features/OptionsFeature { // eu.vendeli.tgbot.api.botactions/CreateInvoiceLinkAction|null[0] - constructor (kotlin/String, kotlin/String, kotlin/String, kotlin/String, eu.vendeli.tgbot.types.internal/Currency, kotlin.collections/List) // eu.vendeli.tgbot.api.botactions/CreateInvoiceLinkAction.|(kotlin.String;kotlin.String;kotlin.String;kotlin.String;eu.vendeli.tgbot.types.internal.Currency;kotlin.collections.List){}[0] +final class eu.vendeli.tgbot.api.botactions/CreateInvoiceLinkAction : eu.vendeli.tgbot.interfaces.action/BusinessActionExt, eu.vendeli.tgbot.interfaces.action/SimpleAction, eu.vendeli.tgbot.interfaces.features/OptionsFeature { // eu.vendeli.tgbot.api.botactions/CreateInvoiceLinkAction|null[0] + constructor (kotlin/String, kotlin/String, kotlin/String, eu.vendeli.tgbot.types.internal/Currency, kotlin.collections/List) // eu.vendeli.tgbot.api.botactions/CreateInvoiceLinkAction.|(kotlin.String;kotlin.String;kotlin.String;eu.vendeli.tgbot.types.internal.Currency;kotlin.collections.List){}[0] } final class eu.vendeli.tgbot.api.botactions/DeleteMyCommandsAction : eu.vendeli.tgbot.interfaces.action/SimpleAction { // eu.vendeli.tgbot.api.botactions/DeleteMyCommandsAction|null[0] @@ -1081,6 +1091,14 @@ final class eu.vendeli.tgbot.api.botactions/DeleteWebhookAction : eu.vendeli.tgb constructor (kotlin/Boolean = ...) // eu.vendeli.tgbot.api.botactions/DeleteWebhookAction.|(kotlin.Boolean){}[0] } +final class eu.vendeli.tgbot.api.botactions/EditUserStarSubscriptionAction : eu.vendeli.tgbot.interfaces.action/SimpleAction { // eu.vendeli.tgbot.api.botactions/EditUserStarSubscriptionAction|null[0] + constructor (kotlin/Long, kotlin/String, kotlin/Boolean) // eu.vendeli.tgbot.api.botactions/EditUserStarSubscriptionAction.|(kotlin.Long;kotlin.String;kotlin.Boolean){}[0] +} + +final class eu.vendeli.tgbot.api.botactions/GetAvailableGiftsAction : eu.vendeli.tgbot.interfaces.action/SimpleAction { // eu.vendeli.tgbot.api.botactions/GetAvailableGiftsAction|null[0] + constructor () // eu.vendeli.tgbot.api.botactions/GetAvailableGiftsAction.|(){}[0] +} + final class eu.vendeli.tgbot.api.botactions/GetBusinessConnectionAction : eu.vendeli.tgbot.interfaces.action/SimpleAction { // eu.vendeli.tgbot.api.botactions/GetBusinessConnectionAction|null[0] constructor (kotlin/String) // eu.vendeli.tgbot.api.botactions/GetBusinessConnectionAction.|(kotlin.String){}[0] } @@ -1129,6 +1147,14 @@ final class eu.vendeli.tgbot.api.botactions/RefundStarPaymentAction : eu.vendeli constructor (kotlin/String, kotlin/Long) // eu.vendeli.tgbot.api.botactions/RefundStarPaymentAction.|(kotlin.String;kotlin.Long){}[0] } +final class eu.vendeli.tgbot.api.botactions/SavePreparedInlineMessageAction : eu.vendeli.tgbot.interfaces.action/SimpleAction, eu.vendeli.tgbot.interfaces.features/OptionsFeature { // eu.vendeli.tgbot.api.botactions/SavePreparedInlineMessageAction|null[0] + constructor (kotlin/Long, eu.vendeli.tgbot.types.inline/InlineQueryResult) // eu.vendeli.tgbot.api.botactions/SavePreparedInlineMessageAction.|(kotlin.Long;eu.vendeli.tgbot.types.inline.InlineQueryResult){}[0] +} + +final class eu.vendeli.tgbot.api.botactions/SendGiftAction : eu.vendeli.tgbot.interfaces.action/SimpleAction, eu.vendeli.tgbot.interfaces.features/EntitiesFeature { // eu.vendeli.tgbot.api.botactions/SendGiftAction|null[0] + constructor (kotlin/Long, kotlin/String, eu.vendeli.tgbot.types/ParseMode? = ..., kotlin/Function0? = ...) // eu.vendeli.tgbot.api.botactions/SendGiftAction.|(kotlin.Long;kotlin.String;eu.vendeli.tgbot.types.ParseMode?;kotlin.Function0?){}[0] +} + final class eu.vendeli.tgbot.api.botactions/SetMyCommandsAction : eu.vendeli.tgbot.interfaces.action/SimpleAction { // eu.vendeli.tgbot.api.botactions/SetMyCommandsAction|null[0] constructor (kotlin/String? = ..., eu.vendeli.tgbot.types.bot/BotCommandScope? = ..., kotlin.collections/List) // eu.vendeli.tgbot.api.botactions/SetMyCommandsAction.|(kotlin.String?;eu.vendeli.tgbot.types.bot.BotCommandScope?;kotlin.collections.List){}[0] } @@ -1149,6 +1175,10 @@ final class eu.vendeli.tgbot.api.botactions/SetMyShortDescriptionAction : eu.ven constructor (kotlin/String? = ..., kotlin/String? = ...) // eu.vendeli.tgbot.api.botactions/SetMyShortDescriptionAction.|(kotlin.String?;kotlin.String?){}[0] } +final class eu.vendeli.tgbot.api.botactions/SetUserEmojiStatusAction : eu.vendeli.tgbot.interfaces.action/SimpleAction { // eu.vendeli.tgbot.api.botactions/SetUserEmojiStatusAction|null[0] + constructor (kotlin/Long, kotlin/String? = ..., kotlinx.datetime/Instant? = ...) // eu.vendeli.tgbot.api.botactions/SetUserEmojiStatusAction.|(kotlin.Long;kotlin.String?;kotlinx.datetime.Instant?){}[0] +} + final class eu.vendeli.tgbot.api.botactions/SetWebhookAction : eu.vendeli.tgbot.interfaces.action/SimpleAction, eu.vendeli.tgbot.interfaces.features/OptionsFeature { // eu.vendeli.tgbot.api.botactions/SetWebhookAction|null[0] constructor (kotlin/String) // eu.vendeli.tgbot.api.botactions/SetWebhookAction.|(kotlin.String){}[0] } @@ -1530,7 +1560,7 @@ final class eu.vendeli.tgbot.api/SendLocationAction : eu.vendeli.tgbot.interface constructor (kotlin/Float, kotlin/Float) // eu.vendeli.tgbot.api/SendLocationAction.|(kotlin.Float;kotlin.Float){}[0] } -final class eu.vendeli.tgbot.api/SendPollAction : eu.vendeli.tgbot.interfaces.action/Action, eu.vendeli.tgbot.interfaces.action/BusinessActionExt, eu.vendeli.tgbot.interfaces.features/MarkupFeature, eu.vendeli.tgbot.interfaces.features/OptionsFeature { // eu.vendeli.tgbot.api/SendPollAction|null[0] +final class eu.vendeli.tgbot.api/SendPollAction : eu.vendeli.tgbot.interfaces.action/Action, eu.vendeli.tgbot.interfaces.action/BusinessActionExt, eu.vendeli.tgbot.interfaces.features/EntitiesFeature, eu.vendeli.tgbot.interfaces.features/MarkupFeature, eu.vendeli.tgbot.interfaces.features/OptionsFeature { // eu.vendeli.tgbot.api/SendPollAction|null[0] constructor (kotlin/String, kotlin.collections/List) // eu.vendeli.tgbot.api/SendPollAction.|(kotlin.String;kotlin.collections.List){}[0] } @@ -3446,7 +3476,7 @@ final class eu.vendeli.tgbot.types.internal.configuration/HttpConfiguration { // } final class eu.vendeli.tgbot.types.internal.configuration/LoggingConfiguration { // eu.vendeli.tgbot.types.internal.configuration/LoggingConfiguration|null[0] - constructor (eu.vendeli.tgbot.interfaces.helper/Logger = ..., eu.vendeli.tgbot.types.internal/LogLvl = ..., eu.vendeli.tgbot.types.internal/HttpLogLevel = ...) // eu.vendeli.tgbot.types.internal.configuration/LoggingConfiguration.|(eu.vendeli.tgbot.interfaces.helper.Logger;eu.vendeli.tgbot.types.internal.LogLvl;eu.vendeli.tgbot.types.internal.HttpLogLevel){}[0] + constructor (eu.vendeli.tgbot.types.internal/LogLvl = ..., eu.vendeli.tgbot.types.internal/HttpLogLevel = ...) // eu.vendeli.tgbot.types.internal.configuration/LoggingConfiguration.|(eu.vendeli.tgbot.types.internal.LogLvl;eu.vendeli.tgbot.types.internal.HttpLogLevel){}[0] final var botLogLevel // eu.vendeli.tgbot.types.internal.configuration/LoggingConfiguration.botLogLevel|{}botLogLevel[0] final fun (): eu.vendeli.tgbot.types.internal/LogLvl // eu.vendeli.tgbot.types.internal.configuration/LoggingConfiguration.botLogLevel.|(){}[0] @@ -3454,14 +3484,10 @@ final class eu.vendeli.tgbot.types.internal.configuration/LoggingConfiguration { final var httpLogLevel // eu.vendeli.tgbot.types.internal.configuration/LoggingConfiguration.httpLogLevel|{}httpLogLevel[0] final fun (): eu.vendeli.tgbot.types.internal/HttpLogLevel // eu.vendeli.tgbot.types.internal.configuration/LoggingConfiguration.httpLogLevel.|(){}[0] final fun (eu.vendeli.tgbot.types.internal/HttpLogLevel) // eu.vendeli.tgbot.types.internal.configuration/LoggingConfiguration.httpLogLevel.|(eu.vendeli.tgbot.types.internal.HttpLogLevel){}[0] - final var logger // eu.vendeli.tgbot.types.internal.configuration/LoggingConfiguration.logger|{}logger[0] - final fun (): eu.vendeli.tgbot.interfaces.helper/Logger // eu.vendeli.tgbot.types.internal.configuration/LoggingConfiguration.logger.|(){}[0] - final fun (eu.vendeli.tgbot.interfaces.helper/Logger) // eu.vendeli.tgbot.types.internal.configuration/LoggingConfiguration.logger.|(eu.vendeli.tgbot.interfaces.helper.Logger){}[0] - - final fun component1(): eu.vendeli.tgbot.interfaces.helper/Logger // eu.vendeli.tgbot.types.internal.configuration/LoggingConfiguration.component1|component1(){}[0] - final fun component2(): eu.vendeli.tgbot.types.internal/LogLvl // eu.vendeli.tgbot.types.internal.configuration/LoggingConfiguration.component2|component2(){}[0] - final fun component3(): eu.vendeli.tgbot.types.internal/HttpLogLevel // eu.vendeli.tgbot.types.internal.configuration/LoggingConfiguration.component3|component3(){}[0] - final fun copy(eu.vendeli.tgbot.interfaces.helper/Logger = ..., eu.vendeli.tgbot.types.internal/LogLvl = ..., eu.vendeli.tgbot.types.internal/HttpLogLevel = ...): eu.vendeli.tgbot.types.internal.configuration/LoggingConfiguration // eu.vendeli.tgbot.types.internal.configuration/LoggingConfiguration.copy|copy(eu.vendeli.tgbot.interfaces.helper.Logger;eu.vendeli.tgbot.types.internal.LogLvl;eu.vendeli.tgbot.types.internal.HttpLogLevel){}[0] + + final fun component1(): eu.vendeli.tgbot.types.internal/LogLvl // eu.vendeli.tgbot.types.internal.configuration/LoggingConfiguration.component1|component1(){}[0] + final fun component2(): eu.vendeli.tgbot.types.internal/HttpLogLevel // eu.vendeli.tgbot.types.internal.configuration/LoggingConfiguration.component2|component2(){}[0] + final fun copy(eu.vendeli.tgbot.types.internal/LogLvl = ..., eu.vendeli.tgbot.types.internal/HttpLogLevel = ...): eu.vendeli.tgbot.types.internal.configuration/LoggingConfiguration // eu.vendeli.tgbot.types.internal.configuration/LoggingConfiguration.copy|copy(eu.vendeli.tgbot.types.internal.LogLvl;eu.vendeli.tgbot.types.internal.HttpLogLevel){}[0] final fun equals(kotlin/Any?): kotlin/Boolean // eu.vendeli.tgbot.types.internal.configuration/LoggingConfiguration.equals|equals(kotlin.Any?){}[0] final fun hashCode(): kotlin/Int // eu.vendeli.tgbot.types.internal.configuration/LoggingConfiguration.hashCode|hashCode(){}[0] final fun toString(): kotlin/String // eu.vendeli.tgbot.types.internal.configuration/LoggingConfiguration.toString|toString(){}[0] @@ -3973,7 +3999,7 @@ final class eu.vendeli.tgbot.types.internal.options/CopyMessagesOptions : eu.ven } final class eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions : eu.vendeli.tgbot.types.internal.options/Options { // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions|null[0] - constructor (kotlin/Int? = ..., kotlin.collections/List? = ..., kotlin/String? = ..., kotlin/String? = ..., kotlin/Long? = ..., kotlin/Int? = ..., kotlin/Int? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ...) // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.|(kotlin.Int?;kotlin.collections.List?;kotlin.String?;kotlin.String?;kotlin.Long?;kotlin.Int?;kotlin.Int?;kotlin.Boolean?;kotlin.Boolean?;kotlin.Boolean?;kotlin.Boolean?;kotlin.Boolean?;kotlin.Boolean?;kotlin.Boolean?){}[0] + constructor (kotlin/String? = ..., kotlin/Int? = ..., kotlin.collections/List? = ..., kotlin/String? = ..., kotlin/String? = ..., kotlin/Long? = ..., kotlin/Int? = ..., kotlin/Int? = ..., kotlin/Boolean? = ..., kotlin.time/Duration? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ...) // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.|(kotlin.String?;kotlin.Int?;kotlin.collections.List?;kotlin.String?;kotlin.String?;kotlin.Long?;kotlin.Int?;kotlin.Int?;kotlin.Boolean?;kotlin.time.Duration?;kotlin.Boolean?;kotlin.Boolean?;kotlin.Boolean?;kotlin.Boolean?;kotlin.Boolean?;kotlin.Boolean?){}[0] final var isFlexible // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.isFlexible|{}isFlexible[0] final fun (): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.isFlexible.|(){}[0] @@ -4008,31 +4034,39 @@ final class eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions : e final var providerData // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.providerData|{}providerData[0] final fun (): kotlin/String? // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.providerData.|(){}[0] final fun (kotlin/String?) // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.providerData.|(kotlin.String?){}[0] + final var providerToken // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.providerToken|{}providerToken[0] + final fun (): kotlin/String? // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.providerToken.|(){}[0] + final fun (kotlin/String?) // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.providerToken.|(kotlin.String?){}[0] final var sendEmailToProvider // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.sendEmailToProvider|{}sendEmailToProvider[0] final fun (): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.sendEmailToProvider.|(){}[0] final fun (kotlin/Boolean?) // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.sendEmailToProvider.|(kotlin.Boolean?){}[0] final var sendPhoneNumberToProvider // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.sendPhoneNumberToProvider|{}sendPhoneNumberToProvider[0] final fun (): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.sendPhoneNumberToProvider.|(){}[0] final fun (kotlin/Boolean?) // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.sendPhoneNumberToProvider.|(kotlin.Boolean?){}[0] + final var subscriptionPeriod // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.subscriptionPeriod|{}subscriptionPeriod[0] + final fun (): kotlin.time/Duration? // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.subscriptionPeriod.|(){}[0] + final fun (kotlin.time/Duration?) // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.subscriptionPeriod.|(kotlin.time.Duration?){}[0] final var suggestedTipAmounts // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.suggestedTipAmounts|{}suggestedTipAmounts[0] final fun (): kotlin.collections/List? // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.suggestedTipAmounts.|(){}[0] final fun (kotlin.collections/List?) // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.suggestedTipAmounts.|(kotlin.collections.List?){}[0] - final fun component1(): kotlin/Int? // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.component1|component1(){}[0] - final fun component10(): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.component10|component10(){}[0] + final fun component1(): kotlin/String? // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.component1|component1(){}[0] + final fun component10(): kotlin.time/Duration? // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.component10|component10(){}[0] final fun component11(): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.component11|component11(){}[0] final fun component12(): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.component12|component12(){}[0] final fun component13(): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.component13|component13(){}[0] final fun component14(): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.component14|component14(){}[0] - final fun component2(): kotlin.collections/List? // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.component2|component2(){}[0] - final fun component3(): kotlin/String? // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.component3|component3(){}[0] + final fun component15(): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.component15|component15(){}[0] + final fun component16(): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.component16|component16(){}[0] + final fun component2(): kotlin/Int? // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.component2|component2(){}[0] + final fun component3(): kotlin.collections/List? // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.component3|component3(){}[0] final fun component4(): kotlin/String? // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.component4|component4(){}[0] - final fun component5(): kotlin/Long? // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.component5|component5(){}[0] - final fun component6(): kotlin/Int? // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.component6|component6(){}[0] + final fun component5(): kotlin/String? // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.component5|component5(){}[0] + final fun component6(): kotlin/Long? // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.component6|component6(){}[0] final fun component7(): kotlin/Int? // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.component7|component7(){}[0] - final fun component8(): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.component8|component8(){}[0] + final fun component8(): kotlin/Int? // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.component8|component8(){}[0] final fun component9(): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.component9|component9(){}[0] - final fun copy(kotlin/Int? = ..., kotlin.collections/List? = ..., kotlin/String? = ..., kotlin/String? = ..., kotlin/Long? = ..., kotlin/Int? = ..., kotlin/Int? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ...): eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.copy|copy(kotlin.Int?;kotlin.collections.List?;kotlin.String?;kotlin.String?;kotlin.Long?;kotlin.Int?;kotlin.Int?;kotlin.Boolean?;kotlin.Boolean?;kotlin.Boolean?;kotlin.Boolean?;kotlin.Boolean?;kotlin.Boolean?;kotlin.Boolean?){}[0] + final fun copy(kotlin/String? = ..., kotlin/Int? = ..., kotlin.collections/List? = ..., kotlin/String? = ..., kotlin/String? = ..., kotlin/Long? = ..., kotlin/Int? = ..., kotlin/Int? = ..., kotlin/Boolean? = ..., kotlin.time/Duration? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ...): eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.copy|copy(kotlin.String?;kotlin.Int?;kotlin.collections.List?;kotlin.String?;kotlin.String?;kotlin.Long?;kotlin.Int?;kotlin.Int?;kotlin.Boolean?;kotlin.time.Duration?;kotlin.Boolean?;kotlin.Boolean?;kotlin.Boolean?;kotlin.Boolean?;kotlin.Boolean?;kotlin.Boolean?){}[0] final fun equals(kotlin/Any?): kotlin/Boolean // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.equals|equals(kotlin.Any?){}[0] final fun hashCode(): kotlin/Int // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.hashCode|hashCode(){}[0] final fun toString(): kotlin/String // eu.vendeli.tgbot.types.internal.options/CreateInvoiceLinkOptions.toString|toString(){}[0] @@ -4806,7 +4840,7 @@ final class eu.vendeli.tgbot.types.internal.options/PhotoOptions : eu.vendeli.tg } final class eu.vendeli.tgbot.types.internal.options/PollOptions : eu.vendeli.tgbot.types.internal.options/ForumProps, eu.vendeli.tgbot.types.internal.options/MessageEffectIdProp, eu.vendeli.tgbot.types.internal.options/OptionsCommon { // eu.vendeli.tgbot.types.internal.options/PollOptions|null[0] - constructor (kotlin/Boolean? = ..., eu.vendeli.tgbot.types.poll/PollType? = ..., kotlin/Boolean? = ..., kotlin/Int? = ..., kotlin/String? = ..., eu.vendeli.tgbot.types/ParseMode? = ..., kotlin.collections/List? = ..., kotlin.time/Duration? = ..., kotlinx.datetime/Instant? = ..., kotlin/Boolean? = ..., eu.vendeli.tgbot.types/ParseMode? = ..., kotlin.collections/List? = ..., kotlin/Boolean? = ..., eu.vendeli.tgbot.types/ReplyParameters? = ..., kotlin/Boolean? = ..., kotlin/Int? = ..., kotlin/String? = ..., kotlin/Boolean? = ...) // eu.vendeli.tgbot.types.internal.options/PollOptions.|(kotlin.Boolean?;eu.vendeli.tgbot.types.poll.PollType?;kotlin.Boolean?;kotlin.Int?;kotlin.String?;eu.vendeli.tgbot.types.ParseMode?;kotlin.collections.List?;kotlin.time.Duration?;kotlinx.datetime.Instant?;kotlin.Boolean?;eu.vendeli.tgbot.types.ParseMode?;kotlin.collections.List?;kotlin.Boolean?;eu.vendeli.tgbot.types.ReplyParameters?;kotlin.Boolean?;kotlin.Int?;kotlin.String?;kotlin.Boolean?){}[0] + constructor (kotlin/Boolean? = ..., eu.vendeli.tgbot.types.poll/PollType? = ..., kotlin/Boolean? = ..., kotlin/Int? = ..., kotlin/String? = ..., eu.vendeli.tgbot.types/ParseMode? = ..., kotlin.collections/List? = ..., kotlin.time/Duration? = ..., kotlinx.datetime/Instant? = ..., kotlin/Boolean? = ..., eu.vendeli.tgbot.types/ParseMode? = ..., kotlin/Boolean? = ..., eu.vendeli.tgbot.types/ReplyParameters? = ..., kotlin/Boolean? = ..., kotlin/Int? = ..., kotlin/String? = ..., kotlin/Boolean? = ...) // eu.vendeli.tgbot.types.internal.options/PollOptions.|(kotlin.Boolean?;eu.vendeli.tgbot.types.poll.PollType?;kotlin.Boolean?;kotlin.Int?;kotlin.String?;eu.vendeli.tgbot.types.ParseMode?;kotlin.collections.List?;kotlin.time.Duration?;kotlinx.datetime.Instant?;kotlin.Boolean?;eu.vendeli.tgbot.types.ParseMode?;kotlin.Boolean?;eu.vendeli.tgbot.types.ReplyParameters?;kotlin.Boolean?;kotlin.Int?;kotlin.String?;kotlin.Boolean?){}[0] final var allowPaidBroadcast // eu.vendeli.tgbot.types.internal.options/PollOptions.allowPaidBroadcast|{}allowPaidBroadcast[0] final fun (): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/PollOptions.allowPaidBroadcast.|(){}[0] @@ -4850,9 +4884,6 @@ final class eu.vendeli.tgbot.types.internal.options/PollOptions : eu.vendeli.tgb final var protectContent // eu.vendeli.tgbot.types.internal.options/PollOptions.protectContent|{}protectContent[0] final fun (): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/PollOptions.protectContent.|(){}[0] final fun (kotlin/Boolean?) // eu.vendeli.tgbot.types.internal.options/PollOptions.protectContent.|(kotlin.Boolean?){}[0] - final var questionEntities // eu.vendeli.tgbot.types.internal.options/PollOptions.questionEntities|{}questionEntities[0] - final fun (): kotlin.collections/List? // eu.vendeli.tgbot.types.internal.options/PollOptions.questionEntities.|(){}[0] - final fun (kotlin.collections/List?) // eu.vendeli.tgbot.types.internal.options/PollOptions.questionEntities.|(kotlin.collections.List?){}[0] final var questionParseMode // eu.vendeli.tgbot.types.internal.options/PollOptions.questionParseMode|{}questionParseMode[0] final fun (): eu.vendeli.tgbot.types/ParseMode? // eu.vendeli.tgbot.types.internal.options/PollOptions.questionParseMode.|(){}[0] final fun (eu.vendeli.tgbot.types/ParseMode?) // eu.vendeli.tgbot.types.internal.options/PollOptions.questionParseMode.|(eu.vendeli.tgbot.types.ParseMode?){}[0] @@ -4866,13 +4897,12 @@ final class eu.vendeli.tgbot.types.internal.options/PollOptions : eu.vendeli.tgb final fun component1(): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/PollOptions.component1|component1(){}[0] final fun component10(): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/PollOptions.component10|component10(){}[0] final fun component11(): eu.vendeli.tgbot.types/ParseMode? // eu.vendeli.tgbot.types.internal.options/PollOptions.component11|component11(){}[0] - final fun component12(): kotlin.collections/List? // eu.vendeli.tgbot.types.internal.options/PollOptions.component12|component12(){}[0] - final fun component13(): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/PollOptions.component13|component13(){}[0] - final fun component14(): eu.vendeli.tgbot.types/ReplyParameters? // eu.vendeli.tgbot.types.internal.options/PollOptions.component14|component14(){}[0] - final fun component15(): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/PollOptions.component15|component15(){}[0] - final fun component16(): kotlin/Int? // eu.vendeli.tgbot.types.internal.options/PollOptions.component16|component16(){}[0] - final fun component17(): kotlin/String? // eu.vendeli.tgbot.types.internal.options/PollOptions.component17|component17(){}[0] - final fun component18(): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/PollOptions.component18|component18(){}[0] + final fun component12(): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/PollOptions.component12|component12(){}[0] + final fun component13(): eu.vendeli.tgbot.types/ReplyParameters? // eu.vendeli.tgbot.types.internal.options/PollOptions.component13|component13(){}[0] + final fun component14(): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/PollOptions.component14|component14(){}[0] + final fun component15(): kotlin/Int? // eu.vendeli.tgbot.types.internal.options/PollOptions.component15|component15(){}[0] + final fun component16(): kotlin/String? // eu.vendeli.tgbot.types.internal.options/PollOptions.component16|component16(){}[0] + final fun component17(): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/PollOptions.component17|component17(){}[0] final fun component2(): eu.vendeli.tgbot.types.poll/PollType? // eu.vendeli.tgbot.types.internal.options/PollOptions.component2|component2(){}[0] final fun component3(): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/PollOptions.component3|component3(){}[0] final fun component4(): kotlin/Int? // eu.vendeli.tgbot.types.internal.options/PollOptions.component4|component4(){}[0] @@ -4881,7 +4911,7 @@ final class eu.vendeli.tgbot.types.internal.options/PollOptions : eu.vendeli.tgb final fun component7(): kotlin.collections/List? // eu.vendeli.tgbot.types.internal.options/PollOptions.component7|component7(){}[0] final fun component8(): kotlin.time/Duration? // eu.vendeli.tgbot.types.internal.options/PollOptions.component8|component8(){}[0] final fun component9(): kotlinx.datetime/Instant? // eu.vendeli.tgbot.types.internal.options/PollOptions.component9|component9(){}[0] - final fun copy(kotlin/Boolean? = ..., eu.vendeli.tgbot.types.poll/PollType? = ..., kotlin/Boolean? = ..., kotlin/Int? = ..., kotlin/String? = ..., eu.vendeli.tgbot.types/ParseMode? = ..., kotlin.collections/List? = ..., kotlin.time/Duration? = ..., kotlinx.datetime/Instant? = ..., kotlin/Boolean? = ..., eu.vendeli.tgbot.types/ParseMode? = ..., kotlin.collections/List? = ..., kotlin/Boolean? = ..., eu.vendeli.tgbot.types/ReplyParameters? = ..., kotlin/Boolean? = ..., kotlin/Int? = ..., kotlin/String? = ..., kotlin/Boolean? = ...): eu.vendeli.tgbot.types.internal.options/PollOptions // eu.vendeli.tgbot.types.internal.options/PollOptions.copy|copy(kotlin.Boolean?;eu.vendeli.tgbot.types.poll.PollType?;kotlin.Boolean?;kotlin.Int?;kotlin.String?;eu.vendeli.tgbot.types.ParseMode?;kotlin.collections.List?;kotlin.time.Duration?;kotlinx.datetime.Instant?;kotlin.Boolean?;eu.vendeli.tgbot.types.ParseMode?;kotlin.collections.List?;kotlin.Boolean?;eu.vendeli.tgbot.types.ReplyParameters?;kotlin.Boolean?;kotlin.Int?;kotlin.String?;kotlin.Boolean?){}[0] + final fun copy(kotlin/Boolean? = ..., eu.vendeli.tgbot.types.poll/PollType? = ..., kotlin/Boolean? = ..., kotlin/Int? = ..., kotlin/String? = ..., eu.vendeli.tgbot.types/ParseMode? = ..., kotlin.collections/List? = ..., kotlin.time/Duration? = ..., kotlinx.datetime/Instant? = ..., kotlin/Boolean? = ..., eu.vendeli.tgbot.types/ParseMode? = ..., kotlin/Boolean? = ..., eu.vendeli.tgbot.types/ReplyParameters? = ..., kotlin/Boolean? = ..., kotlin/Int? = ..., kotlin/String? = ..., kotlin/Boolean? = ...): eu.vendeli.tgbot.types.internal.options/PollOptions // eu.vendeli.tgbot.types.internal.options/PollOptions.copy|copy(kotlin.Boolean?;eu.vendeli.tgbot.types.poll.PollType?;kotlin.Boolean?;kotlin.Int?;kotlin.String?;eu.vendeli.tgbot.types.ParseMode?;kotlin.collections.List?;kotlin.time.Duration?;kotlinx.datetime.Instant?;kotlin.Boolean?;eu.vendeli.tgbot.types.ParseMode?;kotlin.Boolean?;eu.vendeli.tgbot.types.ReplyParameters?;kotlin.Boolean?;kotlin.Int?;kotlin.String?;kotlin.Boolean?){}[0] final fun equals(kotlin/Any?): kotlin/Boolean // eu.vendeli.tgbot.types.internal.options/PollOptions.equals|equals(kotlin.Any?){}[0] final fun hashCode(): kotlin/Int // eu.vendeli.tgbot.types.internal.options/PollOptions.hashCode|hashCode(){}[0] final fun toString(): kotlin/String // eu.vendeli.tgbot.types.internal.options/PollOptions.toString|toString(){}[0] @@ -4905,22 +4935,21 @@ final class eu.vendeli.tgbot.types.internal.options/PollOptions : eu.vendeli.tgb final class eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions : eu.vendeli.tgbot.types.internal.options/Options { // eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions|null[0] constructor (kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ...) // eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions.|(kotlin.Boolean?;kotlin.Boolean?;kotlin.Boolean?;kotlin.Boolean?;kotlin.Boolean?;kotlin.Boolean?;kotlin.Boolean?;kotlin.Boolean?;kotlin.Boolean?;kotlin.Boolean?;kotlin.Boolean?;kotlin.Boolean?;kotlin.Boolean?;kotlin.Boolean?;kotlin.Boolean?){}[0] - final val canDeleteStories // eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions.canDeleteStories|{}canDeleteStories[0] - final fun (): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions.canDeleteStories.|(){}[0] - final val canEditStories // eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions.canEditStories|{}canEditStories[0] - final fun (): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions.canEditStories.|(){}[0] - final val canPostStories // eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions.canPostStories|{}canPostStories[0] - final fun (): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions.canPostStories.|(){}[0] - final var canChangeInfo // eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions.canChangeInfo|{}canChangeInfo[0] final fun (): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions.canChangeInfo.|(){}[0] final fun (kotlin/Boolean?) // eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions.canChangeInfo.|(kotlin.Boolean?){}[0] final var canDeleteMessages // eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions.canDeleteMessages|{}canDeleteMessages[0] final fun (): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions.canDeleteMessages.|(){}[0] final fun (kotlin/Boolean?) // eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions.canDeleteMessages.|(kotlin.Boolean?){}[0] + final var canDeleteStories // eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions.canDeleteStories|{}canDeleteStories[0] + final fun (): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions.canDeleteStories.|(){}[0] + final fun (kotlin/Boolean?) // eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions.canDeleteStories.|(kotlin.Boolean?){}[0] final var canEditMessages // eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions.canEditMessages|{}canEditMessages[0] final fun (): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions.canEditMessages.|(){}[0] final fun (kotlin/Boolean?) // eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions.canEditMessages.|(kotlin.Boolean?){}[0] + final var canEditStories // eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions.canEditStories|{}canEditStories[0] + final fun (): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions.canEditStories.|(){}[0] + final fun (kotlin/Boolean?) // eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions.canEditStories.|(kotlin.Boolean?){}[0] final var canInviteUsers // eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions.canInviteUsers|{}canInviteUsers[0] final fun (): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions.canInviteUsers.|(){}[0] final fun (kotlin/Boolean?) // eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions.canInviteUsers.|(kotlin.Boolean?){}[0] @@ -4939,6 +4968,9 @@ final class eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions : e final var canPostMessages // eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions.canPostMessages|{}canPostMessages[0] final fun (): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions.canPostMessages.|(){}[0] final fun (kotlin/Boolean?) // eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions.canPostMessages.|(kotlin.Boolean?){}[0] + final var canPostStories // eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions.canPostStories|{}canPostStories[0] + final fun (): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions.canPostStories.|(){}[0] + final fun (kotlin/Boolean?) // eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions.canPostStories.|(kotlin.Boolean?){}[0] final var canPromoteMembers // eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions.canPromoteMembers|{}canPromoteMembers[0] final fun (): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions.canPromoteMembers.|(){}[0] final fun (kotlin/Boolean?) // eu.vendeli.tgbot.types.internal.options/PromoteChatMemberOptions.canPromoteMembers.|(kotlin.Boolean?){}[0] @@ -5026,6 +5058,32 @@ final class eu.vendeli.tgbot.types.internal.options/ReplyKeyboardMarkupOptions { } } +final class eu.vendeli.tgbot.types.internal.options/SavePreparedInlineMessageOptions : eu.vendeli.tgbot.types.internal.options/Options { // eu.vendeli.tgbot.types.internal.options/SavePreparedInlineMessageOptions|null[0] + constructor (kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ...) // eu.vendeli.tgbot.types.internal.options/SavePreparedInlineMessageOptions.|(kotlin.Boolean?;kotlin.Boolean?;kotlin.Boolean?;kotlin.Boolean?){}[0] + + final var allowBotChats // eu.vendeli.tgbot.types.internal.options/SavePreparedInlineMessageOptions.allowBotChats|{}allowBotChats[0] + final fun (): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/SavePreparedInlineMessageOptions.allowBotChats.|(){}[0] + final fun (kotlin/Boolean?) // eu.vendeli.tgbot.types.internal.options/SavePreparedInlineMessageOptions.allowBotChats.|(kotlin.Boolean?){}[0] + final var allowChannelChats // eu.vendeli.tgbot.types.internal.options/SavePreparedInlineMessageOptions.allowChannelChats|{}allowChannelChats[0] + final fun (): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/SavePreparedInlineMessageOptions.allowChannelChats.|(){}[0] + final fun (kotlin/Boolean?) // eu.vendeli.tgbot.types.internal.options/SavePreparedInlineMessageOptions.allowChannelChats.|(kotlin.Boolean?){}[0] + final var allowGroupChats // eu.vendeli.tgbot.types.internal.options/SavePreparedInlineMessageOptions.allowGroupChats|{}allowGroupChats[0] + final fun (): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/SavePreparedInlineMessageOptions.allowGroupChats.|(){}[0] + final fun (kotlin/Boolean?) // eu.vendeli.tgbot.types.internal.options/SavePreparedInlineMessageOptions.allowGroupChats.|(kotlin.Boolean?){}[0] + final var allowUserChats // eu.vendeli.tgbot.types.internal.options/SavePreparedInlineMessageOptions.allowUserChats|{}allowUserChats[0] + final fun (): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/SavePreparedInlineMessageOptions.allowUserChats.|(){}[0] + final fun (kotlin/Boolean?) // eu.vendeli.tgbot.types.internal.options/SavePreparedInlineMessageOptions.allowUserChats.|(kotlin.Boolean?){}[0] + + final fun component1(): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/SavePreparedInlineMessageOptions.component1|component1(){}[0] + final fun component2(): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/SavePreparedInlineMessageOptions.component2|component2(){}[0] + final fun component3(): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/SavePreparedInlineMessageOptions.component3|component3(){}[0] + final fun component4(): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/SavePreparedInlineMessageOptions.component4|component4(){}[0] + final fun copy(kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ...): eu.vendeli.tgbot.types.internal.options/SavePreparedInlineMessageOptions // eu.vendeli.tgbot.types.internal.options/SavePreparedInlineMessageOptions.copy|copy(kotlin.Boolean?;kotlin.Boolean?;kotlin.Boolean?;kotlin.Boolean?){}[0] + final fun equals(kotlin/Any?): kotlin/Boolean // eu.vendeli.tgbot.types.internal.options/SavePreparedInlineMessageOptions.equals|equals(kotlin.Any?){}[0] + final fun hashCode(): kotlin/Int // eu.vendeli.tgbot.types.internal.options/SavePreparedInlineMessageOptions.hashCode|hashCode(){}[0] + final fun toString(): kotlin/String // eu.vendeli.tgbot.types.internal.options/SavePreparedInlineMessageOptions.toString|toString(){}[0] +} + final class eu.vendeli.tgbot.types.internal.options/SetGameScoreOptions : eu.vendeli.tgbot.types.internal.options/Options { // eu.vendeli.tgbot.types.internal.options/SetGameScoreOptions|null[0] constructor (kotlin/Boolean? = ..., kotlin/Boolean? = ...) // eu.vendeli.tgbot.types.internal.options/SetGameScoreOptions.|(kotlin.Boolean?;kotlin.Boolean?){}[0] @@ -5109,15 +5167,15 @@ final class eu.vendeli.tgbot.types.internal.options/SetWebhookOptions : eu.vende final class eu.vendeli.tgbot.types.internal.options/StickerOptions : eu.vendeli.tgbot.types.internal.options/ForumProps, eu.vendeli.tgbot.types.internal.options/MessageEffectIdProp, eu.vendeli.tgbot.types.internal.options/OptionsCommon { // eu.vendeli.tgbot.types.internal.options/StickerOptions|null[0] constructor (kotlin/String? = ..., kotlin/Boolean? = ..., eu.vendeli.tgbot.types/ReplyParameters? = ..., kotlin/Boolean? = ..., kotlin/Int? = ..., kotlin/String? = ..., kotlin/Boolean? = ...) // eu.vendeli.tgbot.types.internal.options/StickerOptions.|(kotlin.String?;kotlin.Boolean?;eu.vendeli.tgbot.types.ReplyParameters?;kotlin.Boolean?;kotlin.Int?;kotlin.String?;kotlin.Boolean?){}[0] - final val emoji // eu.vendeli.tgbot.types.internal.options/StickerOptions.emoji|{}emoji[0] - final fun (): kotlin/String? // eu.vendeli.tgbot.types.internal.options/StickerOptions.emoji.|(){}[0] - final var allowPaidBroadcast // eu.vendeli.tgbot.types.internal.options/StickerOptions.allowPaidBroadcast|{}allowPaidBroadcast[0] final fun (): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/StickerOptions.allowPaidBroadcast.|(){}[0] final fun (kotlin/Boolean?) // eu.vendeli.tgbot.types.internal.options/StickerOptions.allowPaidBroadcast.|(kotlin.Boolean?){}[0] final var disableNotification // eu.vendeli.tgbot.types.internal.options/StickerOptions.disableNotification|{}disableNotification[0] final fun (): kotlin/Boolean? // eu.vendeli.tgbot.types.internal.options/StickerOptions.disableNotification.|(){}[0] final fun (kotlin/Boolean?) // eu.vendeli.tgbot.types.internal.options/StickerOptions.disableNotification.|(kotlin.Boolean?){}[0] + final var emoji // eu.vendeli.tgbot.types.internal.options/StickerOptions.emoji|{}emoji[0] + final fun (): kotlin/String? // eu.vendeli.tgbot.types.internal.options/StickerOptions.emoji.|(){}[0] + final fun (kotlin/String?) // eu.vendeli.tgbot.types.internal.options/StickerOptions.emoji.|(kotlin.String?){}[0] final var messageEffectId // eu.vendeli.tgbot.types.internal.options/StickerOptions.messageEffectId|{}messageEffectId[0] final fun (): kotlin/String? // eu.vendeli.tgbot.types.internal.options/StickerOptions.messageEffectId.|(){}[0] final fun (kotlin/String?) // eu.vendeli.tgbot.types.internal.options/StickerOptions.messageEffectId.|(kotlin.String?){}[0] @@ -7640,6 +7698,35 @@ final class eu.vendeli.tgbot.types.msg/MessageReactionUpdated { // eu.vendeli.tg } } +final class eu.vendeli.tgbot.types.msg/PreparedInlineMessage { // eu.vendeli.tgbot.types.msg/PreparedInlineMessage|null[0] + constructor (kotlin/String, kotlinx.datetime/Instant) // eu.vendeli.tgbot.types.msg/PreparedInlineMessage.|(kotlin.String;kotlinx.datetime.Instant){}[0] + + final val expirationDate // eu.vendeli.tgbot.types.msg/PreparedInlineMessage.expirationDate|{}expirationDate[0] + final fun (): kotlinx.datetime/Instant // eu.vendeli.tgbot.types.msg/PreparedInlineMessage.expirationDate.|(){}[0] + final val id // eu.vendeli.tgbot.types.msg/PreparedInlineMessage.id|{}id[0] + final fun (): kotlin/String // eu.vendeli.tgbot.types.msg/PreparedInlineMessage.id.|(){}[0] + + final fun component1(): kotlin/String // eu.vendeli.tgbot.types.msg/PreparedInlineMessage.component1|component1(){}[0] + final fun component2(): kotlinx.datetime/Instant // eu.vendeli.tgbot.types.msg/PreparedInlineMessage.component2|component2(){}[0] + final fun copy(kotlin/String = ..., kotlinx.datetime/Instant = ...): eu.vendeli.tgbot.types.msg/PreparedInlineMessage // eu.vendeli.tgbot.types.msg/PreparedInlineMessage.copy|copy(kotlin.String;kotlinx.datetime.Instant){}[0] + final fun equals(kotlin/Any?): kotlin/Boolean // eu.vendeli.tgbot.types.msg/PreparedInlineMessage.equals|equals(kotlin.Any?){}[0] + final fun hashCode(): kotlin/Int // eu.vendeli.tgbot.types.msg/PreparedInlineMessage.hashCode|hashCode(){}[0] + final fun toString(): kotlin/String // eu.vendeli.tgbot.types.msg/PreparedInlineMessage.toString|toString(){}[0] + + final object $serializer : kotlinx.serialization.internal/GeneratedSerializer { // eu.vendeli.tgbot.types.msg/PreparedInlineMessage.$serializer|null[0] + final val descriptor // eu.vendeli.tgbot.types.msg/PreparedInlineMessage.$serializer.descriptor|{}descriptor[0] + final fun (): kotlinx.serialization.descriptors/SerialDescriptor // eu.vendeli.tgbot.types.msg/PreparedInlineMessage.$serializer.descriptor.|(){}[0] + + final fun childSerializers(): kotlin/Array> // eu.vendeli.tgbot.types.msg/PreparedInlineMessage.$serializer.childSerializers|childSerializers(){}[0] + final fun deserialize(kotlinx.serialization.encoding/Decoder): eu.vendeli.tgbot.types.msg/PreparedInlineMessage // eu.vendeli.tgbot.types.msg/PreparedInlineMessage.$serializer.deserialize|deserialize(kotlinx.serialization.encoding.Decoder){}[0] + final fun serialize(kotlinx.serialization.encoding/Encoder, eu.vendeli.tgbot.types.msg/PreparedInlineMessage) // eu.vendeli.tgbot.types.msg/PreparedInlineMessage.$serializer.serialize|serialize(kotlinx.serialization.encoding.Encoder;eu.vendeli.tgbot.types.msg.PreparedInlineMessage){}[0] + } + + final object Companion { // eu.vendeli.tgbot.types.msg/PreparedInlineMessage.Companion|null[0] + final fun serializer(): kotlinx.serialization/KSerializer // eu.vendeli.tgbot.types.msg/PreparedInlineMessage.Companion.serializer|serializer(){}[0] + } +} + final class eu.vendeli.tgbot.types.passport/EncryptedCredentials { // eu.vendeli.tgbot.types.passport/EncryptedCredentials|null[0] constructor (kotlin/String, kotlin/String, kotlin/String) // eu.vendeli.tgbot.types.passport/EncryptedCredentials.|(kotlin.String;kotlin.String;kotlin.String){}[0] @@ -8094,31 +8181,40 @@ final class eu.vendeli.tgbot.types.payment/ShippingQuery { // eu.vendeli.tgbot.t } final class eu.vendeli.tgbot.types.payment/SuccessfulPayment { // eu.vendeli.tgbot.types.payment/SuccessfulPayment|null[0] - constructor (eu.vendeli.tgbot.types.internal/Currency, kotlin/Int, kotlin/String, kotlin/String? = ..., eu.vendeli.tgbot.types.payment/OrderInfo? = ..., kotlin/String, kotlin/String) // eu.vendeli.tgbot.types.payment/SuccessfulPayment.|(eu.vendeli.tgbot.types.internal.Currency;kotlin.Int;kotlin.String;kotlin.String?;eu.vendeli.tgbot.types.payment.OrderInfo?;kotlin.String;kotlin.String){}[0] + constructor (eu.vendeli.tgbot.types.internal/Currency, kotlin/Int, kotlin/String, kotlin/String? = ..., eu.vendeli.tgbot.types.payment/OrderInfo? = ..., kotlinx.datetime/Instant? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/String, kotlin/String) // eu.vendeli.tgbot.types.payment/SuccessfulPayment.|(eu.vendeli.tgbot.types.internal.Currency;kotlin.Int;kotlin.String;kotlin.String?;eu.vendeli.tgbot.types.payment.OrderInfo?;kotlinx.datetime.Instant?;kotlin.Boolean?;kotlin.Boolean?;kotlin.String;kotlin.String){}[0] final val currency // eu.vendeli.tgbot.types.payment/SuccessfulPayment.currency|{}currency[0] final fun (): eu.vendeli.tgbot.types.internal/Currency // eu.vendeli.tgbot.types.payment/SuccessfulPayment.currency.|(){}[0] final val invoicePayload // eu.vendeli.tgbot.types.payment/SuccessfulPayment.invoicePayload|{}invoicePayload[0] final fun (): kotlin/String // eu.vendeli.tgbot.types.payment/SuccessfulPayment.invoicePayload.|(){}[0] + final val isFirstRecurring // eu.vendeli.tgbot.types.payment/SuccessfulPayment.isFirstRecurring|{}isFirstRecurring[0] + final fun (): kotlin/Boolean? // eu.vendeli.tgbot.types.payment/SuccessfulPayment.isFirstRecurring.|(){}[0] + final val isRecurring // eu.vendeli.tgbot.types.payment/SuccessfulPayment.isRecurring|{}isRecurring[0] + final fun (): kotlin/Boolean? // eu.vendeli.tgbot.types.payment/SuccessfulPayment.isRecurring.|(){}[0] final val orderInfo // eu.vendeli.tgbot.types.payment/SuccessfulPayment.orderInfo|{}orderInfo[0] final fun (): eu.vendeli.tgbot.types.payment/OrderInfo? // eu.vendeli.tgbot.types.payment/SuccessfulPayment.orderInfo.|(){}[0] final val providerPaymentChargeId // eu.vendeli.tgbot.types.payment/SuccessfulPayment.providerPaymentChargeId|{}providerPaymentChargeId[0] final fun (): kotlin/String // eu.vendeli.tgbot.types.payment/SuccessfulPayment.providerPaymentChargeId.|(){}[0] final val shippingOptionId // eu.vendeli.tgbot.types.payment/SuccessfulPayment.shippingOptionId|{}shippingOptionId[0] final fun (): kotlin/String? // eu.vendeli.tgbot.types.payment/SuccessfulPayment.shippingOptionId.|(){}[0] + final val subscriptionExpirationDate // eu.vendeli.tgbot.types.payment/SuccessfulPayment.subscriptionExpirationDate|{}subscriptionExpirationDate[0] + final fun (): kotlinx.datetime/Instant? // eu.vendeli.tgbot.types.payment/SuccessfulPayment.subscriptionExpirationDate.|(){}[0] final val telegramPaymentChargeId // eu.vendeli.tgbot.types.payment/SuccessfulPayment.telegramPaymentChargeId|{}telegramPaymentChargeId[0] final fun (): kotlin/String // eu.vendeli.tgbot.types.payment/SuccessfulPayment.telegramPaymentChargeId.|(){}[0] final val totalAmount // eu.vendeli.tgbot.types.payment/SuccessfulPayment.totalAmount|{}totalAmount[0] final fun (): kotlin/Int // eu.vendeli.tgbot.types.payment/SuccessfulPayment.totalAmount.|(){}[0] final fun component1(): eu.vendeli.tgbot.types.internal/Currency // eu.vendeli.tgbot.types.payment/SuccessfulPayment.component1|component1(){}[0] + final fun component10(): kotlin/String // eu.vendeli.tgbot.types.payment/SuccessfulPayment.component10|component10(){}[0] final fun component2(): kotlin/Int // eu.vendeli.tgbot.types.payment/SuccessfulPayment.component2|component2(){}[0] final fun component3(): kotlin/String // eu.vendeli.tgbot.types.payment/SuccessfulPayment.component3|component3(){}[0] final fun component4(): kotlin/String? // eu.vendeli.tgbot.types.payment/SuccessfulPayment.component4|component4(){}[0] final fun component5(): eu.vendeli.tgbot.types.payment/OrderInfo? // eu.vendeli.tgbot.types.payment/SuccessfulPayment.component5|component5(){}[0] - final fun component6(): kotlin/String // eu.vendeli.tgbot.types.payment/SuccessfulPayment.component6|component6(){}[0] - final fun component7(): kotlin/String // eu.vendeli.tgbot.types.payment/SuccessfulPayment.component7|component7(){}[0] - final fun copy(eu.vendeli.tgbot.types.internal/Currency = ..., kotlin/Int = ..., kotlin/String = ..., kotlin/String? = ..., eu.vendeli.tgbot.types.payment/OrderInfo? = ..., kotlin/String = ..., kotlin/String = ...): eu.vendeli.tgbot.types.payment/SuccessfulPayment // eu.vendeli.tgbot.types.payment/SuccessfulPayment.copy|copy(eu.vendeli.tgbot.types.internal.Currency;kotlin.Int;kotlin.String;kotlin.String?;eu.vendeli.tgbot.types.payment.OrderInfo?;kotlin.String;kotlin.String){}[0] + final fun component6(): kotlinx.datetime/Instant? // eu.vendeli.tgbot.types.payment/SuccessfulPayment.component6|component6(){}[0] + final fun component7(): kotlin/Boolean? // eu.vendeli.tgbot.types.payment/SuccessfulPayment.component7|component7(){}[0] + final fun component8(): kotlin/Boolean? // eu.vendeli.tgbot.types.payment/SuccessfulPayment.component8|component8(){}[0] + final fun component9(): kotlin/String // eu.vendeli.tgbot.types.payment/SuccessfulPayment.component9|component9(){}[0] + final fun copy(eu.vendeli.tgbot.types.internal/Currency = ..., kotlin/Int = ..., kotlin/String = ..., kotlin/String? = ..., eu.vendeli.tgbot.types.payment/OrderInfo? = ..., kotlinx.datetime/Instant? = ..., kotlin/Boolean? = ..., kotlin/Boolean? = ..., kotlin/String = ..., kotlin/String = ...): eu.vendeli.tgbot.types.payment/SuccessfulPayment // eu.vendeli.tgbot.types.payment/SuccessfulPayment.copy|copy(eu.vendeli.tgbot.types.internal.Currency;kotlin.Int;kotlin.String;kotlin.String?;eu.vendeli.tgbot.types.payment.OrderInfo?;kotlinx.datetime.Instant?;kotlin.Boolean?;kotlin.Boolean?;kotlin.String;kotlin.String){}[0] final fun equals(kotlin/Any?): kotlin/Boolean // eu.vendeli.tgbot.types.payment/SuccessfulPayment.equals|equals(kotlin.Any?){}[0] final fun hashCode(): kotlin/Int // eu.vendeli.tgbot.types.payment/SuccessfulPayment.hashCode|hashCode(){}[0] final fun toString(): kotlin/String // eu.vendeli.tgbot.types.payment/SuccessfulPayment.toString|toString(){}[0] @@ -8342,6 +8438,72 @@ final class eu.vendeli.tgbot.types.stars/StarTransactions { // eu.vendeli.tgbot. } } +final class eu.vendeli.tgbot.types.user/Gift { // eu.vendeli.tgbot.types.user/Gift|null[0] + constructor (kotlin/String, eu.vendeli.tgbot.types.media/Sticker, kotlin/Int, kotlin/Int? = ..., kotlin/Int? = ...) // eu.vendeli.tgbot.types.user/Gift.|(kotlin.String;eu.vendeli.tgbot.types.media.Sticker;kotlin.Int;kotlin.Int?;kotlin.Int?){}[0] + + final val id // eu.vendeli.tgbot.types.user/Gift.id|{}id[0] + final fun (): kotlin/String // eu.vendeli.tgbot.types.user/Gift.id.|(){}[0] + final val remainingCount // eu.vendeli.tgbot.types.user/Gift.remainingCount|{}remainingCount[0] + final fun (): kotlin/Int? // eu.vendeli.tgbot.types.user/Gift.remainingCount.|(){}[0] + final val starCount // eu.vendeli.tgbot.types.user/Gift.starCount|{}starCount[0] + final fun (): kotlin/Int // eu.vendeli.tgbot.types.user/Gift.starCount.|(){}[0] + final val sticker // eu.vendeli.tgbot.types.user/Gift.sticker|{}sticker[0] + final fun (): eu.vendeli.tgbot.types.media/Sticker // eu.vendeli.tgbot.types.user/Gift.sticker.|(){}[0] + final val totalCount // eu.vendeli.tgbot.types.user/Gift.totalCount|{}totalCount[0] + final fun (): kotlin/Int? // eu.vendeli.tgbot.types.user/Gift.totalCount.|(){}[0] + + final fun component1(): kotlin/String // eu.vendeli.tgbot.types.user/Gift.component1|component1(){}[0] + final fun component2(): eu.vendeli.tgbot.types.media/Sticker // eu.vendeli.tgbot.types.user/Gift.component2|component2(){}[0] + final fun component3(): kotlin/Int // eu.vendeli.tgbot.types.user/Gift.component3|component3(){}[0] + final fun component4(): kotlin/Int? // eu.vendeli.tgbot.types.user/Gift.component4|component4(){}[0] + final fun component5(): kotlin/Int? // eu.vendeli.tgbot.types.user/Gift.component5|component5(){}[0] + final fun copy(kotlin/String = ..., eu.vendeli.tgbot.types.media/Sticker = ..., kotlin/Int = ..., kotlin/Int? = ..., kotlin/Int? = ...): eu.vendeli.tgbot.types.user/Gift // eu.vendeli.tgbot.types.user/Gift.copy|copy(kotlin.String;eu.vendeli.tgbot.types.media.Sticker;kotlin.Int;kotlin.Int?;kotlin.Int?){}[0] + final fun equals(kotlin/Any?): kotlin/Boolean // eu.vendeli.tgbot.types.user/Gift.equals|equals(kotlin.Any?){}[0] + final fun hashCode(): kotlin/Int // eu.vendeli.tgbot.types.user/Gift.hashCode|hashCode(){}[0] + final fun toString(): kotlin/String // eu.vendeli.tgbot.types.user/Gift.toString|toString(){}[0] + + final object $serializer : kotlinx.serialization.internal/GeneratedSerializer { // eu.vendeli.tgbot.types.user/Gift.$serializer|null[0] + final val descriptor // eu.vendeli.tgbot.types.user/Gift.$serializer.descriptor|{}descriptor[0] + final fun (): kotlinx.serialization.descriptors/SerialDescriptor // eu.vendeli.tgbot.types.user/Gift.$serializer.descriptor.|(){}[0] + + final fun childSerializers(): kotlin/Array> // eu.vendeli.tgbot.types.user/Gift.$serializer.childSerializers|childSerializers(){}[0] + final fun deserialize(kotlinx.serialization.encoding/Decoder): eu.vendeli.tgbot.types.user/Gift // eu.vendeli.tgbot.types.user/Gift.$serializer.deserialize|deserialize(kotlinx.serialization.encoding.Decoder){}[0] + final fun serialize(kotlinx.serialization.encoding/Encoder, eu.vendeli.tgbot.types.user/Gift) // eu.vendeli.tgbot.types.user/Gift.$serializer.serialize|serialize(kotlinx.serialization.encoding.Encoder;eu.vendeli.tgbot.types.user.Gift){}[0] + } + + final object Companion { // eu.vendeli.tgbot.types.user/Gift.Companion|null[0] + final fun serializer(): kotlinx.serialization/KSerializer // eu.vendeli.tgbot.types.user/Gift.Companion.serializer|serializer(){}[0] + } +} + +final class eu.vendeli.tgbot.types.user/Gifts { // eu.vendeli.tgbot.types.user/Gifts|null[0] + constructor (kotlin.collections/List) // eu.vendeli.tgbot.types.user/Gifts.|(kotlin.collections.List){}[0] + + final val gifts // eu.vendeli.tgbot.types.user/Gifts.gifts|{}gifts[0] + final fun (): kotlin.collections/List // eu.vendeli.tgbot.types.user/Gifts.gifts.|(){}[0] + + final fun component1(): kotlin.collections/List // eu.vendeli.tgbot.types.user/Gifts.component1|component1(){}[0] + final fun copy(kotlin.collections/List = ...): eu.vendeli.tgbot.types.user/Gifts // eu.vendeli.tgbot.types.user/Gifts.copy|copy(kotlin.collections.List){}[0] + final fun equals(kotlin/Any?): kotlin/Boolean // eu.vendeli.tgbot.types.user/Gifts.equals|equals(kotlin.Any?){}[0] + final fun hashCode(): kotlin/Int // eu.vendeli.tgbot.types.user/Gifts.hashCode|hashCode(){}[0] + final fun toString(): kotlin/String // eu.vendeli.tgbot.types.user/Gifts.toString|toString(){}[0] + + final object $serializer : kotlinx.serialization.internal/GeneratedSerializer { // eu.vendeli.tgbot.types.user/Gifts.$serializer|null[0] + final val descriptor // eu.vendeli.tgbot.types.user/Gifts.$serializer.descriptor|{}descriptor[0] + final fun (): kotlinx.serialization.descriptors/SerialDescriptor // eu.vendeli.tgbot.types.user/Gifts.$serializer.descriptor.|(){}[0] + + final fun childSerializers(): kotlin/Array> // eu.vendeli.tgbot.types.user/Gifts.$serializer.childSerializers|childSerializers(){}[0] + final fun deserialize(kotlinx.serialization.encoding/Decoder): eu.vendeli.tgbot.types.user/Gifts // eu.vendeli.tgbot.types.user/Gifts.$serializer.deserialize|deserialize(kotlinx.serialization.encoding.Decoder){}[0] + final fun serialize(kotlinx.serialization.encoding/Encoder, eu.vendeli.tgbot.types.user/Gifts) // eu.vendeli.tgbot.types.user/Gifts.$serializer.serialize|serialize(kotlinx.serialization.encoding.Encoder;eu.vendeli.tgbot.types.user.Gifts){}[0] + } + + final object Companion { // eu.vendeli.tgbot.types.user/Gifts.Companion|null[0] + final val $childSerializers // eu.vendeli.tgbot.types.user/Gifts.Companion.$childSerializers|{}$childSerializers[0] + + final fun serializer(): kotlinx.serialization/KSerializer // eu.vendeli.tgbot.types.user/Gifts.Companion.serializer|serializer(){}[0] + } +} + final class eu.vendeli.tgbot.types/Birthdate { // eu.vendeli.tgbot.types/Birthdate|null[0] constructor (kotlin/Int, kotlin/Int, kotlin/Int? = ...) // eu.vendeli.tgbot.types/Birthdate.|(kotlin.Int;kotlin.Int;kotlin.Int?){}[0] @@ -9342,16 +9504,6 @@ final class eu.vendeli.tgbot.utils.builders/ReplyKeyboardMarkupBuilder : eu.vend final fun options(kotlin/Function1) // eu.vendeli.tgbot.utils.builders/ReplyKeyboardMarkupBuilder.options|options(kotlin.Function1){}[0] } -final class eu.vendeli.tgbot.utils/LoggingWrapper { // eu.vendeli.tgbot.utils/LoggingWrapper|null[0] - constructor (eu.vendeli.tgbot.types.internal.configuration/LoggingConfiguration, kotlin/String = ...) // eu.vendeli.tgbot.utils/LoggingWrapper.|(eu.vendeli.tgbot.types.internal.configuration.LoggingConfiguration;kotlin.String){}[0] - - final suspend fun debug(kotlin/Function0) // eu.vendeli.tgbot.utils/LoggingWrapper.debug|debug(kotlin.Function0){}[0] - final suspend fun error(kotlin/Throwable? = ..., kotlin/Function0) // eu.vendeli.tgbot.utils/LoggingWrapper.error|error(kotlin.Throwable?;kotlin.Function0){}[0] - final suspend fun info(kotlin/Function0) // eu.vendeli.tgbot.utils/LoggingWrapper.info|info(kotlin.Function0){}[0] - final suspend fun trace(kotlin/Function0) // eu.vendeli.tgbot.utils/LoggingWrapper.trace|trace(kotlin.Function0){}[0] - final suspend fun warn(kotlin/Function0) // eu.vendeli.tgbot.utils/LoggingWrapper.warn|warn(kotlin.Function0){}[0] -} - final class eu.vendeli.tgbot.utils/TgFailureException : eu.vendeli.tgbot.utils/TgException { // eu.vendeli.tgbot.utils/TgFailureException|null[0] constructor (kotlin/String) // eu.vendeli.tgbot.utils/TgFailureException.|(kotlin.String){}[0] @@ -11179,7 +11331,7 @@ sealed class eu.vendeli.tgbot.types.internal/CommonMatcher { // eu.vendeli.tgbot open fun toString(): kotlin/String // eu.vendeli.tgbot.types.internal/CommonMatcher.toString|toString(){}[0] final class Regex : eu.vendeli.tgbot.types.internal/CommonMatcher { // eu.vendeli.tgbot.types.internal/CommonMatcher.Regex|null[0] - constructor (kotlin.text/Regex, kotlin.reflect/KClass, kotlin.collections/Set) // eu.vendeli.tgbot.types.internal/CommonMatcher.Regex.|(kotlin.text.Regex;kotlin.reflect.KClass;kotlin.collections.Set){}[0] + constructor (kotlin.text/Regex, kotlin.reflect/KClass = ..., kotlin.collections/Set = ...) // eu.vendeli.tgbot.types.internal/CommonMatcher.Regex.|(kotlin.text.Regex;kotlin.reflect.KClass;kotlin.collections.Set){}[0] final val value // eu.vendeli.tgbot.types.internal/CommonMatcher.Regex.value|{}value[0] final fun (): kotlin.text/Regex // eu.vendeli.tgbot.types.internal/CommonMatcher.Regex.value.|(){}[0] @@ -11188,7 +11340,7 @@ sealed class eu.vendeli.tgbot.types.internal/CommonMatcher { // eu.vendeli.tgbot } final class String : eu.vendeli.tgbot.types.internal/CommonMatcher { // eu.vendeli.tgbot.types.internal/CommonMatcher.String|null[0] - constructor (kotlin/String, kotlin.reflect/KClass, kotlin.collections/Set) // eu.vendeli.tgbot.types.internal/CommonMatcher.String.|(kotlin.String;kotlin.reflect.KClass;kotlin.collections.Set){}[0] + constructor (kotlin/String, kotlin.reflect/KClass = ..., kotlin.collections/Set = ...) // eu.vendeli.tgbot.types.internal/CommonMatcher.String.|(kotlin.String;kotlin.reflect.KClass;kotlin.collections.Set){}[0] final val value // eu.vendeli.tgbot.types.internal/CommonMatcher.String.value|{}value[0] final fun (): kotlin/String // eu.vendeli.tgbot.types.internal/CommonMatcher.String.value.|(){}[0] @@ -12500,14 +12652,18 @@ sealed class eu.vendeli.tgbot.types.stars/TransactionPartner { // eu.vendeli.tgb } final class UserPartner : eu.vendeli.tgbot.types.stars/TransactionPartner { // eu.vendeli.tgbot.types.stars/TransactionPartner.UserPartner|null[0] - constructor (eu.vendeli.tgbot.types/User, kotlin/String? = ..., kotlin.collections/List? = ..., kotlin/String? = ...) // eu.vendeli.tgbot.types.stars/TransactionPartner.UserPartner.|(eu.vendeli.tgbot.types.User;kotlin.String?;kotlin.collections.List?;kotlin.String?){}[0] + constructor (eu.vendeli.tgbot.types/User, kotlin/String? = ..., kotlin.collections/List? = ..., kotlin/String? = ..., kotlin.time/Duration? = ..., kotlin/String? = ...) // eu.vendeli.tgbot.types.stars/TransactionPartner.UserPartner.|(eu.vendeli.tgbot.types.User;kotlin.String?;kotlin.collections.List?;kotlin.String?;kotlin.time.Duration?;kotlin.String?){}[0] + final val gift // eu.vendeli.tgbot.types.stars/TransactionPartner.UserPartner.gift|{}gift[0] + final fun (): kotlin/String? // eu.vendeli.tgbot.types.stars/TransactionPartner.UserPartner.gift.|(){}[0] final val invoicePayload // eu.vendeli.tgbot.types.stars/TransactionPartner.UserPartner.invoicePayload|{}invoicePayload[0] final fun (): kotlin/String? // eu.vendeli.tgbot.types.stars/TransactionPartner.UserPartner.invoicePayload.|(){}[0] final val paidMedia // eu.vendeli.tgbot.types.stars/TransactionPartner.UserPartner.paidMedia|{}paidMedia[0] final fun (): kotlin.collections/List? // eu.vendeli.tgbot.types.stars/TransactionPartner.UserPartner.paidMedia.|(){}[0] final val paidMediaPayload // eu.vendeli.tgbot.types.stars/TransactionPartner.UserPartner.paidMediaPayload|{}paidMediaPayload[0] final fun (): kotlin/String? // eu.vendeli.tgbot.types.stars/TransactionPartner.UserPartner.paidMediaPayload.|(){}[0] + final val subscriptionPeriod // eu.vendeli.tgbot.types.stars/TransactionPartner.UserPartner.subscriptionPeriod|{}subscriptionPeriod[0] + final fun (): kotlin.time/Duration? // eu.vendeli.tgbot.types.stars/TransactionPartner.UserPartner.subscriptionPeriod.|(){}[0] final val user // eu.vendeli.tgbot.types.stars/TransactionPartner.UserPartner.user|{}user[0] final fun (): eu.vendeli.tgbot.types/User // eu.vendeli.tgbot.types.stars/TransactionPartner.UserPartner.user.|(){}[0] @@ -12515,7 +12671,9 @@ sealed class eu.vendeli.tgbot.types.stars/TransactionPartner { // eu.vendeli.tgb final fun component2(): kotlin/String? // eu.vendeli.tgbot.types.stars/TransactionPartner.UserPartner.component2|component2(){}[0] final fun component3(): kotlin.collections/List? // eu.vendeli.tgbot.types.stars/TransactionPartner.UserPartner.component3|component3(){}[0] final fun component4(): kotlin/String? // eu.vendeli.tgbot.types.stars/TransactionPartner.UserPartner.component4|component4(){}[0] - final fun copy(eu.vendeli.tgbot.types/User = ..., kotlin/String? = ..., kotlin.collections/List? = ..., kotlin/String? = ...): eu.vendeli.tgbot.types.stars/TransactionPartner.UserPartner // eu.vendeli.tgbot.types.stars/TransactionPartner.UserPartner.copy|copy(eu.vendeli.tgbot.types.User;kotlin.String?;kotlin.collections.List?;kotlin.String?){}[0] + final fun component5(): kotlin.time/Duration? // eu.vendeli.tgbot.types.stars/TransactionPartner.UserPartner.component5|component5(){}[0] + final fun component6(): kotlin/String? // eu.vendeli.tgbot.types.stars/TransactionPartner.UserPartner.component6|component6(){}[0] + final fun copy(eu.vendeli.tgbot.types/User = ..., kotlin/String? = ..., kotlin.collections/List? = ..., kotlin/String? = ..., kotlin.time/Duration? = ..., kotlin/String? = ...): eu.vendeli.tgbot.types.stars/TransactionPartner.UserPartner // eu.vendeli.tgbot.types.stars/TransactionPartner.UserPartner.copy|copy(eu.vendeli.tgbot.types.User;kotlin.String?;kotlin.collections.List?;kotlin.String?;kotlin.time.Duration?;kotlin.String?){}[0] final fun equals(kotlin/Any?): kotlin/Boolean // eu.vendeli.tgbot.types.stars/TransactionPartner.UserPartner.equals|equals(kotlin.Any?){}[0] final fun hashCode(): kotlin/Int // eu.vendeli.tgbot.types.stars/TransactionPartner.UserPartner.hashCode|hashCode(){}[0] final fun toString(): kotlin/String // eu.vendeli.tgbot.types.stars/TransactionPartner.UserPartner.toString|toString(){}[0] @@ -13239,7 +13397,6 @@ final fun (eu.vendeli.tgbot.core/FunctionalHandlingDsl).eu.vendeli.tgbot.utils/o final fun (eu.vendeli.tgbot/TelegramBot).eu.vendeli.tgbot.utils/defineActivities(kotlin.collections/Map>) // eu.vendeli.tgbot.utils/defineActivities|defineActivities@eu.vendeli.tgbot.TelegramBot(kotlin.collections.Map>){}[0] final fun (kotlin/ByteArray).eu.vendeli.tgbot.utils/toImplicitFile(kotlin/String = ..., kotlin/String = ...): eu.vendeli.tgbot.types.internal/ImplicitFile.InpFile // eu.vendeli.tgbot.utils/toImplicitFile|toImplicitFile@kotlin.ByteArray(kotlin.String;kotlin.String){}[0] final fun (kotlin/ByteArray).eu.vendeli.tgbot.utils/toInputFile(kotlin/String = ..., kotlin/String = ...): eu.vendeli.tgbot.types.internal/InputFile // eu.vendeli.tgbot.utils/toInputFile|toInputFile@kotlin.ByteArray(kotlin.String;kotlin.String){}[0] -final fun (kotlin/String).eu.vendeli.tgbot.utils/checkIsInitDataSafe(kotlin/String, kotlin/String): kotlin/Boolean // eu.vendeli.tgbot.utils/checkIsInitDataSafe|checkIsInitDataSafe@kotlin.String(kotlin.String;kotlin.String){}[0] final fun <#A: eu.vendeli.tgbot.types.internal.chain/Link<*>> (eu.vendeli.tgbot.interfaces.ctx/InputListener).eu.vendeli.tgbot.utils/setChain(eu.vendeli.tgbot.types/User, #A) // eu.vendeli.tgbot.utils/setChain|setChain@eu.vendeli.tgbot.interfaces.ctx.InputListener(eu.vendeli.tgbot.types.User;0:0){0§>}[0] final fun <#A: kotlin/Any?> (eu.vendeli.tgbot.types.internal/Response<#A>).eu.vendeli.tgbot.types.internal/getOrNull(): #A? // eu.vendeli.tgbot.types.internal/getOrNull|getOrNull@eu.vendeli.tgbot.types.internal.Response<0:0>(){0§}[0] final fun <#A: kotlin/Any?> (eu.vendeli.tgbot.types.internal/Response<#A>).eu.vendeli.tgbot.types.internal/isSuccess(): kotlin/Boolean // eu.vendeli.tgbot.types.internal/isSuccess|isSuccess@eu.vendeli.tgbot.types.internal.Response<0:0>(){0§}[0] @@ -13274,10 +13431,12 @@ final inline fun eu.vendeli.tgbot.api.answer/answerShippingQuery(kotlin/String, final inline fun eu.vendeli.tgbot.api.answer/answerShippingQuery(kotlin/String, kotlin/Boolean = ..., kotlin/String? = ..., kotlin/Array...): eu.vendeli.tgbot.api.answer/AnswerShippingQueryAction // eu.vendeli.tgbot.api.answer/answerShippingQuery|answerShippingQuery(kotlin.String;kotlin.Boolean;kotlin.String?;kotlin.Array...){}[0] final inline fun eu.vendeli.tgbot.api.answer/answerWebAppQuery(kotlin/String, eu.vendeli.tgbot.types.inline/InlineQueryResult): eu.vendeli.tgbot.api.answer/AnswerWebAppQueryAction // eu.vendeli.tgbot.api.answer/answerWebAppQuery|answerWebAppQuery(kotlin.String;eu.vendeli.tgbot.types.inline.InlineQueryResult){}[0] final inline fun eu.vendeli.tgbot.api.botactions/close(): eu.vendeli.tgbot.api.botactions/CloseAction // eu.vendeli.tgbot.api.botactions/close|close(){}[0] -final inline fun eu.vendeli.tgbot.api.botactions/createInvoiceLink(kotlin/String, kotlin/String, kotlin/String, eu.vendeli.tgbot.types.internal/Currency, kotlin/Array..., kotlin/Function0): eu.vendeli.tgbot.api.botactions/CreateInvoiceLinkAction // eu.vendeli.tgbot.api.botactions/createInvoiceLink|createInvoiceLink(kotlin.String;kotlin.String;kotlin.String;eu.vendeli.tgbot.types.internal.Currency;kotlin.Array...;kotlin.Function0){}[0] -final inline fun eu.vendeli.tgbot.api.botactions/createInvoiceLink(kotlin/String, kotlin/String, kotlin/String, kotlin/String, eu.vendeli.tgbot.types.internal/Currency, kotlin.collections/List): eu.vendeli.tgbot.api.botactions/CreateInvoiceLinkAction // eu.vendeli.tgbot.api.botactions/createInvoiceLink|createInvoiceLink(kotlin.String;kotlin.String;kotlin.String;kotlin.String;eu.vendeli.tgbot.types.internal.Currency;kotlin.collections.List){}[0] +final inline fun eu.vendeli.tgbot.api.botactions/createInvoiceLink(kotlin/String, kotlin/String, eu.vendeli.tgbot.types.internal/Currency, kotlin/Array..., kotlin/Function0): eu.vendeli.tgbot.api.botactions/CreateInvoiceLinkAction // eu.vendeli.tgbot.api.botactions/createInvoiceLink|createInvoiceLink(kotlin.String;kotlin.String;eu.vendeli.tgbot.types.internal.Currency;kotlin.Array...;kotlin.Function0){}[0] +final inline fun eu.vendeli.tgbot.api.botactions/createInvoiceLink(kotlin/String, kotlin/String, kotlin/String, eu.vendeli.tgbot.types.internal/Currency, kotlin.collections/List): eu.vendeli.tgbot.api.botactions/CreateInvoiceLinkAction // eu.vendeli.tgbot.api.botactions/createInvoiceLink|createInvoiceLink(kotlin.String;kotlin.String;kotlin.String;eu.vendeli.tgbot.types.internal.Currency;kotlin.collections.List){}[0] final inline fun eu.vendeli.tgbot.api.botactions/deleteMyCommands(kotlin/String? = ..., eu.vendeli.tgbot.types.bot/BotCommandScope? = ...): eu.vendeli.tgbot.api.botactions/DeleteMyCommandsAction // eu.vendeli.tgbot.api.botactions/deleteMyCommands|deleteMyCommands(kotlin.String?;eu.vendeli.tgbot.types.bot.BotCommandScope?){}[0] final inline fun eu.vendeli.tgbot.api.botactions/deleteWebhook(kotlin/Boolean = ...): eu.vendeli.tgbot.api.botactions/DeleteWebhookAction // eu.vendeli.tgbot.api.botactions/deleteWebhook|deleteWebhook(kotlin.Boolean){}[0] +final inline fun eu.vendeli.tgbot.api.botactions/editUserStarSubscription(kotlin/Long, kotlin/String, kotlin/Boolean): eu.vendeli.tgbot.api.botactions/EditUserStarSubscriptionAction // eu.vendeli.tgbot.api.botactions/editUserStarSubscription|editUserStarSubscription(kotlin.Long;kotlin.String;kotlin.Boolean){}[0] +final inline fun eu.vendeli.tgbot.api.botactions/getAvailableGifts(): eu.vendeli.tgbot.api.botactions/GetAvailableGiftsAction // eu.vendeli.tgbot.api.botactions/getAvailableGifts|getAvailableGifts(){}[0] final inline fun eu.vendeli.tgbot.api.botactions/getBusinessConnection(kotlin/String): eu.vendeli.tgbot.api.botactions/GetBusinessConnectionAction // eu.vendeli.tgbot.api.botactions/getBusinessConnection|getBusinessConnection(kotlin.String){}[0] final inline fun eu.vendeli.tgbot.api.botactions/getMe(): eu.vendeli.tgbot.api.botactions/GetMeAction // eu.vendeli.tgbot.api.botactions/getMe|getMe(){}[0] final inline fun eu.vendeli.tgbot.api.botactions/getMyCommands(kotlin/String? = ..., eu.vendeli.tgbot.types.bot/BotCommandScope? = ...): eu.vendeli.tgbot.api.botactions/GetMyCommandsAction // eu.vendeli.tgbot.api.botactions/getMyCommands|getMyCommands(kotlin.String?;eu.vendeli.tgbot.types.bot.BotCommandScope?){}[0] @@ -13290,12 +13449,15 @@ final inline fun eu.vendeli.tgbot.api.botactions/getUpdates(): eu.vendeli.tgbot. final inline fun eu.vendeli.tgbot.api.botactions/getWebhookInfo(): eu.vendeli.tgbot.api.botactions/GetWebhookInfoAction // eu.vendeli.tgbot.api.botactions/getWebhookInfo|getWebhookInfo(){}[0] final inline fun eu.vendeli.tgbot.api.botactions/logOut(): eu.vendeli.tgbot.api.botactions/LogOutAction // eu.vendeli.tgbot.api.botactions/logOut|logOut(){}[0] final inline fun eu.vendeli.tgbot.api.botactions/refundStarPayment(kotlin/String, kotlin/Long): eu.vendeli.tgbot.api.botactions/RefundStarPaymentAction // eu.vendeli.tgbot.api.botactions/refundStarPayment|refundStarPayment(kotlin.String;kotlin.Long){}[0] +final inline fun eu.vendeli.tgbot.api.botactions/savePreparedInlineMessage(kotlin/Long, eu.vendeli.tgbot.types.inline/InlineQueryResult): eu.vendeli.tgbot.api.botactions/SavePreparedInlineMessageAction // eu.vendeli.tgbot.api.botactions/savePreparedInlineMessage|savePreparedInlineMessage(kotlin.Long;eu.vendeli.tgbot.types.inline.InlineQueryResult){}[0] +final inline fun eu.vendeli.tgbot.api.botactions/sendGift(kotlin/Long, kotlin/String, eu.vendeli.tgbot.types/ParseMode? = ..., noinline kotlin/Function0? = ...): eu.vendeli.tgbot.api.botactions/SendGiftAction // eu.vendeli.tgbot.api.botactions/sendGift|sendGift(kotlin.Long;kotlin.String;eu.vendeli.tgbot.types.ParseMode?;kotlin.Function0?){}[0] final inline fun eu.vendeli.tgbot.api.botactions/setMyCommands(kotlin/String? = ..., eu.vendeli.tgbot.types.bot/BotCommandScope? = ..., kotlin.collections/List): eu.vendeli.tgbot.api.botactions/SetMyCommandsAction // eu.vendeli.tgbot.api.botactions/setMyCommands|setMyCommands(kotlin.String?;eu.vendeli.tgbot.types.bot.BotCommandScope?;kotlin.collections.List){}[0] final inline fun eu.vendeli.tgbot.api.botactions/setMyCommands(kotlin/String? = ..., eu.vendeli.tgbot.types.bot/BotCommandScope? = ..., kotlin/Array...): eu.vendeli.tgbot.api.botactions/SetMyCommandsAction // eu.vendeli.tgbot.api.botactions/setMyCommands|setMyCommands(kotlin.String?;eu.vendeli.tgbot.types.bot.BotCommandScope?;kotlin.Array...){}[0] final inline fun eu.vendeli.tgbot.api.botactions/setMyDefaultAdministratorRights(eu.vendeli.tgbot.types.chat/ChatAdministratorRights? = ..., kotlin/Boolean? = ...): eu.vendeli.tgbot.api.botactions/SetMyDefaultAdministratorRightsAction // eu.vendeli.tgbot.api.botactions/setMyDefaultAdministratorRights|setMyDefaultAdministratorRights(eu.vendeli.tgbot.types.chat.ChatAdministratorRights?;kotlin.Boolean?){}[0] final inline fun eu.vendeli.tgbot.api.botactions/setMyDescription(kotlin/String? = ..., kotlin/String? = ...): eu.vendeli.tgbot.api.botactions/SetMyDescriptionAction // eu.vendeli.tgbot.api.botactions/setMyDescription|setMyDescription(kotlin.String?;kotlin.String?){}[0] final inline fun eu.vendeli.tgbot.api.botactions/setMyName(kotlin/String? = ..., kotlin/String? = ...): eu.vendeli.tgbot.api.botactions/SetMyNameAction // eu.vendeli.tgbot.api.botactions/setMyName|setMyName(kotlin.String?;kotlin.String?){}[0] final inline fun eu.vendeli.tgbot.api.botactions/setMyShortDescription(kotlin/String? = ..., kotlin/String? = ...): eu.vendeli.tgbot.api.botactions/SetMyShortDescriptionAction // eu.vendeli.tgbot.api.botactions/setMyShortDescription|setMyShortDescription(kotlin.String?;kotlin.String?){}[0] +final inline fun eu.vendeli.tgbot.api.botactions/setUserEmojiStatus(kotlin/Long, kotlin/String? = ..., kotlinx.datetime/Instant? = ...): eu.vendeli.tgbot.api.botactions/SetUserEmojiStatusAction // eu.vendeli.tgbot.api.botactions/setUserEmojiStatus|setUserEmojiStatus(kotlin.Long;kotlin.String?;kotlinx.datetime.Instant?){}[0] final inline fun eu.vendeli.tgbot.api.botactions/setWebhook(kotlin/String): eu.vendeli.tgbot.api.botactions/SetWebhookAction // eu.vendeli.tgbot.api.botactions/setWebhook|setWebhook(kotlin.String){}[0] final inline fun eu.vendeli.tgbot.api.chat/approveChatJoinRequest(eu.vendeli.tgbot.types/User): eu.vendeli.tgbot.api.chat/ApproveChatJoinRequestAction // eu.vendeli.tgbot.api.chat/approveChatJoinRequest|approveChatJoinRequest(eu.vendeli.tgbot.types.User){}[0] final inline fun eu.vendeli.tgbot.api.chat/approveChatJoinRequest(kotlin/Long): eu.vendeli.tgbot.api.chat/ApproveChatJoinRequestAction // eu.vendeli.tgbot.api.chat/approveChatJoinRequest|approveChatJoinRequest(kotlin.Long){}[0] @@ -13509,6 +13671,10 @@ final inline fun eu.vendeli.tgbot.api/stopMessageLiveLocation(kotlin/Long): eu.v final inline fun eu.vendeli.tgbot.api/stopPoll(kotlin/Long): eu.vendeli.tgbot.api/StopPollAction // eu.vendeli.tgbot.api/stopPoll|stopPoll(kotlin.Long){}[0] final inline fun eu.vendeli.tgbot.api/venue(kotlin/Float, kotlin/Float, kotlin/String, kotlin/String): eu.vendeli.tgbot.api/SendVenueAction // eu.vendeli.tgbot.api/venue|venue(kotlin.Float;kotlin.Float;kotlin.String;kotlin.String){}[0] final suspend fun (eu.vendeli.tgbot.core/TgUpdateHandler).eu.vendeli.tgbot.utils/runExceptionHandler(kotlinx.coroutines/CoroutineDispatcher = ..., kotlin/Long = ..., eu.vendeli.tgbot.interfaces.helper/ExceptionHandler): kotlinx.coroutines/Job // eu.vendeli.tgbot.utils/runExceptionHandler|runExceptionHandler@eu.vendeli.tgbot.core.TgUpdateHandler(kotlinx.coroutines.CoroutineDispatcher;kotlin.Long;eu.vendeli.tgbot.interfaces.helper.ExceptionHandler){}[0] +final suspend inline fun (io.ktor.util.logging/Logger).eu.vendeli.tgbot.utils/debug(kotlin/Function0) // eu.vendeli.tgbot.utils/debug|debug@io.ktor.util.logging.Logger(kotlin.Function0){}[0] +final suspend inline fun (io.ktor.util.logging/Logger).eu.vendeli.tgbot.utils/error(kotlin/Throwable? = ..., kotlin/Function0) // eu.vendeli.tgbot.utils/error|error@io.ktor.util.logging.Logger(kotlin.Throwable?;kotlin.Function0){}[0] +final suspend inline fun (io.ktor.util.logging/Logger).eu.vendeli.tgbot.utils/info(kotlin/Function0) // eu.vendeli.tgbot.utils/info|info@io.ktor.util.logging.Logger(kotlin.Function0){}[0] +final suspend inline fun (io.ktor.util.logging/Logger).eu.vendeli.tgbot.utils/warn(kotlin/Function0) // eu.vendeli.tgbot.utils/warn|warn@io.ktor.util.logging.Logger(kotlin.Function0){}[0] final suspend inline fun <#A: kotlin/Any?, #B: kotlin/Any?> (kotlinx.coroutines/Deferred>).eu.vendeli.tgbot.types.internal/foldResponse(kotlin/Function1, #B>, kotlin/Function1): #B // eu.vendeli.tgbot.types.internal/foldResponse|foldResponse@kotlinx.coroutines.Deferred>(kotlin.Function1,0:1>;kotlin.Function1){0§;1§}[0] final suspend inline fun <#A: kotlin/Any?> (kotlinx.coroutines/Deferred>).eu.vendeli.tgbot.types.internal/getOrNull(): #A? // eu.vendeli.tgbot.types.internal/getOrNull|getOrNull@kotlinx.coroutines.Deferred>(){0§}[0] final suspend inline fun <#A: kotlin/Any?> (kotlinx.coroutines/Deferred>).eu.vendeli.tgbot.types.internal/onFailure(kotlin/Function1): #A? // eu.vendeli.tgbot.types.internal/onFailure|onFailure@kotlinx.coroutines.Deferred>(kotlin.Function1){0§}[0] diff --git a/telegram-bot/build.gradle.kts b/telegram-bot/build.gradle.kts index a4076c1f52..1e9a5c7fc1 100644 --- a/telegram-bot/build.gradle.kts +++ b/telegram-bot/build.gradle.kts @@ -19,7 +19,6 @@ configuredKotlin { implementation(libs.kotlin.serialization) implementation(libs.kotlin.reflect) - implementation(libs.krypto) implementation(libs.stately) implementation(libs.ktor.client.core) implementation(libs.ktor.client.logging) @@ -37,15 +36,12 @@ configuredKotlin { implementation(libs.ktor.client.java) } jsMain.dependencies { - implementation(libs.logging) implementation(libs.ktor.client.js) } named("linuxX64Main").dependencies { - implementation(libs.logging) implementation(libs.ktor.client.curl) } named("mingwX64Main").dependencies { - implementation(libs.logging) implementation(libs.ktor.client.winhttp) } } @@ -53,9 +49,7 @@ configuredKotlin { targets.all { compilations.all { compileTaskProvider.configure { - compilerOptions { - allWarningsAsErrors = true - } + compilerOptions.allWarningsAsErrors = true } } } diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/TelegramBot.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/TelegramBot.kt index 7d0c74d7d4..d607cd8e17 100644 --- a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/TelegramBot.kt +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/TelegramBot.kt @@ -8,8 +8,8 @@ import eu.vendeli.tgbot.types.internal.configuration.BotConfiguration import eu.vendeli.tgbot.types.media.File import eu.vendeli.tgbot.utils.BotConfigurator import eu.vendeli.tgbot.utils.FunctionalHandlingBlock -import eu.vendeli.tgbot.utils.LoggingWrapper import eu.vendeli.tgbot.utils.getConfiguredHttpClient +import eu.vendeli.tgbot.utils.getLogger import io.ktor.client.HttpClient import io.ktor.client.request.get import io.ktor.client.statement.readRawBytes @@ -48,7 +48,7 @@ class TelegramBot( } internal val config = BotConfiguration().apply(botConfiguration) - internal val logger = LoggingWrapper(config.logging, "eu.vendeli.TelegramBot") + internal val logger = getLogger(config.logging.botLogLevel, "eu.vendeli.TelegramBot") internal val baseUrl by lazy { "${config.apiHost}/bot$token" + if (config.isTestEnv) "/test/" else "/" } diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/annotations/ArgParser.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/annotations/ArgParser.kt new file mode 100644 index 0000000000..75f84fc420 --- /dev/null +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/annotations/ArgParser.kt @@ -0,0 +1,15 @@ +package eu.vendeli.tgbot.annotations + +import eu.vendeli.tgbot.implementations.DefaultArgParser +import eu.vendeli.tgbot.interfaces.helper.ArgumentParser +import kotlin.reflect.KClass + +/** + * The annotation used to set an argument parsing mechanism that handlers will pick. + * + * @property argParser Custom argument parser. + */ +@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) +annotation class ArgParser( + val argParser: KClass = DefaultArgParser::class, +) diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/annotations/CommandHandler.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/annotations/CommandHandler.kt index ad49e23eb6..a844ec88f5 100644 --- a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/annotations/CommandHandler.kt +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/annotations/CommandHandler.kt @@ -20,23 +20,43 @@ import kotlin.reflect.KClass @Retention(AnnotationRetention.SOURCE) annotation class CommandHandler( val value: Array, + @Deprecated( + "The functionality of the parameter is given in a separate annotation, please use it. The parameter will be removed soon.", + ) val rateLimits: RateLimits = RateLimits(0, 0), val scope: Array = [UpdateType.MESSAGE], + @Deprecated( + "The functionality of the parameter is given in a separate annotation, please use it. The parameter will be removed soon.", + ) val guard: KClass = DefaultGuard::class, + @Deprecated( + "The functionality of the parameter is given in a separate annotation, please use it. The parameter will be removed soon.", + ) val argParser: KClass = DefaultArgParser::class, ) { /** * Shortcut [CommandHandler] annotation with specified scope for [UpdateType.CALLBACK_QUERY]. * * @property value Keywords of the command. + * @property autoAnswer Reply to callbackQuery automatically (call `answerCallbackQuery` before handling). * @property rateLimits Query limits for this particular command. * @property guard Guard condition that will be checked. * @property argParser Custom argument parser. */ annotation class CallbackQuery( val value: Array, + val autoAnswer: Boolean = false, + @Deprecated( + "The functionality of the parameter is given in a separate annotation, please use it. The parameter will be removed soon.", + ) val rateLimits: RateLimits = RateLimits(0, 0), + @Deprecated( + "The functionality of the parameter is given in a separate annotation, please use it. The parameter will be removed soon.", + ) val guard: KClass = DefaultGuard::class, + @Deprecated( + "The functionality of the parameter is given in a separate annotation, please use it. The parameter will be removed soon.", + ) val argParser: KClass = DefaultArgParser::class, ) } diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/annotations/CommonHandler.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/annotations/CommonHandler.kt index d290e62bfc..bfec7f7169 100644 --- a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/annotations/CommonHandler.kt +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/annotations/CommonHandler.kt @@ -32,7 +32,13 @@ annotation class CommonHandler { val filter: KClass = DefaultFilter::class, val priority: Int = 0, val scope: Array = [UpdateType.MESSAGE], + @Deprecated( + "The functionality of the parameter is given in a separate annotation, please use it. The parameter will be removed soon.", + ) val rateLimits: RateLimits = RateLimits(0, 0), + @Deprecated( + "The functionality of the parameter is given in a separate annotation, please use it. The parameter will be removed soon.", + ) val argParser: KClass = DefaultArgParser::class, ) @@ -55,7 +61,13 @@ annotation class CommonHandler { val filter: KClass = DefaultFilter::class, val priority: Int = 0, val scope: Array = [UpdateType.MESSAGE], + @Deprecated( + "The functionality of the parameter is given in a separate annotation, please use it. The parameter will be removed soon.", + ) val rateLimits: RateLimits = RateLimits(0, 0), + @Deprecated( + "The functionality of the parameter is given in a separate annotation, please use it. The parameter will be removed soon.", + ) val argParser: KClass = DefaultArgParser::class, ) } diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/annotations/Guard.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/annotations/Guard.kt new file mode 100644 index 0000000000..e68e6aa27c --- /dev/null +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/annotations/Guard.kt @@ -0,0 +1,15 @@ +package eu.vendeli.tgbot.annotations + +import eu.vendeli.tgbot.implementations.DefaultGuard +import eu.vendeli.tgbot.interfaces.helper.Guard +import kotlin.reflect.KClass + +/** + * The annotation used to set a guarding mechanism that handlers will pick. + * + * @property guard Guard condition that will be checked. + */ +@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) +annotation class Guard( + val guard: KClass = DefaultGuard::class, +) diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/annotations/InputHandler.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/annotations/InputHandler.kt index bf4e85291a..dafbe0eb6e 100644 --- a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/annotations/InputHandler.kt +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/annotations/InputHandler.kt @@ -15,6 +15,12 @@ import kotlin.reflect.KClass @Retention(AnnotationRetention.SOURCE) annotation class InputHandler( val value: Array, + @Deprecated( + "The functionality of the parameter is given in a separate annotation, please use it. The parameter will be removed soon.", + ) val rateLimits: RateLimits = RateLimits(0, 0), + @Deprecated( + "The functionality of the parameter is given in a separate annotation, please use it. The parameter will be removed soon.", + ) val guard: KClass = DefaultGuard::class, ) diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/annotations/RateLimits.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/annotations/RateLimits.kt index edead9e2f4..829b67bc9c 100644 --- a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/annotations/RateLimits.kt +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/annotations/RateLimits.kt @@ -6,7 +6,7 @@ package eu.vendeli.tgbot.annotations * @property period The period for which the requests will be counted. (in milliseconds) * @property rate The number of requests for a certain period. */ -@Target(AnnotationTarget.ANNOTATION_CLASS) +@Target(AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) @Retention(AnnotationRetention.SOURCE) annotation class RateLimits( val period: Long = 0L, diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/annotations/internal/TgAPI.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/annotations/internal/TgAPI.kt index c009862841..5d3f6d1bb4 100644 --- a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/annotations/internal/TgAPI.kt +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/annotations/internal/TgAPI.kt @@ -11,7 +11,7 @@ package eu.vendeli.tgbot.annotations.internal ) annotation class TgAPI { @Retention(AnnotationRetention.SOURCE) - @Target(AnnotationTarget.PROPERTY, AnnotationTarget.CLASS) + @Target(AnnotationTarget.PROPERTY, AnnotationTarget.CLASS, AnnotationTarget.TYPE) annotation class Name( val value: String, ) diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/api/Poll.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/api/Poll.kt index 41c13f4909..53920e7581 100644 --- a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/api/Poll.kt +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/api/Poll.kt @@ -5,6 +5,7 @@ package eu.vendeli.tgbot.api import eu.vendeli.tgbot.annotations.internal.TgAPI import eu.vendeli.tgbot.interfaces.action.Action import eu.vendeli.tgbot.interfaces.action.BusinessActionExt +import eu.vendeli.tgbot.interfaces.features.EntitiesFeature import eu.vendeli.tgbot.interfaces.features.MarkupFeature import eu.vendeli.tgbot.interfaces.features.OptionsFeature import eu.vendeli.tgbot.types.internal.options.PollOptions @@ -22,6 +23,8 @@ class SendPollAction( ) : Action(), BusinessActionExt, OptionsFeature, + @TgAPI.Name("questionEntities") + EntitiesFeature, MarkupFeature { @TgAPI.Name("sendPoll") override val method = "sendPoll" diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/api/botactions/CreateInvoiceLink.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/api/botactions/CreateInvoiceLink.kt index 9908ef036d..25dbfbf764 100644 --- a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/api/botactions/CreateInvoiceLink.kt +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/api/botactions/CreateInvoiceLink.kt @@ -3,6 +3,7 @@ package eu.vendeli.tgbot.api.botactions import eu.vendeli.tgbot.annotations.internal.TgAPI +import eu.vendeli.tgbot.interfaces.action.BusinessActionExt import eu.vendeli.tgbot.interfaces.action.SimpleAction import eu.vendeli.tgbot.interfaces.features.OptionsFeature import eu.vendeli.tgbot.types.internal.Currency @@ -17,10 +18,10 @@ class CreateInvoiceLinkAction( title: String, description: String, payload: String, - providerToken: String, currency: Currency, prices: List, ) : SimpleAction(), + BusinessActionExt, OptionsFeature { override val options = CreateInvoiceLinkOptions() @@ -32,7 +33,6 @@ class CreateInvoiceLinkAction( parameters["title"] = title.toJsonElement() parameters["description"] = description.toJsonElement() parameters["payload"] = payload.toJsonElement() - parameters["provider_token"] = providerToken.toJsonElement() parameters["currency"] = currency.name.toJsonElement() parameters["prices"] = prices.encodeWith(LabeledPrice.serializer()) } @@ -42,12 +42,14 @@ class CreateInvoiceLinkAction( * Use this method to create a link for an invoice. Returns the created invoice link as String on success. * * [Api reference](https://core.telegram.org/bots/api#createinvoicelink) + * @param businessConnectionId Unique identifier of the business connection on behalf of which the link will be created * @param title Product name, 1-32 characters * @param description Product description, 1-255 characters * @param payload Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes. * @param providerToken Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars. * @param currency Three-letter ISO 4217 currency code, see more on currencies. Pass "XTR" for payments in Telegram Stars. * @param prices Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars. + * @param subscriptionPeriod The number of seconds the subscription will be active for before the next payment. The currency must be set to "XTR" (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. * @param maxTipAmount The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars. * @param suggestedTipAmounts A JSON-serialized array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount. * @param providerData JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider. @@ -70,17 +72,15 @@ inline fun createInvoiceLink( title: String, description: String, payload: String, - providerToken: String, currency: Currency, prices: List, -) = CreateInvoiceLinkAction(title, description, payload, providerToken, currency, prices) +) = CreateInvoiceLinkAction(title, description, payload, currency, prices) @TgAPI inline fun createInvoiceLink( title: String, description: String, - providerToken: String, currency: Currency, vararg prices: LabeledPrice, payload: () -> String, -) = createInvoiceLink(title, description, payload(), providerToken, currency, prices.asList()) +) = createInvoiceLink(title, description, payload(), currency, prices.asList()) diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/api/botactions/EditUserStarSubscription.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/api/botactions/EditUserStarSubscription.kt new file mode 100644 index 0000000000..f765b20809 --- /dev/null +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/api/botactions/EditUserStarSubscription.kt @@ -0,0 +1,42 @@ +@file:Suppress("MatchingDeclarationName") + +package eu.vendeli.tgbot.api.botactions + +import eu.vendeli.tgbot.annotations.internal.TgAPI +import eu.vendeli.tgbot.interfaces.action.SimpleAction +import eu.vendeli.tgbot.utils.getReturnType +import eu.vendeli.tgbot.utils.toJsonElement + +@TgAPI +class EditUserStarSubscriptionAction( + userId: Long, + telegramPaymentChargeId: String, + isCanceled: Boolean, +) : SimpleAction() { + @TgAPI.Name("editUserStarSubscription") + override val method = "editUserStarSubscription" + override val returnType = getReturnType() + + init { + parameters["user_id"] = userId.toJsonElement() + parameters["telegram_payment_charge_id"] = telegramPaymentChargeId.toJsonElement() + parameters["is_canceled"] = isCanceled.toJsonElement() + } +} + +/** + * Allows the bot to cancel or re-enable extension of a subscription paid in Telegram Stars. Returns True on success. + * + * [Api reference](https://core.telegram.org/bots/api#edituserstarsubscription) + * @param userId Identifier of the user whose subscription will be edited + * @param telegramPaymentChargeId Telegram payment identifier for the subscription + * @param isCanceled Pass True to cancel extension of the user subscription; the subscription must be active up to the end of the current subscription period. Pass False to allow the user to re-enable a subscription that was previously canceled by the bot. + * @returns [Boolean] + */ +@Suppress("NOTHING_TO_INLINE") +@TgAPI +inline fun editUserStarSubscription( + userId: Long, + telegramPaymentChargeId: String, + isCanceled: Boolean, +) = EditUserStarSubscriptionAction(userId, telegramPaymentChargeId, isCanceled) diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/api/botactions/GetAvailableGifts.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/api/botactions/GetAvailableGifts.kt new file mode 100644 index 0000000000..e41a085d32 --- /dev/null +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/api/botactions/GetAvailableGifts.kt @@ -0,0 +1,26 @@ +@file:Suppress("MatchingDeclarationName") + +package eu.vendeli.tgbot.api.botactions + +import eu.vendeli.tgbot.annotations.internal.TgAPI +import eu.vendeli.tgbot.interfaces.action.SimpleAction +import eu.vendeli.tgbot.types.user.Gifts +import eu.vendeli.tgbot.utils.getReturnType + +@TgAPI +class GetAvailableGiftsAction : SimpleAction() { + @TgAPI.Name("getAvailableGifts") + override val method = "getAvailableGifts" + override val returnType = getReturnType() +} + +/** + * Returns the list of gifts that can be sent by the bot to users. Requires no parameters. Returns a Gifts object. + * + * [Api reference](https://core.telegram.org/bots/api#getavailablegifts) + * + * @returns [Gifts] + */ +@Suppress("NOTHING_TO_INLINE") +@TgAPI +inline fun getAvailableGifts() = GetAvailableGiftsAction() diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/api/botactions/SavePreparedInlineMessage.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/api/botactions/SavePreparedInlineMessage.kt new file mode 100644 index 0000000000..c3bfb56293 --- /dev/null +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/api/botactions/SavePreparedInlineMessage.kt @@ -0,0 +1,49 @@ +@file:Suppress("MatchingDeclarationName") + +package eu.vendeli.tgbot.api.botactions + +import eu.vendeli.tgbot.annotations.internal.TgAPI +import eu.vendeli.tgbot.interfaces.action.SimpleAction +import eu.vendeli.tgbot.interfaces.features.OptionsFeature +import eu.vendeli.tgbot.types.inline.InlineQueryResult +import eu.vendeli.tgbot.types.internal.options.SavePreparedInlineMessageOptions +import eu.vendeli.tgbot.types.msg.PreparedInlineMessage +import eu.vendeli.tgbot.utils.encodeWith +import eu.vendeli.tgbot.utils.getReturnType +import eu.vendeli.tgbot.utils.toJsonElement + +@TgAPI +class SavePreparedInlineMessageAction( + userId: Long, + result: InlineQueryResult, +) : SimpleAction(), + OptionsFeature { + @TgAPI.Name("savePreparedInlineMessage") + override val method = "savePreparedInlineMessage" + override val returnType = getReturnType() + override val options = SavePreparedInlineMessageOptions() + + init { + parameters["user_id"] = userId.toJsonElement() + parameters["result"] = result.encodeWith(InlineQueryResult.serializer()) + } +} + +/** + * Stores a message that can be sent by a user of a Mini App. Returns a PreparedInlineMessage object. + * + * [Api reference](https://core.telegram.org/bots/api#savepreparedinlinemessage) + * @param userId Unique identifier of the target user that can use the prepared message + * @param result A JSON-serialized object describing the message to be sent + * @param allowUserChats Pass True if the message can be sent to private chats with users + * @param allowBotChats Pass True if the message can be sent to private chats with bots + * @param allowGroupChats Pass True if the message can be sent to group and supergroup chats + * @param allowChannelChats Pass True if the message can be sent to channel chats + * @returns [PreparedInlineMessage] + */ +@Suppress("NOTHING_TO_INLINE") +@TgAPI +inline fun savePreparedInlineMessage( + userId: Long, + result: InlineQueryResult, +) = SavePreparedInlineMessageAction(userId, result) diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/api/botactions/SendGift.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/api/botactions/SendGift.kt new file mode 100644 index 0000000000..d30162dbc5 --- /dev/null +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/api/botactions/SendGift.kt @@ -0,0 +1,52 @@ +@file:Suppress("MatchingDeclarationName") + +package eu.vendeli.tgbot.api.botactions + +import eu.vendeli.tgbot.annotations.internal.TgAPI +import eu.vendeli.tgbot.interfaces.action.SimpleAction +import eu.vendeli.tgbot.interfaces.features.EntitiesFeature +import eu.vendeli.tgbot.types.ParseMode +import eu.vendeli.tgbot.utils.getReturnType +import eu.vendeli.tgbot.utils.toJsonElement + +@TgAPI +class SendGiftAction( + userId: Long, + giftId: String, + textParseMode: ParseMode? = null, + text: (() -> String)? = null, +) : SimpleAction(), + @TgAPI.Name("textEntities") + EntitiesFeature { + @TgAPI.Name("sendGift") + override val method = "sendGift" + override val returnType = getReturnType() + override val entitiesFieldName = "text_entities" + + init { + parameters["user_id"] = userId.toJsonElement() + parameters["gift_id"] = giftId.toJsonElement() + textParseMode?.let { parameters["text_parse_mode"] = it.name.toJsonElement() } + text?.let { parameters["text"] = it().toJsonElement() } + } +} + +/** + * Sends a gift to the given user. The gift can't be converted to Telegram Stars by the user. Returns True on success. + * + * [Api reference](https://core.telegram.org/bots/api#sendgift) + * @param userId Unique identifier of the target user that will receive the gift + * @param giftId Identifier of the gift + * @param text Text that will be shown along with the gift; 0-255 characters + * @param textParseMode Mode for parsing entities in the text. See formatting options for more details. Entities other than "bold", "italic", "underline", "strikethrough", "spoiler", and "custom_emoji" are ignored. + * @param textEntities A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than "bold", "italic", "underline", "strikethrough", "spoiler", and "custom_emoji" are ignored. + * @returns [Boolean] + */ +@Suppress("NOTHING_TO_INLINE") +@TgAPI +inline fun sendGift( + userId: Long, + giftId: String, + textParseMode: ParseMode? = null, + noinline text: (() -> String)? = null, +) = SendGiftAction(userId, giftId, textParseMode, text) diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/api/botactions/SetUserEmojiStatus.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/api/botactions/SetUserEmojiStatus.kt new file mode 100644 index 0000000000..4c50414aff --- /dev/null +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/api/botactions/SetUserEmojiStatus.kt @@ -0,0 +1,45 @@ +@file:Suppress("MatchingDeclarationName") + +package eu.vendeli.tgbot.api.botactions + +import eu.vendeli.tgbot.annotations.internal.TgAPI +import eu.vendeli.tgbot.interfaces.action.SimpleAction +import eu.vendeli.tgbot.utils.getReturnType +import eu.vendeli.tgbot.utils.toJsonElement +import kotlinx.datetime.Instant + +@TgAPI +class SetUserEmojiStatusAction( + userId: Long, + emojiStatusCustomEmojiId: String? = null, + emojiStatusExpirationDate: Instant? = null, +) : SimpleAction() { + @TgAPI.Name("setUserEmojiStatus") + override val method = "setUserEmojiStatus" + override val returnType = getReturnType() + + init { + parameters["user_id"] = userId.toJsonElement() + emojiStatusCustomEmojiId?.toJsonElement()?.let { parameters["emoji_status_custom_emoji_id"] = it } + emojiStatusExpirationDate?.epochSeconds?.toJsonElement()?.let { + parameters["emoji_status_expiration_date"] = it + } + } +} + +/** + * Changes the emoji status for a given user that previously allowed the bot to manage their emoji status via the Mini App method requestEmojiStatusAccess. Returns True on success. + * + * [Api reference](https://core.telegram.org/bots/api#setuseremojistatus) + * @param userId Unique identifier of the target user + * @param emojiStatusCustomEmojiId Custom emoji identifier of the emoji status to set. Pass an empty string to remove the status. + * @param emojiStatusExpirationDate Expiration date of the emoji status, if any + * @returns [Boolean] + */ +@Suppress("NOTHING_TO_INLINE") +@TgAPI +inline fun setUserEmojiStatus( + userId: Long, + emojiStatusCustomEmojiId: String? = null, + emojiStatusExpirationDate: Instant? = null, +) = SetUserEmojiStatusAction(userId, emojiStatusCustomEmojiId, emojiStatusExpirationDate) diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/core/FunctionalHandlingDsl.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/core/FunctionalHandlingDsl.kt index 34f4696435..6115cb579c 100644 --- a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/core/FunctionalHandlingDsl.kt +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/core/FunctionalHandlingDsl.kt @@ -16,11 +16,11 @@ import eu.vendeli.tgbot.types.internal.ProcessedUpdate import eu.vendeli.tgbot.types.internal.UpdateType import eu.vendeli.tgbot.types.internal.chain.SingleInputChain import eu.vendeli.tgbot.types.internal.configuration.RateLimits -import eu.vendeli.tgbot.utils.DEFAULT_COMMAND_SCOPE -import eu.vendeli.tgbot.utils.LoggingWrapper +import eu.vendeli.tgbot.utils.DEFAULT_SCOPE import eu.vendeli.tgbot.utils.OnCommandActivity import eu.vendeli.tgbot.utils.OnInputActivity import eu.vendeli.tgbot.utils.WhenNotHandledActivity +import eu.vendeli.tgbot.utils.getLogger import kotlin.reflect.KClass /** @@ -33,7 +33,7 @@ class FunctionalHandlingDsl internal constructor( internal val bot: TelegramBot, ) { internal val functionalActivities = FunctionalActivities() - internal val logger = LoggingWrapper(bot.config.logging, "eu.vendeli.FunctionalHandler") + internal val logger = getLogger(bot.config.logging.botLogLevel, "eu.vendeli.FunctionalHandler") /** * The action that is performed when the command is matched. @@ -45,7 +45,7 @@ class FunctionalHandlingDsl internal constructor( */ fun onCommand( command: String, - scope: Set = DEFAULT_COMMAND_SCOPE, + scope: Set = DEFAULT_SCOPE, rateLimits: RateLimits = RateLimits.NOT_LIMITED, guard: Guard = DefaultGuard, argParser: KClass = DefaultArgParser::class, @@ -92,7 +92,7 @@ class FunctionalHandlingDsl internal constructor( fun common( value: String, filter: KClass = DefaultFilter::class, - scope: Set = DEFAULT_COMMAND_SCOPE, + scope: Set = DEFAULT_SCOPE, rateLimits: RateLimits = RateLimits.NOT_LIMITED, argParser: KClass = DefaultArgParser::class, block: OnCommandActivity, @@ -113,7 +113,7 @@ class FunctionalHandlingDsl internal constructor( fun common( value: Regex, filter: KClass = DefaultFilter::class, - scope: Set = DEFAULT_COMMAND_SCOPE, + scope: Set = DEFAULT_SCOPE, rateLimits: RateLimits = RateLimits.NOT_LIMITED, argParser: KClass = DefaultArgParser::class, block: OnCommandActivity, diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/core/TgUpdateHandler.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/core/TgUpdateHandler.kt index 5ac5741ad3..993dcb3f79 100644 --- a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/core/TgUpdateHandler.kt +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/core/TgUpdateHandler.kt @@ -16,16 +16,21 @@ import eu.vendeli.tgbot.utils.GET_UPDATES_ACTION import eu.vendeli.tgbot.utils.HandlingBehaviourBlock import eu.vendeli.tgbot.utils.Invocable import eu.vendeli.tgbot.utils.InvocationLambda -import eu.vendeli.tgbot.utils.LoggingWrapper import eu.vendeli.tgbot.utils.asyncAction import eu.vendeli.tgbot.utils.checkIsGuarded import eu.vendeli.tgbot.utils.checkIsLimited import eu.vendeli.tgbot.utils.coHandle +import eu.vendeli.tgbot.utils.debug +import eu.vendeli.tgbot.utils.error +import eu.vendeli.tgbot.utils.getLogger import eu.vendeli.tgbot.utils.getParameters import eu.vendeli.tgbot.utils.handleFailure +import eu.vendeli.tgbot.utils.info import eu.vendeli.tgbot.utils.parseCommand import eu.vendeli.tgbot.utils.process import eu.vendeli.tgbot.utils.serde +import eu.vendeli.tgbot.utils.warn +import io.ktor.util.logging.trace import kotlinx.coroutines.CoroutineName import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Deferred @@ -55,7 +60,7 @@ class TgUpdateHandler internal constructor( CoroutineScope(SupervisorJob() + dispatcher + CoroutineName("TgBot")) } internal val functionalHandlingBehavior by lazy { FunctionalHandlingDsl(bot) } - internal val logger = LoggingWrapper(bot.config.logging, "eu.vendeli.core.TgUpdateHandler") + internal val logger = getLogger(bot.config.logging.botLogLevel, "eu.vendeli.core.TgUpdateHandler") /** * The channel where errors caught during update processing is stored with update that caused them. diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/interfaces/action/Action.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/interfaces/action/Action.kt index 83386ac4e0..062104c03e 100644 --- a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/interfaces/action/Action.kt +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/interfaces/action/Action.kt @@ -66,6 +66,12 @@ abstract class Action : TgAction() { via: TelegramBot, ): Deferred> = sendAsync(to.id, via) + /** + * Make a request for action returning its [Response]. + * + * @param to Recipient + * @param via Instance of the bot through which the request will be made. + */ suspend inline fun sendReturning( to: String, via: TelegramBot, diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/interfaces/helper/Logger.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/interfaces/helper/Logger.kt deleted file mode 100644 index ed5b8c6e09..0000000000 --- a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/interfaces/helper/Logger.kt +++ /dev/null @@ -1,10 +0,0 @@ -package eu.vendeli.tgbot.interfaces.helper - -import eu.vendeli.tgbot.types.internal.LogLvl - -/** - * Interface to pass a global logging mechanism. - */ -fun interface Logger { - suspend fun log(lvl: LogLvl, tag: String?, message: String, throwable: Throwable?) -} diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/ActivitiesData.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/ActivitiesData.kt index 775b68623f..a60c2bf6dc 100644 --- a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/ActivitiesData.kt +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/ActivitiesData.kt @@ -4,16 +4,17 @@ import eu.vendeli.tgbot.utils.CommandHandlers import eu.vendeli.tgbot.utils.CommonHandlers import eu.vendeli.tgbot.utils.InputHandlers import eu.vendeli.tgbot.utils.InvocationLambda -import eu.vendeli.tgbot.utils.LoggingWrapper import eu.vendeli.tgbot.utils.UpdateTypeHandlers import eu.vendeli.tgbot.utils._OperatingActivities +import eu.vendeli.tgbot.utils.info +import io.ktor.util.logging.Logger import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.launch @Suppress("UNCHECKED_CAST") internal class ActivitiesData( pkg: String? = null, - logger: LoggingWrapper, + logger: Logger, ) { private val activities = when { _OperatingActivities.size == 1 -> _OperatingActivities.entries.firstOrNull()?.value diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/CommonMatcher.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/CommonMatcher.kt index 0904f952fd..40cb1b6bbe 100644 --- a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/CommonMatcher.kt +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/CommonMatcher.kt @@ -1,7 +1,9 @@ package eu.vendeli.tgbot.types.internal import eu.vendeli.tgbot.TelegramBot +import eu.vendeli.tgbot.implementations.DefaultFilter import eu.vendeli.tgbot.interfaces.helper.Filter +import eu.vendeli.tgbot.utils.DEFAULT_SCOPE import eu.vendeli.tgbot.utils.checkIsFiltered import kotlin.reflect.KClass @@ -14,8 +16,8 @@ sealed class CommonMatcher( class String( override val value: kotlin.String, - filter: KClass, - scope: Set, + filter: KClass = DefaultFilter::class, + scope: Set = DEFAULT_SCOPE, ) : CommonMatcher(value, filter, scope) { override suspend fun match(text: kotlin.String, update: ProcessedUpdate, bot: TelegramBot): Boolean = update.type in scope && @@ -25,8 +27,8 @@ sealed class CommonMatcher( class Regex( override val value: kotlin.text.Regex, - filter: KClass, - scope: Set, + filter: KClass = DefaultFilter::class, + scope: Set = DEFAULT_SCOPE, ) : CommonMatcher(value, filter, scope) { override suspend fun match(text: kotlin.String, update: ProcessedUpdate, bot: TelegramBot): Boolean = update.type in scope && diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/LogLvl.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/LogLvl.kt index c5aa69f687..47d3fa98e9 100644 --- a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/LogLvl.kt +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/LogLvl.kt @@ -5,16 +5,14 @@ import io.ktor.client.plugins.logging.LogLevel /** * Proxy enum for Bot logger leveling. */ -enum class LogLvl( - val int: Int, -) { - OFF(Int.MAX_VALUE), - ERROR(40000), - WARN(30000), - INFO(20000), - DEBUG(10000), - TRACE(5000), - ALL(Int.MIN_VALUE), +enum class LogLvl { + OFF, + ERROR, + WARN, + INFO, + DEBUG, + TRACE, + ALL, } /** diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/Response.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/Response.kt index 7d423afa85..c44cccab69 100644 --- a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/Response.kt +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/Response.kt @@ -36,10 +36,23 @@ inline fun Response.onFailure(block: (Response.Failure) -> Unit): T? = wh } } +/** + * Handles request's failure case. + * @return a fail-safe response. + */ suspend inline fun Deferred>.onFailure(block: (Response.Failure) -> Unit): T? = await().onFailure(block) +/** + * Whether the request completed successfully. + */ fun Response.isSuccess(): Boolean = this is Response.Success + +/** + * Get response or null on failure. + * + * @return response payload + */ fun Response.getOrNull(): T? = when (this) { is Response.Success -> result else -> null @@ -47,6 +60,9 @@ fun Response.getOrNull(): T? = when (this) { suspend inline fun Deferred>.getOrNull(): T? = await().getOrNull() +/** + * Handles response success and failure cases. + */ @Suppress("UNCHECKED_CAST") suspend inline fun Deferred>.foldResponse( success: Response.Success.() -> R, diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/configuration/LoggingConfiguration.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/configuration/LoggingConfiguration.kt index 8f7f89a37a..91356830ea 100644 --- a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/configuration/LoggingConfiguration.kt +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/configuration/LoggingConfiguration.kt @@ -1,23 +1,17 @@ package eu.vendeli.tgbot.types.internal.configuration -import eu.vendeli.tgbot.interfaces.helper.Logger import eu.vendeli.tgbot.types.internal.HttpLogLevel import eu.vendeli.tgbot.types.internal.LogLvl -import eu.vendeli.tgbot.utils.DEFAULT_LOGGER import kotlinx.serialization.Serializable -import kotlinx.serialization.Transient /** * The class containing the logging configuration. * - * @property logger Logger which will be used for logging. * @property botLogLevel The level of logs of the bot actions. * @property httpLogLevel The level of http request logs. */ @Serializable data class LoggingConfiguration( - @Transient - var logger: Logger = DEFAULT_LOGGER, var botLogLevel: LogLvl = LogLvl.INFO, var httpLogLevel: HttpLogLevel = HttpLogLevel.NONE, ) diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/options/CreateInvoiceLinkOptions.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/options/CreateInvoiceLinkOptions.kt index ec2225a403..32f4eab156 100644 --- a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/options/CreateInvoiceLinkOptions.kt +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/options/CreateInvoiceLinkOptions.kt @@ -1,6 +1,8 @@ package eu.vendeli.tgbot.types.internal.options +import eu.vendeli.tgbot.utils.serde.DurationSerializer import kotlinx.serialization.Serializable +import kotlin.time.Duration /** * Create invoice link options @@ -29,6 +31,7 @@ import kotlinx.serialization.Serializable */ @Serializable data class CreateInvoiceLinkOptions( + var providerToken: String? = null, var maxTipAmount: Int? = null, var suggestedTipAmounts: List? = null, var providerData: String? = null, @@ -37,6 +40,8 @@ data class CreateInvoiceLinkOptions( var photoWidth: Int? = null, var photoHeight: Int? = null, var needName: Boolean? = null, + @Serializable(DurationSerializer::class) + var subscriptionPeriod: Duration? = null, var needPhoneNumber: Boolean? = null, var needEmail: Boolean? = null, var needShippingAddress: Boolean? = null, diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/options/IOptions.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/options/IOptions.kt index 4360cdaf16..3b0736d06d 100644 --- a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/options/IOptions.kt +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/options/IOptions.kt @@ -17,7 +17,7 @@ interface MediaSpoiler : Options { var hasSpoiler: Boolean? } -interface LinkPreviewProp { +interface LinkPreviewProp : Options { var linkPreviewOptions: LinkPreviewOptions? fun disableWebPagePreview() { @@ -29,19 +29,19 @@ interface LinkPreviewProp { } } -interface ThumbnailProp { +interface ThumbnailProp : Options { var thumbnail: ImplicitFile? } -interface MessageEffectIdProp { +interface MessageEffectIdProp : Options { var messageEffectId: String? } -interface ShowCaptionAboveMediaProp { +interface ShowCaptionAboveMediaProp : Options { var showCaptionAboveMedia: Boolean? } -interface ForumProps { +interface ForumProps : Options { var messageThreadId: Int? } diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/options/PollOptions.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/options/PollOptions.kt index 4b6e3f7129..5ffda9fbd5 100644 --- a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/options/PollOptions.kt +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/options/PollOptions.kt @@ -25,7 +25,6 @@ data class PollOptions( var closeDate: Instant? = null, var isClosed: Boolean? = null, var questionParseMode: ParseMode? = null, - var questionEntities: List? = null, override var disableNotification: Boolean? = null, override var replyParameters: ReplyParameters? = null, override var protectContent: Boolean? = null, diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/options/PromoteChatMemberOptions.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/options/PromoteChatMemberOptions.kt index d957f0bf42..49fa3c663f 100644 --- a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/options/PromoteChatMemberOptions.kt +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/options/PromoteChatMemberOptions.kt @@ -16,7 +16,7 @@ data class PromoteChatMemberOptions( var canInviteUsers: Boolean? = null, var canPinMessages: Boolean? = null, var canManageTopics: Boolean? = null, - val canPostStories: Boolean? = null, - val canEditStories: Boolean? = null, - val canDeleteStories: Boolean? = null, + var canPostStories: Boolean? = null, + var canEditStories: Boolean? = null, + var canDeleteStories: Boolean? = null, ) : Options diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/options/SavePreparedInlineMessageOptions.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/options/SavePreparedInlineMessageOptions.kt new file mode 100644 index 0000000000..d79a631b55 --- /dev/null +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/options/SavePreparedInlineMessageOptions.kt @@ -0,0 +1,8 @@ +package eu.vendeli.tgbot.types.internal.options + +data class SavePreparedInlineMessageOptions( + var allowUserChats: Boolean? = null, + var allowBotChats: Boolean? = null, + var allowGroupChats: Boolean? = null, + var allowChannelChats: Boolean? = null, +) : Options diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/options/StickerOptions.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/options/StickerOptions.kt index ea063598e4..ddca8b9a30 100644 --- a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/options/StickerOptions.kt +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/internal/options/StickerOptions.kt @@ -5,7 +5,7 @@ import kotlinx.serialization.Serializable @Serializable data class StickerOptions( - val emoji: String? = null, + var emoji: String? = null, override var disableNotification: Boolean? = null, override var replyParameters: ReplyParameters? = null, override var protectContent: Boolean? = null, diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/msg/PreparedInlineMessage.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/msg/PreparedInlineMessage.kt new file mode 100644 index 0000000000..5753e64ad3 --- /dev/null +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/msg/PreparedInlineMessage.kt @@ -0,0 +1,19 @@ +package eu.vendeli.tgbot.types.msg + +import eu.vendeli.tgbot.utils.serde.InstantSerializer +import kotlinx.datetime.Instant +import kotlinx.serialization.Serializable + +/** + * Describes an inline message to be sent by a user of a Mini App. + * + * [Api reference](https://core.telegram.org/bots/api#preparedinlinemessage) + * @property id Unique identifier of the prepared message + * @property expirationDate Expiration date of the prepared message, in Unix time. Expired prepared messages can no longer be used + */ +@Serializable +data class PreparedInlineMessage( + val id: String, + @Serializable(InstantSerializer::class) + val expirationDate: Instant, +) diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/payment/SuccessfulPayment.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/payment/SuccessfulPayment.kt index 4437bdf42d..05f5238934 100644 --- a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/payment/SuccessfulPayment.kt +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/payment/SuccessfulPayment.kt @@ -1,6 +1,8 @@ package eu.vendeli.tgbot.types.payment import eu.vendeli.tgbot.types.internal.Currency +import eu.vendeli.tgbot.utils.serde.InstantSerializer +import kotlinx.datetime.Instant import kotlinx.serialization.Serializable /** @@ -10,6 +12,9 @@ import kotlinx.serialization.Serializable * @property currency Three-letter ISO 4217 currency code, or "XTR" for payments in Telegram Stars * @property totalAmount Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). * @property invoicePayload Bot-specified invoice payload + * @property subscriptionExpirationDate Optional. Expiration date of the subscription, in Unix time; for recurring payments only + * @property isRecurring Optional. True, if the payment is a recurring payment for a subscription + * @property isFirstRecurring Optional. True, if the payment is the first payment for a subscription * @property shippingOptionId Optional. Identifier of the shipping option chosen by the user * @property orderInfo Optional. Order information provided by the user * @property telegramPaymentChargeId Telegram payment identifier @@ -22,6 +27,10 @@ data class SuccessfulPayment( val invoicePayload: String, val shippingOptionId: String? = null, val orderInfo: OrderInfo? = null, + @Serializable(InstantSerializer::class) + val subscriptionExpirationDate: Instant? = null, + val isRecurring: Boolean? = null, + val isFirstRecurring: Boolean? = null, val telegramPaymentChargeId: String, val providerPaymentChargeId: String, ) diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/stars/TransactionPartner.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/stars/TransactionPartner.kt index b30b4dd240..cffbb802ed 100644 --- a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/stars/TransactionPartner.kt +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/stars/TransactionPartner.kt @@ -3,8 +3,10 @@ package eu.vendeli.tgbot.types.stars import eu.vendeli.tgbot.annotations.internal.TgAPI import eu.vendeli.tgbot.types.User import eu.vendeli.tgbot.types.media.PaidMedia +import eu.vendeli.tgbot.utils.serde.DurationSerializer import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable +import kotlin.time.Duration /** * This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of @@ -35,6 +37,9 @@ sealed class TransactionPartner( val invoicePayload: String? = null, val paidMedia: List? = null, val paidMediaPayload: String? = null, + @Serializable(DurationSerializer::class) + val subscriptionPeriod: Duration? = null, + val gift: String? = null, ) : TransactionPartner("user") @Serializable diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/user/Gift.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/user/Gift.kt new file mode 100644 index 0000000000..2a72b8a9cd --- /dev/null +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/user/Gift.kt @@ -0,0 +1,23 @@ +package eu.vendeli.tgbot.types.user + +import eu.vendeli.tgbot.types.media.Sticker +import kotlinx.serialization.Serializable + +/** + * This object represents a gift that can be sent by the bot. + * + * [Api reference](https://core.telegram.org/bots/api#gift) + * @property id Unique identifier of the gift + * @property sticker The sticker that represents the gift + * @property starCount The number of Telegram Stars that must be paid to send the sticker + * @property totalCount Optional. The total number of the gifts of this type that can be sent; for limited gifts only + * @property remainingCount Optional. The number of remaining gifts of this type that can be sent; for limited gifts only + */ +@Serializable +data class Gift( + val id: String, + val sticker: Sticker, + val starCount: Int, + val totalCount: Int? = null, + val remainingCount: Int? = null, +) diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/user/Gifts.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/user/Gifts.kt new file mode 100644 index 0000000000..167bd3e498 --- /dev/null +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/user/Gifts.kt @@ -0,0 +1,14 @@ +package eu.vendeli.tgbot.types.user + +import kotlinx.serialization.Serializable + +/** + * This object represent a list of gifts. + * + * [Api reference](https://core.telegram.org/bots/api#gifts) + * @property gifts The list of gifts + */ +@Serializable +data class Gifts( + val gifts: List, +) diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/utils/BotUtils.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/utils/BotUtils.kt index 33fef2439a..923a5f6693 100644 --- a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/utils/BotUtils.kt +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/utils/BotUtils.kt @@ -68,4 +68,7 @@ internal suspend inline fun asyncAction(crossinline block: suspend () -> T): @Suppress("NOTHING_TO_INLINE", "UNCHECKED_CAST") internal inline fun Any?.cast() = this as T +@Suppress("NOTHING_TO_INLINE", "UNCHECKED_CAST") +internal inline fun Any?.safeCast() = this as? T + expect val KClass<*>.fqName: String diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/utils/CONST.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/utils/CONST.kt index 76aaaf381f..dfbcbe3138 100644 --- a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/utils/CONST.kt +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/utils/CONST.kt @@ -9,8 +9,7 @@ const val DEFAULT_FILENAME = "file" val DEFAULT_HANDLING_BEHAVIOUR: HandlingBehaviourBlock = { handle(it) } -internal val DEFAULT_COMMAND_SCOPE = setOf(UpdateType.MESSAGE) +internal val DEFAULT_SCOPE = setOf(UpdateType.MESSAGE) internal expect val PROCESSING_DISPATCHER: CoroutineDispatcher -internal const val DEFAULT_LOGGING_TAG = "eu.vendeli" internal val GET_UPDATES_ACTION = getUpdates() diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/utils/CommonExtenstions.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/utils/CommonExtenstions.kt index 8736950de9..cb55ff4894 100644 --- a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/utils/CommonExtenstions.kt +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/utils/CommonExtenstions.kt @@ -9,30 +9,11 @@ import eu.vendeli.tgbot.types.User import eu.vendeli.tgbot.types.internal.chain.Link import eu.vendeli.tgbot.types.keyboard.InlineKeyboardMarkup import eu.vendeli.tgbot.utils.builders.inlineKeyboardMarkup -import io.ktor.http.decodeURLQueryComponent -import korlibs.crypto.HMAC import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.channels.consumeEach import kotlinx.coroutines.delay import kotlin.reflect.KClass -/** - * Function to check is web app data is safe. - * - * @param botToken bot token. - * @param hash hash from webapp - */ -fun String.checkIsInitDataSafe(botToken: String, hash: String): Boolean { - val secretKey = HMAC.hmacSHA256(botToken.encodeToByteArray(), "WebAppData".encodeToByteArray()) - val decodedData = decodeURLQueryComponent() - .split("&") - .filterNot { it.startsWith("hash=") } - .sorted() - .joinToString("\n") - - return HMAC.hmacSHA256(secretKey.bytes, decodedData.encodeToByteArray()).hexLower == hash.lowercase() -} - /** * Runs exception handler loop. * diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/utils/ComponentConfigurations.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/utils/ComponentConfigurations.kt index e3781dee5a..81b2de6bd0 100644 --- a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/utils/ComponentConfigurations.kt +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/utils/ComponentConfigurations.kt @@ -1,46 +1,22 @@ package eu.vendeli.tgbot.utils import eu.vendeli.tgbot.annotations.internal.KtGramInternal -import eu.vendeli.tgbot.types.internal.LogLvl import eu.vendeli.tgbot.types.internal.configuration.HttpConfiguration import eu.vendeli.tgbot.types.internal.configuration.LoggingConfiguration import io.ktor.client.HttpClient import io.ktor.client.plugins.HttpRequestRetry import io.ktor.client.plugins.HttpTimeout import io.ktor.client.plugins.defaultRequest -import io.ktor.client.plugins.logging.Logger import io.ktor.client.plugins.logging.Logging -import io.ktor.client.request.HttpSendPipeline import io.ktor.client.request.header -import kotlinx.coroutines.DelicateCoroutinesApi -import kotlinx.coroutines.GlobalScope -import kotlinx.coroutines.launch import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.json.Json import kotlinx.serialization.json.JsonNamingStrategy -@OptIn(DelicateCoroutinesApi::class) @KtGramInternal fun getConfiguredHttpClient(httpCfg: HttpConfiguration, loggingCfg: LoggingConfiguration) = httpCfg.run cfg@{ - val loggingTag = "eu.vendeli.http" HttpClient { - install("RequestLogging") { - sendPipeline.intercept(HttpSendPipeline.Monitoring) { - loggingCfg.logger.log( - LogLvl.TRACE, - loggingTag, - "TgApiRequest: ${context.method} ${context.url.buildString()}", - null, - ) - } - } - install(Logging) { - this.logger = object : Logger { - override fun log(message: String) { - GlobalScope.launch { loggingCfg.logger.log(LogLvl.DEBUG, loggingTag, message, null) } - } - } level = loggingCfg.httpLogLevel.toKtorLvl() } diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/utils/FunctionalDSLUtils.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/utils/FunctionalDSLUtils.kt index 5687d824d6..5f46831d72 100644 --- a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/utils/FunctionalDSLUtils.kt +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/utils/FunctionalDSLUtils.kt @@ -32,165 +32,159 @@ import kotlin.Unit * Action that is performed on the presence of [eu.vendeli.tgbot.types.Update.message] in the [eu.vendeli.tgbot.types.Update]. */ public fun FunctionalHandlingDsl.onMessage(block: suspend ActivityCtx.() -> Unit) { - functionalActivities.onUpdateActivities[UpdateType.MESSAGE] = block.cast() + functionalActivities.onUpdateActivities[UpdateType.MESSAGE] = block.cast() } /** * Action that is performed on the presence of [eu.vendeli.tgbot.types.Update.editedMessage] in the [eu.vendeli.tgbot.types.Update]. */ public fun FunctionalHandlingDsl.onEditedMessage(block: suspend ActivityCtx.() -> Unit) { - functionalActivities.onUpdateActivities[UpdateType.EDIT_MESSAGE] = block.cast() + functionalActivities.onUpdateActivities[UpdateType.EDIT_MESSAGE] = block.cast() } /** * Action that is performed on the presence of [eu.vendeli.tgbot.types.Update.channelPost] in the [eu.vendeli.tgbot.types.Update]. */ public fun FunctionalHandlingDsl.onChannelPost(block: suspend ActivityCtx.() -> Unit) { - functionalActivities.onUpdateActivities[UpdateType.CHANNEL_POST] = block.cast() + functionalActivities.onUpdateActivities[UpdateType.CHANNEL_POST] = block.cast() } /** * Action that is performed on the presence of [eu.vendeli.tgbot.types.Update.editedChannelPost] in the [eu.vendeli.tgbot.types.Update]. */ public fun FunctionalHandlingDsl.onEditedChannelPost(block: suspend ActivityCtx.() -> Unit) { - functionalActivities.onUpdateActivities[UpdateType.EDITED_CHANNEL_POST] = block.cast() + functionalActivities.onUpdateActivities[UpdateType.EDITED_CHANNEL_POST] = block.cast() } /** * Action that is performed on the presence of [eu.vendeli.tgbot.types.Update.businessConnection] in the [eu.vendeli.tgbot.types.Update]. */ public fun FunctionalHandlingDsl.onBusinessConnection(block: suspend ActivityCtx.() -> Unit) { - functionalActivities.onUpdateActivities[UpdateType.BUSINESS_CONNECTION] = block.cast() + functionalActivities.onUpdateActivities[UpdateType.BUSINESS_CONNECTION] = block.cast() } /** * Action that is performed on the presence of [eu.vendeli.tgbot.types.Update.businessMessage] in the [eu.vendeli.tgbot.types.Update]. */ public fun FunctionalHandlingDsl.onBusinessMessage(block: suspend ActivityCtx.() -> Unit) { - functionalActivities.onUpdateActivities[UpdateType.BUSINESS_MESSAGE] = block.cast() + functionalActivities.onUpdateActivities[UpdateType.BUSINESS_MESSAGE] = block.cast() } /** * Action that is performed on the presence of [eu.vendeli.tgbot.types.Update.editedBusinessMessage] in the [eu.vendeli.tgbot.types.Update]. */ -public fun FunctionalHandlingDsl.onEditedBusinessMessage( - block: suspend ActivityCtx.() -> Unit, -) { - functionalActivities.onUpdateActivities[UpdateType.EDITED_BUSINESS_MESSAGE] = block.cast() +public fun FunctionalHandlingDsl.onEditedBusinessMessage(block: suspend ActivityCtx.() -> Unit) { + functionalActivities.onUpdateActivities[UpdateType.EDITED_BUSINESS_MESSAGE] = block.cast() } /** * Action that is performed on the presence of [eu.vendeli.tgbot.types.Update.deletedBusinessMessages] in the [eu.vendeli.tgbot.types.Update]. */ -public fun FunctionalHandlingDsl.onDeletedBusinessMessages( - block: suspend ActivityCtx.() -> Unit, -) { - functionalActivities.onUpdateActivities[UpdateType.DELETED_BUSINESS_MESSAGES] = block.cast() +public fun FunctionalHandlingDsl.onDeletedBusinessMessages(block: suspend ActivityCtx.() -> Unit) { + functionalActivities.onUpdateActivities[UpdateType.DELETED_BUSINESS_MESSAGES] = block.cast() } /** * Action that is performed on the presence of [eu.vendeli.tgbot.types.Update.messageReaction] in the [eu.vendeli.tgbot.types.Update]. */ public fun FunctionalHandlingDsl.onMessageReaction(block: suspend ActivityCtx.() -> Unit) { - functionalActivities.onUpdateActivities[UpdateType.MESSAGE_REACTION] = block.cast() + functionalActivities.onUpdateActivities[UpdateType.MESSAGE_REACTION] = block.cast() } /** * Action that is performed on the presence of [eu.vendeli.tgbot.types.Update.messageReactionCount] in the [eu.vendeli.tgbot.types.Update]. */ -public fun FunctionalHandlingDsl.onMessageReactionCount( - block: suspend ActivityCtx.() -> Unit, -) { - functionalActivities.onUpdateActivities[UpdateType.MESSAGE_REACTION_COUNT] = block.cast() +public fun FunctionalHandlingDsl.onMessageReactionCount(block: suspend ActivityCtx.() -> Unit) { + functionalActivities.onUpdateActivities[UpdateType.MESSAGE_REACTION_COUNT] = block.cast() } /** * Action that is performed on the presence of [eu.vendeli.tgbot.types.Update.inlineQuery] in the [eu.vendeli.tgbot.types.Update]. */ public fun FunctionalHandlingDsl.onInlineQuery(block: suspend ActivityCtx.() -> Unit) { - functionalActivities.onUpdateActivities[UpdateType.INLINE_QUERY] = block.cast() + functionalActivities.onUpdateActivities[UpdateType.INLINE_QUERY] = block.cast() } /** * Action that is performed on the presence of [eu.vendeli.tgbot.types.Update.chosenInlineResult] in the [eu.vendeli.tgbot.types.Update]. */ public fun FunctionalHandlingDsl.onChosenInlineResult(block: suspend ActivityCtx.() -> Unit) { - functionalActivities.onUpdateActivities[UpdateType.CHOSEN_INLINE_RESULT] = block.cast() + functionalActivities.onUpdateActivities[UpdateType.CHOSEN_INLINE_RESULT] = block.cast() } /** * Action that is performed on the presence of [eu.vendeli.tgbot.types.Update.callbackQuery] in the [eu.vendeli.tgbot.types.Update]. */ public fun FunctionalHandlingDsl.onCallbackQuery(block: suspend ActivityCtx.() -> Unit) { - functionalActivities.onUpdateActivities[UpdateType.CALLBACK_QUERY] = block.cast() + functionalActivities.onUpdateActivities[UpdateType.CALLBACK_QUERY] = block.cast() } /** * Action that is performed on the presence of [eu.vendeli.tgbot.types.Update.shippingQuery] in the [eu.vendeli.tgbot.types.Update]. */ public fun FunctionalHandlingDsl.onShippingQuery(block: suspend ActivityCtx.() -> Unit) { - functionalActivities.onUpdateActivities[UpdateType.SHIPPING_QUERY] = block.cast() + functionalActivities.onUpdateActivities[UpdateType.SHIPPING_QUERY] = block.cast() } /** * Action that is performed on the presence of [eu.vendeli.tgbot.types.Update.preCheckoutQuery] in the [eu.vendeli.tgbot.types.Update]. */ public fun FunctionalHandlingDsl.onPreCheckoutQuery(block: suspend ActivityCtx.() -> Unit) { - functionalActivities.onUpdateActivities[UpdateType.PRE_CHECKOUT_QUERY] = block.cast() + functionalActivities.onUpdateActivities[UpdateType.PRE_CHECKOUT_QUERY] = block.cast() } /** * Action that is performed on the presence of [eu.vendeli.tgbot.types.Update.poll] in the [eu.vendeli.tgbot.types.Update]. */ public fun FunctionalHandlingDsl.onPoll(block: suspend ActivityCtx.() -> Unit) { - functionalActivities.onUpdateActivities[UpdateType.POLL] = block.cast() + functionalActivities.onUpdateActivities[UpdateType.POLL] = block.cast() } /** * Action that is performed on the presence of [eu.vendeli.tgbot.types.Update.pollAnswer] in the [eu.vendeli.tgbot.types.Update]. */ public fun FunctionalHandlingDsl.onPollAnswer(block: suspend ActivityCtx.() -> Unit) { - functionalActivities.onUpdateActivities[UpdateType.POLL_ANSWER] = block.cast() + functionalActivities.onUpdateActivities[UpdateType.POLL_ANSWER] = block.cast() } /** * Action that is performed on the presence of [eu.vendeli.tgbot.types.Update.myChatMember] in the [eu.vendeli.tgbot.types.Update]. */ public fun FunctionalHandlingDsl.onMyChatMember(block: suspend ActivityCtx.() -> Unit) { - functionalActivities.onUpdateActivities[UpdateType.MY_CHAT_MEMBER] = block.cast() + functionalActivities.onUpdateActivities[UpdateType.MY_CHAT_MEMBER] = block.cast() } /** * Action that is performed on the presence of [eu.vendeli.tgbot.types.Update.chatMember] in the [eu.vendeli.tgbot.types.Update]. */ public fun FunctionalHandlingDsl.onChatMember(block: suspend ActivityCtx.() -> Unit) { - functionalActivities.onUpdateActivities[UpdateType.CHAT_MEMBER] = block.cast() + functionalActivities.onUpdateActivities[UpdateType.CHAT_MEMBER] = block.cast() } /** * Action that is performed on the presence of [eu.vendeli.tgbot.types.Update.chatJoinRequest] in the [eu.vendeli.tgbot.types.Update]. */ public fun FunctionalHandlingDsl.onChatJoinRequest(block: suspend ActivityCtx.() -> Unit) { - functionalActivities.onUpdateActivities[UpdateType.CHAT_JOIN_REQUEST] = block.cast() + functionalActivities.onUpdateActivities[UpdateType.CHAT_JOIN_REQUEST] = block.cast() } /** * Action that is performed on the presence of [eu.vendeli.tgbot.types.Update.chatBoost] in the [eu.vendeli.tgbot.types.Update]. */ public fun FunctionalHandlingDsl.onChatBoost(block: suspend ActivityCtx.() -> Unit) { - functionalActivities.onUpdateActivities[UpdateType.CHAT_BOOST] = block.cast() + functionalActivities.onUpdateActivities[UpdateType.CHAT_BOOST] = block.cast() } /** * Action that is performed on the presence of [eu.vendeli.tgbot.types.Update.removedChatBoost] in the [eu.vendeli.tgbot.types.Update]. */ public fun FunctionalHandlingDsl.onRemovedChatBoost(block: suspend ActivityCtx.() -> Unit) { - functionalActivities.onUpdateActivities[UpdateType.REMOVED_CHAT_BOOST] = block.cast() + functionalActivities.onUpdateActivities[UpdateType.REMOVED_CHAT_BOOST] = block.cast() } /** * Action that is performed on the presence of [eu.vendeli.tgbot.types.Update.purchasedPaidMedia] in the [eu.vendeli.tgbot.types.Update]. */ public fun FunctionalHandlingDsl.onPurchasedPaidMedia(block: suspend ActivityCtx.() -> Unit) { - functionalActivities.onUpdateActivities[UpdateType.PURCHASED_PAID_MEDIA] = block.cast() + functionalActivities.onUpdateActivities[UpdateType.PURCHASED_PAID_MEDIA] = block.cast() } diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/utils/LoggingUtils.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/utils/LoggingUtils.kt index 0c09c60479..68ab4ee735 100644 --- a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/utils/LoggingUtils.kt +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/utils/LoggingUtils.kt @@ -1,22 +1,19 @@ package eu.vendeli.tgbot.utils -import eu.vendeli.tgbot.interfaces.helper.Logger import eu.vendeli.tgbot.types.internal.LogLvl -import eu.vendeli.tgbot.types.internal.configuration.LoggingConfiguration +import io.ktor.util.logging.Logger -class LoggingWrapper( - private val cfg: LoggingConfiguration, - private val tag: String = DEFAULT_LOGGING_TAG, -) { - suspend fun info(message: () -> String) = log(LogLvl.INFO, message, null) - suspend fun warn(message: () -> String) = log(LogLvl.WARN, message, null) - suspend fun debug(message: () -> String) = log(LogLvl.DEBUG, message, null) - suspend fun trace(message: () -> String) = log(LogLvl.TRACE, message, null) - suspend fun error(throwable: Throwable? = null, message: () -> String) = - log(LogLvl.ERROR, message, throwable) +internal expect inline fun getLogger(lvl: LogLvl, tag: String): Logger - private suspend inline fun log(logLvl: LogLvl, message: () -> String, throwable: Throwable?) = - if (cfg.botLogLevel.int <= logLvl.int) cfg.logger.log(logLvl, tag, message(), throwable) else Unit -} +@Suppress("NOTHING_TO_INLINE") +suspend inline fun Logger.info(message: () -> String) = info(message()) -internal expect val DEFAULT_LOGGER: Logger +@Suppress("NOTHING_TO_INLINE") +suspend inline fun Logger.warn(message: () -> String) = warn(message()) + +@Suppress("NOTHING_TO_INLINE") +suspend inline fun Logger.debug(message: () -> String) = debug(message()) + +@Suppress("NOTHING_TO_INLINE") +suspend inline fun Logger.error(throwable: Throwable? = null, message: () -> String) = + throwable?.let { error(message(), it) } ?: error(message()) diff --git a/telegram-bot/src/jsMain/kotlin/eu/vendeli/tgbot/utils/LoggingUtils.js.kt b/telegram-bot/src/jsMain/kotlin/eu/vendeli/tgbot/utils/LoggingUtils.js.kt index bec868689e..898014d2d7 100644 --- a/telegram-bot/src/jsMain/kotlin/eu/vendeli/tgbot/utils/LoggingUtils.js.kt +++ b/telegram-bot/src/jsMain/kotlin/eu/vendeli/tgbot/utils/LoggingUtils.js.kt @@ -1,30 +1,7 @@ package eu.vendeli.tgbot.utils -import co.touchlab.kermit.DefaultFormatter -import co.touchlab.kermit.Severity -import co.touchlab.kermit.mutableLoggerConfigInit -import co.touchlab.kermit.platformLogWriter -import eu.vendeli.tgbot.interfaces.helper.Logger import eu.vendeli.tgbot.types.internal.LogLvl +import io.ktor.util.logging.KtorSimpleLogger -private val kermitLogger by lazy { - co.touchlab.kermit.Logger( - mutableLoggerConfigInit(platformLogWriter(DefaultFormatter)), - DEFAULT_LOGGING_TAG, - ) -} - -private fun LogLvl.toSeverity(): Severity = when (this) { - LogLvl.TRACE -> Severity.Verbose - LogLvl.DEBUG -> Severity.Debug - LogLvl.INFO -> Severity.Info - LogLvl.WARN -> Severity.Warn - LogLvl.ERROR -> Severity.Error - LogLvl.ALL -> Severity.Verbose - LogLvl.OFF -> error("Turned off.") -} - -internal actual val DEFAULT_LOGGER: Logger - get() = Logger { lvl, tag, message, throwable -> - kermitLogger.log(lvl.toSeverity(), tag ?: DEFAULT_LOGGING_TAG, throwable, message) - } +@Suppress("NOTHING_TO_INLINE") +internal actual inline fun getLogger(lvl: LogLvl, tag: String) = KtorSimpleLogger(tag) diff --git a/telegram-bot/src/jvmMain/kotlin/eu/vendeli/tgbot/utils/LoggingUtils.jvm.kt b/telegram-bot/src/jvmMain/kotlin/eu/vendeli/tgbot/utils/LoggingUtils.jvm.kt index ce8ca260ac..18f2fef3b4 100644 --- a/telegram-bot/src/jvmMain/kotlin/eu/vendeli/tgbot/utils/LoggingUtils.jvm.kt +++ b/telegram-bot/src/jvmMain/kotlin/eu/vendeli/tgbot/utils/LoggingUtils.jvm.kt @@ -1,35 +1,11 @@ package eu.vendeli.tgbot.utils import ch.qos.logback.classic.Level -import eu.vendeli.tgbot.interfaces.helper.Logger import eu.vendeli.tgbot.types.internal.LogLvl -import org.slf4j.LoggerFactory +import io.ktor.util.logging.KtorSimpleLogger +import io.ktor.util.logging.Logger -internal class LogbackLoggerWrapper : Logger { - private val loggers = mutableMapOf() - - override suspend fun log(lvl: LogLvl, tag: String?, message: String, throwable: Throwable?) { - val logger = getLogger(tag ?: DEFAULT_LOGGING_TAG) - when (lvl) { - LogLvl.DEBUG -> logger.debug(message) - LogLvl.INFO -> logger.info(message) - LogLvl.WARN -> logger.warn(message) - LogLvl.ERROR -> logger.error(message, throwable) - LogLvl.TRACE -> logger.trace(message) - LogLvl.ALL -> logger.info(message) - LogLvl.OFF -> {} - } - } - - private fun getLogger(tag: String): org.slf4j.Logger = loggers.getOrElse(tag) { - LoggerFactory.getLogger(tag).also { - it.cast().level = Level.TRACE - loggers[tag] = it - } - } +@Suppress("NOTHING_TO_INLINE") +internal actual inline fun getLogger(lvl: LogLvl, tag: String): Logger = KtorSimpleLogger(tag).apply { + safeCast()?.level = Level.valueOf(lvl.name) } - -private val logbackLogger by lazy { LogbackLoggerWrapper() } - -internal actual val DEFAULT_LOGGER: Logger - get() = logbackLogger diff --git a/telegram-bot/src/jvmTest/kotlin/BotTestContext.kt b/telegram-bot/src/jvmTest/kotlin/BotTestContext.kt index 601be2aafb..3a982af986 100644 --- a/telegram-bot/src/jvmTest/kotlin/BotTestContext.kt +++ b/telegram-bot/src/jvmTest/kotlin/BotTestContext.kt @@ -10,11 +10,9 @@ import eu.vendeli.tgbot.types.chat.ChatType import eu.vendeli.tgbot.types.internal.HttpLogLevel import eu.vendeli.tgbot.types.internal.LogLvl import eu.vendeli.tgbot.types.internal.Response -import eu.vendeli.tgbot.types.internal.configuration.LoggingConfiguration import eu.vendeli.tgbot.types.internal.getOrNull import eu.vendeli.tgbot.types.internal.isSuccess import eu.vendeli.tgbot.utils.GET_UPDATES_ACTION -import eu.vendeli.tgbot.utils.LoggingWrapper import eu.vendeli.tgbot.utils.defineActivities import eu.vendeli.tgbot.utils.serde import eu.vendeli.utils.MockUpdate @@ -27,6 +25,7 @@ import io.kotest.matchers.nulls.shouldNotBeNull import io.ktor.client.request.get import io.ktor.client.statement.readRawBytes import io.ktor.http.isSuccess +import io.ktor.util.logging.KtorSimpleLogger import io.mockk.coEvery import io.mockk.every import io.mockk.mockkStatic @@ -76,7 +75,7 @@ abstract class BotTestContext( protected val ITER_INT: Int get() = INT_ITERATOR.nextInt() protected val RAND_INT: Int get() = RANDOM_INST.nextInt() protected val DUMB_USER = User(1, false, "Test") - protected val logger = LoggingWrapper(LoggingConfiguration()) + protected val logger = KtorSimpleLogger("test.eu.vendeli.ktgram") @BeforeAll fun prepareTestBot() { @@ -113,7 +112,7 @@ abstract class BotTestContext( private fun getRandomPic(): ByteArray? = runBlocking { bot.httpClient.get(RandomPicResource.RANDOM_PIC_URL).takeIf { it.status.isSuccess() }?.readRawBytes()?.also { - logger.warn { "RANDOM PIC OBTAINING ERROR." } + logger.warn("RANDOM PIC OBTAINING ERROR.") } } diff --git a/telegram-bot/src/jvmTest/kotlin/eu/vendeli/RateLimitingTest.kt b/telegram-bot/src/jvmTest/kotlin/eu/vendeli/RateLimitingTest.kt index 717cdf99de..4bb0b94bca 100644 --- a/telegram-bot/src/jvmTest/kotlin/eu/vendeli/RateLimitingTest.kt +++ b/telegram-bot/src/jvmTest/kotlin/eu/vendeli/RateLimitingTest.kt @@ -1,6 +1,7 @@ package eu.vendeli import BotTestContext +import eu.vendeli.tgbot.TelegramBot import eu.vendeli.tgbot.implementations.TokenBucketLimiterImpl import eu.vendeli.tgbot.types.internal.LogLvl import eu.vendeli.tgbot.types.internal.configuration.RateLimits @@ -27,8 +28,12 @@ class RateLimitingTest : BotTestContext(mockHttp = true) { @Test suspend fun `test limit exceeding`() { + var exceeded = false val hitsCounter = AtomicInteger(0) val loopCounter = AtomicInteger(0) + bot.config.rateLimiter.exceededAction = { _: Long, _: TelegramBot -> + exceeded = true + } bot.update.setListener { if (loopCounter.incrementAndGet() == 10) stopListener() @@ -40,13 +45,18 @@ class RateLimitingTest : BotTestContext(mockHttp = true) { } hitsCounter.get() shouldBe 5 loopCounter.get() shouldBe 10 + exceeded shouldBe true } @Test suspend fun `test certain command limit exceeding`() { + var exceeded = false val messageHitsCounter = AtomicInteger(0) val commandHitsCounter = AtomicInteger(0) val loopsCounter = AtomicInteger(0) + bot.config.rateLimiter.exceededAction = { _: Long, _: TelegramBot -> + exceeded = true + } bot.update.setListener { if (loopsCounter.incrementAndGet() == 20) stopListener() @@ -62,5 +72,6 @@ class RateLimitingTest : BotTestContext(mockHttp = true) { messageHitsCounter.get() shouldBe 5 commandHitsCounter.get() shouldBe 2 loopsCounter.get() shouldBe 20 + exceeded shouldBe true } } diff --git a/telegram-bot/src/jvmTest/kotlin/eu/vendeli/api/botactions/CreateInvoiceLinkTest.kt b/telegram-bot/src/jvmTest/kotlin/eu/vendeli/api/botactions/CreateInvoiceLinkTest.kt index f5985bf2b5..d4d408c7f9 100644 --- a/telegram-bot/src/jvmTest/kotlin/eu/vendeli/api/botactions/CreateInvoiceLinkTest.kt +++ b/telegram-bot/src/jvmTest/kotlin/eu/vendeli/api/botactions/CreateInvoiceLinkTest.kt @@ -16,11 +16,12 @@ class CreateInvoiceLinkTest : BotTestContext() { val result = createInvoiceLink( "test", "test1", - PAYMENT_PROVIDER_TOKEN, Currency.AED, LabeledPrice("test3", 1000), ) { "test2" + }.options { + providerToken = PAYMENT_PROVIDER_TOKEN }.sendReq().shouldSuccess() result.shouldNotBeNull() diff --git a/telegram-bot/src/jvmTest/kotlin/eu/vendeli/api/botactions/RefundStarPaymentTest.kt b/telegram-bot/src/jvmTest/kotlin/eu/vendeli/api/botactions/RefundStarPaymentTest.kt index c313d4fd9b..588924ce7e 100644 --- a/telegram-bot/src/jvmTest/kotlin/eu/vendeli/api/botactions/RefundStarPaymentTest.kt +++ b/telegram-bot/src/jvmTest/kotlin/eu/vendeli/api/botactions/RefundStarPaymentTest.kt @@ -14,7 +14,7 @@ class RefundStarPaymentTest : BotTestContext() { DUMB_USER.id, ).sendReq() .onFailure { - it.description shouldContain "USER_ID_INVALID" + it.description shouldContain "CHARGE_ID_EMPTY" }?.shouldBeFalse() } } diff --git a/telegram-bot/src/jvmTest/kotlin/eu/vendeli/api/botactions/SetMyActionsTest.kt b/telegram-bot/src/jvmTest/kotlin/eu/vendeli/api/botactions/SetMyActionsTest.kt index 550bcf5031..f67b6cc641 100644 --- a/telegram-bot/src/jvmTest/kotlin/eu/vendeli/api/botactions/SetMyActionsTest.kt +++ b/telegram-bot/src/jvmTest/kotlin/eu/vendeli/api/botactions/SetMyActionsTest.kt @@ -3,7 +3,6 @@ package eu.vendeli.api.botactions import BotTestContext import eu.vendeli.tgbot.api.botactions.deleteMyCommands import eu.vendeli.tgbot.api.botactions.getMyCommands -import eu.vendeli.tgbot.api.botactions.getMyDefaultAdministratorRights import eu.vendeli.tgbot.api.botactions.getMyDescription import eu.vendeli.tgbot.api.botactions.getMyName import eu.vendeli.tgbot.api.botactions.getMyShortDescription @@ -27,7 +26,7 @@ class SetMyActionsTest : BotTestContext() { setMyDefaultAdministratorRights( ChatAdministratorRights( isAnonymous = true, - canManageChat = false, + canManageChat = true, canDeleteMessages = false, canRestrictMembers = false, canPromoteMembers = false, @@ -42,33 +41,7 @@ class SetMyActionsTest : BotTestContext() { canEditStories = false, canDeleteStories = false, ), - ).send(bot) - - val result = getMyDefaultAdministratorRights().sendReq().shouldSuccess() - - with(result) { - isAnonymous.shouldBeTrue() - } - - setMyDefaultAdministratorRights( - ChatAdministratorRights( - isAnonymous = false, - canManageChat = false, - canDeleteMessages = false, - canRestrictMembers = false, - canPromoteMembers = false, - canChangeInfo = false, - canInviteUsers = false, - canPostMessages = false, - canEditMessages = false, - canPinMessages = false, - canManageTopics = false, - canPostStories = false, - canEditStories = false, - canDeleteStories = false, - canManageVideoChats = false, - ), - ).send(bot) + ).sendReq(bot).shouldSuccess().shouldBeTrue() } @Test diff --git a/telegram-bot/src/jvmTest/kotlin/eu/vendeli/fixtures/GeneratedActivities.kt b/telegram-bot/src/jvmTest/kotlin/eu/vendeli/fixtures/GeneratedActivities.kt index 2389a8140a..1218ed23d2 100644 --- a/telegram-bot/src/jvmTest/kotlin/eu/vendeli/fixtures/GeneratedActivities.kt +++ b/telegram-bot/src/jvmTest/kotlin/eu/vendeli/fixtures/GeneratedActivities.kt @@ -145,11 +145,11 @@ private val __TG_INPUTS0: Map = mapOf( ), "eu.vendeli.fixtures.Conversation.Name" to ( suspendCall { - classManager, - update, - user, - bot, - parameters, + classManager, + update, + user, + bot, + parameters, -> if (user == null) return@suspendCall Unit val inst = classManager.getInstance(eu.vendeli.fixtures.Conversation.Name::class) as @@ -180,11 +180,11 @@ private val __TG_INPUTS0: Map = mapOf( ), "eu.vendeli.fixtures.Conversation.Age" to ( suspendCall { - classManager, - update, - user, - bot, - parameters, + classManager, + update, + user, + bot, + parameters, -> if (user == null) return@suspendCall Unit val inst = classManager.getInstance(eu.vendeli.fixtures.Conversation.Age::class) as @@ -260,11 +260,11 @@ private val __TG_COMMONS0: Map = mapOf( setOf(), ) to ( suspendCall { - classManager, - update, - user, - bot, - parameters, + classManager, + update, + user, + bot, + parameters, -> val inst = classManager.getInstance(eu.vendeli.fixtures.RegexCommands::class) as eu.vendeli.fixtures.RegexCommands @@ -300,11 +300,11 @@ private val __TG_UPDATE_TYPES0: Map = mapOf( ) private val __TG_UNPROCESSED0: InvocationLambda? = suspendCall { - classManager, - update, - user, - bot, - parameters, + classManager, + update, + user, + bot, + parameters, -> val inst = classManager.getInstance(eu.vendeli.fixtures.TgAnnotationsModel::class) as eu.vendeli.fixtures.TgAnnotationsModel diff --git a/telegram-bot/src/linuxMain/kotlin/eu/vendeli/tgbot/utils/LoggingUtils.linux.kt b/telegram-bot/src/linuxMain/kotlin/eu/vendeli/tgbot/utils/LoggingUtils.linux.kt deleted file mode 100644 index bec868689e..0000000000 --- a/telegram-bot/src/linuxMain/kotlin/eu/vendeli/tgbot/utils/LoggingUtils.linux.kt +++ /dev/null @@ -1,30 +0,0 @@ -package eu.vendeli.tgbot.utils - -import co.touchlab.kermit.DefaultFormatter -import co.touchlab.kermit.Severity -import co.touchlab.kermit.mutableLoggerConfigInit -import co.touchlab.kermit.platformLogWriter -import eu.vendeli.tgbot.interfaces.helper.Logger -import eu.vendeli.tgbot.types.internal.LogLvl - -private val kermitLogger by lazy { - co.touchlab.kermit.Logger( - mutableLoggerConfigInit(platformLogWriter(DefaultFormatter)), - DEFAULT_LOGGING_TAG, - ) -} - -private fun LogLvl.toSeverity(): Severity = when (this) { - LogLvl.TRACE -> Severity.Verbose - LogLvl.DEBUG -> Severity.Debug - LogLvl.INFO -> Severity.Info - LogLvl.WARN -> Severity.Warn - LogLvl.ERROR -> Severity.Error - LogLvl.ALL -> Severity.Verbose - LogLvl.OFF -> error("Turned off.") -} - -internal actual val DEFAULT_LOGGER: Logger - get() = Logger { lvl, tag, message, throwable -> - kermitLogger.log(lvl.toSeverity(), tag ?: DEFAULT_LOGGING_TAG, throwable, message) - } diff --git a/telegram-bot/src/mingwX64Main/kotlin/eu/vendeli/tgbot/utils/LoggingUtils.mingwX64.kt b/telegram-bot/src/mingwX64Main/kotlin/eu/vendeli/tgbot/utils/LoggingUtils.mingwX64.kt deleted file mode 100644 index bec868689e..0000000000 --- a/telegram-bot/src/mingwX64Main/kotlin/eu/vendeli/tgbot/utils/LoggingUtils.mingwX64.kt +++ /dev/null @@ -1,30 +0,0 @@ -package eu.vendeli.tgbot.utils - -import co.touchlab.kermit.DefaultFormatter -import co.touchlab.kermit.Severity -import co.touchlab.kermit.mutableLoggerConfigInit -import co.touchlab.kermit.platformLogWriter -import eu.vendeli.tgbot.interfaces.helper.Logger -import eu.vendeli.tgbot.types.internal.LogLvl - -private val kermitLogger by lazy { - co.touchlab.kermit.Logger( - mutableLoggerConfigInit(platformLogWriter(DefaultFormatter)), - DEFAULT_LOGGING_TAG, - ) -} - -private fun LogLvl.toSeverity(): Severity = when (this) { - LogLvl.TRACE -> Severity.Verbose - LogLvl.DEBUG -> Severity.Debug - LogLvl.INFO -> Severity.Info - LogLvl.WARN -> Severity.Warn - LogLvl.ERROR -> Severity.Error - LogLvl.ALL -> Severity.Verbose - LogLvl.OFF -> error("Turned off.") -} - -internal actual val DEFAULT_LOGGER: Logger - get() = Logger { lvl, tag, message, throwable -> - kermitLogger.log(lvl.toSeverity(), tag ?: DEFAULT_LOGGING_TAG, throwable, message) - } diff --git a/telegram-bot/src/nativeMain/kotlin/eu/vendeli/tgbot/utils/LoggingUtils.native.kt b/telegram-bot/src/nativeMain/kotlin/eu/vendeli/tgbot/utils/LoggingUtils.native.kt new file mode 100644 index 0000000000..9c62c702ca --- /dev/null +++ b/telegram-bot/src/nativeMain/kotlin/eu/vendeli/tgbot/utils/LoggingUtils.native.kt @@ -0,0 +1,11 @@ +package eu.vendeli.tgbot.utils + +import eu.vendeli.tgbot.types.internal.LogLvl +import io.ktor.util.logging.KtorSimpleLogger +import io.ktor.util.logging.Logger + +@Suppress("NOTHING_TO_INLINE") +internal actual inline fun getLogger( + lvl: LogLvl, + tag: String, +): Logger = KtorSimpleLogger(tag) diff --git a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/biometric/BiometricType.kt b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/biometric/BiometricType.kt index 796cc0e153..847132d85b 100644 --- a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/biometric/BiometricType.kt +++ b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/biometric/BiometricType.kt @@ -2,5 +2,7 @@ package eu.vendeli.webapps.biometric @Suppress("EnumEntryName") enum class BiometricType { - finger, face, unknown + finger, + face, + unknown, } diff --git a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/button/BottomButton.kt b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/button/BottomButton.kt index cf5ef8aca3..7cde20d235 100644 --- a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/button/BottomButton.kt +++ b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/button/BottomButton.kt @@ -4,7 +4,8 @@ import kotlin.js.Json @Suppress("EnumEntryName") enum class BottomButtonType { - main, secondary + main, + secondary, } external class BottomButton { @@ -52,5 +53,3 @@ fun BottomButton.setParams(block: MainButtonParams.() -> Unit): BottomButton = M @Suppress("UNCHECKED_CAST_TO_EXTERNAL_INTERFACE") this.setParams(it.asDynamic() as Json) } - - diff --git a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/core/BiometricManager.kt b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/core/BiometricManager.kt index 7a21b4dabb..bd28db4d1c 100644 --- a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/core/BiometricManager.kt +++ b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/core/BiometricManager.kt @@ -23,12 +23,12 @@ external interface BiometricManager { ): BiometricManager fun authenticate( params: BiometricAuthenticateParams, - callback: BiometricAuthenticateCallback = definedExternally + callback: BiometricAuthenticateCallback = definedExternally, ): BiometricManager fun updateBiometricToken( token: String, - callback: BiometricUpdateTokenCallback = definedExternally + callback: BiometricUpdateTokenCallback = definedExternally, ): BiometricManager fun openSettings(): BiometricManager diff --git a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/core/EventType.kt b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/core/EventType.kt index 0b9f69c56e..f1b718037b 100644 --- a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/core/EventType.kt +++ b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/core/EventType.kt @@ -1,6 +1,8 @@ package eu.vendeli.webapps.core -sealed class EventType(val name: String) { +sealed class EventType( + val name: String, +) { data object ThemeChanged : EventType("themeChanged") data object ViewportChanged : EventType("viewportChanged") data object MainButtonClicked : EventType("mainButtonClicked") @@ -14,4 +16,32 @@ sealed class EventType(val name: String) { data object WriteAccessRequested : EventType("writeAccessRequested") data object ContactRequested : EventType("contactRequested") data object ScanQrPopupClosed : EventType("scanQrPopupClosed") + data object Activated : EventType("activated") + data object Deactivated : EventType("deactivated") + data object SafeAreaChanged : EventType("safeAreaChanged") + data object ContentSafeAreaChanged : EventType("contentSafeAreaChanged") + data object FullscreenChanged : EventType("fullscreenChanged") + data object FullscreenFailed : EventType("fullscreenFailed") + data object HomeScreenAdded : EventType("homeScreenAdded") + data object HomeScreenChecked : EventType("homeScreenChecked") + data object AccelerometerStarted : EventType("accelerometerStarted") + data object AccelerometerStopped : EventType("accelerometerStopped") + data object AccelerometerChanged : EventType("accelerometerChanged") + data object AccelerometerFailed : EventType("accelerometerFailed") + data object DeviceOrientationStarted : EventType("deviceOrientationStarted") + data object DeviceOrientationStopped : EventType("deviceOrientationStopped") + data object DeviceOrientationChanged : EventType("deviceOrientationChanged") + data object DeviceOrientationFailed : EventType("deviceOrientationFailed") + data object GyroscopeStarted : EventType("gyroscopeStarted") + data object GyroscopeStopped : EventType("gyroscopeStopped") + data object GyroscopeChanged : EventType("gyroscopeChanged") + data object GyroscopeFailed : EventType("gyroscopeFailed") + data object LocationManagerUpdated : EventType("locationManagerUpdated") + data object LocationRequested : EventType("locationRequested") + data object ShareMessageSent : EventType("shareMessageSent") + data object ShareMessageFailed : EventType("shareMessageFailed") + data object EmojiStatusSet : EventType("emojiStatusSet") + data object EmojiStatusFailed : EventType("emojiStatusFailed") + data object EmojiStatusAccessRequested : EventType("emojiStatusAccessRequested") + data object FileDownloadRequested : EventType("fileDownloadRequested") } diff --git a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/core/WebApp.kt b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/core/WebApp.kt index c48d1f089d..facbe4487b 100644 --- a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/core/WebApp.kt +++ b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/core/WebApp.kt @@ -7,11 +7,19 @@ import eu.vendeli.webapps.haptic.HapticFeedback import eu.vendeli.webapps.invoice.InvoiceClosedInfo import eu.vendeli.webapps.popup.PopupParams import eu.vendeli.webapps.popup.ScanQrPopupParams +import eu.vendeli.webapps.sensors.Accelerometer +import eu.vendeli.webapps.sensors.DeviceOrientation +import eu.vendeli.webapps.sensors.Gyroscope +import eu.vendeli.webapps.sensors.LocationManager +import eu.vendeli.webapps.ui.SafeAreaInset import eu.vendeli.webapps.ui.ThemeParams import eu.vendeli.webapps.utils.AlertCallback import eu.vendeli.webapps.utils.ClipboardTextReceivedCallback import eu.vendeli.webapps.utils.ClosePopupCallback import eu.vendeli.webapps.utils.ConfirmCallback +import eu.vendeli.webapps.user_interaction.DownloadFileParams +import eu.vendeli.webapps.user_interaction.EmojiStatusParams +import eu.vendeli.webapps.utils.HomeScreenStatusCallback import eu.vendeli.webapps.utils.OpenLinkParams import eu.vendeli.webapps.utils.QRTextReceivedCallback import eu.vendeli.webapps.utils.StoryShareParams @@ -31,6 +39,11 @@ external class WebApp { val viewportStableHeight: Float val isClosingConfirmationEnabled: Boolean val isVerticalSwipesEnabled: Boolean + val isActive: Boolean + val isFullscreen: Boolean + val isOrientationLocked: Boolean + val safeAreaInset: SafeAreaInset + val contentSafeAreaInset: SafeAreaInset fun setHeaderColor(color: String) fun setBackgroundColor(color: String) @@ -66,6 +79,18 @@ external class WebApp { @JsName("BiometricManager") val biometricManager: BiometricManager + @JsName("Accelerometer") + val accelerometer: Accelerometer + + @JsName("DeviceOrientation") + val deviceOrientation: DeviceOrientation + + @JsName("Gyroscope") + val gyroscope: Gyroscope + + @JsName("LocationManager") + val locationManager: LocationManager + @JsName("SettingsButton") val settingsButton: SettingsButton @@ -84,4 +109,28 @@ external class WebApp { fun requestWriteAccess(callback: ((Boolean) -> Unit)? = definedExternally) fun requestContact(callback: ((Boolean) -> Unit)? = definedExternally) + + fun requestFullscreen() + fun exitFullscreen() + fun lockOrientation() + fun unlockOrientation() + fun addToHomeScreen() + fun checkHomeScreenStatus(callback: HomeScreenStatusCallback = definedExternally) + + @Suppress("LocalVariableName") + fun shareMessage(msg_id: Long, callback: (Boolean) -> Unit = definedExternally) + + @Suppress("LocalVariableName") + fun setEmojiStatus( + custom_emoji_id: Long, + params: EmojiStatusParams = definedExternally, + callback: (Boolean) -> Unit = definedExternally, + ) + + fun requestEmojiStatusAccess(callback: (Boolean) -> Unit = definedExternally) + + fun downloadFile( + params: DownloadFileParams, + callback: (Boolean) -> Unit = definedExternally, + ) } diff --git a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/haptic/HapticFeedbackStyle.kt b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/haptic/HapticFeedbackStyle.kt index bdeda47969..d2cb195d14 100644 --- a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/haptic/HapticFeedbackStyle.kt +++ b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/haptic/HapticFeedbackStyle.kt @@ -5,5 +5,9 @@ import kotlinx.serialization.Serializable @Serializable @Suppress("EnumEntryName") enum class HapticFeedbackStyle { - light, medium, heavy, rigid, soft + light, + medium, + heavy, + rigid, + soft, } diff --git a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/haptic/HapticFeedbackType.kt b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/haptic/HapticFeedbackType.kt index b6bff2bae2..d92c3ea2ee 100644 --- a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/haptic/HapticFeedbackType.kt +++ b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/haptic/HapticFeedbackType.kt @@ -5,5 +5,7 @@ import kotlinx.serialization.Serializable @Serializable @Suppress("EnumEntryName") enum class HapticFeedbackType { - error, success, warning + error, + success, + warning, } diff --git a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/invoice/InvoiceClosedInfo.kt b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/invoice/InvoiceClosedInfo.kt index a5713b41ab..db2d3a9d49 100644 --- a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/invoice/InvoiceClosedInfo.kt +++ b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/invoice/InvoiceClosedInfo.kt @@ -7,4 +7,3 @@ external interface InvoiceClosedInfo { val InvoiceClosedInfo.Status: InvoiceStatus get() = InvoiceStatus.valueOf(status) - diff --git a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/invoice/InvoiceStatus.kt b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/invoice/InvoiceStatus.kt index 359e713286..da991ee931 100644 --- a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/invoice/InvoiceStatus.kt +++ b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/invoice/InvoiceStatus.kt @@ -2,5 +2,8 @@ package eu.vendeli.webapps.invoice @Suppress("EnumEntryName") enum class InvoiceStatus { - paid, canceled, failed, pending + paid, + canceled, + failed, + pending, } diff --git a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/popup/PopupButton.kt b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/popup/PopupButton.kt index e3ddd0663c..7a0968c19d 100644 --- a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/popup/PopupButton.kt +++ b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/popup/PopupButton.kt @@ -15,7 +15,11 @@ external interface PopupButton { @Serializable @Suppress("EnumEntryName") enum class PopupButtonType { - default, ok, close, cancel, destructive + default, + ok, + close, + cancel, + destructive, } fun DefaultPopupButton( diff --git a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/sensors/Accelerometer.kt b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/sensors/Accelerometer.kt new file mode 100644 index 0000000000..8988b23c2d --- /dev/null +++ b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/sensors/Accelerometer.kt @@ -0,0 +1,20 @@ +package eu.vendeli.webapps.sensors + +import eu.vendeli.webapps.utils.TrackingStartedCallback +import eu.vendeli.webapps.utils.TrackingStoppedCallback + +external interface Accelerometer { + val isStarted: Boolean + val x: Float + val y: Float + val z: Float + + fun start( + params: AccelerometerStartParams, + callback: TrackingStartedCallback = definedExternally, + ): Accelerometer + + fun stop( + callback: TrackingStoppedCallback = definedExternally, + ): Accelerometer +} diff --git a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/sensors/AccelerometerStartParams.kt b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/sensors/AccelerometerStartParams.kt new file mode 100644 index 0000000000..50a01fc783 --- /dev/null +++ b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/sensors/AccelerometerStartParams.kt @@ -0,0 +1,6 @@ +package eu.vendeli.webapps.sensors + +external interface AccelerometerStartParams { + @JsName("refresh_rate") + val refreshRate: Int +} diff --git a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/sensors/DeviceOrientation.kt b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/sensors/DeviceOrientation.kt new file mode 100644 index 0000000000..c59a96277a --- /dev/null +++ b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/sensors/DeviceOrientation.kt @@ -0,0 +1,21 @@ +package eu.vendeli.webapps.sensors + +import eu.vendeli.webapps.utils.TrackingStartedCallback +import eu.vendeli.webapps.utils.TrackingStoppedCallback + +external interface DeviceOrientation { + val isStarted: Boolean + val absolute: Boolean + val alpha: Float + val beta: Float + val gamma: Float + + fun start( + params: DeviceOrientationStartParams, + callback: TrackingStartedCallback = definedExternally, + ): DeviceOrientation + + fun stop( + callback: TrackingStoppedCallback = definedExternally, + ): DeviceOrientation +} diff --git a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/sensors/DeviceOrientationStartParams.kt b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/sensors/DeviceOrientationStartParams.kt new file mode 100644 index 0000000000..274888fc62 --- /dev/null +++ b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/sensors/DeviceOrientationStartParams.kt @@ -0,0 +1,9 @@ +package eu.vendeli.webapps.sensors + +external interface DeviceOrientationStartParams { + @JsName("refresh_rate") + val refreshRate: Int? + + @JsName("need_absolute") + val needAbsolute: Boolean? +} diff --git a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/sensors/Gyroscope.kt b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/sensors/Gyroscope.kt new file mode 100644 index 0000000000..7d1ffa91b1 --- /dev/null +++ b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/sensors/Gyroscope.kt @@ -0,0 +1,20 @@ +package eu.vendeli.webapps.sensors + +import eu.vendeli.webapps.utils.TrackingStartedCallback +import eu.vendeli.webapps.utils.TrackingStoppedCallback + +external interface Gyroscope { + val isStarted: Boolean + val x: Float + val y: Float + val z: Float + + fun start( + params: GyroscopeStartParams, + callback: TrackingStartedCallback = definedExternally, + ): Gyroscope + + fun stop( + callback: TrackingStoppedCallback = definedExternally, + ): Gyroscope +} diff --git a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/sensors/GyroscopeStartParams.kt b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/sensors/GyroscopeStartParams.kt new file mode 100644 index 0000000000..da71526e3f --- /dev/null +++ b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/sensors/GyroscopeStartParams.kt @@ -0,0 +1,6 @@ +package eu.vendeli.webapps.sensors + +external interface GyroscopeStartParams { + @JsName("refresh_rate") + val refreshRate: Int +} diff --git a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/sensors/LocationData.kt b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/sensors/LocationData.kt new file mode 100644 index 0000000000..5edd23213b --- /dev/null +++ b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/sensors/LocationData.kt @@ -0,0 +1,30 @@ +package eu.vendeli.webapps.sensors + +external interface LocationData { + @JsName("latitude") + val latitude: Float + + @JsName("longitude") + val longitude: Float + + @JsName("altitude") + val altitude: Float? + + @JsName("course") + val course: Float? + + @JsName("speed") + val speed: Float? + + @JsName("horizontal_accuracy") + val horizontalAccuracy: Float? + + @JsName("vertical_accuracy") + val verticalAccuracy: Float? + + @JsName("course_accuracy") + val courseAccuracy: Float? + + @JsName("speed_accuracy") + val speedAccuracy: Float? +} diff --git a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/sensors/LocationManager.kt b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/sensors/LocationManager.kt new file mode 100644 index 0000000000..adbdcb9b4e --- /dev/null +++ b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/sensors/LocationManager.kt @@ -0,0 +1,14 @@ +package eu.vendeli.webapps.sensors + +import eu.vendeli.webapps.utils.LocationRequestedCallback + +external interface LocationManager { + val isInited: Boolean + val isLocationAvailable: Boolean + val isAccessRequested: Boolean + val isAccessGranted: Boolean + + fun init(callback: () -> Unit = definedExternally): LocationManager + fun getLocation(callback: LocationRequestedCallback): LocationManager + fun openSettings(): LocationManager +} diff --git a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/ui/ColorScheme.kt b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/ui/ColorScheme.kt index 43822166fa..e87a1d641b 100644 --- a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/ui/ColorScheme.kt +++ b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/ui/ColorScheme.kt @@ -3,5 +3,5 @@ package eu.vendeli.webapps.ui @Suppress("EnumEntryName") enum class ColorScheme { light, - dark + dark, } diff --git a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/ui/SafeAreaInset.kt b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/ui/SafeAreaInset.kt new file mode 100644 index 0000000000..069be1bd60 --- /dev/null +++ b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/ui/SafeAreaInset.kt @@ -0,0 +1,8 @@ +package eu.vendeli.webapps.ui + +external interface SafeAreaInset { + val top: Int? + val bottom: Int? + val left: Int? + val right: Int? +} diff --git a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/user_interaction/DownloadFileParams.kt b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/user_interaction/DownloadFileParams.kt new file mode 100644 index 0000000000..b8edb16a86 --- /dev/null +++ b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/user_interaction/DownloadFileParams.kt @@ -0,0 +1,8 @@ +package eu.vendeli.webapps.user_interaction + +external interface DownloadFileParams { + val url: String + + @JsName("file_name") + val fileName: String +} diff --git a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/user_interaction/EmojiStatusParams.kt b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/user_interaction/EmojiStatusParams.kt new file mode 100644 index 0000000000..19f13fa2ab --- /dev/null +++ b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/user_interaction/EmojiStatusParams.kt @@ -0,0 +1,5 @@ +package eu.vendeli.webapps.user_interaction + +external interface EmojiStatusParams { + val duration: Int? +} diff --git a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/user_interaction/EventEnums.kt b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/user_interaction/EventEnums.kt new file mode 100644 index 0000000000..b8f01c7fb1 --- /dev/null +++ b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/user_interaction/EventEnums.kt @@ -0,0 +1,61 @@ +package eu.vendeli.webapps.user_interaction + +@Suppress("EnumEntryName") +enum class FullscreenError { + unsupported, + already_fullscreen, +} + +@Suppress("EnumEntryName") +enum class AccelerometerError { + unsupported, +} + +@Suppress("EnumEntryName") +enum class DeviceOrientationError { + unsupported, +} + +@Suppress("EnumEntryName") +enum class HomeScreenStatus { + unsupported, + unknown, + added, + missed, +} + +@Suppress("EnumEntryName") +enum class GyroscopeError { + unsupported, +} + +@Suppress("EnumEntryName") +enum class ShareMessageError { + unsupported, + message_expired, + message_send_failed, + user_declined, + unknown_error, +} + +@Suppress("EnumEntryName") +enum class EmojiStatusError { + unsupported, + suggested_emoji_invalid, + duration_invalid, + user_declined, + server_error, + unknown_error, +} + +@Suppress("EnumEntryName") +enum class EmojiStatusAccess { + allowed, + cancelled, +} + +@Suppress("EnumEntryName") +enum class FileDownloadStatus { + downloading, + cancelled, +} diff --git a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/user_interaction/EventParameters.kt b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/user_interaction/EventParameters.kt new file mode 100644 index 0000000000..7f0a47aac5 --- /dev/null +++ b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/user_interaction/EventParameters.kt @@ -0,0 +1,70 @@ +package eu.vendeli.webapps.user_interaction + +import eu.vendeli.webapps.sensors.LocationData + +external interface FullscreenFailedInfo { + val error: String +} + +val FullscreenFailedInfo.Error: FullscreenError + get() = FullscreenError.valueOf(error) + +external interface HomeScreenCheckedInfo { + val status: String +} + +val HomeScreenCheckedInfo.Status: HomeScreenStatus + get() = HomeScreenStatus.valueOf(status) + +external interface AccelerometerFailedInfo { + val error: String +} + +val AccelerometerFailedInfo.Error: AccelerometerError + get() = AccelerometerError.valueOf(error) + +external interface DeviceOrientationFailedInfo { + val error: String +} + +val DeviceOrientationFailedInfo.Error: DeviceOrientationError + get() = DeviceOrientationError.valueOf(error) + +external interface GyroscopeFailedInfo { + val error: String +} + +val GyroscopeFailedInfo.Error: GyroscopeError + get() = GyroscopeError.valueOf(error) + +external interface LocationRequestedInfo { + val locationData: LocationData +} + +external interface ShareMessageFailedInfo { + val error: String +} + +val ShareMessageFailedInfo.Error: ShareMessageError + get() = ShareMessageError.valueOf(error) + +external interface EmojiStatusFailedInfo { + val error: String +} + +val EmojiStatusFailedInfo.Error: EmojiStatusError + get() = EmojiStatusError.valueOf(error) + +external interface EmojiStatusAccessRequestedInfo { + val status: String +} + +val EmojiStatusAccessRequestedInfo.Status: EmojiStatusAccess + get() = EmojiStatusAccess.valueOf(status) + +external interface FileDownloadRequestedInfo { + val status: String +} + +val FileDownloadRequestedInfo.Status: FileDownloadStatus + get() = FileDownloadStatus.valueOf(status) diff --git a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/utils/EventHandlerExtUtils.kt b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/utils/EventHandlerExtUtils.kt index b0d60edddb..3006fc1e1f 100644 --- a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/utils/EventHandlerExtUtils.kt +++ b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/utils/EventHandlerExtUtils.kt @@ -41,3 +41,87 @@ fun WebApp.onWriteAccessRequested(eventHandler: WriteAccessRequestedHandler) = fun WebApp.onContactRequested(eventHandler: ContactRequestedHandler) = onEvent(EventType.ContactRequested, EventHandler.ContactRequested(eventHandler)) + +fun WebApp.onActivated(eventHandler: NoParamsEventHandler) = + onEvent(EventType.Activated, EventHandler.Activated(eventHandler)) + +fun WebApp.onDeactivated(eventHandler: NoParamsEventHandler) = + onEvent(EventType.Deactivated, EventHandler.Deactivated(eventHandler)) + +fun WebApp.onSafeAreaChanged(eventHandler: NoParamsEventHandler) = + onEvent(EventType.SafeAreaChanged, EventHandler.SafeAreaChanged(eventHandler)) + +fun WebApp.onContentSafeAreaChanged(eventHandler: NoParamsEventHandler) = + onEvent(EventType.ContentSafeAreaChanged, EventHandler.ContentSafeAreaChanged(eventHandler)) + +fun WebApp.onFullscreenChanged(eventHandler: NoParamsEventHandler) = + onEvent(EventType.FullscreenChanged, EventHandler.FullscreenChanged(eventHandler)) + +fun WebApp.onHomeScreenAdded(eventHandler: NoParamsEventHandler) = + onEvent(EventType.HomeScreenAdded, EventHandler.HomeScreenAdded(eventHandler)) + +fun WebApp.onAccelerometerStarted(eventHandler: NoParamsEventHandler) = + onEvent(EventType.AccelerometerStarted, EventHandler.AccelerometerStarted(eventHandler)) + +fun WebApp.onAccelerometerStopped(eventHandler: NoParamsEventHandler) = + onEvent(EventType.AccelerometerStopped, EventHandler.AccelerometerStopped(eventHandler)) + +fun WebApp.onAccelerometerChanged(eventHandler: NoParamsEventHandler) = + onEvent(EventType.AccelerometerChanged, EventHandler.AccelerometerChanged(eventHandler)) + +fun WebApp.onDeviceOrientationStarted(eventHandler: NoParamsEventHandler) = + onEvent(EventType.DeviceOrientationStarted, EventHandler.DeviceOrientationStarted(eventHandler)) + +fun WebApp.onDeviceOrientationStopped(eventHandler: NoParamsEventHandler) = + onEvent(EventType.DeviceOrientationStopped, EventHandler.DeviceOrientationStopped(eventHandler)) + +fun WebApp.onDeviceOrientationChanged(eventHandler: NoParamsEventHandler) = + onEvent(EventType.DeviceOrientationChanged, EventHandler.DeviceOrientationChanged(eventHandler)) + +fun WebApp.onGyroscopeStarted(eventHandler: NoParamsEventHandler) = + onEvent(EventType.GyroscopeStarted, EventHandler.GyroscopeStarted(eventHandler)) + +fun WebApp.onGyroscopeStopped(eventHandler: NoParamsEventHandler) = + onEvent(EventType.GyroscopeStopped, EventHandler.GyroscopeStopped(eventHandler)) + +fun WebApp.onGyroscopeChanged(eventHandler: NoParamsEventHandler) = + onEvent(EventType.GyroscopeChanged, EventHandler.GyroscopeChanged(eventHandler)) + +fun WebApp.onLocationManagerUpdated(eventHandler: NoParamsEventHandler) = + onEvent(EventType.LocationManagerUpdated, EventHandler.LocationManagerUpdated(eventHandler)) + +fun WebApp.onShareMessageSent(eventHandler: NoParamsEventHandler) = + onEvent(EventType.ShareMessageSent, EventHandler.ShareMessageSent(eventHandler)) + +fun WebApp.onEmojiStatusSet(eventHandler: NoParamsEventHandler) = + onEvent(EventType.EmojiStatusSet, EventHandler.EmojiStatusSet(eventHandler)) + +fun WebApp.onFullscreenFailed(eventHandler: FullscreenFailedEventHandler) = + onEvent(EventType.FullscreenFailed, EventHandler.FullscreenFailed(eventHandler)) + +fun WebApp.onHomeScreenChecked(eventHandler: HomeScreenCheckedEventHandler) = + onEvent(EventType.HomeScreenChecked, EventHandler.HomeScreenChecked(eventHandler)) + +fun WebApp.onAccelerometerFailed(eventHandler: AccelerometerFailedEventHandler) = + onEvent(EventType.AccelerometerFailed, EventHandler.AccelerometerFailed(eventHandler)) + +fun WebApp.onDeviceOrientationFailed(eventHandler: DeviceOrientationFailedEventHandler) = + onEvent(EventType.DeviceOrientationFailed, EventHandler.DeviceOrientationFailed(eventHandler)) + +fun WebApp.onGyroscopeFailed(eventHandler: GyroscopeFailedEventHandler) = + onEvent(EventType.GyroscopeFailed, EventHandler.GyroscopeFailed(eventHandler)) + +fun WebApp.onLocationRequested(eventHandler: LocationRequestedEventHandler) = + onEvent(EventType.LocationRequested, EventHandler.LocationRequested(eventHandler)) + +fun WebApp.onEmojiStatusAccessRequested(eventHandler: EmojiStatusAccessRequestedEventHandler) = + onEvent(EventType.EmojiStatusAccessRequested, EventHandler.EmojiStatusAccessRequested(eventHandler)) + +fun WebApp.onShareMessageFailed(eventHandler: ShareMessageFailedEventHandler) = + onEvent(EventType.ShareMessageFailed, EventHandler.ShareMessageFailed(eventHandler)) + +fun WebApp.onEmojiStatusFailed(eventHandler: EmojiStatusFailedEventHandler) = + onEvent(EventType.EmojiStatusFailed, EventHandler.EmojiStatusFailed(eventHandler)) + +fun WebApp.onFileDownloadRequested(eventHandler: FileDownloadRequestedEventHandler) = + onEvent(EventType.FileDownloadRequested, EventHandler.FileDownloadRequested(eventHandler)) diff --git a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/utils/HelperExtUtils.kt b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/utils/HelperExtUtils.kt index d4e64f8afc..45f9a427ad 100644 --- a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/utils/HelperExtUtils.kt +++ b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/utils/HelperExtUtils.kt @@ -13,9 +13,7 @@ inline fun conditionalAction( @Suppress("UnusedReceiverParameter") @JsName("decodeURLQueryComponent") -fun String.decodeURLQueryComponent(): String { - return js("decodeURIComponent(this)").unsafeCast() -} +fun String.decodeURLQueryComponent(): String = js("decodeURIComponent(this)").unsafeCast() const val BG_COLOR = "bg_color" const val SECONDARY_BG_COLOR = "secondary_bg_color" diff --git a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/utils/RequestState.kt b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/utils/RequestState.kt index 8421b1d5c8..db1c3a6376 100644 --- a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/utils/RequestState.kt +++ b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/utils/RequestState.kt @@ -6,7 +6,8 @@ external interface WriteAccessRequestState { @Suppress("EnumEntryName") enum class WriteAccessRequestStatus { - allowed, canceled + allowed, + canceled, } val WriteAccessRequestState.Status: WriteAccessRequestStatus @@ -18,7 +19,8 @@ external interface ContactRequestState { @Suppress("EnumEntryName") enum class ContactRequestStatus { - sent, canceled + sent, + canceled, } val ContactRequestState.Status: ContactRequestStatus diff --git a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/utils/TypeAliases.kt b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/utils/TypeAliases.kt index 0ed413390c..ae0dedba9e 100644 --- a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/utils/TypeAliases.kt +++ b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/utils/TypeAliases.kt @@ -1,8 +1,18 @@ package eu.vendeli.webapps.utils - import eu.vendeli.webapps.core.WebApp import eu.vendeli.webapps.invoice.InvoiceClosedInfo +import eu.vendeli.webapps.sensors.LocationData import eu.vendeli.webapps.ui.ViewportChangedData +import eu.vendeli.webapps.user_interaction.AccelerometerFailedInfo +import eu.vendeli.webapps.user_interaction.DeviceOrientationFailedInfo +import eu.vendeli.webapps.user_interaction.EmojiStatusAccessRequestedInfo +import eu.vendeli.webapps.user_interaction.EmojiStatusFailedInfo +import eu.vendeli.webapps.user_interaction.FileDownloadRequestedInfo +import eu.vendeli.webapps.user_interaction.FullscreenFailedInfo +import eu.vendeli.webapps.user_interaction.GyroscopeFailedInfo +import eu.vendeli.webapps.user_interaction.HomeScreenCheckedInfo +import eu.vendeli.webapps.user_interaction.HomeScreenStatus +import eu.vendeli.webapps.user_interaction.ShareMessageFailedInfo // Callbacks typealias AlertCallback = () -> Unit @@ -13,7 +23,10 @@ typealias ClipboardTextReceivedCallback = (String) -> Unit typealias BiometricRequestAccessCallback = (accessGranted: Boolean) -> Unit typealias BiometricAuthenticateCallback = (userAuthenticated: Boolean) -> Unit typealias BiometricUpdateTokenCallback = (tokenUpdated: Boolean) -> Unit - +typealias TrackingStartedCallback = (started: Boolean) -> Unit +typealias TrackingStoppedCallback = (started: Boolean) -> Unit +typealias LocationRequestedCallback = (location: LocationData?) -> Unit +typealias HomeScreenStatusCallback = (status: HomeScreenStatus) -> Unit // Handlers typealias NoParamsEventHandler = WebApp.() -> Unit @@ -24,3 +37,13 @@ typealias QRTextReceivedEventHandler = WebApp.(String) -> Boolean typealias ClipboardTextReceivedEventHandler = WebApp.(String) -> Unit typealias WriteAccessRequestedHandler = WebApp.(WriteAccessRequestState) -> Unit typealias ContactRequestedHandler = WebApp.(ContactRequestState) -> Unit +typealias FullscreenFailedEventHandler = WebApp.(FullscreenFailedInfo) -> Unit +typealias HomeScreenCheckedEventHandler = WebApp.(HomeScreenCheckedInfo) -> Unit +typealias AccelerometerFailedEventHandler = WebApp.(AccelerometerFailedInfo) -> Unit +typealias DeviceOrientationFailedEventHandler = WebApp.(DeviceOrientationFailedInfo) -> Unit +typealias EmojiStatusFailedEventHandler = WebApp.(EmojiStatusFailedInfo) -> Unit +typealias EmojiStatusAccessRequestedEventHandler = WebApp.(EmojiStatusAccessRequestedInfo) -> Unit +typealias FileDownloadRequestedEventHandler = WebApp.(FileDownloadRequestedInfo) -> Unit +typealias GyroscopeFailedEventHandler = WebApp.(GyroscopeFailedInfo) -> Unit +typealias LocationRequestedEventHandler = WebApp.(LocationData) -> Unit +typealias ShareMessageFailedEventHandler = WebApp.(ShareMessageFailedInfo) -> Unit diff --git a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/utils/WebAppExtUtils.kt b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/utils/WebAppExtUtils.kt index 74465f9290..15586343f0 100644 --- a/webapps/src/jsMain/kotlin/eu/vendeli/webapps/utils/WebAppExtUtils.kt +++ b/webapps/src/jsMain/kotlin/eu/vendeli/webapps/utils/WebAppExtUtils.kt @@ -9,19 +9,146 @@ import eu.vendeli.webapps.popup.PopupParams import eu.vendeli.webapps.ui.ColorScheme val WebApp.ColorScheme: ColorScheme - get() = eu.vendeli.webapps.ui.ColorScheme.valueOf(colorScheme) + get() = eu.vendeli.webapps.ui.ColorScheme + .valueOf(colorScheme) sealed interface EventHandler { val block: Function<*> - value class ViewportChanged(override val block: ViewportChangedEventHandler) : EventHandler - value class InvoiceClosed(override val block: InvoiceClosedEventHandler) : EventHandler - value class PopupClosed(override val block: PopupClosedEventHandler) : EventHandler - value class QRTextReceived(override val block: QRTextReceivedEventHandler) : EventHandler - value class ClipboardTextReceived(override val block: ClipboardTextReceivedEventHandler) : EventHandler - value class WriteAccessRequested(override val block: WriteAccessRequestedHandler) : EventHandler - value class ContactRequested(override val block: ContactRequestedHandler) : EventHandler - value class NoParams(override val block: NoParamsEventHandler) : EventHandler + value class ViewportChanged( + override val block: ViewportChangedEventHandler, + ) : EventHandler + value class InvoiceClosed( + override val block: InvoiceClosedEventHandler, + ) : EventHandler + value class PopupClosed( + override val block: PopupClosedEventHandler, + ) : EventHandler + value class QRTextReceived( + override val block: QRTextReceivedEventHandler, + ) : EventHandler + value class ClipboardTextReceived( + override val block: ClipboardTextReceivedEventHandler, + ) : EventHandler + value class WriteAccessRequested( + override val block: WriteAccessRequestedHandler, + ) : EventHandler + value class ContactRequested( + override val block: ContactRequestedHandler, + ) : EventHandler + value class NoParams( + override val block: NoParamsEventHandler, + ) : EventHandler + value class Activated( + override val block: NoParamsEventHandler, + ) : EventHandler + + value class Deactivated( + override val block: NoParamsEventHandler, + ) : EventHandler + value class SafeAreaChanged( + override val block: NoParamsEventHandler, + ) : EventHandler + + value class ContentSafeAreaChanged( + override val block: NoParamsEventHandler, + ) : EventHandler + + value class FullscreenChanged( + override val block: NoParamsEventHandler, + ) : EventHandler + + value class FullscreenFailed( + override val block: FullscreenFailedEventHandler, + ) : EventHandler + + value class HomeScreenAdded( + override val block: NoParamsEventHandler, + ) : EventHandler + + value class HomeScreenChecked( + override val block: HomeScreenCheckedEventHandler, + ) : EventHandler + + value class AccelerometerStarted( + override val block: NoParamsEventHandler, + ) : EventHandler + + value class AccelerometerStopped( + override val block: NoParamsEventHandler, + ) : EventHandler + + value class AccelerometerChanged( + override val block: NoParamsEventHandler, + ) : EventHandler + + value class AccelerometerFailed( + override val block: AccelerometerFailedEventHandler, + ) : EventHandler + + value class DeviceOrientationStarted( + override val block: NoParamsEventHandler, + ) : EventHandler + + value class DeviceOrientationStopped( + override val block: NoParamsEventHandler, + ) : EventHandler + + value class DeviceOrientationChanged( + override val block: NoParamsEventHandler, + ) : EventHandler + + value class DeviceOrientationFailed( + override val block: DeviceOrientationFailedEventHandler, + ) : EventHandler + + value class GyroscopeStarted( + override val block: NoParamsEventHandler, + ) : EventHandler + + value class GyroscopeStopped( + override val block: NoParamsEventHandler, + ) : EventHandler + + value class GyroscopeChanged( + override val block: NoParamsEventHandler, + ) : EventHandler + + value class GyroscopeFailed( + override val block: GyroscopeFailedEventHandler, + ) : EventHandler + + value class LocationManagerUpdated( + override val block: NoParamsEventHandler, + ) : EventHandler + + value class LocationRequested( + override val block: LocationRequestedEventHandler, + ) : EventHandler + + value class ShareMessageSent( + override val block: NoParamsEventHandler, + ) : EventHandler + + value class ShareMessageFailed( + override val block: ShareMessageFailedEventHandler, + ) : EventHandler + + value class EmojiStatusSet( + override val block: NoParamsEventHandler, + ) : EventHandler + + value class EmojiStatusFailed( + override val block: EmojiStatusFailedEventHandler, + ) : EventHandler + + value class EmojiStatusAccessRequested( + override val block: EmojiStatusAccessRequestedEventHandler, + ) : EventHandler + + value class FileDownloadRequested( + override val block: FileDownloadRequestedEventHandler, + ) : EventHandler } internal inline fun WebApp.onEvent(type: EventType.ViewportChanged, eventHandler: EventHandler.ViewportChanged) { @@ -40,11 +167,17 @@ internal inline fun WebApp.onEvent(type: EventType.QRTextReceived, eventHandler: onEvent(type.name, eventHandler.block) } -internal inline fun WebApp.onEvent(type: EventType.ClipboardTextReceived, eventHandler: EventHandler.ClipboardTextReceived) { +internal inline fun WebApp.onEvent( + type: EventType.ClipboardTextReceived, + eventHandler: EventHandler.ClipboardTextReceived, +) { onEvent(type.name, eventHandler.block) } -internal inline fun WebApp.onEvent(type: EventType.WriteAccessRequested, eventHandler: EventHandler.WriteAccessRequested) { +internal inline fun WebApp.onEvent( + type: EventType.WriteAccessRequested, + eventHandler: EventHandler.WriteAccessRequested, +) { onEvent(type.name, eventHandler.block) } @@ -77,6 +210,118 @@ internal inline fun WebApp.onEvent(type: EventType.ScanQrPopupClosed, eventHandl onEvent(type.name, eventHandler.block) } +internal inline fun WebApp.onEvent(type: EventType.Activated, eventHandler: EventHandler.Activated) { + onEvent(type.name, eventHandler.block) +} + +internal inline fun WebApp.onEvent(type: EventType.Deactivated, eventHandler: EventHandler.Deactivated) { + onEvent(type.name, eventHandler.block) +} + +internal inline fun WebApp.onEvent(type: EventType.SafeAreaChanged, eventHandler: EventHandler.SafeAreaChanged) { + onEvent(type.name, eventHandler.block) +} + +internal inline fun WebApp.onEvent(type: EventType.ContentSafeAreaChanged, eventHandler: EventHandler.ContentSafeAreaChanged) { + onEvent(type.name, eventHandler.block) +} + +internal inline fun WebApp.onEvent(type: EventType.FullscreenChanged, eventHandler: EventHandler.FullscreenChanged) { + onEvent(type.name, eventHandler.block) +} + +internal inline fun WebApp.onEvent(type: EventType.FullscreenFailed, eventHandler: EventHandler.FullscreenFailed) { + onEvent(type.name, eventHandler.block) +} + +internal inline fun WebApp.onEvent(type: EventType.HomeScreenAdded, eventHandler: EventHandler.HomeScreenAdded) { + onEvent(type.name, eventHandler.block) +} + +internal inline fun WebApp.onEvent(type: EventType.HomeScreenChecked, eventHandler: EventHandler.HomeScreenChecked) { + onEvent(type.name, eventHandler.block) +} + +internal inline fun WebApp.onEvent(type: EventType.AccelerometerStarted, eventHandler: EventHandler.AccelerometerStarted) { + onEvent(type.name, eventHandler.block) +} + +internal inline fun WebApp.onEvent(type: EventType.AccelerometerStopped, eventHandler: EventHandler.AccelerometerStopped) { + onEvent(type.name, eventHandler.block) +} + +internal inline fun WebApp.onEvent(type: EventType.AccelerometerChanged, eventHandler: EventHandler.AccelerometerChanged) { + onEvent(type.name, eventHandler.block) +} + +internal inline fun WebApp.onEvent(type: EventType.AccelerometerFailed, eventHandler: EventHandler.AccelerometerFailed) { + onEvent(type.name, eventHandler.block) +} + +internal inline fun WebApp.onEvent(type: EventType.DeviceOrientationStarted, eventHandler: EventHandler.DeviceOrientationStarted) { + onEvent(type.name, eventHandler.block) +} + +internal inline fun WebApp.onEvent(type: EventType.DeviceOrientationStopped, eventHandler: EventHandler.DeviceOrientationStopped) { + onEvent(type.name, eventHandler.block) +} + +internal inline fun WebApp.onEvent(type: EventType.DeviceOrientationChanged, eventHandler: EventHandler.DeviceOrientationChanged) { + onEvent(type.name, eventHandler.block) +} + +internal inline fun WebApp.onEvent(type: EventType.DeviceOrientationFailed, eventHandler: EventHandler.DeviceOrientationFailed) { + onEvent(type.name, eventHandler.block) +} + +internal inline fun WebApp.onEvent(type: EventType.GyroscopeStarted, eventHandler: EventHandler.GyroscopeStarted) { + onEvent(type.name, eventHandler.block) +} + +internal inline fun WebApp.onEvent(type: EventType.GyroscopeStopped, eventHandler: EventHandler.GyroscopeStopped) { + onEvent(type.name, eventHandler.block) +} + +internal inline fun WebApp.onEvent(type: EventType.GyroscopeChanged, eventHandler: EventHandler.GyroscopeChanged) { + onEvent(type.name, eventHandler.block) +} + +internal inline fun WebApp.onEvent(type: EventType.GyroscopeFailed, eventHandler: EventHandler.GyroscopeFailed) { + onEvent(type.name, eventHandler.block) +} + +internal inline fun WebApp.onEvent(type: EventType.LocationManagerUpdated, eventHandler: EventHandler.LocationManagerUpdated) { + onEvent(type.name, eventHandler.block) +} + +internal inline fun WebApp.onEvent(type: EventType.LocationRequested, eventHandler: EventHandler.LocationRequested) { + onEvent(type.name, eventHandler.block) +} + +internal inline fun WebApp.onEvent(type: EventType.ShareMessageSent, eventHandler: EventHandler.ShareMessageSent) { + onEvent(type.name, eventHandler.block) +} + +internal inline fun WebApp.onEvent(type: EventType.ShareMessageFailed, eventHandler: EventHandler.ShareMessageFailed) { + onEvent(type.name, eventHandler.block) +} + +internal inline fun WebApp.onEvent(type: EventType.EmojiStatusSet, eventHandler: EventHandler.EmojiStatusSet) { + onEvent(type.name, eventHandler.block) +} + +internal inline fun WebApp.onEvent(type: EventType.EmojiStatusFailed, eventHandler: EventHandler.EmojiStatusFailed) { + onEvent(type.name, eventHandler.block) +} + +internal inline fun WebApp.onEvent(type: EventType.EmojiStatusAccessRequested, eventHandler: EventHandler.EmojiStatusAccessRequested) { + onEvent(type.name, eventHandler.block) +} + +internal inline fun WebApp.onEvent(type: EventType.FileDownloadRequested, eventHandler: EventHandler.FileDownloadRequested) { + onEvent(type.name, eventHandler.block) +} + fun WebApp.showPopup( message: String, title: String?,