Compare commits

...

6 Commits

Author SHA1 Message Date
renovate[bot]
8dcb6fdc4b Merge 91837c0ea2 into 9170d30b2f 2024-03-02 00:10:24 +06:00
9170d30b2f Update gradle-wrapper.properties 2024-03-02 00:08:22 +06:00
2f3fd2e53b Update gradle.properties 2024-03-02 00:05:34 +06:00
88697fb5a6 Merge pull request #253 from InsanusMokrassar/10.1.0
10.1.0
2024-02-17 13:38:13 +06:00
578d00cac6 Update gradle.properties 2024-02-17 13:37:50 +06:00
13ecb3f0df update dependencies 2024-02-17 01:51:32 +06:00
3 changed files with 24 additions and 5 deletions

View File

@@ -1,4 +1,9 @@
import dev.inmo.kslog.common.KSLog
import dev.inmo.kslog.common.LogLevel
import dev.inmo.kslog.common.defaultMessageFormatter
import dev.inmo.kslog.common.setDefaultKSLog
import dev.inmo.micro_utils.coroutines.firstOf
import dev.inmo.micro_utils.coroutines.subscribeSafelyWithoutExceptions
import dev.inmo.micro_utils.fsm.common.State
import dev.inmo.tgbotapi.bot.ktor.telegramBot
import dev.inmo.tgbotapi.extensions.api.bot.setMyCommands
@@ -50,6 +55,16 @@ sealed interface UserRetrievingStep : State {
suspend fun main(args: Array<String>) {
val botToken = args.first()
val isDebug = args.getOrNull(2) == "debug"
if (isDebug) {
setDefaultKSLog(
KSLog { level: LogLevel, tag: String?, message: Any, throwable: Throwable? ->
println(defaultMessageFormatter(level, tag, message, throwable))
}
)
}
val bot = telegramBot(botToken)
val allowedAdmin = ChatId(args[1].toLong())
@@ -517,5 +532,9 @@ suspend fun main(args: Array<String>) {
BotCommand("rights_in_channel", "Trigger granular keyboard. Use with reply to user"),
scope = BotCommandScope.AllGroupChats
)
allUpdatesFlow.subscribeSafelyWithoutExceptions(this) {
println(it)
}
}.join()
}

View File

@@ -5,7 +5,7 @@ org.gradle.jvmargs=-Xmx2344m
kotlin_version=1.9.22
telegram_bot_api_version=10.0.0
micro_utils_version=0.20.26
serialization_version=1.6.2
ktor_version=2.3.7
telegram_bot_api_version=10.1.1
micro_utils_version=0.20.37
serialization_version=1.6.3
ktor_version=2.3.8

View File

@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip