diff --git a/src/api.rs b/src/api.rs index c311147..0c18148 100644 --- a/src/api.rs +++ b/src/api.rs @@ -23,17 +23,17 @@ use crate::PingList; #[derive(Debug)] pub(crate) struct AppState { /// Clean text bot usernames - pub bots: Vec, + pub bots: Vec, /// Sha256 tokens pub tokens: Vec, /// The telegram clinet - tg_client: grammers_client::Client, + tg_client: grammers_client::Client, } #[derive(serde::Serialize)] struct MessageSchema<'a> { - message: &'a str, - status: bool, + message: &'a str, + status: bool, #[serde(skip)] status_code: StatusCode, } @@ -46,11 +46,11 @@ impl AppState { client: grammers_client::Client, ) -> Self { Self { - bots: bots + bots: bots .into_iter() .map(|b| b.trim_start_matches('@').trim().to_lowercase()) .collect(), - tokens: tokens + tokens: tokens .into_iter() .map(|t| sha256::digest(t.trim())) .collect(), diff --git a/src/main.rs b/src/main.rs index 656a85e..c8f6f41 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,7 +25,7 @@ mod superbot; #[derive(Default, Clone)] pub(crate) struct PingedBot { telegram_id: u64, - ping_in: i64, + ping_in: i64, is_response: bool, } @@ -64,6 +64,7 @@ impl PingList for Mutex> { log::debug!("Response status: {result}"); result } + fn new_res(&self, telegram_id: u64) { log::debug!("New res from: {telegram_id}"); let mut bots = self.lock().unwrap();