diff options
| author | Fuwn <[email protected]> | 2025-09-21 15:22:49 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-09-21 15:22:49 -0700 |
| commit | e087d720fe2833e8f09d515dc4726d82469b1fd9 (patch) | |
| tree | 0c6aaa8fd8c7569897c61c8c6c1f0718739d6fe4 | |
| parent | feat(irm): Discord logging (diff) | |
| download | umabot-e087d720fe2833e8f09d515dc4726d82469b1fd9.tar.xz umabot-e087d720fe2833e8f09d515dc4726d82469b1fd9.zip | |
fix(base): NO_TEXT error handling
| -rw-r--r-- | src/umabot/rules/base.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/umabot/rules/base.py b/src/umabot/rules/base.py index 0318aaa..1ee0d41 100644 --- a/src/umabot/rules/base.py +++ b/src/umabot/rules/base.py @@ -47,9 +47,12 @@ class Rule(ABC): submission.mod.remove() self.logger.info(f"Removed submission {submission.id} by {submission.author}") - # Post removal message - submission.reply(removal_message) - self.logger.info(f"Posted removal message for {submission.id}") + # Post removal message only if it's not empty + if removal_message and removal_message.strip(): + submission.reply(removal_message) + self.logger.info(f"Posted removal message for {submission.id}") + else: + self.logger.info(f"Skipped posting removal message for {submission.id} (empty message)") return True |