feat: 🚀 add and use dotenv-packed
Use dotenv for more convenient credential management
This commit is contained in:
parent
73d5f43ad3
commit
de0af4d2ac
12
lib/index.js
12
lib/index.js
|
@ -1,4 +1,4 @@
|
|||
// TODO reload
|
||||
const env = require("dotenv-packed").parseEnv().parsed
|
||||
const fs = require('fs');
|
||||
let cfg = {
|
||||
admin: "Applezaus",
|
||||
|
@ -12,14 +12,14 @@ const mineflayer = require("mineflayer");
|
|||
const bot =
|
||||
!isNaN(parseInt(process.argv[3])) && parseInt(process.argv[3]) > 1e2 ?
|
||||
mineflayer.createBot({
|
||||
host: process.argv[2] || process.env.MINECRAFT_HOST || 'localhost', // Change this to the ip you want.
|
||||
port: parseInt(process.argv[3]) || process.env.MINECRAFT_PORT // || 58471,
|
||||
host: process.argv[2] || process.env.MINECRAFT_HOST || env.MINECRAFT_HOST || 'localhost', // Change this to the ip you want.
|
||||
port: parseInt(process.argv[3]) || process.env.MINECRAFT_PORT || env.MINECRAFT_PORT // || 58471,
|
||||
})
|
||||
:
|
||||
mineflayer.createBot({
|
||||
host: process.argv[2] || process.env.MINECRAFT_HOST || 'localhost', // Change this to the ip you want.
|
||||
username: process.argv[3] || process.env.MINECRAFT_USER,
|
||||
password: process.argv[4] || process.env.MINECRAFT_PASS,
|
||||
host: process.argv[2] || process.env.MINECRAFT_HOST || env.MINECRAFT_HOST || 'localhost', // Change this to the ip you want.
|
||||
username: process.argv[3] || process.env.MINECRAFT_USER || env.MINECRAFT_USER,
|
||||
password: process.argv[4] || process.env.MINECRAFT_PASS || env.MINECRAFT_PASS,
|
||||
// port: process.argv[5] || process.env.MINECRAFT_PORT || 58471,
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user