diff options
Diffstat (limited to 'commands/Moderation')
| -rw-r--r-- | commands/Moderation/ban.js | 23 | ||||
| -rw-r--r-- | commands/Moderation/interrogate.js | 15 | ||||
| -rw-r--r-- | commands/Moderation/jail.js | 15 | ||||
| -rw-r--r-- | commands/Moderation/kick.js | 15 | ||||
| -rw-r--r-- | commands/Moderation/lswarns.js | 17 | ||||
| -rw-r--r-- | commands/Moderation/purge.js | 13 | ||||
| -rw-r--r-- | commands/Moderation/setLogs.js | 13 | ||||
| -rw-r--r-- | commands/Moderation/setSuggestions.js | 44 | ||||
| -rw-r--r-- | commands/Moderation/softban.js | 29 | ||||
| -rw-r--r-- | commands/Moderation/timeout.js | 13 | ||||
| -rw-r--r-- | commands/Moderation/warn.js | 13 |
11 files changed, 51 insertions, 159 deletions
diff --git a/commands/Moderation/ban.js b/commands/Moderation/ban.js index 5974c53..b9ffa4d 100644 --- a/commands/Moderation/ban.js +++ b/commands/Moderation/ban.js @@ -3,18 +3,7 @@ * Ban: Plugin for PokeBot that performs moderation actions. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * Licensed under the Open Software License version 3.0 * * *************************************/ @@ -23,12 +12,16 @@ exports.run = async (bot, msg, args) => { if (!msg.guild.member(bot.user).hasPermission('BAN_MEMBERS')) return msg.reply('I don\'t have permission to ban members.'); const member = msg.mentions.members.first(); - if (!member) return await msg.reply('Who am I gonna ban?'); + if (!member) return await msg.reply('Who am I gonna ban? (Remember to @mention them)'); const reason = args.join(' ').slice(3 + member.user.id.length); await member.ban({ days: 7, reason: msg.author.tag + (reason ? ': ' + reason : '') }) - .catch(err => { msg.reply('There was an error.'); console.error(err.stack);}); - msg.channel.send(`Alright, I banned **${member.user.tag}**${(reason ? ` for the reason **${reason}**.` : '.')}`); + .catch(err => { + msg.reply('There was an error.'); return console.error(err.stack); + }) + .then(() => { + msg.channel.send(`Alright, I banned **${member.user.tag}**${(reason ? ` for the reason **${reason}**.` : '.')}`); + }); const { RichEmbed } = require('discord.js'); try { diff --git a/commands/Moderation/interrogate.js b/commands/Moderation/interrogate.js index 8fa9708..821c93a 100644 --- a/commands/Moderation/interrogate.js +++ b/commands/Moderation/interrogate.js @@ -3,18 +3,7 @@ * Interrogate: Plugin for PokeBot that allows the staff to investigate the fish :cod: * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * Licensed under the Open Software License version 3.0 * * *************************************/ @@ -25,7 +14,7 @@ exports.run = async (bot, msg) => { if (!msg.guild.member(bot.user).hasPermission('MANAGE_ROLES')) return msg.reply('I cannot interrogate anyone.'); const member = msg.mentions.members.first(); - if (!member) return await msg.reply('Who do I interrogate?'); + if (!member) return await msg.reply('Who shall I interrogate? (Remember to @mention them)'); member.addRole(msg.guild.roles.find('name', 'Interrogation')); diff --git a/commands/Moderation/jail.js b/commands/Moderation/jail.js index 9923540..2dc50cf 100644 --- a/commands/Moderation/jail.js +++ b/commands/Moderation/jail.js @@ -3,18 +3,7 @@ * Jail: Plugin for PokeBot that punishes bad boys.. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * Licensed under the Open Software License version 3.0 * * *************************************/ @@ -25,7 +14,7 @@ exports.run = async (bot, msg) => { if (!msg.guild.member(bot.user).hasPermission('MANAGE_ROLES')) return msg.reply('I cannot put anyone in jail.'); const member = msg.mentions.members.first(); - if (!member) return await msg.reply('Who do I put in jail?'); + if (!member) return await msg.reply('Who do I put in jail? (Remember to @mention them)'); member.addRole(msg.guild.roles.find('name', 'Jail')); diff --git a/commands/Moderation/kick.js b/commands/Moderation/kick.js index c9d1d24..174e867 100644 --- a/commands/Moderation/kick.js +++ b/commands/Moderation/kick.js @@ -3,18 +3,7 @@ * Kick: Plugin for PokeBot that performs moderation actions. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * Licensed under the Open Software License version 3.0 * * *************************************/ @@ -23,7 +12,7 @@ exports.run = async (bot, msg, args) => { if (!msg.guild.member(bot.user).hasPermission('KICK_MEMBERS')) return msg.reply('I don\'t have permission to kick members.'); const member = msg.mentions.members.first(); - if (!member) return await msg.reply('Who am I gonna kick?'); + if (!member) return await msg.reply('Who am I gonna kick? (Remember to @mention them)'); const reason = args.join(' ').slice(3 + member.user.id.length); await member.kick(msg.author.tag + ': ' + (reason ? ': ' + reason : '')) diff --git a/commands/Moderation/lswarns.js b/commands/Moderation/lswarns.js index 7d03c12..732184d 100644 --- a/commands/Moderation/lswarns.js +++ b/commands/Moderation/lswarns.js @@ -3,18 +3,7 @@ * List Warns: Plugin for PokeBot that performs moderation actions. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * Licensed under the Open Software License version 3.0 * * *************************************/ @@ -23,11 +12,11 @@ exports.run = async (bot, msg) => { const { RichEmbed } = require('discord.js'); const warns = await db.fetch(`warns_${msg.guild.id}_${msg.author.id}`); - if (!warns) return await msg.reply('Yay! You have no warns.'); + if (!warns) return await msg.reply('You don\'t have any warnings in this server.'); const embed = new RichEmbed() .setTitle('Warns'); for (let i = 0; i < warns.count; i++) { - embed.addField('Warning #' + i+1, warns.reasons[i]); + embed.addField('Warning #' + i + 1, warns.reasons[i]); } msg.channel.send({ embed }); }; diff --git a/commands/Moderation/purge.js b/commands/Moderation/purge.js index 256dca8..6ce557c 100644 --- a/commands/Moderation/purge.js +++ b/commands/Moderation/purge.js @@ -3,18 +3,7 @@ * Purge: Plugin for PokeBot that performs moderation actions. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Moderation/setLogs.js b/commands/Moderation/setLogs.js index a354085..8ae50ea 100644 --- a/commands/Moderation/setLogs.js +++ b/commands/Moderation/setLogs.js @@ -3,18 +3,7 @@ * Set Log: Plugin for PokeBot that performs moderation actions. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Moderation/setSuggestions.js b/commands/Moderation/setSuggestions.js index 2fcd880..2a9d1bd 100644 --- a/commands/Moderation/setSuggestions.js +++ b/commands/Moderation/setSuggestions.js @@ -3,35 +3,23 @@ * Set Suggestions: Plugin for PokeBot that performs moderation actions. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * Licensed under the Open Software License version 3.0 * * *************************************/ exports.run = async (bot, msg, args) => { - if (!msg.member.hasPermission('MANAGE_MESSAGES')) return msg.reply('You don\'t have permission to manage messages.'); - bot.plugins.settings.setStr('suggestions', args[0], msg.guild.id); - msg.reply('Alright, I have set the suggestions channel to ' + args[0]); - }; - - exports.conf = { - aliases: [], - guildOnly: true, - }; - - exports.help = { - name: 'setSuggestions', - description: 'Set\'s the Suggestions Channel.', - usage: '<channelID>', - }; -
\ No newline at end of file + if (!msg.member.hasPermission('MANAGE_MESSAGES')) return msg.reply('You don\'t have permission to manage messages.'); + bot.plugins.settings.setStr('suggestions', args[0], msg.guild.id); + msg.reply('Alright, I have set the suggestions channel to ' + args[0]); +}; + +exports.conf = { + aliases: [], + guildOnly: true, +}; + +exports.help = { + name: 'setSuggestions', + description: 'Set\'s the Suggestions Channel.', + usage: '<channelID>', +}; diff --git a/commands/Moderation/softban.js b/commands/Moderation/softban.js index 2db58ec..dd5b4a9 100644 --- a/commands/Moderation/softban.js +++ b/commands/Moderation/softban.js @@ -3,18 +3,7 @@ * SoftBan: Plugin for PokeBot that performs moderation actions. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * Licensed under the Open Software License version 3.0 * * *************************************/ @@ -27,9 +16,19 @@ exports.run = async (bot, msg, args) => { const reason = args.join(' ').slice(3 + member.user.id.length); await member.ban({ days: 7, reason: msg.author.tag + ': ' + (reason ? reason : '') }) - .catch(err => { msg.reply('There was an error.'); console.error(err.stack);}); - await msg.guild.unban(member.user.id).catch(msg.reply('There was an error.')); - msg.channel.send(`Alright, I softbanned **${member.user.tag}**${(reason ? ` for the reason **${reason}**.` : '.')}`); + .catch(err => { + msg.reply('There was an error.'); + return console.error(err.stack); + }) + .then(() => { + msg.channel.send(`Alright, I softbanned **${member.user.tag}**${(reason ? ` for the reason **${reason}**.` : '.')}`); + }); + await msg.guild.unban(member.user.id) + .catch(err => { + msg.reply('There was an error.'); + return console.error(err.stack); + }); + const { RichEmbed } = require('discord.js'); try { const embed = new RichEmbed() diff --git a/commands/Moderation/timeout.js b/commands/Moderation/timeout.js index af9c713..2e479ac 100644 --- a/commands/Moderation/timeout.js +++ b/commands/Moderation/timeout.js @@ -3,18 +3,7 @@ * Time Out: Plugin for PokeBot that punishes bad boys.. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * Licensed under the Open Software License version 3.0 * * *************************************/ diff --git a/commands/Moderation/warn.js b/commands/Moderation/warn.js index 2599c0f..1dd0410 100644 --- a/commands/Moderation/warn.js +++ b/commands/Moderation/warn.js @@ -3,18 +3,7 @@ * Warn: Plugin for PokeBot that performs moderation actions. * Copyright (C) 2018 TheEdge, jtsshieh, Alee * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * Licensed under the Open Software License version 3.0 * * *************************************/ |
