summaryrefslogtreecommitdiff
path: root/src/commands/ask.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/ask.rs')
-rw-r--r--src/commands/ask.rs23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/commands/ask.rs b/src/commands/ask.rs
index 7cc82a1..3589484 100644
--- a/src/commands/ask.rs
+++ b/src/commands/ask.rs
@@ -1,6 +1,6 @@
-use crate::consts;
-use crate::utils;
-use crate::{Context, Error};
+use crate::{consts, utils, Context};
+
+use color_eyre::eyre::{Context as _, Result};
/// ask teawie a question!
#[poise::command(prefix_command, slash_command)]
@@ -9,15 +9,10 @@ pub async fn ask(
#[description = "the question you want to ask teawie"]
#[rename = "question"]
_question: String,
-) -> Result<(), Error> {
- match utils::random_choice(consts::RESPONSES) {
- Ok(resp) => {
- ctx.say(resp).await?;
- Ok(())
- }
- Err(why) => {
- ctx.say("idk").await?;
- Err(why)
- }
- }
+) -> Result<()> {
+ let resp = utils::random_choice(consts::RESPONSES)
+ .wrap_err("couldn't choose from random responses!")?;
+
+ ctx.say(resp).await?;
+ Ok(())
}