From fb4aaad19f96bf3b5e6025c867b0a51b85689683 Mon Sep 17 00:00:00 2001 From: spiral Date: Sun, 26 Sep 2021 22:50:08 -0400 Subject: [PATCH] lint --- Myriad/Rest/DiscordApiClient.cs | 2 +- PluralKit.Bot/Commands/CommandTree.cs | 8 ++++---- PluralKit.Bot/Commands/Switch.cs | 10 +++++----- PluralKit.Bot/Proxy/ProxyTagParser.cs | 4 ++-- .../Database/Repository/ModelRepository.Switch.cs | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Myriad/Rest/DiscordApiClient.cs b/Myriad/Rest/DiscordApiClient.cs index 3faa202f..5ea2d411 100644 --- a/Myriad/Rest/DiscordApiClient.cs +++ b/Myriad/Rest/DiscordApiClient.cs @@ -132,7 +132,7 @@ namespace Myriad.Rest var url = $"/webhooks/{webhookId}/{webhookToken}/messages/{messageId}"; if (threadId != null) url += $"?thread_id={threadId}"; - + return _client.Patch(url, ("EditWebhookMessage", webhookId), request)!; } diff --git a/PluralKit.Bot/Commands/CommandTree.cs b/PluralKit.Bot/Commands/CommandTree.cs index d79676bb..e96d1316 100644 --- a/PluralKit.Bot/Commands/CommandTree.cs +++ b/PluralKit.Bot/Commands/CommandTree.cs @@ -485,10 +485,10 @@ namespace PluralKit.Bot else if (ctx.Match("move", "shift", "offset")) await ctx.Execute(SwitchMove, m => m.SwitchMove(ctx)); else if (ctx.Match("edit", "replace")) - if (ctx.Match("out")) - await ctx.Execute(SwitchEditOut, m => m.SwitchEditOut(ctx)); - else - await ctx.Execute(SwitchEdit, m => m.SwitchEdit(ctx)); + if (ctx.Match("out")) + await ctx.Execute(SwitchEditOut, m => m.SwitchEditOut(ctx)); + else + await ctx.Execute(SwitchEdit, m => m.SwitchEdit(ctx)); else if (ctx.Match("delete", "remove", "erase", "cancel", "yeet")) await ctx.Execute(SwitchDelete, m => m.SwitchDelete(ctx)); else if (ctx.Match("commands", "help")) diff --git a/PluralKit.Bot/Commands/Switch.cs b/PluralKit.Bot/Commands/Switch.cs index 8df4ceb7..3581aa9f 100644 --- a/PluralKit.Bot/Commands/Switch.cs +++ b/PluralKit.Bot/Commands/Switch.cs @@ -142,12 +142,12 @@ namespace PluralKit.Bot var lastSwitchDeltaStr = (SystemClock.Instance.GetCurrentInstant() - lastSwitch.Timestamp).FormatDuration(); var lastSwitchMemberStr = string.Join(", ", await lastSwitchMembers.Select(m => m.NameFor(ctx)).ToListAsync()); var newSwitchMemberStr = string.Join(", ", members.Select(m => m.NameFor(ctx))); - + string msg; if (members.Count == 0) - msg = $"{Emojis.Warn} This will turn the latest switch ({lastSwitchMemberStr}, {lastSwitchDeltaStr} ago) into a switch-out. Is this okay?"; + msg = $"{Emojis.Warn} This will turn the latest switch ({lastSwitchMemberStr}, {lastSwitchDeltaStr} ago) into a switch-out. Is this okay?"; else - msg = $"{Emojis.Warn} This will change the latest switch ({lastSwitchMemberStr}, {lastSwitchDeltaStr} ago) to {newSwitchMemberStr}. Is this okay?"; + msg = $"{Emojis.Warn} This will change the latest switch ({lastSwitchMemberStr}, {lastSwitchDeltaStr} ago) to {newSwitchMemberStr}. Is this okay?"; if (!await ctx.PromptYesNo(msg, "Edit")) throw Errors.SwitchEditCancelled; // Actually edit the switch @@ -155,9 +155,9 @@ namespace PluralKit.Bot // Tell the user the edit suceeded if (members.Count == 0) - await ctx.Reply($"{Emojis.Success} Switch edited. The latest switch is now a switch-out."); + await ctx.Reply($"{Emojis.Success} Switch edited. The latest switch is now a switch-out."); else - await ctx.Reply($"{Emojis.Success} Switch edited. Current fronter is now {newSwitchMemberStr}."); + await ctx.Reply($"{Emojis.Success} Switch edited. Current fronter is now {newSwitchMemberStr}."); } public async Task SwitchDelete(Context ctx) diff --git a/PluralKit.Bot/Proxy/ProxyTagParser.cs b/PluralKit.Bot/Proxy/ProxyTagParser.cs index acaf49f0..c5e7770e 100644 --- a/PluralKit.Bot/Proxy/ProxyTagParser.cs +++ b/PluralKit.Bot/Proxy/ProxyTagParser.cs @@ -40,8 +40,8 @@ namespace PluralKit.Bot // Skip blank tags (shouldn't ever happen in practice) if (tag.Prefix == null && tag.Suffix == null) continue; - if(tag.Prefix == "<" && prefixPattern.IsMatch(input)) continue; - if(tag.Suffix == ">" && suffixPattern.IsMatch(input)) continue; + if (tag.Prefix == "<" && prefixPattern.IsMatch(input)) continue; + if (tag.Suffix == ">" && suffixPattern.IsMatch(input)) continue; // Can we match with these tags? if (TryMatchTagsInner(input, tag, out result.Content)) diff --git a/PluralKit.Core/Database/Repository/ModelRepository.Switch.cs b/PluralKit.Core/Database/Repository/ModelRepository.Switch.cs index 03fa1bc2..11168bd1 100644 --- a/PluralKit.Core/Database/Repository/ModelRepository.Switch.cs +++ b/PluralKit.Core/Database/Repository/ModelRepository.Switch.cs @@ -46,7 +46,7 @@ namespace PluralKit.Core // Remove the old members from the switch await conn.ExecuteAsync("delete from switch_members where switch = @Switch", - new {Switch = switchId}); + new { Switch = switchId }); // Add the new members await using (var w = conn.BeginBinaryImport("copy switch_members (switch, member) from stdin (format binary)"))