From 741cc856e3546828bc127da03166067eb2053f43 Mon Sep 17 00:00:00 2001 From: Rory& Date: Fri, 5 Dec 2025 00:58:08 +0100 Subject: Drop dev test bot --- .../Bot/Commands/PingCommand.cs | 24 ---------------------- 1 file changed, 24 deletions(-) delete mode 100644 Utilities/LibMatrix.DevTestBot/Bot/Commands/PingCommand.cs (limited to 'Utilities/LibMatrix.DevTestBot/Bot/Commands/PingCommand.cs') diff --git a/Utilities/LibMatrix.DevTestBot/Bot/Commands/PingCommand.cs b/Utilities/LibMatrix.DevTestBot/Bot/Commands/PingCommand.cs deleted file mode 100644 index 350d89e..0000000 --- a/Utilities/LibMatrix.DevTestBot/Bot/Commands/PingCommand.cs +++ /dev/null @@ -1,24 +0,0 @@ -using LibMatrix.EventTypes.Spec; -using LibMatrix.Utilities.Bot.Interfaces; - -namespace LibMatrix.ExampleBot.Bot.Commands; - -public class PingCommand : ICommand { - public string Name { get; } = "do-ping"; - public string[]? Aliases => []; - public bool Unlisted => false; - public string Description { get; } = "Pong!"; - - // public async Task Invoke(CommandContext ctx) => await ctx.Room.SendMessageEventAsync(new RoomMessageEventContent(body: "pong!")); - public async Task Invoke(CommandContext ctx) { - // await ctx.Room.SendMessageEventAsync(new RoomMessageEventContent(body: "pong!")); - var count = ctx.Args.Length > 0 ? int.Parse(ctx.Args[0]) : 1; - var tasks = Enumerable.Range(0, count).Select(async i => { - await ctx.Room.SendMessageEventAsync(new RoomMessageEventContent(body: $"!ping {i}", messageType: "m.text")); - await Task.Delay(1000); - }).ToList(); - await Task.WhenAll(tasks); - - await ctx.Room.SendMessageEventAsync(new RoomMessageEventContent(body: "Pong!")); - } -} \ No newline at end of file -- cgit 1.5.1