mirror of
https://github.com/InsanusMokrassar/PlaguBot.git
synced 2025-09-16 13:59:26 +00:00
0.4.0
This commit is contained in:
@@ -5,18 +5,6 @@ import kotlinx.coroutines.*
|
||||
import kotlinx.serialization.InternalSerializationApi
|
||||
import java.io.File
|
||||
|
||||
@Deprecated(
|
||||
"This method is redundant due to new class PlaguBot",
|
||||
ReplaceWith(
|
||||
"PlaguBot(config).start(scope)",
|
||||
"dev.inmo.plagubot.PlaguBot"
|
||||
)
|
||||
)
|
||||
suspend inline fun initPlaguBot(
|
||||
config: Config,
|
||||
scope: CoroutineScope = CoroutineScope(Dispatchers.Default)
|
||||
): Job = PlaguBot(config).start(scope)
|
||||
|
||||
/**
|
||||
* This method by default expects one argument in [args] field: path to config
|
||||
*/
|
||||
|
@@ -4,8 +4,7 @@ import dev.inmo.micro_utils.coroutines.safelyWithoutExceptions
|
||||
import dev.inmo.plagubot.config.*
|
||||
import dev.inmo.tgbotapi.bot.Ktor.telegramBot
|
||||
import dev.inmo.tgbotapi.extensions.api.bot.setMyCommands
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.buildBehaviour
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.*
|
||||
import dev.inmo.tgbotapi.types.BotCommand
|
||||
import dev.inmo.tgbotapi.types.botCommandsLimit
|
||||
import kotlinx.coroutines.*
|
||||
@@ -50,7 +49,7 @@ data class PlaguBot(
|
||||
*/
|
||||
suspend fun start(
|
||||
scope: CoroutineScope = CoroutineScope(Dispatchers.Default)
|
||||
): Job = bot.buildBehaviour(scope) {
|
||||
): Job = bot.buildBehaviourWithLongPolling(scope) {
|
||||
invoke(database, paramsMap)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user