2019-01-01 03:49:09 +01:00
|
|
|
const { Command } = require('discord-akairo');
|
|
|
|
const fs = require('fs');
|
|
|
|
|
|
|
|
class StarBoardCommand extends Command {
|
2019-01-02 08:09:45 +01:00
|
|
|
constructor() {
|
|
|
|
super('starboard', {
|
|
|
|
aliases: ['starboard'],
|
|
|
|
category: 'admin',
|
|
|
|
channelRestriction: 'guild',
|
2019-01-12 17:00:36 +01:00
|
|
|
userPermissions: ['MANAGE_CHANNELS'],
|
2019-02-14 18:44:21 +01:00
|
|
|
args: [
|
|
|
|
{
|
|
|
|
id: 'emote',
|
|
|
|
type: 'string',
|
|
|
|
default: '🌟'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 'count',
|
|
|
|
type: 'integer',
|
|
|
|
default: '4'
|
|
|
|
}
|
|
|
|
],
|
2019-01-02 08:09:45 +01:00
|
|
|
description: {
|
|
|
|
content: 'Set starboard',
|
|
|
|
usage: '[]',
|
|
|
|
examples: ['']
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2019-01-01 03:49:09 +01:00
|
|
|
|
2019-02-14 18:44:21 +01:00
|
|
|
async exec(message, args) {
|
2019-01-02 08:09:45 +01:00
|
|
|
let starboardChannel = message.channel.id;
|
2019-01-01 03:49:09 +01:00
|
|
|
|
2019-02-14 18:44:21 +01:00
|
|
|
fs.writeFile(`./board/star${message.guild.id}.json`, `{"starboard": "${starboardChannel}", "emote": "${args.emote}", "count": "${args.count}"}`, function (err) {
|
2019-01-02 08:09:45 +01:00
|
|
|
if (err) {
|
2019-02-14 18:44:21 +01:00
|
|
|
console.log(err);
|
2019-01-02 08:09:45 +01:00
|
|
|
}
|
|
|
|
});
|
2019-01-02 10:48:26 +01:00
|
|
|
|
2019-02-14 18:44:21 +01:00
|
|
|
return message.channel.send(`This channel have been set as the starboard with ${args.emote} with the minium of ${args.count}`);
|
2019-01-02 08:09:45 +01:00
|
|
|
}
|
2019-01-01 03:49:09 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = StarBoardCommand;
|