forked from Supositware/Haha-Yes
see whitelisted word
Signed-off-by: loicbersier <loic.bersier1@gmail.com>
This commit is contained in:
parent
2ef3a1d974
commit
79743e2b13
1 changed files with 41 additions and 0 deletions
41
commands/utility/seewhitelistedword.js
Normal file
41
commands/utility/seewhitelistedword.js
Normal file
|
@ -0,0 +1,41 @@
|
|||
const { Command } = require('discord-akairo');
|
||||
const whitelistWord = require('../../models').whitelistWord;
|
||||
|
||||
|
||||
class seewhitelistedCommand extends Command {
|
||||
constructor() {
|
||||
super('seewhitelistedword', {
|
||||
aliases: ['seewhitelistedword', 'seewhitelisted'],
|
||||
category: 'utility',
|
||||
clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'],
|
||||
channel: 'guild',
|
||||
description: {
|
||||
content: 'Show the list of banned word',
|
||||
usage: '',
|
||||
examples: ['']
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async exec(message) {
|
||||
const WhitelistWord = await whitelistWord.findAll({where: {serverID: message.guild.id}});
|
||||
let list;
|
||||
for (let i = 0; i < WhitelistWord.length; i++) {
|
||||
if (i == 0) {
|
||||
list = WhitelistWord[i].get('word');
|
||||
} else {
|
||||
list = list + ' | ' + WhitelistWord[i].get('word');
|
||||
}
|
||||
}
|
||||
|
||||
if (list == undefined) return message.channel.send('No word are whitelisted yet.');
|
||||
|
||||
const Embed = this.client.util.embed()
|
||||
.setColor(message.member ? message.member.displayHexColor : 'NAVY')
|
||||
.setTitle('List of whitelisted words')
|
||||
.setDescription(list);
|
||||
|
||||
return message.channel.send(Embed);
|
||||
}
|
||||
}
|
||||
module.exports = seewhitelistedCommand;
|
Loading…
Reference in a new issue