From 7a400da1eeec52ca90c742f2ae72502bd40e327a Mon Sep 17 00:00:00 2001 From: ErrorNoInternet Date: Wed, 8 Jan 2025 13:20:58 -0500 Subject: [PATCH] feat(commands/tools/clear): add --ignore-ids --- commands/tools.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/commands/tools.py b/commands/tools.py index 0a983f3..7b3a400 100644 --- a/commands/tools.py +++ b/commands/tools.py @@ -60,6 +60,13 @@ async def clear(message): action="store_true", help="delete the command message as well", ) + parser.add_argument( + "-I", + "--ignore-ids", + type=int, + action="append", + help="ignore messages with this id", + ) if not (args := await parser.parse_args(message, tokens)): return @@ -74,6 +81,8 @@ async def clear(message): regex = re.compile(r, re.IGNORECASE if args.case_insensitive else 0) def check(m): + if m.id in args.ignore_ids: + return False c = [] if regex: c.append(regex.search(m.content))