From 71e61663e2701aa2ed0e28faed185972958c122e Mon Sep 17 00:00:00 2001 From: benji7425 Date: Mon, 2 Oct 2017 00:18:05 +0100 Subject: [PATCH] Fix exception if bot mentioned without a command --- discord-bot-core/HandleMessage.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/discord-bot-core/HandleMessage.js b/discord-bot-core/HandleMessage.js index e52a10b..70fe31a 100644 --- a/discord-bot-core/HandleMessage.js +++ b/discord-bot-core/HandleMessage.js @@ -33,6 +33,9 @@ function handleMessage(client, message, commands, guildData) { /**@param param*/ function handleInternalCommand(message, split, commands, isMemberAdmin) { + if (!split[1]) + return; + if (split[1].toLowerCase() === "version") message.reply(`${ParentPackageJSON.name} v${ParentPackageJSON.version}`); else if (split[1].toLowerCase() === "help") {