PokeBot/commands/Moderation/lswarns.js

33 lines
892 B
JavaScript
Raw Normal View History

/** **************************************
*
2018-03-09 22:09:54 -05:00
* List Warns: Plugin for PokeBot that performs moderation actions.
* Copyright (C) 2018 TheEdge, jtsshieh, Alee
*
2018-03-31 21:45:52 -04:00
* Licensed under the Open Software License version 3.0
*
* *************************************/
exports.run = async (bot, msg) => {
const db = require('quick.db');
const { RichEmbed } = require('discord.js');
2018-03-12 21:57:11 -04:00
const warns = await db.fetch(`warns_${msg.guild.id}_${msg.author.id}`);
2018-04-05 19:17:23 -04:00
if (!warns) return await msg.reply('You don\'t have any warnings in this server.');
const embed = new RichEmbed()
.setTitle('Warns');
2018-03-12 21:57:11 -04:00
for (let i = 0; i < warns.count; i++) {
2018-04-05 19:17:23 -04:00
embed.addField('Warning #' + i + 1, warns.reasons[i]);
}
msg.channel.send({ embed });
};
exports.conf = {
aliases: [],
guildOnly: true,
};
exports.help = {
name: 'lswarns',
description: 'Shows all the warnings a user has.',
};