Skip to content

Commit

Permalink
new command for roadmap
Browse files Browse the repository at this point in the history
  • Loading branch information
lulujsx committed Mar 26, 2024
1 parent c31d670 commit 5d58307
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}, 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}, models::errors::BotErrors};

/// Enumeration of commands accepted by the bot.
#[derive(BotCommands, Clone)]
Expand All @@ -19,6 +19,8 @@ pub enum Command {
Help,
#[command(description = "Hace algo")]
HacerAlgo,
#[command(description = "Muestra el link de la imagen del roadmap de la carrera")]
Roadmap,
#[command(description = "Devuelve una lista de links")]
Links,
#[command(description = "Lista las comunidades IT que tenemos")]
Expand All @@ -44,6 +46,7 @@ impl Command {
let response = match cmd {
Command::Help => help(&msg, &bot).await,
Command::HacerAlgo => hacer_algo(&msg, &bot).await,
Command::Roadmap => roadmap(&msg, &bot).await,
Command::Links => links_utiles(&msg, &bot).await,
Command::CalendarioAcademico => calendario_academico(&msg, &bot).await,
Command::SIU => get_siu_info(&msg, &bot).await,
Expand Down
3 changes: 2 additions & 1 deletion src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ pub mod links_utiles;
pub mod calendario_academico;
pub mod get_siu_info;
pub mod comunidades_it;
pub mod mails_de_escuela;
pub mod mails_de_escuela;
pub mod roadmap;
11 changes: 11 additions & 0 deletions src/commands/roadmap.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
use teloxide::{requests::Requester, types::Message, Bot};

use crate::models::errors::BotErrors;


pub async fn roadmap(msg: &Message, bot: &Bot) -> Result<(), BotErrors> {
bot.send_message(msg.chat.id, "https://i.ibb.co/yB15FSW/Programa.jpg").await?;
println!("enviando link imagen");

Ok(())
}

0 comments on commit 5d58307

Please sign in to comment.