mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 13:06:50 +00:00
fix: No embed found early return (sapphire bot log cleanup)
Co-authored-by: violet <167108906+avioletheart@users.noreply.github.com>
This commit is contained in:
parent
36e8daf597
commit
0cc0ec935c
1 changed files with 1 additions and 0 deletions
|
|
@ -249,6 +249,7 @@ public class LoggerCleanService
|
|||
// Embed, Message title field: "Message deleted", description contains "**Message ID:** [[id]]"
|
||||
// Example: "**Message ID:** [1297549791927996598]"
|
||||
var embed = msg.Embeds?.FirstOrDefault();
|
||||
if (embed == null) return null;
|
||||
if (!(embed.Title?.StartsWith("Message deleted") ?? false)) return null;
|
||||
var match = _sapphireRegex.Match(embed.Description);
|
||||
return match.Success ? ulong.Parse(match.Groups[1].Value) : null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue