* Add guide for MediatR * Add sample for MediatR * Fix exposed token in program.cs * Fix review points * Remove newline in MediatrDiscordEventListener.cs
14 lines
449 B
C#
14 lines
449 B
C#
using MediatR;
|
|
using MediatRSample.Notifications;
|
|
|
|
namespace MediatRSample.Handlers;
|
|
|
|
public class MessageReceivedHandler : INotificationHandler<MessageReceivedNotification>
|
|
{
|
|
public async Task Handle(MessageReceivedNotification notification, CancellationToken cancellationToken)
|
|
{
|
|
Console.WriteLine($"MediatR works! (Received a message by {notification.Message.Author.Username})");
|
|
|
|
// Your implementation
|
|
}
|
|
} |