mirror of
https://github.com/Steffo99/patched-porobot.git
synced 2024-12-23 01:54:22 +00:00
Improve debug messages
This commit is contained in:
parent
26257ff2a3
commit
f5456980f6
1 changed files with 5 additions and 2 deletions
|
@ -21,6 +21,7 @@ pub fn inline_query_handler(
|
|||
// It's not a real loop, it's just to make the code flow more tolerable.
|
||||
let payload: AnswerInlineQuery = loop {
|
||||
if query.query.len() == 0 {
|
||||
debug!("Empty query specified.");
|
||||
break AnswerInlineQuery {
|
||||
inline_query_id: query.id.clone(),
|
||||
results: vec![],
|
||||
|
@ -33,6 +34,7 @@ pub fn inline_query_handler(
|
|||
}
|
||||
|
||||
if let Ok(deck) = Deck::from_code(&query.query.to_ascii_uppercase()) {
|
||||
debug!("Parsed deck successfully!");
|
||||
break AnswerInlineQuery {
|
||||
inline_query_id: query.id.clone(),
|
||||
results: vec![
|
||||
|
@ -46,11 +48,11 @@ pub fn inline_query_handler(
|
|||
}
|
||||
}
|
||||
|
||||
debug!("Querying the search engine...");
|
||||
debug!("Querying the card search engine...");
|
||||
let results = engine.query(&query.query, 50);
|
||||
|
||||
if let Err(_) = results {
|
||||
debug!("Invalid query syntax.");
|
||||
debug!("Invalid card search query syntax.");
|
||||
break AnswerInlineQuery {
|
||||
inline_query_id: query.id.clone(),
|
||||
results: vec![],
|
||||
|
@ -77,6 +79,7 @@ pub fn inline_query_handler(
|
|||
};
|
||||
}
|
||||
|
||||
debug!("Card search query successful!");
|
||||
break AnswerInlineQuery {
|
||||
inline_query_id: query.id.clone(),
|
||||
results: results
|
||||
|
|
Loading…
Reference in a new issue