remotes/1693045480750635534/spooky-22
Aevann1 2021-09-04 00:21:47 +02:00
parent dbba52e97e
commit bf26b5b256
3 changed files with 8 additions and 2 deletions

View File

@ -34,6 +34,7 @@ class User(Base, Stndrd, Age_times):
if "pcm" in site:
quadrant = Column(String)
basedcount = Column(Integer, default=0)
pills = customtitle = Column(String, default="")
titlecolor = Column(String, default=defaultcolor)
theme = Column(String, default=defaulttheme)

View File

@ -54,7 +54,9 @@ The only proven method of prevention is the COVID-19 vaccine, paired with approp
Thank you."""
BASED_MSG = """@{username}'s Based Count has increased by 1. Their Based Count is now {basedcount}."""
BASED_MSG = """@{username}'s Based Count has increased by 1. Their Based Count is now {basedcount}.\
Pills: {pills}"""
BASEDBOT_ACCOUNT = 800
NOTIFICATIONS_ACCOUNT = 1046

View File

@ -296,6 +296,8 @@ def api_comment(v):
g.db.flush()
if "pcm" in request.host and c_aux.body.lower().startswith("based"):
pill = re.match("based and (.*?)(-| )pilled", body, re.IGNORECASE)
c_based = Comment(author_id=BASEDBOT_ACCOUNT,
parent_submission=parent_submission,
distinguish_level=6,
@ -310,10 +312,11 @@ def api_comment(v):
if level == 1: basedguy = get_account(c.post.author_id)
else: basedguy = get_account(c.parent_comment.author_id)
basedguy.basedcount += 1
if pill: basedguy.pills += f"{pill}, "
g.db.add(basedguy)
g.db.flush()
body2 = BASED_MSG.format(username=basedguy.username, basedcount=basedguy.basedcount)
body2 = BASED_MSG.format(username=basedguy.username, basedcount=basedguy.basedcount, pills=basedguy.pills)
with CustomRenderer(post_id=parent_id) as renderer: body_md = renderer.render(mistletoe.Document(body2))