diff options
Diffstat (limited to 'commands')
| -rw-r--r-- | commands/help.js | 13 | ||||
| -rw-r--r-- | commands/setprefix.js | 2 |
2 files changed, 13 insertions, 2 deletions
diff --git a/commands/help.js b/commands/help.js index f6c380d..8631aa3 100644 --- a/commands/help.js +++ b/commands/help.js @@ -18,6 +18,7 @@ *
* *************************************/
const Discord = require('discord.js');
+const fs = require('fs');
module.exports.run = async (client, message) => {
const categories = [];
const commands = Array.from(client.commands.keys());
@@ -28,9 +29,19 @@ module.exports.run = async (client, message) => { }
});
+ let prefixes = JSON.parse(fs.readFileSync("./storage/prefixes.json", "utf8"));
+
+ if(!prefixes[message.guild.id]){
+ prefixes[message.guild.id] = {
+ prefixes: settings.prefix
+ };
+ }
+
+ let prefix = prefixes[message.guild.id].prefixes
+
const embed = new Discord.RichEmbed()
.setAuthor('AleeBot ' + require('../storage/settings.json').abVersion + ` Help and on ${client.guilds.size} servers`, 'https://cdn.discordapp.com/avatars/282547024547545109/6c147a444ae328c38145ef1f74169e38.png?size=2048')
- .setDescription('Every command you input into AleeBot is `' + require('../storage/settings.json').prefix + '`')
+ .setDescription('Every command you input into AleeBot is `' + prefix + '`')
.setColor('#1fd619')
.setFooter('AleeCorp Copyright 2018, Licensed with GPL-3.0');
diff --git a/commands/setprefix.js b/commands/setprefix.js index 876f6e6..730f5b5 100644 --- a/commands/setprefix.js +++ b/commands/setprefix.js @@ -20,7 +20,7 @@ module.exports.run = async (client, message, args) => { const fs = require('fs'); if(!message.member.hasPermission("ADMINISTRATOR")) return message.reply('Sorry you need admin to set my prefix') - if(!args[0] || args[0 == "help"]) return message.reply('Usage: ab:setprefix <prefix>') + if(!args[0] || args[0 == "help"]) return message.reply(`Usage: <your prefix>setprefix <prefix>`) let prefixes = JSON.parse(fs.readFileSync("./storage/prefixes.json", "utf8")); |
