Skip to content

Commands

Nick DeGruccio edited this page May 1, 2023 · 12 revisions

Generic Details

When it comes to commands with Impactor, 99% of the code you will write will be based entirely on the Cloud Command Framework, with documentation available widely here. These documents will show you the workflow required to create a command with Cloud and Impactor.

Where Impactor Comes In

Impactor is specifically useful if you want to avoid the work of creating your own source type, which cloud requires a means of translating between your type and the native platform source type forwards and backwards. If you use Impactor to wrap around Cloud, versus using Cloud directly, you will make use of the CommandSource. Additionally, you'll want to create a command manager via ImpactorCommandManager. This will create a manager already equipped to process commands using the CommandSource interface, and will allow you to configure details such as a help menu.

From there, you simply need to maintain your command manager, which holds a delegate to the internal Cloud Command Manager. You'll then want to make use of this to register commands accordingly. Whether you opt for an annotation processor or registration via command builders, the choice from there is yours.

Should you need examples of how to create annoation based commands for the annotation processor option, see EconomyCommands from Impactor itself.

Clone this wiki locally