diff --git a/Cargo.lock b/Cargo.lock index 67d5236..1b663b7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,7 +4,7 @@ version = 4 [[package]] name = "RustBot" -version = "0.4.6" +version = "0.5.0" dependencies = [ "chrono", "poise", diff --git a/Cargo.toml b/Cargo.toml index 39cd070..500e23c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "RustBot" -version = "0.4.6" +version = "0.5.0" authors = ["Tim Hillier tim.r.hillier@gmail.com"] edition = "2024" diff --git a/src/commands/score.rs b/src/commands/score.rs index 0988b4e..b0e1d49 100644 --- a/src/commands/score.rs +++ b/src/commands/score.rs @@ -57,10 +57,21 @@ Returns the top 10 scoring users. pub async fn leader(ctx: Context<'_>) -> Result<(), Error> { let top_scores = get_top_scores(10).await; - let mut reply_string: String = String::new(); + let mut reply_string = String::from("🏆 **Leaderboard** 🏆\n\n"); for (i, value) in top_scores.0.iter().enumerate() { - reply_string.push_str((i + 1).to_string().as_str()); - reply_string.push_str(value.to_string().as_str()); + let place = match i { + 0 => "🥇", + 1 => "🥈", + 2 => "🥉", + _ => "🔹", + }; + reply_string.push_str(&format!( + "{} **#{}** — {} — **{}** points\n", + place, + i + 1, + value.user_name, + value.score + )); } if let Err(why) = ctx.reply(reply_string).await {