mirror of
https://github.com/Myxelium/Lunaris2.0.git
synced 2026-04-11 15:19:53 +00:00
Add chat functionality (#1)
* Working chatbot * Clean * Working LLM chatbot --------- Co-authored-by: Myx <info@azaaxin.com>
This commit is contained in:
34
Bot/Handler/SlashCommandReceivedHandler.cs
Normal file
34
Bot/Handler/SlashCommandReceivedHandler.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using Lunaris2.Handler.GoodByeCommand;
|
||||
using Lunaris2.Handler.MusicPlayer.JoinCommand;
|
||||
using Lunaris2.Handler.MusicPlayer.PlayCommand;
|
||||
using Lunaris2.Handler.MusicPlayer.SkipCommand;
|
||||
using Lunaris2.Notification;
|
||||
using Lunaris2.SlashCommand;
|
||||
using MediatR;
|
||||
|
||||
namespace Lunaris2.Handler;
|
||||
|
||||
public class SlashCommandReceivedHandler(ISender mediator) : INotificationHandler<SlashCommandReceivedNotification>
|
||||
{
|
||||
public async Task Handle(SlashCommandReceivedNotification notification, CancellationToken cancellationToken)
|
||||
{
|
||||
switch (notification.Message.CommandName)
|
||||
{
|
||||
case Command.Hello.Name:
|
||||
await mediator.Send(new HelloCommand.HelloCommand(notification.Message), cancellationToken);
|
||||
break;
|
||||
case Command.Goodbye.Name:
|
||||
await mediator.Send(new GoodbyeCommand(notification.Message), cancellationToken);
|
||||
break;
|
||||
case Command.Join.Name:
|
||||
await mediator.Send(new JoinCommand(notification.Message), cancellationToken);
|
||||
break;
|
||||
case Command.Play.Name:
|
||||
await mediator.Send(new PlayCommand(notification.Message), cancellationToken);
|
||||
break;
|
||||
case Command.Skip.Name:
|
||||
await mediator.Send(new SkipCommand(notification.Message), cancellationToken);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user