remotes/1693045480750635534/spooky-22
Aevann1 2021-09-03 23:04:04 +02:00
parent c0279fa97a
commit d44d4f7cf1
3 changed files with 41 additions and 3 deletions

View File

@ -30,7 +30,11 @@ class User(Base, Stndrd, Age_times):
background = Column(String)
customtitle = Column(String)
customtitleplain = Column(String)
quadrant = Column(String)
if "pcm" in site:
quadrant = Column(String)
basedcount = Column(Integer, default=0)
titlecolor = Column(String, default=defaultcolor)
theme = Column(String, default=defaulttheme)
themecolor = Column(String, default=defaultcolor)

View File

@ -54,7 +54,7 @@ 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}."""
NOTIFICATIONS_ACCOUNT = 1046
AUTOJANNY_ACCOUNT = 2360

View File

@ -295,7 +295,41 @@ def api_comment(v):
g.db.add(c_aux)
g.db.flush()
if "rdrama" in request.host and "ivermectin" in c_aux.body_html.lower():
if c.parent_comment and c_aux.body.lower().startswith("based"):
c_based = Comment(author_id=800,
parent_submission=parent_submission,
distinguish_level=6,
parent_comment_id=c.id,
level=level+1,
is_bot=True,
)
g.db.add(c_based)
g.db.flush()
basedguy = c.parent_comment.author.basedcount
basedguy.basedcount += 1
g.db.add(basedguy)
g.db.flush()
body2 = BASED_MSG.format(username=v.username, basedcount=basedguy)
with CustomRenderer(post_id=parent_id) as renderer:
body_md = renderer.render(mistletoe.Document(body2))
body_based_html = sanitize(body_md)
c_aux = CommentAux(
id=c_based.id,
body_html=body_based_html,
body=body2
)
g.db.add(c_aux)
g.db.flush()
n = Notification(comment_id=c_based.id, user_id=v.id)
g.db.add(n)
if "rdrama" in request.host and "ivermectin" in c_aux.body.lower():
c.is_banned = True
c.ban_reason = "ToS Violation"