splatoon3.ink/app/index.mjs
Matt Isenhower c1664590b5
Some checks failed
Build frontend / build (22.x) (push) Has been cancelled
Deploy / deploy-frontend (push) Has been cancelled
Deploy / deploy-backend (push) Has been cancelled
Fix code styles / build (push) Has been cancelled
Tests / test (22.x) (push) Has been cancelled
Auto-update social media avatars
2026-02-20 08:56:19 -08:00

46 lines
1.4 KiB
JavaScript

import dotenv from 'dotenv';
import consoleStamp from 'console-stamp';
import cron from './cron.mjs';
import { sendStatuses, testStatuses } from './social/index.mjs';
import { update } 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';
import { sync, syncUpload, syncDownload } from './sync/index.mjs';
import { updateAvatars } from './social/updateAvatars.mjs';
consoleStamp(console);
dotenv.config({ quiet: true });
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: update,
warmCaches,
dataArchive: archiveData,
sync,
syncUpload,
syncDownload,
updateAvatars,
};
const command = process.argv[2];
const params = process.argv.slice(3);
const action = actions[command];
if (action) {
action(...params);
} else {
console.error(`Unrecognized command: ${command}`);
}