mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-04-30 11:09:54 +03:00
General fixes (#54)
Depends on #55 These changes are really small and I don't know how to reasonably split them into multiple PRs, but here's the changelog: - The result of the `UtilityService#LogActionAsync` call in `BanCommandGroup#BanUserAsync` is no longer ignored and it's errors will now prevent feedback from being sent; - Converted `if` statement to a `return` with ternary in `LanguageOption`; - Slightly decreased method complexity of `MessageDeletedResponder#RespondAsync` by cleverly using Results; - Changed the order of parameters for `UtilityService#LogActionAsync` to flow better; - Removed the exemption for `ConvertIfToReturnStatement` for InspectCode. --------- Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
parent
685688bbe8
commit
daa1dd4184
5 changed files with 19 additions and 20 deletions
|
@ -152,7 +152,9 @@ public class BanCommandGroup : CommandGroup {
|
|||
title, target)
|
||||
.WithColour(ColorsList.Green).Build();
|
||||
|
||||
_utility.LogActionAsync(cfg, channelId, title, target, description, user, CancellationToken);
|
||||
var logResult = _utility.LogActionAsync(cfg, channelId, user, title, description, target, CancellationToken);
|
||||
if (!logResult.IsSuccess)
|
||||
return Result.FromError(logResult.Error);
|
||||
|
||||
return await _feedbackService.SendContextualEmbedResultAsync(embed, CancellationToken);
|
||||
}
|
||||
|
@ -222,7 +224,7 @@ public class BanCommandGroup : CommandGroup {
|
|||
|
||||
var title = string.Format(Messages.UserUnbanned, target.GetTag());
|
||||
var description = string.Format(Messages.DescriptionActionReason, reason);
|
||||
var logResult = _utility.LogActionAsync(cfg, channelId, title, target, description, user, CancellationToken);
|
||||
var logResult = _utility.LogActionAsync(cfg, channelId, user, title, description, target, CancellationToken);
|
||||
if (!logResult.IsSuccess)
|
||||
return Result.FromError(logResult.Error);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue