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
All checks were successful
Build && Deploy / cargo build (push) Successful in 1m7s
This commit is contained in:
parent
1669327df2
commit
e74f875e3b
@ -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(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user