mirror of
https://github.com/InsanusMokrassar/PlaguBot.git
synced 2025-12-05 22:06:02 +00:00
Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d78f8adbea | |||
| 487ce413f1 | |||
| 556ded1e84 | |||
| 605fb956a4 | |||
| b907f8d53b | |||
| 2a0cd5d6a8 | |||
| 00f3485959 | |||
| 856ae65fa8 | |||
| d9488f8ccd | |||
| 2f06a65cc6 | |||
| f3e6b55861 | |||
| 7bdb525f01 | |||
| e6a2add7f8 | |||
| 3d7cb28c92 | |||
| 81a1ed6613 | |||
| b43efb4255 | |||
| 8d3d9f8c6a | |||
| 6cb241642b | |||
| f551f471d9 |
52
CHANGELOG.md
52
CHANGELOG.md
@@ -1,5 +1,57 @@
|
||||
# Changelog
|
||||
|
||||
## 10.3.1
|
||||
|
||||
* `Versions`:
|
||||
* `kotlin`: `2.1.10`
|
||||
* `serialization`: `1.8.0`
|
||||
* `coroutines`: `1.10.1`
|
||||
* `microutils`: `0.24.5`
|
||||
* `tgbotapi`: `23.1.2`
|
||||
* `exposed`: `0.58.0`
|
||||
* `sqlite`: `3.48.0.0`
|
||||
* `koin`: `4.0.2`
|
||||
|
||||
## 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`:
|
||||
* `kotlin`: `2.0.21`
|
||||
* `serialization`: `1.7.3`
|
||||
* `coroutines`: `1.9.0`
|
||||
* `microutils`: `0.23.0`
|
||||
* `tgbotapi`: `20.0.0`
|
||||
* `exposed`: `0.55.0`
|
||||
* `sqlite`: `3.47.0.0`
|
||||
* `koin`: `4.0.0`
|
||||
|
||||
## 10.0.0
|
||||
|
||||
**OVERALL LOGIC OF PLAGUBOT INITIALIZATION AND WORK HAS BEEN CHANGED**
|
||||
|
||||
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.0.0
|
||||
version=10.3.1
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
[versions]
|
||||
|
||||
kt = "2.0.20"
|
||||
kt-serialization = "1.7.2"
|
||||
kt-coroutines = "1.8.1"
|
||||
kt = "2.1.10"
|
||||
kt-serialization = "1.8.0"
|
||||
kt-coroutines = "1.10.1"
|
||||
|
||||
microutils = "0.22.2"
|
||||
tgbotapi = "18.1.0"
|
||||
microutils = "0.24.5"
|
||||
tgbotapi = "23.1.2"
|
||||
|
||||
ksp = "2.0.20-1.0.24"
|
||||
ksp = "2.1.10-1.0.29"
|
||||
|
||||
jb-exposed = "0.54.0"
|
||||
jb-dokka = "1.9.20"
|
||||
jb-exposed = "0.58.0"
|
||||
jb-dokka = "2.0.0"
|
||||
|
||||
sqlite = "3.46.1.0"
|
||||
sqlite = "3.48.0.0"
|
||||
|
||||
gh-release = "2.5.2"
|
||||
|
||||
koin = "3.5.6"
|
||||
koin = "4.0.2"
|
||||
|
||||
[libraries]
|
||||
|
||||
|
||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
Reference in New Issue
Block a user