Merge branch 'dev' into 'main'
Updating env management See merge request illegitimate/illegitimate-bot!25
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
PRODTOKEN=
|
||||
TOKEN=
|
||||
DEVTOKEN=
|
||||
MONGOURI=
|
||||
DEV=
|
||||
CLIENTID=
|
||||
|
||||
9
index.js
9
index.js
@@ -1,12 +1,19 @@
|
||||
const { Client, GatewayIntentBits, Partials, ActivityType, Events, Collection } = require('discord.js');
|
||||
const { botLogChannel, color } = require('./config/options.json');
|
||||
const env = require('dotenv').config();
|
||||
const token = process.env.TOKEN;
|
||||
const mongoURI = process.env.MONGOURI;
|
||||
const { connect } = require('mongoose');
|
||||
const path = require('path');
|
||||
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({
|
||||
intents: [
|
||||
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": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"prod:build": "node scripts/deploy-commands.js --prod",
|
||||
"dev:build": "node scripts/deploy-commands.js --dev"
|
||||
"dev": "nodemon",
|
||||
"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",
|
||||
"license": "ISC",
|
||||
|
||||
Reference in New Issue
Block a user