Catalog npm
Back to packageRELEASE DETAILS

1.1.2

npm

2pg-music

Discord.js music used for 2PG

discorddiscord musicdiscord.js music
Published5 Nov 2020
Direct dependencies6
Transitive dependenciesNot calculated

README

Current package documentation

2PG Music

Simple music module, built with TypeScript, used by 2PG.

Docs - https://theadamjr.github.io/2pg-music

Example

npm i -S 2pg-music discord.js

ES6:

import { Client } from 'discord.js';
import { MusicClient } from '2pg-music';

const music = new MusicClient();
const bot = new Client();

music.on('trackStart', ({ textChannel }, track) => textChannel?.send(`\`${track.title}\` - **${track.requestor}** started.`));

bot.on('message', async (msg) => {
  if (msg.author.bot) return;
  
  if (msg.content === '.play') {
    const player = getPlayer(msg);
    await player.play('discord bot dashboard intro', { member: msg.member });
  }
});

function getPlayer(msg) {
  return music.get(msg.guild.id)
    ?? music.create({
      voiceChannel: msg.member.voice.channel,
      textChannel: msg.channel
    });
}

bot.login('<your_bot_token>');

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 6

Native requirements
6 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
@discordjs/opus
Environment
{
  "local_name": "@discordjs/opus",
  "alias": false,
  "peer_metadata": null
}
^0.3.3runtime
@types/yt-search
Environment
{
  "local_name": "@types/yt-search",
  "alias": false,
  "peer_metadata": null
}
^2.3.0runtime
discord-ytdl-core
Environment
{
  "local_name": "discord-ytdl-core",
  "alias": false,
  "peer_metadata": null
}
^4.1.3runtime
ffmpeg-static
Environment
{
  "local_name": "ffmpeg-static",
  "alias": false,
  "peer_metadata": null
}
^4.2.7runtime
yt-search
Environment
{
  "local_name": "yt-search",
  "alias": false,
  "peer_metadata": null
}
^2.4.1runtime
discord.js
Environment
{
  "local_name": "discord.js",
  "alias": false,
  "peer_metadata": null
}
^12.4.1development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-8svALf0z99iSc2E3w4RzSl4Z8DAFINEtdEy76HA2Fnj2lFUj/DrTOpmX6F0SAfNaci5JX0N59a8iNUEKeQBmtQ==",
  "shasum": "b690e8a47e5d5990563b31a61df5b4c28f811d03",
  "tarball": "https://registry.npmjs.org/2pg-music/-/2pg-music-1.1.2.tgz",
  "fileCount": 45,
  "unpackedSize": 408957,
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpC9BCRA9TVsSAnZWagAAgs4QAIX9wxO5cztO0h/x3HXX\nIJffl3dT7rz1z6LkrzkoZ8gdMBf2/P/aD9102i9ychMAZ0pJ6V1rbkltNdUw\nr2bBGQIpvFd+1iow/iP9gxumSRure3b+N2NVQFqvpIE9U1ApMVoDw4IxWxiI\nvJJk+fcbmyOPtsyjrlngp2s93TIQs1uIIvRq6zveawJI/DNGs5P6pCozFG3N\n7E2rUzWInogvScHTZ4dr0wtBi8sS6an2IjeDB13os5pMidsHXxeE+2kj+Ms+\njucb3FPoQxi+ftlARGnkp04QTwKN8wmTWAIf56nzPxuZqETosyWyFp2l5Zv2\nNDRPAz9AmYOSOpsn7bLInITNcAVrgADcxe3sG4krtZ9yCf7AKGH4MQfT7C5b\nbUG3F22S7iyCjUQ34+lyRWOqZKQF1yrVQ5xiYYQAlmFP8lMkjACJyliTpKlC\nPJ7X4agcMRs0NDmnF7sd8G4daojD0QhDGmi+zsRoMbSiB3GaJ5uklkXeKpDW\ne9ZwzazcMtENNWEMEAkjYe6FvWmvsqhXXfqsDQFQd36UQxvnZgvwc4wsWrnJ\nxGdxy4iPNgjVxl22SULc8tzslKDEY8I2+JslHy8wqt2bRp1+aJTlItYzkaOe\nNzhKJReRXCpTC4rOzrkJ3BAIyL4Ai8ES3SvqVBk0/kb8JvtXoMmn7rswC+Aq\n+pzg\r\n=r0hZ\r\n-----END PGP SIGNATURE-----\r\n",
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEUCICAkvwqSim4kcPqM/Ew9PMIZfAyTel6sFLuaM/K/Oa63AiEA7Kc/p/znOoWUYhBHdAaOJ3XOjDlVI/5qMa0k6xatLd0="
    }
  ]
}

Repository

PENDING
theadamjr/2pg-music

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:17 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:c7dd135a97560b2f7e2c41c49ee990ff70e23f6768d5ddd6064ce485a1fffc17

Other collected versions

1.1.14 Nov1.1.04 Nov1.0.94 Nov1.0.83 Nov1.0.73 Nov1.0.63 NovView all collected versions →