Small fix

This commit is contained in:
Myx
2024-08-11 16:03:42 +02:00
parent 05b7324ecc
commit 34375f52bd
4 changed files with 14 additions and 14 deletions

View File

@@ -90,7 +90,5 @@ public class PlayHandler : IRequestHandler<PlayCommand>
await context.SendMessageAsync($"Couldn't read song information", _client);
}
}
_audioService.TrackStarted += OnTrackStarted;
}
}

View File

@@ -1,6 +1,7 @@
using Lunaris2.Handler.GoodByeCommand;
using Lunaris2.Handler.MusicPlayer.JoinCommand;
using Lunaris2.Handler.MusicPlayer.DisconnectCommand;
using Lunaris2.Handler.MusicPlayer.PauseCommand;
using Lunaris2.Handler.MusicPlayer.PlayCommand;
using Lunaris2.Handler.MusicPlayer.ResumeCommand;
using Lunaris2.Handler.MusicPlayer.SkipCommand;
using Lunaris2.Notification;
using Lunaris2.SlashCommand;
@@ -12,16 +13,18 @@ public class SlashCommandReceivedHandler(ISender mediator) : INotificationHandle
{
public async Task Handle(SlashCommandReceivedNotification notification, CancellationToken cancellationToken)
{
await notification.Message.DeferAsync();
switch (notification.Message.CommandName)
{
case Command.Hello.Name:
await mediator.Send(new HelloCommand.HelloCommand(notification.Message), cancellationToken);
case Command.Resume.Name:
await mediator.Send(new ResumeCommand(notification.Message), cancellationToken);
break;
case Command.Goodbye.Name:
await mediator.Send(new GoodbyeCommand(notification.Message), cancellationToken);
case Command.Pause.Name:
await mediator.Send(new PauseCommand(notification.Message), cancellationToken);
break;
case Command.Join.Name:
await mediator.Send(new JoinCommand(notification.Message), cancellationToken);
case Command.Disconnect.Name:
await mediator.Send(new DisconnectCommand(notification.Message), cancellationToken);
break;
case Command.Play.Name:
await mediator.Send(new PlayCommand(notification.Message), cancellationToken);