Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. var Config = {};
  2. try{
  3. Config = require("./config.json");
  4. } catch(e){ //no config file, use defaults
  5. Config.debug = false;
  6. Config.commandPrefix = '!';
  7. try{
  8. if(fs.lstatSync("./config.json").isFile()){
  9. console.log("WARNING: config.json found but we couldn't read it!\n" + e.stack);
  10. }
  11. } catch(e2){
  12. fs.writeFile("./config.json",JSON.stringify(Config,null,2));
  13. }
  14. }
  15. if(!Config.hasOwnProperty("commandPrefix")){
  16. Config.commandPrefix = '!';
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement