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 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 (newState.serverMute || !newState.serverMute) {
83
+ if (oldState.serverMute !== newState.serverMute) {
84
84
  queue.setPaused(newState.serverMute);
85
85
  }
86
- else if (newState.suppress || !newState.suppress) {
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);
@@ -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<typeof fetch | typeof undici.default>;
1188
+ static getFetch(): Promise<any>;
1190
1189
  }
1191
1190
 
1192
1191
  declare const version: string;
@@ -112,11 +112,13 @@ class Util {
112
112
  static async getFetch() {
113
113
  if ("fetch" in globalThis)
114
114
  return globalThis.fetch;
115
- try {
116
- return await Promise.resolve().then(() => __importStar(require("undici"))).then((res) => res.default);
117
- }
118
- catch {
119
- // uh?
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "discord-player",
3
- "version": "5.3.0-dev.0",
3
+ "version": "5.3.0-dev.1",
4
4
  "description": "Complete framework to facilitate music commands using discord.js",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",