diff --git a/PluralKit.Bot/Services/LoggerCleanService.cs b/PluralKit.Bot/Services/LoggerCleanService.cs index 7df10227..72d0d599 100644 --- a/PluralKit.Bot/Services/LoggerCleanService.cs +++ b/PluralKit.Bot/Services/LoggerCleanService.cs @@ -39,6 +39,7 @@ public class LoggerCleanService private static readonly Regex _GiselleRegex = new("\\*\\*Message ID\\*\\*: `(\\d{17,19})`"); private static readonly Regex _ProBotRegex = new("\\*\\*Message sent by <@(\\d{17,19})> deleted in <#\\d{17,19}>.\\*\\*"); private static readonly Regex _DozerRegex = new("Message ID: (\\d{17,19}) - (\\d{17,19})\nUserID: (\\d{17,19})"); + private static readonly Regex _SkyraRegex = new("https://discord.com/channels/(\\d{17,19})/(\\d{17,19})/(\\d{17,19})"); private static readonly Regex _VortexRegex = new("`\\[(\\d\\d:\\d\\d:\\d\\d)\\]` .* \\(ID:(\\d{17,19})\\).* <#\\d{17,19}>:"); @@ -73,6 +74,7 @@ public class LoggerCleanService new LoggerBot("ProBot", 282859044593598464, fuzzyExtractFunc: ExtractProBot), // webhook new LoggerBot("ProBot Prime", 567703512763334685, fuzzyExtractFunc: ExtractProBot), // webhook (?) new LoggerBot("Dozer", 356535250932858885, ExtractDozer), + new LoggerBot("Skyra", 266624760782258186, ExtractSkyra), }.ToDictionary(b => b.Id); private static Dictionary _botsByApplicationId @@ -365,7 +367,7 @@ public class LoggerCleanService } : null; } - + private static ulong? ExtractDozer(Message msg) { var embed = msg.Embeds?.FirstOrDefault(); @@ -373,6 +375,14 @@ public class LoggerCleanService return match.Success ? ulong.Parse(match.Groups[2].Value) : null; } + private static ulong? ExtractSkyra(Message msg) + { + var embed = msg.Embeds?.FirstOrDefault(); + if (embed?.Footer?.Text == null || !embed.Footer.Text.StartsWith("Message Deleted")) return null; + var match = _SkyraRegex.Match(embed.Author.Url); + return match.Success ? ulong.Parse(match.Groups[3].Value) : null; + } + public class LoggerBot { public ulong Id; diff --git a/docs/content/staff/compatibility.md b/docs/content/staff/compatibility.md index a6b10293..8fd6f018 100644 --- a/docs/content/staff/compatibility.md +++ b/docs/content/staff/compatibility.md @@ -34,6 +34,7 @@ At the moment, log cleanup works with the following bots: - [Mantaro](https://mantaro.site/) (precise) - [Pancake](https://pancake.gg/) (fuzzy) - [SafetyAtLast](https://www.safetyatlast.net/) (fuzzy) +- [Skyra](https://www.skyra.pw/) (precise) - [UnbelievaBoat](https://unbelievaboat.com/) (precise) - Vanessa (fuzzy) - [Vortex](https://github.com/jagrosh/Vortex/wiki) (fuzzy)