discord-player 5.3.0-dev.0 → 5.3.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Player.js +2 -2
- package/dist/Structures/Queue.js +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/utils/Util.js +7 -5
- package/package.json +1 -1
package/dist/Player.js
CHANGED
|
@@ -80,10 +80,10 @@ class Player extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
80
80
|
return void this.emit("botDisconnect", queue);
|
|
81
81
|
}
|
|
82
82
|
if (!oldState.channelId && newState.channelId && newState.member.id === newState.guild.members.me.id) {
|
|
83
|
-
if (
|
|
83
|
+
if (oldState.serverMute !== newState.serverMute) {
|
|
84
84
|
queue.setPaused(newState.serverMute);
|
|
85
85
|
}
|
|
86
|
-
else if (
|
|
86
|
+
else if (oldState.suppress !== newState.suppress) {
|
|
87
87
|
if (newState.suppress)
|
|
88
88
|
newState.guild.members.me.voice.setRequestToSpeak(true).catch(Util_1.Util.noop);
|
|
89
89
|
queue.setPaused(newState.suppress);
|
package/dist/Structures/Queue.js
CHANGED
|
@@ -697,7 +697,7 @@ class Queue {
|
|
|
697
697
|
this._filtersUpdate = options.filtersUpdate;
|
|
698
698
|
const volumeTransformer = resource.volume;
|
|
699
699
|
if (volumeTransformer && typeof this.options.initialVolume === "number")
|
|
700
|
-
Reflect.set(volumeTransformer, "volume", Math.pow(this.options.initialVolume, 1.660964));
|
|
700
|
+
Reflect.set(volumeTransformer, "volume", Math.pow(this.options.initialVolume / 100, 1.660964));
|
|
701
701
|
if (volumeTransformer?.hasSmoothness && typeof this.options.volumeSmoothness === "number") {
|
|
702
702
|
if (typeof volumeTransformer.setSmoothness === "function")
|
|
703
703
|
volumeTransformer.setSmoothness(this.options.volumeSmoothness || 0);
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { Readable, Duplex } from 'stream';
|
|
|
4
4
|
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
5
5
|
import { AudioPlayerError, AudioResource, VoiceConnection, AudioPlayer, StreamType, AudioPlayerStatus } from '@discordjs/voice';
|
|
6
6
|
import { downloadOptions } from 'ytdl-core';
|
|
7
|
-
import * as undici from 'undici';
|
|
8
7
|
|
|
9
8
|
declare class Playlist {
|
|
10
9
|
readonly player: Player;
|
|
@@ -1186,7 +1185,7 @@ declare class Util {
|
|
|
1186
1185
|
*/
|
|
1187
1186
|
static wait(time: number): Promise<unknown>;
|
|
1188
1187
|
static noop(): void;
|
|
1189
|
-
static getFetch(): Promise<
|
|
1188
|
+
static getFetch(): Promise<any>;
|
|
1190
1189
|
}
|
|
1191
1190
|
|
|
1192
1191
|
declare const version: string;
|
package/dist/utils/Util.js
CHANGED
|
@@ -112,11 +112,13 @@ class Util {
|
|
|
112
112
|
static async getFetch() {
|
|
113
113
|
if ("fetch" in globalThis)
|
|
114
114
|
return globalThis.fetch;
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
115
|
+
for (const lib of ["undici", "node-fetch"]) {
|
|
116
|
+
try {
|
|
117
|
+
return await Promise.resolve().then(() => __importStar(require(lib))).then((res) => res.fetch || res.default?.fetch || res.default);
|
|
118
|
+
}
|
|
119
|
+
catch {
|
|
120
|
+
// uh?
|
|
121
|
+
}
|
|
120
122
|
}
|
|
121
123
|
}
|
|
122
124
|
}
|