File tree Expand file tree Collapse file tree
src/main/java/fr/jim/services/slash Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,6 +30,8 @@ public SlashRollService() {
3030 public void roll (SlashCommandInteractionEvent event ) {
3131
3232
33+ event .deferReply ().queue ();
34+
3335 String rollOptions = event .getOption (ConstantesBot .OPTION_SLASH_ROLL_OPTIONS ).getAsString ();
3436 boolean isInvisible = event .getOption (ConstantesBot .OPTION_SLASH_ROLL_INVISIBLE ) != null ?
3537 event .getOption (ConstantesBot .OPTION_SLASH_ROLL_INVISIBLE ).getAsBoolean () : false ;
@@ -39,7 +41,7 @@ public void roll(SlashCommandInteractionEvent event) {
3941
4042
4143 if (!rollMatcher .matches ()) {
42- event .reply ("Les options ne sont pas correctes, voici quelques exemples :\n " +
44+ event .getHook (). sendMessage ("Les options ne sont pas correctes, voici quelques exemples :\n " +
4345 "/roll 1d6 2d12\n " +
4446 "/roll 6 12-1 10+2\n " +
4547 "/roll 1d6+1\n " +
@@ -51,7 +53,8 @@ public void roll(SlashCommandInteractionEvent event) {
5153
5254 if (rolls .size () > 20 ) {
5355
54- event .reply ("Nombre max de rolls : 20. Tu en as lancé " + rolls .size ()).setEphemeral (true ).queue ();
56+ event .getHook ().sendMessage ("Nombre max de rolls : 20. Tu en as lancé " + rolls .size ())
57+ .setEphemeral (true ).queue ();
5558 LOGGER .info ("Trop de rolls : " + rolls .size ());
5659 return ;
5760 }
@@ -222,7 +225,7 @@ public void roll(SlashCommandInteractionEvent event) {
222225
223226 }
224227
225- event .reply (sb .toString ()).setEphemeral (isInvisible ).queue ();
228+ event .getHook (). sendMessage (sb .toString ()).setEphemeral (isInvisible ).queue ();
226229
227230 }
228231
You can’t perform that action at this time.
0 commit comments