From a2e7d6f5318a126626550f33ec755ecfe1acf9be Mon Sep 17 00:00:00 2001 From: Ethan Ruszanowski Date: Wed, 11 Jan 2023 17:02:40 -0500 Subject: [PATCH] Add random command and subcommand framework --- src/commands/mod.rs | 1 + src/commands/random.rs | 28 ++++++++++++++++++++++++++++ src/main.rs | 1 + 3 files changed, 30 insertions(+) create mode 100644 src/commands/random.rs diff --git a/src/commands/mod.rs b/src/commands/mod.rs index 60e109e..f947f1b 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -1,3 +1,4 @@ // Group all commands for registration pub(crate) mod slur; pub(crate) mod team_up; +pub(crate) mod random; \ No newline at end of file diff --git a/src/commands/random.rs b/src/commands/random.rs new file mode 100644 index 0000000..59c3eb4 --- /dev/null +++ b/src/commands/random.rs @@ -0,0 +1,28 @@ +use crate::{Context, Error}; + +/// Picks a random something +#[poise::command(slash_command, prefix_command, subcommands("god", "mode"))] +pub(crate) async fn random( + ctx: Context<'_>, +) -> Result<(), Error> { + ctx.say("Pick a subcommand, idiot.").await?; + Ok(()) +} + +/// Picks a random god to play +#[poise::command(slash_command, prefix_command)] +pub(crate) async fn god( + ctx: Context<'_>, +) -> Result<(), Error> { + ctx.say("Waiting for that sweet API access.").await?; + Ok(()) +} + +/// Picks a random mode to play +#[poise::command(slash_command, prefix_command)] +pub(crate) async fn mode( + ctx: Context<'_>, +) -> Result<(), Error> { + ctx.say("Waiting for that sweet API access.").await?; + Ok(()) +} \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 8442cf4..9e6b027 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,6 +14,7 @@ async fn main() { commands: vec![ commands::slur::slur(), commands::team_up::team_up(), + commands::random::random(), ], // IntelliJ doesn't like this, but it's fine. ..Default::default() })