-
Notifications
You must be signed in to change notification settings - Fork 120
/
Copy pathbuiltins.rs
28 lines (25 loc) · 996 Bytes
/
builtins.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use crate::{Context, Error};
#[cfg(feature = "cache")]
#[poise::command(slash_command, prefix_command)]
pub async fn servers(ctx: Context<'_>) -> Result<(), Error> {
poise::builtins::servers(ctx).await?;
Ok(())
}
#[poise::command(slash_command, prefix_command)]
pub async fn help(ctx: Context<'_>, command: Option<String>) -> Result<(), Error> {
let configuration = poise::builtins::HelpConfiguration {
// [configure aspects about the help message here]
..Default::default()
};
poise::builtins::help(ctx, command.as_deref(), configuration).await?;
Ok(())
}
#[poise::command(slash_command, prefix_command)]
pub async fn pretty_help(ctx: Context<'_>, command: Option<String>) -> Result<(), Error> {
let configuration = poise::builtins::PrettyHelpConfiguration {
// [configure aspects about the help message here]
..Default::default()
};
poise::builtins::pretty_help(ctx, command.as_deref(), configuration).await?;
Ok(())
}