This commit is contained in:
Nathan Rashleigh committed 2024-06-30 23:19:06 +10:00
1 parent c987ba01b0
commit 9931732ded
2 files changed
+4 -14

No files matched your search

+3 -9
View File
@@ -1,6 +1,5 @@
import "dotenv/config"
import fs from 'fs/promises'
import { exec as execCb } from 'child_process'
import { promisify } from 'util'
@@ -21,9 +20,9 @@ BigInt.prototype.toJSON = function bigIntStringify() {
};
const exec = promisify(execCb)
const log = pino({ base: {} });
async function main() {
const log = pino({ base: {} });
const VISION_CREDENTIALS = JSON.parse(process.env.VISION_CREDENTIALS)
const vision = new Vision.ImageAnnotatorClient({ credentials: VISION_CREDENTIALS })
@@ -43,7 +42,7 @@ async function main() {
const memes = await memeService(log, prisma, meili)
const attachments = await attachmentService(log, minio, prisma, memes)
const scraper = await discordScraper(process.env.DISCORD_AUTH, vision, minio, prisma, log, attachments)
const scraper = await discordScraper(process.env.DISCORD_AUTH, vision, prisma, log, attachments)
const CHANNEL_IDS = [
// 367936426962190336n, // TPM shitposts
@@ -59,14 +58,9 @@ async function main() {
}
await migrateDb()
log.info('ready')
await Promise.all(CHANNEL_IDS.map(id => scraper.processChannel(id)))
}
main()
.then(() => true)
.catch(e => console.error(e))
.catch(e => log.error(e))