Remove extended Command class

This commit is contained in:
Daniel Odendahl Jr
2017-09-29 00:49:17 +00:00
parent 9fb95df18a
commit 38a1e11b02
201 changed files with 208 additions and 228 deletions
+5 -2
View File
@@ -1,4 +1,4 @@
const Command = require('../../structures/Command');
const { Command } = require('discord.js-commando');
const snekfetch = require('snekfetch');
const { WEBHOOK_URL } = process.env;
@@ -10,7 +10,6 @@ module.exports = class WebhookCommand extends Command {
group: 'text-edit',
memberName: 'webhook',
description: 'Posts a message to the webhook defined in your `process.env`.',
ownerOnly: true,
args: [
{
key: 'content',
@@ -21,6 +20,10 @@ module.exports = class WebhookCommand extends Command {
});
}
hasPermission(msg) {
return this.client.isOwner(msg.author) || `The \`${this.name}\` command can only be used by the bot owner.`;
}
async run(msg, { content }) {
if (msg.channel.type === 'text' && msg.channel.permissionsFor(this.client.user).has('MANAGE_MESSAGES')) {
await msg.delete();