From c12a9fe8ec8a1d07abe594d2a95210ea330ef377 Mon Sep 17 00:00:00 2001 From: syui Date: Sat, 30 Mar 2024 11:29:57 +0900 Subject: [PATCH] fix --- src/bot.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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();