From 586e260c92ec8f79a34847b3992743f17a7cca51 Mon Sep 17 00:00:00 2001
From: Octol1ttle <l1ttleofficial@outlook.com>
Date: Fri, 30 Jun 2023 15:08:50 +0500
Subject: [PATCH] Bring back easter eggs

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
---
 EventResponders.cs             | 26 ++++++++++++++++++++++++++
 Services/GuildUpdateService.cs |  4 +++-
 2 files changed, 29 insertions(+), 1 deletion(-)

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<IGuildMemberUpdate> {
         return Result.FromSuccess();
     }
 }
+
+/// <summary>
+///     Handles sending replies to easter egg messages.
+/// </summary>
+public class MessageCreateResponder : IResponder<IMessageCreate> {
+    private readonly IDiscordRestChannelAPI _channelApi;
+
+    public MessageCreateResponder(IDiscordRestChannelAPI channelApi) {
+        _channelApi = channelApi;
+    }
+
+    public Task<Result> 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<string>)
+            });
+        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<Activity> _activityList = new(1) { new Activity("with Remora.Discord", ActivityType.Game) };
@@ -59,6 +60,7 @@ public class GuildUpdateService : BackgroundService {
 
     /// <summary>
     ///     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 <see cref="SongList"/>.
     /// </summary>
     /// <remarks>If update tasks take longer than 1 second, the next timer tick will be skipped.</remarks>
     /// <param name="ct">The cancellation token for this operation.</param>