From b126596020d1a87541e3dd0a3c99913491a5c7f2 Mon Sep 17 00:00:00 2001 From: pokesudenk Date: Sat, 24 Feb 2018 11:50:46 -0500 Subject: warn command + fixed an error in the games --- bot.js | 2 +- commands/warn.js | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 commands/warn.js diff --git a/bot.js b/bot.js index e74747b..e73ff6d 100644 --- a/bot.js +++ b/bot.js @@ -11,7 +11,7 @@ function setGame() { const games = [ 'Pokemon', 'Catching things', - 'Finding pokemons', + 'Finding pokemon', 'Type p:help for help', ]; diff --git a/commands/warn.js b/commands/warn.js new file mode 100644 index 0000000..0e9e966 --- /dev/null +++ b/commands/warn.js @@ -0,0 +1,30 @@ +exports.run = (bot, msg, args) => { + if (!message.member.permissions.has("MANAGE_MESSAGES")) return message.channel.send(':warning: You cannot warn members due to your permission level.'); + let warnReason = args.slice(1); + var victim = message.mentions.users.first(); + + message.channel.send(`Successfully logged ${victim.user.tag}'s warning.`) + + bot.channels.find('name', 'logs').send( + new Discord.RichEmbed() + .setColor(0x00ae86) + .setTitle('Warning') + .addField('ID', victim.id, true) + .addField('Created Account', victim.user.createdAt, true) + .addField('Warning Reason', warnReason) + .setTimestamp() + .setFooter('Warned by: ' + message.author.user.tag, message.author.user.avatarURL) + ); + }; + + exports.conf = { + aliases: [], + guildOnly: true, + }; + + exports.help = { + name: 'warn', + description: 'Logs a warning to the user.', + category: 'Moderation', + }; + \ No newline at end of file -- cgit v1.2.3