diff --git a/src/main.rs b/src/main.rs index 5bafffd..e53c274 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,6 @@ use teloxide::{prelude::*, utils::command::BotCommands}; use std::sync::Arc; +use chrono::Local; mod check_permissions; mod pole_dialogue; mod ban_stiker; @@ -16,7 +17,9 @@ enum Command { #[command(description = "display this text.")] Help, #[command(description = "list pole points" )] - Top + Top, + #[command(description = "get the server time" )] + Time, } #[tokio::main] @@ -102,6 +105,7 @@ async fn answer( }, Command::Help => bot.send_message(msg.chat.id, Command::descriptions().to_string()).await?, Command::Top => pole_dialogue::get_top(msg, bot).await?, + Command::Time => bot.send_message(msg.chat.id, Local::now().format("%Y-%m-%d:%H:%M:%S").to_string()).await?, }; Ok(())