Skip to content

Commit 508c939

Browse files
committed
Move missing env var check to index.js
Prevents PR workflow tests throwing as they require the config file. Best to keep ./config.js purely for the config as the checks need only be for starting the bot
1 parent 60869bd commit 508c939

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

config.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
1-
const MissingEnvVarError = require('./utils/errors/startup/missing-env-var');
2-
31
require('dotenv').config();
42

5-
const missingMandatoryEnvKeys = [
6-
'DISCORD_API_KEY',
7-
'DISCORD_CLIENT_ID',
8-
'DISCORD_GUILD_ID',
9-
].filter((key) => !process.env[key]);
10-
if (missingMandatoryEnvKeys.length) {
11-
throw new MissingEnvVarError(missingMandatoryEnvKeys);
12-
}
13-
143
const config = {
154
pointsbot: {
165
token: process.env.POINTSBOT_TOKEN,

0 commit comments

Comments
 (0)