Skip to content

Commit

Permalink
fix: remove No image pattern match log
Browse files Browse the repository at this point in the history
  • Loading branch information
akira02 committed Dec 16, 2024
1 parent 94b6585 commit 98e6a2a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ async fn handle_message(bot: &Bot, msg: &Message) -> Result<(), anyhow::Error> {
};

let pattern = Regex::new(r"^(.+?)\.(jpg|png|gif)$")?;
let captures = pattern
.captures(text)
.ok_or_else(|| anyhow::anyhow!("No image pattern match"))?;
let captures = pattern.captures(text).ok_or(anyhow::anyhow!(""))?;

let query = captures.get(1).unwrap().as_str();
info!("Query: {}", query);
Expand Down

0 comments on commit 98e6a2a

Please sign in to comment.