Route IPC send_message by paired room role
This commit is contained in:
22
runners/agent-runner/src/ipc-message.ts
Normal file
22
runners/agent-runner/src/ipc-message.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
export interface SendMessageIpcPayloadInput {
|
||||
chatJid: string;
|
||||
text: string;
|
||||
sender?: string;
|
||||
senderRole?: string;
|
||||
groupFolder: string;
|
||||
timestamp?: string;
|
||||
}
|
||||
|
||||
export function buildSendMessageIpcPayload(
|
||||
input: SendMessageIpcPayloadInput,
|
||||
): Record<string, string | undefined> {
|
||||
return {
|
||||
type: 'message',
|
||||
chatJid: input.chatJid,
|
||||
text: input.text,
|
||||
sender: input.sender || undefined,
|
||||
senderRole: input.senderRole || undefined,
|
||||
groupFolder: input.groupFolder,
|
||||
timestamp: input.timestamp || new Date().toISOString(),
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user