Accept all :numXX: emoji

This commit is contained in:
Midgard 2023-11-30 12:18:51 +01:00
parent 3181e52c20
commit 50ea5fc979
Signed by: midgard
GPG key ID: 511C112F1331BBB4

View file

@ -49,8 +49,7 @@ for line in sys.stdin:
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)
for numb in range(0, 9+1): message = re.sub(" *:(?:green)?num([0-9]+): *", lambda m: m.group(1), message)
message = re.sub(f" *:(green)?num{numb}: *", str(numb), message)
message = message.replace("\ufe0f", "").replace("\u20e3", "") message = message.replace("\ufe0f", "").replace("\u20e3", "")
message = message.strip() message = message.strip()
else: else: