Auto-Aliases

This commit is contained in:
Daniel Odendahl Jr
2017-05-07 17:34:59 +00:00
parent 0a1bc41b26
commit 52e299b1b4
44 changed files with 83 additions and 89 deletions
+2 -4
View File
@@ -40,13 +40,11 @@ module.exports = class BanCommand extends Command {
if(!msg.channel.permissionsFor(this.client.user).has('BAN_MEMBERS'))
return msg.say('This Command requires the `Ban Members` Permission.');
const modlogs = msg.guild.channels.get(msg.guild.settings.get('modLog'));
if(!modlogs)
return msg.say('This Command requires a channel set with the `modchannel` command.');
if(!modlogs) return msg.say('This Command requires a channel set with the `modchannel` command.');
if(!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS'))
return msg.say('This Command requires the `Embed Links` Permission.');
const { member, reason } = args;
if(!member.bannable)
return msg.say('This member is not bannable. Perhaps they have a higher role than me?');
if(!member.bannable) return msg.say('This member is not bannable. Perhaps they have a higher role than me?');
try {
try {
await member.send(stripIndents`
+2 -4
View File
@@ -37,13 +37,11 @@ module.exports = class KickCommand extends Command {
if(!msg.channel.permissionsFor(this.client.user).has('KICK_MEMBERS'))
return msg.say('This Command requires the `Kick Members` Permission.');
const modlogs = msg.guild.channels.get(msg.guild.settings.get('modLog'));
if(!modlogs)
return msg.say('This Command requires a channel set with the `modchannel` command.');
if(!modlogs) return msg.say('This Command requires a channel set with the `modchannel` command.');
if(!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS'))
return msg.say('This Command requires the `Embed Links` Permission.');
const { member, reason } = args;
if(!member.kickable)
return msg.say('This member is not kickable. Perhaps they have a higher role than me?');
if(!member.kickable) return msg.say('This member is not kickable. Perhaps they have a higher role than me?');
try {
try {
await member.send(stripIndents`
+2 -4
View File
@@ -39,13 +39,11 @@ module.exports = class SoftbanCommand extends Command {
if(!msg.channel.permissionsFor(this.client.user).has('KICK_MEMBERS'))
return msg.say('This Command requires the `Kick Members` Permission.');
const modlogs = msg.guild.channels.get(msg.guild.settings.get('modLog'));
if(!modlogs)
return msg.say('This Command requires a channel set with the `modchannel` command.');
if(!modlogs) return msg.say('This Command requires a channel set with the `modchannel` command.');
if(!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS'))
return msg.say('This Command requires the `Embed Links` Permission.');
const { member, reason } = args;
if(!member.bannable)
return msg.say('This member is not bannable. Perhaps they have a higher role than me?');
if(!member.bannable) return msg.say('This member is not bannable. Perhaps they have a higher role than me?');
try {
try {
await member.send(stripIndents`
+2 -4
View File
@@ -44,14 +44,12 @@ module.exports = class UnbanCommand extends Command {
if(!msg.channel.permissionsFor(this.client.user).has('BAN_MEMBERS'))
return msg.say('This Command requires the `Ban Members` Permission.');
const modlogs = msg.guild.channels.get(msg.guild.settings.get('modLog'));
if(!modlogs)
return msg.say('This Command requires a channel set with the `modchannel` command.');
if(!modlogs) return msg.say('This Command requires a channel set with the `modchannel` command.');
if(!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS'))
return msg.say('This Command requires the `Embed Links` Permission.');
const { id, reason } = args;
const bans = await msg.guild.fetchBans();
if(!bans.has(id))
return msg.say('This ID is not in the Guild Banlist.');
if(!bans.has(id)) return msg.say('This ID is not in the Guild Banlist.');
const member = bans.get(id);
try {
await msg.guild.unban(member);
+1 -2
View File
@@ -35,8 +35,7 @@ module.exports = class WarnCommand extends Command {
async run(msg, args) {
const modlogs = msg.guild.channels.get(msg.guild.settings.get('modLog'));
if(!modlogs)
return msg.say('This Command requires a channel set with the `modchannel` command.');
if(!modlogs) return msg.say('This Command requires a channel set with the `modchannel` command.');
if(!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS'))
return msg.say('This Command requires the `Embed Links` Permission.');
const { member, reason } = args;