allow loading spam detection module

Co-authored-by: Martin Löffler <contact@fatalerrorcoded.eu>
This commit is contained in:
Jan 2022-07-17 13:18:34 +02:00
parent b986f1c585
commit 14f7d37c71
Signed by: Lea
GPG key ID: 5D5E18ACB990F57A
2 changed files with 10 additions and 0 deletions

View file

@ -0,0 +1,9 @@
import path from 'path';
import { client } from '../..';
import logger from '../logger';
if (process.env['AUTOMOD_LOAD_SPAM_DETECTION']) {
logger.info('Importing spam detection');
import(path.join(process.cwd(), '..', 'private', 'automod-spam-detection', 'dist', 'index.js'))
.then(mod => mod.raidDetection(client as any, logger, client.db, process.env.REDIS_URL));
}

View file

@ -68,4 +68,5 @@ logger.info(`\
import('./bot/modules/metrics'); import('./bot/modules/metrics');
import('./bot/modules/bot_status'); import('./bot/modules/bot_status');
import('./bot/modules/fetch_all'); import('./bot/modules/fetch_all');
import('./bot/modules/raid_detection');
})(); })();