mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-26 14:19:11 +02:00
args and more
This commit is contained in:
+14
-12
@@ -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];
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user