mirror of
https://github.com/InsanusMokrassar/PlaguBot.git
synced 2025-12-05 13:55:53 +00:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b907f8d53b | |||
| 2a0cd5d6a8 | |||
| 00f3485959 | |||
| 856ae65fa8 | |||
| d9488f8ccd | |||
| 2f06a65cc6 | |||
| f3e6b55861 | |||
| 7bdb525f01 | |||
| e6a2add7f8 | |||
| 3d7cb28c92 | |||
| 81a1ed6613 | |||
| b43efb4255 |
28
CHANGELOG.md
28
CHANGELOG.md
@@ -1,5 +1,33 @@
|
||||
# Changelog
|
||||
|
||||
## 10.3.0
|
||||
|
||||
* `Versions`:
|
||||
* `microutils`: `0.23.2`
|
||||
* `tgbotapi`: `22.0.0`
|
||||
* `exposed`: `0.57.0`
|
||||
|
||||
## 10.2.1
|
||||
|
||||
* `Versions`:
|
||||
* `tgbotapi`: `21.0.1`
|
||||
* `Bot`:
|
||||
* Now all `CombinedSubcontextInitialAction.SubItem`s will be taken from `Koin` to setup root `subcontextInitialAction`
|
||||
|
||||
## 10.2.0
|
||||
|
||||
* `Versions`:
|
||||
* `kotlin`: `2.1.0`
|
||||
* `microutils`: `0.23.1`
|
||||
* `tgbotapi`: `21.0.0`
|
||||
* `exposed`: `0.56.0`
|
||||
* `sqlite`: `3.47.1.0`
|
||||
|
||||
## 10.1.1
|
||||
|
||||
* `Versions`:
|
||||
* `tgbotapi`: `20.0.1`
|
||||
|
||||
## 10.1.0
|
||||
|
||||
* `Versions`:
|
||||
|
||||
15
README.md
15
README.md
@@ -19,6 +19,8 @@ That is a set of libraries for plagubots. Look at the
|
||||
|
||||
### Technical help
|
||||
|
||||
#### FSM
|
||||
|
||||
In this bot has been used variant with FSM. That means that you may use all the [Behaviour Builder with FSM](https://bookstack.inmo.dev/books/telegrambotapi/page/behaviour-builder-with-fsm) functionality. In case you wish to setup states repo, you should use the next code in the `setupDI` of your plugin:
|
||||
|
||||
```kotlin
|
||||
@@ -41,3 +43,16 @@ single<StateHandlingErrorHandler<State>> {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Subcontext initial actions
|
||||
|
||||
Bot will take all the `CombinedSubcontextInitialAction.SubItem`s from `Koin` to include it in root of
|
||||
`behaviourBuilder`. To create your own subitem:
|
||||
|
||||
```kotlin
|
||||
singleWithRandomQualifier<CombinedSubcontextInitialAction.SubItem> {
|
||||
CombinedSubcontextInitialAction.SubItem {
|
||||
// do some action or throw error to rerun on next round
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -7,6 +7,7 @@ import dev.inmo.micro_utils.fsm.common.State
|
||||
import dev.inmo.micro_utils.fsm.common.StatesManager
|
||||
import dev.inmo.micro_utils.fsm.common.managers.*
|
||||
import dev.inmo.micro_utils.koin.getAllDistinct
|
||||
import dev.inmo.micro_utils.pagination.utils.getAll
|
||||
import dev.inmo.micro_utils.startup.launcher.StartLauncherPlugin
|
||||
import dev.inmo.plagubot.config.*
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
@@ -85,7 +86,8 @@ object PlaguBot : Plugin {
|
||||
onStateHandlingErrorHandler = koin.getOrNull<StateHandlingErrorHandler<State>>() ?: { state, e ->
|
||||
logger.eS(e) { "Unable to handle state $state" }
|
||||
null
|
||||
}
|
||||
},
|
||||
subcontextInitialAction = CombinedSubcontextInitialAction(koin.getAllDistinct()).subcontextInitialAction
|
||||
) {
|
||||
logger.i("Start setup of bot part")
|
||||
behaviourContext = this
|
||||
|
||||
@@ -5,4 +5,4 @@ kotlin.js.generate.externals=true
|
||||
kotlin.incremental=true
|
||||
|
||||
group=dev.inmo
|
||||
version=10.1.0
|
||||
version=10.3.0
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
[versions]
|
||||
|
||||
kt = "2.0.21"
|
||||
kt = "2.1.0"
|
||||
kt-serialization = "1.7.3"
|
||||
kt-coroutines = "1.9.0"
|
||||
|
||||
microutils = "0.23.0"
|
||||
tgbotapi = "20.0.0"
|
||||
microutils = "0.23.2"
|
||||
tgbotapi = "22.0.0"
|
||||
|
||||
ksp = "2.0.21-1.0.26"
|
||||
ksp = "2.1.0-1.0.29"
|
||||
|
||||
jb-exposed = "0.55.0"
|
||||
jb-exposed = "0.57.0"
|
||||
jb-dokka = "1.9.20"
|
||||
|
||||
sqlite = "3.47.0.0"
|
||||
sqlite = "3.47.1.0"
|
||||
|
||||
gh-release = "2.5.2"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user