forked from rDrama/rDrama
fix mod log links
parent
fa15b1fdf8
commit
e0e8eb3dd6
|
@ -186,3 +186,5 @@ def command_regex_matcher(match, upper=False):
|
||||||
color = tuple(choices(range(256), k=3))
|
color = tuple(choices(range(256), k=3))
|
||||||
result = f'<b style="color:rgb{color}">Your roll: {result}</b>'
|
result = f'<b style="color:rgb{color}">Your roll: {result}</b>'
|
||||||
return match.group(1) + result
|
return match.group(1) + result
|
||||||
|
|
||||||
|
reason_regex = re.compile('(/(post|comment)/[0-9]+)', flags=re.A)
|
||||||
|
|
|
@ -1003,11 +1003,10 @@ def ban_user(user_id, v):
|
||||||
if not reason:
|
if not reason:
|
||||||
abort(400, "You need to submit a reason for banning!")
|
abort(400, "You need to submit a reason for banning!")
|
||||||
|
|
||||||
if reason.startswith("/") and '\\' not in reason:
|
|
||||||
reason = f'<a href="{reason.split()[0]}">{reason}</a>'
|
|
||||||
|
|
||||||
reason = filter_emojis_only(reason)
|
reason = filter_emojis_only(reason)
|
||||||
|
|
||||||
|
reason = reason_regex.sub(r'<a href="\1">\1</a>', reason)
|
||||||
|
|
||||||
user.ban(admin=v, reason=reason, days=days)
|
user.ban(admin=v, reason=reason, days=days)
|
||||||
|
|
||||||
if request.values.get("alts"):
|
if request.values.get("alts"):
|
||||||
|
@ -1071,11 +1070,11 @@ def agendaposter(user_id, v):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
reason = request.values.get("reason", "").strip()
|
reason = request.values.get("reason", "").strip()
|
||||||
if reason and reason.startswith("/") and '\\' not in reason:
|
|
||||||
reason = f'<a href="{reason.split()[0]}">{reason}</a>'
|
|
||||||
|
|
||||||
reason = filter_emojis_only(reason)
|
reason = filter_emojis_only(reason)
|
||||||
|
|
||||||
|
reason = reason_regex.sub(r'<a href="\1">\1</a>', reason)
|
||||||
|
|
||||||
duration = "permanently"
|
duration = "permanently"
|
||||||
if days:
|
if days:
|
||||||
user.agendaposter = int(time.time()) + (days * 86400)
|
user.agendaposter = int(time.time()) + (days * 86400)
|
||||||
|
|
Loading…
Reference in New Issue