forked from rDrama/rDrama
fds
parent
0d9842e947
commit
ceb7bb8be9
|
@ -485,7 +485,7 @@ class User(Base):
|
|||
|
||||
return data
|
||||
|
||||
def ban(self, admin=None, reason=None, days=0):
|
||||
def ban(self, admin=None, reason=None, days=0, discord=True):
|
||||
|
||||
if days > 0:
|
||||
ban_time = int(time.time()) + (days * 86400)
|
||||
|
@ -493,7 +493,7 @@ class User(Base):
|
|||
else:
|
||||
self.bannerurl = None
|
||||
self.profileurl = None
|
||||
if self.discord_id: remove_user(self)
|
||||
if self.discord_id and discord: remove_user(self)
|
||||
|
||||
self.is_banned = admin.id if admin else AUTOJANNY_ACCOUNT
|
||||
if reason: self.ban_reason = reason
|
||||
|
|
|
@ -196,7 +196,7 @@ def grass_trigger(post=None, comment=None):
|
|||
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")
|
||||
author.ban(reason="grass award used", discord=False)
|
||||
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 = {
|
||||
|
|
Loading…
Reference in New Issue