Skip to content

Commit

Permalink
bump commons
Browse files Browse the repository at this point in the history
  • Loading branch information
centralhardware committed Oct 12, 2024
1 parent 973fff5 commit cf72d59
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repositories {

dependencies {
implementation("dev.inmo:tgbotapi:18.2.1")
implementation("com.github.centralhardware:telegram-bot-commons:9f6c59be9c")
implementation("com.github.centralhardware:telegram-bot-commons:d8a870a5b2")
implementation("com.github.seratch:kotliquery:1.9.0")
}

Expand Down
14 changes: 2 additions & 12 deletions src/main/kotlin/Main.kt
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
import dev.inmo.kslog.common.KSLog
import dev.inmo.kslog.common.configure
import dev.inmo.kslog.common.info
import dev.inmo.tgbotapi.HealthCheck
import dev.inmo.tgbotapi.KSLogExceptionsHandler
import dev.inmo.tgbotapi.botToken
import dev.inmo.tgbotapi.extensions.api.answers.answer
import dev.inmo.tgbotapi.extensions.api.answers.answerInlineQuery
import dev.inmo.tgbotapi.extensions.behaviour_builder.telegramBotWithBehaviourAndLongPolling
import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.onAnyInlineQuery
import dev.inmo.tgbotapi.longPolling
import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultArticle
import dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputTextMessageContent
import dev.inmo.tgbotapi.types.InlineQueryId
import dev.inmo.tgbotapi.types.LinkPreviewOptions
import dev.inmo.tgbotapi.types.message.HTML
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import java.net.URLEncoder
import java.nio.charset.StandardCharsets
import java.util.concurrent.atomic.AtomicInteger
Expand Down Expand Up @@ -60,12 +55,7 @@ private fun getArticle(

suspend fun main() {
KSLog.configure("LetMeGoogleThatForYou")
telegramBotWithBehaviourAndLongPolling(
botToken,
CoroutineScope(Dispatchers.IO),
defaultExceptionsHandler = KSLogExceptionsHandler
) {
HealthCheck.addBot(this)
longPolling {
onAnyInlineQuery {
KSLog.info(it.query)
if (it.query.isBlank()) {
Expand Down

0 comments on commit cf72d59

Please sign in to comment.