mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-04-21 01:38:55 +00:00
Paint the user embed!
This commit is contained in:
parent
572b17b715
commit
bc25312942
1 changed files with 23 additions and 13 deletions
|
@ -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),
|
||||||
|
|
Loading…
Add table
Reference in a new issue