Giter Site home page Giter Site logo

androz2091 / discord-player Goto Github PK

View Code? Open in Web Editor NEW
583.0 13.0 195.0 10.64 MB

🎧 Complete framework to simplify the implementation of music commands using discord.js v14

Home Page: https://discord-player.js.org/

License: MIT License

TypeScript 88.41% Shell 0.01% JavaScript 0.47% CSS 0.04% MDX 11.06%
discord-player music discord bot framework custom play queue-management youtube search

discord-player's Introduction

Discord Player

Discord Player is a robust framework for developing Discord Music bots using JavaScript and TypeScript. It is built on top of the discord-voip library and offers a comprehensive set of customizable tools, making it one of the most feature enrich framework in town.

downloadsBadge versionBadge discordBadge

Why Choose Discord Player?

  • Beginner-friendly with easy-to-understand features
  • TypeScript support
  • Offers hackable APIs.
  • Supports audio player sharing
  • Quick and easy setup process
  • Wide range of player management features
  • Offers 64+ built-in audio filter presets
  • Highly customizable according to your needs
  • Automatic queue management
  • Query caching support
  • Extensible sources through the Extractors API
  • Object-oriented design
  • Built-in stats tracker
  • Offers easy debugging methods
  • Out-of-the-box voice states handling
  • IP Rotation support
  • Easy serialization and deserialization

Installation

Before you start

Discord Player requires Discord.js 14.0 or higher. Please ensure that you have a compatible version by running npm list discord.js in your terminal. If you're using an earlier version, please update it. The discord.js Guide provides resources to assist you with the update process.

Main Library

$ npm install --save discord-player # main library
$ npm install --save @discord-player/extractor # extractors provider

Discord Player recognizes @discord-player/extractor and loads it automatically by default. Just invoke await player.extractors.loadDefault().

Opus Library

Since Discord only accepts opus packets, you need to install the opus library. Discord Player supports multiple opus libraries, such as:

Among these, mediaplex is the recommended library as it adds more functionalities to discord-player than just libopus interface. You can install opus libraries by running:

$ npm install --save mediaplex
# or
$ npm install --save @discordjs/opus
# or
$ npm install --save opusscript
# or
$ npm install --save @evan/opus
# or
$ npm install --save node-opus

FFmpeg or Avconv

FFmpeg or Avconv is required for media transcoding. You can obtain it from https://ffmpeg.org or via npm.

We do not recommend installing ffmpeg via npm because binaries pulled from npm is known to be unstable. It is recommended to install it from the official source.

$ npm install --save ffmpeg-static
# or
$ npm install --save @ffmpeg-installer/ffmpeg
# or
$ npm install --save @node-ffmpeg/node-ffmpeg-installer
# or
$ npm install --save ffmpeg-binaries

Use FFMPEG_PATH environment variable to load ffmpeg from custom path.

Streaming Library

YouTube streaming is not supported without installing one of the following package. If you want to add support for YouTube playback, you need to install a streaming library. This step is not needed if you do not plan on using youtube source.

$ npm install --save youtube-ext
# or
$ npm install --save play-dl
# or
$ npm install --save @distube/ytdl-core
# or
$ npm install --save yt-stream
# or
$ npm install --save ytdl-core

We recommend using youtube-ext for better performance.

Once you have completed these installations, let's proceed with writing a simple music bot.

Setup

Let's create a main player instance. This instance handles and keeps track of all the queues and its components.

const { Player } = require('discord-player');

const client = new Discord.Client({
    // Make sure you have 'GuildVoiceStates' intent enabled
    intents: ['GuildVoiceStates' /* Other intents */]
});

// this is the entrypoint for discord-player based application
const player = new Player(client);

// Now, lets load all the default extractors, except 'YouTubeExtractor'. You can remove the filter if you want to load all the extractors.
await player.extractors.loadDefault((ext) => ext !== 'YouTubeExtractor');

Discord Player is mostly events based. It emits different events based on the context and actions. Let's add a basic event listener to notify the user when a track starts to play:

// this event is emitted whenever discord-player starts to play a track
player.events.on('playerStart', (queue, track) => {
    // we will later define queue.metadata object while creating the queue
    queue.metadata.channel.send(`Started playing **${track.title}**!`);
});

Let's move on to the command part. You can define the command as per your requirements. We will only focus on the command part:

const { useMainPlayer } = require('discord-player');

