Skip to content
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

AuthorizationState is not updating from WaitTdlibParameters #46

Open
gourshete opened this issue Jun 13, 2021 · 4 comments
Open

AuthorizationState is not updating from WaitTdlibParameters #46

gourshete opened this issue Jun 13, 2021 · 4 comments

Comments

@gourshete
Copy link

I am trying to run the ruby program given in readme. I have api_id and api_hash. But the authorization_state is set to WaitTdlibParameters initially and I am not sure how would it get updated to one of the states mentioned in the case when block.

Here is code snippet from my local file -

p '-----------------------------after config-----------------------------'
TD::Api.set_log_verbosity_level(1)
client = TD::Client.new
p '-----------------------------after client.new-----------------------------'

begin
  state = nil
  p '-----------------------------before client.on-----------------------------'
  client.on(TD::Types::Update::AuthorizationState) do |update|
    p '-----------------------------before case-----------------------------'
    p "update.authorization_state - #{update.authorization_state}"
    state = case update.authorization_state
            when TD::Types::AuthorizationState::WaitPhoneNumber
              :wait_phone_number
            when TD::Types::AuthorizationState::WaitCode
              :wait_code
            when TD::Types::AuthorizationState::WaitPassword
              :wait_password
            when TD::Types::AuthorizationState::Ready
              :ready
            else
              nil
            end
    p '-----------------------------end of case-----------------------------'
  end

Output

"-----------------------------before case-----------------------------"
"update.authorization_state - #<TD::Types::AuthorizationState::WaitTdlibParameters:0x00007fb7feb08d18>"

I tried few things like calling client.set_tdlib_parameters, but it is not getting me the correct result. Please let me know if I am missing something.

@m3xq
Copy link

m3xq commented Aug 22, 2021

Hi, I've just faced the same problem, my solution is: m3xq@17f578a

@Mehonoshin
Copy link

Same for me on the latest version

@Mehonoshin
Copy link

@m3xq unfortunately your patch does not solve the issue for me :(

@tilvin
Copy link

tilvin commented Jul 5, 2024

Maybe my comment from other issue will help somehow #63 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants