aboutsummaryrefslogtreecommitdiff
path: root/src/commands/meme/invoke.rs
diff options
context:
space:
mode:
authorNathan Perry <np@nathanperry.dev>2024-05-08 12:55:35 -0400
committerNathan Perry <np@nathanperry.dev>2024-05-08 14:16:01 -0400
commitffba60b278162707bc4eb004c3bfb6b2e9595213 (patch)
treeedf8172ecad59d46a6056944fd9e79f7dfb327c2 /src/commands/meme/invoke.rs
parentfe467f60d99efa54f2ef64606e7d39b9b06d7294 (diff)
rework to use songbird
Diffstat (limited to 'src/commands/meme/invoke.rs')
-rw-r--r--src/commands/meme/invoke.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/commands/meme/invoke.rs b/src/commands/meme/invoke.rs
index 03c6251..13996da 100644
--- a/src/commands/meme/invoke.rs
+++ b/src/commands/meme/invoke.rs
@@ -30,37 +30,37 @@ use crate::{
#[command]
#[aliases("mem")]
pub async fn meme(ctx: &Context, msg: &Message, args: Args) -> CommandResult {
- _meme(ctx, msg, args, AudioPlayback::Optional)
+ _meme(ctx, msg, args, AudioPlayback::Optional).await
}
#[command]
pub async fn omen(ctx: &Context, msg: &Message, _args: Args) -> CommandResult {
let args = Args::new("", &[]);
- _meme(ctx, msg, args, AudioPlayback::Optional)
+ _meme(ctx, msg, args, AudioPlayback::Optional).await
}
#[command]
pub async fn silentomen(ctx: &Context, msg: &Message, _args: Args) -> CommandResult {
let args = Args::new("", &[]);
- _meme(ctx, msg, args, AudioPlayback::Prohibited)
+ _meme(ctx, msg, args, AudioPlayback::Prohibited).await
}
#[command]
pub async fn audioomen(ctx: &Context, msg: &Message, _args: Args) -> CommandResult {
let args = Args::new("", &[]);
- _meme(ctx, msg, args, AudioPlayback::Required)
+ _meme(ctx, msg, args, AudioPlayback::Required).await
}
#[command]
#[aliases("audiomeme", "audiomem")]
pub async fn audio_meme(ctx: &Context, msg: &Message, args: Args) -> CommandResult {
- _meme(ctx, msg, args, AudioPlayback::Required)
+ _meme(ctx, msg, args, AudioPlayback::Required).await
}
#[command]
#[aliases("silentmeme", "silentmem")]
pub async fn silent_meme(ctx: &Context, msg: &Message, args: Args) -> CommandResult {
- _meme(ctx, msg, args, AudioPlayback::Prohibited)
+ _meme(ctx, msg, args, AudioPlayback::Prohibited).await
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
@@ -152,7 +152,7 @@ async fn rand_meme(
#[command]
#[aliases("rarememe", "raremem")]
pub async fn rare_meme(ctx: &Context, msg: &Message, _args: Args) -> CommandResult {
- let should_audio = ctx.users_listening()?;
+ let should_audio = util::users_listening(ctx).await?;
let mut conn = connection()?;
@@ -160,7 +160,7 @@ pub async fn rare_meme(ctx: &Context, msg: &Message, _args: Args) -> CommandResu
match meme {
Ok(meme) => {
InvocationRecord::create(&mut conn, msg.author.id.get(), msg.id.get(), meme.id, true)?;
- send_meme(ctx, &meme, &mut conn, msg)
+ send_meme(ctx, &meme, &mut conn, msg).await
},
Err(e) => {
match e.downcast_ref::<DieselError>() {
@@ -177,7 +177,7 @@ pub async fn rare_meme(ctx: &Context, msg: &Message, _args: Args) -> CommandResu
.map_err(CommandError::from)
.await?;
- Err(e)
+ Err(e.into())
},
}
}