mirror of
https://github.com/misenhower/splatoon3.ink.git
synced 2026-04-22 09:38:10 -05:00
40 lines
1.2 KiB
JavaScript
40 lines
1.2 KiB
JavaScript
import dotenv from 'dotenv';
|
|
import consoleStamp from 'console-stamp';
|
|
import cron from './cron.mjs';
|
|
import { sendStatuses, testStatuses } from './social/index.mjs';
|
|
import { updatePrimary, updateAll } from './data/index.mjs';
|
|
import { warmCaches } from "./splatnet/index.mjs";
|
|
import MastodonClient from './social/clients/MastodonClient.mjs';
|
|
import ImageWriter from './social/clients/ImageWriter.mjs';
|
|
import BlueskyClient from './social/clients/BlueskyClient.mjs';
|
|
import ThreadsClient from './social/clients/ThreadsClient.mjs';
|
|
import { archiveData } from './data/DataArchiver.mjs';
|
|
import { sentryInit } from './common/sentry.mjs';
|
|
|
|
consoleStamp(console);
|
|
dotenv.config();
|
|
sentryInit();
|
|
|
|
const actions = {
|
|
cron,
|
|
social: sendStatuses,
|
|
socialTest: testStatuses,
|
|
socialTestMastodon: () => testStatuses([new MastodonClient]),
|
|
socialTestBluesky: () => testStatuses([new BlueskyClient]),
|
|
socialTestImage: () => testStatuses([new ImageWriter]),
|
|
socialTestThreads: () => testStatuses([new ThreadsClient]),
|
|
splatnet: updatePrimary,
|
|
splatnetAll: updateAll,
|
|
warmCaches,
|
|
dataArchive: archiveData,
|
|
}
|
|
|
|
const command = process.argv[2];
|
|
const action = actions[command];
|
|
if (action) {
|
|
action();
|
|
} else {
|
|
console.error(`Unrecognized command: ${command}`);
|
|
}
|
|
|