fix permachudding

master
Aevann1 2022-11-08 05:37:14 +02:00
parent bd8192781a
commit 3f4a568d32
1 changed files with 4 additions and 3 deletions

View File

@ -1015,11 +1015,9 @@ def agendaposter(user_id, v):
if reason and reason.startswith("/") and '\\' not in reason: if reason and reason.startswith("/") and '\\' not in reason:
reason = f'<a href="{reason.split()[0]}">{reason}</a>' reason = f'<a href="{reason.split()[0]}">{reason}</a>'
user.agendaposter = int(time.time()) + (days * 86400)
g.db.add(user)
duration = "permanently" duration = "permanently"
if days: if days:
user.agendaposter = int(time.time()) + (days * 86400)
days_txt = str(days) days_txt = str(days)
if days_txt.endswith('.0'): days_txt = days_txt[:-2] if days_txt.endswith('.0'): days_txt = days_txt[:-2]
duration = f"for {days_txt} day" duration = f"for {days_txt} day"
@ -1027,9 +1025,12 @@ def agendaposter(user_id, v):
if reason: text = f"@{v.username} (Admin) has chudded you for **{days_txt}** days for the following reason:\n\n> {reason}" if reason: text = f"@{v.username} (Admin) has chudded you for **{days_txt}** days for the following reason:\n\n> {reason}"
else: text = f"@{v.username} (Admin) has chudded you for **{days_txt}** days." else: text = f"@{v.username} (Admin) has chudded you for **{days_txt}** days."
else: else:
user.agendaposter = 1
if reason: text = f"@{v.username} (Admin) has chudded you permanently for the following reason:\n\n> {reason}" if reason: text = f"@{v.username} (Admin) has chudded you permanently for the following reason:\n\n> {reason}"
else: text = f"@{v.username} (Admin) has chudded you permanently." else: text = f"@{v.username} (Admin) has chudded you permanently."
g.db.add(user)
send_repeatable_notification(user.id, text) send_repeatable_notification(user.id, text)
note = f'duration: {duration}' note = f'duration: {duration}'