small improvement in GetMe

This commit is contained in:
InsanusMokrassar committed 2023-11-25 12:57:11 +06:00
1 parent d842dab5b8
commit e155373655
2 files changed
+9 -7

No files matched your search

+6 -4
View File
@@ -2,6 +2,7 @@ import dev.inmo.kslog.common.KSLog
import dev.inmo.kslog.common.LogLevel
import dev.inmo.kslog.common.defaultMessageFormatter
import dev.inmo.kslog.common.filter.filtered
import dev.inmo.kslog.common.setDefaultKSLog
import dev.inmo.tgbotapi.bot.ktor.telegramBot
import dev.inmo.tgbotapi.extensions.api.bot.getMe
import dev.inmo.tgbotapi.utils.DefaultKTgBotAPIKSLog
@@ -12,10 +13,11 @@ import dev.inmo.tgbotapi.utils.DefaultKTgBotAPIKSLog
suspend fun main(vararg args: String) {
val botToken = args.first()
KSLog.default = KSLog { level: LogLevel, tag: String?, message: Any, throwable: Throwable? ->
println(defaultMessageFormatter(level, tag, message, throwable))
}
setDefaultKSLog(
KSLog { level: LogLevel, tag: String?, message: Any, throwable: Throwable? ->
println(defaultMessageFormatter(level, tag, message, throwable))
}
)
val bot = telegramBot(botToken)
println(bot.getMe())