diff options
| author | seth <[email protected]> | 2023-11-17 20:29:32 -0500 |
|---|---|---|
| committer | seth <[email protected]> | 2023-11-18 01:42:03 +0000 |
| commit | a14e362054c6c96ff840c7297e8b575e83f60029 (patch) | |
| tree | 3b90ee02b6bbdfb2df5f96164283c7f3d56d2359 /src/commands | |
| parent | 061d782907c5ba14517bdefb9774441d1e3457cd (diff) | |
feat: put random teawie/shiggy in embed
Diffstat (limited to 'src/commands')
| -rw-r--r-- | src/commands/random.rs | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/src/commands/random.rs b/src/commands/random.rs index 6c61fdc..bc34928 100644 --- a/src/commands/random.rs +++ b/src/commands/random.rs @@ -23,29 +23,22 @@ pub async fn lore(ctx: Context<'_>) -> Result<(), Error> { /// get a random teawie #[poise::command(prefix_command, slash_command)] pub async fn teawie(ctx: Context<'_>) -> Result<(), Error> { - match api::guzzle::get_random_teawie().await { - Ok(resp) => { - ctx.say(resp).await?; - Ok(()) - } - Err(why) => { - ctx.say("i'm too lazy to send a selfie").await?; - Err(why) - } + if let Ok(url) = api::guzzle::get_random_teawie().await { + utils::send_url_as_embed(ctx, url).await + } else { + ctx.say("i'm too lazy to send a selfie right now :(") + .await?; + Ok(()) } } /// get a random shiggy #[poise::command(prefix_command, slash_command)] pub async fn shiggy(ctx: Context<'_>) -> Result<(), Error> { - match api::shiggy::get_random_shiggy().await { - Ok(resp) => { - ctx.say(resp).await?; - Ok(()) - } - Err(why) => { - ctx.say("i can't get a shiggy right now :(").await?; - Err(why) - } + if let Ok(url) = api::shiggy::get_random_shiggy().await { + utils::send_url_as_embed(ctx, url).await + } else { + ctx.say("i couldn't get a shiggy right now :(").await?; + Ok(()) } } |
