diff --git a/src/commands/pkg.rs b/src/commands/pkg.rs index 224da12..ae96ab6 100644 --- a/src/commands/pkg.rs +++ b/src/commands/pkg.rs @@ -1,10 +1,8 @@ use crate::bot::{Command, Context}; use async_trait::async_trait; -//use std::collections::HashMap; use reqwest::Client; -use serde_json::{Map,Value}; use serde::{Deserialize}; -use tracing::Level; + #[derive(Default)] @@ -20,14 +18,13 @@ impl Pkg { } } -#[derive(Debug, Deserialize)] -struct pkgd{ - version: u32, - results: Vec, +#[derive(Debug,Deserialize)] +struct Depkgd{ + results: Vec, } -#[derive(Debug, Deserialize)] -struct result { +#[derive(Debug,Deserialize)] +struct TheGStuff { pkgname: String, repo: String, pkgver: String, @@ -45,7 +42,7 @@ impl Command for Pkg { )) .send() .await?.text().await?; - let b: pkgd = serde_json::from_str(&body)?; + let b: Depkgd = serde_json::from_str(&body)?; let c = &b.results[0]; tracing::debug!("{:?}",b); Ok(format!("{} (v: {}): {}",c.pkgname,c.pkgver,c.pkgdesc))