From 7ff8707520254ea7b3da9e99e7547890647909b8 Mon Sep 17 00:00:00 2001 From: Tanguy Herbron Date: Sun, 9 May 2021 01:40:30 +0200 Subject: [PATCH] Fix argument-less commands --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 1645d19..250628f 100644 --- a/index.js +++ b/index.js @@ -17,7 +17,7 @@ client.on("message", message => { if(content.substr(0,1) === "!") { let boundary = content.indexOf(' '); - let prefix = content.substr(0, boundary); + let prefix = boundary === -1 ? content : content.substr(0, boundary); moduleManager.execute(prefix, message); }