From b1c5e96e846d85b514e03491f529ba8927e5b2a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Bersier?= Date: Thu, 6 Sep 2018 18:59:55 +0200 Subject: [PATCH] re added prefix --- commands/prefix.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 commands/prefix.js diff --git a/commands/prefix.js b/commands/prefix.js new file mode 100644 index 00000000..aae9f003 --- /dev/null +++ b/commands/prefix.js @@ -0,0 +1,10 @@ +exports.run = (client, message, args) => { + 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); + } +} \ No newline at end of file