use anyhow::Result; use dotenv::dotenv; use migration::{Migrator, MigratorTrait}; use pass_manager::get_dispatcher; use sea_orm::Database; use std::env; #[tokio::main] async fn main() -> Result<()> { let _ = dotenv(); pretty_env_logger::init(); let token = env::var("TOKEN").expect("expected TOKEN in the enviroment"); let database_url = env::var("DATABASE_URL").expect("expected DATABASE_URL in the enviroment"); let db = Database::connect(database_url).await?; Migrator::up(&db, None).await?; get_dispatcher(token, db).dispatch().await; Ok(()) }