Skip to content

Commit

Permalink
Add kicks, gags, and message deletions in stats count (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverbooth committed Sep 1, 2022
1 parent f75a319 commit e0c388e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Hammer/Commands/Infractions/InfractionCommand.Stats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,13 @@ public async Task StatsAsync(InteractionContext context)

embed.WithTitle("Infraction Statistics");
embed.AddField("Total Infractions", infractions.Count.ToString("N0"), true);
embed.AddField("Total Warnings", infractions.Count(i => i.Type is InfractionType.Warning).ToString("N0"), true);
embed.AddField("Total Mutes", infractions.Count(i => i.Type is InfractionType.TemporaryMute or InfractionType.Mute).ToString("N0"), true);
embed.AddField("Total Bans", infractions.Count(i => i.Type is InfractionType.TemporaryBan or InfractionType.Ban).ToString("N0"), true);
embed.AddField("Total Infracted Users", infractions.DistinctBy(i => i.UserId).Count().ToString("N0"), true);
embed.AddField("Infracted Users", infractions.DistinctBy(i => i.UserId).Count().ToString("N0"), true);
embed.AddField("Warnings", infractions.Count(i => i.Type is InfractionType.Warning).ToString("N0"), true);
embed.AddField("Mutes", infractions.Count(i => i.Type is InfractionType.TemporaryMute or InfractionType.Mute).ToString("N0"), true);
embed.AddField("Bans", infractions.Count(i => i.Type is InfractionType.TemporaryBan or InfractionType.Ban).ToString("N0"), true);
embed.AddField("Kicks", infractions.Count(i => i.Type is InfractionType.Kick).ToString("N0"), true);
embed.AddField("Gags", infractions.Count(i => i.Type is InfractionType.Gag).ToString("N0"), true);
embed.AddField("Messages Deleted", infractions.Count(i => i.Type is InfractionType.MessageDeletion).ToString("N0"), true);
}

var builder = new DiscordWebhookBuilder();
Expand Down

0 comments on commit e0c388e

Please sign in to comment.