Skip to content

Instantly share code, notes, and snippets.

View Strandxo's full-sized avatar
🏠
Working on MenuDocs

Connor Moriarty Strandxo

🏠
Working on MenuDocs
View GitHub Profile
@Strandxo
Strandxo / functions
Last active November 1, 2019 10:46
Playing Music
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,
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));
};