Fix InvalidCastException in TLRequestGetStickerSet (#905)

When trying to SendRequest it was throwing an exception saying "cannot cast object of type TeleSharp.TL.TLStickerSet to TeleSharp.TL.Messages.TLStickerSet" 

Fixes https://github.com/sochix/TLSharp/issues/826
This commit is contained in:
emRzed 2020-02-03 10:27:57 +03:30 committed by GitHub
parent 90f9305dd6
commit 43f16e879e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,7 +18,7 @@ namespace TeleSharp.TL.Messages
} }
} }
public TLStickerSet Set { get; set; } public TL.TLStickerSet Set { get; set; }
public TLVector<TLStickerPack> Packs { get; set; } public TLVector<TLStickerPack> Packs { get; set; }
public TLVector<TLAbsDocument> Documents { get; set; } public TLVector<TLAbsDocument> Documents { get; set; }
@ -30,7 +30,7 @@ namespace TeleSharp.TL.Messages
public override void DeserializeBody(BinaryReader br) public override void DeserializeBody(BinaryReader br)
{ {
Set = (TLStickerSet)ObjectUtils.DeserializeObject(br); Set = (TL.TLStickerSet)ObjectUtils.DeserializeObject(br);
Packs = (TLVector<TLStickerPack>)ObjectUtils.DeserializeVector<TLStickerPack>(br); Packs = (TLVector<TLStickerPack>)ObjectUtils.DeserializeVector<TLStickerPack>(br);
Documents = (TLVector<TLAbsDocument>)ObjectUtils.DeserializeVector<TLAbsDocument>(br); Documents = (TLVector<TLAbsDocument>)ObjectUtils.DeserializeVector<TLAbsDocument>(br);