From 36cd593cdc6f8bfadceaeaa172d60db3b3c707bb Mon Sep 17 00:00:00 2001 From: git-bruh Date: Wed, 9 Dec 2020 10:49:48 +0530 Subject: [PATCH] Fix not being able to send multiple emotes properly at once --- main.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 93d866f..8f64fbe 100644 --- a/main.py +++ b/main.py @@ -141,10 +141,13 @@ class MatrixClient(nio.AsyncClient): guild = channel.guild + added_emotes = [] for emote in emotes: - emote_ = discord.utils.get(guild.emojis, name=emote) - if emote_: - message = message.replace(f":{emote}:", str(emote_)) + if emote not in added_emotes: + added_emotes.append(emote) + emote_ = discord.utils.get(guild.emojis, name=emote) + if emote_: + message = message.replace(f":{emote}:", str(emote_)) for mention in mentions: if mention[2] != "":