#![warn(missing_docs)] //! In case you and your friends ever felt like you don't have enough //! Slavoj Žižek in your life, this matrix bot can help you satisfying that //! need. use std::sync::{Arc, Mutex}; use matrix_bot_api::MatrixBot; pub mod bot_config; pub mod command_handler; pub mod zizek_db; use bot_config::BotConfig; use command_handler::CommandHandler; use zizek_db::ZizekDb; fn main() { let bot_config = BotConfig::from_config_file().expect("Unable to read bot configuration file"); let zizek_db = Arc::new(Mutex::new( ZizekDb::from_file("zizek_quotes.db").expect("Unable to load zizek quote database"), )); /* The command handler is the handler with the highest priority, so it gets * registered first */ let bot = MatrixBot::new(CommandHandler::new(zizek_db.clone())); bot.run( bot_config.user(), bot_config.password(), bot_config.homeserver_url(), ); }