public async Task ClearInfractionsAsync( [Summary("The user to clear the infractions from.")] GuildUserProxy user) { ulong userId = user.HasValue ? user.GuildUser.Id : user.ID; int clearedInfractions = Moderation.ClearInfractions(userId); EmbedBuilder builder = GetDefaultBuilder() .WithColor(Color.Green); if (user.HasValue) { builder.WithDescription($"**{clearedInfractions}** infraction(s) were cleared from {user.GuildUser}."); } else { builder.WithDescription($"**{clearedInfractions}** infraction(s) were cleared from {userId}."); } await builder.Build() .SendToChannel(Context.Channel); if (clearedInfractions > 0) { await ModerationLog.CreateEntry(ModerationLogEntry.New .WithDefaultsFromContext(Context) .WithActionType(ModerationActionType.ClearInfractions) .WithTarget(userId)); } }
public async Task ClearInfractionsAsync( [Summary("The user to clear the infractions from.")] SocketGuildUser user) { int clearedInfractions = Moderation.ClearInfractions(user); await GetDefaultBuilder() .WithDescription($"{clearedInfractions} infraction(s) were cleared from {user.Mention}.") .Build() .SendToChannel(Context.Channel); if (clearedInfractions > 0) { await ModerationLog.CreateEntry(ModerationLogEntry.New .WithDefaultsFromContext(Context) .WithActionType(ModerationActionType.ClearInfractions) .WithTarget(user)); } }