11package org .togetherjava .tjbot .commands ;
22
33import net .dv8tion .jda .api .entities .Emoji ;
4- import net .dv8tion .jda .api .events .interaction .ButtonClickEvent ;
5- import net .dv8tion .jda .api .events .interaction .SelectionMenuEvent ;
6- import net .dv8tion .jda .api .events .interaction .SlashCommandEvent ;
4+ import net .dv8tion .jda .api .events .interaction .command . SlashCommandInteractionEvent ;
5+ import net .dv8tion .jda .api .events .interaction .component . ButtonInteractionEvent ;
6+ import net .dv8tion .jda .api .events .interaction .component . SelectMenuInteractionEvent ;
77import net .dv8tion .jda .api .interactions .commands .build .CommandData ;
8- import net .dv8tion .jda .api .interactions .components .ButtonStyle ;
8+ import net .dv8tion .jda .api .interactions .commands .build .Commands ;
9+ import net .dv8tion .jda .api .interactions .commands .build .SlashCommandData ;
910import net .dv8tion .jda .api .interactions .components .ComponentInteraction ;
11+ import net .dv8tion .jda .api .interactions .components .buttons .ButtonStyle ;
1012import org .jetbrains .annotations .NotNull ;
1113import org .togetherjava .tjbot .commands .componentids .ComponentId ;
1214import org .togetherjava .tjbot .commands .componentids .ComponentIdGenerator ;
2830 * is then to be returned by {@link #getData()} where the system will then pick it up from.
2931 * <p>
3032 * After registration, the system will notify a command whenever one of its corresponding slash
31- * commands ({@link #onSlashCommand(SlashCommandEvent )}), buttons
32- * ({@link #onButtonClick(ButtonClickEvent , List)}) or menus
33- * ({@link #onSelectionMenu(SelectionMenuEvent , List)}) have been triggered.
33+ * commands ({@link #onSlashCommand(SlashCommandInteractionEvent )}), buttons
34+ * ({@link #onButtonClick(ButtonInteractionEvent , List)}) or menus
35+ * ({@link #onSelectionMenu(SelectMenuInteractionEvent , List)}) have been triggered.
3436 * <p>
3537 * <p>
3638 * Some example commands are available in {@link org.togetherjava.tjbot.commands.basic}.
@@ -40,7 +42,7 @@ public interface SlashCommand extends Feature {
4042 /**
4143 * Gets the name of the command.
4244 * <p>
43- * Requirements for this are documented in {@link CommandData#CommandData (String, String)}.
45+ * Requirements for this are documented in {@link Commands#slash (String, String)}.
4446 * <p>
4547 * <p>
4648 * After registration of the command, the name must not change anymore.
@@ -53,7 +55,7 @@ public interface SlashCommand extends Feature {
5355 /**
5456 * Gets the description of the command.
5557 * <p>
56- * Requirements for this are documented in {@link CommandData#CommandData (String, String)}.
58+ * Requirements for this are documented in {@link Commands#slash (String, String)}.
5759 * <p>
5860 * <p>
5961 * After registration of the command, the description must not change anymore.
@@ -79,7 +81,7 @@ public interface SlashCommand extends Feature {
7981 * The data can be used to configure the settings for this command, i.e. adding options,
8082 * subcommands, menus and more.
8183 * <p>
82- * See {@link CommandData } for details on how to create and configure instances of it.
84+ * See {@link SlashCommandData } for details on how to create and configure instances of it.
8385 * <p>
8486 * <p>
8587 * This method may be called multiple times, implementations must not create new data each time
@@ -89,7 +91,7 @@ public interface SlashCommand extends Feature {
8991 * @return the command data of this command
9092 */
9193 @ NotNull
92- CommandData getData ();
94+ SlashCommandData getData ();
9395
9496 /**
9597 * Triggered by the core system when a slash command corresponding to this implementation (based
@@ -104,7 +106,7 @@ public interface SlashCommand extends Feature {
104106 * <p>
105107 * Buttons or menus have to be created with a component ID (see
106108 * {@link ComponentInteraction#getComponentId()},
107- * {@link net.dv8tion.jda.api.interactions.components.Button#of(ButtonStyle, String, Emoji)}) in
109+ * {@link net.dv8tion.jda.api.interactions.components.buttons. Button#of(ButtonStyle, String, Emoji)}) in
108110 * a very specific format, otherwise the core system will fail to identify the command that
109111 * corresponded to the button or menu click event and is unable to route it back.
110112 * <p>
@@ -115,8 +117,8 @@ public interface SlashCommand extends Feature {
115117 * given to {@link #acceptComponentIdGenerator(ComponentIdGenerator)} during system setup. The
116118 * required {@link ComponentId} instance accepts optional extra arguments, which, if provided,
117119 * can be picked up during the corresponding event (see
118- * {@link #onButtonClick(ButtonClickEvent , List)},
119- * {@link #onSelectionMenu(SelectionMenuEvent , List)}).
120+ * {@link #onButtonClick(ButtonInteractionEvent , List)},
121+ * {@link #onSelectionMenu(SelectMenuInteractionEvent , List)}).
120122 * <p>
121123 * Alternatively, if {@link SlashCommandAdapter} has been extended, it also offers a handy
122124 * {@link SlashCommandAdapter#generateComponentId(String...)} method to ease the flow.
@@ -129,7 +131,7 @@ public interface SlashCommand extends Feature {
129131 *
130132 * @param event the event that triggered this
131133 */
132- void onSlashCommand (@ NotNull SlashCommandEvent event );
134+ void onSlashCommand (@ NotNull SlashCommandInteractionEvent event );
133135
134136 /**
135137 * Triggered by the core system when a button corresponding to this implementation (based on
@@ -147,9 +149,9 @@ public interface SlashCommand extends Feature {
147149 *
148150 * @param event the event that triggered this
149151 * @param args the arguments transported with the button, see
150- * {@link #onSlashCommand(SlashCommandEvent )} for details on how these are created
152+ * {@link #onSlashCommand(SlashCommandInteractionEvent )} for details on how these are created
151153 */
152- void onButtonClick (@ NotNull ButtonClickEvent event , @ NotNull List <String > args );
154+ void onButtonClick (@ NotNull ButtonInteractionEvent event , @ NotNull List <String > args );
153155
154156 /**
155157 * Triggered by the core system when a selection menu corresponding to this implementation
@@ -167,17 +169,17 @@ public interface SlashCommand extends Feature {
167169 *
168170 * @param event the event that triggered this
169171 * @param args the arguments transported with the selection menu, see
170- * {@link #onSlashCommand(SlashCommandEvent )} for details on how these are created
172+ * {@link #onSlashCommand(SlashCommandInteractionEvent )} for details on how these are created
171173 */
172- void onSelectionMenu (@ NotNull SelectionMenuEvent event , @ NotNull List <String > args );
174+ void onSelectionMenu (@ NotNull SelectMenuInteractionEvent event , @ NotNull List <String > args );
173175
174176 /**
175177 * Triggered by the core system during its setup phase. It will provide the command a component
176178 * id generator through this method, which can be used to generate component ids, as used for
177- * button or selection menus. See {@link #onSlashCommand(SlashCommandEvent )} for details on how
179+ * button or selection menus. See {@link #onSlashCommand(SlashCommandInteractionEvent )} for details on how
178180 * to use this.
179181 *
180182 * @param generator the provided component id generator
181183 */
182184 void acceptComponentIdGenerator (@ NotNull ComponentIdGenerator generator );
183- }
185+ }
0 commit comments