diff --git a/bathbot/src/commands/osu/relax/profile.rs b/bathbot/src/commands/osu/relax/profile.rs index fff7706e..5ab6731c 100644 --- a/bathbot/src/commands/osu/relax/profile.rs +++ b/bathbot/src/commands/osu/relax/profile.rs @@ -106,7 +106,7 @@ pub(super) async fn relax_profile(orig: CommandOrigin<'_>, args: RelaxProfile<'_ Ok(Some(info_res)) => info_res, Ok(None) => { return orig - .error(format!("Relax user `{}` not found", user.username)) + .error(format!("Relax player `{}` not found", user.username)) .await; } Err(err) => { @@ -166,7 +166,7 @@ pub fn relax_profile_builder(args: RelaxProfileArgs) -> Result { let stats = &args.info; let mut description = "__**Relax user statistics".to_string(); if let Some(discord_id) = args.discord_id { - let _ = write!(description, "for <@{discord_id}>"); + let _ = write!(description, " for <@{discord_id}>"); }; description.push_str(":**__"); diff --git a/bathbot/src/commands/osu/relax/top.rs b/bathbot/src/commands/osu/relax/top.rs index a29ef7eb..489ad061 100644 --- a/bathbot/src/commands/osu/relax/top.rs +++ b/bathbot/src/commands/osu/relax/top.rs @@ -1,7 +1,7 @@ use std::{cmp::Ordering, collections::HashMap}; use bathbot_util::constants::GENERAL_ISSUE; -use eyre::Result; +use eyre::{Report, Result}; use rosu_v2::{error::OsuError, model::GameMode, request::UserId}; use super::RelaxTop; @@ -52,7 +52,7 @@ pub async fn top(orig: CommandOrigin<'_>, args: RelaxTop<'_>) -> Result<()> { } Err(err) => { let _ = orig.error(GENERAL_ISSUE).await; - let err = eyre::Report::new(err).wrap_err("Failed to get user"); + let err = Report::new(err).wrap_err("Failed to get user"); return Err(err); } @@ -66,7 +66,12 @@ pub async fn top(orig: CommandOrigin<'_>, args: RelaxTop<'_>) -> Result<()> { let relax_api_result = tokio::try_join!(scores_fut, player_fut); let (mut scores, player) = match relax_api_result { - Ok(v) => v, + Ok((scores, Some(player))) => (scores, player), + Ok((_, None)) => { + return orig + .error(format!("Relax user `{}` not found", user.username)) + .await; + } Err(e) => { let _ = orig.error("Failed to get a relax player").await; @@ -91,10 +96,6 @@ pub async fn top(orig: CommandOrigin<'_>, args: RelaxTop<'_>) -> Result<()> { } }; - let Some(player) = player else { - return orig.error("Relax player not found").await; - }; - match args.sort.unwrap_or_default() { RelaxTopOrder::Acc => scores.sort_unstable_by(|lhs, rhs| { rhs.accuracy