Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

discord-player

Package Overview
Dependencies
Maintainers
1
Versions
358
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

discord-player - npm Package Compare versions

Comparing version 1.3.5 to 1.3.7

.github/FUNDING.yml

2

package.json
{
"name": "discord-player",
"version": "1.3.5",
"version": "1.3.7",
"description": "Complete framework to facilitate music commands using discord.js v12",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -97,3 +97,3 @@ const ytdl = require('ytdl-core');

return new Promise(async (resolve, reject) => {
if(typeof voiceChannel !== VoiceChannel) return reject("voiceChannel must be type of VoiceChannel. value="+voiceChannel);
if(!voiceChannel || typeof voiceChannel !== "object") return reject("voiceChannel must be type of VoiceChannel. value="+voiceChannel);
if(typeof songName !== "string") return reject("songName must be type of string. value="+songName);

@@ -100,0 +100,0 @@ // Searches the song

@@ -21,2 +21,7 @@ /**

/**
* Raw video object from Simple Youtube API
* @type {Video}
*/
this.rawVideo = video;
/**
* Raw informations about the song.

@@ -23,0 +28,0 @@ * @type {Object}

@@ -28,8 +28,16 @@ const fetch = require('node-fetch');

} else {
// Try with song name
let results = await SYA.searchVideos(search, 1);
if(results.length < 1) return reject('Not found');
let fetched = await results.shift().fetch();
results.push(fetched);
resolve(results.pop());
try {
// Try with song name
let results = await SYA.searchVideos(search, 1);
if(results.length < 1) return reject('Not found');
let fetched = await results.shift().fetch();
results.push(fetched);
resolve(results.pop());
} catch(err){
if(err.message === "Bad Request"){
reject('Invalid Youtube Data v3 API key.');
} else {
reject(err);
}
}
}

@@ -36,0 +44,0 @@ });

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc