From 7f3f9f0bf18ba9c48b7b62d4825a2932b6b0c68d Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Thu, 29 Jul 2021 16:53:42 +0200 Subject: feat: make login --- src/commands.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/commands.rs (limited to 'src/commands.rs') diff --git a/src/commands.rs b/src/commands.rs new file mode 100644 index 0000000..11c59a9 --- /dev/null +++ b/src/commands.rs @@ -0,0 +1,20 @@ +use std::error::Error; +use teloxide::prelude::{AutoSend, Bot, Message, UpdateWithCx}; +use teloxide::utils::command::BotCommand; + +#[derive(BotCommand)] +#[command(rename = "lowercase", description = "These commands are supported:")] +pub enum Command { + #[command(description = "display this text")] + Help, +} + +pub async fn handler( + cx: UpdateWithCx, Message>, + command: Command, +) -> Result<(), Box> { + match command { + Command::Help => cx.answer(Command::descriptions()).await?, + }; + Ok(()) +} -- cgit v1.2.3-18-g5258