export async function execute(interaction) {
    const player = useMainPlayer();
    const channel = interaction.member.voice.channel;
    if (!channel) return interaction.reply('You are not connected to a voice channel!'); // make sure we have a voice channel
    const query = interaction.options.getString('query', true); // we need input/query to play

    // let's defer the interaction as things can take time to process
    await interaction.deferReply();

    try {
        const { track } = await player.play(channel, query, {
            nodeOptions: {
                // nodeOptions are the options for guild node (aka your queue in simple word)
                metadata: interaction // we can access this metadata object using queue.metadata later on
            }
        });

        return interaction.followUp(`**${track.title}** enqueued!`);
    } catch (e) {
        // let's return error if something failed
        return interaction.followUp(`Something went wrong: ${e}`);
    }
}

That's all it takes to build your own music bot. Please check out the Documentation for more features/functionalities.

Community Resources

Explore a curated list of resources built by the Discord Player community, including open-source music bots and extractors. Visit https://discord-player.js.org/showcase for more information.

discord-player's People

Contributors

416rehman avatar abish-desu avatar androz2091 avatar casperiv0 avatar crocross avatar dependabot-preview[bot] avatar dependabot[bot] avatar dongsu8142 avatar ewox07 avatar febkosq8 avatar greenscreen410 avatar hmes98318 avatar itsauric avatar klairm avatar lackypal avatar mariusbegby avatar maxtechnics avatar mirasaki avatar mittelblut9 avatar mylloon avatar nerdytechy avatar notghex avatar rizina avatar sayuriu avatar takejohn avatar tapshts avatar tasooneasia avatar thaddeuskkr avatar thomasthebro1 avatar twlite avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

discord-player's Issues

Suggestion: Add seek function

Good Evening

I really love this package, since it is too simple to make, I hope you add a seek function
Example: seek 1
So when I run this command, the player will seek the song to minute 1, and like this

another suggestion but not necessary but if it is easy to make, I hope you make it
the 2nd suggestion is to make a function to get the volume, instead of only adjusting the volume, you can see the current volume.

Thanks for reading

New README

Hey! I am currently in the process of rewriting the README for the Discord Player package so that it is up to date for everyone. Once I complete it, would you be happy for me to make a pull request with the new README?

Here is what I have so far:
image

Error while playing music

Cannot seem to play music shows the error mentioned below:
TypeError: Cannot convert "null" to int
TypeError: Cannot convert "null" to int
/rbd/pnpm-volume/ce908d90-1591-4e68-8e70-6fd0493443ea/node_modules/.registry.npmjs.org/opusscript/0.0.7/node_modules/opusscript/build/opusscript_native_wasm.js:8
var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}Module["arguments"]=[];Module["thisProgram"]="./this.program";Module["quit"]=function(status,toThrow){throw toThrow};Module["preRun"]=[];Module["postRun"]=[];var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_HAS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_HAS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_NODE=ENVIRONMENT_HAS_NODE&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMEN
abort(TypeError: Cannot convert "null" to int). Build with -s ASSERTIONS=1 for more info.

General Enhancements

Bugs

First off I wanted to say that I absolutely love this module. Writing music playback commands for discord bots can be incredibly hard/tedious, so thank you for taking the time to make this. With that said, I did notice a couple bugs

  • Trying to play a string of random characters (ex: player.play(msg.member.voice.channel, "ajhknmnbafca")) returns a console error, shown below.
(node:25360) UnhandledPromiseRejectionWarning: Not found
(node:25360) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:25360) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

This is not fixed by using .catch(), or even using the default code found in the readme. This might be an issue on my end, I'm not entirely sure

  • The way song duration is stored is a bit strange. As it is, I have to multiply by 10 to get ms, or divide by 10 to get seconds. Having duration stored as one or the other would be ideal compared to how it's currently stored

Suggestions

While using this module, I had a couple ideas on how it could be improved. All of my suggestions are possible with the current module and a bit of extra code, but adding them natively would greatly improve/simplify the user experience

  • player.setRepeatMode should be able to be toggled. Ex: player.setRepeatMode(msg.guild.id, toggle) instead of making you use true or false. This would remove the need to code a toggle manually

  • A built-in playskip function would be amazing. This can currently be accomplished by clearing the queue, adding the song, and skipping the current one

  • There should be a stopwatch-esque feature for the currently playing song. Basically it would be nice to be able to see how long the current song has been playing for

  • A search function is probably what I want the most. Returning the top 10 results for a search and allowing the user to choose between them would honestly be fantastic. I do understand that this could be hard to implement though

[ENHANCEMENT] Move from Youtube API to traditional web scraping

It is not feasible to use simple-youtube-api or the Youtube API because the daily quota exhausts pretty quickly.

