helper fixes

This commit is contained in:
Erik 2022-01-15 19:47:12 +02:00
parent dd941193f6
commit 08e7eaea73
No known key found for this signature in database
GPG Key ID: FEFF4B220DDF5589

View File

@ -153,11 +153,19 @@ class InteractionWrapper {
get subcommand() { get subcommand() {
const [data] = this.options.data; const [data] = this.options.data;
if (data.type === 'SUB_COMMAND') return data; if (!data) return null;
else if (data.type === 'SUB_COMMAND') return data;
else if (data.type === 'SUB_COMMAND_GROUP') return data.options[0]; else if (data.type === 'SUB_COMMAND_GROUP') return data.options[0];
return null; return null;
} }
get subcommandGroup() {
const [data] = this.options.data;
if (!data) return null;
else if (data.type === 'SUB_COMMAND_GROUP') return data;
return null;
}
/** /**
* Recursively gets the actual subcommands * Recursively gets the actual subcommands
* @private * @private