Move all commands to their own files

This commit is contained in:
jude
2024-02-17 18:55:16 +00:00
parent eb92eacb90
commit 4823754955
51 changed files with 1757 additions and 1699 deletions

View File

@ -34,7 +34,11 @@ use sqlx::{MySql, Pool};
use tokio::sync::{broadcast, broadcast::Sender, RwLock};
use crate::{
commands::{command_macro, info_cmds, moderation_cmds, reminder_cmds, timer, todo_cmds},
commands::{
allowed_dm, clock::clock, clock_context_menu::clock_context_menu, command_macro,
dashboard::dashboard, delete, donate::donate, help::help, info::info, look, multiline,
nudge, offset, pause, remind, settings, timer, timezone::timezone, todo, webhook::webhook,
},
consts::THEME_COLOR,
event_handlers::listener,
hooks::all_checks,
@ -99,31 +103,31 @@ async fn _main(tx: Sender<()>) -> Result<(), Box<dyn StdError + Send + Sync>> {
let options = poise::FrameworkOptions {
commands: vec![
info_cmds::help(),
info_cmds::info(),
info_cmds::donate(),
info_cmds::clock(),
info_cmds::clock_context_menu(),
info_cmds::dashboard(),
moderation_cmds::timezone(),
help(),
info(),
donate(),
clock(),
clock_context_menu(),
dashboard(),
timezone(),
poise::Command {
subcommands: vec![
moderation_cmds::set_allowed_dm(),
moderation_cmds::unset_allowed_dm(),
allowed_dm::set_allowed_dm::set_allowed_dm(),
allowed_dm::unset_allowed_dm::unset_allowed_dm(),
],
..moderation_cmds::allowed_dm()
..allowed_dm::allowed_dm()
},
poise::Command {
subcommands: vec![poise::Command {
subcommands: vec![
moderation_cmds::set_ephemeral_confirmations(),
moderation_cmds::unset_ephemeral_confirmations(),
settings::ephemeral_confirmations::set_ephemeral_confirmations::set_ephemeral_confirmations(),
settings::ephemeral_confirmations::unset_ephemeral_confirmations::unset_ephemeral_confirmations(),
],
..moderation_cmds::ephemeral_confirmations()
..settings::ephemeral_confirmations::ephemeral_confirmations()
}],
..moderation_cmds::settings()
..settings::settings()
},
moderation_cmds::webhook(),
webhook(),
poise::Command {
subcommands: vec![
command_macro::delete_macro::delete_macro(),
@ -132,45 +136,39 @@ async fn _main(tx: Sender<()>) -> Result<(), Box<dyn StdError + Send + Sync>> {
command_macro::record_macro::record_macro(),
command_macro::run_macro::run_macro(),
],
..command_macro::macro_base::macro_base()
..command_macro::command_macro()
},
reminder_cmds::pause(),
reminder_cmds::offset(),
reminder_cmds::nudge(),
reminder_cmds::look(),
reminder_cmds::delete(),
pause::pause(),
offset::offset(),
nudge::nudge(),
look::look(),
delete::delete(),
poise::Command {
subcommands: vec![
timer::list_timer::list_timer(),
timer::start_timer::start_timer(),
timer::delete_timer::delete_timer(),
],
..timer::timer_base::timer_base()
..timer::timer()
},
reminder_cmds::multiline(),
reminder_cmds::remind(),
multiline::multiline(),
remind::remind(),
poise::Command {
subcommands: vec![
poise::Command {
subcommands: vec![
todo_cmds::todo_guild_add(),
todo_cmds::todo_guild_view(),
],
..todo_cmds::todo_guild_base()
subcommands: vec![todo::guild::add::add(), todo::guild::view::view()],
..todo::guild::guild()
},
poise::Command {
subcommands: vec![
todo_cmds::todo_channel_add(),
todo_cmds::todo_channel_view(),
],
..todo_cmds::todo_channel_base()
subcommands: vec![todo::channel::add::add(), todo::channel::view::view()],
..todo::channel::channel()
},
poise::Command {
subcommands: vec![todo_cmds::todo_user_add(), todo_cmds::todo_user_view()],
..todo_cmds::todo_user_base()
subcommands: vec![todo::user::add::add(), todo::user::view::view()],
..todo::user::user()
},
],
..todo_cmds::todo_base()
..todo::todo()
},
],
allowed_mentions: None,