create /commit command to get commit hash from which this bot was built
All checks were successful
Build && Deploy / cargo build (push) Successful in 1m7s

This commit is contained in:
Akulij 2025-06-01 17:37:58 +05:00
parent 1669327df2
commit e74f875e3b

View File

@ -1,3 +1,4 @@
use git_const::git_hash;
use itertools::Itertools; use itertools::Itertools;
use teloxide::{ use teloxide::{
prelude::*, prelude::*,
@ -44,6 +45,8 @@ pub enum AdminCommands {
Cancel, Cancel,
/// Create new instance of telegram bot /// Create new instance of telegram bot
Deploy { token: String }, Deploy { token: String },
/// Get commit hash of this bot
Commit,
} }
pub async fn admin_command_handler( pub async fn admin_command_handler(
@ -189,6 +192,12 @@ pub async fn admin_command_handler(
.await?; .await?;
Ok(()) Ok(())
} }
AdminCommands::Commit => {
let hash = git_hash!();
bot.send_message(msg.chat.id, format!("Commit: {hash}"))
.await?;
Ok(())
}
} }
} }