Skip to content

Commit

Permalink
Merge branch 'develop' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverbooth committed Mar 8, 2023
2 parents 2c69a8d + 0c81483 commit 6503590
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions Hammer/Commands/Infractions/InfractionCommand.Stats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,14 @@ public async Task StatsAsync(InteractionContext context)
int banCount = infractions.Count(i => i.Type is InfractionType.Ban);
var bans = $"{banCount + tempBanCount} ({tempBanCount}T / {banCount}P)";

long totalMuteDuration = _muteService.GetTemporaryMutes(context.Guild).Sum(m => m.ExpiresAt!.Value.Ticks);
long totalBanDuration = _banService.GetTemporaryBans(context.Guild).Sum(m => m.ExpiresAt.Ticks);
DateTimeOffset now = DateTimeOffset.UtcNow;
long remainingMuteDuration = _muteService.GetTemporaryMutes(context.Guild).Sum(m => (now - m.ExpiresAt!.Value).Ticks);
long remainingBanDuration = _banService.GetTemporaryBans(context.Guild).Sum(b => (now - b.ExpiresAt).Ticks);

embed.WithTitle("Infraction Statistics");
embed.AddField("Total Infractions", totalInfractions.ToString("N0"), true);
embed.AddField("Total Mute Duration", TimeSpan.FromTicks(totalMuteDuration).Humanize(), true);
embed.AddField("Total Ban Duration", TimeSpan.FromTicks(totalBanDuration).Humanize(), true);
embed.AddField("Remaining Mute Duration", TimeSpan.FromTicks(remainingMuteDuration).Humanize(), true);
embed.AddField("Remaining Ban Duration", TimeSpan.FromTicks(remainingBanDuration).Humanize(), true);

embed.AddField("Total Infracted Users", infractedUsers.ToString("N0"), true);
embed.AddField("Total Warned Users", warnedUsers.ToString("N0"), true);
Expand Down
2 changes: 1 addition & 1 deletion Hammer/Hammer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<VersionPrefix>5.0.0</VersionPrefix>
<VersionPrefix>5.0.1</VersionPrefix>
</PropertyGroup>

<PropertyGroup Condition="'$(VersionSuffix)' != '' And '$(BuildNumber)' == ''">
Expand Down

0 comments on commit 6503590

Please sign in to comment.