diff options
Diffstat (limited to 'MatrixContentFilter/Commands/NewRoomCommand.cs')
-rw-r--r-- | MatrixContentFilter/Commands/NewRoomCommand.cs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/MatrixContentFilter/Commands/NewRoomCommand.cs b/MatrixContentFilter/Commands/NewRoomCommand.cs new file mode 100644 index 0000000..b8becd4 --- /dev/null +++ b/MatrixContentFilter/Commands/NewRoomCommand.cs @@ -0,0 +1,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!] + }); + } +} \ No newline at end of file |