From a5371c4711428fc927afe90dac7958316e1b18aa Mon Sep 17 00:00:00 2001 From: benji7425 Date: Wed, 20 Sep 2017 23:44:33 +0100 Subject: [PATCH] git subrepo pull discord-bot-core subrepo: subdir: "discord-bot-core" merged: "81a8c67" upstream: origin: "git@github.com:benji7425/discord-bot-core.git" branch: "master" commit: "81a8c67" git-subrepo: version: "0.3.1" origin: "???" commit: "???" --- discord-bot-core/.gitrepo | 4 ++-- discord-bot-core/client.js | 6 ++++-- discord-bot-core/message-handler.js | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/discord-bot-core/.gitrepo b/discord-bot-core/.gitrepo index 0b1b881..dbfcf16 100644 --- a/discord-bot-core/.gitrepo +++ b/discord-bot-core/.gitrepo @@ -6,7 +6,7 @@ [subrepo] remote = git@github.com:benji7425/discord-bot-core.git branch = master - commit = 8e6d6ce99e581f5ac5fb899112ef33bcf3e16a34 - parent = 341964a90ddca9afc684fd9331fc4177b8b68c04 + commit = 81a8c678cad14ed8162dd52475bff7ed02b6bc4e + parent = 052a0bf7e6a782290e50aa54f504be670dff776d method = merge cmdver = 0.3.1 diff --git a/discord-bot-core/client.js b/discord-bot-core/client.js index fbe284f..da40094 100644 --- a/discord-bot-core/client.js +++ b/discord-bot-core/client.js @@ -56,8 +56,10 @@ class CoreClient { if (msg) message.reply(msg); }) .catch(err => { - message.reply(err); - DiscordUtil.dateError(`Command error in guild ${message.guild.name}\n`, err.message || err); + if (err) { + message.reply(err); + DiscordUtil.dateError(`Command error in guild ${message.guild.name}\n`, err.message || err); + } }) .then(() => this.writeFile()); }); diff --git a/discord-bot-core/message-handler.js b/discord-bot-core/message-handler.js index 7c91670..b9bec94 100644 --- a/discord-bot-core/message-handler.js +++ b/discord-bot-core/message-handler.js @@ -41,7 +41,7 @@ function handleTextMessage(coreClient, message, guildsData) { const invoke = coreClient.implementations[commandProp]; if (!command || !params || isNaN(expectedParamCount)) - return reject(`'${message.content.split(" ")[1]}' is not a recognised command`); + return reject(); if (command === Config.commands.version) resolve(`${ParentPackageJSON.name} v${ParentPackageJSON.version}`);