Stop pinging Telegram

Turns out grammers does it by itself
This commit is contained in:
blank X 2021-06-22 12:17:47 +07:00
parent 9993e52e0d
commit 8c2db3c958
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
1 changed files with 1 additions and 14 deletions

View File

@ -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()