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.0.5 to 1.0.6

2

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

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

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

// Searches the song
let video = await Util.getFirstYoutubeResult(songName, this.SYA).catch(() => {});
let video = await Util.getFirstYoutubeResult(songName, this.SYA);
if(!video) reject('Song not found');

@@ -80,0 +80,0 @@ // Joins the voice channel

@@ -20,13 +20,17 @@ const fetch = require('node-fetch');

// Try with URL
let video = await SYA.getVideo(search).catch(() => {});
if(video){
video = await video.fetch()
SYA.getVideo(search).then(async (video) => {
video = await video.fetch();
resolve(video);
}
// Try with song name
let results = await SYA.searchVideos(search, 1);
if(results.length < 1) reject('Not found');
let fetched = await results.shift().fetch();
results.push(fetched)
resolve(results.pop());
}).catch(async (err) => {
if(err.message === "Bad Request"){
reject('Invalid Youtube Data v3 API key.');
} 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());
}
});
});

@@ -33,0 +37,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