From da574d514ceeae7611ad50d647d754e224c9b67f Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Thu, 24 Aug 2017 17:42:13 +0000 Subject: [PATCH] Minor Modifications --- package.json | 2 +- structures/Command.js | 8 +++++--- structures/Util.js | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 30670fb2..c82a5f94 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiaobot", - "version": "31.1.1", + "version": "31.1.2", "description": "Your personal server companion.", "main": "Shard.js", "scripts": { diff --git a/structures/Command.js b/structures/Command.js index d86f2cf5..1b23e8b5 100644 --- a/structures/Command.js +++ b/structures/Command.js @@ -15,19 +15,21 @@ class XiaoCommand extends Command { } hasPermission(msg) { - if (this.ownerOnly && !this.client.isOwner(msg.author)) return 'This Command can only be used by the bot owner.'; + if (this.ownerOnly && !this.client.isOwner(msg.author)) { + return `The \`${this.name}\` command can only be used by the bot owner.`; + } if (msg.channel.type === 'text') { if (this.clientPermissions) { for (const permission of this.clientPermissions) { if (!msg.channel.permissionsFor(this.client.user).has(permission)) { - return `This Command requires me to have the \`${perms[permission]}\` Permission.`; + return `The \`${this.name}\` command requires me to have the \`${perms[permission]}\` Permission.`; } } } if (this.userPermissions) { for (const permission of this.userPermissions) { if (!msg.channel.permissionsFor(msg.author).has(permission)) { - return `This Command requires you to have the \`${perms[permission]}\` Permission.`; + return `The \`${this.name}\` command requires you to have the \`${perms[permission]}\` Permission.`; } } } diff --git a/structures/Util.js b/structures/Util.js index ec93c6a4..724652ce 100644 --- a/structures/Util.js +++ b/structures/Util.js @@ -63,7 +63,7 @@ class Util { } static shuffle(arr) { - for (let i = arr.length - 1; i > 0; i--) { + for (let i = arr.length - 1; i >= 0; i--) { const j = Math.floor(Math.random() * (i + 1)); const temp = arr[i]; arr[i] = arr[j];