This commit is contained in:
Imonlytryingtohelp
2026-04-04 15:52:06 +01:00
parent 476eadd6c9
commit dc8060270b
2 changed files with 12 additions and 1 deletions
+7
View File
@@ -1,6 +1,13 @@
# Changelog # Changelog
## [2.2.3] - 2026-04-04
### Fixed
- **Template Variable Substitution in post_tags Comments:**
- Fixed issue where `{author}` and `{{author}}` placeholders in `post_tags` comments were not being replaced with the actual post author's username.
- Template variables now properly substitute in automatic post_tags comments, matching behavior of trigger-based comments.
## [2.2.2] - 2026-03-29 ## [2.2.2] - 2026-03-29
### Added ### Added
+5 -1
View File
@@ -3,7 +3,7 @@ import praw
from config import get_reddit, Config from config import get_reddit, Config
from update_checker import start_update_checker from update_checker import start_update_checker
BOT_VERSION = "2.2.2" # Change this for new releases BOT_VERSION = "2.2.3" # Change this for new releases
BOT_NAME = "ModReplyBot" # Change this if bot name changes BOT_NAME = "ModReplyBot" # Change this if bot name changes
import time import time
@@ -49,6 +49,10 @@ class ModReplyBot:
time.sleep(30) time.sleep(30)
def comment_only(self, submission, comment_text, matched_tag=None): def comment_only(self, submission, comment_text, matched_tag=None):
try: try:
# Replace template variables
comment_text = comment_text.replace("{{author}}", submission.author.name if submission.author else "unknown")
comment_text = comment_text.replace("{author}", submission.author.name if submission.author else "unknown")
# Check required text and prepend message if needed # Check required text and prepend message if needed
if matched_tag and matched_tag in self.tag_required_text: if matched_tag and matched_tag in self.tag_required_text:
comment_text = self.check_required_text_and_prepend_message( comment_text = self.check_required_text_and_prepend_message(