Paint the user embed!

This commit is contained in:
Natsu Kagami 2020-08-09 22:47:42 -04:00
parent 572b17b715
commit bc25312942
No known key found for this signature in database
GPG key ID: F17543D4B9424B94

View file

@ -301,31 +301,40 @@ pub(crate) fn user_embed<'a>(
.unwrap_or("Inactive".to_owned()), .unwrap_or("Inactive".to_owned()),
false, false,
) )
.field("World Rank", format!("#{}", u.rank), true) .field("World Rank", format!("#{}", grouped_number(u.rank)), true)
.field( .field(
"Country Rank", "Country Rank",
format!(":flag_{}: #{}", u.country.to_lowercase(), u.country_rank), format!(":flag_{}: #{}", u.country.to_lowercase(), grouped_number(u.country_rank)),
true, true,
) )
.field("Accuracy", format!("{:.2}%", u.accuracy), true) .field("Accuracy", format!("{:.2}%", u.accuracy), true)
.field( .field(
"Play count", "Play count / Play time",
format!("{} (play time: {})", u.play_count, Duration(u.played_time)), format!(
"{} ({})",
grouped_number(u.play_count),
Duration(u.played_time)
),
false, false,
) )
.field( .field(
"Ranks", "Ranks",
format!( format!(
"{} SSH | {} SS | {} SH | {} S | {} A", "**{}** SSH | **{}** SS | **{}** SH | **{}** S | **{}** A",
u.count_ssh, u.count_ss, u.count_sh, u.count_s, u.count_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, false,
) )
.field( .field(
"Level", format!("Level {:.0}", u.level),
format!( format!(
"Level **{:.0}**: {} total score, {} ranked score", "**{}** total score, **{}** ranked score",
u.level, u.total_score, u.ranked_score grouped_number(u.total_score),
grouped_number(u.ranked_score)
), ),
false, false,
) )
@ -348,13 +357,14 @@ pub(crate) fn user_embed<'a>(
) )
)) ))
.push("on ") .push("on ")
.push(format!( .push_line(format!(
"[{} - {}]({})", "[{} - {} [{}]]({})**{} **",
MessageBuilder::new().push_bold_safe(&map.artist).build(), MessageBuilder::new().push_bold_safe(&map.artist).build(),
MessageBuilder::new().push_bold_safe(&map.title).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!( .push(format!(
"{:.1}⭐ | `{}`", "{:.1}⭐ | `{}`",
info.map(|i| i.stars as f64).unwrap_or(map.difficulty.stars), info.map(|i| i.stars as f64).unwrap_or(map.difficulty.stars),