feat: move mc stuff to subcommand
parent
f8ce315d8e
commit
ef7508a456
|
@ -3,9 +3,17 @@ use async_minecraft_ping::ServerDescription;
|
|||
|
||||
const DEFAULT_SERVER: &str = "rustybever.be";
|
||||
|
||||
/// Ping a minecraft server
|
||||
/// Parent command for Minecraft-related actions.
|
||||
///
|
||||
/// Minecraft-related commands
|
||||
#[poise::command(prefix_command, slash_command, subcommands("ping"))]
|
||||
pub async fn mc(_ctx: Context<'_>) -> Result<(), Error> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Ping a minecraft server; defaults to our server.
|
||||
#[poise::command(prefix_command, slash_command)]
|
||||
pub async fn ping_mc(
|
||||
pub async fn ping(
|
||||
ctx: Context<'_>,
|
||||
#[description = "Address of the server"] address: Option<String>,
|
||||
#[description = "Port the server runs on"] port: Option<u16>,
|
||||
|
|
|
@ -6,7 +6,7 @@ use crate::{Context, Data, Error};
|
|||
type EmbedField = (String, String, bool);
|
||||
|
||||
pub fn commands() -> Vec<poise::structs::Command<Data, Error>> {
|
||||
vec![help(), affluence::available(), minecraft::ping_mc()]
|
||||
vec![affluence::available(), minecraft::mc(), help()]
|
||||
}
|
||||
|
||||
/// Show this help menu
|
||||
|
@ -21,7 +21,7 @@ pub async fn help(
|
|||
ctx,
|
||||
command.as_deref(),
|
||||
poise::builtins::HelpConfiguration {
|
||||
extra_text_at_bottom: "This is an example bot made to showcase features of my custom Discord bot framework",
|
||||
extra_text_at_bottom: "Brought to you by Doofenshmirtz Evil Incorporated.",
|
||||
..Default::default()
|
||||
},
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue