Applied codestyle to all .cs files

This commit is contained in:
Kwoth
2021-12-29 06:07:16 +01:00
parent 723447c7d4
commit 82000c97a4
543 changed files with 13221 additions and 14059 deletions

View File

@@ -5,11 +5,15 @@ namespace NadekoBot.Modules.Permissions.Services;
public class GlobalPermissionService : ILateBlocker, INService
{
private readonly BotConfigService _bss;
public int Priority { get; } = 0;
public HashSet<string> BlockedCommands => _bss.Data.Blocked.Commands;
public HashSet<string> BlockedModules => _bss.Data.Blocked.Modules;
public HashSet<string> BlockedCommands
=> _bss.Data.Blocked.Commands;
public HashSet<string> BlockedModules
=> _bss.Data.Blocked.Modules;
private readonly BotConfigService _bss;
public GlobalPermissionService(BotConfigService bss)
=> _bss = bss;
@@ -17,21 +21,19 @@ public class GlobalPermissionService : ILateBlocker, INService
public Task<bool> TryBlockLate(ICommandContext ctx, string moduleName, CommandInfo command)
{
var settings = _bss.Data;
var settings = _bss.Data;
var commandName = command.Name.ToLowerInvariant();
if (commandName != "resetglobalperms" &&
(settings.Blocked.Commands.Contains(commandName) ||
settings.Blocked.Modules.Contains(moduleName.ToLowerInvariant())))
{
if (commandName != "resetglobalperms"
&& (settings.Blocked.Commands.Contains(commandName)
|| settings.Blocked.Modules.Contains(moduleName.ToLowerInvariant())))
return Task.FromResult(true);
}
return Task.FromResult(false);
}
/// <summary>
/// Toggles module blacklist
/// Toggles module blacklist
/// </summary>
/// <param name="moduleName">Lowercase module name</param>
/// <returns>Whether the module is added</returns>
@@ -53,9 +55,9 @@ public class GlobalPermissionService : ILateBlocker, INService
return added;
}
/// <summary>
/// Toggles command blacklist
/// Toggles command blacklist
/// </summary>
/// <param name="commandName">Lowercase command name</param>
/// <returns>Whether the command is added</returns>
@@ -79,7 +81,7 @@ public class GlobalPermissionService : ILateBlocker, INService
}
/// <summary>
/// Resets all global permissions
/// Resets all global permissions
/// </summary>
public Task Reset()
{
@@ -91,4 +93,4 @@ public class GlobalPermissionService : ILateBlocker, INService
return Task.CompletedTask;
}
}
}