add emoji html junk removing function

emoji in redeem notes now show up as their shortcodes
This commit is contained in:
2023-01-09 15:08:33 +01:00
parent 85c4df9250
commit 25589ff69e
2 changed files with 9 additions and 3 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
from flask import current_app
from tlapbot.db import get_db
from tlapbot.owncast_helpers import (use_points, add_to_redeem_queue,
add_to_counter, read_users_points, send_chat)
add_to_counter, read_users_points, send_chat, remove_emoji)
def handle_redeem(message, user_id):
@@ -39,7 +39,7 @@ def handle_redeem(message, user_id):
if not note:
send_chat(f"Cannot redeem {redeem}, no note included.")
return
if add_to_redeem_queue(db, user_id, redeem, note) and use_points(db, user_id, price):
if add_to_redeem_queue(db, user_id, redeem, remove_emoji(note)) and use_points(db, user_id, price):
send_chat(f"{redeem} redeemed for {price} points.")
else:
send_chat(f"Redeeming {redeem} failed.")