| 42 | } |
| 43 | |
| 44 | async function findOrCreateFeedChannel() { |
| 45 | let channel = await prisma.channels.findUnique({ |
| 46 | where: { id: config.linen.feedChannelId }, |
| 47 | }); |
| 48 | if (!channel) { |
| 49 | channel = await prisma.channels.create({ |
| 50 | data: { |
| 51 | channelName: 'feed', |
| 52 | id: config.linen.feedChannelId, |
| 53 | type: 'PUBLIC', |
| 54 | viewType: 'CHAT', |
| 55 | account: { |
| 56 | connectOrCreate: { |
| 57 | where: { id: config.linen.communityId }, |
| 58 | create: { id: config.linen.communityId }, |
| 59 | }, |
| 60 | }, |
| 61 | }, |
| 62 | }); |
| 63 | } |
| 64 | return channel; |
| 65 | } |
| 66 | |
| 67 | async function findOrCreateLinenBot() { |
| 68 | let linenBot = await prisma.users.findUnique({ |