A feature is a group of event handler, possibly with somes states, which provides a coherent behavior for the user. It is the main abstraction of the bot, and is the main way to extend the bot.
flowchart LR
FeatureDefinition --> FeatureRuntime
FeatureRuntime --> EventHandler
FeatureRuntime --> State
FeatureConfiguration --> FeatureDefinition
FeatureConfiguration --> FeatureDescription
Base interface for all features. It is used to register the feature in the bot.
Used in two ways :
- A feature configurable via the code. Can be registered only when the bot is starting via bot constructor
- A feature configurable at run time, via the features manager.
It contains all the states and the event handlers. It is the class which is used by the bot to handle the incoming messages.
A serializable version of feature definition hich contains all the information needed to build the definition.
Contains all the information needed to build the UI for the feature configuration.
Global handle of all features : enable/disable, register, CRUD, dispatch events (incoming/outgoing), etc...
sequenceDiagram
bot ->> feature manager: incoming message
feature manager ->> feature: check if feature is enabled
feature -->> feature manager: true
feature manager ->> feature: handle message(incoming message)
feature ->> feature: find handler and states
feature ->> event Handler: handle message(message, states)