From 0a79828ff79bf35aed48cbc12a965ce3841e2064 Mon Sep 17 00:00:00 2001
From: Toastie <toastie@toastiet0ast.com>
Date: Wed, 29 Jan 2025 20:09:01 +1300
Subject: [PATCH 01/10] fixed .temprole not giving the role

---
 CHANGELOG.md                                             | 7 +++++++
 src/EllieBot/EllieBot.csproj                             | 2 +-
 src/EllieBot/Modules/Administration/Role/RoleCommands.cs | 3 ++-
 src/EllieBot/data/strings/commands/commands.en-US.yml    | 6 +++---
 4 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1cb4785..0845049 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,13 @@
 
 Mostly based on [keepachangelog](https://keepachangelog.com/en/1.1.0/) except date format. a-c-f-r-o
 
+## [5.3.8] - 29.01.2025
+
+## Fixed
+
+- `.temprole` now correctly adds a role
+  - `.h temprole` also shows the correct overload now
+
 ## [5.3.7] - 21.01.2025
 
 ## Changed
diff --git a/src/EllieBot/EllieBot.csproj b/src/EllieBot/EllieBot.csproj
index 8620d8e..7dd0e0e 100644
--- a/src/EllieBot/EllieBot.csproj
+++ b/src/EllieBot/EllieBot.csproj
@@ -4,7 +4,7 @@
     <Nullable>enable</Nullable>
     <ImplicitUsings>true</ImplicitUsings>
     <SatelliteResourceLanguages>en</SatelliteResourceLanguages>
-    <Version>5.3.7</Version>
+    <Version>5.3.8</Version>
 
     <!-- Output/build -->
     <RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory>
diff --git a/src/EllieBot/Modules/Administration/Role/RoleCommands.cs b/src/EllieBot/Modules/Administration/Role/RoleCommands.cs
index 32d5692..b6b0eb0 100644
--- a/src/EllieBot/Modules/Administration/Role/RoleCommands.cs
+++ b/src/EllieBot/Modules/Administration/Role/RoleCommands.cs
@@ -221,7 +221,7 @@ public partial class Administration
         [RequireContext(ContextType.Guild)]
         [UserPerm(GuildPerm.Administrator)]
         [BotPerm(GuildPerm.ManageRoles)]
-        public async Task TempRole(ParsedTimespan timespan, IUser user, [Leftover] IRole role)
+        public async Task TempRole(ParsedTimespan timespan, IGuildUser user, [Leftover] IRole role)
         {
             if (!await CheckRoleHierarchy(role))
             {
@@ -231,6 +231,7 @@ public partial class Administration
                 return;
             }
 
+            await user.AddRoleAsync(role);
             await _tempRoleService.AddTempRoleAsync(ctx.Guild.Id, role.Id, user.Id, timespan.Time);
 
 
diff --git a/src/EllieBot/data/strings/commands/commands.en-US.yml b/src/EllieBot/data/strings/commands/commands.en-US.yml
index 6d2ef7a..f3b3253 100644
--- a/src/EllieBot/data/strings/commands/commands.en-US.yml
+++ b/src/EllieBot/data/strings/commands/commands.en-US.yml
@@ -4852,11 +4852,11 @@ temprole:
     - '15m @User Jail'
     - '7d @Newbie Trial Member'
   params:
-    - days:
+    - time:
         desc: "The time after which the role is automatically removed."
-    - user:
+      user:
         desc: "The user to give the role to."
-    - role:
+      role:
         desc: "The role to give to the user."
 minesweeper:
   desc: |-

From ba1bc1732eecc957c18e2b4c573cd67b9bf82dfe Mon Sep 17 00:00:00 2001
From: Toastie <toastie@toastiet0ast.com>
Date: Thu, 30 Jan 2025 16:09:52 +1300
Subject: [PATCH 02/10] remind now has a 1 year max timeout, up from 2 months

---
 src/EllieBot/Modules/Utility/Remind/RemindCommands.cs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/EllieBot/Modules/Utility/Remind/RemindCommands.cs b/src/EllieBot/Modules/Utility/Remind/RemindCommands.cs
index 16da439..035f20f 100644
--- a/src/EllieBot/Modules/Utility/Remind/RemindCommands.cs
+++ b/src/EllieBot/Modules/Utility/Remind/RemindCommands.cs
@@ -183,7 +183,7 @@ public partial class Utility
         {
             var time = DateTime.UtcNow + ts;
 
-            if (ts > TimeSpan.FromDays(60))
+            if (ts > TimeSpan.FromDays(366))
                 return false;
 
             if (ctx.Guild is not null)

From 34ba6e782b8a092caed1f24f88fe295cab089308 Mon Sep 17 00:00:00 2001
From: Toastie <toastie@toastiet0ast.com>
Date: Thu, 30 Jan 2025 23:56:22 +1300
Subject: [PATCH 03/10] fixed .stock command, probably

---
 .../Crypto/DefaultStockDataService.cs         | 136 ++++++++++++------
 .../Crypto/_common/NasdaqChartResponse.cs     |  20 +++
 .../Crypto/_common/NasdaqDataResponse.cs      |   6 +
 .../Crypto/_common/NasdaqSummaryResponse.cs   |  44 ++++++
 4 files changed, 163 insertions(+), 43 deletions(-)
 create mode 100644 src/EllieBot/Modules/Searches/Crypto/_common/NasdaqChartResponse.cs
 create mode 100644 src/EllieBot/Modules/Searches/Crypto/_common/NasdaqDataResponse.cs
 create mode 100644 src/EllieBot/Modules/Searches/Crypto/_common/NasdaqSummaryResponse.cs

diff --git a/src/EllieBot/Modules/Searches/Crypto/DefaultStockDataService.cs b/src/EllieBot/Modules/Searches/Crypto/DefaultStockDataService.cs
index 9b000bd..d5ac9a8 100644
--- a/src/EllieBot/Modules/Searches/Crypto/DefaultStockDataService.cs
+++ b/src/EllieBot/Modules/Searches/Crypto/DefaultStockDataService.cs
@@ -2,6 +2,8 @@
 using CsvHelper;
 using CsvHelper.Configuration;
 using System.Globalization;
+using System.Net;
+using System.Net.Http.Json;
 using System.Text.Json;
 
 namespace EllieBot.Modules.Searches;
@@ -9,54 +11,57 @@ namespace EllieBot.Modules.Searches;
 public sealed class DefaultStockDataService : IStockDataService, IEService
 {
     private readonly IHttpClientFactory _httpClientFactory;
+    private readonly IBotCache _cache;
 
-    public DefaultStockDataService(IHttpClientFactory httpClientFactory)
-        => _httpClientFactory = httpClientFactory;
+    public DefaultStockDataService(IHttpClientFactory httpClientFactory, IBotCache cache)
+        => (_httpClientFactory, _cache) = (httpClientFactory, cache);
+
+    private static TypedKey<StockData> GetStockDataKey(string query)
+        => new($"stockdata:{query}");
 
     public async Task<StockData?> GetStockDataAsync(string query)
+    {
+        ArgumentException.ThrowIfNullOrWhiteSpace(query);
+
+        return await _cache.GetOrAddAsync(GetStockDataKey(query.Trim().ToLowerInvariant()),
+            () => GetStockDataInternalAsync(query),
+            expiry: TimeSpan.FromHours(1));
+    }
+
+    public async Task<StockData?> GetStockDataInternalAsync(string query)
     {
         try
         {
             if (!query.IsAlphaNumeric())
                 return default;
 
-            using var http = _httpClientFactory.CreateClient();
+            var info = await GetNasdaqDataResponse<NasdaqSummaryResponse>(
+                $"https://api.nasdaq.com/api/quote/{query}/summary?assetclass=stocks");
 
-            var quoteHtmlPage = $"https://finance.yahoo.com/quote/{query.ToUpperInvariant()}";
-
-            var config = Configuration.Default.WithDefaultLoader();
-            using var document = await BrowsingContext.New(config).OpenAsync(quoteHtmlPage);
-
-            var tickerName = document.QuerySelector("div.top > .left > .container > h1")
-                                     ?.TextContent;
-            
-            if (tickerName is null)
+            if (info?.Data is not { } d || d.SummaryData is not { } sd)
                 return default;
-            
-            var marketcap = document
-                            .QuerySelector("li > span > fin-streamer[data-field='marketCap']")
-                            ?.TextContent;
 
+            var closePrice = double.Parse(sd.PreviousClose.Value?.Substring(1) ?? "0",
+                NumberStyles.Any,
+                CultureInfo.InvariantCulture);
 
-            var volume = document.QuerySelector("li > span > fin-streamer[data-field='regularMarketVolume']")
-                                 ?.TextContent;
-
-            var close = document.QuerySelector("li > span > fin-streamer[data-field='regularMarketPreviousClose']")
-                                ?.TextContent
-                        ?? "0";
-
-            var price = document.QuerySelector("fin-streamer.livePrice > span")
-                                ?.TextContent
-                        ?? "0";
+            var price = d.BidAsk.Bid.Value.IndexOf('*') is var idx and > 0
+                        && double.TryParse(d.BidAsk.Bid.Value.Substring(1, idx - 1),
+                            NumberStyles.Any,
+                            CultureInfo.InvariantCulture,
+                            out var bid)
+                ? bid
+                : double.NaN;
 
             return new()
             {
-                Name = tickerName,
-                Symbol = query,
-                Price = double.Parse(price, NumberStyles.Any, CultureInfo.InvariantCulture),
-                Close = double.Parse(close, NumberStyles.Any, CultureInfo.InvariantCulture),
-                MarketCap = marketcap,
-                DailyVolume = (long)double.Parse(volume ?? "0", NumberStyles.Any, CultureInfo.InvariantCulture),
+                Name = query,
+                Symbol = info.Data.Symbol,
+                Price = price,
+                Close = closePrice,
+                MarketCap = sd.MarketCap.Value,
+                DailyVolume =
+                    (long)double.Parse(sd.AverageVolume.Value ?? "0", NumberStyles.Any, CultureInfo.InvariantCulture),
             };
         }
         catch (Exception ex)
@@ -66,6 +71,36 @@ public sealed class DefaultStockDataService : IStockDataService, IEService
         }
     }
 
+    private async Task<NasdaqDataResponse<T>?> GetNasdaqDataResponse<T>(string url)
+    {
+        using var httpClient = _httpClientFactory.CreateClient("google:search");
+
+        var req = new HttpRequestMessage(HttpMethod.Get,
+            url)
+        {
+            Headers =
+            {
+                { "Host", "api.nasdaq.com" },
+                { "User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:132.0) Gecko/20100101 Firefox/132.0" },
+                { "Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" },
+                { "Accept-Language", "en-US,en;q=0.5" },
+                { "Accept-Encoding", "gzip, deflate, br, zstd" },
+                { "Connection", "keep-alive" },
+                { "Upgrade-Insecure-Requests", "1" },
+                { "Sec-Fetch-Dest", "document" },
+                { "Sec-Fetch-Mode", "navigate" },
+                { "Sec-Fetch-Site", "none" },
+                { "Sec-Fetch-User", "?1" },
+                { "Priority", "u=0, i" },
+                { "TE", "trailers" }
+            }
+        };
+        var res = await httpClient.SendAsync(req);
+
+        var info = await res.Content.ReadFromJsonAsync<NasdaqDataResponse<T>>();
+        return info;
+    }
+
     public async Task<IReadOnlyCollection<SymbolData>> SearchSymbolAsync(string query)
     {
         if (string.IsNullOrWhiteSpace(query))
@@ -91,22 +126,37 @@ public sealed class DefaultStockDataService : IStockDataService, IEService
                    .ToList();
     }
 
-    private static CsvConfiguration _csvConfig = new(CultureInfo.InvariantCulture);
+    private static TypedKey<IReadOnlyCollection<CandleData>> GetCandleDataKey(string query)
+        => new($"candledata:{query}");
 
     public async Task<IReadOnlyCollection<CandleData>> GetCandleDataAsync(string query)
+        => await _cache.GetOrAddAsync(GetCandleDataKey(query),
+               async () => await GetCandleDataInternalAsync(query),
+               expiry: TimeSpan.FromHours(4))
+           ?? [];
+
+    public async Task<IReadOnlyCollection<CandleData>> GetCandleDataInternalAsync(string query)
     {
         using var http = _httpClientFactory.CreateClient();
-        await using var resStream = await http.GetStreamAsync(
-            $"https://query1.finance.yahoo.com/v7/finance/download/{query}"
-            + $"?period1={DateTime.UtcNow.Subtract(30.Days()).ToTimestamp()}"
-            + $"&period2={DateTime.UtcNow.ToTimestamp()}"
-            + "&interval=1d");
 
-        using var textReader = new StreamReader(resStream);
-        using var csv = new CsvReader(textReader, _csvConfig);
-        var records = csv.GetRecords<YahooFinanceCandleData>().ToArray();
+        var now = DateTime.UtcNow;
+        var fromdate = now.Subtract(30.Days()).ToString("yyyy-MM-dd");
+        var todate = now.ToString("yyyy-MM-dd");
 
-        return records
-            .Map(static x => new CandleData(x.Open, x.Close, x.High, x.Low, x.Volume));
+        var res = await GetNasdaqDataResponse<NasdaqChartResponse>(
+            $"https://api.nasdaq.com/api/quote/{query}/chart?assetclass=stocks"
+            + $"&fromdate={fromdate}"
+            + $"&todate={todate}");
+
+        if (res?.Data?.Chart is not { } chart)
+            return Array.Empty<CandleData>();
+
+
+        return chart.Select(d => new CandleData(d.Z.Open,
+                        d.Z.Close,
+                        d.Z.High,
+                        d.Z.Low,
+                        (long)double.Parse(d.Z.Volume, NumberStyles.Any, CultureInfo.InvariantCulture)))
+                    .ToList();
     }
 }
\ No newline at end of file
diff --git a/src/EllieBot/Modules/Searches/Crypto/_common/NasdaqChartResponse.cs b/src/EllieBot/Modules/Searches/Crypto/_common/NasdaqChartResponse.cs
new file mode 100644
index 0000000..d4c163b
--- /dev/null
+++ b/src/EllieBot/Modules/Searches/Crypto/_common/NasdaqChartResponse.cs
@@ -0,0 +1,20 @@
+namespace EllieBot.Modules.Searches;
+
+public sealed class NasdaqChartResponse
+{
+    public required NasdaqChartResponseData[] Chart { get; init; }
+
+    public sealed class NasdaqChartResponseData
+    {
+        public required CandleData Z { get; init; }
+
+        public sealed class CandleData
+        {
+            public required decimal High { get; init; }
+            public required decimal Low { get; init; }
+            public required decimal Open { get; init; }
+            public required decimal Close { get; init; }
+            public required string Volume { get; init; }
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/EllieBot/Modules/Searches/Crypto/_common/NasdaqDataResponse.cs b/src/EllieBot/Modules/Searches/Crypto/_common/NasdaqDataResponse.cs
new file mode 100644
index 0000000..2370ca8
--- /dev/null
+++ b/src/EllieBot/Modules/Searches/Crypto/_common/NasdaqDataResponse.cs
@@ -0,0 +1,6 @@
+namespace EllieBot.Modules.Searches;
+
+public sealed class NasdaqDataResponse<T>
+{
+    public required T? Data { get; init; }
+}
\ No newline at end of file
diff --git a/src/EllieBot/Modules/Searches/Crypto/_common/NasdaqSummaryResponse.cs b/src/EllieBot/Modules/Searches/Crypto/_common/NasdaqSummaryResponse.cs
new file mode 100644
index 0000000..7803eff
--- /dev/null
+++ b/src/EllieBot/Modules/Searches/Crypto/_common/NasdaqSummaryResponse.cs
@@ -0,0 +1,44 @@
+using System.Text.Json.Serialization;
+
+namespace EllieBot.Modules.Searches;
+
+public sealed class NasdaqSummaryResponse
+{
+    public required string Symbol { get; init; }
+
+    public required NasdaqSummaryResponseData SummaryData { get; init; }
+    public required NasdaqSummaryBidAsk BidAsk { get; init; }
+
+    public sealed class NasdaqSummaryBidAsk
+    {
+        [JsonPropertyName("Bid * Size")]
+        public required NasdaqBid Bid { get; init; }
+
+        public sealed class NasdaqBid
+        {
+            public required string Value { get; init; }
+        }
+    }
+
+    public sealed class NasdaqSummaryResponseData
+    {
+        public required PreviousCloseData PreviousClose { get; init; }
+        public required MarketCapData MarketCap { get; init; }
+        public required AverageVolumeData AverageVolume { get; init; }
+
+        public sealed class PreviousCloseData
+        {
+            public required string Value { get; init; }
+        }
+
+        public sealed class MarketCapData
+        {
+            public required string Value { get; init; }
+        }
+
+        public sealed class AverageVolumeData
+        {
+            public required string Value { get; init; }
+        }
+    }
+}
\ No newline at end of file

From 491e9b5a6f35dd901410ea40b943cfaf4acad1cb Mon Sep 17 00:00:00 2001
From: Toastie <toastie@toastiet0ast.com>
Date: Fri, 31 Jan 2025 13:11:19 +1300
Subject: [PATCH 04/10] fixed captcha cutting off

---
 src/EllieBot/Modules/Gambling/Gambling.cs     | 35 +------------------
 .../Modules/Games/Fish/CaptchaService.cs      |  4 +--
 2 files changed, 3 insertions(+), 36 deletions(-)

diff --git a/src/EllieBot/Modules/Gambling/Gambling.cs b/src/EllieBot/Modules/Gambling/Gambling.cs
index dafdfe1..7d0459b 100644
--- a/src/EllieBot/Modules/Gambling/Gambling.cs
+++ b/src/EllieBot/Modules/Gambling/Gambling.cs
@@ -162,7 +162,7 @@ public partial class Gambling : GamblingModule<GamblingService>
 
             if (password is not null)
             {
-                var img = GetPasswordImage(password);
+                var img = _captchaService.GetPasswordImage(password);
                 await using var stream = await img.ToStreamAsync();
                 var toSend = Response()
                     .File(stream, "timely.png");
@@ -194,39 +194,6 @@ public partial class Gambling : GamblingModule<GamblingService>
         await ClaimTimely();
     }
 
-    private Image<Rgba32> GetPasswordImage(string password)
-    {
-        var img = new Image<Rgba32>(50, 24);
-
-        var font = _fonts.NotoSans.CreateFont(22);
-        var outlinePen = new SolidPen(Color.Black, 0.5f);
-        var strikeoutRun = new RichTextRun
-        {
-            Start = 0,
-            End = password.GetGraphemeCount(),
-            Font = font,
-            StrikeoutPen = new SolidPen(Color.White, 4),
-            TextDecorations = TextDecorations.Strikeout
-        };
-        // draw password on the image
-        img.Mutate(x =>
-        {
-            x.DrawText(new RichTextOptions(font)
-            {
-                HorizontalAlignment = HorizontalAlignment.Center,
-                VerticalAlignment = VerticalAlignment.Center,
-                FallbackFontFamilies = _fonts.FallBackFonts,
-                Origin = new(25, 12),
-                TextRuns = [strikeoutRun]
-            },
-                password,
-                Brushes.Solid(Color.White),
-                outlinePen);
-        });
-
-        return img;
-    }
-
     private async Task ClaimTimely()
     {
         var period = Config.Timely.Cooldown;
diff --git a/src/EllieBot/Modules/Games/Fish/CaptchaService.cs b/src/EllieBot/Modules/Games/Fish/CaptchaService.cs
index 6ec1ed5..cecf6cb 100644
--- a/src/EllieBot/Modules/Games/Fish/CaptchaService.cs
+++ b/src/EllieBot/Modules/Games/Fish/CaptchaService.cs
@@ -16,7 +16,7 @@ public sealed class CaptchaService(FontProvider fonts, IBotCache cache, IPatrona
 
     public Image<Rgba32> GetPasswordImage(string password)
     {
-        var img = new Image<Rgba32>(50, 24);
+        var img = new Image<Rgba32>(60, 34);
 
         var font = fonts.NotoSans.CreateFont(22);
         var outlinePen = new SolidPen(Color.Black, 0.5f);
@@ -38,7 +38,7 @@ public sealed class CaptchaService(FontProvider fonts, IBotCache cache, IPatrona
                     HorizontalAlignment = HorizontalAlignment.Center,
                     VerticalAlignment = VerticalAlignment.Center,
                     FallbackFontFamilies = fonts.FallBackFonts,
-                    Origin = new(25, 12),
+                    Origin = new(30, 15),
                     TextRuns = [strikeoutRun]
                 },
                 password,

From c6ea3fd36f93095b4e9d9ba02aa819a47fa8325f Mon Sep 17 00:00:00 2001
From: Toastie <toastie@toastiet0ast.com>
Date: Fri, 31 Jan 2025 13:16:12 +1300
Subject: [PATCH 05/10] global ellie captcha patron add will show 12.5% of the
 time now, down from 20%, and be smaller

---
 src/EllieBot/Modules/Gambling/Gambling.cs       | 4 ++--
 src/EllieBot/Modules/Games/Fish/FishCommands.cs | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/EllieBot/Modules/Gambling/Gambling.cs b/src/EllieBot/Modules/Gambling/Gambling.cs
index 7d0459b..2654e2d 100644
--- a/src/EllieBot/Modules/Gambling/Gambling.cs
+++ b/src/EllieBot/Modules/Gambling/Gambling.cs
@@ -168,9 +168,9 @@ public partial class Gambling : GamblingModule<GamblingService>
                     .File(stream, "timely.png");
 
 #if GLOBAL_ELLIE
-                if (_rng.Next(0, 5) == 0)
+                if (_rng.Next(0, 8) == 0)
                     toSend = toSend
-                        .Confirm("[Sub on Patreon](https://patreon.com/elliebot) to remove captcha.");
+                        .Text("*[Sub on Patreon](https://patreon.com/elliebot) to remove captcha.*");
 #endif
 
                 var captchaMessage = await toSend.SendAsync();
diff --git a/src/EllieBot/Modules/Games/Fish/FishCommands.cs b/src/EllieBot/Modules/Games/Fish/FishCommands.cs
index 903b58a..d89c289 100644
--- a/src/EllieBot/Modules/Games/Fish/FishCommands.cs
+++ b/src/EllieBot/Modules/Games/Fish/FishCommands.cs
@@ -33,9 +33,9 @@ public partial class Games
                         .File(stream, "timely.png");
 
 #if GLOBAL_ELLIE
-                    if (_rng.Next(0, 5) == 0)
+                    if (_rng.Next(0, 8) == 0)
                         toSend = toSend
-                            .Confirm("[Sub on Patreon](https://patreon.com/elliebot) to remove captcha.");
+                            .Text("*[Sub on Patreon](https://patreon.com/elliebot) to remove captcha.*");
 #endif
                     var captcha = await toSend.SendAsync();
 

From 4fb4a2d0c31dc729004a6f35c70c5d170a2dd031 Mon Sep 17 00:00:00 2001
From: Toastie <toastie@toastiet0ast.com>
Date: Fri, 31 Jan 2025 13:49:31 +1300
Subject: [PATCH 06/10] increased todo and archive limits slightly

---
 .../Modules/Utility/Todo/TodoCommands.cs      | 27 ++++++++++++++++---
 .../Modules/Utility/Todo/TodoService.cs       |  8 +++---
 src/EllieBot/data/aliases.yml                 |  5 ++++
 .../data/strings/commands/commands.en-US.yml  |  7 +++++
 4 files changed, 39 insertions(+), 8 deletions(-)

diff --git a/src/EllieBot/Modules/Utility/Todo/TodoCommands.cs b/src/EllieBot/Modules/Utility/Todo/TodoCommands.cs
index ed941d6..e39a280 100644
--- a/src/EllieBot/Modules/Utility/Todo/TodoCommands.cs
+++ b/src/EllieBot/Modules/Utility/Todo/TodoCommands.cs
@@ -150,7 +150,26 @@ public partial class Utility
             [Cmd]
             public async Task TodoArchiveAdd([Leftover] string name)
             {
-                var result = await _service.ArchiveTodosAsync(ctx.User.Id, name);
+                var result = await _service.ArchiveTodosAsync(ctx.User.Id, name, false);
+                if (result == ArchiveTodoResult.NoTodos)
+                {
+                    await Response().Error(strs.todo_no_todos).SendAsync();
+                    return;
+                }
+
+                if (result == ArchiveTodoResult.MaxLimitReached)
+                {
+                    await Response().Error(strs.todo_archive_max_limit).SendAsync();
+                    return;
+                }
+
+                await ctx.OkAsync();
+            }
+
+            [Cmd]
+            public async Task TodoArchiveDone([Leftover] string name)
+            {
+                var result = await _service.ArchiveTodosAsync(ctx.User.Id, name, true);
                 if (result == ArchiveTodoResult.NoTodos)
                 {
                     await Response().Error(strs.todo_no_todos).SendAsync();
@@ -193,7 +212,7 @@ public partial class Utility
 
                           foreach (var archivedList in items)
                           {
-                              eb.AddField($"id: {archivedList.Id.ToString()}", archivedList.Name, true);
+                              eb.AddField($"id: {new kwum(archivedList.Id)}", archivedList.Name, true);
                           }
 
                           return eb;
@@ -202,7 +221,7 @@ public partial class Utility
             }
 
             [Cmd]
-            public async Task TodoArchiveShow(int id)
+            public async Task TodoArchiveShow(kwum id)
             {
                 var list = await _service.GetArchivedTodoListAsync(ctx.User.Id, id);
                 if (list == null || list.Items.Count == 0)
@@ -234,7 +253,7 @@ public partial class Utility
             }
 
             [Cmd]
-            public async Task TodoArchiveDelete(int id)
+            public async Task TodoArchiveDelete(kwum id)
             {
                 if (!await _service.ArchiveDeleteAsync(ctx.User.Id, id))
                 {
diff --git a/src/EllieBot/Modules/Utility/Todo/TodoService.cs b/src/EllieBot/Modules/Utility/Todo/TodoService.cs
index ab7f3bf..f349e38 100644
--- a/src/EllieBot/Modules/Utility/Todo/TodoService.cs
+++ b/src/EllieBot/Modules/Utility/Todo/TodoService.cs
@@ -6,8 +6,8 @@ namespace EllieBot.Modules.Utility;
 
 public sealed class TodoService : IEService
 {
-    private const int ARCHIVE_MAX_COUNT = 9;
-    private const int TODO_MAX_COUNT = 27;
+    private const int ARCHIVE_MAX_COUNT = 18;
+    private const int TODO_MAX_COUNT = 36;
 
     private readonly DbService _db;
 
@@ -111,7 +111,7 @@ public sealed class TodoService : IEService
               .DeleteAsync();
     }
 
-    public async Task<ArchiveTodoResult> ArchiveTodosAsync(ulong userId, string name)
+    public async Task<ArchiveTodoResult> ArchiveTodosAsync(ulong userId, string name, bool onlyDone)
     {
         // create a new archive
 
@@ -140,7 +140,7 @@ public sealed class TodoService : IEService
 
         var updated = await ctx
                             .GetTable<TodoModel>()
-                            .Where(x => x.UserId == userId && x.ArchiveId == null)
+                            .Where(x => x.UserId == userId && (!onlyDone || x.IsDone) && x.ArchiveId == null)
                             .Set(x => x.ArchiveId, inserted.Id)
                             .UpdateAsync();
 
diff --git a/src/EllieBot/data/aliases.yml b/src/EllieBot/data/aliases.yml
index 2f31667..969bfe0 100644
--- a/src/EllieBot/data/aliases.yml
+++ b/src/EllieBot/data/aliases.yml
@@ -1441,6 +1441,11 @@ todoarchivedelete:
   - del
   - remove
   - rm
+todoarchivedone:
+  - done
+  - compelete
+  - finish
+  - completed
 todoedit:
   - edit
   - change
diff --git a/src/EllieBot/data/strings/commands/commands.en-US.yml b/src/EllieBot/data/strings/commands/commands.en-US.yml
index f3b3253..720ea39 100644
--- a/src/EllieBot/data/strings/commands/commands.en-US.yml
+++ b/src/EllieBot/data/strings/commands/commands.en-US.yml
@@ -4524,6 +4524,13 @@ todoarchiveadd:
   params:
     - name:
         desc: "The name of the archive to be created."
+todoarchivedone:
+  desc: Creates a new archive with the specified name using only completed current todos.
+  ex:
+    - Success!
+  params:
+    - name:
+        desc: "The name of the archive to be created."
 todoarchivelist:
   desc: Lists all archived todo lists.
   ex:

From 96ce7b192e4e881f86d35639ab6b7a6f4373bd60 Mon Sep 17 00:00:00 2001
From: Toastie <toastie@toastiet0ast.com>
Date: Fri, 31 Jan 2025 17:06:12 +1300
Subject: [PATCH 07/10] added .todo archive done <name>, to create an
 alternative to .todo archive add <name> in case you want to create an archive
 of only currently completed todos Updated CHANGELOG.md, upped version to
 5.3.9

---
 CHANGELOG.md                 | 21 ++++++++++++++++++++-
 src/EllieBot/EllieBot.csproj |  2 +-
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0845049..2b5a04c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,25 @@
 
 Mostly based on [keepachangelog](https://keepachangelog.com/en/1.1.0/) except date format. a-c-f-r-o
 
+## [5.3.9] - 31.01.2025
+
+## Added  
+
+- Added `.todo archive done <name>` 
+    - Creates an archive of only currently completed todos 
+    - An alternative to ".todo archive add <name>" which moves all todos to an archive
+
+## Changed
+
+- Increased todo and archive limits slightly
+- Global ellie captcha patron ad will show 12.5% of the time now, down from 20%, and be smaller 
+- `.remind` now has a 1 year max timeout, up from 2 months
+
+## Fixed
+
+- Captcha is now slightly bigger, with larger margin, to mitigate phone edge issues
+- Fixed `.stock` command, unless there is some ip blocking going on
+
 ## [5.3.8] - 29.01.2025
 
 ## Fixed
@@ -195,7 +214,7 @@ Mostly based on [keepachangelog](https://keepachangelog.com/en/1.1.0/) except da
 
 - Self Assigned Roles reworked! Use `.h .sar` for the list of commands
     - `.sar autodel`
-        - Toggles the automatic deletion of the user's message and Nadeko's confirmations for .iam and .iamn commands.
+        - Toggles the automatic deletion of the user's message and Ellie's confirmations for .iam and .iamn commands.
     - `.sar ad`
         - Adds a role to the list of self-assignable roles. You can also specify a group.
         - If 'Exclusive self-assignable roles' feature is enabled (.sar exclusive), users will be able to pick one role
diff --git a/src/EllieBot/EllieBot.csproj b/src/EllieBot/EllieBot.csproj
index 7dd0e0e..7295d9e 100644
--- a/src/EllieBot/EllieBot.csproj
+++ b/src/EllieBot/EllieBot.csproj
@@ -4,7 +4,7 @@
     <Nullable>enable</Nullable>
     <ImplicitUsings>true</ImplicitUsings>
     <SatelliteResourceLanguages>en</SatelliteResourceLanguages>
-    <Version>5.3.8</Version>
+    <Version>5.3.9</Version>
 
     <!-- Output/build -->
     <RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory>

From bc4ab57a6713c85fd1d90cef9faa990673212b85 Mon Sep 17 00:00:00 2001
From: Toastie <toastie@toastiet0ast.com>
Date: Mon, 3 Feb 2025 00:19:29 +1300
Subject: [PATCH 08/10] .delete will now accept a message link

---
 .../Modules/Administration/Administration.cs  | 19 +++++++++++++++----
 .../data/strings/commands/commands.en-US.yml  | 10 +++++++++-
 2 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/src/EllieBot/Modules/Administration/Administration.cs b/src/EllieBot/Modules/Administration/Administration.cs
index b9332be..fac8320 100644
--- a/src/EllieBot/Modules/Administration/Administration.cs
+++ b/src/EllieBot/Modules/Administration/Administration.cs
@@ -97,9 +97,9 @@ public partial class Administration : EllieModule<AdministrationService>
         var (enabled, channels) = _service.GetDelMsgOnCmdData(ctx.Guild.Id);
 
         var embed = CreateEmbed()
-                       .WithOkColor()
-                       .WithTitle(GetText(strs.server_delmsgoncmd))
-                       .WithDescription(enabled ? "✅" : "❌");
+                    .WithOkColor()
+                    .WithTitle(GetText(strs.server_delmsgoncmd))
+                    .WithDescription(enabled ? "✅" : "❌");
 
         var str = string.Join("\n",
             channels.Select(x =>
@@ -301,6 +301,16 @@ public partial class Administration : EllieModule<AdministrationService>
     public Task Delete(ulong messageId, ParsedTimespan timespan = null)
         => Delete((ITextChannel)ctx.Channel, messageId, timespan);
 
+    [Cmd]
+    [RequireContext(ContextType.Guild)]
+    public async Task Delete(MessageLink messageLink, ParsedTimespan timespan = null)
+    {
+        if (messageLink.Channel is not ITextChannel tc)
+            return;
+
+        await Delete(tc, messageLink.Message.Id, timespan);
+    }
+
     [Cmd]
     [RequireContext(ContextType.Guild)]
     public async Task Delete(ITextChannel channel, ulong messageId, ParsedTimespan timespan = null)
@@ -373,7 +383,8 @@ public partial class Administration : EllieModule<AdministrationService>
         if (ctx.Channel is not SocketTextChannel stc)
             return;
 
-        var t = stc.Threads.FirstOrDefault(x => string.Equals(x.Name, name, StringComparison.InvariantCultureIgnoreCase));
+        var t = stc.Threads.FirstOrDefault(
+            x => string.Equals(x.Name, name, StringComparison.InvariantCultureIgnoreCase));
 
         if (t is null)
         {
diff --git a/src/EllieBot/data/strings/commands/commands.en-US.yml b/src/EllieBot/data/strings/commands/commands.en-US.yml
index 720ea39..75623e5 100644
--- a/src/EllieBot/data/strings/commands/commands.en-US.yml
+++ b/src/EllieBot/data/strings/commands/commands.en-US.yml
@@ -4134,7 +4134,11 @@ edit:
       text:
         desc: "The new text content of the edited message."
 delete:
-  desc: Deletes a single message given the channel and message ID. If channel is ommited, message will be searched for in the current channel. You can also specify time parameter after which the message will be deleted (up to 7 days). This timer won't persist through bot restarts.
+  desc: |-
+    Deletes a single message given the channel and message ID, or a message link.
+    If channel is omitted, message will be searched for in the current channel.
+    You can also specify time parameter after which the message will be deleted (up to 7 days).
+    This timer won't persist through bot restarts.
   ex:
     - '#chat 771562360594628608'
     - 771562360594628608
@@ -4144,6 +4148,10 @@ delete:
         desc: "The id of a specific message within a channel, used to target the deletion operation."
       time:
         desc: "The duration after which the message should be automatically deleted."
+    - messageLink:
+        desc: "The link of the message to delete. It must be on the same server."
+      time:
+        desc: "The duration after which the message should be automatically deleted."
     - channel:
         desc: "The channel where the message is located or should be searched for."
       messageId:

From fb2642904dd5cdc286f67ca4afc20540236fccad Mon Sep 17 00:00:00 2001
From: Toastie <toastie@toastiet0ast.com>
Date: Mon, 3 Feb 2025 00:25:00 +1300
Subject: [PATCH 09/10] Updated LICENSE.md to reserve all rights, removed some
 missing files

---
 .gitignore |   8 ++-
 LICENSE    | 202 ++---------------------------------------------------
 2 files changed, 11 insertions(+), 199 deletions(-)

diff --git a/.gitignore b/.gitignore
index 8c045b8..a6cf868 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,6 +20,7 @@ src/EllieBot/credentials.json
 src/EllieBot/old_credentials.json 
 src/EllieBot/credentials.json.bak
 src/EllieBot/data/EllieBot.db
+# scripts
 ellie-menu.ps1
 package.sh
 
@@ -371,4 +372,9 @@ __pycache__/
 
 ### VisualStudio Patch ###
 build/
-site/
\ No newline at end of file
+site/
+
+## AI
+
+.aider.*
+PROMPT.md
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
index 109d49a..866a73c 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,201 +1,7 @@
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
+Copyright 2025 Toastie & EllieBotDevs
 
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 
-   1. Definitions.
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright 2024 Toastie_t0ast
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
\ No newline at end of file
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

From 86a4a1ca9904f59a69211d42f1e4356d9953b581 Mon Sep 17 00:00:00 2001
From: Toastie <toastie@toastiet0ast.com>
Date: Mon, 3 Feb 2025 00:26:13 +1300
Subject: [PATCH 10/10] Reverted LICENSE file change

---
 LICENSE | 202 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 198 insertions(+), 4 deletions(-)

diff --git a/LICENSE b/LICENSE
index 866a73c..87fa19d 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,7 +1,201 @@
-Copyright 2025 Toastie & EllieBotDevs
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
 
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
 
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+   1. Definitions.
 
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright 2025 Toastie_t0ast
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
\ No newline at end of file