diff --git a/EventResponders.cs b/EventResponders.cs index 0f095bb..3c3269a 100644 --- a/EventResponders.cs +++ b/EventResponders.cs @@ -11,6 +11,7 @@ using Remora.Discord.Caching.Services; using Remora.Discord.Extensions.Embeds; using Remora.Discord.Extensions.Formatting; using Remora.Discord.Gateway.Responders; +using Remora.Rest.Core; using Remora.Results; // ReSharper disable UnusedType.Global @@ -305,3 +306,28 @@ public class GuildMemberUpdateResponder : IResponder { return Result.FromSuccess(); } } + +/// +/// Handles sending replies to easter egg messages. +/// +public class MessageCreateResponder : IResponder { + private readonly IDiscordRestChannelAPI _channelApi; + + public MessageCreateResponder(IDiscordRestChannelAPI channelApi) { + _channelApi = channelApi; + } + + public Task RespondAsync(IMessageCreate gatewayEvent, CancellationToken ct = default) { + _ = _channelApi.CreateMessageAsync( + gatewayEvent.ChannelID, ct: ct, content: gatewayEvent.Content switch { + "whoami" => "`nobody`", + "сука !!" => "`root`", + "воооо" => "`removing /...`", + "пон" => + "https://cdn.discordapp.com/attachments/837385840946053181/1087236080950055023/vUORS10xPaY-1.jpg", + "++++" => "#", + _ => default(Optional) + }); + return Task.FromResult(Result.FromSuccess()); + } +} diff --git a/Services/GuildUpdateService.cs b/Services/GuildUpdateService.cs index 4db9e1f..b1eb010 100644 --- a/Services/GuildUpdateService.cs +++ b/Services/GuildUpdateService.cs @@ -27,7 +27,8 @@ public class GuildUpdateService : BackgroundService { ("Splatoon 3 - Rockagilly Blues (Yoko & the Gold Bazookas)", new TimeSpan(0, 3, 37)), ("Splatoon 3 - Seep and Destroy", new TimeSpan(0, 2, 42)), ("IA - A Tale of Six Trillion Years and a Night", new TimeSpan(0, 3, 40)), - ("Manuel - Gas Gas Gas", new TimeSpan(0, 3, 17)) + ("Manuel - Gas Gas Gas", new TimeSpan(0, 3, 17)), + ("Camellia - Flamewall", new TimeSpan(0, 6, 50)) }; private readonly List _activityList = new(1) { new Activity("with Remora.Discord", ActivityType.Game) }; @@ -59,6 +60,7 @@ public class GuildUpdateService : BackgroundService { /// /// Activates a periodic timer with a 1 second interval and adds guild update tasks on each timer tick. + /// Additionally, updates the current presence with songs from . /// /// If update tasks take longer than 1 second, the next timer tick will be skipped. /// The cancellation token for this operation.