This commit is contained in:
Loïc Bersier 2018-09-06 19:25:51 +02:00
parent 6b6dda4cee
commit b6f9df9276
2 changed files with 12 additions and 11 deletions

View file

@ -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);
}
}

View file

@ -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); client.login(config.token);