Minor Modifications

This commit is contained in:
Daniel Odendahl Jr
2017-08-24 17:42:13 +00:00
parent 0d93199c8c
commit da574d514c
3 changed files with 7 additions and 5 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiaobot",
"version": "31.1.1",
"version": "31.1.2",
"description": "Your personal server companion.",
"main": "Shard.js",
"scripts": {
+5 -3
View File
@@ -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.`;
}
}
}
+1 -1
View File
@@ -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];