Switched from diesel to sqlx
This commit is contained in:
11
src/main.rs
11
src/main.rs
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user