Remove ALL Settings

This commit is contained in:
Daniel Odendahl Jr
2017-09-08 21:12:32 +00:00
parent 80d317cc78
commit 0dc1dd6c1a
11 changed files with 14 additions and 334 deletions
+4 -29
View File
@@ -1,7 +1,4 @@
const Command = require('../../structures/Command');
const { MessageEmbed } = require('discord.js');
const { stripIndents } = require('common-tags');
const { filterTopics } = require('../../structures/Util');
module.exports = class HackbanCommand extends Command {
constructor(client) {
@@ -10,7 +7,7 @@ module.exports = class HackbanCommand extends Command {
aliases: ['hackbanne'],
group: 'moderation',
memberName: 'hackban',
description: 'Bans a user who doesn\'t have to be in the server and logs the ban to the mod logs.',
description: 'Bans a user who doesn\'t have to be in the server.',
guildOnly: true,
clientPermissions: ['BAN_MEMBERS'],
userPermissions: ['ADMINISTRATOR'],
@@ -34,7 +31,6 @@ module.exports = class HackbanCommand extends Command {
}
async run(msg, args) {
const modlogs = filterTopics(msg.guild.channels, 'modlog').first();
const { id, reason } = args;
if (id === msg.author.id) return msg.say('I don\'t think you want to ban yourself...');
if (id === msg.guild.ownerID) return msg.say('Don\'t you think that might be betraying your leader?');
@@ -44,7 +40,7 @@ module.exports = class HackbanCommand extends Command {
} catch (err) {
return msg.say('Could not resolve user.');
}
await msg.say(`Are you sure you want to ban ${user.tag} (${user.id})?`);
await msg.say(`Are you sure you want to hackban ${user.tag} (${user.id})?`);
const msgs = await msg.channel.awaitMessages(res => res.author.id === msg.author.id, {
max: 1,
time: 30000
@@ -56,29 +52,8 @@ module.exports = class HackbanCommand extends Command {
reason: `${msg.author.tag}: ${reason}`
});
} catch (err) {
return msg.say(`Could not ban the user: \`${err.message}\``);
}
await msg.say(`Successfully banned ${user.tag}.`);
if (!modlogs || !modlogs.permissionsFor(this.client.user).has('SEND_MESSAGES')) {
return msg.say('Could not log the ban to the mod logs.');
} else if (modlogs.permissionsFor(this.client.user).has('EMBED_LINKS')) {
const embed = new MessageEmbed()
.setAuthor(msg.author.tag, msg.author.displayAvatarURL())
.setColor(0xA90000)
.setTimestamp()
.setDescription(stripIndents`
**Member:** ${user.tag} (${user.id})
**Action:** Hackban
**Reason:** ${reason}
`);
return modlogs.send({ embed });
} else {
return modlogs.send(stripIndents`
**Member:** ${user.tag} (${user.id})
**Action:** Hackban
**Reason:** ${reason}
**Moderator:** ${msg.author.tag}
`);
return msg.say(`Could not hackban the user: \`${err.message}\``);
}
return msg.say(`Successfully hackbanned ${user.tag}.`);
}
};