@@ -91,7 +91,7 @@ public MusicHandler getMusic(@NotNull SlashCommandInteractionEvent event, boolea
9191 // Check if user is in voice channel
9292 if (!inChannel (Objects .requireNonNull (event .getMember ()))) {
9393 String text = "Please connect to a voice channel first!" ;
94- event .getHook (). sendMessageEmbeds ( EmbedUtils .createError (text )).queue ();
94+ event .replyEmbeds ( EmbedUtils .createError (text )). setEphemeral ( true ).queue ();
9595 return null ;
9696 }
9797 // Bot should join voice channel if not already in one.
@@ -104,13 +104,13 @@ public MusicHandler getMusic(@NotNull SlashCommandInteractionEvent event, boolea
104104 if (!skipQueueCheck ) {
105105 if (settings .musicHandler == null || settings .musicHandler .getQueue ().isEmpty ()) {
106106 String text = ":sound: There are no songs in the queue!" ;
107- event .getHook (). sendMessageEmbeds (EmbedUtils .createDefault (text )).queue ();
107+ event .replyEmbeds (EmbedUtils .createDefault (text )).queue ();
108108 return null ;
109109 }
110110 // Check if member is in the right voice channel
111111 if (settings .musicHandler .getPlayChannel () != channel ) {
112112 String text = "You are not in the same voice channel as TechnoBot!" ;
113- event .getHook (). sendMessageEmbeds ( EmbedUtils .createError (text )).queue ();
113+ event .replyEmbeds ( EmbedUtils .createError (text )). setEphemeral ( true ).queue ();
114114 return null ;
115115 }
116116 }
@@ -167,7 +167,7 @@ public void addTrack(SlashCommandInteractionEvent event, String url) {
167167
168168 @ Override
169169 public void trackLoaded (@ NotNull AudioTrack audioTrack ) {
170- event .getHook (). sendMessage (":notes: | Added **" +audioTrack .getInfo ().title +"** to the queue." ).queue ();
170+ event .reply (":notes: | Added **" +audioTrack .getInfo ().title +"** to the queue." ).queue ();
171171 music .enqueue (audioTrack );
172172 }
173173
@@ -182,7 +182,7 @@ public void playlistLoaded(@NotNull AudioPlaylist audioPlaylist) {
182182 // Otherwise load first 100 tracks from playlist
183183 int total = audioPlaylist .getTracks ().size ();
184184 if (total > 100 ) total = 100 ;
185- event .getHook (). sendMessage (":notes: | Added **" +audioPlaylist .getName ()+"** with `" +total +"` songs to the queue." ).queue ();
185+ event .reply (":notes: | Added **" +audioPlaylist .getName ()+"** with `" +total +"` songs to the queue." ).queue ();
186186
187187 total = music .getQueue ().size ();
188188 for (AudioTrack track : audioPlaylist .getTracks ()) {
@@ -196,13 +196,13 @@ public void playlistLoaded(@NotNull AudioPlaylist audioPlaylist) {
196196 @ Override
197197 public void noMatches () {
198198 String msg = "That is not a valid song!" ;
199- event .getHook (). sendMessageEmbeds ( EmbedUtils .createError (msg )).queue ();
199+ event .replyEmbeds ( EmbedUtils .createError (msg )). setEphemeral ( true ).queue ();
200200 }
201201
202202 @ Override
203203 public void loadFailed (FriendlyException e ) {
204204 String msg = "That is not a valid link!" ;
205- event .getHook (). sendMessageEmbeds ( EmbedUtils .createError (msg )).queue ();
205+ event .replyEmbeds ( EmbedUtils .createError (msg )). setEphemeral ( true ).queue ();
206206 }
207207 });
208208 }
0 commit comments