add time command
This commit is contained in:
parent
b45da0e007
commit
1b85aff129
@ -1,5 +1,6 @@
|
|||||||
use teloxide::{prelude::*, utils::command::BotCommands};
|
use teloxide::{prelude::*, utils::command::BotCommands};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
use chrono::Local;
|
||||||
mod check_permissions;
|
mod check_permissions;
|
||||||
mod pole_dialogue;
|
mod pole_dialogue;
|
||||||
mod ban_stiker;
|
mod ban_stiker;
|
||||||
@ -16,7 +17,9 @@ enum Command {
|
|||||||
#[command(description = "display this text.")]
|
#[command(description = "display this text.")]
|
||||||
Help,
|
Help,
|
||||||
#[command(description = "list pole points" )]
|
#[command(description = "list pole points" )]
|
||||||
Top
|
Top,
|
||||||
|
#[command(description = "get the server time" )]
|
||||||
|
Time,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
@ -102,6 +105,7 @@ async fn answer(
|
|||||||
},
|
},
|
||||||
Command::Help => bot.send_message(msg.chat.id, Command::descriptions().to_string()).await?,
|
Command::Help => bot.send_message(msg.chat.id, Command::descriptions().to_string()).await?,
|
||||||
Command::Top => pole_dialogue::get_top(msg, bot).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(())
|
Ok(())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user