From 68fc254d8809f0322aa7a0e1ad903af13f85407b Mon Sep 17 00:00:00 2001 From: Midgard Date: Wed, 13 Dec 2023 20:11:36 +0100 Subject: [PATCH] Be less lax about spaces between emoji --- check_numberdealers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/check_numberdealers.py b/check_numberdealers.py index fa2b251..4665c1d 100755 --- a/check_numberdealers.py +++ b/check_numberdealers.py @@ -46,10 +46,10 @@ for line in sys.stdin: if "message" in line and line["message"] != "": message = line["message"] - message = re.sub(r"^[#>]* *|[*_`]*", "", message) + message = re.sub(r"^[#>]* ?|[*_`]*", "", message) for emoji, numb in NUMBER_EMOJI.items(): message = re.sub(f" *:{emoji}: *", numb, message) - message = re.sub(" *:(?:green)?num([0-9]+): *", lambda m: m.group(1), message) + message = re.sub(" ?:(?:green)?num([0-9]+): ?", lambda m: m.group(1), message) message = message.replace("\ufe0f", "").replace("\u20e3", "") message = message.strip() else: