Skip to content

Commit

Permalink
[Core] Add MessageBuilder.cs for RecordEntity
Browse files Browse the repository at this point in the history
  • Loading branch information
Linwenxuan authored and Linwenxuan committed Feb 2, 2024
1 parent d152345 commit 1807dba
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Lagrange.Core/Message/MessageBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,30 @@ public MessageBuilder Image(byte[] file)
return this;
}

/// <summary>
/// Add a audio entity to the message chain
/// </summary>
/// <param name="file">The audio file that has already been converted to SilkCodec</param>
public MessageBuilder Record(byte[] file)
{
var recordEntity = new RecordEntity(file);
_chain.Add(recordEntity);

return this;
}

/// <summary>
/// Add a audio entity to the message chain
/// </summary>
/// <param name="filePath">The audio file that has already been converted to SilkCodec</param>
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);
Expand Down

0 comments on commit 1807dba

Please sign in to comment.