MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / createThread

Function createThread

apps/web/services/feed/notifyFeed.ts:91–117  ·  view source on GitHub ↗
({
  body,
  channelId,
  linenBotId,
}: {
  body: string;
  channelId: string;
  linenBotId: string;
})

Source from the content-addressed store, hash-verified

89}
90
91async function createThread({
92 body,
93 channelId,
94 linenBotId,
95}: {
96 body: string;
97 channelId: string;
98 linenBotId: string;
99}) {
100 await prisma.threads.create({
101 data: {
102 sentAt: new Date().getTime(),
103 feed: true,
104 lastReplyAt: new Date().getTime(),
105 channel: { connect: { id: channelId } },
106 messages: {
107 create: {
108 body,
109 sentAt: new Date(),
110 author: { connect: { id: linenBotId } },
111 channel: { connect: { id: channelId } },
112 messageFormat: MessageFormat.LINEN,
113 },
114 },
115 },
116 });
117}

Callers 2

notifyFeedFunction · 0.70
createThreadWrapperFunction · 0.50

Calls 1

createMethod · 0.45

Tested by

no test coverage detected