complete sample with native

This commit is contained in:
2023-04-19 20:20:11 +06:00
parent 7b996fe1de
commit c6019b1862
15 changed files with 100 additions and 158 deletions

View File

@@ -15,11 +15,7 @@ suspend fun activateResenderBot(
token: String,
print: (Any) -> Unit
) {
val bot = telegramBot(token)
print(bot.getMe())
bot.buildBehaviourWithLongPolling(CoroutineScope(currentCoroutineContext() + SupervisorJob())) {
telegramBotWithBehaviourAndLongPolling(token, scope = CoroutineScope(currentCoroutineContext() + SupervisorJob())) {
onContentMessage(
subcontextUpdatesFilter = MessageFilterByChat,
) {
@@ -43,5 +39,6 @@ suspend fun activateResenderBot(
allUpdatesFlow.subscribeSafelyWithoutExceptions(this) {
println(it)
}
}.join()
print(bot.getMe())
}.second.join()
}