-
Notifications
You must be signed in to change notification settings - Fork 65
Closed
Labels
questionFurther information is requestedFurther information is requested
Description
updateChatMessageTtl is not implemented and when received from Telegram will result in an exception thrown.
Could not create an instance of type TdLib.TdApi+Object. Type is an interface or abstract class and cannot be instantiated. Path '@type', line 1, position 9.
tdsharp/TdLib/Bindings/Receiver.cs
Lines 43 to 69 in 9bebcfa
| private void ProcessEvents() | |
| { | |
| var ct = _cts.Token; | |
| while (!ct.IsCancellationRequested) | |
| { | |
| var data = _tdJsonClient.Receive(0.1); | |
| if (!string.IsNullOrEmpty(data)) | |
| { | |
| try | |
| { | |
| var structure = JsonConvert.DeserializeObject<TdApi.Object>(data, _converter); | |
| Received?.Invoke(this, structure); | |
| if (structure is TdApi.Update.UpdateAuthorizationState update) | |
| { | |
| AuthorizationStateChanged?.Invoke(this, update.AuthorizationState); | |
| } | |
| } | |
| catch (Exception e) | |
| { | |
| ExceptionThrown?.Invoke(this, e); | |
| } | |
| } | |
| } | |
| } |
This is because on line
54, the deserialization will fallback to TdApi.Object if the type is not found.
Lines 10 to 15 in 9bebcfa
| public abstract class Object | |
| { | |
| [JsonProperty("@type")] public virtual string DataType { get; set; } | |
| [JsonProperty("@extra")] public virtual string Extra { get; set; } | |
| } |
And
TdApi.Object is abstract. No deserialization can be performed on abstract class.Reactions are currently unavailable
Metadata
Metadata
Labels
questionFurther information is requestedFurther information is requested