From 64ed31cc23dc513f04f5901fbd32adf3aff846d8 Mon Sep 17 00:00:00 2001 From: TIm Hillier Date: Tue, 2 Dec 2025 10:06:55 -0800 Subject: [PATCH 1/3] added version command. --- src/commands/ping.rs | 8 ++++++++ src/main.rs | 1 + 2 files changed, 9 insertions(+) diff --git a/src/commands/ping.rs b/src/commands/ping.rs index 62fffe0..df179ca 100644 --- a/src/commands/ping.rs +++ b/src/commands/ping.rs @@ -15,3 +15,11 @@ pub async fn ping( ctx.send(reply).await?; Ok(()) } + +/// Returns the version of the bot. +#[poise::command(prefix_command, required_permissions = "ADMINISTRATOR")] +pub async fn version(ctx: Context<'_>) -> Result<(), Error> { + let response = format!("The bot is running version {}", env!("CARGO_PKG_VERSION")); + ctx.reply(response).await?; + Ok(()) +} diff --git a/src/main.rs b/src/main.rs index 389d07b..007aafa 100644 --- a/src/main.rs +++ b/src/main.rs @@ -195,6 +195,7 @@ async fn main() { .options(poise::FrameworkOptions { commands: vec![ ping(), + version(), judge(), score(), top(), From f3ed353d2d6ed7bf24c493af168a1f7b9f7db0d4 Mon Sep 17 00:00:00 2001 From: TIm Hillier Date: Mon, 8 Dec 2025 15:34:54 -0800 Subject: [PATCH 2/3] Updated score leaderboard. --- src/commands/score.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) 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 { From 97a1bceda14167ef574fb7296edc0cf5c0bc1c10 Mon Sep 17 00:00:00 2001 From: TIm Hillier Date: Fri, 12 Dec 2025 17:50:09 -0800 Subject: [PATCH 3/3] Update version to 5.0 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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"