11package org .togetherjava .tjbot .commands .reminder ;
22
33import net .dv8tion .jda .api .entities .Member ;
4- import net .dv8tion .jda .api .events .interaction .SlashCommandEvent ;
4+ import net .dv8tion .jda .api .events .interaction .command . SlashCommandInteractionEvent ;
55import org .jetbrains .annotations .NotNull ;
66import org .junit .jupiter .api .Assertions ;
77import org .junit .jupiter .api .BeforeEach ;
@@ -35,14 +35,14 @@ void setUp() {
3535 rawReminders = new RawReminderTestHelper (database , jdaTester );
3636 }
3737
38- private @ NotNull SlashCommandEvent triggerSlashCommand (int timeAmount , @ NotNull String timeUnit ,
39- @ NotNull String content ) {
38+ private @ NotNull SlashCommandInteractionEvent triggerSlashCommand (int timeAmount ,
39+ @ NotNull String timeUnit , @ NotNull String content ) {
4040 return triggerSlashCommand (timeAmount , timeUnit , content , jdaTester .getMemberSpy ());
4141 }
4242
43- private @ NotNull SlashCommandEvent triggerSlashCommand (int timeAmount , @ NotNull String timeUnit ,
44- @ NotNull String content , @ NotNull Member author ) {
45- SlashCommandEvent event = jdaTester .createSlashCommandEvent (command )
43+ private @ NotNull SlashCommandInteractionEvent triggerSlashCommand (int timeAmount ,
44+ @ NotNull String timeUnit , @ NotNull String content , @ NotNull Member author ) {
45+ SlashCommandInteractionEvent event = jdaTester .createSlashCommandInteractionEvent (command )
4646 .setOption (RemindCommand .TIME_AMOUNT_OPTION , timeAmount )
4747 .setOption (RemindCommand .TIME_UNIT_OPTION , timeUnit )
4848 .setOption (RemindCommand .CONTENT_OPTION , content )
@@ -70,7 +70,7 @@ void throwsWhenGivenUnsupportedUnit() {
7070 void doesNotSupportDatesTooFarInFuture () {
7171 // GIVEN
7272 // WHEN triggering /remind too far in the future
73- SlashCommandEvent event = triggerSlashCommand (10 , "years" , "foo" );
73+ SlashCommandInteractionEvent event = triggerSlashCommand (10 , "years" , "foo" );
7474
7575 // THEN rejects and responds accordingly, no reminder was created
7676 verify (event ).reply (startsWith ("The reminder is set too far in the future" ));
@@ -87,7 +87,7 @@ void userIsLimitedIfTooManyPendingReminders() {
8787 }
8888
8989 // WHEN triggering another reminder
90- SlashCommandEvent event = triggerSlashCommand (5 , "minutes" , "foo" );
90+ SlashCommandInteractionEvent event = triggerSlashCommand (5 , "minutes" , "foo" );
9191
9292 // THEN rejects and responds accordingly, no new reminder was created
9393 verify (event )
@@ -110,7 +110,7 @@ void userIsNotLimitedIfOtherUserHasTooManyPendingReminders() {
110110 Member secondUser = jdaTester .createMemberSpy (2 );
111111
112112 // WHEN the second user triggers another reminder
113- SlashCommandEvent event = triggerSlashCommand (5 , "minutes" , "foo" , secondUser );
113+ SlashCommandInteractionEvent event = triggerSlashCommand (5 , "minutes" , "foo" , secondUser );
114114
115115 // THEN accepts the reminder and responds accordingly
116116 verify (event ).reply ("Will remind you about 'foo' in 5 minutes." );
@@ -125,7 +125,7 @@ void userIsNotLimitedIfOtherUserHasTooManyPendingReminders() {
125125 void canCreateReminders () {
126126 // GIVEN
127127 // WHEN triggering the /remind command
128- SlashCommandEvent event = triggerSlashCommand (5 , "minutes" , "foo" );
128+ SlashCommandInteractionEvent event = triggerSlashCommand (5 , "minutes" , "foo" );
129129
130130 // THEN accepts the reminder and responds accordingly
131131 verify (event ).reply ("Will remind you about 'foo' in 5 minutes." );
0 commit comments