From 0c1e5c19589d0988b4ea5e594561ed926c25fd15 Mon Sep 17 00:00:00 2001 From: Hirrolot Date: Tue, 29 Mar 2022 02:01:00 +0600 Subject: [PATCH] Fix fucked up `examples/admin.rs` --- examples/admin.rs | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/examples/admin.rs b/examples/admin.rs index 698035a7..d2545282 100644 --- a/examples/admin.rs +++ b/examples/admin.rs @@ -143,33 +143,6 @@ async fn mute_user( Ok(()) } -<<<<<<< HEAD -async fn action( - bot: Bot, - msg: Message, - command: Command, -) -> Result<(), Box> { - match command { - Command::Help => { - bot.send_message(msg.chat.id, Command::descriptions().to_string()).await?; - } - Command::Kick => kick_user(bot, msg).await?, - Command::Ban { time, unit } => ban_user(bot, msg, calc_restrict_time(time, unit)).await?, - Command::Mute { time, unit } => mute_user(bot, msg, calc_restrict_time(time, unit)).await?, - }; - - Ok(()) -} - -#[tokio::main] -async fn main() { - pretty_env_logger::init(); - log::info!("Starting admin_bot..."); - - let bot = teloxide::Bot::from_env().auto_send(); - - teloxide::commands_repl(bot, action, Command::ty()).await; -======= // Calculates time of user restriction. fn calc_restrict_time(time: u64, unit: UnitOfTime) -> Duration { match unit { @@ -177,5 +150,4 @@ fn calc_restrict_time(time: u64, unit: UnitOfTime) -> Duration { UnitOfTime::Minutes => Duration::minutes(time as i64), UnitOfTime::Seconds => Duration::seconds(time as i64), } ->>>>>>> Refactor `examples/admin.rs` and `buttons.rs` }