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.d.mts
CHANGED
|
@@ -664,7 +664,7 @@ declare class DisTubeVoice extends TypedEmitter<DisTubeVoiceEvents> {
|
|
|
664
664
|
* Play a {@link DisTubeStream}
|
|
665
665
|
* @param dtStream - DisTubeStream
|
|
666
666
|
*/
|
|
667
|
-
play(dtStream: DisTubeStream): void
|
|
667
|
+
play(dtStream: DisTubeStream): Promise<void>;
|
|
668
668
|
set volume(volume: number);
|
|
669
669
|
/**
|
|
670
670
|
* Get or set the volume percentage
|
|
@@ -1234,7 +1234,7 @@ declare function objectKeys<T>(obj: T): KeyOf<T>;
|
|
|
1234
1234
|
declare function isNsfwChannel(channel?: GuildTextBasedChannel): boolean;
|
|
1235
1235
|
type Falsy = undefined | null | false | 0 | "";
|
|
1236
1236
|
declare const isTruthy: <T>(x: T | Falsy) => x is T;
|
|
1237
|
-
declare const checkEncryptionLibraries: () => boolean
|
|
1237
|
+
declare const checkEncryptionLibraries: () => Promise<boolean>;
|
|
1238
1238
|
|
|
1239
1239
|
/**
|
|
1240
1240
|
* DisTube class
|
package/dist/index.d.ts
CHANGED
|
@@ -664,7 +664,7 @@ declare class DisTubeVoice extends TypedEmitter<DisTubeVoiceEvents> {
|
|
|
664
664
|
* Play a {@link DisTubeStream}
|
|
665
665
|
* @param dtStream - DisTubeStream
|
|
666
666
|
*/
|
|
667
|
-
play(dtStream: DisTubeStream): void
|
|
667
|
+
play(dtStream: DisTubeStream): Promise<void>;
|
|
668
668
|
set volume(volume: number);
|
|
669
669
|
/**
|
|
670
670
|
* Get or set the volume percentage
|
|
@@ -1234,7 +1234,7 @@ declare function objectKeys<T>(obj: T): KeyOf<T>;
|
|
|
1234
1234
|
declare function isNsfwChannel(channel?: GuildTextBasedChannel): boolean;
|
|
1235
1235
|
type Falsy = undefined | null | false | 0 | "";
|
|
1236
1236
|
declare const isTruthy: <T>(x: T | Falsy) => x is T;
|
|
1237
|
-
declare const checkEncryptionLibraries: () => boolean
|
|
1237
|
+
declare const checkEncryptionLibraries: () => Promise<boolean>;
|
|
1238
1238
|
|
|
1239
1239
|
/**
|
|
1240
1240
|
* DisTube class
|
package/dist/index.js
CHANGED
|
@@ -685,8 +685,8 @@ var DisTubeVoice = class extends import_tiny_typed_emitter.TypedEmitter {
|
|
|
685
685
|
* Play a {@link DisTubeStream}
|
|
686
686
|
* @param dtStream - DisTubeStream
|
|
687
687
|
*/
|
|
688
|
-
play(dtStream) {
|
|
689
|
-
if (!checkEncryptionLibraries()) {
|
|
688
|
+
async play(dtStream) {
|
|
689
|
+
if (!await checkEncryptionLibraries()) {
|
|
690
690
|
dtStream.kill();
|
|
691
691
|
throw new DisTubeError("ENCRYPTION_LIBRARIES_MISSING");
|
|
692
692
|
}
|
|
@@ -1489,7 +1489,7 @@ var QueueManager = class extends GuildIdManager {
|
|
|
1489
1489
|
const dtStream = new DisTubeStream(stream.url, streamOptions);
|
|
1490
1490
|
dtStream.on("debug", (data) => this.emit("ffmpegDebug" /* FFMPEG_DEBUG */, `[${queue.id}] ${data}`));
|
|
1491
1491
|
this.debug(`[${queue.id}] Started playing: ${willPlaySong}`);
|
|
1492
|
-
queue.voice.play(dtStream);
|
|
1492
|
+
await queue.voice.play(dtStream);
|
|
1493
1493
|
if (emitPlaySong) this.emit("playSong" /* PLAY_SONG */, queue, song);
|
|
1494
1494
|
} catch (e) {
|
|
1495
1495
|
this.#handlePlayingError(queue, e);
|
|
@@ -2067,10 +2067,10 @@ function isNsfwChannel(channel) {
|
|
|
2067
2067
|
}
|
|
2068
2068
|
__name(isNsfwChannel, "isNsfwChannel");
|
|
2069
2069
|
var isTruthy = /* @__PURE__ */ __name((x) => Boolean(x), "isTruthy");
|
|
2070
|
-
var checkEncryptionLibraries = /* @__PURE__ */ __name(() => {
|
|
2070
|
+
var checkEncryptionLibraries = /* @__PURE__ */ __name(async () => {
|
|
2071
2071
|
for (const lib of ["sodium-native", "sodium", "libsodium-wrappers", "tweetnacl"]) {
|
|
2072
2072
|
try {
|
|
2073
|
-
|
|
2073
|
+
await import(lib);
|
|
2074
2074
|
return true;
|
|
2075
2075
|
} catch {
|
|
2076
2076
|
}
|
|
@@ -2467,7 +2467,7 @@ ${e.message}`;
|
|
|
2467
2467
|
};
|
|
2468
2468
|
|
|
2469
2469
|
// src/index.ts
|
|
2470
|
-
var version = "5.0.
|
|
2470
|
+
var version = "5.0.4";
|
|
2471
2471
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2472
2472
|
0 && (module.exports = {
|
|
2473
2473
|
BaseManager,
|