support chatid command
This commit is contained in:
@ -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
|
||||
|
||||
|
||||
13
src/main.rs
13
src/main.rs
@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user