alternative syntax for relative time range

This commit is contained in:
Klemek
2021-04-09 18:19:40 +02:00
parent 90a26bcc9c
commit 802e208092
3 changed files with 29 additions and 13 deletions
+2 -2
View File
@@ -12,8 +12,8 @@ from utils import (
delta,
gdpr,
ISO8601_REGEX,
RELATIVE_REGEX,
parse_time,
RELATIVE_TIME,
)
from logs import (
GuildLogs,
@@ -70,7 +70,7 @@ class Scanner(ABC):
arg = arg[3:-1] if "!" in arg else arg[2:-1]
elif re.match(r"^<#!?\d+>$", arg):
arg = arg[3:-1] if "!" in arg else arg[2:-1]
elif re.match(ISO8601_REGEX, arg) or arg in RELATIVE_TIME:
elif re.match(ISO8601_REGEX, arg) or re.match(RELATIVE_REGEX, arg):
dates += [parse_time(arg)]
skip_check = True
if len(dates) > 2: