From 134a45dbd09ad4381f1a73f63ac72df745e5085e Mon Sep 17 00:00:00 2001 From: Supositware Date: Fri, 8 Feb 2019 18:46:00 +0100 Subject: [PATCH] Fixed server command --- commands/utility/server.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/commands/utility/server.js b/commands/utility/server.js index d3a39fb1..5b301a78 100644 --- a/commands/utility/server.js +++ b/commands/utility/server.js @@ -24,8 +24,14 @@ class ServerCommand extends Command { else if (autoresponse[message.channel.id] == 'enable') autoresponseStatus = 'enabled'; - const customresponse = require(`../../tag/${message.guild.id}.json`); - var count = Object.keys(customresponse).length; + let count; + + try { + const customresponse = require(`../../tag/${message.guild.id}.json`); + count = Object.keys(customresponse).length; + } catch (e) { + count = 0; + } const addEmbed = new MessageEmbed() .setColor('#0099ff')