feat(commands/tools/clear): add --ignore-ids

This commit is contained in:
Ryan 2025-01-08 13:20:58 -05:00
parent 78f2d0a568
commit 7a400da1ee
Signed by: ErrorNoInternet
GPG Key ID: 2486BFB7B1E6A4A3

View File

@ -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))