support chatid command
This commit is contained in:
@ -3,6 +3,7 @@ name = "altherego"
|
|||||||
version = "0.9.9"
|
version = "0.9.9"
|
||||||
authors = ["Aleksandr Trushkin <atrushkin@outlook.com>"]
|
authors = ["Aleksandr Trushkin <atrushkin@outlook.com>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
default-run = "altherego"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# 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::RoomTemperature].endpoint(handle_temperature_sensor))
|
||||||
.branch(dptree::case![Command::HostTemperature].endpoint(handle_host_temperature))
|
.branch(dptree::case![Command::HostTemperature].endpoint(handle_host_temperature))
|
||||||
.branch(dptree::case![Command::VersionRequest].endpoint(handle_version))
|
.branch(dptree::case![Command::VersionRequest].endpoint(handle_version))
|
||||||
@ -266,14 +263,14 @@ struct Climate {
|
|||||||
#[derive(BotCommands, Debug, Clone, PartialEq, Eq)]
|
#[derive(BotCommands, Debug, Clone, PartialEq, Eq)]
|
||||||
#[command(description = "These commands are supported:")]
|
#[command(description = "These commands are supported:")]
|
||||||
enum Command {
|
enum Command {
|
||||||
#[command(description = "display this text.")]
|
#[command(rename="help", description = "display this text.")]
|
||||||
Help,
|
Help,
|
||||||
#[command(description = "temperature of your room.")]
|
#[command(rename="roomtemp", description = "temperature of your room.")]
|
||||||
RoomTemperature,
|
RoomTemperature,
|
||||||
#[command(description = "temperature of raspberry.")]
|
#[command(rename="hosttemp", description = "temperature of raspberry.")]
|
||||||
HostTemperature,
|
HostTemperature,
|
||||||
#[command(description = "prints current version.")]
|
#[command(rename="version", description = "prints current version.")]
|
||||||
VersionRequest,
|
VersionRequest,
|
||||||
#[command(description = "prints current chat id.")]
|
#[command(rename="chatid", description = "prints current chat id.")]
|
||||||
ChatID,
|
ChatID,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user