Socket
Socket
Sign inDemoInstall

ksoft.js

Package Overview
Dependencies
5
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.0 to 1.2.1

26

lib/apis/lyrics.js

@@ -137,6 +137,12 @@ /**

* @param {Boolean} returnAvancedResponse Whether or not you want the full response in the promise. This is useful for checking the responses to make sure it is returning the right lyrics
* @param {String} libraryVersion The library you are using and version. for d.js master just put "d.js master" for stable put "d.js stable" if you are using eris just put eris
* @returns {Promise<advancedResponse>}
*/
async searchAndPlay(query, voiceChannelConnection, libraryVersion) {
async searchAndPlay(query, voiceChannelConnection) {
let ytdl = null;
try {
ytdl = require('ytdl-core');
} catch (e) {
throw new Error('ytdl-core is required for playing music');
}
if (!query) throw new Error('[Ksoft API] Please provide a search query');

@@ -147,14 +153,6 @@ const youtubeResult = await require('../util/searchYoutube')(query);

});
if (libraryVersion === 'd.js master') {
if (voiceChannelConnection) {
voiceChannelConnection.play(require('ytdl-core')(youtubeResult[0].url, { filter: 'audioonly' }));
}
} else if (libraryVersion === 'd.js stable') {
if (voiceChannelConnection) {
voiceChannelConnection.playStream(require('ytdl-core')(youtubeResult[0].url, { filter: 'audioonly' }));
}
} else {
if (voiceChannelConnection) {
voiceChannelConnection.play(require('ytdl-core')(youtubeResult[0].url, { filter: 'audioonly' }));
}
if (voiceChannelConnection) {
(voiceChannelConnection.playStream || voiceChannelConnection.play)(
ytdl(youtubeResult[0].url, { filter: 'audioonly' })
);
}

@@ -161,0 +159,0 @@

{
"name": "ksoft.js",
"version": "1.2.0",
"version": "1.2.1",
"description": "Official API Wrapper for KSoft.Si API, written in Node.js",

@@ -32,4 +32,3 @@ "main": "index.js",

"form-data": "^2.3.3",
"public-ip": "^2.4.0",
"ytdl-core": "^0.28.0"
"public-ip": "^2.4.0"
},

@@ -36,0 +35,0 @@ "devDependencies": {

@@ -156,4 +156,6 @@ # ksoft.js

Please note: To play music with this feature you are going to need to have ffmpeg, node-opus/opuscript, and ytdl-core installed
```javascript
ksoft.lyrics.searchAndPlay(query: String, voiceConnection, libraryVersion: String); // libraryVersion is the library you are using and version. for d.js master just put "d.js master" for stable put "d.js stable" if you are using eris just put eris
ksoft.lyrics.searchAndPlay(query: String, voiceConnection);
```

@@ -160,0 +162,0 @@

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc