From dbae256c7e101695083d9b06b4d67af9c43d2ad7 Mon Sep 17 00:00:00 2001 From: niuhuan Date: Wed, 11 Dec 2024 18:07:35 +0800 Subject: [PATCH] :rocket: publish --- teleser/Cargo.toml | 10 +++++----- teleser/src/client.rs | 16 +++------------- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/teleser/Cargo.toml b/teleser/Cargo.toml index 0cc63a2..f45a1f1 100644 --- a/teleser/Cargo.toml +++ b/teleser/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "teleser" -version = "0.1.2" +version = "0.1.3" edition = "2021" description = "Telegram TMProto bot frame" license = "MIT" @@ -9,10 +9,10 @@ repository = "https://github.com/niuhuan/teleser-rs" [dependencies] anyhow = "1.0" async-trait = "0.1" -grammers-client = "0.4.0" -grammers-session = "0.4.0" -grammers-tl-types = "0.4.0" -teleser_gen = { path = "../teleser_gen" } +grammers-client = "0.7.0" +grammers-session = "0.7.0" +grammers-tl-types = "0.7.0" +teleser_gen = "0.1.0" tokio = { version = "1", features = ["full"] } tracing = "0.1" diff --git a/teleser/src/client.rs b/teleser/src/client.rs index 6117291..a9e08c7 100644 --- a/teleser/src/client.rs +++ b/teleser/src/client.rs @@ -195,11 +195,7 @@ pub async fn run_client_and_reconnect>>(client: S) -> Result let usr = match &client.auth { Auth::AuthWithPhoneAndCode(auth) => { let token = inner_client - .request_login_code( - auth.input_phone().await?.as_str(), - client.api_id.clone(), - client.api_hash.as_str(), - ) + .request_login_code(auth.input_phone().await?.as_str()) .await?; match inner_client .sign_in(&token, auth.input_code().await?.as_str()) @@ -216,11 +212,7 @@ pub async fn run_client_and_reconnect>>(client: S) -> Result } Auth::AuthWithBotToken(auth) => { inner_client - .bot_sign_in( - auth.input_bot_token().await?.as_str(), - client.api_id.clone(), - client.api_hash.as_str(), - ) + .bot_sign_in(auth.input_bot_token().await?.as_str()) .await? } }; @@ -273,9 +265,7 @@ pub async fn run_client_and_reconnect>>(client: S) -> Result result = inner_client.next_update() => match result { Ok(update)=> { error_counter = 0; - if let Some(update) = update { - task::spawn(hand(client.modules.clone(),inner_client.clone(), update)); - } + task::spawn(hand(client.modules.clone(),inner_client.clone(), update)); } Err(e)=>{ error_counter+=1;