tdlib-ruby Telegram API returns Error timed out

452 Views Asked by At

I was trying to set up a web client for telegram using ruby. I registered for telegram application and obtained api_id and api_hash keys. Then I am using tdlib with the help of https://github.com/southbridgeio/tdlib-ruby. Each method call returns promise object and when checked for reason, shows - <TD::Types::Error code=0 message="Timeout error">. I'm not sure what is wrong. Any help would be appreciated.

1

There are 1 best solutions below

0
On

Had similar problem. You need to connect first. For example:

client = TD::Client.new
client.connect.then do
    client.join_chat(chat_id)
end

Or

client = TD::Client.new
client.connect.wait
client.join_chat(chat_id).wait