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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
use poise::builtins::HelpConfiguration;
use crate::{
PoiseContext,
commands::playback::_play,
};
#[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<poise::Command<crate::PoiseData, anyhow::Error>> {
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<String>) -> anyhow::Result<()> {
poise::builtins::help(ctx, command.as_deref(), HelpConfiguration {
include_description: true,
..Default::default()
})
.await?;
Ok(())
}
pub async fn link_unrecognized(ctx: PoiseContext<'_>, u: url::Url) -> anyhow::Result<()> {
_play(ctx, &u).await?;
Ok(())
}
|