With some googling around, I found out that each API call is not counted as one but has a cost associated with it. For example, the search endpoint has a 100 cost, so one query to that endpoint cost 100 from the daily quota.

With a playlist of 37 songs, I reached my daily quota after I queued the playlist 8 times during development. And that is on one guild, if a bot joins several guilds it will exhaust the quota pretty quick. So, instead of fetching results from the Youtube API, it's better if the library does some web scraping.

That way the developers wouldn't have to care about crossing the daily limits and I believe that's pretty much what other music bots on Discord are doing.

Add radios methods

Add something like:

client.player.playRadio(message.member.voice.channel, "nrj");
client.player.stopRadio(message.guild.id);
client.player.isPlayingRadio(message.guild.id);

This would be totally separate from the other methods (isPlaying() will return false if the player is playing radio).

Facing error with new update

(node:153) UnhandledPromiseRejectionWarning: voiceChannel must be type of VoiceChannel. value=673975005075341373 (node:153) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2) (node:153) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

When I use the play command bot throws that error.

my play command don't work

hello in my bot i have added a command "play"

let queue = await client.player.getQueue(message.guild.id).lenght;
if(!message.member.voiceChannel) return message.channel.send("❌ | Error: You're not in a voice channel !")
if(!args[0]) return message.channel.send("❌ | Error: please add a music name !")
if(queue > 30) return message.channel.send("🛑 | Error: you can't add more than 30 music, please subscribe to the premium to increase this limit")
if(client.player.isPlaying(message.guild.id)){

    let song = await client.player.addToQueue(message.guild.id, args[0]);

 const embedok = new Discord.RichEmbed()
.setDescription(`__**✅ Added to queue 🎶**__\n  » ${song.name}`)
.setAuthor(`requested by ${message.author.tag}`, message.author.avatarURL)
.setTimestamp()
message.channel.send(embedok)
} else {
    let song = await client.player.play(message.member.voiceChannel, args[0])
    const embedok1 = new Discord.RichEmbed()
    .setDescription(`__**✅ Now playing 🎶**__\n  » ${song.name}`)
    .setTimestamp()
    message.channel.send(embedok1)
}

but this don't work

Version 2 Suggestions

I have noticed that the development branch for discord-player has been receiving daily updates and important bug fixes recently, so I thought that I would throw in some new ideas.

  1. player.dumpQueue(guild) - Creates a new JSON file with the queue current queue array which holds all of the current tracks in the queue that are ready to be played. When this function is run, the idea is that it will create a new JSON file, add the queue array to it and then resolve the file at the end of the process.
  2. player.loadQueue(guild, file) - This is what the dumpQueue idea is for. The user using the command attaches a JSON file containing the queue and then the player automatically loads the queue into this list. It will not remove any songs which are currently waiting in the queue to be played.
  3. Add some functionality so that the skip function can be used for vote skipping aswell as instantly skipping the song. player.skip(guild, useVoting) - useVoting would be a boolean

Audio quality issues.

Errors like these are noted in console while playing music
Could not extract html5player key: https://www.youtube.com/s/player/9b926fb0/player_ias.vflset/en_US/base.js
Audio plays distorted.

Miniget

Miniget Status Code : 416
I ran into that while using this and I believe it's a simple fix.
It happens because you're playing a video when all you need is the audio
You can fix this by making a filter 'options' in the play() function which gives you audio instead of video. So instead you'll do .play(ytdl(song.url, options))

const dispatcher = serverQueue.connection
options = {
  quality: 'highestaudio'
};
 .play(ytdl(song.url, options))

[v3-rewrite] Will this version support Radio?

The question is quite obvious because of the title. Will v3 support the ability to play a live radio stream will built-in functions? (e.g. client.player.play(voiceChannel, { type: 'radio', name: 'someradioname' }, user)) - if the 2nd argument isn't an object then it will just scrape YouTube as normal.

If you need help finding any streaming URLs for Radio services I have a few compiled that might be useful for you.

Queue Issue

If I am currently playing a song in a server then I add a song in queue then the bot starts to play the current song again.

Player wont play

Good morning,
My name is Blaise.... I am a Discord Bot Developer, i have started using this package for my discord bot, but now it seems to not be able to play any thing...... If you need code lmk

New Feature Requests

I've been using this package as my daily music driver for my bot for a the past day now, and I've got some features which could be very useful.

client.player.remove(songId) - The songId would be what it is listed as in the queue so you would have to implement Song.SongId
Playlist support? - I don't know if this is already a thing
Add the requester to who queued the song Song.requestedBy
client.player.search(query, maxResults) - Searches for music on YouTube and returns about the results.
client.player.seek(time) - Seeks to a certain part in the song

