comment bots: have the bots themselves do checks

pull/52/head
justcool393 2022-12-08 21:31:59 -06:00
parent e5f0de6424
commit 2abf718ee4
2 changed files with 7 additions and 7 deletions

View File

@ -201,6 +201,7 @@ def execute_snappy(post:Submission, v:User):
post.replies = [c]
def execute_zozbot(c:Comment, level:int, post_target:post_target_type, v):
if SITE_NAME != 'rDrama': return
posting_to_submission = isinstance(post_target, Submission)
if random.random() >= 0.001: return
c2 = Comment(author_id=ZOZBOT_ID,
@ -259,6 +260,7 @@ def execute_zozbot(c:Comment, level:int, post_target:post_target_type, v):
g.db.add(zozbot)
def execute_longpostbot(c:Comment, level:int, body, body_html, post_target:post_target_type, v:User):
if SITE_NAME != 'rDrama': return
posting_to_submission = isinstance(post_target, Submission)
if not len(c.body.split()) >= 200: return
if "</blockquote>" in body_html: return
@ -296,6 +298,8 @@ def execute_longpostbot(c:Comment, level:int, body, body_html, post_target:post_
g.db.add(n)
def execute_basedbot(c:Comment, level:int, body, post_target:post_target_type, v:User):
if SITE != "pcmemes.net": return
if not c.body.lower().startswith("based"): return
posting_to_submission = isinstance(post_target, Submission)
pill = based_regex.match(body)
if level == 1: basedguy = get_account(post_target.author_id)

View File

@ -251,8 +251,7 @@ def comment(v:User):
process_poll_options(c, CommentOption, options, 0, "Poll", g.db)
process_poll_options(c, CommentOption, choices, 1, "Poll", g.db)
if SITE == 'pcmemes.net' and c.body.lower().startswith("based"):
execute_basedbot(c, level, body, post_target, v)
execute_basedbot(c, level, body, post_target, v)
if post_target.id not in ADMIGGER_THREADS and v.agendaposter and not v.marseyawarded and AGENDAPOSTER_PHRASE not in c.body.lower() and post_target.sub != 'chudrama':
c.is_banned = True
@ -281,9 +280,8 @@ def comment(v:User):
n = Notification(comment_id=c_jannied.id, user_id=v.id)
g.db.add(n)
if SITE_NAME == 'rDrama':
execute_longpostbot(c, level, body, body_html, post_target, v)
execute_zozbot(c, level, post_target, v)
execute_longpostbot(c, level, body, body_html, post_target, v)
execute_zozbot(c, level, post_target, v)
if not v.shadowbanned:
notify_users = NOTIFY_USERS(body, v)
@ -329,9 +327,7 @@ 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)
if c.level > 5: