fd
This commit is contained in:
parent
db4bbfb878
commit
dd60d46a50
3 changed files with 8 additions and 2 deletions
|
@ -34,6 +34,7 @@ class User(Base, Stndrd, Age_times):
|
||||||
if "pcm" in site:
|
if "pcm" in site:
|
||||||
quadrant = Column(String)
|
quadrant = Column(String)
|
||||||
basedcount = Column(Integer, default=0)
|
basedcount = Column(Integer, default=0)
|
||||||
|
pills = customtitle = Column(String, default="")
|
||||||
|
|
||||||
titlecolor = Column(String, default=defaultcolor)
|
titlecolor = Column(String, default=defaultcolor)
|
||||||
theme = Column(String, default=defaulttheme)
|
theme = Column(String, default=defaulttheme)
|
||||||
|
|
|
@ -54,7 +54,9 @@ The only proven method of prevention is the COVID-19 vaccine, paired with approp
|
||||||
|
|
||||||
Thank you."""
|
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
|
BASEDBOT_ACCOUNT = 800
|
||||||
NOTIFICATIONS_ACCOUNT = 1046
|
NOTIFICATIONS_ACCOUNT = 1046
|
||||||
|
|
|
@ -296,6 +296,8 @@ def api_comment(v):
|
||||||
g.db.flush()
|
g.db.flush()
|
||||||
|
|
||||||
if "pcm" in request.host and c_aux.body.lower().startswith("based"):
|
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,
|
c_based = Comment(author_id=BASEDBOT_ACCOUNT,
|
||||||
parent_submission=parent_submission,
|
parent_submission=parent_submission,
|
||||||
distinguish_level=6,
|
distinguish_level=6,
|
||||||
|
@ -310,10 +312,11 @@ def api_comment(v):
|
||||||
if level == 1: basedguy = get_account(c.post.author_id)
|
if level == 1: basedguy = get_account(c.post.author_id)
|
||||||
else: basedguy = get_account(c.parent_comment.author_id)
|
else: basedguy = get_account(c.parent_comment.author_id)
|
||||||
basedguy.basedcount += 1
|
basedguy.basedcount += 1
|
||||||
|
if pill: basedguy.pills += f"{pill}, "
|
||||||
g.db.add(basedguy)
|
g.db.add(basedguy)
|
||||||
g.db.flush()
|
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))
|
with CustomRenderer(post_id=parent_id) as renderer: body_md = renderer.render(mistletoe.Document(body2))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue