Updating env management
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
PRODTOKEN=
|
PRODTOKEN=
|
||||||
TOKEN=
|
DEVTOKEN=
|
||||||
MONGOURI=
|
MONGOURI=
|
||||||
DEV=
|
DEV=
|
||||||
CLIENTID=
|
CLIENTID=
|
||||||
|
|||||||
9
index.js
9
index.js
@@ -1,12 +1,19 @@
|
|||||||
const { Client, GatewayIntentBits, Partials, ActivityType, Events, Collection } = require('discord.js');
|
const { Client, GatewayIntentBits, Partials, ActivityType, Events, Collection } = require('discord.js');
|
||||||
const { botLogChannel, color } = require('./config/options.json');
|
const { botLogChannel, color } = require('./config/options.json');
|
||||||
const env = require('dotenv').config();
|
const env = require('dotenv').config();
|
||||||
const token = process.env.TOKEN;
|
|
||||||
const mongoURI = process.env.MONGOURI;
|
const mongoURI = process.env.MONGOURI;
|
||||||
const { connect } = require('mongoose');
|
const { connect } = require('mongoose');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
||||||
|
if (process.env.NODE_ENV === 'dev') {
|
||||||
|
console.log("Running in development mode.");
|
||||||
|
var token = process.env.DEVTOKEN;
|
||||||
|
} else {
|
||||||
|
console.log("Running in production mode.");
|
||||||
|
var token = process.env.PRODTOKEN;
|
||||||
|
}
|
||||||
|
|
||||||
const client = new Client({
|
const client = new Client({
|
||||||
intents: [
|
intents: [
|
||||||
GatewayIntentBits.Guilds,
|
GatewayIntentBits.Guilds,
|
||||||
|
|||||||
12
nodemon.json
Normal file
12
nodemon.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"restartable": "rs",
|
||||||
|
"ignore": [
|
||||||
|
".git",
|
||||||
|
"node_modules/**/node_modules"
|
||||||
|
],
|
||||||
|
"verbose": true,
|
||||||
|
"env": {
|
||||||
|
"NODE_ENV": "dev"
|
||||||
|
},
|
||||||
|
"ext": "js,json"
|
||||||
|
}
|
||||||
@@ -4,8 +4,10 @@
|
|||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prod:build": "node scripts/deploy-commands.js --prod",
|
"dev": "nodemon",
|
||||||
"dev:build": "node scripts/deploy-commands.js --dev"
|
"dev:build": "node scripts/dev-deploy.js"
|
||||||
|
"prod:build:global": "node scripts/deploy-commands.js --prod",
|
||||||
|
"prod:build:user": "node scripts/deploy-commands.js --dev"
|
||||||
},
|
},
|
||||||
"author": "Taken",
|
"author": "Taken",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
|
|||||||
Reference in New Issue
Block a user