ban template config option.

This commit is contained in:
2026-03-04 21:29:58 +00:00
parent 348f43b2a3
commit c84fcc1faa
2 changed files with 12 additions and 6 deletions

View File

@@ -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,