From 1807dbabe2405cb4e911dbbab32c397f4af7e85b Mon Sep 17 00:00:00 2001 From: Linwenxuan <116782992+Linwenxuan05@users.noreply.github.com> Date: Fri, 2 Feb 2024 10:54:27 +0800 Subject: [PATCH] [Core] Add MessageBuilder.cs for RecordEntity --- Lagrange.Core/Message/MessageBuilder.cs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Lagrange.Core/Message/MessageBuilder.cs b/Lagrange.Core/Message/MessageBuilder.cs index c1386e3d0..ea4efd439 100644 --- a/Lagrange.Core/Message/MessageBuilder.cs +++ b/Lagrange.Core/Message/MessageBuilder.cs @@ -126,6 +126,30 @@ public MessageBuilder Image(byte[] file) return this; } + /// + /// Add a audio entity to the message chain + /// + /// The audio file that has already been converted to SilkCodec + public MessageBuilder Record(byte[] file) + { + var recordEntity = new RecordEntity(file); + _chain.Add(recordEntity); + + return this; + } + + /// + /// Add a audio entity to the message chain + /// + /// The audio file that has already been converted to SilkCodec + public MessageBuilder Record(string filePath) + { + var recordEntity = new RecordEntity(filePath); + _chain.Add(recordEntity); + + return this; + } + public MessageBuilder File(byte[] file, string fileName) { var fileEntity = new FileEntity(file, fileName);