fix(bot): fix blargbot log cleanup

closes #467
This commit is contained in:
spiral 2022-12-29 01:50:04 +00:00
parent 9be65d03b1
commit 757a4ea5e2
No known key found for this signature in database
GPG Key ID: 244A11E4B0BCF40E

View File

@ -204,7 +204,7 @@ public class LoggerCleanService
// Embed, title ends with "Message Deleted", contains ID plain in a field. // Embed, title ends with "Message Deleted", contains ID plain in a field.
var embed = msg.Embeds?.FirstOrDefault(); var embed = msg.Embeds?.FirstOrDefault();
if (embed == null || !(embed.Title?.EndsWith("Message Deleted") ?? false)) return null; if (embed == null || !(embed.Title?.EndsWith("Message Deleted") ?? false)) return null;
var field = embed.Fields.FirstOrDefault(f => f.Name == "Message ID"); var field = embed.Fields.FirstOrDefault(f => f.Name == "Message Id");
var match = _basicRegex.Match(field.Value ?? ""); var match = _basicRegex.Match(field.Value ?? "");
return match.Success ? ulong.Parse(match.Groups[1].Value) : null; return match.Success ? ulong.Parse(match.Groups[1].Value) : null;
} }