From 08e7eaea7385004a833a9918bfc7ca750cc90c21 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Sat, 15 Jan 2022 19:47:12 +0200 Subject: [PATCH] helper fixes --- src/structure/client/wrappers/InteractionWrapper.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/structure/client/wrappers/InteractionWrapper.js b/src/structure/client/wrappers/InteractionWrapper.js index ad5da32..ed1d46e 100644 --- a/src/structure/client/wrappers/InteractionWrapper.js +++ b/src/structure/client/wrappers/InteractionWrapper.js @@ -153,11 +153,19 @@ class InteractionWrapper { get subcommand() { 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]; 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 * @private