diff --git a/Cargo.lock b/Cargo.lock index 5d8e1bf..a1a4d77 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1745,9 +1745,9 @@ dependencies = [ [[package]] name = "url-track-cleaner" -version = "0.1.3" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58ece4daaa956919b83dd77d5c73dee850342934c29757c1cbbe05141bd90fdf" +checksum = "9c0c6743da8d1f79ab97c34709e0b52d65f77fe324f7dc82e75b6bea883b9d2f" dependencies = [ "anyhow", "regex", diff --git a/Cargo.toml b/Cargo.toml index 30c4c5f..f57ec2d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,6 +13,6 @@ tokio = { version = "1.37", features = ["rt-multi-thread", "macros"] } dashmap = "5.5.3" chrono = "0.4.34" once_cell = "1.19.0" -url-track-cleaner = "0.1.3" +url-track-cleaner = "0.1.5" anyhow = "1.0.82" linkify = "0.10.0" diff --git a/src/urlenhance.rs b/src/urlenhance.rs index b450174..dec671a 100644 --- a/src/urlenhance.rs +++ b/src/urlenhance.rs @@ -27,14 +27,14 @@ pub(crate) async fn handle_clean_url_cmd( cmd: CleanUrlCommand, ) -> ResponseResult<()> { if let Some(replied) = &msg.reply_to_message().cloned() { - if let Some(text) = replied.text() { - return handle_clean_urls_in_text(bot, msg, text.clone()).await; + return if let Some(text) = replied.text() { + handle_clean_urls_in_text(bot, msg, text).await } else { bot.send_message(msg.chat.id, "无法处理此消息") .reply_to_message_id(msg.id) .await?; - return Ok(()); - } + Ok(()) + }; } if cmd.url.is_empty() { bot.send_message(msg.chat.id, "URL 不能为空")