Skip to content

How to add new commands

LeNDuyA edited this page Oct 22, 2025 · 1 revision
---
title: Commands architecture
---
classDiagram
    class DiscordBot {
    }
    
    class WavuFeature {
        <<RegisteredFeature>>
        +command1() --> Function1
        +command2() --> Function2
        +command3() --> Function3
    }
    
    class WavuWiki {
    }
    
    class Function1 {
    }
    
    class Function2 {
    }
    
    class Function3 {
    }
    
    DiscordBot "1" --> "*" WavuFeature: uses
    
    WavuWiki ..|> WavuFeature: implements
    
    WavuWiki --> Function1
    WavuWiki --> Function2
    WavuWiki --> Function3
    
    style DiscordBot fill:#3B82F6,stroke:#2563EB,color:#fff
    style WavuFeature fill:#F59E0B,stroke:#D97706,color:#fff
    style WavuWiki fill:#10B981,stroke:#059669,color:#fff
    style Function1 fill:#A7F3D0,stroke:#10B981,color:#000
    style Function2 fill:#A7F3D0,stroke:#10B981,color:#000
    style Function3 fill:#A7F3D0,stroke:#10B981,color:#000
Loading
  1. feature/relevantModule/ - add the new function in the interface and implement it
  2. relevantClient/usecase - create a new usecase that calls the new function
  3. relevantClient/featureRegistry/ - register the command
    1. featureRegistry/Command - add your command
    2. featureRegistry/RelevantFeature
      1. slashCommands: List<SlashCommand> - add a new SlashCommand for your command
      2. execute() - add your command into the when block and call the new usecase

See THIS commit as an example.

Clone this wiki locally