forked from rDrama/rDrama
fdfd
parent
c0279fa97a
commit
d44d4f7cf1
|
@ -30,7 +30,11 @@ class User(Base, Stndrd, Age_times):
|
||||||
background = Column(String)
|
background = Column(String)
|
||||||
customtitle = Column(String)
|
customtitle = Column(String)
|
||||||
customtitleplain = Column(String)
|
customtitleplain = Column(String)
|
||||||
|
|
||||||
|
if "pcm" in site:
|
||||||
quadrant = Column(String)
|
quadrant = Column(String)
|
||||||
|
basedcount = Column(Integer, default=0)
|
||||||
|
|
||||||
titlecolor = Column(String, default=defaultcolor)
|
titlecolor = Column(String, default=defaultcolor)
|
||||||
theme = Column(String, default=defaulttheme)
|
theme = Column(String, default=defaulttheme)
|
||||||
themecolor = Column(String, default=defaultcolor)
|
themecolor = Column(String, default=defaultcolor)
|
||||||
|
|
|
@ -54,7 +54,7 @@ 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}."""
|
||||||
|
|
||||||
NOTIFICATIONS_ACCOUNT = 1046
|
NOTIFICATIONS_ACCOUNT = 1046
|
||||||
AUTOJANNY_ACCOUNT = 2360
|
AUTOJANNY_ACCOUNT = 2360
|
||||||
|
|
|
@ -295,7 +295,41 @@ def api_comment(v):
|
||||||
g.db.add(c_aux)
|
g.db.add(c_aux)
|
||||||
g.db.flush()
|
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.is_banned = True
|
||||||
c.ban_reason = "ToS Violation"
|
c.ban_reason = "ToS Violation"
|
||||||
|
|
Loading…
Reference in New Issue