Skip to content

InsanusMokrassar/PlaguBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

b907f8d · Dec 7, 2024
Dec 5, 2022
Nov 5, 2023
Nov 12, 2020
Dec 3, 2024
Dec 7, 2024
Sep 22, 2024
Nov 8, 2020
Jun 11, 2022
Dec 7, 2024
Nov 8, 2020
Dec 3, 2024
Nov 12, 2020
Dec 10, 2023
Nov 12, 2020
Apr 23, 2024
Dec 7, 2024
Nov 8, 2020
Nov 8, 2020
Aug 13, 2022
Sep 4, 2022

Repository files navigation

PlaguBot

For users

Template: Use template

You can create your bot using this template by following of its instructions

For developers

Template: Use template
Bot version: Maven Central
Plugin version: Maven Central

That is a set of libraries for plagubots. Look at the PlaguBot Plugin template to find how to create your bot.

Technical help

FSM

In this bot has been used variant with FSM. That means that you may use all the 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:

single<StatesManager<State>> {
    // setup your manager and return here
    // Default is:
    DefaultStatesManager(
        InMemoryDefaultStatesManagerRepo()
    )
}

Besides, you may setup handling errors lambda in the same function:

single<StateHandlingErrorHandler<State>> {
    { state, e ->
        logger.eS(e) { "Unable to handle state $state" } // logging by default
        null // you should return new state or null, default callback will return null
    }
}

Subcontext initial actions

Bot will take all the CombinedSubcontextInitialAction.SubItems from Koin to include it in root of behaviourBuilder. To create your own subitem:

singleWithRandomQualifier<CombinedSubcontextInitialAction.SubItem> {
    CombinedSubcontextInitialAction.SubItem {
        // do some action or throw error to rerun on next round
    }
}