about summary refs log tree commit diff
path: root/MiniUtils/Commands/IgnoreCommand.cs
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-11-10 03:05:18 +0100
committerRory& <root@rory.gay>2025-11-10 03:05:18 +0100
commitd272c5b6f50e3f66a430fe4a6bbb3188f9adb1c8 (patch)
tree328d96076fe8c6fe6081f9083fcb3a498c41a683 /MiniUtils/Commands/IgnoreCommand.cs
parentMore stuff (diff)
downloadMiniUtils-d272c5b6f50e3f66a430fe4a6bbb3188f9adb1c8.tar.xz
MiniUtils changes, add uick ban sync hack bot HEAD master
Diffstat (limited to 'MiniUtils/Commands/IgnoreCommand.cs')
-rw-r--r--MiniUtils/Commands/IgnoreCommand.cs23
1 files changed, 14 insertions, 9 deletions
diff --git a/MiniUtils/Commands/IgnoreCommand.cs b/MiniUtils/Commands/IgnoreCommand.cs

index 4206b72..1bd4de3 100644 --- a/MiniUtils/Commands/IgnoreCommand.cs +++ b/MiniUtils/Commands/IgnoreCommand.cs
@@ -44,23 +44,28 @@ public class IgnoreCommand(IgnoreListManager ignoreListManager) : ICommand { await ctx.Room.SendReactionAsync(ctx.MessageEvent.EventId!, $"{Emojis.RightArrowWithTail} {count}"); } else if (ctx.Args is ["disable", .. var itemsToDisable]) { - var count = await ignoreListManager.MoveList(false, itemsToDisable); + var count = await ignoreListManager.MoveList(false, itemsToDisable.Where(x => x.StartsWith('@'))); await ctx.Room.SendReactionAsync(ctx.MessageEvent.EventId!, $"{Emojis.RightArrowWithTail} {count}"); } else if (ctx.Args is ["enable", .. var itemsToEnable]) { - var count = await ignoreListManager.MoveList(true, itemsToEnable); + var count = await ignoreListManager.MoveList(true, itemsToEnable.Where(x => x.StartsWith('@'))); await ctx.Room.SendReactionAsync(ctx.MessageEvent.EventId!, $"{Emojis.RightArrowWithTail} {count}"); } else if (ctx.Args is ["add", .. var itemsToAdd]) { - var count = await ignoreListManager.AddList(itemsToAdd); + var count = await ignoreListManager.AddList(itemsToAdd.Where(x => x.StartsWith('@'))); + await ctx.Room.SendReactionAsync(ctx.MessageEvent.EventId!, $"{Emojis.RightArrowWithTail} {count}"); + } + + else if (ctx.Args is ["remove", .. var itemsToRemove]) { + var count = await ignoreListManager.RemoveList(itemsToRemove.Where(x => x.StartsWith('@'))); await ctx.Room.SendReactionAsync(ctx.MessageEvent.EventId!, $"{Emojis.RightArrowWithTail} {count}"); } } private async Task Summarize(CommandContext ctx, IgnoredUserListEventContentWithDisabled ignoreList) { - var msb = new MessageBuilder() - .WithBody($"Ignored users: {ignoreList.IgnoredUsers.Count}").WithNewline() - .WithBody($"Disabled ignores: {ignoreList.DisabledIgnoredUsers.Count}").WithNewline(); - await ctx.Room.SendMessageEventAsync(msb.Build()); - } - } \ No newline at end of file + var msb = new MessageBuilder() + .WithBody($"Ignored users: {ignoreList.IgnoredUsers.Count}").WithNewline() + .WithBody($"Disabled ignores: {ignoreList.DisabledIgnoredUsers.Count}").WithNewline(); + await ctx.Room.SendMessageEventAsync(msb.Build()); + } +} \ No newline at end of file