(thread: DiscordThread, channel: channels)
| 153 | } |
| 154 | |
| 155 | function parseThread(thread: DiscordThread, channel: channels) { |
| 156 | const date = thread.thread_metadata?.create_timestamp || Date.now(); |
| 157 | return { |
| 158 | channelId: channel.id, |
| 159 | externalThreadId: thread.id, |
| 160 | messageCount: (thread.message_count || 0) + 1, |
| 161 | ...(thread.name && { slug: slugify(thread.name) }), |
| 162 | title: thread.name, |
| 163 | sentAt: new Date(date).getTime(), |
| 164 | lastReplyAt: new Date(date).getTime(), |
| 165 | }; |
| 166 | } |
| 167 | |
| 168 | async function crawlExistingThread({ |
| 169 | thread, |
no test coverage detected