clearer chud message to chudded user

pull/142/head
Aevann 2023-03-24 13:51:25 +02:00
parent 3ee1851fa6
commit a93c5ed0e5
2 changed files with 7 additions and 6 deletions

View File

@ -1042,26 +1042,25 @@ def agendaposter(id, v):
reason = reason_regex_post.sub(r'<a href="\1">\1</a>', reason)
reason = reason_regex_comment.sub(r'<a href="\1#context">\1</a>', reason)
duration = "permanently"
if days:
if user.agendaposter:
user.agendaposter += days * 86400
else:
user.agendaposter = int(time.time()) + (days * 86400)
days_txt = str(days)
if days_txt.endswith('.0'): days_txt = days_txt[:-2]
duration = f"for {days_txt} day"
if days != 1: duration += "s"
if reason: text = f"@{v.username} (a site admin) has chudded you for **{days_txt}** days for the following reason:\n\n> {reason}"
else: text = f"@{v.username} (a site admin) has chudded you for **{days_txt}** days."
else:
user.agendaposter = 1
if reason: text = f"@{v.username} (a site admin) has chudded you permanently for the following reason:\n\n> {reason}"
else: text = f"@{v.username} (a site admin) has chudded you permanently."
duration = "permanently"
user.agendaposter_phrase = "trans lives matter"
text += f"\n\n> {user.agendaposter_phrase}"
text = f"@{v.username} (a site admin) has chudded you **{duration}**"
if reason: text += f"for the following reason:\n\n> {reason}"
text += f"\n\n**You now have to say this phrase in all posts and comments you make {duration}:**\n\n> {user.agendaposter_phrase}"
user.chudded_by = v.id
g.db.add(user)

View File

@ -221,6 +221,8 @@ def award_thing(v, thing_type, id):
msg += "!"
if note:
note = '\n\n> '.join(note.splitlines())
if kind == "agendaposter":
msg += f"\n\n**You now have to say this phrase in all posts and comments you make for 24 hours:**"
msg += f"\n\n> {note}"
send_repeatable_notification(author.id, msg)