Giter Site home page Giter Site logo

Comments (15)

Xilo14 avatar Xilo14 commented on August 12, 2024 4

Ok, after several hours of searching, I understand that we do not need to install the options that come by update. I got a few new errors before I realized it. Here's the timeline:

  1. Failed to parse JSON object as TDLib request: Unknown class "updateoption" - this error occurred due to overriding the datatype parameter. It is not necessary to touch it, it is a kind of class name for the json format. The Extra parameter can also be left untouched, because it is used by the library, for example, for id. You can simply delete these parameters and use the setOption method according to the documentation https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1set_option.html, passing only two parameters.
    After that, I started getting another error.
  2. TDLib. tdexception: "Option can't be set" - Starting immediately with the "version" option. https://core.telegram.org/tdlib/options. According to the same documentation, the options on which such an exception was made are forbidden to write. It is logical, because we do not need to change the version of tdlib. Therefore, updateoption only informs our application about the option change or occurs during initialization. For example so that we can correctly display the current version in the corner of the app)))

I checked the documentation and it is not written anywhere in the need to set options after getting the event. And in the examples, it is often ignored in general.
Solution: do not set the options that came for the event updateoption

from tdsharp.

x2bool avatar x2bool commented on August 12, 2024

@dariooo512 what was the purpose of SetOption function call here: https://github.com/egramtel/tdsharp/blob/master/Samples/TdLib.Samples.GetChats/Program.cs#L28 ?

from tdsharp.

Inetov avatar Inetov commented on August 12, 2024

I have same problem. This code master/Samples/TdLib.Samples.GetChats doesn't work!

@x2bool, I did not understand your question...

from tdsharp.

dariooo512 avatar dariooo512 commented on August 12, 2024

@dariooo512 what was the purpose of SetOption function call here: https://github.com/egramtel/tdsharp/blob/master/Samples/TdLib.Samples.GetChats/Program.cs#L28 ?

Hi, that code is used to set options coming from the server such as max message length.

from tdsharp.

dariooo512 avatar dariooo512 commented on August 12, 2024

I have same problem. This code master/Samples/TdLib.Samples.GetChats doesn't work!

@x2bool, I did not understand your question...

Did you set the param with your Telegram app data? (ApiId, ApiHash, PhoneNumber)

from tdsharp.

Inetov avatar Inetov commented on August 12, 2024

Did you set the param with your Telegram app data? (ApiId, ApiHash, PhoneNumber)

sure
изображение

from tdsharp.

dariooo512 avatar dariooo512 commented on August 12, 2024

Looks like the version upgrade from 1.4.0 to 1.6.0 did break that request. (Looks like a mismatch between request Json schema and related class model)

from tdsharp.

ageiter avatar ageiter commented on August 12, 2024

Hi,
I have the same problem. Is there already a solution or workaround to this issue?
I have commented out the code in the case UpdateOption and then the query GetChats works. But the options are not saved then.

from tdsharp.

x2bool avatar x2bool commented on August 12, 2024

@ageiter The workaround for now is to comment out SetOption call

from tdsharp.

x2bool avatar x2bool commented on August 12, 2024

updateOption is clearly defined: https://github.com/tdlib/td/blob/master/td/generate/scheme/td_api.tl#L3005

And it seems there is no mismatch between the types. tdlib for some reason doesn't recognize updateOption class. hmm... What actual subtype of the OptionValue are you getting?

from tdsharp.

StruninIhor avatar StruninIhor commented on August 12, 2024

updateOption is clearly defined: https://github.com/tdlib/td/blob/master/td/generate/scheme/td_api.tl#L3005

And it seems there is no mismatch between the types. tdlib for some reason doesn't recognize updateOption class. hmm... What actual subtype of the OptionValue are you getting?


Hi I'm facing the same issue.
Hope that will help
image

from tdsharp.

bretbas avatar bretbas commented on August 12, 2024

I have the same problem...

from tdsharp.

Ilya93 avatar Ilya93 commented on August 12, 2024

Me too..

from tdsharp.

matheusrochabume avatar matheusrochabume commented on August 12, 2024

I have the same problem, has anyone managed to solve it?

from tdsharp.

Xilo14 avatar Xilo14 commented on August 12, 2024

Hi. I have the same problem. I am compile 1.7 tdlib and generate new classes with your code generator, but the problem was not solved. Another functions works correctly.
изображение
This happens when I try to run your sample project. If I comment "setOption", everything works fine

from tdsharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.