From fe9bcd7dc1833d5ba5ad75a84794217d8d840d56 Mon Sep 17 00:00:00 2001 From: seth Date: Wed, 15 Nov 2023 23:43:45 -0500 Subject: refactor: merge bottom & convert --- src/main.rs | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 749daae..c604df6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,10 +1,8 @@ use std::time::Duration; use std::{env, error}; -use crate::commands::*; -use crate::consts::*; -use crate::pinboard::PinBoard; use log::*; +use pinboard::PinBoard; use poise::serenity_prelude as serentiy; use poise::serenity_prelude::*; @@ -58,21 +56,8 @@ async fn main() { env_logger::init(); dotenvy::dotenv().unwrap(); - let guild_commands = vec![copypasta::copypasta(), teawiespam::teawiespam()]; - let options = poise::FrameworkOptions { - commands: vec![ - ask::ask(), - bing::bing(), - bottom::bottom(), - convert::convert(), - random_lore::random_lore(), - random_shiggy::random_shiggy(), - random_teawie::random_teawie(), - copypasta::copypasta(), - teawiespam::teawiespam(), - version::version(), - ], + commands: commands::to_global_commands(), event_handler: |ctx, event, _, data| { Box::pin(async move { // yes this is dumb. no i don't care. @@ -105,7 +90,12 @@ async fn main() { poise::builtins::register_globally(ctx, &framework.options().commands).await?; info!("registered global commands!"); - poise::builtins::register_in_guild(ctx, &guild_commands, TEAWIE_GUILD).await?; + poise::builtins::register_in_guild( + ctx, + &commands::to_guild_commands(), + consts::TEAWIE_GUILD, + ) + .await?; info!("registered guild commands!"); Ok(Data::new()) -- cgit v1.2.3