if config.json dosent exist, throw error saying they need config.json

This commit is contained in:
Loïc Bersier 2019-06-29 17:08:23 +02:00
parent 2cf6b30a78
commit 38fa060507

View file

@ -1,3 +1,7 @@
const fs = require('fs');
if (!fs.existsSync('./config.json')) {
throw new Error('I could not find config.json, are you sure you have it?');
}
const { AkairoClient, CommandHandler, InhibitorHandler, ListenerHandler } = require('discord-akairo'); const { AkairoClient, CommandHandler, InhibitorHandler, ListenerHandler } = require('discord-akairo');
const { token, prefix, ownerID } = require('./config.json'); const { token, prefix, ownerID } = require('./config.json');
require('console-stamp')(console, '[HH:MM:ss]'); require('console-stamp')(console, '[HH:MM:ss]');