ban template config option.
This commit is contained in:
@@ -44,6 +44,7 @@ config = {
|
|||||||
"username": "",
|
"username": "",
|
||||||
"password": "",
|
"password": "",
|
||||||
"sub_name": "",
|
"sub_name": "",
|
||||||
|
"ban_template": "",
|
||||||
# numeric settings are stored as integers here rather than strings
|
# numeric settings are stored as integers here rather than strings
|
||||||
"max_days": 180,
|
"max_days": 180,
|
||||||
"max_posts": 180,
|
"max_posts": 180,
|
||||||
|
|||||||
@@ -33,13 +33,20 @@ def get_flair(flair: str) -> Flair:
|
|||||||
|
|
||||||
|
|
||||||
def modmail_removal_notification(submission: Row, method: str) -> str:
|
def modmail_removal_notification(submission: Row, method: str) -> str:
|
||||||
|
try:
|
||||||
|
from config import config as bot_config
|
||||||
|
ban_template = bot_config.get("ban_template", "[Deleted post](https://reddit.com/comments/{post_id}).\n\nDeleting an answered post, without marking it solved, is against our rules.\n\nYou can read [our rules](https://reddit.com/r/MinecraftHelp/wiki/rules) to see if you're eligible to appeal this ban.")
|
||||||
|
except Exception:
|
||||||
|
ban_template = "[Deleted post](https://reddit.com/comments/{post_id}).\n\nDeleting an answered post, without marking it solved, is against our rules.\n\nYou can read [our rules](https://reddit.com/r/MinecraftHelp/wiki/rules) to see if you're eligible to appeal this ban."
|
||||||
|
|
||||||
|
ban_text = ban_template.format(post_id=submission.post_id)
|
||||||
return f"""A post has been removed
|
return f"""A post has been removed
|
||||||
|
|
||||||
OP: `{submission.username}`
|
OP: `{submission.username}`
|
||||||
|
|
||||||
Title: {submission.title}
|
Title: {submission.title}
|
||||||
|
|
||||||
Post ID: https://old.reddit.com/comments/{submission.post_id}
|
Post ID: https://sh.reddit.com/comments/{submission.post_id}
|
||||||
|
|
||||||
Date created: {submission.record_created}
|
Date created: {submission.record_created}
|
||||||
|
|
||||||
@@ -47,11 +54,8 @@ Date found: {submission.record_edited}
|
|||||||
|
|
||||||
Ban Template;
|
Ban Template;
|
||||||
|
|
||||||
[Deleted post](https://reddit.com/comments/{submission.post_id}).
|
{ban_text}
|
||||||
|
"""
|
||||||
Deleting an answered post, without marking it solved, is against our rules.
|
|
||||||
|
|
||||||
You can read [our rules](https://reddit.com/r/MinecraftHelp/wiki/rules) to see if you're eligible to appeal this ban."""
|
|
||||||
|
|
||||||
|
|
||||||
# default template used when resetting the configuration. this mirrors
|
# default template used when resetting the configuration. this mirrors
|
||||||
@@ -68,6 +72,7 @@ config = {
|
|||||||
"username": "",
|
"username": "",
|
||||||
"password": "",
|
"password": "",
|
||||||
"sub_name": "",
|
"sub_name": "",
|
||||||
|
"ban_template": "",
|
||||||
# numeric settings are stored as integers here rather than strings
|
# numeric settings are stored as integers here rather than strings
|
||||||
"max_days": 180,
|
"max_days": 180,
|
||||||
"max_posts": 180,
|
"max_posts": 180,
|
||||||
|
|||||||
Reference in New Issue
Block a user