From 38fa0605073b161cecc50ec2f64fa20485bebfb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Bersier?= Date: Sat, 29 Jun 2019 17:08:23 +0200 Subject: [PATCH] if config.json dosent exist, throw error saying they need config.json --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index 8bcd5a48..e8d26cf6 100644 --- a/index.js +++ b/index.js @@ -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 { token, prefix, ownerID } = require('./config.json'); require('console-stamp')(console, '[HH:MM:ss]');