summaryrefslogtreecommitdiff
path: root/src/commands/random.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/random.rs')
-rw-r--r--src/commands/random.rs29
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(())
}
}