Files
xiao/commands/settings/starboard.js
T
Daniel Odendahl Jr 208652d270 Custom hasPermission
2017-05-28 02:30:06 +00:00

32 lines
953 B
JavaScript

const { Command } = require('discord.js-commando');
module.exports = class StarboardCommand extends Command {
constructor(client) {
super(client, {
name: 'starboard',
group: 'settings',
memberName: 'starboard',
description: 'Sets the channel for the starboard.',
guildOnly: true,
args: [
{
key: 'channel',
prompt: 'What is the channel you want to set as the starboard?',
type: 'channel'
}
]
});
}
hasPermission(msg) {
if (!msg.member.hasPermission('ADMINISTRATOR')) return 'You do not have the `Administrator` Permission.';
else return true;
}
run(msg, args) {
const { channel } = args;
msg.guild.settings.set('starboard', channel.id);
return msg.say(`Starboard set to ${channel.name}.`);
}
};