mirror of
https://github.com/mii443/rs-docker-bot.git
synced 2025-08-23 00:25:30 +00:00
fix context
This commit is contained in:
19
src/main.rs
19
src/main.rs
@ -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> {
|
||||||
|
Reference in New Issue
Block a user