From 5eaf22b256fb941216bafde58a57ba26b99dd485 Mon Sep 17 00:00:00 2001 From: mii443 Date: Tue, 8 Oct 2024 09:54:13 +0000 Subject: [PATCH] fix context --- src/main.rs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/main.rs b/src/main.rs index 82353ba..98bbc20 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,20 +3,21 @@ mod docker; mod event_handler; mod language; -use std::{ - env, - fs::File, - io::Read, - sync::{Arc, Mutex}, -}; +use std::{env, fs::File, io::Read, sync::Arc}; use config::Config; use event_handler::Handler; -struct ConfigStorage; +use poise::{ + serenity_prelude::{self as serenity, futures::lock::Mutex, UserId}, + PrefixFrameworkOptions, +}; -impl TypeMapKey for ConfigStorage { - type Value = Arc>; +type Error = Box; +type Context<'a> = poise::Context<'a, Data, Error>; + +pub struct Data { + pub context: Arc>, } fn load_config() -> Option {