add time command

This commit is contained in:
Guillermo Roche 2024-12-05 22:26:29 +01:00
parent b45da0e007
commit 1b85aff129
Signed by: groche97
GPG Key ID: 041FB85BEEA4B9B0

View File

@ -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(())