Fix emoji not replacing or rendering, also fix visitor fetching 429 error

This commit is contained in:
Jeremy Zhang
2017-06-10 03:43:23 +00:00
parent fbe41a9a35
commit 289fdc0eb5
2 changed files with 13 additions and 11 deletions

View File

@ -100,17 +100,12 @@ def check_user_in_guild(guild_id):
return dbUser is not None and not checkUserRevoke(guild_id)
def parse_emoji(textToParse, guild_id):
emojis = []
emojis = re.findall(":(.*?):", textToParse)
guild_emojis = get_guild_emojis(guild_id)
newText = textToParse
for gemoji in guild_emojis:
emoji_name = gemoji["name"]
emoji_id = gemoji["id"]
for usremote in emojis:
if usremote == emoji_name:
newText = newText.replace(":{}:".format(emoji_name), "<:{}:{}>".format(emoji_name, emoji_id))
return newText
textToParse = textToParse.replace(":{}:".format(emoji_name), "<:{}:{}>".format(emoji_name, emoji_id))
return textToParse
def format_post_content(guild_id, message):