|
|
|
@ -375,7 +375,7 @@ pub async fn leaderboard(ctx: &Context<'_>) -> Result<(), Error> {
|
|
|
|
|
let mut top_submitters: Vec<(&String, &u32)> = submission_counts.iter().collect();
|
|
|
|
|
top_submitters.sort_by(|a, b| b.1.cmp(a.1));
|
|
|
|
|
let mut leaderboard_html = String::from("<table id=\"leaderboard\">");
|
|
|
|
|
for (i, (id, count)) in top_submitters[0..LENGTH].iter().enumerate() {
|
|
|
|
|
for (i, (id, count)) in top_submitters[0..std::cmp::min(top_submitters.len(), LENGTH)].iter().enumerate() {
|
|
|
|
|
let place = i + 1;
|
|
|
|
|
let user = serenity::UserId(id.parse::<u64>().unwrap())
|
|
|
|
|
.to_user(&ctx.serenity_context().http)
|
|
|
|
|