Medusa System Added

Read about the medusa system [here](https://nadekobot.readthedocs.io/en/latest/medusa/creating-a-medusa/)
This commit is contained in:
Kwoth
2022-04-16 12:44:46 +00:00
parent 3a516ab32a
commit 7cb15f5278
103 changed files with 3363 additions and 203 deletions

View File

@@ -1,4 +1,5 @@
#nullable disable
using Nadeko.Medusa;
using NadekoBot.Modules.Administration.Services;
using NadekoBot.Services.Database.Models;
@@ -19,13 +20,19 @@ public partial class Administration
private readonly DiscordSocketClient _client;
private readonly IBotStrings _strings;
private readonly IMedusaLoaderService _medusaLoader;
private readonly ICoordinator _coord;
public SelfCommands(DiscordSocketClient client, IBotStrings strings, ICoordinator coord)
public SelfCommands(
DiscordSocketClient client,
IBotStrings strings,
ICoordinator coord,
IMedusaLoaderService medusaLoader)
{
_client = client;
_strings = strings;
_coord = coord;
_medusaLoader = medusaLoader;
}
[Cmd]
@@ -506,6 +513,7 @@ public partial class Administration
public async partial Task StringsReload()
{
_strings.Reload();
await _medusaLoader.ReloadStrings();
await ReplyConfirmLocalizedAsync(strs.bot_strings_reloaded);
}

View File

@@ -6,7 +6,7 @@ using System.Collections.Immutable;
namespace NadekoBot.Modules.Administration.Services;
public sealed class SelfService : ILateExecutor, IReadyExecutor, INService
public sealed class SelfService : IExecNoCommand, IReadyExecutor, INService
{
private readonly CommandHandler _cmdHandler;
private readonly DbService _db;
@@ -206,7 +206,7 @@ public sealed class SelfService : ILateExecutor, IReadyExecutor, INService
=> _pubSub.Pub(_guildLeaveKey, guildStr);
// forwards dms
public async Task LateExecute(IGuild guild, IUserMessage msg)
public async Task ExecOnNoCommandAsync(IGuild guild, IUserMessage msg)
{
var bs = _bss.Data;
if (msg.Channel is IDMChannel && bs.ForwardMessages && ownerChannels.Any())