Browse Source

Use dotenv

master
Abheek Dhawan 3 years ago
parent
commit
0ba18aeb08
  1. 1
      .gitignore
  2. 1
      bot.js
  3. 2
      index.js
  4. 14
      package-lock.json
  5. 1
      package.json

1
.gitignore

@ -1 +1,2 @@
node_modules/ node_modules/
.env

1
bot.js

@ -1,4 +1,5 @@
#!/usr/bin/env node #!/usr/bin/env node
require('dotenv').config()
const Discord = require('discord.js'); const Discord = require('discord.js');
const MongoClient = require('mongodb').MongoClient; const MongoClient = require('mongodb').MongoClient;

2
index.js

@ -1,3 +1,5 @@
require('dotenv').config()
const { ShardingManager } = require('discord.js'); const { ShardingManager } = require('discord.js');
const manager = new ShardingManager('./bot.js', { token: process.env.BOT_TOKEN }); const manager = new ShardingManager('./bot.js', { token: process.env.BOT_TOKEN });

14
package-lock.json

@ -11,6 +11,7 @@
"dependencies": { "dependencies": {
"csvtojson": "^2.0.10", "csvtojson": "^2.0.10",
"discord.js": "github:discordjs/discord.js", "discord.js": "github:discordjs/discord.js",
"dotenv": "^10.0.0",
"mongodb": "^3.6.5", "mongodb": "^3.6.5",
"node-fetch": "^2.6.1", "node-fetch": "^2.6.1",
"nodemon": "^2.0.7" "nodemon": "^2.0.7"
@ -502,6 +503,14 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/dotenv": {
"version": "10.0.0",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz",
"integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==",
"engines": {
"node": ">=10"
}
},
"node_modules/duplexer3": { "node_modules/duplexer3": {
"version": "0.1.4", "version": "0.1.4",
"resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz",
@ -1895,6 +1904,11 @@
"is-obj": "^2.0.0" "is-obj": "^2.0.0"
} }
}, },
"dotenv": {
"version": "10.0.0",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz",
"integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q=="
},
"duplexer3": { "duplexer3": {
"version": "0.1.4", "version": "0.1.4",
"resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz",

1
package.json

@ -13,6 +13,7 @@
"dependencies": { "dependencies": {
"csvtojson": "^2.0.10", "csvtojson": "^2.0.10",
"discord.js": "github:discordjs/discord.js", "discord.js": "github:discordjs/discord.js",
"dotenv": "^10.0.0",
"mongodb": "^3.6.5", "mongodb": "^3.6.5",
"node-fetch": "^2.6.1", "node-fetch": "^2.6.1",
"nodemon": "^2.0.7" "nodemon": "^2.0.7"

Loading…
Cancel
Save