@@ -8,7 +8,7 @@ export class Util {
8
8
9
9
const check = options => {
10
10
for ( const option of options ) {
11
- if ( [ 1 , 2 ] . includes ( option . type ) ) args . push ( option . name ) ;
11
+ if ( Util . checkIfSubOrGroup ( option . type ) ) args . push ( option . name ) ;
12
12
else args . push ( option . value ) ;
13
13
14
14
if ( option . options ) check ( option . options ) ;
@@ -29,7 +29,7 @@ export class Util {
29
29
30
30
const check = ( options , object ) => {
31
31
for ( const option of options ) {
32
- if ( [ 1 , 2 ] . includes ( option . type ) ) object [ option . name ] = { } ;
32
+ if ( Util . checkIfSubOrGroup ( option . type ) ) object [ option . name ] = { } ;
33
33
else object [ option . name ] = option . value ;
34
34
35
35
if ( option . options ) check ( option . options , object [ option . name ] ) ;
@@ -40,6 +40,15 @@ export class Util {
40
40
41
41
return args ;
42
42
}
43
+
44
+ /**
45
+ * @deprecated We don't support arguments in object/array
46
+ * @link https://discord.js.org/#/docs/main/stable/class/CommandInteractionOptionResolver
47
+ */
48
+ private static checkIfSubOrGroup ( type ) {
49
+ // Why? Because discord.js v14 (:
50
+ return ! ! [ 'SUB_COMMAND' , 'SUB_COMMAND_GROUP' , 'Subcommand' , 'SubcommandGroup' ] . includes ( type ) ;
51
+ }
43
52
44
53
static isClass ( input : any ) : boolean {
45
54
return (
0 commit comments