support chatid command

This commit is contained in:
2023-03-05 23:42:36 +03:00
parent 75abdf2412
commit 0c566d3726
2 changed files with 6 additions and 8 deletions

View File

@ -3,6 +3,7 @@ name = "altherego"
version = "0.9.9"
authors = ["Aleksandr Trushkin <atrushkin@outlook.com>"]
edition = "2018"
default-run = "altherego"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -105,9 +105,6 @@ async fn run() -> anyhow::Result<()> {
}
},
))
.chain(dptree::map(|g: utils::Generators| -> utils::RequestID {
g.next_request_id()
}))
.branch(dptree::case![Command::RoomTemperature].endpoint(handle_temperature_sensor))
.branch(dptree::case![Command::HostTemperature].endpoint(handle_host_temperature))
.branch(dptree::case![Command::VersionRequest].endpoint(handle_version))
@ -266,14 +263,14 @@ struct Climate {
#[derive(BotCommands, Debug, Clone, PartialEq, Eq)]
#[command(description = "These commands are supported:")]
enum Command {
#[command(description = "display this text.")]
#[command(rename="help", description = "display this text.")]
Help,
#[command(description = "temperature of your room.")]
#[command(rename="roomtemp", description = "temperature of your room.")]
RoomTemperature,
#[command(description = "temperature of raspberry.")]
#[command(rename="hosttemp", description = "temperature of raspberry.")]
HostTemperature,
#[command(description = "prints current version.")]
#[command(rename="version", description = "prints current version.")]
VersionRequest,
#[command(description = "prints current chat id.")]
#[command(rename="chatid", description = "prints current chat id.")]
ChatID,
}