diff options
Diffstat (limited to 'ExampleBots/MediaModeratorPoC/Bot/Commands/HelpCommand.cs')
-rw-r--r-- | ExampleBots/MediaModeratorPoC/Bot/Commands/HelpCommand.cs | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/ExampleBots/MediaModeratorPoC/Bot/Commands/HelpCommand.cs b/ExampleBots/MediaModeratorPoC/Bot/Commands/HelpCommand.cs deleted file mode 100644 index 8d63daa..0000000 --- a/ExampleBots/MediaModeratorPoC/Bot/Commands/HelpCommand.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.Text; -using LibMatrix.StateEventTypes.Spec; -using MediaModeratorPoC.Bot.Interfaces; -using Microsoft.Extensions.DependencyInjection; - -namespace MediaModeratorPoC.Bot.Commands; - -public class HelpCommand(IServiceProvider services) : ICommand { - public string Name { get; } = "help"; - public string Description { get; } = "Displays this help message"; - - public async Task Invoke(CommandContext ctx) { - var sb = new StringBuilder(); - sb.AppendLine("Available commands:"); - var commands = services.GetServices<ICommand>().ToList(); - foreach (var command in commands) { - sb.AppendLine($"- {command.Name}: {command.Description}"); - } - - await ctx.Room.SendMessageEventAsync("m.room.message", new RoomMessageEventData { - MessageType = "m.notice", - Body = sb.ToString() - }); - } -} |