commands: tidy up help & joke
This commit is contained in:
parent
e847ea0ad0
commit
b63ecde6b4
3 changed files with 17 additions and 17 deletions
|
@ -1,23 +1,23 @@
|
||||||
use eyre::Result;
|
|
||||||
use poise::{builtins, samples::HelpConfiguration};
|
|
||||||
|
|
||||||
use crate::Context;
|
use crate::Context;
|
||||||
|
|
||||||
|
use eyre::Result;
|
||||||
|
use log::trace;
|
||||||
|
use poise::samples::HelpConfiguration;
|
||||||
|
|
||||||
/// View the help menu
|
/// View the help menu
|
||||||
#[poise::command(slash_command, prefix_command, track_edits = true)]
|
#[poise::command(slash_command, prefix_command, track_edits = true)]
|
||||||
pub async fn help(
|
pub async fn help(
|
||||||
ctx: Context<'_>,
|
ctx: Context<'_>,
|
||||||
#[description = "provide information about a specific command"] command: Option<String>,
|
#[description = "Provide information about a specific command"] command: Option<String>,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
builtins::help(
|
trace!("Running help command");
|
||||||
ctx,
|
|
||||||
command.as_deref(),
|
let configuration = HelpConfiguration {
|
||||||
HelpConfiguration {
|
extra_text_at_bottom: "Use /help for more information about a specific command!",
|
||||||
extra_text_at_bottom: "Use /help for more information about a specific command!",
|
..Default::default()
|
||||||
..HelpConfiguration::default()
|
};
|
||||||
},
|
|
||||||
)
|
poise::builtins::help(ctx, command.as_deref(), configuration).await?;
|
||||||
.await?;
|
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,9 +10,8 @@ pub async fn joke(ctx: Context<'_>) -> Result<()> {
|
||||||
trace!("Running joke command");
|
trace!("Running joke command");
|
||||||
|
|
||||||
ctx.defer().await?;
|
ctx.defer().await?;
|
||||||
|
|
||||||
let joke = dadjoke::get_joke().await?;
|
let joke = dadjoke::get_joke().await?;
|
||||||
|
|
||||||
ctx.say(joke).await?;
|
ctx.say(joke).await?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
use crate::Data;
|
use crate::Data;
|
||||||
|
|
||||||
use eyre::Report;
|
use eyre::Report;
|
||||||
use poise::Command;
|
|
||||||
|
|
||||||
mod general;
|
mod general;
|
||||||
|
|
||||||
pub fn get() -> Vec<Command<Data, Report>> {
|
pub type Command = poise::Command<Data, Report>;
|
||||||
|
|
||||||
|
pub fn get() -> Vec<Command> {
|
||||||
vec![
|
vec![
|
||||||
general::joke(),
|
general::joke(),
|
||||||
general::members(),
|
general::members(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue