about summary refs log tree commit diff
path: root/Utilities/LibMatrix.DevTestBot/Bot/Interfaces/CommandContext.cs
blob: 90a95e4669e27ee55132d26466ae3dbcd2be13c1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
using LibMatrix.EventTypes.Spec;
using LibMatrix.RoomTypes;

namespace LibMatrix.ExampleBot.Bot.Interfaces;

public class CommandContext {
    public GenericRoom Room { get; set; }
    public StateEventResponse MessageEvent { get; set; }
    public string CommandName => (MessageEvent.TypedContent as RoomMessageEventContent).Body.Split(' ')[0][1..];
    public string[] Args => (MessageEvent.TypedContent as RoomMessageEventContent).Body.Split(' ')[1..];
}