Skip to content

Commit

Permalink
🚀 publish
Browse files Browse the repository at this point in the history
  • Loading branch information
niuhuan committed Dec 11, 2024
1 parent 9c1cbee commit dbae256
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
10 changes: 5 additions & 5 deletions teleser/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "teleser"
version = "0.1.2"
version = "0.1.3"
edition = "2021"
description = "Telegram TMProto bot frame"
license = "MIT"
Expand All @@ -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"

Expand Down
16 changes: 3 additions & 13 deletions teleser/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,7 @@ pub async fn run_client_and_reconnect<S: Into<Arc<Client>>>(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())
Expand All @@ -216,11 +212,7 @@ pub async fn run_client_and_reconnect<S: Into<Arc<Client>>>(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?
}
};
Expand Down Expand Up @@ -273,9 +265,7 @@ pub async fn run_client_and_reconnect<S: Into<Arc<Client>>>(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;
Expand Down

0 comments on commit dbae256

Please sign in to comment.