Lavalink4net (#3)

* Update readme.md

Test

Migrate from Victoria

* Small fix

---------

Co-authored-by: Myx <info@azaaxin.com>
This commit is contained in:
2024-08-11 16:06:52 +02:00
committed by GitHub
parent d72676c7e0
commit 9bcebea6b0
22 changed files with 337 additions and 315 deletions

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);