mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 09:48:26 -04:00
Medusa System Added
Read about the medusa system [here](https://nadekobot.readthedocs.io/en/latest/medusa/creating-a-medusa/)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -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())
|
||||
|
Reference in New Issue
Block a user