diff --git a/package-lock.json b/package-lock.json index 2f074ad..36c61bd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,9 @@ "dependencies": { "@discordjs/opus": "^0.8.0", "@discordjs/voice": "^0.11.0", + "@types/fluent-ffmpeg": "^2.1.20", "discord.js": "^14.3.0", + "ffmpeg-static": "^5.1.0", "genius-lyrics": "^4.4.0", "get-audio-duration": "^3.1.0", "play-dl": "^1.9.5", @@ -19,6 +21,20 @@ "tweetnacl": "^1.0.3" } }, + "node_modules/@derhuerst/http-basic": { + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/@derhuerst/http-basic/-/http-basic-8.2.4.tgz", + "integrity": "sha512-F9rL9k9Xjf5blCz8HsJRO4diy111cayL2vkY2XE4r4t3n0yPXVYy3KD3nJ1qbrSn9743UWSXH4IwuCa/HWlGFw==", + "dependencies": { + "caseless": "^0.12.0", + "concat-stream": "^2.0.0", + "http-response-object": "^3.0.1", + "parse-cache-control": "^1.0.1" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@discordjs/builders": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.2.0.tgz", @@ -264,6 +280,14 @@ "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz", "integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==" }, + "node_modules/@types/fluent-ffmpeg": { + "version": "2.1.20", + "resolved": "https://registry.npmjs.org/@types/fluent-ffmpeg/-/fluent-ffmpeg-2.1.20.tgz", + "integrity": "sha512-B+OvhCdJ3LgEq2PhvWNOiB/EfwnXLElfMCgc4Z1K5zXgSfo9I6uGKwR/lqmNPFQuebNnes7re3gqkV77SyypLg==", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/node": { "version": "18.7.18", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.18.tgz", @@ -337,6 +361,16 @@ "concat-map": "0.0.1" } }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" + }, + "node_modules/caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==" + }, "node_modules/cheerio": { "version": "1.0.0-rc.12", "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz", @@ -394,6 +428,20 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, + "node_modules/concat-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", + "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", + "engines": [ + "node >= 6.0" + ], + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.0.2", + "typedarray": "^0.0.6" + } + }, "node_modules/console-control-strings": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", @@ -560,6 +608,14 @@ "url": "https://github.com/fb55/entities?sponsor=1" } }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "engines": { + "node": ">=6" + } + }, "node_modules/execa": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", @@ -587,6 +643,21 @@ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, + "node_modules/ffmpeg-static": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/ffmpeg-static/-/ffmpeg-static-5.1.0.tgz", + "integrity": "sha512-eEWOiGdbf7HKPeJI5PoJ0oCwkL0hckL2JdS4JOuB/gUETppwkEpq8nF0+e6VEQnDCo/iuoipbTUsn9QJmtpNkg==", + "hasInstallScript": true, + "dependencies": { + "@derhuerst/http-basic": "^8.2.0", + "env-paths": "^2.2.0", + "https-proxy-agent": "^5.0.0", + "progress": "^2.0.3" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/file-type": { "version": "17.1.6", "resolved": "https://registry.npmjs.org/file-type/-/file-type-17.1.6.tgz", @@ -710,6 +781,19 @@ "entities": "^4.3.0" } }, + "node_modules/http-response-object": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/http-response-object/-/http-response-object-3.0.2.tgz", + "integrity": "sha512-bqX0XTF6fnXSQcEJ2Iuyr75yVakyjIDCqroJQ/aHfSdlM743Cwqoi2nDYMzLGWUcuTWGWy8AAvOKXTfiv6q9RA==", + "dependencies": { + "@types/node": "^10.0.3" + } + }, + "node_modules/http-response-object/node_modules/@types/node": { + "version": "10.17.60", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", + "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==" + }, "node_modules/https-proxy-agent": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", @@ -1001,6 +1085,11 @@ "optional": true, "peer": true }, + "node_modules/parse-cache-control": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-cache-control/-/parse-cache-control-1.0.1.tgz", + "integrity": "sha512-60zvsJReQPX5/QP0Kzfd/VrpjScIQ7SHBW6bFCYfEP+fp0Eppr1SHhIO5nd1PjZtvclzSzES9D/p5nFJurwfWg==" + }, "node_modules/parse5": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.1.tgz", @@ -1093,6 +1182,14 @@ } } }, + "node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/readable-stream": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", @@ -1310,6 +1407,11 @@ "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" }, + "node_modules/typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" + }, "node_modules/undici": { "version": "5.10.0", "resolved": "https://registry.npmjs.org/undici/-/undici-5.10.0.tgz", @@ -1391,6 +1493,17 @@ } }, "dependencies": { + "@derhuerst/http-basic": { + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/@derhuerst/http-basic/-/http-basic-8.2.4.tgz", + "integrity": "sha512-F9rL9k9Xjf5blCz8HsJRO4diy111cayL2vkY2XE4r4t3n0yPXVYy3KD3nJ1qbrSn9743UWSXH4IwuCa/HWlGFw==", + "requires": { + "caseless": "^0.12.0", + "concat-stream": "^2.0.0", + "http-response-object": "^3.0.1", + "parse-cache-control": "^1.0.1" + } + }, "@discordjs/builders": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.2.0.tgz", @@ -1553,6 +1666,14 @@ "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz", "integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==" }, + "@types/fluent-ffmpeg": { + "version": "2.1.20", + "resolved": "https://registry.npmjs.org/@types/fluent-ffmpeg/-/fluent-ffmpeg-2.1.20.tgz", + "integrity": "sha512-B+OvhCdJ3LgEq2PhvWNOiB/EfwnXLElfMCgc4Z1K5zXgSfo9I6uGKwR/lqmNPFQuebNnes7re3gqkV77SyypLg==", + "requires": { + "@types/node": "*" + } + }, "@types/node": { "version": "18.7.18", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.18.tgz", @@ -1617,6 +1738,16 @@ "concat-map": "0.0.1" } }, + "buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==" + }, "cheerio": { "version": "1.0.0-rc.12", "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz", @@ -1659,6 +1790,17 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, + "concat-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", + "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.0.2", + "typedarray": "^0.0.6" + } + }, "console-control-strings": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", @@ -1775,6 +1917,11 @@ "resolved": "https://registry.npmjs.org/entities/-/entities-4.4.0.tgz", "integrity": "sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA==" }, + "env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==" + }, "execa": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", @@ -1796,6 +1943,17 @@ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, + "ffmpeg-static": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/ffmpeg-static/-/ffmpeg-static-5.1.0.tgz", + "integrity": "sha512-eEWOiGdbf7HKPeJI5PoJ0oCwkL0hckL2JdS4JOuB/gUETppwkEpq8nF0+e6VEQnDCo/iuoipbTUsn9QJmtpNkg==", + "requires": { + "@derhuerst/http-basic": "^8.2.0", + "env-paths": "^2.2.0", + "https-proxy-agent": "^5.0.0", + "progress": "^2.0.3" + } + }, "file-type": { "version": "17.1.6", "resolved": "https://registry.npmjs.org/file-type/-/file-type-17.1.6.tgz", @@ -1888,6 +2046,21 @@ "entities": "^4.3.0" } }, + "http-response-object": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/http-response-object/-/http-response-object-3.0.2.tgz", + "integrity": "sha512-bqX0XTF6fnXSQcEJ2Iuyr75yVakyjIDCqroJQ/aHfSdlM743Cwqoi2nDYMzLGWUcuTWGWy8AAvOKXTfiv6q9RA==", + "requires": { + "@types/node": "^10.0.3" + }, + "dependencies": { + "@types/node": { + "version": "10.17.60", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", + "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==" + } + } + }, "https-proxy-agent": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", @@ -2090,6 +2263,11 @@ "optional": true, "peer": true }, + "parse-cache-control": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-cache-control/-/parse-cache-control-1.0.1.tgz", + "integrity": "sha512-60zvsJReQPX5/QP0Kzfd/VrpjScIQ7SHBW6bFCYfEP+fp0Eppr1SHhIO5nd1PjZtvclzSzES9D/p5nFJurwfWg==" + }, "parse5": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.1.tgz", @@ -2141,6 +2319,11 @@ "integrity": "sha512-eW7LXORkTCQznZs+eqe9VjGOrLBxcBPXgNyHXMTSRVhphvd/RrxgIR7WaWt4fkLuhshcdT5KHL88LAfcvS3f5g==", "requires": {} }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==" + }, "readable-stream": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", @@ -2290,6 +2473,11 @@ "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" + }, "undici": { "version": "5.10.0", "resolved": "https://registry.npmjs.org/undici/-/undici-5.10.0.tgz", diff --git a/package.json b/package.json index 9bc47b6..be75b72 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,9 @@ "dependencies": { "@discordjs/opus": "^0.8.0", "@discordjs/voice": "^0.11.0", + "@types/fluent-ffmpeg": "^2.1.20", "discord.js": "^14.3.0", + "ffmpeg-static": "^5.1.0", "genius-lyrics": "^4.4.0", "get-audio-duration": "^3.1.0", "play-dl": "^1.9.5", @@ -32,7 +34,6 @@ "directories": { "example": "examples" }, - "devDependencies": {}, "repository": { "type": "git", "url": "git+https://github.com/Olebeh/olebeh-music-player.git" diff --git a/src/Player.ts b/src/Player.ts index 27baec0..146d791 100644 --- a/src/Player.ts +++ b/src/Player.ts @@ -74,7 +74,6 @@ export class Player extends TypedEmitter { this.client.on(`voiceStateUpdate`, async (oldState, newState) => { if (oldState.channel?.id && !newState.channel?.id && oldState.member?.id === this.client.user.id) { - console.log('disconnected') const queue = this.getQueue(newState.guild.id) if (!queue) return @@ -356,7 +355,7 @@ export class Player extends TypedEmitter { return await SpotifySearchResult(undefined, playlist) } } else { - if (query.includes('://cdn.discordapp.com/') || query.includes('://media.discordapp.net/') && !query.includes(' ')) { + if (query) { const trackInfo = await fetch(query) const duration = await getAudioDuration(query) const track = new Track(this, { diff --git a/src/modules/Queue.ts b/src/modules/Queue.ts index b5df32a..74ea411 100644 --- a/src/modules/Queue.ts +++ b/src/modules/Queue.ts @@ -387,6 +387,7 @@ export class Queue { if (!this.current) return false as If if (position < 1) position = 0 if (position >= this.current.durationMs) return this.skip() as If + if (this.current.source === `arbitrary`) throw new PlayerError(`Seeking local files feature is not implemented yet`, ErrorStatusCode.NotImplemented) await this.play(this.current, { force: true, seek: position }) return true as If @@ -469,8 +470,8 @@ export class Queue { const { title, author, source, url } = track if (source === `youtube`) { - const yt_stream = await playdl.stream(url) - const resource = this.connection.createStream(yt_stream.stream, { type: yt_stream.type, data: track }) as AudioResource + const yt_stream = await playdl.stream(url, { seek: options?.seek }) + const resource = this.connection.createStream(yt_stream.stream, { type: yt_stream.type, data: track }) await this.connection.playStream(resource, this.volume) } else if (source === `spotify`) { @@ -478,12 +479,12 @@ export class Queue { await playdl.refreshToken() } - const sp_stream = await playdl.stream(await playdl.search(`${author} ${title}`, { source: { youtube: `video` } }).then(result => result[0].url)) - const resource = this.connection.createStream(sp_stream.stream, { type: sp_stream.type, data: track }) as AudioResource + const sp_stream = await playdl.stream(await playdl.search(`${author} ${title}`, { source: { youtube: `video` } }).then(result => result[0].url), { seek: options?.seek }) + const resource = this.connection.createStream(sp_stream.stream, { type: sp_stream.type, data: track }) await this.connection.playStream(resource, this.volume) } else if (source === `arbitrary`) { - const resource = this.connection.createStream(track.url, { type: StreamType.Arbitrary, data: track }) as AudioResource + const resource = this.connection.createStream(url, { type: StreamType.Arbitrary, data: track }) await this.connection.playStream(resource, this.volume) } diff --git a/src/utils/PlayerError.ts b/src/utils/PlayerError.ts index 1f12ef5..eb92fe6 100644 --- a/src/utils/PlayerError.ts +++ b/src/utils/PlayerError.ts @@ -11,7 +11,8 @@ export enum ErrorStatusCode { UnknownRepeatMode = `UnknownRepeatMode`, TrackNotFound = `TrackNotFound`, NoConnection = `NoConnection`, - DestroyedQueue = `DestroyedQueue` + DestroyedQueue = `DestroyedQueue`, + NotImplemented = `NotImplemented` } export class PlayerError extends Error { diff --git a/src/utils/StreamDispatcher.ts b/src/utils/StreamDispatcher.ts index b3dd109..f4cddd9 100644 --- a/src/utils/StreamDispatcher.ts +++ b/src/utils/StreamDispatcher.ts @@ -108,7 +108,7 @@ export class StreamDispatcher extends EventEmitter { }); this.audioPlayer.on(`stateChange`, (oldState, newState) => { - if (newState.status === AudioPlayerStatus.Playing) { + if (newState.status === AudioPlayerStatus.Playing && oldState.status !== AudioPlayerStatus.Playing) { if (!this.paused) return void this.emit(`start`, this.audioResource!); } else if (newState.status === AudioPlayerStatus.Idle && oldState.status !== AudioPlayerStatus.Idle) { if (!this.paused) { @@ -129,16 +129,14 @@ export class StreamDispatcher extends EventEmitter { * @param {object} [ops] Options * @returns {AudioResource} */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - createStream(src: Readable | Duplex | string, ops?: { type?: StreamType; data?: any; disableVolume?: boolean }): AudioResource { - this.audioResource = createAudioResource(src, { + createStream(stream: Readable | Duplex | string, ops?: { type?: StreamType; data?: any; disableVolume?: boolean }): AudioResource { + this.audioResource = createAudioResource(stream, { inputType: ops?.type ?? StreamType.Arbitrary, metadata: ops?.data, - // eslint-disable-next-line no-extra-boolean-cast inlineVolume: !Boolean(ops?.disableVolume) - }); + }) - return this.audioResource; + return this.audioResource } /** diff --git a/typings/utils/PlayerError.d.ts b/typings/utils/PlayerError.d.ts index 5726f13..9981b62 100644 --- a/typings/utils/PlayerError.d.ts +++ b/typings/utils/PlayerError.d.ts @@ -11,7 +11,8 @@ export declare enum ErrorStatusCode { UnknownRepeatMode = "UnknownRepeatMode", TrackNotFound = "TrackNotFound", NoConnection = "NoConnection", - DestroyedQueue = "DestroyedQueue" + DestroyedQueue = "DestroyedQueue", + NotImplemented = "NotImplemented" } export declare class PlayerError extends Error { message: string; diff --git a/typings/utils/StreamDispatcher.d.ts b/typings/utils/StreamDispatcher.d.ts index a7e6f57..4acdb47 100644 --- a/typings/utils/StreamDispatcher.d.ts +++ b/typings/utils/StreamDispatcher.d.ts @@ -31,11 +31,11 @@ export declare class StreamDispatcher extends EventEmitter { * @param {object} [ops] Options * @returns {AudioResource} */ - createStream(src: Readable | Duplex | string, ops?: { + createStream(stream: Readable | Duplex | string, ops?: { type?: StreamType; data?: any; disableVolume?: boolean; - }): AudioResource; + }): AudioResource; /** * The player status * @type {AudioPlayerStatus}