mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +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 _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 _VortexRegex =
|
||||
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("ProBot", 282859044593598464, fuzzyExtractFunc: ExtractProBot), // webhook
|
||||
new LoggerBot("ProBot Prime", 567703512763334685, fuzzyExtractFunc: ExtractProBot), // webhook (?)
|
||||
new LoggerBot("Dozer", 356535250932858885, ExtractDozer),
|
||||
}.ToDictionary(b => b.Id);
|
||||
|
||||
private static Dictionary<ulong, LoggerBot> _botsByApplicationId
|
||||
|
|
@ -363,6 +365,13 @@ public class LoggerCleanService
|
|||
}
|
||||
: 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
|
||||
{
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ At the moment, log cleanup works with the following bots:
|
|||
- [blargbot](https://blargbot.xyz/) (precise)
|
||||
- [Carl-bot](https://carl.gg/) (precise)
|
||||
- [Circle](https://circlebot.xyz/) (fuzzy)
|
||||
- [Dozer](https://github.com/frcdiscord/dozer) (precise)
|
||||
- [Dyno](https://dyno.gg/) (precise)
|
||||
- [GearBot](https://gearbot.rocks/) (fuzzy)
|
||||
- [GenericBot](https://github.com/galenguyer/GenericBot) (precise)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue