Skip to content

Latest commit

 

History

History
38 lines (35 loc) · 1.92 KB

feature.md

File metadata and controls

38 lines (35 loc) · 1.92 KB

Feature

What is a feature

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
Loading

FeatureDefinition

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.

FeatureDescription

Contains all the information needed to build the UI for the feature configuration.

Feature manager

Global handle of all features : enable/disable, register, CRUD, dispatch events (incoming/outgoing), etc...

When receiving an incoming message

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)
Loading