fix context

This commit is contained in:
mii443
2024-10-08 09:54:13 +00:00
parent e82284281b
commit 5eaf22b256

View File

@ -3,20 +3,21 @@ mod docker;
mod event_handler; mod event_handler;
mod language; mod language;
use std::{ use std::{env, fs::File, io::Read, sync::Arc};
env,
fs::File,
io::Read,
sync::{Arc, Mutex},
};
use config::Config; use config::Config;
use event_handler::Handler; use event_handler::Handler;
struct ConfigStorage; use poise::{
serenity_prelude::{self as serenity, futures::lock::Mutex, UserId},
PrefixFrameworkOptions,
};
impl TypeMapKey for ConfigStorage { type Error = Box<dyn std::error::Error + Send + Sync>;
type Value = Arc<Mutex<Config>>; type Context<'a> = poise::Context<'a, Data, Error>;
pub struct Data {
pub context: Arc<Mutex<Config>>,
} }
fn load_config() -> Option<Config> { fn load_config() -> Option<Config> {