1
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Haha-Yes/commands/admin/starboard.js

44 lines
995 B
JavaScript

const { Command } = require('discord-akairo');
const fs = require('fs');
class StarBoardCommand extends Command {
constructor() {
super('starboard', {
aliases: ['starboard'],
category: 'admin',
channelRestriction: 'guild',
userPermissions: ['MANAGE_CHANNELS'],
args: [
{
id: 'emote',
type: 'string',
default: '🌟'
},
{
id: 'count',
type: 'integer',
default: '4'
}
],
description: {
content: 'Set starboard',
usage: '[]',
examples: ['']
}
});
}
async exec(message, args) {
let starboardChannel = message.channel.id;
fs.writeFile(`./board/star${message.guild.id}.json`, `{"starboard": "${starboardChannel}", "emote": "${args.emote}", "count": "${args.count}"}`, function (err) {
if (err) {
console.log(err);
}
});
return message.channel.send(`This channel have been set as the starboard with ${args.emote} with the minium of ${args.count}`);
}
}
module.exports = StarBoardCommand;