add method to create timestamp and chatMessage

This commit is contained in:
marlon-erler
2024-07-19 19:49:55 +02:00
parent 99f16fd1a3
commit 74e969fa34
2 changed files with 23 additions and 3 deletions
+14
View File
@@ -1,5 +1,19 @@
// this file is responsible for managing chats and chat messages. objects are delegated to objectModel.ts.
import { createTimestamp } from "../utility";
// creation methods
export function createChatMessage(channel: string, sender: string, body: string): ChatMessage {
return {
dataVersion: "v2",
channel,
sender,
body,
dateSent: createTimestamp(),
}
}
// types
export interface ChatMessage {
dataVersion: "v2";