Fix not being able to send multiple emotes properly at once

This commit is contained in:
git-bruh 2020-12-09 10:49:48 +05:30
parent 71b6d0cd00
commit 36cd593cdc
No known key found for this signature in database
GPG key ID: E1475C50075ADCE6

View file

@ -141,10 +141,13 @@ class MatrixClient(nio.AsyncClient):
guild = channel.guild guild = channel.guild
added_emotes = []
for emote in emotes: for emote in emotes:
emote_ = discord.utils.get(guild.emojis, name=emote) if emote not in added_emotes:
if emote_: added_emotes.append(emote)
message = message.replace(f":{emote}:", str(emote_)) emote_ = discord.utils.get(guild.emojis, name=emote)
if emote_:
message = message.replace(f":{emote}:", str(emote_))
for mention in mentions: for mention in mentions:
if mention[2] != "": if mention[2] != "":