remove dead code

This commit is contained in:
mykola2312 2024-02-18 19:12:21 +02:00
parent 2211ace02e
commit 70c050ca19

View file

@ -1,5 +1,6 @@
use anyhow; use anyhow;
use dotenv::dotenv; use dotenv::dotenv;
use teloxide::dispatching::dialogue::GetChatId;
use std::env; use std::env;
use std::fmt; use std::fmt;
use std::str; use std::str;
@ -11,6 +12,7 @@ use teloxide::dispatching::UpdateHandler;
use teloxide::{prelude::*, update_listeners::Polling, utils::command::BotCommands}; use teloxide::{prelude::*, update_listeners::Polling, utils::command::BotCommands};
mod dl; mod dl;
use dl::download::download;
type State = (); type State = ();
type MyDialogue = Dialogue<State, InMemStorage<State>>; type MyDialogue = Dialogue<State, InMemStorage<State>>;
@ -59,7 +61,9 @@ fn schema() -> UpdateHandler<HandlerErr> {
use dptree::case; use dptree::case;
let command_handler = let command_handler =
teloxide::filter_command::<Command, _>().branch(case![Command::Test].endpoint(test)); teloxide::filter_command::<Command, _>()
.branch(case![Command::Test].endpoint(test));
//.branch(case![Command::Download(download)].endpoint(download));
let message_handler = Update::filter_message().branch(command_handler); let message_handler = Update::filter_message().branch(command_handler);
let raw_message_handler = Update::filter_message().branch(dptree::endpoint(handle_message)); let raw_message_handler = Update::filter_message().branch(dptree::endpoint(handle_message));
@ -73,6 +77,9 @@ fn schema() -> UpdateHandler<HandlerErr> {
#[command(rename_rule = "lowercase")] #[command(rename_rule = "lowercase")]
enum Command { enum Command {
Test, Test,
#[command(alias = "dl")]
Download(String),
} }
async fn test(bot: Bot, msg: Message) -> HandlerResult { async fn test(bot: Bot, msg: Message) -> HandlerResult {
@ -91,13 +98,3 @@ async fn handle_message(_bot: Bot, _dialogue: MyDialogue, msg: Message) -> Handl
Ok(()) Ok(())
} }
async fn _answer(bot: Bot, msg: Message, cmd: Command) -> ResponseResult<()> {
match cmd {
Command::Test => {
bot.send_message(msg.chat.id, "test response").await?;
}
}
Ok(())
}