Huge Modification to Code

This commit is contained in:
Daniel Odendahl Jr
2017-03-21 19:20:47 +00:00
parent 65bf037068
commit d49fe32bf6
100 changed files with 1541 additions and 2049 deletions
+12 -10
View File
@@ -1,10 +1,15 @@
const commando = require('discord.js-commando');
const banlist = require('./banlist.json');
class ContactCommand extends commando.Command {
module.exports = class ContactCommand extends commando.Command {
constructor(Client){
super(Client, {
name: 'contact',
name: 'contact',
aliases: [
'suggest',
'report',
'bug'
],
group: 'botinfo',
memberName: 'contact',
description: 'Report bugs or request new features. (;contact Fix this command!)',
@@ -12,20 +17,17 @@ class ContactCommand extends commando.Command {
});
}
async run(message, args) {
async run(message) {
if(message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission('SEND_MESSAGES')) return;
if(!message.channel.permissionsFor(this.client.user).hasPermission('READ_MESSAGES')) return;
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log("[Command] " + message.content);
let banid = message.author.id;
if (message.author.id === banlist.banned[banid]) {
let banID = message.author.id;
if (message.author.id === banlist.banned[banID]) {
message.channel.send("Sorry, you've been banned from using this command.");
} else {
this.client.users.get('242699360352206850').send("**" + message.author.username + '#' + message.author.discriminator + " (" + message.author.id + ")" + ":**\n" + message.content.split(" ").slice(1).join(" "));
message.channel.send('Message Sent! Thanks for your support!');
}
}
}
module.exports = ContactCommand;
};