mirror of
https://github.com/ethanrusz/echbot.git
synced 2024-11-22 04:07:46 -05:00
Add random command and subcommand framework
This commit is contained in:
parent
a3a673c7e6
commit
a2e7d6f531
3 changed files with 30 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
||||||
// Group all commands for registration
|
// Group all commands for registration
|
||||||
pub(crate) mod slur;
|
pub(crate) mod slur;
|
||||||
pub(crate) mod team_up;
|
pub(crate) mod team_up;
|
||||||
|
pub(crate) mod random;
|
28
src/commands/random.rs
Normal file
28
src/commands/random.rs
Normal file
|
@ -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(())
|
||||||
|
}
|
|
@ -14,6 +14,7 @@ async fn main() {
|
||||||
commands: vec![
|
commands: vec![
|
||||||
commands::slur::slur(),
|
commands::slur::slur(),
|
||||||
commands::team_up::team_up(),
|
commands::team_up::team_up(),
|
||||||
|
commands::random::random(),
|
||||||
], // IntelliJ doesn't like this, but it's fine.
|
], // IntelliJ doesn't like this, but it's fine.
|
||||||
..Default::default()
|
..Default::default()
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue