about summary refs log tree commit diff
path: root/Commands/ReloadPoliciesCommand.cs
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-03-22 17:43:00 +0100
committerRory& <root@rory.gay>2024-03-22 17:43:00 +0100
commitc137f94aeb122c636629fb9361dd73626594f690 (patch)
tree44f04e0b2b026d21c817e330918243fd5a4a8cd4 /Commands/ReloadPoliciesCommand.cs
parentChanges (diff)
downloadModerationBot-c137f94aeb122c636629fb9361dd73626594f690.tar.xz
Changes
Diffstat (limited to '')
-rw-r--r--Commands/ReloadPoliciesCommand.cs7
1 files changed, 4 insertions, 3 deletions
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<bool> 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<BotData>("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