Skip to content

Commit 9e3a176

Browse files
committed
fix(orchestrator): post activity summary to Discord only when mutations allowed
1 parent 1583e48 commit 9e3a176

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

src/ghdcbot/engine/orchestrator.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -194,15 +194,16 @@ def run_once(self) -> None:
194194
"report_dir": str(_activity_path.parent),
195195
},
196196
})
197-
# Optional: post short summary to Discord if configured
198-
activity_channel_id = getattr(
199-
self.config.discord, "activity_channel_id", None
200-
)
201-
if activity_channel_id and activity_md:
202-
send_msg = getattr(self.discord_writer, "send_message", None)
203-
if callable(send_msg):
204-
summary = activity_md[:1900] + ("..." if len(activity_md) > 1900 else "")
205-
send_msg(activity_channel_id, summary)
197+
# Optional: post short summary to Discord if configured (only when mutations allowed)
198+
if policy.allow_discord_mutations:
199+
activity_channel_id = getattr(
200+
self.config.discord, "activity_channel_id", None
201+
)
202+
if activity_channel_id and activity_md:
203+
send_msg = getattr(self.discord_writer, "send_message", None)
204+
if callable(send_msg):
205+
summary = activity_md[:1900] + ("..." if len(activity_md) > 1900 else "")
206+
send_msg(activity_channel_id, summary)
206207
except Exception as exc:
207208
logger.exception("Failed to write audit reports", extra={"error": str(exc)})
208209

0 commit comments

Comments
 (0)