tabbymusicmodule

1.0.0 • Public • Published

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(' '));
        }
    }
})

Readme

Keywords

none

Package Sidebar

Install

npm i tabbymusicmodule

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

8.96 kB

Total Files

8

Last publish

Collaborators

  • heges