forked from rDrama/rDrama
fds
parent
9c1528537c
commit
fcb7c94659
|
@ -485,7 +485,7 @@ class User(Base):
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def ban(self, admin=None, reason=None, days=0, discord=True):
|
def ban(self, admin=None, reason=None, days=0):
|
||||||
|
|
||||||
if days > 0:
|
if days > 0:
|
||||||
ban_time = int(time.time()) + (days * 86400)
|
ban_time = int(time.time()) + (days * 86400)
|
||||||
|
@ -493,7 +493,7 @@ class User(Base):
|
||||||
else:
|
else:
|
||||||
self.bannerurl = None
|
self.bannerurl = None
|
||||||
self.profileurl = None
|
self.profileurl = None
|
||||||
if self.discord_id and discord: remove_user(self)
|
if self.discord_id: remove_user(self)
|
||||||
|
|
||||||
self.is_banned = admin.id if admin else AUTOJANNY_ACCOUNT
|
self.is_banned = admin.id if admin else AUTOJANNY_ACCOUNT
|
||||||
if reason: self.ban_reason = reason
|
if reason: self.ban_reason = reason
|
||||||
|
|
|
@ -181,7 +181,7 @@ def banaward_trigger(post=None, comment=None):
|
||||||
link = f"[this post]({post.permalink})" if post else f"[this comment]({comment.permalink})"
|
link = f"[this post]({post.permalink})" if post else f"[this comment]({comment.permalink})"
|
||||||
|
|
||||||
if not author.is_suspended:
|
if not author.is_suspended:
|
||||||
author.ban(reason="one-day ban award used", days=1)
|
author.ban(reason=f"one-day ban award used by @{v.username}", days=1)
|
||||||
|
|
||||||
send_notification(NOTIFICATIONS_ACCOUNT, author, f"Your account has been suspended for a day for {link}. It sucked and you should feel bad.")
|
send_notification(NOTIFICATIONS_ACCOUNT, author, f"Your account has been suspended for a day for {link}. It sucked and you should feel bad.")
|
||||||
elif author.unban_utc > 0:
|
elif author.unban_utc > 0:
|
||||||
|
@ -194,9 +194,12 @@ def banaward_trigger(post=None, comment=None):
|
||||||
def grass_trigger(post=None, comment=None):
|
def grass_trigger(post=None, comment=None):
|
||||||
|
|
||||||
author = post.author if post else comment.author
|
author = post.author if post else comment.author
|
||||||
link = f"[this post]({post.permalink})" if post else f"[this comment]({comment.permalink})"
|
|
||||||
|
|
||||||
author.ban(reason="grass award used", discord=False)
|
author.is_banned = AUTOJANNY_ACCOUNT
|
||||||
|
author.ban_reason = f"grass award used by @{v.username}"
|
||||||
|
g.db.add(self)
|
||||||
|
|
||||||
|
link = f"[this post]({post.permalink})" if post else f"[this comment]({comment.permalink})"
|
||||||
send_notification(NOTIFICATIONS_ACCOUNT, author, f"Your account has been suspended permanently for {link}. You must [provide the admins](/contact) a timestamped picture of you touching grass to get unbanned!")
|
send_notification(NOTIFICATIONS_ACCOUNT, author, f"Your account has been suspended permanently for {link}. You must [provide the admins](/contact) a timestamped picture of you touching grass to get unbanned!")
|
||||||
|
|
||||||
ACTIONS = {
|
ACTIONS = {
|
||||||
|
|
Loading…
Reference in New Issue