Package dev.inmo.plagubot.plugins.commands

Types

Link copied to clipboard
data class BotCommandFullInfo(val key: CommandsKeeperKey, val command: BotCommand)

Full info about the command its key and the command itself

Link copied to clipboard
class CommandsKeeper(preset: List<BotCommandFullInfo> = emptyList())

In memory commands keeper. Contains all the registered commands inside and can be useful in case you wish to addCommand or removeCommand

Link copied to clipboard
value class CommandsKeeperKey(val key: Pair<BotCommandScope, String?>)

Full info about the command scope including BotCommandScope and its optional language code (see languageCode and languageCodeIetf)

Link copied to clipboard
object CommandsPlugin : Plugin

This plugin has been created for centralized work with commands in context of Plugins system of plagubot. Pass BotCommandFullInfo in your Plugin.setupDI section to declare some command. You may use CommandsKeeper for flexible setup of commands in runtime.

Functions

Link copied to clipboard
fun BotCommand.full(languageCode: IetfLanguageCode): BotCommandFullInfo
fun BotCommand.full(key: CommandsKeeperKey = CommandsKeeperKey.DEFAULT): BotCommandFullInfo
fun BotCommand.full(scope: BotCommandScope): BotCommandFullInfo
fun BotCommand.full(languageCode: String): BotCommandFullInfo
fun BotCommand.full(scope: BotCommandScope, languageCode: IetfLanguageCode): BotCommandFullInfo
fun BotCommand.full(scope: BotCommandScope, languageCode: String): BotCommandFullInfo

Properties

Link copied to clipboard
val Scope.commandsKeeper: CommandsKeeper
val Koin.commandsKeeper: CommandsKeeper