mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 17:58:26 -04:00
Updated editorconfig to (mostly?) require braces around if/else statements, and applied the new formatting rules
This commit is contained in:
@@ -34,8 +34,8 @@ public partial class Permissions
|
||||
BlacklistType.User => Format.Code(i.ItemId.ToString())
|
||||
+ " "
|
||||
+ ((await _client.Rest.GetUserAsync(i.ItemId))
|
||||
?.ToString()
|
||||
?? ""),
|
||||
?.ToString()
|
||||
?? ""),
|
||||
BlacklistType.Server => Format.Code(i.ItemId.ToString())
|
||||
+ " "
|
||||
+ (_client.GetGuild(i.ItemId)?.ToString() ?? ""),
|
||||
|
@@ -75,7 +75,8 @@ public sealed class BlacklistService : IEarlyBehavior
|
||||
using var uow = _db.GetDbContext();
|
||||
var toPublish = uow.Blacklist.AsNoTracking().ToArray();
|
||||
blacklist = toPublish;
|
||||
if (publish) _pubSub.Pub(_blPubKey, toPublish);
|
||||
if (publish)
|
||||
_pubSub.Pub(_blPubKey, toPublish);
|
||||
}
|
||||
|
||||
public void Blacklist(BlacklistType type, ulong id)
|
||||
@@ -84,7 +85,11 @@ public sealed class BlacklistService : IEarlyBehavior
|
||||
return;
|
||||
|
||||
using var uow = _db.GetDbContext();
|
||||
var item = new BlacklistEntry { ItemId = id, Type = type };
|
||||
var item = new BlacklistEntry
|
||||
{
|
||||
ItemId = id,
|
||||
Type = type
|
||||
};
|
||||
uow.Blacklist.Add(item);
|
||||
uow.SaveChanges();
|
||||
|
||||
@@ -110,7 +115,11 @@ public sealed class BlacklistService : IEarlyBehavior
|
||||
{
|
||||
var bc = uow.Blacklist;
|
||||
//blacklist the users
|
||||
bc.AddRange(toBlacklist.Select(x => new BlacklistEntry { ItemId = x, Type = BlacklistType.User }));
|
||||
bc.AddRange(toBlacklist.Select(x => new BlacklistEntry
|
||||
{
|
||||
ItemId = x,
|
||||
Type = BlacklistType.User
|
||||
}));
|
||||
|
||||
//clear their currencies
|
||||
uow.DiscordUser.RemoveFromMany(toBlacklist);
|
||||
|
Reference in New Issue
Block a user