- Started cleanup of command handler

- Removed IUnloadableService
- Started removing INService (removed it from services which implement behavior interfaces) - wip
- Added scrutor for better service registration - wip
This commit is contained in:
Kwoth
2021-06-28 23:20:02 +02:00
parent 1e90d7f7bb
commit 3c82c1f919
30 changed files with 217 additions and 360 deletions

View File

@@ -142,8 +142,7 @@ namespace NadekoBot.Modules.Administration.Services
}
}
public async Task<bool> TryBlockLate(DiscordSocketClient client, ICommandContext context, string moduleName,
CommandInfo command)
public async Task<bool> TryBlockLate(ICommandContext context, string moduleName, CommandInfo command)
{
if (TryGetOverrides(context.Guild?.Id ?? 0, command.Name, out var perm) && perm is not null)
{

View File

@@ -18,7 +18,7 @@ using Serilog;
namespace NadekoBot.Modules.Administration.Services
{
public sealed class SelfService : ILateExecutor, IReadyExecutor, INService
public sealed class SelfService : ILateExecutor, IReadyExecutor
{
private readonly ConnectionMultiplexer _redis;
private readonly CommandHandler _cmdHandler;
@@ -54,6 +54,7 @@ namespace NadekoBot.Modules.Administration.Services
_httpFactory = factory;
_bss = bss;
Log.Information("Self service created");
var sub = _redis.GetSubscriber();
if (_client.ShardId == 0)
{
@@ -226,7 +227,7 @@ namespace NadekoBot.Modules.Administration.Services
}
// forwards dms
public async Task LateExecute(DiscordSocketClient client, IGuild guild, IUserMessage msg)
public async Task LateExecute(IGuild guild, IUserMessage msg)
{
var bs = _bss.Data;
if (msg.Channel is IDMChannel && _bss.Data.ForwardMessages && ownerChannels.Any())