diff --git a/Hanekawa.Application/Contracts/Discord/Common/Ban.cs b/Hanekawa.Application/Contracts/Discord/Common/Ban.cs index c2ef253b..cb35be8f 100644 --- a/Hanekawa.Application/Contracts/Discord/Common/Ban.cs +++ b/Hanekawa.Application/Contracts/Discord/Common/Ban.cs @@ -3,7 +3,7 @@ namespace Hanekawa.Application.Contracts.Discord.Common; -public record Ban : ISqs +public record Ban : IMessageSqs { public ulong GuildId { get; init; } public ulong UserId { get; init; } diff --git a/Hanekawa.Application/Contracts/Discord/Common/Kick.cs b/Hanekawa.Application/Contracts/Discord/Common/Kick.cs index 03ced87c..408b96cb 100644 --- a/Hanekawa.Application/Contracts/Discord/Common/Kick.cs +++ b/Hanekawa.Application/Contracts/Discord/Common/Kick.cs @@ -3,7 +3,7 @@ namespace Hanekawa.Application.Contracts.Discord.Common; -public class Kick : ISqs +public class Kick : IMessageSqs { public ulong GuildId { get; init; } public ulong UserId { get; init; } diff --git a/Hanekawa.Application/Contracts/Discord/Common/Mute.cs b/Hanekawa.Application/Contracts/Discord/Common/Mute.cs index 11d8d53f..e9f3d9cc 100644 --- a/Hanekawa.Application/Contracts/Discord/Common/Mute.cs +++ b/Hanekawa.Application/Contracts/Discord/Common/Mute.cs @@ -3,7 +3,7 @@ namespace Hanekawa.Application.Contracts.Discord.Common; -public class Mute : ISqs +public class Mute : IMessageSqs { public ulong GuildId { get; init; } public ulong UserId { get; init; } diff --git a/Hanekawa.Application/Contracts/Discord/Common/Prune.cs b/Hanekawa.Application/Contracts/Discord/Common/Prune.cs index ab07d83b..25122d21 100644 --- a/Hanekawa.Application/Contracts/Discord/Common/Prune.cs +++ b/Hanekawa.Application/Contracts/Discord/Common/Prune.cs @@ -3,7 +3,7 @@ namespace Hanekawa.Application.Contracts.Discord.Common; -public class Prune : ISqs +public class Prune : IMessageSqs { public ulong GuildId { get; init; } public ulong UserId { get; init; } diff --git a/Hanekawa.Application/Contracts/Discord/Common/Unban.cs b/Hanekawa.Application/Contracts/Discord/Common/Unban.cs index 147b1f27..261c16fb 100644 --- a/Hanekawa.Application/Contracts/Discord/Common/Unban.cs +++ b/Hanekawa.Application/Contracts/Discord/Common/Unban.cs @@ -3,7 +3,7 @@ namespace Hanekawa.Application.Contracts.Discord.Common; -public class Unban : ISqs +public class Unban : IMessageSqs { public ulong GuildId { get; init; } public ulong UserId { get; init; } diff --git a/Hanekawa.Application/Contracts/Discord/Common/Unmute.cs b/Hanekawa.Application/Contracts/Discord/Common/Unmute.cs index 6cb4b57a..9eb72a03 100644 --- a/Hanekawa.Application/Contracts/Discord/Common/Unmute.cs +++ b/Hanekawa.Application/Contracts/Discord/Common/Unmute.cs @@ -3,7 +3,7 @@ namespace Hanekawa.Application.Contracts.Discord.Common; -public class Unmute : ISqs +public class Unmute : IMessageSqs { public ulong GuildId { get; init; } public ulong UserId { get; init; } diff --git a/Hanekawa.Application/Contracts/Discord/Services/BotLeave.cs b/Hanekawa.Application/Contracts/Discord/Services/BotLeave.cs index de38592a..979f4bc2 100644 --- a/Hanekawa.Application/Contracts/Discord/Services/BotLeave.cs +++ b/Hanekawa.Application/Contracts/Discord/Services/BotLeave.cs @@ -2,4 +2,4 @@ namespace Hanekawa.Application.Contracts.Discord.Services; -public record BotLeave(ulong GuildId) : ISqs; \ No newline at end of file +public record BotLeave(ulong GuildId) : INotificationSqs; \ No newline at end of file diff --git a/Hanekawa.Application/Contracts/Discord/Services/MessageDeleted.cs b/Hanekawa.Application/Contracts/Discord/Services/MessageDeleted.cs index 2327db82..39393a70 100644 --- a/Hanekawa.Application/Contracts/Discord/Services/MessageDeleted.cs +++ b/Hanekawa.Application/Contracts/Discord/Services/MessageDeleted.cs @@ -3,4 +3,4 @@ namespace Hanekawa.Application.Contracts.Discord.Services; public record MessageDeleted - (ulong GuildId, ulong ChannelId, ulong AuthorId, ulong MessageId, string MessageContent) : ISqs; + (ulong GuildId, ulong ChannelId, ulong AuthorId, ulong MessageId, string MessageContent) : INotificationSqs; \ No newline at end of file diff --git a/Hanekawa.Application/Contracts/Discord/Services/MessageReceived.cs b/Hanekawa.Application/Contracts/Discord/Services/MessageReceived.cs index d41659f2..90203678 100644 --- a/Hanekawa.Application/Contracts/Discord/Services/MessageReceived.cs +++ b/Hanekawa.Application/Contracts/Discord/Services/MessageReceived.cs @@ -3,5 +3,5 @@ namespace Hanekawa.Application.Contracts.Discord.Services; -public record MessageReceived(ulong GuildId, ulong ChannelId, DiscordMember Member, - ulong MessageId, string? Message, DateTimeOffset CreatedAt) : ISqs; \ No newline at end of file +public record MessageReceived(ulong GuildId, ulong ChannelId, DiscordMember Member, + ulong MessageId, string? Message, DateTimeOffset CreatedAt) : INotificationSqs; \ No newline at end of file diff --git a/Hanekawa.Application/Contracts/Discord/Services/MessagesDeleted.cs b/Hanekawa.Application/Contracts/Discord/Services/MessagesDeleted.cs index 62915250..de7aa965 100644 --- a/Hanekawa.Application/Contracts/Discord/Services/MessagesDeleted.cs +++ b/Hanekawa.Application/Contracts/Discord/Services/MessagesDeleted.cs @@ -2,5 +2,5 @@ namespace Hanekawa.Application.Contracts.Discord.Services; -public record MessagesDeleted(ulong GuildId, ulong ChannelId, ulong[] AuthorId, - ulong[] MessageIds, string[] MessageContents) : ISqs; \ No newline at end of file +public record MessagesDeleted(ulong GuildId, ulong ChannelId, ulong[] AuthorId, + ulong[] MessageIds, string[] MessageContents) : INotificationSqs; \ No newline at end of file diff --git a/Hanekawa.Application/Contracts/Discord/Services/ReactionAdd.cs b/Hanekawa.Application/Contracts/Discord/Services/ReactionAdd.cs index d0ab1b37..e4e22747 100644 --- a/Hanekawa.Application/Contracts/Discord/Services/ReactionAdd.cs +++ b/Hanekawa.Application/Contracts/Discord/Services/ReactionAdd.cs @@ -2,4 +2,4 @@ namespace Hanekawa.Application.Contracts.Discord.Services; -public record ReactionAdd(ulong GuildId, ulong ChannelId, ulong MessageId, ulong UserId, string? Emoji) : ISqs; \ No newline at end of file +public record ReactionAdd(ulong GuildId, ulong ChannelId, ulong MessageId, ulong UserId, string? Emoji) : INotificationSqs; \ No newline at end of file diff --git a/Hanekawa.Application/Contracts/Discord/Services/ReactionCleared.cs b/Hanekawa.Application/Contracts/Discord/Services/ReactionCleared.cs index 14be3541..739cd917 100644 --- a/Hanekawa.Application/Contracts/Discord/Services/ReactionCleared.cs +++ b/Hanekawa.Application/Contracts/Discord/Services/ReactionCleared.cs @@ -2,4 +2,4 @@ namespace Hanekawa.Application.Contracts.Discord.Services; -public record ReactionCleared(ulong GuildId, ulong ChannelId, ulong MessageId) : ISqs; \ No newline at end of file +public record ReactionCleared(ulong GuildId, ulong ChannelId, ulong MessageId) : INotificationSqs; \ No newline at end of file diff --git a/Hanekawa.Application/Contracts/Discord/Services/ReactionRemove.cs b/Hanekawa.Application/Contracts/Discord/Services/ReactionRemove.cs index 2983c50b..0b044919 100644 --- a/Hanekawa.Application/Contracts/Discord/Services/ReactionRemove.cs +++ b/Hanekawa.Application/Contracts/Discord/Services/ReactionRemove.cs @@ -2,4 +2,4 @@ namespace Hanekawa.Application.Contracts.Discord.Services; -public record ReactionRemove(ulong GuildId, ulong ChannelId, ulong MessageId, ulong UserId, string? Emoji) : ISqs; \ No newline at end of file +public record ReactionRemove(ulong GuildId, ulong ChannelId, ulong MessageId, ulong UserId, string? Emoji) : INotificationSqs; \ No newline at end of file diff --git a/Hanekawa.Application/Contracts/Discord/Services/UserBanned.cs b/Hanekawa.Application/Contracts/Discord/Services/UserBanned.cs index 35d2c7a3..3ed2b235 100644 --- a/Hanekawa.Application/Contracts/Discord/Services/UserBanned.cs +++ b/Hanekawa.Application/Contracts/Discord/Services/UserBanned.cs @@ -1,6 +1,9 @@ -using Hanekawa.Entities.Discord; -using MediatR; +using Hanekawa.Application.Interfaces; +using Hanekawa.Entities.Discord; namespace Hanekawa.Application.Contracts.Discord.Services; -public record UserBanned(DiscordMember Member) : IRequest, IRequest; \ No newline at end of file +public record UserBanned(DiscordMember Member) : INotificationSqs +{ + public ulong GuildId { get; init; } +} \ No newline at end of file diff --git a/Hanekawa.Application/Contracts/Discord/Services/UserJoin.cs b/Hanekawa.Application/Contracts/Discord/Services/UserJoin.cs index c0719663..cbe88772 100644 --- a/Hanekawa.Application/Contracts/Discord/Services/UserJoin.cs +++ b/Hanekawa.Application/Contracts/Discord/Services/UserJoin.cs @@ -2,5 +2,5 @@ namespace Hanekawa.Application.Contracts.Discord.Services; -public record UserJoin(ulong GuildId, ulong UserId, string Username, - string AvatarUrl, DateTimeOffset CreatedAt) : ISqs; \ No newline at end of file +public record UserJoin(ulong GuildId, ulong UserId, string Username, + string AvatarUrl, DateTimeOffset CreatedAt) : INotificationSqs; \ No newline at end of file diff --git a/Hanekawa.Application/Contracts/Discord/Services/UserLeave.cs b/Hanekawa.Application/Contracts/Discord/Services/UserLeave.cs index 1fa1464e..bab33e15 100644 --- a/Hanekawa.Application/Contracts/Discord/Services/UserLeave.cs +++ b/Hanekawa.Application/Contracts/Discord/Services/UserLeave.cs @@ -2,4 +2,4 @@ namespace Hanekawa.Application.Contracts.Discord.Services; -public record UserLeave(ulong GuildId, ulong UserId) : ISqs; \ No newline at end of file +public record UserLeave(ulong GuildId, ulong UserId) : INotificationSqs; \ No newline at end of file diff --git a/Hanekawa.Application/Contracts/Discord/Services/UserUnbanned.cs b/Hanekawa.Application/Contracts/Discord/Services/UserUnbanned.cs index 5f42be6a..42c947b6 100644 --- a/Hanekawa.Application/Contracts/Discord/Services/UserUnbanned.cs +++ b/Hanekawa.Application/Contracts/Discord/Services/UserUnbanned.cs @@ -1,6 +1,9 @@ -using Hanekawa.Entities.Discord; -using MediatR; +using Hanekawa.Application.Interfaces; +using Hanekawa.Entities.Discord; namespace Hanekawa.Application.Contracts.Discord.Services; -public record UserUnbanned(DiscordMember Member) : IRequest; \ No newline at end of file +public record UserUnbanned(DiscordMember Member) : INotificationSqs +{ + public ulong GuildId { get; init; } +} \ No newline at end of file diff --git a/Hanekawa.Application/Contracts/Discord/Services/VoiceStateUpdate.cs b/Hanekawa.Application/Contracts/Discord/Services/VoiceStateUpdate.cs index 5cd07799..c37b00e0 100644 --- a/Hanekawa.Application/Contracts/Discord/Services/VoiceStateUpdate.cs +++ b/Hanekawa.Application/Contracts/Discord/Services/VoiceStateUpdate.cs @@ -2,4 +2,4 @@ namespace Hanekawa.Application.Contracts.Discord.Services; -public record VoiceStateUpdate(ulong GuildId, ulong UserId, ulong? ChannelId, string? SessionId) : ISqs; \ No newline at end of file +public record VoiceStateUpdate(ulong GuildId, ulong UserId, ulong? ChannelId, string? SessionId) : IMessageSqs; \ No newline at end of file diff --git a/Hanekawa.Application/Handlers/Services/Levels/MessageReceivedExperienceHandler.cs b/Hanekawa.Application/Handlers/Services/Levels/MessageReceivedExperienceHandler.cs index c411170b..537ab2c6 100644 --- a/Hanekawa.Application/Handlers/Services/Levels/MessageReceivedExperienceHandler.cs +++ b/Hanekawa.Application/Handlers/Services/Levels/MessageReceivedExperienceHandler.cs @@ -6,22 +6,21 @@ namespace Hanekawa.Application.Handlers.Services.Levels; -public class MessageReceivedExperienceHandler: IRequestHandler +public class MessageReceivedExperienceHandler: INotificationHandler { private readonly IConfiguration _configuration; private readonly ILevelService _levelService; - + public MessageReceivedExperienceHandler(ILevelService levelService, IConfiguration configuration) { _levelService = levelService; _configuration = configuration; } - - public async Task Handle(MessageReceived request, CancellationToken cancellationToken) + + public async Task Handle(MessageReceived request, CancellationToken cancellationToken) { await _levelService.AddExperienceAsync(request.Member, Random.Shared.Next(Convert.ToInt32(_configuration["expLower"]), Convert.ToInt32(_configuration["expUpper"]))); - return true; } } \ No newline at end of file diff --git a/Hanekawa.Application/Handlers/Services/Logs/UserBannedHandler.cs b/Hanekawa.Application/Handlers/Services/Logs/UserBannedHandler.cs index 1616898b..9bdf4b5f 100644 --- a/Hanekawa.Application/Handlers/Services/Logs/UserBannedHandler.cs +++ b/Hanekawa.Application/Handlers/Services/Logs/UserBannedHandler.cs @@ -8,7 +8,7 @@ namespace Hanekawa.Application.Handlers.Services.Logs; -public class UserBannedHandler : IRequestHandler +public class UserBannedHandler : INotificationHandler { private readonly IBot _bot; private readonly IDbContext _db; @@ -19,19 +19,19 @@ public UserBannedHandler(IBot bot, IDbContext db) _db = db; } - public async Task Handle(UserBanned request, CancellationToken cancellationToken) + public async Task Handle(UserBanned request, CancellationToken cancellationToken) { var cfg = await _db.GuildConfigs.Include(x => x.LogConfig) .FirstOrDefaultAsync(x => x.GuildId == request.Member.Guild.GuildId, cancellationToken: cancellationToken); - if (cfg is { LogConfig.ModLogChannelId: null }) return false; + if (cfg is { LogConfig.ModLogChannelId: null }) return; var channel = _bot.GetChannel(request.Member.Guild.GuildId, cfg!.LogConfig.ModLogChannelId.Value); if (channel is null) { cfg.LogConfig.ModLogChannelId = null; - await _db.SaveChangesAsync(); - return false; + await _db.SaveChangesAsync(cancellationToken); + return; } - + await _bot.SendMessageAsync(channel.Value, new Embed { Title = $"User Banned | Case ID: {request.Member.Id} | ${request.Member.Guild.GuildId}", @@ -43,6 +43,6 @@ public async Task Handle(UserBanned request, CancellationToken cancellatio new EmbedField("Reason", "No reason provided", false) ] }); - return true; + return; } } \ No newline at end of file diff --git a/Hanekawa.Application/Handlers/Services/Logs/UserJoinedHandler.cs b/Hanekawa.Application/Handlers/Services/Logs/UserJoinedHandler.cs index b51910fd..2ee719b9 100644 --- a/Hanekawa.Application/Handlers/Services/Logs/UserJoinedHandler.cs +++ b/Hanekawa.Application/Handlers/Services/Logs/UserJoinedHandler.cs @@ -4,9 +4,9 @@ namespace Hanekawa.Application.Handlers.Services.Logs; -public class UserJoinedHandler : IRequestHandler +public class UserJoinedHandler : INotificationHandler { - public Task Handle(UserJoin request, CancellationToken cancellationToken) + public Task Handle(UserJoin request, CancellationToken cancellationToken) { throw new NotImplementedException(); } diff --git a/Hanekawa.Application/Handlers/Services/Logs/UserLeftHandler.cs b/Hanekawa.Application/Handlers/Services/Logs/UserLeftHandler.cs index a9f47cba..1d4ccc63 100644 --- a/Hanekawa.Application/Handlers/Services/Logs/UserLeftHandler.cs +++ b/Hanekawa.Application/Handlers/Services/Logs/UserLeftHandler.cs @@ -4,9 +4,9 @@ namespace Hanekawa.Application.Handlers.Services.Logs; -public class UserLeftHandler : IRequestHandler +public class UserLeftHandler : INotificationHandler { - public Task Handle(UserLeave request, CancellationToken cancellationToken) + public Task Handle(UserLeave request, CancellationToken cancellationToken) { throw new NotImplementedException(); } diff --git a/Hanekawa.Application/Handlers/Services/Logs/UserUnbannedHandler.cs b/Hanekawa.Application/Handlers/Services/Logs/UserUnbannedHandler.cs index 9af8d207..0cc3135f 100644 --- a/Hanekawa.Application/Handlers/Services/Logs/UserUnbannedHandler.cs +++ b/Hanekawa.Application/Handlers/Services/Logs/UserUnbannedHandler.cs @@ -8,7 +8,7 @@ namespace Hanekawa.Application.Handlers.Services.Logs; -public class UserUnbannedHandler : IRequestHandler +public class UserUnbannedHandler : INotificationHandler { private readonly IBot _bot; private readonly IDbContext _db; @@ -18,20 +18,20 @@ public UserUnbannedHandler(IBot bot, IDbContext db) _bot = bot; _db = db; } - - public async Task Handle(UserUnbanned request, CancellationToken cancellationToken) + + public async Task Handle(UserUnbanned request, CancellationToken cancellationToken) { var cfg = await _db.GuildConfigs.Include(x => x.LogConfig) .FirstOrDefaultAsync(x => x.GuildId == request.Member.Guild.GuildId, cancellationToken: cancellationToken); - if (cfg is { LogConfig.ModLogChannelId: null }) return false; + if (cfg is { LogConfig.ModLogChannelId: null }) return; var channel = _bot.GetChannel(request.Member.Guild.GuildId, cfg.LogConfig.ModLogChannelId.Value); if (channel is null) { cfg.LogConfig.ModLogChannelId = null; - await _db.SaveChangesAsync(); - return false; + await _db.SaveChangesAsync(cancellationToken); + return; } - + await _bot.SendMessageAsync(channel.Value, new Embed { Title = $"User Banned | Case ID: {request.Member.Id} | ${request.Member.Guild.GuildId}", @@ -43,6 +43,6 @@ public async Task Handle(UserUnbanned request, CancellationToken cancellat new EmbedField("Reason", "No reason provided", false) ] }); - return true; + return; } } \ No newline at end of file diff --git a/Hanekawa.Application/Interfaces/INotificationSqs.cs b/Hanekawa.Application/Interfaces/INotificationSqs.cs new file mode 100644 index 00000000..30350131 --- /dev/null +++ b/Hanekawa.Application/Interfaces/INotificationSqs.cs @@ -0,0 +1,9 @@ +using MediatR; + +namespace Hanekawa.Application.Interfaces; + +public interface IMetric { ulong GuildId { get; init; } } +public interface INotificationSqs : IMetric, INotification; + +public interface IMessageSqs : IMetric, IRequest; +public interface IMessageSqs : IMetric, IRequest; \ No newline at end of file diff --git a/Hanekawa.Application/Interfaces/ISqs.cs b/Hanekawa.Application/Interfaces/ISqs.cs deleted file mode 100644 index df9ec611..00000000 --- a/Hanekawa.Application/Interfaces/ISqs.cs +++ /dev/null @@ -1,9 +0,0 @@ -using MediatR; - -namespace Hanekawa.Application.Interfaces; - -public interface IMetric : IRequest { ulong GuildId { get; init; } } -public interface IMetric : IRequest { ulong GuildId { get; init; } } - -public interface ISqs : IMetric; -public interface ISqs : IMetric; \ No newline at end of file diff --git a/Hanekawa.Bot/Services/Bot/DiscordEventRegister.cs b/Hanekawa.Bot/Services/Bot/DiscordEventRegister.cs index e39cdeae..286f95db 100644 --- a/Hanekawa.Bot/Services/Bot/DiscordEventRegister.cs +++ b/Hanekawa.Bot/Services/Bot/DiscordEventRegister.cs @@ -11,20 +11,20 @@ public class DiscordEventRegister(IServiceProvider service) : DiscordBotService { protected override async ValueTask OnMemberJoined(MemberJoinedEventArgs e) => await service.GetRequiredService() - .Send(new UserJoin(e.GuildId, e.MemberId, e.Member.Name, + .Publish(new UserJoin(e.GuildId, e.MemberId, e.Member.Name, e.Member.GetGuildAvatarUrl(), e.Member.CreatedAt())) .ConfigureAwait(false); protected override async ValueTask OnMemberLeft(MemberLeftEventArgs e) => await service.GetRequiredService() - .Send(new UserLeave(e.GuildId, e.MemberId)) + .Publish(new UserLeave(e.GuildId, e.MemberId)) .ConfigureAwait(false); protected override async ValueTask OnMessageReceived(BotMessageReceivedEventArgs e) { if (e.GuildId is null || e.Member is null) return; await service.GetRequiredService() - .Send(new MessageReceived(e.GuildId.Value, e.ChannelId, new DiscordMember + .Publish(new MessageReceived(e.GuildId.Value, e.ChannelId, new DiscordMember { Guild = new Guild { GuildId = e.GuildId.Value }, Id = e.Member.Id, @@ -42,14 +42,14 @@ protected override async ValueTask OnMessageDeleted(MessageDeletedEventArgs e) { if (e.GuildId.HasValue is false || e.Message is null) return; await service.GetRequiredService() - .Send(new MessageDeleted(e.GuildId.Value, e.ChannelId, e.Message.Author.Id, + .Publish(new MessageDeleted(e.GuildId.Value, e.ChannelId, e.Message.Author.Id, e.MessageId, e.Message.Content)) .ConfigureAwait(false); } protected override async ValueTask OnMessagesDeleted(MessagesDeletedEventArgs e) => await service.GetRequiredService() - .Send(new MessagesDeleted(e.GuildId, e.ChannelId, + .Publish(new MessagesDeleted(e.GuildId, e.ChannelId, e.Messages.Select(x => x.Key.RawValue).ToArray(), e.MessageIds.Select(x => x.RawValue).ToArray(), e.Messages.Select(x => x.Value.Content).ToArray())) @@ -57,7 +57,7 @@ protected override async ValueTask OnMessagesDeleted(MessagesDeletedEventArgs e) protected override async ValueTask OnBanCreated(BanCreatedEventArgs e) => await service.GetRequiredService() - .Send(new UserBanned(new DiscordMember + .Publish(new UserBanned(new DiscordMember { Guild = new Guild { GuildId = e.GuildId }, Id = e.UserId, @@ -69,7 +69,7 @@ protected override async ValueTask OnBanCreated(BanCreatedEventArgs e) protected override async ValueTask OnBanDeleted(BanDeletedEventArgs e) => await service.GetRequiredService() - .Send(new UserUnbanned(new DiscordMember + .Publish(new UserUnbanned(new DiscordMember { Guild = new Guild { GuildId = e.GuildId }, Id = e.UserId, @@ -84,7 +84,7 @@ protected override async ValueTask OnBanDeleted(BanDeletedEventArgs e) protected override async ValueTask OnVoiceStateUpdated(VoiceStateUpdatedEventArgs e) { await service.GetRequiredService() - .Send(new VoiceStateUpdate(e.GuildId, e.MemberId, e.NewVoiceState.ChannelId, + .Publish(new VoiceStateUpdate(e.GuildId, e.MemberId, e.NewVoiceState.ChannelId, e.NewVoiceState.SessionId)) .ConfigureAwait(false); } @@ -93,7 +93,7 @@ protected override async ValueTask OnReactionAdded(ReactionAddedEventArgs e) { if (e.GuildId.HasValue is false) return; await service.GetRequiredService() - .Send(new ReactionAdd(e.GuildId.Value, e.ChannelId, + .Publish(new ReactionAdd(e.GuildId.Value, e.ChannelId, e.MessageId, e.UserId, e.Emoji.GetReactionFormat())) .ConfigureAwait(false); } @@ -102,7 +102,7 @@ protected override async ValueTask OnReactionRemoved(ReactionRemovedEventArgs e) { if (e.GuildId.HasValue is false) return; await service.GetRequiredService() - .Send(new ReactionRemove(e.GuildId.Value, e.ChannelId, e.MessageId, e.UserId, + .Publish(new ReactionRemove(e.GuildId.Value, e.ChannelId, e.MessageId, e.UserId, e.Emoji.GetReactionFormat())) .ConfigureAwait(false); } @@ -111,7 +111,7 @@ protected override async ValueTask OnReactionsCleared(ReactionsClearedEventArgs { if (e.GuildId.HasValue is false) return; await service.GetRequiredService() - .Send(new ReactionCleared(e.GuildId.Value, e.ChannelId, e.MessageId)) + .Publish(new ReactionCleared(e.GuildId.Value, e.ChannelId, e.MessageId)) .ConfigureAwait(false); }