mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI-examples.git
synced 2025-12-27 08:29:10 +00:00
Compare commits
8 Commits
9.3.0
...
6ecbf6b0f7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6ecbf6b0f7 | ||
| b1b8d0eb75 | |||
| 2ac23f70ab | |||
| e155373655 | |||
| d842dab5b8 | |||
| 7186d5e624 | |||
|
|
8fefb17599 | ||
| bcf4ae5888 |
@@ -1,5 +1,11 @@
|
|||||||
|
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.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
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is one of the most easiest bot - it will just print information about itself
|
* This is one of the most easiest bot - it will just print information about itself
|
||||||
@@ -7,6 +13,11 @@ import dev.inmo.tgbotapi.extensions.api.bot.getMe
|
|||||||
suspend fun main(vararg args: String) {
|
suspend fun main(vararg args: String) {
|
||||||
val botToken = args.first()
|
val botToken = args.first()
|
||||||
|
|
||||||
|
setDefaultKSLog(
|
||||||
|
KSLog { level: LogLevel, tag: String?, message: Any, throwable: Throwable? ->
|
||||||
|
println(defaultMessageFormatter(level, tag, message, throwable))
|
||||||
|
}
|
||||||
|
)
|
||||||
val bot = telegramBot(botToken)
|
val bot = telegramBot(botToken)
|
||||||
|
|
||||||
println(bot.getMe())
|
println(bot.getMe())
|
||||||
|
|||||||
@@ -33,6 +33,6 @@ kotlin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'io.ktor:ktor-client-logging-jvm:2.3.0'
|
implementation 'io.ktor:ktor-client-logging-jvm:2.3.5'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,5 +18,5 @@ dependencies {
|
|||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||||
|
|
||||||
implementation "dev.inmo:tgbotapi:$telegram_bot_api_version"
|
implementation "dev.inmo:tgbotapi:$telegram_bot_api_version"
|
||||||
implementation 'io.ktor:ktor-client-logging-jvm:2.3.3'
|
implementation 'io.ktor:ktor-client-logging-jvm:2.3.5'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.3.0
|
telegram_bot_api_version=9.4.1
|
||||||
micro_utils_version=0.20.12
|
micro_utils_version=0.20.15
|
||||||
serialization_version=1.6.0
|
serialization_version=1.6.1
|
||||||
ktor_version=2.3.5
|
ktor_version=2.3.7
|
||||||
|
|||||||
Reference in New Issue
Block a user