AddToQueue not working

I tried to add two tracks. One track is successfully added, app crashed after adding two track with error:
image

Add autoSelfDeaf option

I want the bot to turn off the headphones automatically when playing music in the voice channel to save server resources.

Add delay on leaveOnEnd

I'm not sure if this has been suggested before however.

But a delay or configurable delay on the leaveOnEnd option would be nice.
For example; the bot will stay for 3 minutes when the queue is empty and the timer will be reset once a new song has been added to the bot/queue.

This would avoid the bot from leaving every time the queue is empty and it would need to rejoin again once someone adds a new song, even if the time between the empty queue and new song is 2 seconds.

Could not find a declaration file for module 'discord-player'

I have this line in my code to add PlayerOptions:

const { Player, PlayerOptions } = require("discord-player");

And I initialize the bot like this:

const player = new Player(client, process.env.YOUTUBE_KEY, PlayerOptions.leaveOnEmpty);

But it doesn't recognise the PlayerOptions object, so it throws an error while executing the code:

TypeError: Cannot read property 'leaveOnEmpty' of undefined
    at Object.<anonymous> (c:\Users\ycdem\Documents\GitHub\Lyre\bot.js:14:74)
    at Module._compile (internal/modules/cjs/loader.js:1155:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
    at internal/main/run_main_module.js:18:47

However the client object itself can run without any problems, I mean I get no errors when I delete the PlayerOptions.

Also my IDE (Visual Studio Code) shows this error while hovering the mouse on the discord-player.

image

I tried npm install @types/discord-player, but it doesn't exists in registry. I also searched on the StackOverflow, but looks like it has something to do with package's owner. Also, note that it works perfectly on a cloud application platform like Heroku, but it doesn't execute the same code in local.

The versions of packages:

"dependencies": {
    "@discordjs/opus": "^0.1.0",
    "discord-player": "^1.3.8",
    "discord.js": "^12.0.2",
    "dotenv": "^8.2.0"
  },

Error How to fix this

New Bot Project\node_modules\opusscript\build\opusscript_native_wasm.js:8 var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}Module["arguments"]=[];Module["thisProgram"]="./this.program";Module["quit"]=function(status,toThrow){throw toThrow};Module["preRun"]=[];Module["postRun"]=[];var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_HAS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_HAS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_NODE=ENVIRONMENT_HAS_NODE&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var scriptDirectory="";function locateFile(path){if(M abort(Error: Not playing). Build with -s ASSERTIONS=1 for more info.

I get this error when I try to create progress bar

Addition to the getQueue() function [NECCESSARY]

Hi there. I just thought I would make this suggestion because its probably a necessary feature to have for easy code management. So I am currently trying to add pagination to my queue however I am having a hard time because the getQueue() function also returns the currently playing result; an option to configure this would be a nice addition to this module!

Here is the scenario:

Add an option to getQueue() to return everything in the queue but the currently playing song
So getQueue(guild, andCurPlaying) - guild will be just the normal guild ID to get the queue from. andCurPlaying - if this is **false**, it will not return the currently playing song but the rest of the queue, if this is **true** it will return the currently playing song and the rest of the queue.

Error: write EPIPE when trying to enable filters

events.js:173
      throw er; // Unhandled 'error' event
      ^
Error: write EPIPE
    at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:83:16)
Emitted 'error' event at:
    at errorOrDestroy (internal/streams/destroy.js:107:12)
    at FFmpeg.onerror (_stream_readable.js:720:7)
    at FFmpeg.emit (events.js:196:13)
    at Socket.processError (/rbd/pnpm-volume/5c18d4c9-69ed-4098-87d9-f87cf4c5fc9d/node_modules/.registry.npmjs.org/prism-media/1.2.2/node_modules/prism-media/src/core/FFmpeg.js:64:40)
    at Socket.emit (events.js:196:13)
    at errorOrDestroy (internal/streams/destroy.js:107:12)
    at onwriteError (_stream_writable.js:438:5)
    at onwrite (_stream_writable.js:459:5)
    at internal/streams/destroy.js:49:7
    at Socket._destroy (net.js:593:3)

That is the terminal when i try to enable a filter

Error: Status code: 416 - ytdl

events.js:292
throw er; // Unhandled 'error' event
^

Error: Status code: 416
at ClientRequest. (/Users/user/Documents/project/node_modules/miniget/dist/index.js:156:27)
at Object.onceWrapper (events.js:422:26)
at ClientRequest.emit (events.js:315:20)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:596:27)
at HTTPParser.parserOnHeadersComplete (_http_common.js:119:17)
at TLSSocket.socketOnData (_http_client.js:469:22)
at TLSSocket.emit (events.js:315:20)
at addChunk (_stream_readable.js:295:12)
at readableAddChunk (_stream_readable.js:271:9)

