Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aien-sovereign-core/blob/main/crates/spark-discord-hub/src/main.rs # aien-sovereign-core Autonomous sovereign intelligence engine and runtime core for NVIDIA DGX Spark Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aien-sovereign-core / crates / spark-discord-hub / src / main.rs` 50 lines ยท 1396 bytes Raw Blame History 1 use clap::Parser; 2 use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt}; 3 4 mod atlas_bot; 5 mod gateway; 6 mod gideon_bot; 7 mod models; 8 mod vault; 9 10 use gateway::DiscordGatewayHub; 11 use vault::get_vault_secret; 12 13 #[derive(Parser, Debug)] 14 #[command(name = "spark-discord-hub", about = "Sovereign Native Multi-Bot Discord Hub in Rust")] 15 struct Cli { 16 #[arg(long)] 17 token: Option, 18 } 19 20 #[tokio::main] 21 async fn main() -> Result<(), Box> { 22 tracing_subscriber::registry() 23 .with(tracing_subscriber::EnvFilter::try_from_default_env().unwrap_or_else(|_| "info".into())) 24 .with(tracing_subscriber::fmt::layer()) 25 .init(); 26 27 let cli = Cli::parse(); 28 29 tracing::info!("Initializing SparkOS Discord Multi-Bot Hub..."); 30 31 // Dynamic resolution from TPM vault 32 let token = cli.token 33 .or_else(|| get_vault_secret("DISCORD_BOT_TOKEN")) 34 .or_else(|| get_vault_secret("DISCORD_ATLAS_TOKEN")); 35 36 let token = match token { 37 Some(t) if !t.is_empty() => t, 38 _ => { 39 tracing::error!("No Discord bot token found in atlas-vault (DISCORD_BOT_TOKEN). Exiting."); 40 std::process::exit(1); 41 } 42 }; 43 44 tracing::info!("Discord bot token dynamically resolved from TPM vault. Starting gateway hub..."); 45 46 let hub = DiscordGatewayHub::new(token); 47 hub.run().await?; 48 49 Ok(()) 50 }