aboutsummaryrefslogtreecommitdiff
path: root/src/commands/meme/invoke.rs
diff options
context:
space:
mode:
authorNathan Perry <np@nathanperry.dev>2024-08-06 16:32:35 -0400
committerNathan Perry <np@nathanperry.dev>2024-08-06 16:32:35 -0400
commit501ba27e1cd52741988113ef47ee0fad7d0a5799 (patch)
treecfe5985b6896b8cd440638716d9c032735af46bf /src/commands/meme/invoke.rs
parent011fcf828ebd1325dbd4dfa21c4952f1be38a29f (diff)
fixup unknown command, document commands
Diffstat (limited to 'src/commands/meme/invoke.rs')
-rw-r--r--src/commands/meme/invoke.rs47
1 files changed, 22 insertions, 25 deletions
diff --git a/src/commands/meme/invoke.rs b/src/commands/meme/invoke.rs
index e399e82..31b0085 100644
--- a/src/commands/meme/invoke.rs
+++ b/src/commands/meme/invoke.rs
@@ -14,48 +14,50 @@ use crate::{
},
util,
PoiseContext,
+ RestVec,
};
-#[poise::command(slash_command, prefix_command, guild_only, category = "memes", aliases("mem"))]
-pub async fn meme(ctx: PoiseContext<'_>, #[rest] rest: String) -> anyhow::Result<()> {
- _meme(ctx, rest, AudioPlayback::Optional).await
+/// Post a meme.
+#[poise::command(prefix_command, guild_only, category = "memes", aliases("mem"))]
+pub async fn meme(ctx: PoiseContext<'_>, title: RestVec) -> anyhow::Result<()> {
+ let title = title.into_inner().join(" ");
+
+ _meme(ctx, title.trim(), AudioPlayback::Optional).await
}
-#[poise::command(slash_command, prefix_command, guild_only, category = "memes")]
+/// Post a random omen.
+#[poise::command(prefix_command, guild_only, category = "memes", discard_spare_arguments)]
pub async fn omen(ctx: PoiseContext<'_>) -> anyhow::Result<()> {
_meme(ctx, "", AudioPlayback::Optional).await
}
-#[poise::command(slash_command, prefix_command, guild_only, category = "memes")]
+/// Post a random omen without audio.
+#[poise::command(prefix_command, guild_only, category = "memes", discard_spare_arguments)]
pub async fn silentomen(ctx: PoiseContext<'_>) -> anyhow::Result<()> {
_meme(ctx, "", AudioPlayback::Prohibited).await
}
-#[poise::command(slash_command, prefix_command, guild_only, category = "memes")]
+/// Post a random omen with audio.
+#[poise::command(prefix_command, guild_only, category = "memes", discard_spare_arguments)]
pub async fn audioomen(ctx: PoiseContext<'_>) -> anyhow::Result<()> {
_meme(ctx, "", AudioPlayback::Required).await
}
-#[poise::command(
- slash_command,
- prefix_command,
- guild_only,
- category = "memes",
- aliases("audiomeme", "audiomem")
-)]
-pub async fn audio_meme(ctx: PoiseContext<'_>, #[rest] rest: String) -> anyhow::Result<()> {
- _meme(ctx, rest, AudioPlayback::Required).await
+/// Post a random meme with audio.
+#[poise::command(prefix_command, guild_only, category = "memes", aliases("audiomeme", "audiomem"))]
+pub async fn audio_meme(ctx: PoiseContext<'_>) -> anyhow::Result<()> {
+ _meme(ctx, "", AudioPlayback::Required).await
}
+/// Post a random meme without audio.
#[poise::command(
- slash_command,
prefix_command,
guild_only,
category = "memes",
aliases("silentmeme", "silentmem")
)]
-pub async fn silent_meme(ctx: PoiseContext<'_>, #[rest] rest: String) -> anyhow::Result<()> {
- _meme(ctx, rest, AudioPlayback::Prohibited).await
+pub async fn silent_meme(ctx: PoiseContext<'_>) -> anyhow::Result<()> {
+ _meme(ctx, "", AudioPlayback::Prohibited).await
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
@@ -132,13 +134,8 @@ async fn rand_meme(ctx: PoiseContext<'_>, audio_playback: AudioPlayback) -> anyh
}
}
-#[poise::command(
- slash_command,
- prefix_command,
- guild_only,
- category = "memes",
- aliases("raremem", "rarememe")
-)]
+/// Post a rare meme.
+#[poise::command(prefix_command, guild_only, category = "memes", aliases("raremem", "rarememe"))]
pub async fn rare_meme(ctx: PoiseContext<'_>) -> anyhow::Result<()> {
let should_audio = util::users_listening(ctx.serenity_context()).await?;