String Changes, Don't register tons of defaults

This commit is contained in:
Daniel Odendahl Jr
2017-04-05 17:27:31 +00:00
parent f380a3ecbd
commit 332016ca5d
75 changed files with 225 additions and 265 deletions
+5 -5
View File
@@ -11,7 +11,7 @@ module.exports = class BanCommand extends commando.Command {
group: 'moderation',
memberName: 'ban',
description: 'Bans a user. (;ban @User being a jerk.)',
examples: [";ban @User being a jerk."],
examples: [';ban @User being a jerk.'],
guildOnly: true,
args: [{
key: 'member',
@@ -25,7 +25,7 @@ module.exports = class BanCommand extends commando.Command {
if (reason.length < 141) {
return true;
}
return "Please keep your reason under 140 characters.";
return 'Please keep your reason under 140 characters.';
}
}]
});
@@ -39,13 +39,13 @@ module.exports = class BanCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS', 'BAN_MEMBERS'])) return;
}
console.log(`[Command] ${message.content}`);
if (!message.guild.channels.exists("name", "mod_logs")) return message.say(":x: Error! Could not find the mod_logs channel! Please create it!");
if (!message.guild.channels.exists('name', 'mod_logs')) return message.say(':x: Error! Could not find the mod_logs channel! Please create it!');
const member = args.member;
const reason = args.reason;
if (!message.guild.member(member).bannable) return message.say(":x: Error! This member cannot be banned! Perhaps they have a higher role than me?");
if (!message.guild.member(member).bannable) return message.say(':x: Error! This member cannot be banned! Perhaps they have a higher role than me?');
try {
const banUser = await message.guild.member(member).ban();
const okHandMsg = await message.say(":ok_hand:");
const okHandMsg = await message.say(':ok_hand:');
const embed = new Discord.RichEmbed()
.setAuthor(`${message.author.username}#${message.author.discriminator}`, message.author.avatarURL)
.setColor(0xFF0000)
+5 -5
View File
@@ -8,7 +8,7 @@ module.exports = class KickCommand extends commando.Command {
group: 'moderation',
memberName: 'kick',
description: 'Kicks a user. (;kick @User being a jerk.)',
examples: [";kick @User being a jerk."],
examples: [';kick @User being a jerk.'],
guildOnly: true,
args: [{
key: 'member',
@@ -22,7 +22,7 @@ module.exports = class KickCommand extends commando.Command {
if (reason.length < 141) {
return true;
}
return "Please keep your reason under 140 characters.";
return 'Please keep your reason under 140 characters.';
}
}]
});
@@ -36,13 +36,13 @@ module.exports = class KickCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS', 'KICK_MEMBERS'])) return;
}
console.log(`[Command] ${message.content}`);
if (!message.guild.channels.exists("name", "mod_logs")) return message.say(":x: Error! Could not find the mod_logs channel! Please create it!");
if (!message.guild.channels.exists('name', 'mod_logs')) return message.say(':x: Error! Could not find the mod_logs channel! Please create it!');
const member = args.member;
const reason = args.reason;
if (!message.guild.member(member).bannable) return message.say(":x: Error! This member cannot be kicked! Perhaps they have a higher role than me?");
if (!message.guild.member(member).bannable) return message.say(':x: Error! This member cannot be kicked! Perhaps they have a higher role than me?');
try {
const kickUser = await message.guild.member(member).kick();
const okHandMsg = await message.say(":ok_hand:");
const okHandMsg = await message.say(':ok_hand:');
const embed = new Discord.RichEmbed()
.setAuthor(`${message.author.username}#${message.author.discriminator}`, message.author.avatarURL)
.setColor(0xFFA500)
+3 -3
View File
@@ -7,7 +7,7 @@ module.exports = class LockdownCommand extends commando.Command {
group: 'moderation',
memberName: 'lockdown',
description: 'Locks down the current server or removes a lockdown, which prevents non-roled members from speaking. (;lockdown start)',
examples: [";lockdown start", ";lockdown stop"],
examples: [';lockdown start', ';lockdown stop'],
guildOnly: true,
args: [{
key: 'type',
@@ -17,7 +17,7 @@ module.exports = class LockdownCommand extends commando.Command {
if (type.toLowerCase() === 'start' || type.toLowerCase() === 'stop') {
return true;
}
return "Please enter either start or stop.";
return 'Please enter either start or stop.';
}
}]
});
@@ -29,7 +29,7 @@ module.exports = class LockdownCommand extends commando.Command {
async run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['READ_MESSAGES', 'SEND_MESSAGES'])) return;
if (!message.channel.permissionsFor(this.client.user).hasPermission('ADMINISTRATOR')) return message.say(":x: Error! I don't have the Administrator permission! This is not given by default, as that's quite bad practice. Please give it to me to use the lockdown command!");
if (!message.channel.permissionsFor(this.client.user).hasPermission('ADMINISTRATOR')) return message.say(':x: Error! I don\'t have the Administrator permission! This is not given by default, as that\'s quite bad practice. Please give it to me to use the lockdown command!');
}
console.log(`[Command] ${message.content}`);
const type = args.type;
+3 -3
View File
@@ -15,7 +15,7 @@ module.exports = class PruneCommand extends commando.Command {
group: 'moderation',
memberName: 'prune',
description: 'Deletes a defined number of messages from the current channel, up to 99. (;prune 45)',
examples: [";prune 45"],
examples: [';prune 45'],
guildOnly: true,
throttling: {
usages: 1,
@@ -29,7 +29,7 @@ module.exports = class PruneCommand extends commando.Command {
if (count < 100 && count > 0) {
return true;
}
return "Too many or two few messages to delete. Limit 1-99.";
return 'Too many or two few messages to delete. Limit 1-99.';
}
}]
});
@@ -40,7 +40,7 @@ module.exports = class PruneCommand extends commando.Command {
async run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['READ_MESSAGES', 'MANAGE_MESSAGES'])) return;
if (!message.channel.permissionsFor(this.client.user).hasPermission(['READ_MESSAGES', 'MANAGE_MESSAGES', 'READ_MESSAGE_HISTORY'])) return;
}
console.log(`[Command] ${message.content}`);
const count = args.count + 1;
+5 -5
View File
@@ -11,7 +11,7 @@ module.exports = class UnbanCommand extends commando.Command {
group: 'moderation',
memberName: 'unban',
description: 'Unbans a user. (;unban USERID not being a jerk.)',
examples: [";unban USERID not being a jerk."],
examples: [';unban USERID not being a jerk.'],
guildOnly: true,
args: [{
key: 'memberID',
@@ -21,7 +21,7 @@ module.exports = class UnbanCommand extends commando.Command {
if (userID.length === 18) {
return true;
}
return "Invalid ID. Please enter the user you wish to unban's ID.";
return 'Invalid ID. Please enter the user you wish to unban\'s ID.';
}
}, {
key: 'reason',
@@ -31,7 +31,7 @@ module.exports = class UnbanCommand extends commando.Command {
if (reason.length < 141) {
return true;
}
return "Please keep your reason under 140 characters.";
return 'Please keep your reason under 140 characters.';
}
}]
});
@@ -45,7 +45,7 @@ module.exports = class UnbanCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS', 'BAN_MEMBERS'])) return;
}
console.log(`[Command] ${message.content}`);
if (!message.guild.channels.exists("name", "mod_logs")) return message.say(":x: Error! Could not find the mod_logs channel! Please create it!");
if (!message.guild.channels.exists('name', 'mod_logs')) return message.say(':x: Error! Could not find the mod_logs channel! Please create it!');
const memberID = args.memberID;
const reason = args.reason;
const bans = await message.guild.fetchBans();
@@ -53,7 +53,7 @@ module.exports = class UnbanCommand extends commando.Command {
const unbanUserObj = await bans.get(memberID);
try {
const unbanUser = await message.guild.unban(unbanUserObj);
const okHandMsg = await message.say(":ok_hand:");
const okHandMsg = await message.say(':ok_hand:');
const embed = new Discord.RichEmbed()
.setAuthor(`${message.author.username}#${message.author.discriminator}`, message.author.avatarURL)
.setColor(0x00AE86)
+4 -4
View File
@@ -8,7 +8,7 @@ module.exports = class WarnCommand extends commando.Command {
group: 'moderation',
memberName: 'warn',
description: 'Warns a user. (;warn @User being a jerk)',
examples: [";warn @User being a jerk."],
examples: [';warn @User being a jerk.'],
guildOnly: true,
args: [{
key: 'member',
@@ -22,7 +22,7 @@ module.exports = class WarnCommand extends commando.Command {
if (reason.length < 141) {
return true;
}
return "Please keep your reason under 140 characters.";
return 'Please keep your reason under 140 characters.';
}
}]
});
@@ -38,9 +38,9 @@ module.exports = class WarnCommand extends commando.Command {
console.log(`[Command] ${message.content}`);
const userToWarn = args.member;
const reason = args.reason;
if (!message.guild.channels.exists("name", "mod_logs")) return message.say(":x: Error! Could not find the mod_logs channel! Please create it!");
if (!message.guild.channels.exists('name', 'mod_logs')) return message.say(':x: Error! Could not find the mod_logs channel! Please create it!');
try {
const okHandMsg = await message.say(":ok_hand:");
const okHandMsg = await message.say(':ok_hand:');
const embed = new Discord.RichEmbed()
.setAuthor(`${message.author.username}#${message.author.discriminator}`, message.author.avatarURL)
.setColor(0xFFFF00)