mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI-examples.git
synced 2024-11-25 19:48:49 +00:00
small improvement in GetMe
This commit is contained in:
parent
d842dab5b8
commit
e155373655
@ -2,6 +2,7 @@ import dev.inmo.kslog.common.KSLog
|
|||||||
import dev.inmo.kslog.common.LogLevel
|
import dev.inmo.kslog.common.LogLevel
|
||||||
import dev.inmo.kslog.common.defaultMessageFormatter
|
import dev.inmo.kslog.common.defaultMessageFormatter
|
||||||
import dev.inmo.kslog.common.filter.filtered
|
import dev.inmo.kslog.common.filter.filtered
|
||||||
|
import dev.inmo.kslog.common.setDefaultKSLog
|
||||||
import dev.inmo.tgbotapi.bot.ktor.telegramBot
|
import dev.inmo.tgbotapi.bot.ktor.telegramBot
|
||||||
import dev.inmo.tgbotapi.extensions.api.bot.getMe
|
import dev.inmo.tgbotapi.extensions.api.bot.getMe
|
||||||
import dev.inmo.tgbotapi.utils.DefaultKTgBotAPIKSLog
|
import dev.inmo.tgbotapi.utils.DefaultKTgBotAPIKSLog
|
||||||
@ -12,10 +13,11 @@ import dev.inmo.tgbotapi.utils.DefaultKTgBotAPIKSLog
|
|||||||
suspend fun main(vararg args: String) {
|
suspend fun main(vararg args: String) {
|
||||||
val botToken = args.first()
|
val botToken = args.first()
|
||||||
|
|
||||||
KSLog.default = KSLog { level: LogLevel, tag: String?, message: Any, throwable: Throwable? ->
|
setDefaultKSLog(
|
||||||
|
KSLog { level: LogLevel, tag: String?, message: Any, throwable: Throwable? ->
|
||||||
println(defaultMessageFormatter(level, tag, message, throwable))
|
println(defaultMessageFormatter(level, tag, message, throwable))
|
||||||
}
|
}
|
||||||
|
)
|
||||||
val bot = telegramBot(botToken)
|
val bot = telegramBot(botToken)
|
||||||
|
|
||||||
println(bot.getMe())
|
println(bot.getMe())
|
||||||
|
@ -4,8 +4,8 @@ org.gradle.parallel=true
|
|||||||
org.gradle.jvmargs=-Xmx2g
|
org.gradle.jvmargs=-Xmx2g
|
||||||
|
|
||||||
|
|
||||||
kotlin_version=1.9.20
|
kotlin_version=1.9.21
|
||||||
telegram_bot_api_version=9.4.0-branch_9.4.0-build1937
|
telegram_bot_api_version=9.4.0-branch_9.4.0-build1940
|
||||||
micro_utils_version=0.20.14
|
micro_utils_version=0.20.15
|
||||||
serialization_version=1.6.1
|
serialization_version=1.6.1
|
||||||
ktor_version=2.3.6
|
ktor_version=2.3.6
|
||||||
|
Loading…
Reference in New Issue
Block a user