Add opportunity to use config in setup bot client

This commit is contained in:
2024-09-14 20:17:38 +06:00
parent d772d275b3
commit bb06ba1ca7
3 changed files with 11 additions and 1 deletions

View File

@@ -42,9 +42,16 @@ data class PlaguBot(
token = config.botToken,
apiUrl = config.botApiServer
) {
setupBotClient()
setupBotClient(json)
}
override fun KtorRequestsExecutorBuilder.setupBotClient(params: JsonObject) {
config.botPlugins.forEach {
with(it) {
setupBotClient(params)
}
}
}
override fun KtorRequestsExecutorBuilder.setupBotClient() {
config.botPlugins.forEach {
with(it) {