You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.5 KiB
39 lines
1.5 KiB
const {Command} = require('../../lib.js')
|
|
const suggestionM = require('../../models/suggestion.js');
|
|
|
|
|
|
class suggest extends Command{
|
|
constructor(client){
|
|
super(client, {
|
|
name: 'suggest',
|
|
memberName: 'suggest',
|
|
aliases: ['suggestion'],
|
|
description: `You can suggest a command. Use the following format: !suggest COMMANDNAME ARGUMENTS -> ACTION `
|
|
|
|
})
|
|
}
|
|
async run(message, args)
|
|
{
|
|
console.log('Suggestion:', message.author.username, 'suggested', args);
|
|
if(args.length>0)
|
|
{
|
|
var suggestion = new suggestionM();
|
|
suggestion.authorID = message.author.id;
|
|
suggestion.authorName = message.author.username;
|
|
suggestion.authorPermissions = message.member.permissions.toArray();
|
|
suggestion.guildID = message.guildId;
|
|
suggestion.suggestion = message.content;
|
|
suggestion.save(err=>
|
|
{
|
|
if(err)console.error(err)
|
|
message.channel.send(`${message.author} your suggestion has been saved for future consideration, thank you.`);
|
|
})
|
|
}
|
|
else
|
|
{
|
|
message.channel.send(`${message.author} sent an empty suggestion. Use the command correctly by following the format: !suggest COMMANDNAME ARGUMENTS -> ACTION`);
|
|
}
|
|
|
|
}
|
|
}
|
|
module.exports = suggest; |