use poise::builtins::PrettyHelpConfiguration; use crate::{ commands::playback::_play, PoiseContext, }; #[cfg(feature = "games")] pub mod game; #[cfg(feature = "db")] pub(crate) mod meme; pub(crate) mod playback; pub(crate) mod roll; pub(crate) mod sound_levels; pub(crate) mod today; #[cfg(feature = "db")] pub use self::meme::*; pub fn commands() -> Vec> { let mut commands = vec![ sound_levels::mute(), sound_levels::unmute(), sound_levels::volume(), roll::roll(), today::today(), help(), ]; commands.extend(playback::commands()); #[cfg(feature = "games")] commands.extend(game::commands()); #[cfg(feature = "db")] commands.extend(meme::commands()); commands } /// Print this help text. #[poise::command(prefix_command, aliases("halp"))] pub async fn help(ctx: PoiseContext<'_>, command: Option) -> anyhow::Result<()> { poise::builtins::pretty_help( ctx, command.as_ref().map(|x| x.as_str()), PrettyHelpConfiguration { ..Default::default() }, ) .await?; Ok(()) } pub async fn link_unrecognized(ctx: PoiseContext<'_>, u: url::Url) -> anyhow::Result<()> { let _ = _play(ctx, &u).await?; Ok(()) }