CommandsAPI: Fix spread overwriting omitted subcommand options (#3057)

This commit is contained in:
Etorix 2024-12-02 18:13:27 -08:00 committed by GitHub
parent 3f61fe722d
commit dd87f360d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -110,6 +110,7 @@ function registerSubCommands(cmd: Command, plugin: string) {
const subCmd = { const subCmd = {
...cmd, ...cmd,
...o, ...o,
options: o.options !== undefined ? o.options : undefined,
type: ApplicationCommandType.CHAT_INPUT, type: ApplicationCommandType.CHAT_INPUT,
name: `${cmd.name} ${o.name}`, name: `${cmd.name} ${o.name}`,
id: `${o.name}-${cmd.id}`, id: `${o.name}-${cmd.id}`,