mirror of
https://github.com/InsanusMokrassar/docs.git
synced 2024-11-25 11:38:59 +00:00
start add plagubot manuals
This commit is contained in:
parent
74b8b22bb7
commit
655bdf2126
49
docs/tgbotapi/plagubot/index.md
Normal file
49
docs/tgbotapi/plagubot/index.md
Normal 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
|
||||
```
|
@ -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/'
|
||||
|
Loading…
Reference in New Issue
Block a user