[!TIP]
This PR is a part of new system to allow changing commands while bot is active (see #4)
Overview
Interactor
A new way to register commands, which supports creating, updating and deleting commands using InteractorComponents.
Main usage still the same for creating commands, call this method:
If you need to clear unknown commands that Discord registered for bot, but bot doesn't know anymore about them, call:
Future<void> forgetUnknown()
[!WARNING]
This method will remove all components that are not registered in Interactor,
so this methods should be called after all components are registered
All other methods remains the same.
InteractorComponent
New way to build commands. Main way to handle commands remains the same, the only exception — all methods now can be async.
Example of creating new command (slash or message):
Overview
Interactor
A new way to register commands, which supports creating, updating and deleting commands using
InteractorComponent
s. Main usage still the same for creating commands, call this method:or to register multiple commands at once:
New API
If you need to clear unknown commands that Discord registered for bot, but bot doesn't know anymore about them, call:
All other methods remains the same.
InteractorComponent
New way to build commands. Main way to handle commands remains the same, the only exception — all methods now can be async.
Example of creating new command (slash or message):
See code documentation for more.
Other changes
CommandHandler
(use Interactor),LFGBotCore
(use services.bot)Dependencies
toServices