Be less lax about spaces between emoji

This commit is contained in:
Midgard 2023-12-13 20:11:36 +01:00
parent 50ea5fc979
commit 68fc254d88
Signed by: midgard
GPG key ID: 511C112F1331BBB4

View file

@ -46,10 +46,10 @@ for line in sys.stdin:
if "message" in line and line["message"] != "": if "message" in line and line["message"] != "":
message = line["message"] message = line["message"]
message = re.sub(r"^[#>]* *|[*_`]*", "", message) message = re.sub(r"^[#>]* ?|[*_`]*", "", message)
for emoji, numb in NUMBER_EMOJI.items(): for emoji, numb in NUMBER_EMOJI.items():
message = re.sub(f" *:{emoji}: *", numb, message) 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.replace("\ufe0f", "").replace("\u20e3", "")
message = message.strip() message = message.strip()
else: else: