Compare commits
2 Commits
1e046e2e19
...
e74f875e3b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e74f875e3b | ||
|
|
1669327df2 |
7
Cargo.lock
generated
7
Cargo.lock
generated
@ -897,6 +897,12 @@ version = "0.31.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f"
|
||||
|
||||
[[package]]
|
||||
name = "git-const"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "aa4f63cc0cd93d91bcc11b46f61db771bc36c405d96043506ae40facd87b31f7"
|
||||
|
||||
[[package]]
|
||||
name = "glob"
|
||||
version = "0.3.2"
|
||||
@ -915,6 +921,7 @@ dependencies = [
|
||||
"enum_stringify",
|
||||
"envconfig",
|
||||
"futures",
|
||||
"git-const",
|
||||
"itertools 0.14.0",
|
||||
"lazy_static",
|
||||
"log",
|
||||
|
||||
@ -14,6 +14,7 @@ dotenvy = "0.15.7"
|
||||
enum_stringify = "0.6.3"
|
||||
envconfig = "0.11.0"
|
||||
futures = "0.3.31"
|
||||
git-const = "1.1.0"
|
||||
itertools = "0.14.0"
|
||||
lazy_static = "1.5.0"
|
||||
log = "0.4.27"
|
||||
|
||||
@ -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