diff --git a/Lagrange.Core/Message/Entity/LightAppEntity.cs b/Lagrange.Core/Message/Entity/LightAppEntity.cs index 501338c0e..1b5d8b730 100644 --- a/Lagrange.Core/Message/Entity/LightAppEntity.cs +++ b/Lagrange.Core/Message/Entity/LightAppEntity.cs @@ -27,7 +27,7 @@ IEnumerable IMessageEntity.PackElement() { using var payload = new BinaryPacket() .WriteByte(0x01) - .WriteBytes(ZCompression.ZDecompress(Encoding.UTF8.GetBytes(Payload))); + .WriteBytes(ZCompression.ZCompress(Encoding.UTF8.GetBytes(Payload))); return new Elem[] { diff --git a/Lagrange.Core/Message/MessageBuilder.cs b/Lagrange.Core/Message/MessageBuilder.cs index ff2aa919e..f6f698a91 100644 --- a/Lagrange.Core/Message/MessageBuilder.cs +++ b/Lagrange.Core/Message/MessageBuilder.cs @@ -161,6 +161,18 @@ public MessageBuilder Poke(uint type = 1) return this; } + + /// + /// Add a dedicated LightApp entity to message chain + /// + /// Json Payload + public MessageBuilder LightApp(string payload) + { + var pokeEntity = new LightAppEntity(payload); + _chain.Add(pokeEntity); + + return this; + } public MessageBuilder File(byte[] file, string fileName) {