-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Valid api_id must be provided. #37
Comments
As I said here library currently supports only 1.8.0. You have two options:
|
i just tried with the
and then nothing happens, just endless loop of Begin/End messages... weird |
It tells you "waiting for encryption key" (BTW removed in 1.8.21)
Push "enter" here.
On Sun, Nov 26, 2023, at 10:50, Ali wrote:
i just tried with the `1.8` and I got this :
`DEBUG tdlib parameters set
DEBUG state changes handled properly
DEBUG received new auth state: UpdateAuthorizationState { extra: None, client_id: Some(1), authorization_state: WaitEncryptionKey(AuthorizationStateWaitEncryptionKey { extra: None, client_id: None, is_encrypted: false }) }
DEBUG handling new auth state: WaitEncryptionKey(AuthorizationStateWaitEncryptionKey { extra: None, client_id: None, is_encrypted: false })
INFO wait for client's encryption key
waiting for encryption key
[ 3][t 0][1700992099.440389156][Client.cpp:291][&td_requests] End to wait for updates, returning object 0 (nil)
[ 3][t 0][1700992099.440802097][Client.cpp:278][&td_requests] Begin to wait for updates with timeout 1.000000
`
… and then nothing happens, just endless loop of Begin/End messages... weird
—
Reply to this email directly, view it on GitHub <#37 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABRBAYCGRJLQO6HT3SQD3RDYGMGFNAVCNFSM6AAAAAA72RZZN6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRWG4ZTOOJVGU>.
You are receiving this because you commented.Message ID: ***@***.***>
|
then it crashes without asking for verification code. shouldn't it print something ? like enter the thing or whatever... update: |
yes, this is how tdlib (c library) is implemented. |
about "it crashes" - is there any output? |
it dumped an error when unwraping the result of GetMe saying you are unauthorized, which was solved when i copy pasted this example. |
So everything is fine? :)
…On Sun, Nov 26, 2023, at 13:01, Ali wrote:
it dumped an error when unwraping the result of GetMe saying you are unauthorized, which was solved when i copy pasted this example <https://github.com/antonio-antuan/rust-tdlib/blob/master/examples/auth_bot.rs>.
—
Reply to this email directly, view it on GitHub <#37 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABRBAYHW3LDN4OGF4S6SKUTYGMVQTAVCNFSM6AAAAAA72RZZN6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRWG43DINRWHE>.
You are receiving this because you commented.Message ID: ***@***.***>
|
one more thing, its not related to this issue tho but im not sure if i should open another one. when I tried to Ping a proxy, after half a second it returned "time out on send operation", without aborting or anything, it just kept saying it, and the proxy was fine tho, is this behaviour from tdlib or this crate? |
kinda yes, however im not sure what solved the issue or how it happend, but its gone for now, LoL |
This is a part of api.rs. Everything in that file is generated from td_api.tl (of particular version). Therefore - this is a part of tdlib implementation. |
its weird, is it possible to somehow cancel the operation? its blocks the process unfortunately and doesnt return anything |
Could you provide your code?
…On Sun, Nov 26, 2023, at 13:29, Ali wrote:
its weird, is it possible to somehow cancel the operation? its blocks the process unfortunately and doesnt return anything
—
Reply to this email directly, view it on GitHub <#37 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABRBAYCQJR36NZZIHYEOYODYGMY3TAVCNFSM6AAAAAA72RZZN6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRWG43TCMRVGE>.
You are receiving this because you commented.Message ID: ***@***.***>
|
tdjson::set_log_verbosity_level(2);
let tdlib_parameters = TdlibParameters::builder()
.database_directory("tddb")
.use_test_dc(false)
.api_id(api_id)
.api_hash(api_hash)
.system_language_code("en")
.device_model("Desktop")
.system_version("Unknown")
.application_version(env!("CARGO_PKG_VERSION"))
.enable_storage_optimizer(true)
.build();
let (sender, mut receiver) = tokio::sync::mpsc::channel::<Box<Update>>(100);
let client = Client::builder()
.with_tdlib_parameters(tdlib_parameters)
.with_updates_sender(sender)
.with_client_auth_state_handler(ConsoleClientStateHandlerIdentified::new(ClientIdentifier::PhoneNumber(phone) ))
.build()
.unwrap();
let mut worker = Worker::builder()
.with_auth_state_handler(AuthStateHandlerProxy::default())
.build()
.unwrap();
worker.start();
let client = worker.bind_client(client).await.unwrap();
let me1 = client.get_me(GetMe::builder().build()).await.unwrap();
log::info!("me: {:?}", me1);
// id :3
/* let proxy = client.add_proxy(AddProxy::builder()
.server("116.203.10.150")
.port(8085)
.type_(ProxyType::Mtproto(ProxyTypeMtproto::builder().secret("3QAAAAAAAAAAAAAAAAAAAAA=").build()))
.enable(true)
.build())
.await;
*/
let seconds = client.ping_proxy(PingProxy::builder().proxy_id(3).build()).await; //blocks
println!("seconds: {:?}",seconds); |
|
with level 3 its generates a massive amount of irrelevant logs, take a look at this:
notice the timeout in between is happening for no reason. here is the log_level(2) after logging-in and trying to
i dont know maybe its because the version 1.8 is too old or something, I think the library is broken, it would be nice if someone could try out the code and see the results are the same... UPDATE: its funny even with I commented out the |
I think I might be able to help if you could specify what needs to be done in #38 |
try that:
probably it fixes the problem |
it did not, same thing happened again |
ok I have to dive deeply into it |
I Noticed that when i removed the update handler |
Yes, that's the reason of this error. So if you don't want to listen for updates - you can remove it. But if you do want - I have to fix it. Well, I anyway have to fix it...)
…On Mon, Nov 27, 2023, at 11:03, Ali wrote:
I Noticed that when i removed the update handler `.with_updates_sender(sender)` the error never happened again
—
Reply to this email directly, view it on GitHub <#37 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABRBAYGCBSK4QKGUB3LXJ7TYGRQONAVCNFSM6AAAAAA72RZZN6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRXGUYTSNBRGA>.
You are receiving this because you commented.Message ID: ***@***.***>
|
let me know If I could help! |
@MrAliSalehi sorry, was way too busy... |
yes
|
I don't experience the same problem (but used proxies from here)
try the following code and please say if it helps. probably the reason is "wait_authorized" function call. also I used that rust-tdlib version (didn't have a chance to release it yet).
|
hi there I read the comments above and installed tdlib but know i don't understand what to do ); |
How do you want to use it? In your desktop client?) |
yeah in desktop |
This is not the right place to ask such a question) |
No, I mean that I want to build proxies like that one I showed you above |
I don't know, my library is not for that |
The #35 is happening in version
1.8.21
againthey are "" and 0 even when i set them manually.
is there any fix for this?
The text was updated successfully, but these errors were encountered: