diff --git a/files/helpers/actions.py b/files/helpers/actions.py index 1dd23a666..e831f958b 100644 --- a/files/helpers/actions.py +++ b/files/helpers/actions.py @@ -166,7 +166,7 @@ def execute_snappy(post:Submission, v:User): g.db.add(c) - check_slots_command(v, snappy, c) + check_slots_command(c, v, snappy) snappy.comment_count += 1 snappy.pay_account('coins', 1) @@ -530,12 +530,8 @@ def process_poll_options(target:Union[Submission, Comment], ) db.add(option) -def execute_wordle(post_target:post_target_type, c:Comment, body:str, rts:bool): +def execute_wordle(c:Comment, body:str): if not FEATURES['WORDLE']: return if not "!wordle" in body: return answer = random.choice(WORDLE_LIST) c.wordle_result = f'_active_{answer}' - - if not c.wordle_result and not rts: - post_target.comment_count += 1 - g.db.add(post_target) diff --git a/files/helpers/slots.py b/files/helpers/slots.py index 651e01a39..ef6fc0891 100644 --- a/files/helpers/slots.py +++ b/files/helpers/slots.py @@ -120,7 +120,7 @@ def shuffle(stuff): return stuff -def check_slots_command(v:User, u:User, c:Comment): +def check_slots_command(c:Comment, v:User, u:User): if not FEATURES['GAMBLING']: return body = c.body.lower() diff --git a/files/helpers/treasure.py b/files/helpers/treasure.py index 6bf4a7099..e7a2e51ae 100644 --- a/files/helpers/treasure.py +++ b/files/helpers/treasure.py @@ -10,7 +10,7 @@ standard_min = 12 standard_max = 100 lotterizer_rate = 33 -def check_for_treasure(in_text, from_comment): +def check_for_treasure(from_comment, in_text): user = from_comment.author if not FEATURES['GAMBLING']: return diff --git a/files/routes/comments.py b/files/routes/comments.py index e86e73421..17ee16af2 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -326,9 +326,16 @@ def comment(v:User): c.voted = 1 - check_for_treasure(body, c) - execute_wordle(post_target or parent_user, c, body, rts) - check_slots_command(v, v, c) + check_for_treasure(c, body) + execute_wordle(c, body) + check_slots_command(c, v, v) + + # Increment post count iff not self-reply and not a spammy comment game + # Essentially a measure to make comment counts reflect "real" content + if (posting_to_submission and not rts + and not c.wordle_result and not c.slots_result): + post_target.comment_count += 1 + g.db.add(post_target) if c.level > 5: n = g.db.query(Notification).filter_by(