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

Function createThread

apps/web/services/channels/userJoined.ts:80–106  ·  view source on GitHub ↗
({
  body,
  channelId,
  linenBotId,
}: {
  body: string;
  channelId: string;
  linenBotId: string;
})

Source from the content-addressed store, hash-verified

78}
79
80async function createThread({
81 body,
82 channelId,
83 linenBotId,
84}: {
85 body: string;
86 channelId: string;
87 linenBotId: string;
88}) {
89 await prisma.threads.create({
90 data: {
91 sentAt: new Date().getTime(),
92 feed: true,
93 lastReplyAt: new Date().getTime(),
94 channel: { connect: { id: channelId } },
95 messages: {
96 create: {
97 body,
98 sentAt: new Date(),
99 author: { connect: { id: linenBotId } },
100 channel: { connect: { id: channelId } },
101 messageFormat: MessageFormat.LINEN,
102 },
103 },
104 },
105 });
106}

Callers 1

notifyChannelFunction · 0.70

Calls 1

createMethod · 0.45

Tested by

no test coverage detected