From 467c7bab8c115b13c80c255eaa0454a111bc11e8 Mon Sep 17 00:00:00 2001 From: syui Date: Sat, 13 Apr 2024 05:24:25 +0900 Subject: [PATCH] fix --- src/bot.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/bot.rs b/src/bot.rs index f8936bc..f90089b 100644 --- a/src/bot.rs +++ b/src/bot.rs @@ -551,15 +551,11 @@ pub fn c_bot_feed(c: &Context) { let s = 0; let mut e = link.chars().count(); - let mut com = "".to_string(); - let mut prompt = "".to_string(); let mut prompt_sub = "".to_string(); - if vec.len() >= 1 { - com = vec[1].trim().to_string(); - prompt = vec[2..].join(" "); - } - if vec.len() > 2 { - prompt_sub = vec[3..].join(" "); + let com = vec[0].trim().to_string(); + let prompt = vec[1..].join(" "); + if vec.len() > 1 { + prompt_sub = vec[2..].join(" "); } if prompt.is_empty() == false || com.is_empty() == false {