From b6f9df9276899e3020a5d43b7914ffd396ee7b19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Bersier?= Date: Thu, 6 Sep 2018 19:25:51 +0200 Subject: [PATCH] --- commands/prefix.js | 11 ----------- hahayes.js | 12 ++++++++++++ 2 files changed, 12 insertions(+), 11 deletions(-) delete mode 100644 commands/prefix.js diff --git a/commands/prefix.js b/commands/prefix.js deleted file mode 100644 index 06a6b79b..00000000 --- a/commands/prefix.js +++ /dev/null @@ -1,11 +0,0 @@ -exports.run = (client, message, args) => { - const fs = require("fs"); - if (message.author.id == "267065637183029248") { - // Gets the prefix from the command (eg. "!prefix +" it will take the "+" from it) - let newPrefix = message.content.split(" ").slice(1, 2)[0]; - // change the configuration in memory - commands.prefix = newPrefix; - // Now we have to save the file. - fs.writeFile(".././config.json", JSON.stringify(config), (err) => console.error); - } -} \ No newline at end of file diff --git a/hahayes.js b/hahayes.js index 64ce4352..7c6f29a7 100644 --- a/hahayes.js +++ b/hahayes.js @@ -36,4 +36,16 @@ client.on("message", (message) => { } }); +if(message.content.startsWith(config.prefix + "prefix")) { + if (message.author.id == "267065637183029248") { + // Gets the prefix from the command (eg. "!prefix +" it will take the "+" from it) + let newPrefix = message.content.split(" ").slice(1, 2)[0]; + // change the configuration in memory + config.prefix = newPrefix; + + // Now we have to save the file. + fs.writeFile("./config.json", JSON.stringify(config), (err) => console.error); +} +} + client.login(config.token); \ No newline at end of file