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

Function mapSlackMessage

apps/sim/tools/slack/utils.ts:36–70  ·  view source on GitHub ↗
(msg: any)

Source from the content-addressed store, hash-verified

34 * message-returning Slack tool (history, replies, thread, reader).
35 */
36export const mapSlackMessage = (msg: any) => ({
37 type: msg.type ?? 'message',
38 ts: msg.ts,
39 text: msg.text ?? '',
40 user: msg.user ?? null,
41 bot_id: msg.bot_id ?? null,
42 username: msg.username ?? null,
43 channel: msg.channel ?? null,
44 team: msg.team ?? null,
45 thread_ts: msg.thread_ts ?? null,
46 parent_user_id: msg.parent_user_id ?? null,
47 reply_count: msg.reply_count ?? null,
48 reply_users_count: msg.reply_users_count ?? null,
49 latest_reply: msg.latest_reply ?? null,
50 subscribed: msg.subscribed ?? null,
51 last_read: msg.last_read ?? null,
52 unread_count: msg.unread_count ?? null,
53 subtype: msg.subtype ?? null,
54 reactions: msg.reactions ?? [],
55 is_starred: msg.is_starred ?? false,
56 pinned_to: msg.pinned_to ?? [],
57 files: (msg.files ?? []).map((f: any) => ({
58 id: f.id,
59 name: f.name,
60 mimetype: f.mimetype,
61 size: f.size,
62 url_private: f.url_private ?? null,
63 permalink: f.permalink ?? null,
64 mode: f.mode ?? null,
65 })),
66 attachments: msg.attachments ?? [],
67 blocks: msg.blocks ?? [],
68 edited: msg.edited ?? null,
69 permalink: msg.permalink ?? null,
70})
71
72/** Maximum messages to request per page. Slack caps `conversations.*` at 999. */
73const SLACK_PAGE_MAX = 999

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected