MCPcopy Index your code
hub / github.com/Linen-dev/linen.dev / parseThread

Function parseThread

apps/web/services/discord/threads.ts:155–166  ·  view source on GitHub ↗
(thread: DiscordThread, channel: channels)

Source from the content-addressed store, hash-verified

153}
154
155function parseThread(thread: DiscordThread, channel: channels) {
156 const date = thread.thread_metadata?.create_timestamp || Date.now();
157 return {
158 channelId: channel.id,
159 externalThreadId: thread.id,
160 messageCount: (thread.message_count || 0) + 1,
161 ...(thread.name && { slug: slugify(thread.name) }),
162 title: thread.name,
163 sentAt: new Date(date).getTime(),
164 lastReplyAt: new Date(date).getTime(),
165 };
166}
167
168async function crawlExistingThread({
169 thread,

Callers 1

processThreadFunction · 0.85

Calls 1

slugifyFunction · 0.90

Tested by

no test coverage detected