From c137f94aeb122c636629fb9361dd73626594f690 Mon Sep 17 00:00:00 2001 From: Rory& Date: Fri, 22 Mar 2024 17:43:00 +0100 Subject: Changes --- Commands/ReloadPoliciesCommand.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Commands/ReloadPoliciesCommand.cs') diff --git a/Commands/ReloadPoliciesCommand.cs b/Commands/ReloadPoliciesCommand.cs index b876145..2934185 100644 --- a/Commands/ReloadPoliciesCommand.cs +++ b/Commands/ReloadPoliciesCommand.cs @@ -8,7 +8,9 @@ namespace ModerationBot.Commands; public class ReloadPoliciesCommand(IServiceProvider services, HomeserverProviderService hsProvider, HomeserverResolverService hsResolver, PolicyEngine engine) : ICommand { public string Name { get; } = "reloadpolicies"; + public string[]? Aliases { get; } public string Description { get; } = "Reload policies"; + public bool Unlisted { get; } public async Task CanInvoke(CommandContext ctx) { if (ctx.MessageEvent.Sender == "@cadence:cadence.moe") return true; @@ -26,12 +28,11 @@ public class ReloadPoliciesCommand(IServiceProvider services, HomeserverProvider } public async Task Invoke(CommandContext ctx) { - var botData = await ctx.Homeserver.GetAccountDataAsync("gay.rory.moderation_bot_data"); var policyRoom = ctx.Homeserver.GetRoom(botData.DefaultPolicyRoom ?? botData.ControlRoom); var logRoom = ctx.Homeserver.GetRoom(botData.LogRoom ?? botData.ControlRoom); - + await logRoom.SendMessageEventAsync(MessageFormatter.FormatSuccess($"Reloading policy lists due to manual invocation!!!!")); await engine.ReloadActivePolicyLists(); } -} +} \ No newline at end of file -- cgit 1.5.1