")
@limiter.limit("1/second;30/minute;200/hour;1000/day")
@auth_required
@@ -1088,7 +1090,7 @@ def handle_wordle_action(cid, v):
guesses, status, answer = comment.wordle_result.split("_")
count = len(guesses.split(" -> "))
- try: guess = request.values.get("guess").strip().lower()
+ try: guess = request.values.get("thing").strip().lower()
except: abort(400)
if len(guess) != 5 or not d.check(guess) and guess not in WORDLE_LIST:
@@ -1106,4 +1108,4 @@ def handle_wordle_action(cid, v):
g.db.add(comment)
g.db.commit()
- return {"message" : "."}
\ No newline at end of file
+ return {"response" : comment.wordle_html(v)}
\ No newline at end of file
diff --git a/files/templates/comments.html b/files/templates/comments.html
index 708ddb998f..fb57d4dda7 100644
--- a/files/templates/comments.html
+++ b/files/templates/comments.html
@@ -157,23 +157,6 @@
{% set isreply = False %}
{% endif %}
-{% if c.blackjack_result %}
- {% set split_result = c.blackjack_result.split('_') %}
- {% set blackjack_status = split_result[3] %}
- {% set player_hand = split_result[0].replace('X', '10') %}
- {% set dealer_hand = split_result[1].split('/')[0] if blackjack_status == 'active' else split_result[1] %}
- {% set dealer_hand = dealer_hand.replace('X', '10') %}
- {% set wager = split_result[4] %}
- {% set kind = split_result[5] %}
-{% endif %}
-
-{% if c.wordle_result %}
- {% set split_wordle_result = c.wordle_result.split('_') %}
- {% set wordle_guesses = split_wordle_result[0] %}
- {% set wordle_status = split_wordle_result[1] %}
- {% set wordle_answer = split_wordle_result[2] %}
-{% endif %}
-
{% if not isreply %}
@@ -255,35 +238,11 @@
{% endif %}
{% if c.blackjack_result %}
- {% set currency_kind = "Coins" if kind == "coins" else "Marseybucks" %}
- {{player_hand}} vs. {{dealer_hand}}
- {% if blackjack_status == 'active' and v.id == c.author_id %}
-
-
- {% elif blackjack_status == 'push' %}
- Pushed. Refunded {{wager}} {{currency_kind}}.
- {% elif blackjack_status == 'bust' %}
- Bust. Lost {{wager}} {{currency_kind}}.
- {% elif blackjack_status == 'lost' %}
- Lost {{wager}} {{currency_kind}}.
- {% elif blackjack_status == 'won' %}
- Won {{wager}} {{currency_kind}}.
- {% elif blackjack_status == 'blackjack' %}
- Blackjack! Won {{(wager|int * 3/2)|round(0, 'floor')|int}} {{currency_kind}}.
- {% endif %}
+ {{c.blackjack_html(v) | safe}}
{% endif %}
{% if c.wordle_result %}
- {{wordle_guesses}}
- {% if wordle_status == 'active' and v.id == c.author_id %}
-
-
- {% elif wordle_status == 'won' %}
- Correct!
- {% elif wordle_status == 'lost' %}
- Lost. The answer was: {{wordle_answer}}
- {% endif %}
+ {{c.wordle_html(v) | safe}}
{% endif %}
{% if c.active_flags %}
@@ -874,7 +833,7 @@
{% if v %}
-
+
{% endif %}