Switched from diesel to sqlx

This commit is contained in:
2024-09-05 11:52:14 -04:00
parent bce363db7e
commit d08800f9e0
42 changed files with 365 additions and 687 deletions

View File

@@ -1,7 +1,3 @@
extern crate diesel;
#[macro_use]
extern crate diesel_migrations;
use std::env;
use std::collections::HashSet;
use std::sync::Arc;
@@ -13,9 +9,9 @@ use reqwest::Client as HttpClient;
use crate::bot::handler::Handler;
mod bot;
mod database;
mod dnd;
mod error;
mod storage;
pub struct HttpKey;
@@ -27,7 +23,10 @@ impl TypeMapKey for HttpKey {
async fn main() {
dotenv::dotenv().ok();
env_logger::init_from_env(env_logger::Env::default().filter_or("RUST_LOG", "warn,siren=info"));
storage::init().await;
if let Err(err) = database::initialize().await {
log::error!("Failed to initialize database: {err}");
return;
};
let token: String = env::var("DISCORD_TOKEN").expect("Expected a token in the environment");
let intents: GatewayIntents = GatewayIntents::all();