To solve this just add highWaterMark in node_modules/discord-player/src/Player.js

const newStream = ytdl(queue.playing.url, { filter: 'audioonly', opusEncoded: true, encoderArgs, seek: seekTime / 1000, highWaterMark: 1<<25 })

maybe could add highWaterMark option in the PlayerOptions?

SOLVED: Play function stopped working

I keep getting unhandled rejection warnings. I don't know why this may be - it was originally working this morning and I noticed one of my server members using it earlier and it stopped working all of a sudden.
image

I also tried to eval the code using the eval command (client.player.play(msg.member.voice.channel, 'test')) and it still thrown a unhandled rejection warning in the console (I did this to test the possibility of it being a command fault instead I've realised that its not my problem)

Edit: Was also working this after noon, probably stopped working this evening (9:22 PM BST), I've also done debugging such as restarting the bot and reloading commands/modules.
Edit 2: I've tried to update to Node 14 as well as trying to downgrade to Node 12 and there is no hope yet.

Improvement to addToQueue

Fetch song details when the song changes instead of fetching them as soon as the song is queued. Without this, developers need to implement a setTimeout in case they need to queue multiple songs or else they are rate limited by the Youtube API. This problem could be solved if song data is fetched before it starts playing.

queue.voiceConnection.play is not a function

bot.player.play(message.member.voiceChannel, message.content.substr(7, 2000))/*.queue.on('end', () => { message.channel.send(embeds[queueEmpty]); }).on('trackChanged', (oldTrack, newTrack, skipped, repeatMode) => { if(repeatMode){ message.channel.send(embeds[playingRepeat]); } else { message.channel.send(embeds[playingNext]); } }).on('channelEmpty', () => { bot.player.stop(message.guild.id); message.channel.send(embeds[channelEmpty]); });*/

TypeError: queue.voiceConnection.play is not a function at Timeout._onTimeout (/home/nyfos/Secret/node_modules/discord-player/src/Player.js:841:39) at listOnTimeout (internal/timers.js:549:17) at processTimers (internal/timers.js:492:7)

setRepeatMode Bug

Hi there, I've just recently implemented the use of the repeat song function into my bot, however, I found a bug.
When the queue has 2 or more song (the currently playing song and another) the repeat function will work correctly as expected to. But if there is only the 1 song (currently playing) the repeat function will not work and will just disconnect from the voice channel as if its not enabled.

delay

hey when I -play (song) I get this error but after a couple of seconds it works


(node:10476) UnhandledPromiseRejectionWarning: Error: Not playing
    at C:\Users\MH\Documents\Coding\music bot\node_modules\discord-player\src\Player.js:501:39
    at new Promise (<anonymous>)
    at Player.addToQueue (C:\Users\MH\Documents\Coding\music bot\node_modules\discord-player\src\Player.js:498:16)
    at Client.<anonymous> (C:\Users\MH\Documents\Coding\music bot\index.js:51:52)
    at Client.emit (events.js:326:22)
    at MessageCreateAction.handle (C:\Users\MH\Documents\Coding\music bot\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (C:\Users\MH\Documents\Coding\music bot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (C:\Users\MH\Documents\Coding\music bot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (C:\Users\MH\Documents\Coding\music bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (C:\Users\MH\Documents\Coding\music bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:10476) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:10476) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
/*****************************************************************************************************
 * validateURL will be renamed to validateID to match with getPlaylistID in the next release of ytpl *
 *                   set `ytpl.do_warn_deprecate = false` to disable this message                    *
 *****************************************************************************************************/```

Issue with installing the package using NPM

Im trying to download npm i discord-player but all i get is errors:/

PS C:\Users\Clasxsy\Desktop\Music Bot> npm i discord-player
npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno -4058
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t ssh://[email protected]/derhuerst/http-basic.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Clasxsy\AppData\Roaming\npm-cache_logs\2020-07-02T20_23_33_500Z-debug.log

Erreur 'url' argument

Bonjour,
Quand je lance la commande !play cela ne marche pas et met cette erreur :
C9471B93-F7F9-441C-83BC-C5766218E508
Merci.

How can I set the volume of the bot?

Hey there, I was wondering how I could set the volume of the bot? It's really quiet still on full and I'd like to make it louder with the .setVolume function but it doesn't seem to work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.