MCPcopy Index your code
hub / github.com/simstudioai/sim / createFileMessageObject

Function createFileMessageObject

apps/sim/app/api/tools/slack/utils.ts:181–201  ·  view source on GitHub ↗
(
  text: string,
  channel: string,
  files: any[]
)

Source from the content-addressed store, hash-verified

179 * Creates a message object for file uploads
180 */
181export function createFileMessageObject(
182 text: string,
183 channel: string,
184 files: any[]
185): Record<string, any> {
186 const fileTs = files?.[0]?.created?.toString() || (Date.now() / 1000).toString()
187 return {
188 type: 'message',
189 ts: fileTs,
190 text,
191 channel,
192 files: files?.map((file: any) => ({
193 id: file?.id,
194 name: file?.name,
195 mimetype: file?.mimetype,
196 size: file?.size,
197 url_private: file?.url_private,
198 permalink: file?.permalink,
199 })),
200 }
201}
202
203/**
204 * Opens a DM channel with a user and returns the channel ID

Callers 1

sendSlackMessageFunction · 0.85

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected