Skip to content

Commit

Permalink
debug+correct links
Browse files Browse the repository at this point in the history
  • Loading branch information
orzklv committed Jul 2, 2024
1 parent 5cd1e29 commit 2d3bdde
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bots/xinuxmgr/src/functions/about.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ pub async fn command(bot: &Bot, msg: &Message) -> ResponseResult<()> {
pub fn keyboard() -> InlineKeyboardMarkup {
let mut keyboard = Keyboard::new();
keyboard
.url("Ochiq Havolalar", "https://github.com/xinuxuz/telegram")
.url("Ochiq Havolalar", "https://github.com/xinux-org/telegram")
.unwrap()
}
8 changes: 8 additions & 0 deletions bots/xinuxmgr/src/functions/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,23 @@ pub async fn inline(
pkgs: Pkgs,
q: InlineQuery,
) -> Result<(), Box<dyn Error + Send + Sync>> {
println!("Inline request has reached to function");

let parsed: String = q.query.clone();

let parsed = parsed.split_whitespace().collect::<Vec<&str>>();

println!("Parsed: {:?}", parsed);

match parsed.len() {
0 => return_err_answer!(bot, q, "Qidirishni boshlang!", NO_INPUT),
1 => return_err_answer!(bot, q, "Parametrlar yetarli emas!", NOT_ENOUGH),
2 => {}
3.. => return_err_answer!(bot, q, "Parametrlar haddan ko'p!", TOO_MANY),
}

println!("Inputs were checked successfully");

match parsed[0] {
"arch" => {
let request = pkgs.search(parsed[1]).await;
Expand Down Expand Up @@ -84,5 +90,7 @@ pub async fn inline(
_ => return_err_answer!(bot, q, "Noto'g'ri distributiv!", NOT_FOUND),
}

println!("Inline request has been processed successfully");

Ok(())
}

0 comments on commit 2d3bdde

Please sign in to comment.