mirror of
https://github.com/musix-org/musix-oss
synced 2024-12-23 00:23:17 +00:00
version and some formatting to play func
This commit is contained in:
parent
3f1aedfef8
commit
6408cbe525
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "musix",
|
||||
"version": "3.2.0",
|
||||
"version": "3.2.2",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -44,4 +44,4 @@
|
||||
"ytdl-core": "^2.1.0",
|
||||
"zlib-sync": "^0.1.6"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,8 @@ module.exports = async function (guild, song, client, seek, play) {
|
||||
streamConfig.options.seek = seek;
|
||||
|
||||
let input = song.url;
|
||||
if (song.type === "ytdl") input = ytdl(song.url, streamConfig.ytdlOptions);
|
||||
if (song.type === "ytdl")
|
||||
input = ytdl(song.url, streamConfig.ytdlOptions);
|
||||
|
||||
const ffmpegArgs = [
|
||||
"-analyzeduration",
|
||||
@ -44,10 +45,12 @@ module.exports = async function (guild, song, client, seek, play) {
|
||||
args.unshift("-ss", String(seek));
|
||||
|
||||
const transcoder = new prism.FFmpeg({
|
||||
args: args
|
||||
args: args,
|
||||
});
|
||||
|
||||
const stream = input.pipe(transcoder);
|
||||
const stream = input.pipe(transcoder).on("error", (error) => {
|
||||
console.log(error);
|
||||
});
|
||||
|
||||
const dispatcher = queue.connection
|
||||
.play(stream, streamConfig.options)
|
||||
|
Loading…
Reference in New Issue
Block a user