Updated editorconfig to (mostly?) require braces around if/else statements, and applied the new formatting rules

This commit is contained in:
Kwoth
2022-02-02 01:44:45 +01:00
parent b22cd5a81e
commit ffa2c3f119
202 changed files with 2108 additions and 920 deletions

View File

@@ -66,7 +66,11 @@ public partial class Utility
using (var uow = _db.GetDbContext())
{
var config = uow.GuildConfigsForId(ctx.Guild.Id, set => set.Include(x => x.CommandAliases));
config.CommandAliases.Add(new() { Mapping = mapping, Trigger = trigger });
config.CommandAliases.Add(new()
{
Mapping = mapping,
Trigger = trigger
});
uow.SaveChanges();
}
@@ -80,7 +84,11 @@ public partial class Utility
using (var uow = _db.GetDbContext())
{
var config = uow.GuildConfigsForId(ctx.Guild.Id, set => set.Include(x => x.CommandAliases));
var toAdd = new CommandAlias { Mapping = mapping, Trigger = trigger };
var toAdd = new CommandAlias
{
Mapping = mapping,
Trigger = trigger
};
var toRemove = config.CommandAliases.Where(x => x.Trigger == trigger).ToArray();
if (toRemove.Any())
uow.RemoveRange(toRemove);

View File

@@ -74,10 +74,13 @@ public class CommandMapService : IInputTransformer, INService
try
{
var toDelete = await channel.SendConfirmAsync(_eb, $"{input} => {newInput}");
_= Task.Run(async () =>
_ = Task.Run(async () =>
{
await Task.Delay(1500);
await toDelete.DeleteAsync(new() { RetryMode = RetryMode.AlwaysRetry });
await toDelete.DeleteAsync(new()
{
RetryMode = RetryMode.AlwaysRetry
});
});
}
catch { }