start add plagubot manuals

This commit is contained in:
InsanusMokrassar 2023-09-30 13:02:08 +06:00
parent 74b8b22bb7
commit 655bdf2126
2 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,49 @@
# PlaguBot
[PlaguBot](https://github.com/InsanusMokrassar/PlaguBot) is a small framework for unifying developing of modules of bots. It is built with two parts:
* [Plugin](https://github.com/InsanusMokrassar/PlaguBot/blob/master/plugin/src/main/kotlin/dev/inmo/plagubot/Plugin.kt)
* [Bot](https://github.com/InsanusMokrassar/PlaguBot/tree/master/bot/src/main/kotlin/dev/inmo/plagubot)
## Plugin
Plugin is a partially independent part of bot. Plugin have several parts:
* `setupDI` - this method should be used to configure DI part of module
* `setupBotPlugin` - method to start/configure your bot actions
Plugin realization should be an `object` or `class` with empty constructor.
## Bot
Most important of bot is `main` function (full reference: `dev.inmo.plagubot.AppKt`). It consumes one argument - path to config.
Bot is initializing with the next algorithm:
```mermaid
flowchart TB
main["Main"]
subgraph ConfigReading
ConfigJsonParsing["Parsing to Json"]
ConfigParsing["Parsing to global config"]
ConfigJsonParsing --> ConfigParsing
end
ConfigReading["Reading of config"]
BotConstructorCalling["Calling of PlaguBot constructor"]
subgraph BotStart
BotStartKoinAppInit["Initialization of koin app"]
subgraph BotStartSetupDI
sample
end
BotStartKoinAppInit --> BotStartSetupDI
end
main --> ConfigReading
ConfigReading --> BotConstructorCalling
BotConstructorCalling --> BotStart
```

View File

@ -28,6 +28,8 @@ nav:
- 'tgbotapi/updates/heroku.md'
- Logic handling: 'tgbotapi/logic/'
- DSLs: 'tgbotapi/dsls/'
- PlaguBot (TBD):
- 'tgbotapi/plagubot/'
- 'Krontab':
- 'krontab/index.md'
- KDocs: 'https://krontab.inmo.dev/'