mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI-examples.git
synced 2025-10-05 23:19:19 +00:00
complete sample with native
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
Reference in New Issue
Block a user