summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/api/guzzle.rs2
-rw-r--r--src/commands/general/ask.rs6
-rw-r--r--src/commands/general/bing.rs2
-rw-r--r--src/commands/general/config.rs2
-rw-r--r--src/commands/general/convert.rs16
-rw-r--r--src/commands/general/random.rs6
-rw-r--r--src/commands/general/version.rs2
-rw-r--r--src/handlers/error.rs1
8 files changed, 20 insertions, 17 deletions
diff --git a/src/api/guzzle.rs b/src/api/guzzle.rs
index 0533c8b..1f285e9 100644
--- a/src/api/guzzle.rs
+++ b/src/api/guzzle.rs
@@ -18,7 +18,7 @@ pub async fn get_random_teawie() -> Result<String> {
.get(format!("{GUZZLE}{RANDOM_TEAWIE}"))
.build()?;
- debug!("making request to {}", req.url());
+ debug!("Making request to {}", req.url());
let resp = REQWEST_CLIENT.execute(req).await?;
let status = resp.status();
diff --git a/src/commands/general/ask.rs b/src/commands/general/ask.rs
index e1f008a..3f225bb 100644
--- a/src/commands/general/ask.rs
+++ b/src/commands/general/ask.rs
@@ -2,12 +2,12 @@ use crate::{consts, utils, Context};
use color_eyre::eyre::{Context as _, Result};
-/// ask teawie a question!
+/// Ask teawie a question!
#[poise::command(prefix_command, slash_command)]
pub async fn ask(
ctx: Context<'_>,
- #[description = "the question you want to ask teawie"]
- #[rename = "question"]
+ #[description = "The question you want to ask teawie"]
+ #[rename = "Question"]
_question: String,
) -> Result<()> {
let resp = utils::random_choice(consts::RESPONSES)
diff --git a/src/commands/general/bing.rs b/src/commands/general/bing.rs
index b80ebca..93c630b 100644
--- a/src/commands/general/bing.rs
+++ b/src/commands/general/bing.rs
@@ -2,7 +2,7 @@ use crate::Context;
use color_eyre::eyre::Result;
-/// make sure the wie is alive
+/// Make sure the wie is alive
#[poise::command(prefix_command)]
pub async fn bing(ctx: Context<'_>) -> Result<()> {
ctx.say("bong!").await?;
diff --git a/src/commands/general/config.rs b/src/commands/general/config.rs
index 64cdb83..f308f31 100644
--- a/src/commands/general/config.rs
+++ b/src/commands/general/config.rs
@@ -45,6 +45,7 @@ pub async fn config(_ctx: Context<'_>) -> Result<()> {
Ok(())
}
+// Set a configuration option
#[allow(clippy::too_many_arguments)]
#[poise::command(
slash_command,
@@ -135,6 +136,7 @@ pub async fn set(
Ok(())
}
+// Get a configuration option
#[poise::command(
slash_command,
prefix_command,
diff --git a/src/commands/general/convert.rs b/src/commands/general/convert.rs
index cbbf8dc..c00b4b8 100644
--- a/src/commands/general/convert.rs
+++ b/src/commands/general/convert.rs
@@ -11,44 +11,44 @@ pub async fn convert(_ctx: Context<'_>) -> Result<()> {
Ok(())
}
-/// ask teawie to convert °F to °C
+/// Ask teawie to convert °F to °C
#[poise::command(slash_command)]
pub async fn to_celsius(
ctx: Context<'_>,
- #[description = "what teawie will convert"] degrees_fahrenheit: f32,
+ #[description = "What teawie will convert"] degrees_fahrenheit: f32,
) -> Result<()> {
let temp = (degrees_fahrenheit - 32.0) * (5.0 / 9.0);
ctx.say(temp.to_string()).await?;
Ok(())
}
-/// ask teawie to convert °C to °F
+/// Ask teawie to convert °C to °F
#[poise::command(slash_command)]
pub async fn to_fahrenheit(
ctx: Context<'_>,
- #[description = "what teawie will convert"] degrees_celsius: f32,
+ #[description = "What teawie will convert"] degrees_celsius: f32,
) -> Result<()> {
let temp = (degrees_celsius * (9.0 / 5.0)) + 32.0;
ctx.say(temp.to_string()).await?;
Ok(())
}
-/// teawie will translate to bottom 🥺
+/// Teawie will translate to bottom 🥺
#[poise::command(slash_command)]
pub async fn to_bottom(
ctx: Context<'_>,
- #[description = "what teawie will translate into bottom"] message: String,
+ #[description = "What teawie will translate into bottom"] message: String,
) -> Result<()> {
let encoded = bottom::encode_string(&message);
ctx.say(encoded).await?;
Ok(())
}
-/// teawie will translate from bottom 🥸
+/// Teawie will translate from bottom 🥸
#[poise::command(slash_command)]
pub async fn from_bottom(
ctx: Context<'_>,
- #[description = "what teawie will translate from bottom"] message: String,
+ #[description = "What teawie will translate from bottom"] message: String,
) -> Result<()> {
let decoded = bottom::decode_string(&message)?;
ctx.say(decoded).await?;
diff --git a/src/commands/general/random.rs b/src/commands/general/random.rs
index 9595d09..286d04e 100644
--- a/src/commands/general/random.rs
+++ b/src/commands/general/random.rs
@@ -7,7 +7,7 @@ pub async fn random(_ctx: Context<'_>) -> Result<()> {
Ok(())
}
-/// get a random piece of teawie lore!
+/// Get a random piece of teawie lore!
#[poise::command(prefix_command, slash_command)]
pub async fn lore(ctx: Context<'_>) -> Result<()> {
let resp = utils::random_choice(consts::LORE)?;
@@ -15,14 +15,14 @@ pub async fn lore(ctx: Context<'_>) -> Result<()> {
Ok(())
}
-/// get a random teawie
+/// Get a random teawie
#[poise::command(prefix_command, slash_command)]
pub async fn teawie(ctx: Context<'_>) -> Result<()> {
let url = api::guzzle::get_random_teawie().await?;
utils::send_url_as_embed(ctx, url).await
}
-/// get a random shiggy
+/// Get a random shiggy
#[poise::command(prefix_command, slash_command)]
pub async fn shiggy(ctx: Context<'_>) -> Result<()> {
let url = api::shiggy::get_random_shiggy().await?;
diff --git a/src/commands/general/version.rs b/src/commands/general/version.rs
index 8b8d1f1..20368f2 100644
--- a/src/commands/general/version.rs
+++ b/src/commands/general/version.rs
@@ -2,7 +2,7 @@ use crate::colors::Colors;
use crate::Context;
use color_eyre::eyre::Result;
-/// get version info
+/// Get version info
#[poise::command(slash_command)]
pub async fn version(ctx: Context<'_>) -> Result<()> {
let sha = option_env!("GIT_SHA").unwrap_or("main");
diff --git a/src/handlers/error.rs b/src/handlers/error.rs
index bddd4f4..48cb421 100644
--- a/src/handlers/error.rs
+++ b/src/handlers/error.rs
@@ -19,6 +19,7 @@ pub async fn handle(error: poise::FrameworkError<'_, Data, Report>) {
FrameworkError::Command { error, ctx } => {
error!("Error in command {}:\n{error}", ctx.command().name);
+
ctx.send(|c| {
c.embed(|e| {
e.title("Something went wrong!")