Closed pitersky closed 8 years ago
Hi! First of all, thanks for trying out the lib :) The code is still based on telegram link library, so probably not greatly designed yet. But that will change very soon.
About the error: this is an error caused by an unknown type being decoded inside telegram-tl-node. The hash you are seeing in the error is e033ae7d, which is a Int32LE number equivalent to 2108568544. Flipping it's bytes, we get 7dae33e0. This byte sequence should be present as a hash in one of these schemas:
https://core.telegram.org/schema https://core.telegram.org/schema/mtproto
Looking at the first link, you should find this hash as the Config
constructor if you select the right layer. This is where things went bad. I tried the library with the wrong schema too, and got the error you mentioned. Then I remembered that sometimes the telegram docs won't show the most recent schema.
Go to the first link above, and right after the first paragraph, and above the schema definitions, look for 'Layer xx'. It should be 23. If is not, switch to 23, and the grab the source code in the link to the schema JSON.
Replacing the schema file with the correct layer fixed the problem here, and I was able to run your gist code. Let me know if you still can't run it.
By the way, the gist has an error: the client.callApi
method returns a Promise instead of using the callback format, so you want to use it like this:
client.callApi('help.getConfig').then(function(config) { ... });
Hi! First of all, thank you for this release. For me the library code is much more readable then telegram.link one's and it's very helping.
However I can't get it to work. I have managed how to establish connection to server, but
client.callApi('help.getConfig')
results in error: Unable to retrieve a Type by Id [e033ae7d]. The log is as follows:Any tips how to debug this is appreciated. I made a gist with the code I am using: https://gist.github.com/shilka/fed44947350f15e92919