Skip to main content

run_external_cli

Function run_external_cli 

Source
pub async fn run_external_cli<B, F>(
    factory: F,
    args: RunExternalArgs,
) -> Result<Vec<MatchResult>, Error>
where B: Bot, F: Fn() -> B + Send + Sync + 'static,
Expand description

The Rust equivalent of the chipzen run-external CLI: resolve config + env URL + token from args (and a discovered chipzen.toml), then run factory’s bot via run_external_bot.

Wire this into your bot binary’s main — the scaffolded starter ships a run-external subcommand that calls it. factory produces one bot per match (|| MyBot::default()).

§Errors

Surfaces the same errors as run_external_bot (no token, no URL, malformed config, or a terminal Error::BotDecision under safe_mode = false).