From def33cc092ae2c6defcc218b108b7c99cbfb8581 Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Sun, 2 Jul 2023 01:01:09 +0200 Subject: Prefetch room info --- MatrixRoomUtils.Bot/Bot/Interfaces/CommandContext.cs | 9 +++++---- MatrixRoomUtils.Bot/Bot/Interfaces/ICommand.cs | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'MatrixRoomUtils.Bot/Bot/Interfaces') diff --git a/MatrixRoomUtils.Bot/Bot/Interfaces/CommandContext.cs b/MatrixRoomUtils.Bot/Bot/Interfaces/CommandContext.cs index ab29554..94007a5 100644 --- a/MatrixRoomUtils.Bot/Bot/Interfaces/CommandContext.cs +++ b/MatrixRoomUtils.Bot/Bot/Interfaces/CommandContext.cs @@ -1,11 +1,12 @@ -using MatrixRoomUtils.Core; using MatrixRoomUtils.Core.Responses; +using MatrixRoomUtils.Core.RoomTypes; +using MatrixRoomUtils.Core.StateEventTypes.Spec; -namespace MatrixRoomUtils.Bot.Interfaces; +namespace MatrixRoomUtils.Bot.Bot.Interfaces; public class CommandContext { public GenericRoom Room { get; set; } public StateEventResponse MessageEvent { get; set; } - public string CommandName => (MessageEvent.TypedContent as MessageEventData).Body.Split(' ')[0][1..]; - public string[] Args => (MessageEvent.TypedContent as MessageEventData).Body.Split(' ')[1..]; + public string CommandName => (MessageEvent.TypedContent as RoomMessageEventData).Body.Split(' ')[0][1..]; + public string[] Args => (MessageEvent.TypedContent as RoomMessageEventData).Body.Split(' ')[1..]; } \ No newline at end of file diff --git a/MatrixRoomUtils.Bot/Bot/Interfaces/ICommand.cs b/MatrixRoomUtils.Bot/Bot/Interfaces/ICommand.cs index b57d8c9..20805b1 100644 --- a/MatrixRoomUtils.Bot/Bot/Interfaces/ICommand.cs +++ b/MatrixRoomUtils.Bot/Bot/Interfaces/ICommand.cs @@ -1,4 +1,4 @@ -namespace MatrixRoomUtils.Bot.Interfaces; +namespace MatrixRoomUtils.Bot.Bot.Interfaces; public interface ICommand { public string Name { get; } -- cgit 1.5.1