about summary refs log tree commit diff
path: root/MiniUtils/Commands/MscCommand.cs
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-05-13 08:17:26 +0200
committerRory& <root@rory.gay>2025-05-13 08:17:26 +0200
commitddb5a61b0fd234b436c0406ab57e38d67429c6b8 (patch)
treebd2bc4c20aab27135ebaa55e1f9193f22e7d73cc /MiniUtils/Commands/MscCommand.cs
downloadMiniUtils-ddb5a61b0fd234b436c0406ab57e38d67429c6b8.tar.xz
Initial commit
Diffstat (limited to 'MiniUtils/Commands/MscCommand.cs')
-rw-r--r--MiniUtils/Commands/MscCommand.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/MiniUtils/Commands/MscCommand.cs b/MiniUtils/Commands/MscCommand.cs
new file mode 100644

index 0000000..62f1bd7 --- /dev/null +++ b/MiniUtils/Commands/MscCommand.cs
@@ -0,0 +1,24 @@ +using LibMatrix.Extensions; +using LibMatrix.Helpers; +using LibMatrix.Utilities.Bot.Interfaces; +using MiniUtils.Utilities; + +namespace MiniUtils.Commands; + +public class MscCommand(MscInfoProvider mscInfoProvider) : ICommand { + public string Name { get; } = "msc"; + public string[]? Aliases { get; } = []; + public string Description { get; } = "Get MSC info"; + public bool Unlisted { get; } = false; + + public async Task Invoke(CommandContext ctx) { + var msb = new MessageBuilder("m.notice"); + var id = int.Parse(ctx.Args[0]); + var mscInfo = await mscInfoProvider.GetMscInfo(id); + + msb.WithBody(mscInfo?.ToHtml() ?? "No info found!"); + + await ctx.Reply(msb.Build()); + Console.WriteLine(msb.Build().FormattedBody); + } +} \ No newline at end of file