This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { readdirSync } = require("fs") | |
module.exports = (client) => { | |
const load = dirs => { | |
const commands = readdirSync(`./commands/${dirs}/`).filter(d => d.endsWith('.js')); | |
for (let file of commands) { | |
let pull = require(`../commands/${dirs}/${file}`); | |
client.commands.set(pull.config.name, pull); | |
if (pull.config.aliases) pull.config.aliases.forEach(a => client.aliases.set(a, pull.config.name)); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = (bot) => { | |
bot.playCommand = (message, args) => { | |
const [song] = await bot.getSongs(args[0]); | |
const voiceChannel = message.member.voiceChannelID | |
if (!song) return message.channel.send("No songs found. try again!"); | |
if (!voiceChannel) return message.channel.send("You need to be in a voice channel to play music.") | |
const player = await lavalink.join({ | |
guild: message.guild.id, |