diff options
Diffstat (limited to 'src/commands/meme/invoke.rs')
| -rw-r--r-- | src/commands/meme/invoke.rs | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/commands/meme/invoke.rs b/src/commands/meme/invoke.rs index aff5c23..4b361a3 100644 --- a/src/commands/meme/invoke.rs +++ b/src/commands/meme/invoke.rs @@ -1,6 +1,5 @@ use diesel::{ result::Error as DieselError, - row::NamedRow, NotFound, }; use grate::tracing; @@ -93,10 +92,10 @@ pub(crate) async fn _meme( x.id, false, ) - .await?; + .await?; x - } + }, Err(e) => { return if let Some(NotFound) = e.downcast_ref::<DieselError>() { tracing::info!("requested meme not found in database"); @@ -107,7 +106,7 @@ pub(crate) async fn _meme( util::reply(ctx, "what in ryan's name").await?; Err(e.into()) }; - } + }, }; send_meme(ctx, &mem, &mut conn).await @@ -135,15 +134,15 @@ async fn rand_meme(ctx: PoiseContext<'_>, audio_playback: AudioPlayback) -> anyh mem.id, true, ) - .await?; + .await?; send_meme(ctx, &mem, &mut conn).await?; Ok(()) - } + }, Ok(None) => { tracing::info!("random meme not found"); util::reply(ctx, "i don't know any :(").await?; Ok(()) - } + }, Err(e) => { if let Some(NotFound) = e.downcast_ref::<DieselError>() { tracing::info!("random meme not found"); @@ -154,7 +153,7 @@ async fn rand_meme(ctx: PoiseContext<'_>, audio_playback: AudioPlayback) -> anyh util::reply(ctx, "HELP").await?; Err(e.into()) - } + }, } } @@ -177,16 +176,16 @@ pub async fn rare_meme(ctx: PoiseContext<'_>) -> anyhow::Result<()> { meme.id, true, ) - .await?; + .await?; send_meme(ctx, &meme, &mut conn).await - } + }, Ok(None) => { tracing::info!("rare meme not found"); util::reply(ctx, "i don't know any :(").await?; Ok(()) - } + }, Err(e) => { if let Some(NotFound) = e.downcast_ref::<DieselError>() { @@ -199,6 +198,6 @@ pub async fn rare_meme(ctx: PoiseContext<'_>) -> anyhow::Result<()> { util::reply(ctx, "THE MEME MARKET IS IN FREEFALL").await?; Err(e.into()) - } + }, } } |
