From f92f6ca19af31d57e3f4eed994a86ef0368fd69e Mon Sep 17 00:00:00 2001 From: AIFlow_ML Date: Fri, 3 Jan 2025 13:57:24 +0700 Subject: [PATCH] fix(client-slack): implement Media type properties in message attachments - #1384 --- packages/client-slack/jest.config.js | 2 +- packages/client-slack/src/messages.ts | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/client-slack/jest.config.js b/packages/client-slack/jest.config.js index c3bab4bd9c..ceb00df481 100644 --- a/packages/client-slack/jest.config.js +++ b/packages/client-slack/jest.config.js @@ -1,5 +1,5 @@ /** @type {import('ts-jest').JestConfigWithTsJest} */ -module.exports = { +export default { preset: 'ts-jest', testEnvironment: 'node', roots: ['/src'], diff --git a/packages/client-slack/src/messages.ts b/packages/client-slack/src/messages.ts index 089a959268..3a2008d2b5 100644 --- a/packages/client-slack/src/messages.ts +++ b/packages/client-slack/src/messages.ts @@ -255,6 +255,16 @@ export class MessageManager { `${event.thread_ts}-${this.runtime.agentId}` ) : undefined, + attachments: event.text + ? [{ + id: stringToUuid(`${event.ts}-attachment`), + url: '', // Since this is text content, no URL is needed + title: 'Text Attachment', + source: 'slack', + description: 'Text content from Slack message', + text: cleanedText + }] + : undefined, }; const memory: Memory = {