args and more

This commit is contained in:
Daniel Odendahl Jr
2017-03-25 04:16:27 +00:00
parent 8dd6ec1f9b
commit e2a4a92990
82 changed files with 1089 additions and 1021 deletions
+14 -12
View File
@@ -14,24 +14,26 @@ module.exports = class ContactCommand extends commando.Command {
group: 'botinfo',
memberName: 'contact',
description: 'Report bugs or request new features. (;contact Fix this command!)',
examples: [';contact Fix this command!']
examples: [';contact Fix this command!'],
args: [{
key: 'report',
prompt: 'What would you like to report?',
type: 'string'
}]
});
}
hasPermission(msg) {
return !banlist.banned[msg.author.id];
}
run(message) {
async run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let banID = message.author.id;
let messageToReport = message.content.split(" ").slice(1).join(" ");
if (message.author.id === banlist.banned[banID]) {
return message.channel.send("Sorry, you've been banned from using this command.");
}
else if (!messageToReport) {
return message.channel.send(':x: Error! Please do not report nothing!');
}
this.client.users.get(config.owner).send(`**${message.author.username}#${message.author.discriminator} (${message.author.id}):**\n${messageToReport}`);
return message.channel.send('Message Sent! Thanks for your support!');
let messageToReport = args.report;
let reportedMsg = await this.client.users.get(config.owner).send(`**${message.author.username}#${message.author.discriminator} (${message.author.id}):**\n${messageToReport}`);
let successMsg = await message.channel.send('Message Sent! Thanks for your support!');
return [reportedMsg, successMsg];
}
};