From 82e5660b63ea6466e22f855fe524b288b62da7f9 Mon Sep 17 00:00:00 2001 From: Rory& Date: Sun, 18 May 2025 22:52:39 +0200 Subject: More stuff --- MiniUtils/Commands/OpsCommand.cs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 MiniUtils/Commands/OpsCommand.cs (limited to 'MiniUtils/Commands/OpsCommand.cs') diff --git a/MiniUtils/Commands/OpsCommand.cs b/MiniUtils/Commands/OpsCommand.cs new file mode 100644 index 0000000..eef6c6f --- /dev/null +++ b/MiniUtils/Commands/OpsCommand.cs @@ -0,0 +1,25 @@ +using LibMatrix.Helpers; +using LibMatrix.Utilities.Bot.Interfaces; +using MiniUtils.Services; + +namespace MiniUtils.Commands; + +public class OpsCommand(IgnoreListManager ignoreListManager) : ICommand { + public string Name => "ops"; + + public string[]? Aliases => ["admins", "mods"]; + + public string Description => "Ping all the mods"; + + public bool Unlisted => true; + + public async Task Invoke(CommandContext ctx) { + var pls = await ctx.Room.GetPowerLevelsAsync(); + var msb = new MessageBuilder(); + foreach (var pl in pls.Users.Where(x => x.Value >= pls.Kick)) { + msb = msb.WithMention(pl.Key).WithBody(" "); + } + + await ctx.Room.SendMessageEventAsync(msb.Build()); + } +} \ No newline at end of file -- cgit 1.5.1