Using JSON to register application commands and add options
Hi there,
Is there a way to add all of my application command options in the
registerApplicationCommands
method on the Command
class without using builders?
For example, a registerApplicationCommands method might look like this currently, to register options:
---
My use case is that I have a constant array of settings I'd like the user to be able to configure, and it would be nice if I could do something like automatically add a non-required slash command option for each setting. Then the command could look something like /settings set setting1 setting2 setting3 ...
Solution:Jump to solution
Builders serialise to JSON and you can also provide that same JSON.
```ts
// Registering with the discord.js options object...
3 Replies