From 096375344ef87fe53ca009b7a7eaa34c9c9f5407 Mon Sep 17 00:00:00 2001 From: Rory& Date: Fri, 15 Mar 2024 18:10:58 +0100 Subject: Bot changes, move named filters to subclass --- .../LibMatrix.Utilities.Bot/Interfaces/CommandContext.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Utilities/LibMatrix.Utilities.Bot/Interfaces/CommandContext.cs') diff --git a/Utilities/LibMatrix.Utilities.Bot/Interfaces/CommandContext.cs b/Utilities/LibMatrix.Utilities.Bot/Interfaces/CommandContext.cs index e65f86d..062e99f 100644 --- a/Utilities/LibMatrix.Utilities.Bot/Interfaces/CommandContext.cs +++ b/Utilities/LibMatrix.Utilities.Bot/Interfaces/CommandContext.cs @@ -19,4 +19,18 @@ public class CommandContext { public required AuthenticatedHomeserverGeneric Homeserver { get; set; } public async Task Reply(RoomMessageEventContent content) => await Room.SendMessageEventAsync(content); +} + +public class CommandResult { + public required bool Success { get; set; } + public Exception? Exception { get; set; } + public required CommandResultType Result { get; set; } + public required CommandContext Context { get; set; } + + public enum CommandResultType { + Success, + Failure_Exception, + Failure_NoPermission, + Failure_InvalidCommand + } } \ No newline at end of file -- cgit 1.4.1