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
|