From ffba60b278162707bc4eb004c3bfb6b2e9595213 Mon Sep 17 00:00:00 2001 From: Nathan Perry Date: Wed, 8 May 2024 12:55:35 -0400 Subject: rework to use songbird --- src/commands/meme/invoke.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/commands/meme/invoke.rs') 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::() { @@ -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()) }, } } -- cgit v1.3.1