Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Config = {};
- try{
- Config = require("./config.json");
- } catch(e){ //no config file, use defaults
- Config.debug = false;
- Config.commandPrefix = '!';
- try{
- if(fs.lstatSync("./config.json").isFile()){
- console.log("WARNING: config.json found but we couldn't read it!\n" + e.stack);
- }
- } catch(e2){
- fs.writeFile("./config.json",JSON.stringify(Config,null,2));
- }
- }
- if(!Config.hasOwnProperty("commandPrefix")){
- Config.commandPrefix = '!';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement