From 6a9a725cac08fd794e2466aee93116472cd5d8c6 Mon Sep 17 00:00:00 2001 From: benji7425 Date: Sat, 27 Jan 2018 18:04:33 +0000 Subject: [PATCH] Fix help not indicating that the bot username needs to be mentioned --- core/commands/help.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/commands/help.js b/core/commands/help.js index a1516b0..82e9a3d 100644 --- a/core/commands/help.js +++ b/core/commands/help.js @@ -11,17 +11,17 @@ module.exports = new Command({ invoke }); -function invoke({ commands, isMemberAdmin }) { - return Promise.resolve(createHelpEmbed(ParentPackageJson.name, commands, isMemberAdmin)); +function invoke({ commands, isMemberAdmin, client }) { + return Promise.resolve(createHelpEmbed(ParentPackageJson.name, commands, isMemberAdmin, client.user.username)); } -function createHelpEmbed(name, commands, userIsAdmin) { +function createHelpEmbed(name, commands, userIsAdmin, username) { const commandsArr = Object.keys(commands).map(x => commands[x]).filter(x => userIsAdmin || !x.admin); const embed = new Discord.RichEmbed().setTitle(`__${(ParentPackageJson.name + "").replace("discord-bot-", "")} help__`); commandsArr.forEach(command => { - embed.addField(command.name, `${command.description}\n**Usage:** *${name} ${command.syntax}*${userIsAdmin && command.admin ? "\n***Admin only***" : ""}`); + embed.addField(command.name, `${command.description}\n**Usage:** *@${username} ${command.syntax}*${userIsAdmin && command.admin ? "\n***Admin only***" : ""}`); }); embed.addField("__Need more help?__", `[Visit my website](${InternalConfig.website}) or [Join my Discord](${InternalConfig.discordInvite})`, true);