23 lines
630 B
Rust
23 lines
630 B
Rust
#![feature(impl_trait_in_bindings)]
|
|
mod bot_runner;
|
|
mod config_parser;
|
|
mod handlers;
|
|
mod request;
|
|
mod types;
|
|
|
|
use crate::bot_runner::BotRunner;
|
|
use futures::{self, future::try_join_all};
|
|
use std::path::Path;
|
|
|
|
#[tokio::main]
|
|
async fn main() {
|
|
let config = config_parser::parse_configs(Path::new("config.json")).unwrap();
|
|
let handlers = config_parser::build_handlers(config);
|
|
let mut bots: Vec<bot_runner::BotRunner> = vec![];
|
|
for item in handlers {
|
|
bots.push(BotRunner::new(item).await);
|
|
}
|
|
let futures: Vec<_> = bots.iter_mut().map(|b| b.run()).collect();
|
|
let _ = try_join_all(futures).await;
|
|
}
|