From bc2531294249c39510d8ee28ea38c6657a3f8596 Mon Sep 17 00:00:00 2001 From: Natsu Kagami Date: Sun, 9 Aug 2020 22:47:42 -0400 Subject: [PATCH] Paint the user embed! --- youmubot-osu/src/discord/embeds.rs | 36 +++++++++++++++++++----------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/youmubot-osu/src/discord/embeds.rs b/youmubot-osu/src/discord/embeds.rs index 6478341..8ea1bba 100644 --- a/youmubot-osu/src/discord/embeds.rs +++ b/youmubot-osu/src/discord/embeds.rs @@ -301,31 +301,40 @@ pub(crate) fn user_embed<'a>( .unwrap_or("Inactive".to_owned()), false, ) - .field("World Rank", format!("#{}", u.rank), true) + .field("World Rank", format!("#{}", grouped_number(u.rank)), true) .field( "Country Rank", - format!(":flag_{}: #{}", u.country.to_lowercase(), u.country_rank), + format!(":flag_{}: #{}", u.country.to_lowercase(), grouped_number(u.country_rank)), true, ) .field("Accuracy", format!("{:.2}%", u.accuracy), true) .field( - "Play count", - format!("{} (play time: {})", u.play_count, Duration(u.played_time)), + "Play count / Play time", + format!( + "{} ({})", + grouped_number(u.play_count), + Duration(u.played_time) + ), false, ) .field( "Ranks", format!( - "{} SSH | {} SS | {} SH | {} S | {} A", - u.count_ssh, u.count_ss, u.count_sh, u.count_s, u.count_a + "**{}** SSH | **{}** SS | **{}** SH | **{}** S | **{}** A", + grouped_number(u.count_ssh), + grouped_number(u.count_ss), + grouped_number(u.count_sh), + grouped_number(u.count_s), + grouped_number(u.count_a) ), false, ) .field( - "Level", + format!("Level {:.0}", u.level), format!( - "Level **{:.0}**: {} total score, {} ranked score", - u.level, u.total_score, u.ranked_score + "**{}** total score, **{}** ranked score", + grouped_number(u.total_score), + grouped_number(u.ranked_score) ), false, ) @@ -348,13 +357,14 @@ pub(crate) fn user_embed<'a>( ) )) .push("on ") - .push(format!( - "[{} - {}]({})", + .push_line(format!( + "[{} - {} [{}]]({})**{} **", MessageBuilder::new().push_bold_safe(&map.artist).build(), MessageBuilder::new().push_bold_safe(&map.title).build(), - map.link() + map.difficulty_name, + map.link(), + v.mods )) - .push_line(format!(" [{}]", map.difficulty_name)) .push(format!( "{:.1}⭐ | `{}`", info.map(|i| i.stars as f64).unwrap_or(map.difficulty.stars),