mod commands; mod events; pub mod utils; use poise::FrameworkBuilder; use utils::serenity; use commands::logging; use utils::{BotData, Context, Error}; use self::events::event_handler; pub type Result = ::std::result::Result<(), Error>; pub fn make_bot() -> FrameworkBuilder { poise::Framework::builder() .options(poise::FrameworkOptions { commands: vec![logging()], event_handler: |ctx, event, framework, data| { Box::pin(event_handler(ctx, event, framework, data)) }, ..Default::default() }) .token(std::env::var("DISCORD_TOKEN").expect("missing DISCORD_TOKEN")) .intents(serenity::GatewayIntents::non_privileged()) .setup(|ctx, _ready, framework| { Box::pin(async move { poise::builtins::register_globally( ctx, &framework.options().commands, ) .await?; Ok(BotData::new().await?) }) }) }