Installation
Current stable version: 1.0
$ npm install tabbymusicmodule
Usage
const prefix = '!';
const music = require('tabbymusicmodule');
const manager = new music({
ytapi: 'YouTube API token'
})
client.on('message', (msg) => {
if(msg.author.bot) return;
if(msg.content.startsWith(`${prefix}play`)){
let player;
if(!manager.getPlayer(msg.guild.id)){
player = manager.createPlayer({
voiceChannel: msg.member.voice.channel,
textChannel: msg.channel,
})
.on('startedPlaying', (track) => {
player.textChannel.send(`Now playing **${track.title}**`);
})
player.play(msg.content.split(' ').slice(1).join(' '));
}else{
player = manager.getPlayer(msg.guild.id);
player.play(msg.content.split(' ').slice(1).join(' '));
}
}
})