(runner: &mut R)
| 650 | const CHANNEL_PRIORITY: &[&str] = &["telegram", "discord", "slack", "mattermost"]; |
| 651 | |
| 652 | pub fn detect_openclaw_channel<R: OpenclawRunner>(runner: &mut R) -> Option<String> { |
| 653 | let channels = |
| 654 | openclaw_config_get_json_at_path(runner, "channels", OpenclawApprovalMode::AutoApprove) |
| 655 | .ok()?; |
| 656 | let obj = channels.as_object()?; |
| 657 | for &platform in CHANNEL_PRIORITY { |
| 658 | if let Some(cfg) = obj.get(platform) { |
| 659 | if cfg.get("enabled").and_then(Value::as_bool) != Some(false) { |
| 660 | return Some(platform.to_string()); |
| 661 | } |
| 662 | } |
| 663 | } |
| 664 | None |
| 665 | } |
| 666 | |
| 667 | pub fn setup_openclaw_stats_cron<R: OpenclawRunner>( |
| 668 | runner: &mut R, |
no test coverage detected