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

Function parseThreadFromMessage

apps/web/services/discord/messages.ts:158–176  ·  view source on GitHub ↗
(messageParsed: {
  authorId: string;
  body: string;
  channelId: string;
  sentAt: string;
  externalMessageId: string;
  threadId: string | undefined;
  mentions: { usersId: string }[] | undefined;
})

Source from the content-addressed store, hash-verified

156}
157
158async function parseThreadFromMessage(messageParsed: {
159 authorId: string;
160 body: string;
161 channelId: string;
162 sentAt: string;
163 externalMessageId: string;
164 threadId: string | undefined;
165 mentions: { usersId: string }[] | undefined;
166}) {
167 return {
168 sentAt: parseDiscordSentAt(messageParsed.sentAt),
169 channelId: messageParsed.channelId,
170 externalThreadId: messageParsed.externalMessageId,
171 messageCount: 1,
172 slug: slugify(messageParsed.body),
173 title: null,
174 lastReplyAt: parseDiscordSentAt(messageParsed.sentAt),
175 };
176}
177
178export async function createMessages({
179 channel,

Callers 1

processMessagesChunkFunction · 0.70

Calls 2

parseDiscordSentAtFunction · 0.90
slugifyFunction · 0.90

Tested by

no test coverage detected