distube 5.0.3 → 5.0.4
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/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
4
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
5
|
-
}) : x)(function(x) {
|
|
6
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
7
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
8
|
-
});
|
|
9
3
|
|
|
10
4
|
// src/type.ts
|
|
11
5
|
var Events = /* @__PURE__ */ ((Events2) => {
|
|
@@ -629,8 +623,8 @@ var DisTubeVoice = class extends TypedEmitter {
|
|
|
629
623
|
* Play a {@link DisTubeStream}
|
|
630
624
|
* @param dtStream - DisTubeStream
|
|
631
625
|
*/
|
|
632
|
-
play(dtStream) {
|
|
633
|
-
if (!checkEncryptionLibraries()) {
|
|
626
|
+
async play(dtStream) {
|
|
627
|
+
if (!await checkEncryptionLibraries()) {
|
|
634
628
|
dtStream.kill();
|
|
635
629
|
throw new DisTubeError("ENCRYPTION_LIBRARIES_MISSING");
|
|
636
630
|
}
|
|
@@ -1433,7 +1427,7 @@ var QueueManager = class extends GuildIdManager {
|
|
|
1433
1427
|
const dtStream = new DisTubeStream(stream.url, streamOptions);
|
|
1434
1428
|
dtStream.on("debug", (data) => this.emit("ffmpegDebug" /* FFMPEG_DEBUG */, `[${queue.id}] ${data}`));
|
|
1435
1429
|
this.debug(`[${queue.id}] Started playing: ${willPlaySong}`);
|
|
1436
|
-
queue.voice.play(dtStream);
|
|
1430
|
+
await queue.voice.play(dtStream);
|
|
1437
1431
|
if (emitPlaySong) this.emit("playSong" /* PLAY_SONG */, queue, song);
|
|
1438
1432
|
} catch (e) {
|
|
1439
1433
|
this.#handlePlayingError(queue, e);
|
|
@@ -2011,10 +2005,10 @@ function isNsfwChannel(channel) {
|
|
|
2011
2005
|
}
|
|
2012
2006
|
__name(isNsfwChannel, "isNsfwChannel");
|
|
2013
2007
|
var isTruthy = /* @__PURE__ */ __name((x) => Boolean(x), "isTruthy");
|
|
2014
|
-
var checkEncryptionLibraries = /* @__PURE__ */ __name(() => {
|
|
2008
|
+
var checkEncryptionLibraries = /* @__PURE__ */ __name(async () => {
|
|
2015
2009
|
for (const lib of ["sodium-native", "sodium", "libsodium-wrappers", "tweetnacl"]) {
|
|
2016
2010
|
try {
|
|
2017
|
-
|
|
2011
|
+
await import(lib);
|
|
2018
2012
|
return true;
|
|
2019
2013
|
} catch {
|
|
2020
2014
|
}
|
|
@@ -2411,7 +2405,7 @@ ${e.message}`;
|
|
|
2411
2405
|
};
|
|
2412
2406
|
|
|
2413
2407
|
// src/index.ts
|
|
2414
|
-
var version = "5.0.
|
|
2408
|
+
var version = "5.0.4";
|
|
2415
2409
|
export {
|
|
2416
2410
|
BaseManager,
|
|
2417
2411
|
DisTube,
|