From 6684a9a4f7c9cab8a5dfeb66c9a57f2040f93d71 Mon Sep 17 00:00:00 2001 From: Alee Date: Fri, 20 Apr 2018 17:23:08 -0400 Subject: Changes in help --- commands/help.js | 13 ++++++++++++- commands/setprefix.js | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'commands') 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 ') + if(!args[0] || args[0 == "help"]) return message.reply(`Usage: setprefix `) let prefixes = JSON.parse(fs.readFileSync("./storage/prefixes.json", "utf8")); -- cgit v1.2.3