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

Function findOrCreateLinenBot

apps/web/services/feed/notifyFeed.ts:67–89  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

65}
66
67async function findOrCreateLinenBot() {
68 let linenBot = await prisma.users.findUnique({
69 where: {
70 externalUserId_accountsId: {
71 accountsId: config.linen.communityId,
72 externalUserId: config.linen.bot.externalId,
73 },
74 },
75 });
76 if (!linenBot) {
77 linenBot = await prisma.users.create({
78 data: {
79 isAdmin: false,
80 isBot: true,
81 accountsId: config.linen.communityId,
82 externalUserId: config.linen.bot.externalId,
83 displayName: config.linen.bot.displayName,
84 profileImageUrl: config.linen.squareLogo,
85 },
86 });
87 }
88 return linenBot;
89}
90
91async function createThread({
92 body,

Callers 1

notifyFeedFunction · 0.70

Calls 1

createMethod · 0.45

Tested by

no test coverage detected