mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-13 01:00:12 +00:00
feat: add logclean support for Dozer bot (#580)
This commit is contained in:
parent
deeb3ad3a4
commit
878ca63b65
2 changed files with 10 additions and 0 deletions
|
|
@ -38,6 +38,7 @@ public class LoggerCleanService
|
||||||
private static readonly Regex _GearBotRegex = new("\\(``(\\d{17,19})``\\) in <#\\d{17,19}> has been removed.");
|
private static readonly Regex _GearBotRegex = new("\\(``(\\d{17,19})``\\) in <#\\d{17,19}> has been removed.");
|
||||||
private static readonly Regex _GiselleRegex = new("\\*\\*Message ID\\*\\*: `(\\d{17,19})`");
|
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 _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 _VortexRegex =
|
private static readonly Regex _VortexRegex =
|
||||||
new("`\\[(\\d\\d:\\d\\d:\\d\\d)\\]` .* \\(ID:(\\d{17,19})\\).* <#\\d{17,19}>:");
|
new("`\\[(\\d\\d:\\d\\d:\\d\\d)\\]` .* \\(ID:(\\d{17,19})\\).* <#\\d{17,19}>:");
|
||||||
|
|
@ -71,6 +72,7 @@ public class LoggerCleanService
|
||||||
new LoggerBot("Vortex", 240254129333731328, fuzzyExtractFunc: ExtractVortex),
|
new LoggerBot("Vortex", 240254129333731328, fuzzyExtractFunc: ExtractVortex),
|
||||||
new LoggerBot("ProBot", 282859044593598464, fuzzyExtractFunc: ExtractProBot), // webhook
|
new LoggerBot("ProBot", 282859044593598464, fuzzyExtractFunc: ExtractProBot), // webhook
|
||||||
new LoggerBot("ProBot Prime", 567703512763334685, fuzzyExtractFunc: ExtractProBot), // webhook (?)
|
new LoggerBot("ProBot Prime", 567703512763334685, fuzzyExtractFunc: ExtractProBot), // webhook (?)
|
||||||
|
new LoggerBot("Dozer", 356535250932858885, ExtractDozer),
|
||||||
}.ToDictionary(b => b.Id);
|
}.ToDictionary(b => b.Id);
|
||||||
|
|
||||||
private static Dictionary<ulong, LoggerBot> _botsByApplicationId
|
private static Dictionary<ulong, LoggerBot> _botsByApplicationId
|
||||||
|
|
@ -364,6 +366,13 @@ public class LoggerCleanService
|
||||||
: null;
|
: null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static ulong? ExtractDozer(Message msg)
|
||||||
|
{
|
||||||
|
var embed = msg.Embeds?.FirstOrDefault();
|
||||||
|
var match = _DozerRegex.Match(embed?.Footer.Text);
|
||||||
|
return match.Success ? ulong.Parse(match.Groups[2].Value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
public class LoggerBot
|
public class LoggerBot
|
||||||
{
|
{
|
||||||
public ulong Id;
|
public ulong Id;
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ At the moment, log cleanup works with the following bots:
|
||||||
- [blargbot](https://blargbot.xyz/) (precise)
|
- [blargbot](https://blargbot.xyz/) (precise)
|
||||||
- [Carl-bot](https://carl.gg/) (precise)
|
- [Carl-bot](https://carl.gg/) (precise)
|
||||||
- [Circle](https://circlebot.xyz/) (fuzzy)
|
- [Circle](https://circlebot.xyz/) (fuzzy)
|
||||||
|
- [Dozer](https://github.com/frcdiscord/dozer) (precise)
|
||||||
- [Dyno](https://dyno.gg/) (precise)
|
- [Dyno](https://dyno.gg/) (precise)
|
||||||
- [GearBot](https://gearbot.rocks/) (fuzzy)
|
- [GearBot](https://gearbot.rocks/) (fuzzy)
|
||||||
- [GenericBot](https://github.com/galenguyer/GenericBot) (precise)
|
- [GenericBot](https://github.com/galenguyer/GenericBot) (precise)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue