Update devtestbot to use bot utils
4 files changed, 16 insertions, 5 deletions
diff --git a/Utilities/LibMatrix.DevTestBot/Bot/Commands/CmdCommand.cs b/Utilities/LibMatrix.DevTestBot/Bot/Commands/CmdCommand.cs
index 89a9033..874d195 100644
--- a/Utilities/LibMatrix.DevTestBot/Bot/Commands/CmdCommand.cs
+++ b/Utilities/LibMatrix.DevTestBot/Bot/Commands/CmdCommand.cs
@@ -1,11 +1,13 @@
using ArcaneLibs.StringNormalisation;
using LibMatrix.EventTypes.Spec;
-using LibMatrix.ExampleBot.Bot.Interfaces;
+using LibMatrix.Utilities.Bot.Interfaces;
namespace LibMatrix.ExampleBot.Bot.Commands;
public class CmdCommand : ICommand {
public string Name => "cmd";
+ public string[]? Aliases => [];
+ public bool Unlisted => false;
public string Description => "Runs a command on the host system";
public Task<bool> CanInvoke(CommandContext ctx) => Task.FromResult(ctx.MessageEvent.Sender.EndsWith(":rory.gay") || ctx.MessageEvent.Sender.EndsWith(":conduit.rory.gay"));
diff --git a/Utilities/LibMatrix.DevTestBot/Bot/Commands/DbgAniRainbowTest.cs b/Utilities/LibMatrix.DevTestBot/Bot/Commands/DbgAniRainbowTest.cs
index c91261f..0dde297 100644
--- a/Utilities/LibMatrix.DevTestBot/Bot/Commands/DbgAniRainbowTest.cs
+++ b/Utilities/LibMatrix.DevTestBot/Bot/Commands/DbgAniRainbowTest.cs
@@ -1,15 +1,20 @@
using System.Diagnostics;
using LibMatrix.EventTypes.Spec;
-using LibMatrix.ExampleBot.Bot.Interfaces;
using LibMatrix.Helpers;
using LibMatrix.Services;
+using LibMatrix.Utilities.Bot.Interfaces;
namespace ModerationBot.Commands;
public class DbgAniRainbowTest(IServiceProvider services, HomeserverProviderService hsProvider, HomeserverResolverService hsResolver) : ICommand {
public string Name { get; } = "ani-rainbow";
+
+ public string[]? Aliases => [];
+ public bool Unlisted => false;
+
public string Description { get; } = "[Debug] animated rainbow :)";
+
public async Task<bool> CanInvoke(CommandContext ctx) => ctx.Room.RoomId == "!hLEefBaYvNfJwcTjmt:rory.gay";
public async Task Invoke(CommandContext ctx) {
diff --git a/Utilities/LibMatrix.DevTestBot/Bot/Commands/HelpCommand.cs b/Utilities/LibMatrix.DevTestBot/Bot/Commands/HelpCommand.cs
index 7ecbeb3..33bbc5a 100644
--- a/Utilities/LibMatrix.DevTestBot/Bot/Commands/HelpCommand.cs
+++ b/Utilities/LibMatrix.DevTestBot/Bot/Commands/HelpCommand.cs
@@ -1,12 +1,14 @@
using System.Text;
using LibMatrix.EventTypes.Spec;
-using LibMatrix.ExampleBot.Bot.Interfaces;
+using LibMatrix.Utilities.Bot.Interfaces;
using Microsoft.Extensions.DependencyInjection;
namespace LibMatrix.ExampleBot.Bot.Commands;
public class HelpCommand(IServiceProvider services) : ICommand {
public string Name { get; } = "help";
+ public string[]? Aliases => [];
+ public bool Unlisted => false;
public string Description { get; } = "Displays this help message";
public async Task Invoke(CommandContext ctx) {
diff --git a/Utilities/LibMatrix.DevTestBot/Bot/Commands/PingCommand.cs b/Utilities/LibMatrix.DevTestBot/Bot/Commands/PingCommand.cs
index 745c75d..350d89e 100644
--- a/Utilities/LibMatrix.DevTestBot/Bot/Commands/PingCommand.cs
+++ b/Utilities/LibMatrix.DevTestBot/Bot/Commands/PingCommand.cs
@@ -1,10 +1,12 @@
using LibMatrix.EventTypes.Spec;
-using LibMatrix.ExampleBot.Bot.Interfaces;
+using LibMatrix.Utilities.Bot.Interfaces;
namespace LibMatrix.ExampleBot.Bot.Commands;
public class PingCommand : ICommand {
- public string Name { get; } = "ping";
+ 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!"));
|