mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI-examples.git
synced 2025-09-03 15:19:49 +00:00
start migration onto 25.0.0
This commit is contained in:
@@ -16,10 +16,14 @@ plugins {
|
||||
id "org.jetbrains.compose" version "$compose_version"
|
||||
}
|
||||
|
||||
apply plugin: 'application'
|
||||
|
||||
kotlin {
|
||||
jvm()
|
||||
jvm {
|
||||
binaries {
|
||||
executable {
|
||||
mainClass.set("WebAppServerKt")
|
||||
}
|
||||
}
|
||||
}
|
||||
js(IR) {
|
||||
browser()
|
||||
binaries.executable()
|
||||
@@ -53,10 +57,6 @@ kotlin {
|
||||
}
|
||||
}
|
||||
|
||||
application {
|
||||
mainClassName = "WebAppServerKt"
|
||||
}
|
||||
|
||||
tasks.getByName("compileKotlinJvm")
|
||||
.dependsOn(jsBrowserDistribution)
|
||||
tasks.getByName("compileKotlinJvm").configure {
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import androidx.compose.runtime.*
|
||||
import dev.inmo.micro_utils.coroutines.launchLoggingDropExceptions
|
||||
import dev.inmo.micro_utils.coroutines.launchSafelyWithoutExceptions
|
||||
import dev.inmo.tgbotapi.types.CustomEmojiId
|
||||
import dev.inmo.tgbotapi.types.userIdField
|
||||
@@ -110,7 +111,7 @@ fun main() {
|
||||
userId ?.let { userId ->
|
||||
Button({
|
||||
onClick {
|
||||
scope.launchSafelyWithoutExceptions {
|
||||
scope.launchLoggingDropExceptions {
|
||||
client.post("$baseUrl/setCustomEmoji") {
|
||||
parameter(userIdField, userId.long)
|
||||
setBody(
|
||||
@@ -130,7 +131,7 @@ fun main() {
|
||||
|
||||
Button({
|
||||
onClick {
|
||||
scope.launchSafelyWithoutExceptions {
|
||||
scope.launchLoggingDropExceptions {
|
||||
handleResult({ "Clicked" }) {
|
||||
client.post("${window.location.origin.removeSuffix("/")}/inline") {
|
||||
parameter(webAppQueryIdField, it)
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import dev.inmo.kslog.common.*
|
||||
import dev.inmo.micro_utils.coroutines.subscribeLoggingDropExceptions
|
||||
import dev.inmo.micro_utils.coroutines.subscribeSafelyWithoutExceptions
|
||||
import dev.inmo.micro_utils.ktor.server.createKtorServer
|
||||
import dev.inmo.tgbotapi.extensions.api.answers.answerInlineQuery
|
||||
@@ -195,7 +196,7 @@ suspend fun main(vararg args: String) {
|
||||
BotCommand("reply_markup", "Use to get reply markup keyboard with web app trigger"),
|
||||
BotCommand("inline", "Use to get inline keyboard with web app trigger"),
|
||||
)
|
||||
allUpdatesFlow.subscribeSafelyWithoutExceptions(this) {
|
||||
allUpdatesFlow.subscribeLoggingDropExceptions(this) {
|
||||
println(it)
|
||||
}
|
||||
println(getMe())
|
||||
|
Reference in New Issue
Block a user