-
Notifications
You must be signed in to change notification settings - Fork 48
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
The README.md example doesn't work #63
Comments
Changed this part of setting(:client) do
setting(:api_id) { |val| val.to_i } # before: setting :api_id, &:to_i
setting :api_hash
setting :use_test_dc, default: false # before: setting :use_test_dc, false
setting :database_directory, default: "#{Dir.home}/.tdlib-ruby/db" # before: setting :database_directory, "#{Dir.home}/.tdlib-ruby/db"
setting :files_directory, default: "#{Dir.home}/.tdlib-ruby/data" # before: setting :files_directory, "#{Dir.home}/.tdlib-ruby/data"
setting :use_file_database, default: true # before: setting :use_file_database, true
setting :use_chat_info_database, default: true # before: setting :use_chat_info_database, true
setting :use_secret_chats, default: true # before: setting :use_secret_chats, true
setting :use_message_database, default: true # before: setting :use_message_database, true
setting :system_language_code, default: 'en' # before: setting :system_language_code, 'en'
setting :device_model, default: 'Ruby TD client' # before: setting :device_model, 'Ruby TD client'
setting :system_version, default: 'Unknown' # before: setting :system_version, 'Unknown'
setting :application_version, default: '1.0' # before: setting :application_version, '1.0'
setting :enable_storage_optimizer, default: true # before: setting :enable_storage_optimizer, true
setting :ignore_file_names, default: false # before: setting :ignore_file_names, false
end Now it's starting without errors and warnings, but the state = nil
client.on(TD::Types::Update::AuthorizationState) do |update|
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
end
end And my code is just busy. But as I got it, it should show me the prompt to put my phone and so on. From: /home/user/coding/tapp/tel.rb:37 :
32: end
33:
34: client.connect
35:
36: loop do
=> 37: binding.pry
38:
39: case state
40: when :wait_phone_number
41: puts 'Please, enter your phone number:'
42: phone = STDIN.gets.strip
[1] pry(main)> client
=> #<TD::Client:0x00007fe836fdd858
@alive=true,
@config=
{:api_id=>"----------", # my real API ID is shown here
:api_hash=>"----------------------------", # and the API Hash too
:use_test_dc=>false,
:database_directory=>"/home/user/.tdlib-ruby/db",
:files_directory=>"/home/user/.tdlib-ruby/data",
:use_file_database=>true,
:use_chat_info_database=>true,
:use_secret_chats=>true,
:use_message_database=>true,
:system_language_code=>"en",
:device_model=>"Ruby TD client",
:system_version=>"Unknown",
:application_version=>"1.0",
:enable_storage_optimizer=>true,
:ignore_file_names=>false},
[2] pry(main)> state
=> nil
[3] pry(main)> !!! Do you have any idea on how to fix it, guys? |
@yart Write if you can solve this problem. I’m also struggling with it now, I have no ideas. |
Sure. I have an assumption that the problem in one of the following places:
|
@yart did you find a solution? |
@KonstantinReido I didn't have a time for this yet. But I remember about the problem. |
Tdlib changed input params for setTdlibParameters. |
Let me share my experience how to work with this lib:
The most important one is to change
Also i'm trying to inline schema with Tdlib, maybe i will create a PR soon, but at the moment you can check my fork https://github.com/tilvin/tdlib-schema.
Add debugging
Pick method from ClientMethods accordingly.
It comes from rescue, and means that e.g schema's class |
Hm, on my machine it doesn't see
I've used Tried to replace |
Thanks, i forgot this part: Or
to change only one gem instead of two. |
Thanks! Indeed, this fix made that error disappear |
Can anyone tell me what the current set of dependencies is? My current set:
i changed client.rb
I get an error when running the example from the readme (I commented out the logging line to get more information):
p.s. I don't know how important it is, but I had to rename tdjson.dll to libtdjson.dll after compilation tdLib, otherwise I'd get an error:
|
Hello, there were major updates introduces in 'tdlib-schema' and 'tdlib-ruby' a few month ago, so i suggest you to use those gems with master branches. |
@tilvin thanks for the answer, which version should I use TDLib https://github.com/tdlib/td : master or v1.8.0 ? |
|
this might come in handy. I got the authorisation and method of receiving messages from the channel working(text and photo), but when I'm trying to get a video post:
I saw at the very bottom of the documentation information about using ./bin/parse and tried to run:
be sure to take note of: https://github.com/southbridgeio/tdlib-schema/blob/master/bin/parser#L3 |
My Gemfile:
Trying to run the example from the current README and getting only the following:
I've been tried ruby 2.7.8 and 3.2.2 — the same result.
The last warning has been repeated several times. And that's all this code does.
I've changed the dry-configurable version according to this issue: #62. I had the same error before.
Who can help me, guys?
The text was updated successfully, but these errors were encountered: