JaBa/commands/Music/clips.js

42 lines
1,017 B
JavaScript
Raw Normal View History

const Command = require("../../base/Command.js"),
Discord = require("discord.js"),
fs = require("fs");
class Clips extends Command {
2021-12-26 19:29:37 +05:00
constructor(client) {
super(client, {
name: "clips",
dirname: __dirname,
enabled: true,
guildOnly: true,
aliases: [],
memberPermissions: [],
2021-12-26 19:29:37 +05:00
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
nsfw: false,
ownerOnly: false,
cooldown: 2000
});
}
2021-12-26 19:29:37 +05:00
async run(message, args, data) {
fs.readdir("./clips", function (err, files) {
if (err) return console.log("Unable to read directory: " + err);
let clips = [];
2021-12-26 19:29:37 +05:00
files.forEach(function (file) {
clips.push(file.substring(0, file.length - 4));
});
const embed = new Discord.MessageEmbed()
2021-12-13 17:25:08 +05:00
.setTitle(message.translate("music/clips:EMBED_TITLE"))
.setDescription(clips.join("\n"))
.setColor(data.config.embed.color)
2022-01-03 23:20:33 +05:00
.setFooter({ text: data.config.embed.footer })
.setTimestamp();
message.channel.send({ embeds: [embed] });
});
}
};
module.exports = Clips;