pub async fn discord_logs( log_message: &str) -> Result<(), Box<dyn Error>> { let client: Client = Client::new(); let webhook_url: String = env::var("DISCORD_WEBHOOK_URL").unwrap(); let current_time: String = Utc::now().to_string(); client.post(&webhook_url) .body(json!({ "content": format!( "**xylex-daemon @ {} | **{}", current_time, log_message ) }).to_string()) .header( "Content-Type", "application/json" ) .send() .await?; Ok(())}
// cargo.toml [package]name = "xylex"version = "0.1.0"edition = "2021"[dependencies]polars = {version = "0.35.0", features = ["lazy", "rolling_window"] }reqwest = { version = "0.11.23", features = ["json", "blocking"] }tokio = { version = "1.35.1", features = ["full", "macros", "rt-multi-thread"] }chrono = { version = "0.4", features = ["serde"] }serde = { version = "1.0.196", features = ["derive"] }supabase_rs = "0.2.2"thiserror = "1"rocket = "0.5.0"serde_json = "1.0.111"dotenv = "0.15.0"mail-send = "0.4.6"mail-builder = "0.3.1"rsi = "0.1.2"csv = "1.1"arrow = "*"serenity = { version = "0.12", default-features = false, features = ["client", "gateway", "rustls_backend", "model", "collector"] }clokwerk = "0.4.0"image = "0.24.8"rusttype = "0.9.3"rand = "0.8.5"qrcode = "0.13"async-trait = "0.1.77"futures = "0.3.3"imageproc = "0.23.0"tokio-tungstenite = { version = "0.21.0", features = ["native-tls"] }serde_yaml = "0.9.31"lazy_static = "1.4.0"trading_sessions = "0.1.2"md-5 = "0.10.6"hex-literal = "0.4.1"fibonacci_retracement = "0.1.0"futures-util = "0.3.30"futures-channel = "0.3.30"url = "2.5.0"sha256 = "1.5.0"strum = "0.26"strum_macros = "0.26"sled = "0.34.7"xylex_spread_tracker = { path = "./xylex_spread_tracker" }xylex_card_generator = { path = "./xylex_card_generator" }xylex_hash_router = { path = "./xylex_hash_router" }xylex_scheduler = { path = "./xylex_scheduler" }xylex_discord = { path = "./xylex_discord"}[dev-dependencies]anyhow = "1"[profile.dev]opt-level = 0incremental = true[profile.release]opt-level = 3[workspace]members = [ "xylex_wss", "xylex_card_generator", "xylex_spread_tracker", "xylex_scheduler", "xylex_hash_router", "xylex_discord"]
[package]name = "xylex_card_generator"version = "0.1.0"edition = "2021"[dependencies]image = "0.25.0"imageproc = "0.24.0"reqwest = "0.12.2"rusttype = "0.9.3"serde = "1.0.197"serde_json = "1.0.114"serde_yaml = "0.9.34"
[package]name = "xylex_discord"version = "0.1.0"edition = "2021"[dependencies]serenity = { version = "0.12", default-features = false, features = ["client", "gateway", "rustls_backend", "model", "collector"] }tokio = { version = "1.35.1", features = ["full", "macros", "rt-multi-thread"] }chrono = { version = "0.4", features = ["serde"] }serde = { version = "1.0.196", features = ["derive"] }thiserror = "1"serde_json = "1.0.111"dotenv = "0.15.0"serde_yaml = "0.9.31"reqwest = "0.12.2"[dev-dependencies]anyhow = "1"[profile.dev]opt-level = 0incremental = true[profile.release]opt-level = 3
[package]name = "xylex_hash_router"version = "0.1.0"edition = "2021"[dependencies]dotenv = "0.15.0"serde_json = "1.0.115"supabase_rs = "0.2.2"
[package]name = "xylex_spread_tracker"version = "0.1.0"edition = "2021"[dependencies]regex = "1.10.4"reqwest = "0.12.2"serde = "1.0.197"serde_derive = "1.0.197"serde_json = "1.0.115"serde_yaml = "0.9.34"supabase_rs = "0.2.2"tokio = "1.36.0"
[package]name = "xylex_wss"version = "0.1.0"edition = "2021"[dependencies]amqprs = "1.5.3"serde = "1.0.197"serde_json = "1.0.114"serde_yaml = "0.9.34"tokio = "1.36.0"