How can i get registered Command JSON data?
like applicationBuilder.toJSON()?
Solution
Alright, so getting the command JSON in Sapphire is pretty simple.
There isn't one big
Basically, in your command file, you create a method that just returns its own JSON. You can call it
In your command file:
Then, in your
In your
And that's it. Now you have an array with all your command JSON data.
There isn't one big
toJSON() method for everything. The trick is to just make one yourself on each command.Basically, in your command file, you create a method that just returns its own JSON. You can call it
toJSON or whatever you want.In your command file:
Then, in your
ready event, you just loop through all your commands and call that method you made.In your
ready event:And that's it. Now you have an array with all your command JSON data.