MCPcopy Create free account
hub / github.com/clawshell/clawshell / detect_openclaw_channel

Function detect_openclaw_channel

src/openclaw_cli.rs:652–665  ·  view source on GitHub ↗
(runner: &mut R)

Source from the content-addressed store, hash-verified

650const CHANNEL_PRIORITY: &[&str] = &["telegram", "discord", "slack", "mattermost"];
651
652pub 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
667pub fn setup_openclaw_stats_cron<R: OpenclawRunner>(
668 runner: &mut R,

Callers 1

Calls 1

Tested by

no test coverage detected