diff --git a/src/bot.rs b/src/bot.rs index b373546..981f493 100644 --- a/src/bot.rs +++ b/src/bot.rs @@ -52,6 +52,7 @@ pub fn c_bot(c: &Context) { let vec: Vec<&str> = text.split_whitespace().collect(); let handlev: Vec<&str> = handle.split('.').collect(); let mut handlev = handlev[0].trim().to_string(); + let mut ten_p = "false"; let mut link = "https://card.syui.ai/".to_owned() + &handlev; let s = 0; @@ -323,7 +324,9 @@ pub fn c_bot(c: &Context) { let text_limit = c_char(dd); if text_limit.len() > 3 { handlev = d.lines().collect::>()[0].to_string(); - let ten_p = d.lines().collect::>()[1].to_string(); + if d.lines().collect::>().len() >= 1 { + ten_p = d.lines().collect::>()[1]; + } if ten_p != "true" { link = "https://card.syui.ai/".to_owned() + &handlev; e = link.chars().count();