diff --git a/CHANGELOG.md b/CHANGELOG.md index 14538eb..4156d9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## 3.4.1 +* `setupBotPlugin` now works synchronously + ## 3.4.0 * `Versions`: diff --git a/bot/src/main/kotlin/dev/inmo/plagubot/PlaguBot.kt b/bot/src/main/kotlin/dev/inmo/plagubot/PlaguBot.kt index 5cec546..4b0cf7c 100644 --- a/bot/src/main/kotlin/dev/inmo/plagubot/PlaguBot.kt +++ b/bot/src/main/kotlin/dev/inmo/plagubot/PlaguBot.kt @@ -63,20 +63,18 @@ data class PlaguBot( } override suspend fun BehaviourContextWithFSM.setupBotPlugin(koin: Koin) { - config.plugins.map { plugin -> - launch { - runCatchingSafely { - logger.i("Start loading of $plugin") - with(plugin) { - setupBotPlugin(koin) - } - }.onFailure { e -> - logger.w("Unable to load bot part of $plugin", e) - }.onSuccess { - logger.i("Complete loading of $plugin") + config.plugins.forEach { plugin -> + runCatchingSafely { + logger.i("Start loading of $plugin") + with(plugin) { + setupBotPlugin(koin) } + }.onFailure { e -> + logger.w("Unable to load bot part of $plugin", e) + }.onSuccess { + logger.i("Complete loading of $plugin") } - }.joinAll() + } } /**