about summary refs log tree commit diff
path: root/MatrixContentFilter/Commands/NewRoomCommand.cs
blob: b8becd4a80bf7f9070603d075c1d2d7bebb0dc9b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using System.Text;
using ArcaneLibs.Attributes;
using ArcaneLibs.Extensions;
using LibMatrix.EventTypes.Spec;
using LibMatrix.Helpers;
using LibMatrix.Utilities.Bot.Commands;
using LibMatrix.Utilities.Bot.Interfaces;
using MatrixContentFilter.EventTypes;
using Microsoft.Extensions.DependencyInjection;

namespace MatrixContentFilter.Commands;

public class NewRoomCommand(IServiceProvider svcs) : ICommand {
    public string Name { get; } = "newroom";
    public string[]? Aliases { get; } = ["nr"];
    public string Description { get; } = "Create a new room";
    public bool Unlisted { get; } = false;

    public async Task Invoke(CommandContext ctx) {
        await ctx.Homeserver.CreateRoom(new() {
            Invite = [ctx.MessageEvent.Sender!]
        });
    }
}