Skip to content

Commit

Permalink
refactor: put commands into categories
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanccn committed Jan 17, 2024
1 parent 9a35867 commit d42befc
Show file tree
Hide file tree
Showing 16 changed files with 39 additions and 26 deletions.
3 changes: 3 additions & 0 deletions src/commands/fun/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub mod owo;
pub mod pomelo;
pub mod shiggy;
File renamed without changes.
File renamed without changes.
File renamed without changes.
53 changes: 27 additions & 26 deletions src/commands/mod.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
use crate::Context;

mod lighthouse;
mod owo;
mod ping;
mod pomelo;
mod presence;
mod say;
mod self_timeout;
mod shiggy;
mod sysinfo;
mod template_channel;
mod translate;
mod version;
mod fun;
mod useful;
mod utils;

pub use presence::restore as restore_presence;
pub use utils::presence::restore as restore_presence;

macro_rules! command {
($category: ident, $name: ident) => {
$category::$name::$name()
};

($category: ident, $name: ident, $override: ident) => {
$category::$name::$override()
};
}

pub fn to_vec() -> Vec<
poise::Command<
Expand All @@ -22,18 +23,18 @@ pub fn to_vec() -> Vec<
>,
> {
vec![
lighthouse::lighthouse(),
owo::owo(),
ping::ping(),
pomelo::pomelo(),
presence::presence(),
say::say(),
self_timeout::self_timeout(),
self_timeout::transparency(),
shiggy::shiggy(),
sysinfo::sysinfo(),
template_channel::template_channel(),
translate::translate(),
version::version(),
command!(useful, lighthouse),
command!(useful, self_timeout),
command!(useful, self_timeout, transparency),
command!(useful, translate),
command!(fun, owo),
command!(fun, pomelo),
command!(fun, shiggy),
command!(utils, ping),
command!(utils, presence),
command!(utils, say),
command!(utils, sysinfo),
command!(utils, template_channel),
command!(utils, version),
]
}
File renamed without changes.
3 changes: 3 additions & 0 deletions src/commands/useful/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub mod lighthouse;
pub mod self_timeout;
pub mod translate;
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions src/commands/utils/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pub mod ping;
pub mod presence;
pub mod say;
pub mod sysinfo;
pub mod template_channel;
pub mod version;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit d42befc

Please sign in to comment.