Basic bot

This commit is contained in:
Myx
2024-04-11 04:22:49 +02:00
commit 5b996ecd1d
13 changed files with 332 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
using Lunaris2.Handler.GoodByeCommand;
using Lunaris2.Notification;
using Lunaris2.SlashCommand;
using MediatR;
namespace Lunaris2.Handler;
public class MessageReceivedHandler(ISender mediator) : INotificationHandler<MessageReceivedNotification>
{
public async Task Handle(MessageReceivedNotification 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;
default:
break;
}
}
}