Haha-Yes/commands/utility/feedback.js

36 lines
1.2 KiB
JavaScript
Raw Normal View History

2018-09-27 15:22:36 +02:00
const { Command } = require('discord.js-commando');
const { feedbackChannel } = require('../../config.json');
2018-11-28 01:35:26 +01:00
const SelfReloadJSON = require('self-reload-json');
2018-12-05 00:52:21 +01:00
2018-10-02 19:48:49 +02:00
const fs = require('fs');
2018-10-01 16:17:33 +02:00
module.exports = class feedbackCommand extends Command {
2018-09-27 15:22:36 +02:00
constructor(client) {
super(client, {
name: 'feedback',
group: 'utility',
memberName: 'feedback',
2018-11-05 00:11:01 +01:00
description: `Send feedback ( if you abuse you will get blacklisted )`,
2018-10-11 15:46:55 +02:00
throttling: {
2018-10-12 15:28:09 +02:00
usages: 2,
2018-10-11 15:46:55 +02:00
duration: 60,
},
2018-09-27 15:22:36 +02:00
args: [
{
key: 'text',
2018-09-27 15:33:22 +02:00
prompt: 'What would you want to send as feedback?',
2018-09-27 15:22:36 +02:00
type: 'string',
}
]
});
}
async run(message, { text }) {
2018-12-05 00:57:44 +01:00
let blacklistJson = new SelfReloadJSON('DiscordBot/json/blacklist.json');
2018-11-28 01:35:26 +01:00
if(blacklistJson[message.author.id])
return blacklist(blacklistJson[message.author.id] , message)
2018-09-27 15:22:36 +02:00
const channel = this.client.channels.get(feedbackChannel);
2018-11-03 02:09:48 +01:00
channel.send(`from ${message.author.username} (${message.author.id}) : ${text}`);
2018-09-27 15:33:22 +02:00
message.say('Your feedback has been sent!');
2018-10-02 19:48:49 +02:00
}
2018-09-27 15:22:36 +02:00
};