Pad discriminators <1000 with zeroes in leaderboard

late-submissions
Elnu 3 years ago
parent 08a5cac37b
commit 5252428acb

@ -403,7 +403,7 @@ pub async fn leaderboard(ctx: &Context) -> CommandResult {
let profile = format!("https://discord.com/users/{id}"); let profile = format!("https://discord.com/users/{id}");
let name = user.name; let name = user.name;
let discriminator = user.discriminator; let discriminator = user.discriminator;
leaderboard_html.push_str(&format!("<tr><td>{place}</td><td><img src=\"{avatar}\" alt=\"avatar\"></td><td><a href=\"{profile}\" target=\"_blank\">{name}<span class=\"muted\">#{discriminator}</span></a></td><td>{count}</td></tr>")); leaderboard_html.push_str(&format!("<tr><td>{place}</td><td><img src=\"{avatar}\" alt=\"avatar\"></td><td><a href=\"{profile}\" target=\"_blank\">{name}<span class=\"muted\">#{:0>4}</span></a></td><td>{count}</td></tr>", discriminator));
} }
leaderboard_html.push_str("</table>"); leaderboard_html.push_str("</table>");
let mut file = std::fs::OpenOptions::new() let mut file = std::fs::OpenOptions::new()

Loading…
Cancel
Save