diff --git a/src/main.rs b/src/main.rs index 9ac99bc..d406b36 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,8 +4,7 @@ mod utils; mod workers; use grammers_client::{types::chat::PackedChat, Client, Config, InputMessage, Update}; use grammers_session::Session; -use grammers_tl_types::functions::Ping; -use rand::{random, thread_rng, Rng}; +use rand::{thread_rng, Rng}; use regex::Regex; use reqwest::ClientBuilder; use std::collections::{HashSet, VecDeque}; @@ -60,18 +59,6 @@ async fn async_main() { eprintln!("Failed to save session: {:?}", err); } } - { - let tclient = tclient.clone(); - tokio::task::spawn(async move { - loop { - let ping_id = random(); - if let Err(err) = tclient.invoke(&Ping { ping_id }).await { - eprintln!("Failed to ping Telegram: {:?}", err); - } - sleep(Duration::from_secs(60)).await; - } - }); - } if config::STORAGE_CHAT.is_none() { while let Some(update) = tclient .next_update()