From e74f875e3ba99baefa0c79bb4046a2462589bef9 Mon Sep 17 00:00:00 2001 From: Akulij Date: Sun, 1 Jun 2025 17:37:58 +0500 Subject: [PATCH] create /commit command to get commit hash from which this bot was built --- src/admin.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/admin.rs b/src/admin.rs index 10fbba2..9a87504 100644 --- a/src/admin.rs +++ b/src/admin.rs @@ -1,3 +1,4 @@ +use git_const::git_hash; use itertools::Itertools; use teloxide::{ prelude::*, @@ -44,6 +45,8 @@ pub enum AdminCommands { Cancel, /// Create new instance of telegram bot Deploy { token: String }, + /// Get commit hash of this bot + Commit, } pub async fn admin_command_handler( @@ -189,6 +192,12 @@ pub async fn admin_command_handler( .await?; Ok(()) } + AdminCommands::Commit => { + let hash = git_hash!(); + bot.send_message(msg.chat.id, format!("Commit: {hash}")) + .await?; + Ok(()) + } } }