mod labwatch; use serenity::{ all::{ChannelId, Context, EventHandler, Ready}, async_trait, }; use std::{path::PathBuf, sync::Arc}; pub struct Handler(Arc); impl From for Handler { fn from(config: HandlerConfig) -> Handler { Handler(Arc::new(config)) } } pub struct HandlerConfig { pub db_dir: PathBuf, pub labwatch_channel_id: ChannelId, } #[async_trait] impl EventHandler for Handler { async fn ready(&self, ctx: Context, _data_about_bot: Ready) { tokio::spawn(labwatch::start(self.0.clone(), ctx)); } }