From 21ec50c7733bc324be2fd8fc79d4a0fdb4e416d9 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 8 Sep 2024 15:53:46 +0600 Subject: [PATCH] add opportunity to use test server in custom bot --- CustomBot/src/main/kotlin/CustomBot.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CustomBot/src/main/kotlin/CustomBot.kt b/CustomBot/src/main/kotlin/CustomBot.kt index dc7d7b2..b82582c 100644 --- a/CustomBot/src/main/kotlin/CustomBot.kt +++ b/CustomBot/src/main/kotlin/CustomBot.kt @@ -15,6 +15,7 @@ suspend fun main(vararg args: String) { val botToken = args.first() val isDebug = args.any { it == "debug" } + val isTestServer = args.any { it == "testServer" } if (isDebug) { setDefaultKSLog( @@ -24,11 +25,13 @@ suspend fun main(vararg args: String) { ) } - telegramBotWithBehaviourAndLongPolling(botToken, CoroutineScope(Dispatchers.IO)) { + telegramBotWithBehaviourAndLongPolling(botToken, CoroutineScope(Dispatchers.IO), testServer = isTestServer) { // start here!! val me = getMe() println(me) - allUpdatesFlow.subscribeSafelyWithoutExceptions(this) { println(it) } + allUpdatesFlow.subscribeSafelyWithoutExceptions(this) { + println(it) + } }.second.join() }