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

Function notifyFeed

apps/web/services/feed/notifyFeed.ts:20–42  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

18 ].join('\n\n');
19
20export async function notifyFeed(id: string) {
21 const newAccount = await prisma.accounts.findFirst({
22 select: { slackDomain: true, description: true, name: true },
23 where: { id },
24 });
25 if (!newAccount?.description) {
26 return;
27 }
28
29 const linenBot = await findOrCreateLinenBot();
30 const channel = await findOrCreateFeedChannel();
31 const body = messageTemplate({
32 name: newAccount.name,
33 description: newAccount.description,
34 slackDomain: newAccount.slackDomain,
35 });
36
37 await createThread({
38 body,
39 channelId: channel.id,
40 linenBotId: linenBot.id,
41 });
42}
43
44async function findOrCreateFeedChannel() {
45 let channel = await prisma.channels.findUnique({

Callers 1

eventNewCommunityFunction · 0.90

Calls 4

findOrCreateFeedChannelFunction · 0.85
messageTemplateFunction · 0.85
findOrCreateLinenBotFunction · 0.70
createThreadFunction · 0.70

Tested by

no test coverage detected