diff --git a/src/TL.Helpers.cs b/src/TL.Helpers.cs index 463d3bc..1fb8141 100644 --- a/src/TL.Helpers.cs +++ b/src/TL.Helpers.cs @@ -492,6 +492,13 @@ namespace TL public static implicit operator InputStickerSetID(StickerSet stickerSet) => new() { id = stickerSet.id, access_hash = stickerSet.access_hash }; } + partial class MessageEntity + { + public string Type { get { var name = GetType().Name; return name[(name.IndexOf("MessageEntity") + 13)..]; } } + public int Offset { get => offset; set => offset = value; } + public int Length { get => length; set => length = value; } + } + partial class InputChannel { /// Channel identifier diff --git a/src/TL.Schema.cs b/src/TL.Schema.cs index ca343c3..bff0d83 100644 --- a/src/TL.Schema.cs +++ b/src/TL.Schema.cs @@ -6754,7 +6754,7 @@ namespace TL } /// Message entities, representing styled text in a message See Derived classes: , , , , , , , , , , , , , , , , , , , , - public abstract class MessageEntity : IObject + public abstract partial class MessageEntity : IObject { /// Offset of message entity within message (in UTF-16 code units) public int offset; diff --git a/src/TL.cs b/src/TL.cs index 20659c9..1c4fab8 100644 --- a/src/TL.cs +++ b/src/TL.cs @@ -42,9 +42,9 @@ namespace TL public Exception Exception; } - internal static class Serialization + public static class Serialization { - internal static void WriteTLObject(this BinaryWriter writer, T obj) where T : IObject + public static void WriteTLObject(this BinaryWriter writer, T obj) where T : IObject { if (obj == null) { writer.WriteTLNull(typeof(T)); return; } var type = obj.GetType(); @@ -66,7 +66,7 @@ namespace TL } } - internal static IObject ReadTLObject(this BinaryReader reader, uint ctorNb = 0) + public static IObject ReadTLObject(this BinaryReader reader, uint ctorNb = 0) { if (ctorNb == 0) ctorNb = reader.ReadUInt32(); if (ctorNb == Layer.GZipedCtor)