26 lines
413 B
Rust
26 lines
413 B
Rust
use std::sync::Arc;
|
|
|
|
use tokio::sync::Mutex;
|
|
|
|
use crate::{bot::Bot, state::AppState};
|
|
|
|
mod api;
|
|
mod bot;
|
|
mod consts;
|
|
mod env;
|
|
mod errors;
|
|
mod gitea;
|
|
mod state;
|
|
|
|
#[tokio::main]
|
|
async fn main() -> anyhow::Result<()> {
|
|
let config = env::load_config()?;
|
|
|
|
let app_state = AppState {
|
|
bot: Arc::new(Mutex::new(Bot::new(config.clone()))),
|
|
config: config,
|
|
};
|
|
|
|
api::start(app_state).await
|
|
}
|