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

discord-player

Package Overview
Dependencies
Maintainers
2
Versions
359
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 5.2.1 to 5.2.2

dist/VoiceInterface/VolumeTransformer.js

3

dist/index.d.ts

@@ -194,2 +194,5 @@ /// <reference types="node" />

}): Promise<VoiceConnection>;
enterReady(conn: VoiceConnection, options?: {
maxTime?: number;
}): Promise<VoiceConnection>;
/**

@@ -196,0 +199,0 @@ * Disconnects voice connection

@@ -5,2 +5,4 @@ "use strict";

const tslib_1 = require("tslib");
// try applying smooth volume patch on load
require("./smoothVolume");
var AudioFilters_1 = require("./utils/AudioFilters");

@@ -7,0 +9,0 @@ Object.defineProperty(exports, "AudioFilters", { enumerable: true, get: function () { return AudioFilters_1.AudioFilters; } });

8

dist/Player.js

@@ -29,3 +29,3 @@ "use strict";

constructor(client, options = {}) {
var _a;
var _a, _b, _c, _d, _e;
super();

@@ -48,3 +48,3 @@ this.options = {

this.client = client;
if (!new discord_js_1.Intents(this.client.options.intents).has(discord_js_1.Intents.FLAGS.GUILD_VOICE_STATES)) {
if (((_b = (_a = this.client) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.intents) && !new discord_js_1.Intents((_d = (_c = this.client) === null || _c === void 0 ? void 0 : _c.options) === null || _d === void 0 ? void 0 : _d.intents).has(discord_js_1.Intents.FLAGS.GUILD_VOICE_STATES)) {
throw new PlayerError_1.PlayerError('client is missing "GUILD_VOICE_STATES" intent');

@@ -58,3 +58,3 @@ }

this.client.on("voiceStateUpdate", this._handleVoiceState.bind(this));
if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.autoRegisterExtractor) {
if ((_e = this.options) === null || _e === void 0 ? void 0 : _e.autoRegisterExtractor) {
let nv; // eslint-disable-line @typescript-eslint/no-explicit-any

@@ -163,3 +163,3 @@ if ((nv = Util_1.Util.require("@discord-player/extractor"))) {

delete queueInitOptions["metadata"];
(_a = queueInitOptions.volumeSmoothness) !== null && _a !== void 0 ? _a : (queueInitOptions.volumeSmoothness = 0.1);
(_a = queueInitOptions.volumeSmoothness) !== null && _a !== void 0 ? _a : (queueInitOptions.volumeSmoothness = 0.08);
(_b = queueInitOptions.ytdlOptions) !== null && _b !== void 0 ? _b : (queueInitOptions.ytdlOptions = this.options.ytdlOptions);

@@ -166,0 +166,0 @@ const queue = new Queue_1.Queue(this, guild, queueInitOptions);

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const VolumeTransformer_1 = require("./VolumeTransformer");
// eslint-disable-next-line
require("prism-media").VolumeTransformer = VolumeTransformer_1.VolumeTransformer;
const VolumeTransformer_1 = require("./VoiceInterface/VolumeTransformer");
try {
// eslint-disable-next-line
const mod = require("prism-media");
if (typeof mod.VolumeTransformer.hasSmoothing !== "boolean") {
Reflect.set(mod, "VolumeTransformer", VolumeTransformer_1.VolumeTransformer);
}
}
catch (_a) {
/* do nothing */
}

@@ -141,4 +141,3 @@ "use strict";

const connection = yield this.player.voiceUtils.connect(_channel, {
deaf: this.options.autoSelfDeaf,
maxTime: this.player.options.connectionTimeout || 20000
deaf: this.options.autoSelfDeaf
});

@@ -199,2 +198,5 @@ this.connection = connection;

}));
yield this.player.voiceUtils.enterReady(this.connection.voiceConnection, {
maxTime: this.player.options.connectionTimeout || 30000
});
return this;

@@ -707,4 +709,6 @@ });

this._filtersUpdate = options.filtersUpdate;
if (resource.volume && typeof this.options.volumeSmoothness === "number") {
Reflect.set(resource.volume, "_smoothing", this.options.volumeSmoothness || 0);
const volumeTransformer = resource.volume;
if ((volumeTransformer === null || volumeTransformer === void 0 ? void 0 : volumeTransformer.hasSmoothness) && typeof this.options.volumeSmoothness === "number") {
if (typeof volumeTransformer.setSmoothness === "function")
volumeTransformer.setSmoothness(this.options.volumeSmoothness || 0);
}

@@ -711,0 +715,0 @@ this.setVolume(this.options.initialVolume);

@@ -41,5 +41,4 @@ "use strict";

join(channel, options) {
var _a;
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
let conn = (0, voice_1.joinVoiceChannel)({
const conn = (0, voice_1.joinVoiceChannel)({
guildId: channel.guild.id,

@@ -50,2 +49,8 @@ channelId: channel.id,

});
return conn;
});
}
enterReady(conn, options = {}) {
var _a;
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
try {

@@ -52,0 +57,0 @@ conn = yield (0, voice_1.entersState)(conn, voice_1.VoiceConnectionStatus.Ready, (_a = options === null || options === void 0 ? void 0 : options.maxTime) !== null && _a !== void 0 ? _a : 20000);

{
"name": "discord-player",
"version": "5.2.1",
"version": "5.2.2",
"description": "Complete framework to facilitate music commands using discord.js",

@@ -16,3 +16,5 @@ "main": "dist/index.js",

},
"./smoothVolume": "./dist/smoothVolume.js"
"./smoothVolume": "./dist/smoothVolume.js",
"./src/*": "./dist/*",
"./dist/*": "./dist/*"
},

@@ -71,3 +73,3 @@ "scripts": {

"soundcloud-scraper": "^5.0.2",
"spotify-url-info": "^2.2.3",
"spotify-url-info": "^2.2.5",
"tiny-typed-emitter": "^2.1.0",

@@ -91,3 +93,3 @@ "youtube-sr": "^4.1.13",

"discord-api-types": "^0.24.0",
"discord.js": "^13.3.1",
"discord.js": "^13.6.0",
"eslint": "^8.3.0",

@@ -94,0 +96,0 @@ "gen-esm-wrapper": "^1.1.3",

@@ -171,3 +171,3 @@ # Discord Player

Discord Player will make volume transition smooth. To enable this, you need to add this line at the top of your main file:
Discord Player will by default try to implement this. If smooth volume does not work, you need to add this line at the top of your main file:

@@ -174,0 +174,0 @@ ```js

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