Add Discord notifications for image generation and snapshot creation

This commit is contained in:
ImBenji
2026-02-13 21:47:12 +00:00
parent a23defb327
commit 813ed39102
13 changed files with 733 additions and 980 deletions

10
api.js
View File

@@ -3,10 +3,10 @@ const cors = require('cors');
const fs = require('fs');
const path = require('path');
const crypto = require('crypto');
const { initPool, renderHtml, POOL_SIZE } = require('./browserPool');
const v2Routes = require('./v2Routes');
const { cleanupExpiredSessions, cleanupExpiredSnapshots } = require('./db');
const { notifyImageGenerated } = require('./discordWebhook');
const { initPool, renderHtml, POOL_SIZE } = require('./src/services/browserPool');
const v2Routes = require('./src/versiontwo');
const { cleanupExpiredSessions, cleanupExpiredSnapshots } = require('./src/database/db');
const { notifyImageGenerated } = require('./src/services/discordWebhook');
const app = express();
const PORT = 3000;
@@ -220,7 +220,7 @@ function formatTimestamp(epoch) {
return `${hour12}:${minutes} ${ampm} · ${month} ${day}, ${year}`;
}
const TEMPLATE_PATH = path.join(__dirname, 'template.html');
const TEMPLATE_PATH = path.join(__dirname, 'templates/template.html');
const templateHtml = fs.readFileSync(TEMPLATE_PATH, 'utf8');
function buildEngagementHtml(engagement) {