mirror of
https://github.com/InsanusMokrassar/PlaguBot.git
synced 2024-12-22 14:07:12 +00:00
setupBotPlugin now works synchronously
This commit is contained in:
parent
328a8b215c
commit
3592a5907c
@ -2,6 +2,8 @@
|
||||
|
||||
## 3.4.1
|
||||
|
||||
* `setupBotPlugin` now works synchronously
|
||||
|
||||
## 3.4.0
|
||||
|
||||
* `Versions`:
|
||||
|
@ -63,20 +63,18 @@ data class PlaguBot(
|
||||
}
|
||||
|
||||
override suspend fun BehaviourContextWithFSM<State>.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()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user