({
body,
channelId,
linenBotId,
}: {
body: string;
channelId: string;
linenBotId: string;
})
| 89 | } |
| 90 | |
| 91 | async 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 | } |
no test coverage detected