diff --git a/src/command.rs b/src/command.rs index b31e26e..ca9112c 100644 --- a/src/command.rs +++ b/src/command.rs @@ -3,7 +3,7 @@ use std::{error::Error, sync::Arc}; use teloxide::{prelude::*, types::Me, utils::command::BotCommands}; use tracing::error; -use crate::{bot::InstanceState, commands::{calendario_academico::calendario_academico, comunidades_it::comunidades_it, get_siu_info::get_siu_info, hacer_algo::hacer_algo, links_utiles::links_utiles, mails_de_escuela::get_mails_de_escuela, roadmap::roadmap}, models::errors::BotErrors}; +use crate::{bot::InstanceState, commands::{calendario_academico::calendario_academico, comunidades_it::comunidades_it, get_siu_info::get_siu_info, hacer_algo::hacer_algo, links_utiles::links_utiles, mails_de_escuela::get_mails_de_escuela, roadmap::roadmap, sedes::sedes}, models::errors::BotErrors}; /// Enumeration of commands accepted by the bot. #[derive(BotCommands, Clone)] @@ -31,6 +31,8 @@ pub enum Command { SIU, #[command(description = "Obtener mails de Escuela")] MailDeEscuela(String), + #[command(description = "Da una lista de las sedes con sus datos")] + Sedes } impl Command { @@ -51,7 +53,8 @@ impl Command { Command::CalendarioAcademico => calendario_academico(&msg, &bot).await, Command::SIU => get_siu_info(&msg, &bot).await, Command::ComunidadesIT => comunidades_it(&msg, &bot).await, - Command::MailDeEscuela(escuela) => get_mails_de_escuela(&msg, &bot, escuela).await + Command::MailDeEscuela(escuela) => get_mails_de_escuela(&msg, &bot, escuela).await, + Command::Sedes => sedes(&msg, &bot).await }; if let Err(error) = response { diff --git a/src/commands/mod.rs b/src/commands/mod.rs index 3089c8a..d3f4c7d 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -4,4 +4,5 @@ pub mod calendario_academico; pub mod get_siu_info; pub mod comunidades_it; pub mod mails_de_escuela; -pub mod roadmap; \ No newline at end of file +pub mod roadmap; +pub mod sedes; \ No newline at end of file diff --git a/src/commands/sedes.rs b/src/commands/sedes.rs new file mode 100644 index 0000000..c86baef --- /dev/null +++ b/src/commands/sedes.rs @@ -0,0 +1,36 @@ +use teloxide::payloads::SendMessageSetters; +use teloxide::{requests::Requester, types::Message, Bot}; +use teloxide::types::ParseMode::MarkdownV2; + +use crate::models::errors::BotErrors; + +const MESSAGE: &'static str = r#" +*Sede Rectorado* +Tel: \(0220\) 483 4150 +[Belgrano 369 \- San Antonio de Padua](https://maps.app.goo.gl/6Yz6BKtcaTdcnxaz7) +Lunes a viernes de 9 a 16 hs + +*CAMPUS UNIVERSITARIO* +[Av\. Dr\. Ricardo Balbín 2048\-2098, Merlo](https://maps.app.goo.gl/XpKfohxjGXmSu8dP9) +Lunes a viernes de 9 a 20 hs + +*Sede Centenario* +[Centenario 1399 y Lavallol de Acosta \- San Antonio de Padua](https://maps.app.goo.gl/qMegZX6vxGE4bubr9) +Tel: \(0220\) 483 5390 +Lunes a viernes de 9 a 20 hs + +*Sede Córdoba* +[Córdoba 1055 \- Merlo](https://maps.app.goo.gl/mFQ4Wo8pmbHb8RJr5) +Tel: \(0220\) 482 0799 +Lunes a viernes de 8 a 18 hs + +*Hospital Odontológico* +[Moreno y pte\. Perón \- Merlo](https://maps.app.goo.gl/mVqNtUY9H1uDJZbWA) +"#; + + +pub async fn sedes(msg: &Message, bot: &Bot) -> Result<(), BotErrors> { + bot.send_message(msg.chat.id, MESSAGE).parse_mode(MarkdownV2).await?; + + Ok(()) +} \ No newline at end of file