@@ -3,7 +3,7 @@ import { mix } from 'ts-mixer';
3
3
import { assertReturnOfBuilder , validateMaxOptionsLength , validateRequiredParameters } from './Assertions' ;
4
4
import { SharedNameAndDescription } from './mixins/NameAndDescription' ;
5
5
import { SharedSlashCommandOptions } from './mixins/CommandOptions' ;
6
- import { SlashCommandSubCommandBuilder , SlashCommandSubCommandGroupBuilder } from './SlashCommandSubCommands ' ;
6
+ import { SlashCommandSubcommandBuilder , SlashCommandSubcommandGroupBuilder } from './SlashCommandSubcommands ' ;
7
7
8
8
@mix ( SharedSlashCommandOptions , SharedNameAndDescription )
9
9
export class SlashCommandBuilder {
@@ -37,27 +37,27 @@ export class SlashCommandBuilder {
37
37
}
38
38
39
39
/**
40
- * Adds a new sub command group to this command
41
- * @param input A function that returns a sub command group builder, or an already built builder
40
+ * Adds a new subcommand group to this command
41
+ * @param input A function that returns a subcommand group builder, or an already built builder
42
42
*/
43
- public addSubCommandGroup (
43
+ public addSubcommandGroup (
44
44
input :
45
- | SlashCommandSubCommandGroupBuilder
46
- | ( ( subCommandGroup : SlashCommandSubCommandGroupBuilder ) => SlashCommandSubCommandGroupBuilder ) ,
47
- ) : SlashCommandSubCommandGroupsOnlyBuilder {
45
+ | SlashCommandSubcommandGroupBuilder
46
+ | ( ( subcommandGroup : SlashCommandSubcommandGroupBuilder ) => SlashCommandSubcommandGroupBuilder ) ,
47
+ ) : SlashCommandSubcommandGroupsOnlyBuilder {
48
48
const { options } = this ;
49
49
50
50
// First, assert options conditions - we cannot have more than 25 options
51
51
validateMaxOptionsLength ( options ) ;
52
52
53
- // Make sure there is no sub command at the root level - if there is, throw
54
- const hasSubCommands = options . some ( ( item ) => item instanceof SlashCommandSubCommandBuilder ) ;
55
- if ( hasSubCommands ) throw new RangeError ( `You cannot mix sub commands and sub command groups at the root level.` ) ;
53
+ // Make sure there is no subcommand at the root level - if there is, throw
54
+ const hasSubcommands = options . some ( ( item ) => item instanceof SlashCommandSubcommandBuilder ) ;
55
+ if ( hasSubcommands ) throw new RangeError ( `You cannot mix subcommands and subcommand groups at the root level.` ) ;
56
56
57
57
// Get the final result
58
- const result = typeof input === 'function' ? input ( new SlashCommandSubCommandGroupBuilder ( ) ) : input ;
58
+ const result = typeof input === 'function' ? input ( new SlashCommandSubcommandGroupBuilder ( ) ) : input ;
59
59
60
- assertReturnOfBuilder ( result , SlashCommandSubCommandGroupBuilder ) ;
60
+ assertReturnOfBuilder ( result , SlashCommandSubcommandGroupBuilder ) ;
61
61
62
62
// Push it
63
63
options . push ( result ) ;
@@ -66,28 +66,28 @@ export class SlashCommandBuilder {
66
66
}
67
67
68
68
/**
69
- * Adds a new sub command to this command
70
- * @param input A function that returns a sub command builder, or an already built builder
69
+ * Adds a new subcommand to this command
70
+ * @param input A function that returns a subcommand builder, or an already built builder
71
71
*/
72
- public addSubCommand (
72
+ public addSubcommand (
73
73
input :
74
- | SlashCommandSubCommandBuilder
75
- | ( ( subCommandGroup : SlashCommandSubCommandBuilder ) => SlashCommandSubCommandBuilder ) ,
76
- ) : SlashCommandSubCommandsOnlyBuilder {
74
+ | SlashCommandSubcommandBuilder
75
+ | ( ( subcommandGroup : SlashCommandSubcommandBuilder ) => SlashCommandSubcommandBuilder ) ,
76
+ ) : SlashCommandSubcommandsOnlyBuilder {
77
77
const { options } = this ;
78
78
79
79
// First, assert options conditions - we cannot have more than 25 options
80
80
validateMaxOptionsLength ( options ) ;
81
81
82
- // Make sure there is no sub command at the root level - if there is, throw
83
- const hasSubCommandGroups = options . some ( ( item ) => item instanceof SlashCommandSubCommandGroupBuilder ) ;
84
- if ( hasSubCommandGroups )
85
- throw new RangeError ( `You cannot mix sub commands and sub command groups at the root level.` ) ;
82
+ // Make sure there is no subcommand at the root level - if there is, throw
83
+ const hasSubcommandGroups = options . some ( ( item ) => item instanceof SlashCommandSubcommandGroupBuilder ) ;
84
+ if ( hasSubcommandGroups )
85
+ throw new RangeError ( `You cannot mix subcommands and subcommand groups at the root level.` ) ;
86
86
87
87
// Get the final result
88
- const result = typeof input === 'function' ? input ( new SlashCommandSubCommandBuilder ( ) ) : input ;
88
+ const result = typeof input === 'function' ? input ( new SlashCommandSubcommandBuilder ( ) ) : input ;
89
89
90
- assertReturnOfBuilder ( result , SlashCommandSubCommandBuilder ) ;
90
+ assertReturnOfBuilder ( result , SlashCommandSubcommandBuilder ) ;
91
91
92
92
// Push it
93
93
options . push ( result ) ;
@@ -98,13 +98,13 @@ export class SlashCommandBuilder {
98
98
99
99
export interface SlashCommandBuilder extends SharedNameAndDescription , SharedSlashCommandOptions { }
100
100
101
- export interface SlashCommandSubCommandsOnlyBuilder
101
+ export interface SlashCommandSubcommandsOnlyBuilder
102
102
extends SharedNameAndDescription ,
103
- Pick < SlashCommandBuilder , 'toJSON' | 'addSubCommand ' > { }
103
+ Pick < SlashCommandBuilder , 'toJSON' | 'addSubcommand ' > { }
104
104
105
- export interface SlashCommandSubCommandGroupsOnlyBuilder
105
+ export interface SlashCommandSubcommandGroupsOnlyBuilder
106
106
extends SharedNameAndDescription ,
107
- Pick < SlashCommandBuilder , 'toJSON' | 'addSubCommandGroup ' > { }
107
+ Pick < SlashCommandBuilder , 'toJSON' | 'addSubcommandGroup ' > { }
108
108
109
109
export interface SlashCommandOptionsOnlyBuilder
110
110
extends SharedNameAndDescription ,
0 commit comments