diff --git a/src/mods/ascii.rs b/src/mods/ascii.rs index cb151b8..b9c76a1 100644 --- a/src/mods/ascii.rs +++ b/src/mods/ascii.rs @@ -67,7 +67,7 @@ fn select_random_file(dir: &str) -> Option { pub async fn handle_ascii_command( writer: &mut W, - config: &Config, // Adjust the path as necessary to match your project structure + config: &Config, command: &str, channel: &str, ) -> Result<(), Box> { @@ -143,13 +143,16 @@ async fn handle_specific_file( channel: &str, parts: &[&str], ) -> Result<(), Box> { - let file_name = if parts.len() >= 3 { - parts[2..].join(" ") + println!("{:?}", parts); + let file_name = if parts.len() > 2 { + parts[1..].join(" ").replace(' ', "/") } else { - parts[2].to_string() + parts.get(1).unwrap_or(&"").to_string() }; + println!("{:?}", file_name); let file_path = format!("{}/{}.txt", config.ascii_art.clone().unwrap_or_else(|| "ascii_art".to_string()), file_name); + println!("{:?}", file_path); send_ansi_art(writer, &file_path, config.pump_delay, channel).await }