mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI-examples.git
synced 2025-12-06 22:35:39 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 59fca968d7 | |||
| f03ba5f177 | |||
|
|
855d2c1296 | ||
| 280f5abce0 | |||
|
|
ed81e76ef8 | ||
| 541b76b292 | |||
| 5b580b5a15 |
@@ -4,10 +4,16 @@ import dev.inmo.kslog.common.defaultMessageFormatter
|
||||
import dev.inmo.kslog.common.setDefaultKSLog
|
||||
import dev.inmo.micro_utils.coroutines.subscribeSafelyWithoutExceptions
|
||||
import dev.inmo.tgbotapi.extensions.api.bot.getMe
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextData
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.telegramBotWithBehaviourAndLongPolling
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.onCommand
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
|
||||
private var BehaviourContextData.update
|
||||
get() = get("update")
|
||||
set(value) = set("update", value)
|
||||
|
||||
/**
|
||||
* This place can be the playground for your code.
|
||||
*/
|
||||
@@ -38,12 +44,19 @@ suspend fun main(vararg args: String) {
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
subcontextInitialAction = {
|
||||
data.update = it
|
||||
}
|
||||
) {
|
||||
// start here!!
|
||||
val me = getMe()
|
||||
println(me)
|
||||
|
||||
onCommand("start") {
|
||||
println(data.update)
|
||||
}
|
||||
|
||||
allUpdatesFlow.subscribeSafelyWithoutExceptions(this) {
|
||||
println(it)
|
||||
}
|
||||
|
||||
@@ -33,6 +33,6 @@ kotlin {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'io.ktor:ktor-client-logging-jvm:2.3.12'
|
||||
implementation 'io.ktor:ktor-client-logging-jvm:3.0.1'
|
||||
}
|
||||
|
||||
|
||||
@@ -18,5 +18,5 @@ dependencies {
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
|
||||
implementation "dev.inmo:tgbotapi:$telegram_bot_api_version"
|
||||
implementation 'io.ktor:ktor-client-logging-jvm:2.3.12'
|
||||
implementation 'io.ktor:ktor-client-logging-jvm:3.0.1'
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ kotlin.daemon.jvmargs=-Xmx3g -Xms500m
|
||||
|
||||
|
||||
kotlin_version=2.0.21
|
||||
telegram_bot_api_version=19.1.0
|
||||
telegram_bot_api_version=20.1.0
|
||||
micro_utils_version=0.23.0
|
||||
serialization_version=1.7.3
|
||||
ktor_version=3.0.1
|
||||
|
||||
Reference in New Issue
Block a user