File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
src/main/java/dev/tonimatas/cjda Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -61,11 +61,11 @@ public void onSlashCommandInteraction(SlashCommandInteractionEvent event) {
61
61
@ Override
62
62
public void registerCommand (SlashCommand command ) {
63
63
if (isRegistered (command )) {
64
- LOGGER .error ("Slash command {} is already registered!" , command .getCommandName ());
64
+ LOGGER .error ("Slash command {} is already registered!" , command .getName ());
65
65
return ;
66
66
}
67
67
68
- slashCommands .put (command .getCommandName (), command );
68
+ slashCommands .put (command .getName (), command );
69
69
}
70
70
71
71
@ Override
@@ -82,7 +82,7 @@ public CommandListUpdateAction init() {
82
82
List <SlashCommandData > slashCommandDataList = new ArrayList <>();
83
83
84
84
for (SlashCommand command : slashCommands .values ()) {
85
- SlashCommandData data = Commands .slash (command .getCommandName (), command .getDescription ());
85
+ SlashCommandData data = Commands .slash (command .getName (), command .getDescription ());
86
86
87
87
if (localization != null ) {
88
88
data .setLocalizationFunction (localization );
@@ -98,6 +98,6 @@ public CommandListUpdateAction init() {
98
98
}
99
99
100
100
private boolean isRegistered (SlashCommand command ) {
101
- return slashCommands .get (command .getCommandName ()) != null ;
101
+ return slashCommands .get (command .getName ()) != null ;
102
102
}
103
103
}
Original file line number Diff line number Diff line change 5
5
import net .dv8tion .jda .api .interactions .commands .SlashCommandInteraction ;
6
6
import net .dv8tion .jda .api .interactions .commands .build .SlashCommandData ;
7
7
8
- import java .util .List ;
8
+ import java .util .Set ;
9
9
10
10
/**
11
11
* Slash command interface for CJDA.
12
12
* @author TonimatasDEV
13
13
*/
14
14
public interface SlashCommand {
15
15
/**
16
- * It is called when a slash command with the {@link SlashCommand#getCommandName ()} is executed in Discord.
16
+ * It is called when a slash command with the {@link SlashCommand#getName ()} is executed in Discord.
17
17
*
18
18
* @param interaction The slash command interaction that contains important information
19
19
*/
@@ -36,7 +36,7 @@ default SlashCommandData init(SlashCommandData data) {
36
36
*
37
37
* @return The command name
38
38
*/
39
- String getCommandName ();
39
+ String getName ();
40
40
41
41
/**
42
42
* Used to add a default command description {@link SlashCommandData#setDescription(String)}.
@@ -51,5 +51,5 @@ default SlashCommandData init(SlashCommandData data) {
51
51
*
52
52
* @return The command contexts
53
53
*/
54
- List <InteractionContextType > getContexts ();
54
+ Set <InteractionContextType > getContexts ();
55
55
}
You can’t perform that action at this time.
0 commit comments