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

Function createThread

packages/integration-discord/src/utils/linen.ts:120–143  ·  view source on GitHub ↗
({
  thread,
  externalThreadId,
  channelId,
}: {
  thread: {
    messageCount: number | null;
    name: string;
    createdTimestamp: number | null;
  };
  externalThreadId: string;
  channelId: string;
})

Source from the content-addressed store, hash-verified

118}
119
120export async function createThread({
121 thread,
122 externalThreadId,
123 channelId,
124}: {
125 thread: {
126 messageCount: number | null;
127 name: string;
128 createdTimestamp: number | null;
129 };
130 externalThreadId: string;
131 channelId: string;
132}) {
133 await prisma.threads.create({
134 data: {
135 sentAt: BigInt(thread.createdTimestamp || Date.now()),
136 externalThreadId,
137 channelId,
138 messageCount: thread.messageCount || undefined,
139 title: thread.name,
140 slug: slugify(thread.name),
141 },
142 });
143}
144
145export async function updateThread(id: string, title: string) {
146 await prisma.threads.update({

Callers 1

onThreadCreateFunction · 0.90

Calls 2

slugifyFunction · 0.90
createMethod · 0.45

Tested by

no test coverage detected