mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-05-05 13:36:30 +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
|
@ -154,15 +154,15 @@ public class UtilityService : IHostedService {
|
|||
/// </summary>
|
||||
/// <param name="cfg">The guild configuration.</param>
|
||||
/// <param name="channelId">The ID of the channel where the action was executed.</param>
|
||||
/// <param name="title">The title for the embed.</param>
|
||||
/// <param name="avatar">The user whose avatar will be displayed next to the <paramref name="title" /> of the embed.</param>
|
||||
/// <param name="description">The description of the embed.</param>
|
||||
/// <param name="user">The user who performed the action.</param>
|
||||
/// <param name="title">The title for the embed.</param>
|
||||
/// <param name="description">The description of the embed.</param>
|
||||
/// <param name="avatar">The user whose avatar will be displayed next to the <paramref name="title" /> of the embed.</param>
|
||||
/// <param name="ct">The cancellation token for this operation.</param>
|
||||
/// <returns></returns>
|
||||
public Result LogActionAsync(
|
||||
JsonNode cfg, Snowflake channelId, string title, IUser avatar, string description,
|
||||
IUser user, CancellationToken ct = default) {
|
||||
JsonNode cfg, Snowflake channelId, IUser user, string title, string description, IUser avatar,
|
||||
CancellationToken ct = default) {
|
||||
var publicChannel = GuildSettings.PublicFeedbackChannel.Get(cfg);
|
||||
var privateChannel = GuildSettings.PrivateFeedbackChannel.Get(cfg);
|
||||
if (GuildSettings.PublicFeedbackChannel.Get(cfg).EmptyOrEqualTo(channelId)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue