MessageParams.audio constructor

MessageParams.audio({
  1. required String toJid,
  2. String? replyMessageId,
  3. required FileMessageParams fileMessageParams,
  4. List<MessageMetaData> metaData = const [],
  5. required bool isRecorded,
  6. String topicId = "",
})

Constructs a MessageParams object for a Audio message.

Implementation

factory MessageParams.audio({
  required String toJid,
  String? replyMessageId,
  required FileMessageParams fileMessageParams,
  List<MessageMetaData> metaData = const [],
  required bool isRecorded,
  String topicId = "",
}) {
  return MessageParams._(
    toJid: toJid,
    replyMessageId: replyMessageId,
    messageType: isRecorded ? MessageType.audioRecorded : MessageType.audio,
    fileMessageParams: fileMessageParams,
    metaData: metaData,
    topicId: topicId,
  );
}