diff --git a/src/Commands/BanCommandGroup.cs b/src/Commands/BanCommandGroup.cs index 926e615..6dbf9b9 100644 --- a/src/Commands/BanCommandGroup.cs +++ b/src/Commands/BanCommandGroup.cs @@ -196,12 +196,8 @@ public class BanCommandGroup : CommandGroup title, target) .WithColour(ColorsList.Green).Build(); - var logResult = _utility.LogActionAsync( + _utility.LogAction( data.Settings, channelId, executor, title, description, target, ColorsList.Red, ct: ct); - if (!logResult.IsSuccess) - { - return Result.FromError(logResult.Error); - } return await _feedback.SendContextualEmbedResultAsync(embed, ct: ct); } @@ -287,12 +283,9 @@ public class BanCommandGroup : CommandGroup var title = string.Format(Messages.UserUnbanned, target.GetTag()); var description = new StringBuilder().AppendBulletPoint(string.Format(Messages.DescriptionActionReason, reason)); - var logResult = _utility.LogActionAsync( + + _utility.LogAction( data.Settings, channelId, executor, title, description.ToString(), target, ColorsList.Green, ct: ct); - if (!logResult.IsSuccess) - { - return Result.FromError(logResult.Error); - } return await _feedback.SendContextualEmbedResultAsync(embed, ct: ct); } diff --git a/src/Commands/ClearCommandGroup.cs b/src/Commands/ClearCommandGroup.cs index 1d0ad64..395810f 100644 --- a/src/Commands/ClearCommandGroup.cs +++ b/src/Commands/ClearCommandGroup.cs @@ -136,12 +136,8 @@ public class ClearCommandGroup : CommandGroup return Result.FromError(deleteResult.Error); } - var logResult = _utility.LogActionAsync( + _utility.LogAction( data.Settings, channelId, executor, title, description, bot, ColorsList.Red, false, ct); - if (!logResult.IsSuccess) - { - return Result.FromError(logResult.Error); - } var embed = new EmbedBuilder().WithSmallTitle(title, bot) .WithColour(ColorsList.Green).Build(); diff --git a/src/Commands/KickCommandGroup.cs b/src/Commands/KickCommandGroup.cs index a278fb4..0faa1d3 100644 --- a/src/Commands/KickCommandGroup.cs +++ b/src/Commands/KickCommandGroup.cs @@ -157,12 +157,9 @@ public class KickCommandGroup : CommandGroup var title = string.Format(Messages.UserKicked, target.GetTag()); var description = MarkdownExtensions.BulletPoint(string.Format(Messages.DescriptionActionReason, reason)); - var logResult = _utility.LogActionAsync( + + _utility.LogAction( data.Settings, channelId, executor, title, description, target, ColorsList.Red, ct: ct); - if (!logResult.IsSuccess) - { - return Result.FromError(logResult.Error); - } var embed = new EmbedBuilder().WithSmallTitle( string.Format(Messages.UserKicked, target.GetTag()), target) diff --git a/src/Commands/MuteCommandGroup.cs b/src/Commands/MuteCommandGroup.cs index 0156f82..788eb2c 100644 --- a/src/Commands/MuteCommandGroup.cs +++ b/src/Commands/MuteCommandGroup.cs @@ -153,12 +153,8 @@ public class MuteCommandGroup : CommandGroup .AppendBulletPoint(string.Format( Messages.DescriptionActionExpiresAt, Markdown.Timestamp(until))).ToString(); - var logResult = _utility.LogActionAsync( + _utility.LogAction( data.Settings, channelId, executor, title, description, target, ColorsList.Red, ct: ct); - if (!logResult.IsSuccess) - { - return Result.FromError(logResult.Error); - } var embed = new EmbedBuilder().WithSmallTitle( string.Format(Messages.UserMuted, target.GetTag()), target) @@ -339,12 +335,9 @@ public class MuteCommandGroup : CommandGroup var title = string.Format(Messages.UserUnmuted, target.GetTag()); var description = MarkdownExtensions.BulletPoint(string.Format(Messages.DescriptionActionReason, reason)); - var logResult = _utility.LogActionAsync( + + _utility.LogAction( data.Settings, channelId, executor, title, description, target, ColorsList.Green, ct: ct); - if (!logResult.IsSuccess) - { - return Result.FromError(logResult.Error); - } var embed = new EmbedBuilder().WithSmallTitle( string.Format(Messages.UserUnmuted, target.GetTag()), target) diff --git a/src/Commands/SettingsCommandGroup.cs b/src/Commands/SettingsCommandGroup.cs index ce7472f..acfb8ed 100644 --- a/src/Commands/SettingsCommandGroup.cs +++ b/src/Commands/SettingsCommandGroup.cs @@ -218,12 +218,8 @@ public class SettingsCommandGroup : CommandGroup var title = Messages.SettingSuccessfullyChanged; var description = builder.ToString(); - var logResult = _utility.LogActionAsync( + _utility.LogAction( data.Settings, channelId, executor, title, description, bot, ColorsList.Magenta, false, ct); - if (!logResult.IsSuccess) - { - return Result.FromError(logResult.Error); - } var embed = new EmbedBuilder().WithSmallTitle(title, bot) .WithDescription(description) diff --git a/src/Services/Utility.cs b/src/Services/Utility.cs index 401b067..ad06315 100644 --- a/src/Services/Utility.cs +++ b/src/Services/Utility.cs @@ -196,7 +196,7 @@ public sealed class Utility /// /// The cancellation token for this operation. /// A result which has succeeded. - public Result LogActionAsync( + public void LogAction( JsonNode cfg, Snowflake channelId, IUser user, string title, string description, IUser avatar, Color color, bool isPublic = true, CancellationToken ct = default) { @@ -205,7 +205,7 @@ public sealed class Utility if (GuildSettings.PublicFeedbackChannel.Get(cfg).EmptyOrEqualTo(channelId) && GuildSettings.PrivateFeedbackChannel.Get(cfg).EmptyOrEqualTo(channelId)) { - return Result.FromSuccess(); + return; } var logEmbed = new EmbedBuilder().WithSmallTitle(title, avatar) @@ -230,8 +230,6 @@ public sealed class Utility privateChannel, embedResult: logEmbed, ct: ct); } - - return Result.FromSuccess(); } public async Task> GetEmergencyFeedbackChannel(IGuild guild, GuildData data, CancellationToken ct)