fixed custom emoji in composition scan

This commit is contained in:
klemek
2021-01-11 22:03:19 +01:00
parent a3216d58f3
commit 1882e5ffe3
+3 -3
View File
@@ -55,9 +55,9 @@ class CompositionScanner(Scanner):
emotes_found = emojis.regex.findall(message.content) emotes_found = emojis.regex.findall(message.content)
without_emote = message.content without_emote = message.content
for name in emotes_found: for name in emotes_found:
if name not in compo.emotes: if name in emojis.unicode_list or re.match(
if name not in emojis.unicode_list: r"(<a?:[\w\-\~]+:\d+>|:[\w\\-\~]+:)", name
continue ):
compo.emotes[name] += 1 compo.emotes[name] += 1
i = without_emote.index(name) i = without_emote.index(name)
without_emote = without_emote[:i] + without_emote[i + len(name) :] without_emote = without_emote[:i] + without_emote[i + len(name) :]