diff --git a/Bot/main.py b/Bot/main.py index 3a4a283..c639636 100644 --- a/Bot/main.py +++ b/Bot/main.py @@ -44,6 +44,7 @@ config = { "username": "", "password": "", "sub_name": "", + "ban_template": "", # numeric settings are stored as integers here rather than strings "max_days": 180, "max_posts": 180, diff --git a/Bot/utils/actions.py b/Bot/utils/actions.py index d3e557f..ed183f9 100644 --- a/Bot/utils/actions.py +++ b/Bot/utils/actions.py @@ -33,13 +33,20 @@ def get_flair(flair: str) -> Flair: 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 OP: `{submission.username}` 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} @@ -47,11 +54,8 @@ Date found: {submission.record_edited} Ban Template; - [Deleted post](https://reddit.com/comments/{submission.post_id}). - - 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.""" + {ban_text} +""" # default template used when resetting the configuration. this mirrors @@ -68,6 +72,7 @@ config = { "username": "", "password": "", "sub_name": "", + "ban_template": "", # numeric settings are stored as integers here rather than strings "max_days": 180, "max_posts": 180,