From 2c12f15e1260e6e7e50e82c7a0bc568b8891b411 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Sun, 3 Sep 2017 22:26:43 +0000 Subject: [PATCH] userPermissions and clientPermissions are in commando now --- package.json | 4 ++-- structures/Command.js | 19 ------------------- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index 4532fd03..c050811a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiaobot", - "version": "35.1.6", + "version": "35.1.7", "description": "Your personal server companion.", "main": "Shard.js", "scripts": { @@ -35,7 +35,7 @@ "common-tags": "^1.4.0", "custom-translate": "github:dragonfire535/custom-translate", "discord.js": "github:hydrabolt/discord.js", - "discord.js-commando": "github:dragonfire535/discord.js-commando#test", + "discord.js-commando": "github:gawdl3y/discord.js-commando", "erlpack": "github:hammerandchisel/erlpack", "node-opus": "^0.2.6", "snekfetch": "^3.3.0", diff --git a/structures/Command.js b/structures/Command.js index 98add5d5..5d32d6f7 100644 --- a/structures/Command.js +++ b/structures/Command.js @@ -1,13 +1,10 @@ const { Command } = require('discord.js-commando'); -const perms = require('../assets/json/permissions'); class XiaoCommand extends Command { constructor(client, info) { super(client, info); this.ownerOnly = info.ownerOnly; - this.clientPermissions = info.clientPermissions; - this.userPermissions = info.userPermissions; this.throttling = info.throttling || { usages: 1, duration: 2 @@ -18,22 +15,6 @@ class XiaoCommand extends Command { 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 `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 `The \`${this.name}\` command requires you to have the \`${perms[permission]}\` permission.`; - } - } - } - } return true; } }