1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
#![allow(incomplete_features)] #![feature( try_blocks, let_chains, generic_const_exprs, iter_intersperse, if_let_guard, backtrace_frames, const_trait_impl )] emojib::the_crate! {} use std::{net::SocketAddr, sync::OnceLock, time::Instant}; #[cfg(feature = "server")] mod expose; #[macro_use] mod bot; static START: OnceLock<Instant> = OnceLock::new(); #[tokio::main(flavor = "current_thread")] async fn main() { println!("check clones"); bot::clone(); START.get_or_init(Instant::now); #[cfg(feature = "server")] expose::Server::spawn(<SocketAddr as std::str::FromStr>::from_str("0.0.0.0:2000").unwrap()) .await; #[cfg(not(feature = "server"))] bot::Bot::spawn().await; }