Skip to content

Commit 6d445ae

Browse files
committed
fix: responses
1 parent 93ce6a8 commit 6d445ae

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

DisCatSharp.Extensions.SimpleMusicCommands/Commands/MusicCommands.cs

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public async Task DisconnectAsync(InteractionContext ctx)
9090
[SlashCommand("pause", "Pauses the playback")]
9191
public async Task PauseAsync(InteractionContext ctx)
9292
{
93-
await ctx.CreateResponseAsync(InteractionResponseType.ChannelMessageWithSource, new DiscordInteractionResponseBuilder().AsEphemeral().WithContent("Please wait.."));
93+
await ctx.CreateResponseAsync(InteractionResponseType.ChannelMessageWithSource, new DiscordInteractionResponseBuilder().AsEphemeral().WithContent("Pausing.."));
9494
try
9595
{
9696
ArgumentNullException.ThrowIfNull(ctx.Guild);
@@ -112,7 +112,7 @@ public async Task PauseAsync(InteractionContext ctx)
112112
[SlashCommand("resume", "Resumes the playback")]
113113
public async Task ResumeAsync(InteractionContext ctx)
114114
{
115-
await ctx.CreateResponseAsync(InteractionResponseType.ChannelMessageWithSource, new DiscordInteractionResponseBuilder().AsEphemeral().WithContent("Please wait.."));
115+
await ctx.CreateResponseAsync(InteractionResponseType.ChannelMessageWithSource, new DiscordInteractionResponseBuilder().AsEphemeral().WithContent("Resuming.."));
116116
try
117117
{
118118
ArgumentNullException.ThrowIfNull(ctx.Guild);
@@ -204,7 +204,7 @@ public async Task NowPlayingAsync(InteractionContext ctx)
204204
}
205205
catch (ArgumentNullException)
206206
{
207-
await ctx.EditResponseAsync(new DiscordWebhookBuilder().WithContent("Make sure you're connected to a channel."));
207+
await ctx.EditResponseAsync(new DiscordWebhookBuilder().WithContent("Make sure you're connected to a channel and are playing a song currently."));
208208
}
209209
catch (Exception ex)
210210
{
@@ -226,7 +226,7 @@ public async Task SetVolumeAsync(InteractionContext ctx, [Option("volume", "The
226226
var player = ctx.Client.GetLavalink().GetGuildPlayer(ctx.Guild);
227227
ArgumentNullException.ThrowIfNull(player);
228228
await player.SetVolumeAsync(volume);
229-
await ctx.EditResponseAsync(new DiscordWebhookBuilder().WithContent("Success!"));
229+
await ctx.EditResponseAsync(new DiscordWebhookBuilder().WithContent($"Success! Set volume to {volume}%"));
230230
}
231231
catch (ArgumentNullException)
232232
{
@@ -247,12 +247,13 @@ public async Task SeekAsync(InteractionContext ctx, [Option("position", "The tot
247247
ArgumentNullException.ThrowIfNull(ctx.Guild);
248248
var player = ctx.Client.GetLavalink().GetGuildPlayer(ctx.Guild);
249249
ArgumentNullException.ThrowIfNull(player);
250-
await player.SeekAsync(TimeSpan.FromSeconds(seconds));
251-
await ctx.EditResponseAsync(new DiscordWebhookBuilder().WithContent("Success!"));
250+
var ts = TimeSpan.FromSeconds(seconds);
251+
await player.SeekAsync(ts);
252+
await ctx.EditResponseAsync(new DiscordWebhookBuilder().WithContent($"Success! Seeked to {ts}"));
252253
}
253254
catch (ArgumentNullException)
254255
{
255-
await ctx.EditResponseAsync(new DiscordWebhookBuilder().WithContent("Make sure you're connected to a channel."));
256+
await ctx.EditResponseAsync(new DiscordWebhookBuilder().WithContent("Make sure you're connected to a channel and are currently playing a song."));
256257
}
257258
catch (Exception ex)
258259
{
@@ -274,10 +275,12 @@ public async Task PlayQueueAsync(InteractionContext ctx)
274275
var player = ctx.Client.GetLavalink().GetGuildPlayer(ctx.Guild);
275276
ArgumentNullException.ThrowIfNull(player);
276277
player.PlayQueue();
278+
player = ctx.Client.GetLavalink().GetGuildPlayer(ctx.Guild);
279+
await ctx.EditResponseAsync(new DiscordWebhookBuilder().WithContent($"Playing {player!.CurrentTrack!.Info.Title.Bold} from {player.CurrentTrack.Info.Author.Italic}"));
277280
}
278281
catch (ArgumentNullException)
279282
{
280-
await ctx.EditResponseAsync(new DiscordWebhookBuilder().WithContent("Make sure you're connected to a channel."));
283+
await ctx.EditResponseAsync(new DiscordWebhookBuilder().WithContent("Make sure you're connected to a channel. And you added songs to the queue."));
281284
}
282285
catch (Exception ex)
283286
{
@@ -383,7 +386,7 @@ public async Task ShuffleQueueAsync(InteractionContext ctx)
383386
}
384387
catch (ArgumentNullException)
385388
{
386-
await ctx.EditResponseAsync(new DiscordWebhookBuilder().WithContent("Make sure you're connected to a channel."));
389+
await ctx.EditResponseAsync(new DiscordWebhookBuilder().WithContent("Make sure you're connected to a channel and have songs in the queue."));
387390
}
388391
catch (Exception ex)
389392
{
@@ -405,7 +408,7 @@ public async Task ClearQueueAsync(InteractionContext ctx)
405408
}
406409
catch (ArgumentNullException)
407410
{
408-
await ctx.EditResponseAsync(new DiscordWebhookBuilder().WithContent("Make sure you're connected to a channel."));
411+
await ctx.EditResponseAsync(new DiscordWebhookBuilder().WithContent("Make sure you're connected to a channel and have songs in the queue."));
409412
}
410413
catch (Exception ex)
411414
{
@@ -427,7 +430,7 @@ public async Task ReverseQueueAsync(InteractionContext ctx)
427430
}
428431
catch (ArgumentNullException)
429432
{
430-
await ctx.EditResponseAsync(new DiscordWebhookBuilder().WithContent("Make sure you're connected to a channel."));
433+
await ctx.EditResponseAsync(new DiscordWebhookBuilder().WithContent("Make sure you're connected to a channel and have songs in the queue."));
431434
}
432435
catch (Exception ex)
433436
{

0 commit comments

Comments
 (0)