Starboard

This commit is contained in:
Daniel Odendahl Jr
2017-05-23 01:11:14 +00:00
parent 3c98fad04d
commit 4ee80dd9d9
7 changed files with 55 additions and 2 deletions
+2
View File
@@ -18,11 +18,13 @@ module.exports = class SettingListCommand extends Command {
const memberLog = msg.guild.settings.get('memberLog', false);
const singleRole = msg.guild.settings.get('singleRole', false);
const joinRole = msg.guild.settings.get('joinRole', false);
const starboard = msg.guild.settings.get('starboard', false);
return msg.say(stripIndents`
**Prefix:** ${msg.guild.commandPrefix}
**Invite Guard:** ${msg.guild.settings.get('inviteGuard', false)}
**Staff Role:** ${staffRole ? (msg.guild.roles.has(staffRole) ? msg.guild.roles.get(staffRole).name : 'Missing') : 'None'}
**Mod Channel:** ${modLog ? (msg.guild.channels.has(modLog) ? msg.guild.channels.get(modLog).name : 'Missing') : 'None'}
**Starboard:** ${starboard ? (msg.guild.channels.has(starboard) ? msg.guild.channels.get(starboard).name : 'Missing') : 'None'}
**Join Role:** ${joinRole ? (msg.guild.roles.has(joinRole) ? msg.guild.roles.get(joinRole).name : 'Missing') : 'None'}
**Member Channel:** ${memberLog ? (msg.guild.channels.has(memberLog) ? msg.guild.channels.get(memberLog).name : 'Missing') : 'None'}
**Join Message:** ${msg.guild.settings.get('joinMsg', 'Welcome <user>! (Default)')}
+30
View File
@@ -0,0 +1,30 @@
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) {
return msg.member.hasPermission('ADMINISTRATOR');
}
run(msg, args) {
const { channel } = args;
msg.guild.settings.set('starboard', channel.id);
return msg.say(`Starboard set to ${channel.name}.`);
}
};