File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments