Skip to content

Commit

Permalink
chore: add NODE_ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperchupuDev committed Mar 19, 2022
1 parent db86102 commit f3e2c77
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require('dotenv').config();
const { Client } = require('discord.js');
const Database = require('better-sqlite3');
const { DJSPoster } = require('topgg-autoposter');
Expand All @@ -11,9 +12,12 @@ const client = new Client({
}
});

require('dotenv').config();
// eslint-disable-next-line no-new
new DJSPoster(process.env.TOPGG_TOKEN, client);
console.log(`Starting ${process.env.NODE_ENV} build...`);

if (process.env.NODE_ENV !== 'development') {
// eslint-disable-next-line no-new
new DJSPoster(process.env.TOPGG_TOKEN, client);
}

client.db = new Database('database.sqlite3', { fileMustExist: true });
client.config = require('./config.json');
Expand Down

1 comment on commit f3e2c77

@Nyameliaaaa
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

process.env.NODE_ENV === 'production' would be better i think.

Please sign in to comment.