aboutsummaryrefslogtreecommitdiff
path: root/commands/Moderation/timeout.js
diff options
context:
space:
mode:
authorjtsshieh <jtsshieh@outlook.com>2018-03-09 20:45:14 -0500
committerjtsshieh <jtsshieh@outlook.com>2018-03-09 20:45:14 -0500
commit54505ce7eb1aee434a19c5c5bd30f4f7b888c407 (patch)
treee60ea8675570d4a76cf756abdef282d01b98df8d /commands/Moderation/timeout.js
parent0575a6687efd388220f8e83c5983ce1d972bc966 (diff)
parent4d253ab491041e147e9943d8820ba06f611df2d5 (diff)
downloadPokeBot-54505ce7eb1aee434a19c5c5bd30f4f7b888c407.tar.gz
PokeBot-54505ce7eb1aee434a19c5c5bd30f4f7b888c407.tar.bz2
PokeBot-54505ce7eb1aee434a19c5c5bd30f4f7b888c407.zip
Merge branch 'master' of https://github.com/PokeWorld/PokeBot
Diffstat (limited to 'commands/Moderation/timeout.js')
-rw-r--r--commands/Moderation/timeout.js40
1 files changed, 40 insertions, 0 deletions
diff --git a/commands/Moderation/timeout.js b/commands/Moderation/timeout.js
index b78e059..c74ecf0 100644
--- a/commands/Moderation/timeout.js
+++ b/commands/Moderation/timeout.js
@@ -18,6 +18,7 @@
*
* *************************************/
+<<<<<<< HEAD
exports.run = async (bot, msg) => {
if (!msg.member.hasPermission('BAN_MEMBERS')) return msg.reply('You don\'t have permission to put members in time-out..');
if (!msg.guild.member(bot.user).hasPermission('MANAGE_ROLES')) return msg.reply('I cannot put anyone in time-out.');
@@ -55,3 +56,42 @@ exports.help = {
description: 'Put a user in time-out',
usage: '@user',
};
+=======
+exports.run = async (bot, msg, args) => {
+ if (!msg.member.hasPermission('BAN_MEMBERS')) return msg.reply('You don\'t have permission to put members in time-out..');
+ if (!msg.guild.member(bot.user).hasPermission('MANAGE_ROLES')) return msg.reply('I cannot put anyone in time-out.');
+
+ const member = msg.mentions.members.first();
+ if (!member) return await msg.reply('Who do I put in time-out?');
+
+ member.addRole(msg.guild.roles.find('name', 'Timeout'));
+
+ const { RichEmbed } = require('discord.js');
+ try {
+ const embed = new RichEmbed()
+ .setColor(0x00ae86)
+ .setAuthor(member.user.tag, member.user.avatarURL)
+ .setTitle(`Time Out: **${member.user.tag}**`)
+ .setDescription(`*${member.user.tag}* was placed in time-out by *${msg.author.tag}*.`)
+ .addField('Moderator', msg.author.tag)
+ .setTimestamp()
+ .setFooter(`${msg.author.tag} put ${member.user.tag} in time-out.`, msg.author.avatarURL);
+ msg.guild.channels.find('name', 'logs').send({ embed });
+ }
+ catch (err) {
+ console.error(err.stack);
+ }
+ };
+
+ exports.conf = {
+ aliases: [],
+ guildOnly: true,
+ };
+
+ exports.help = {
+ name: 'timeout',
+ description: 'Put a user in time-out',
+ usage: '@user',
+ };
+
+>>>>>>> 4d253ab491041e147e9943d8820ba06f611df2d5