discordjs / voice

Implementation of the Discord Voice API for discord.js and other JS/TS libraries
Apache License 2.0
328 stars 112 forks source link

Discord.JS v13 voice library crashing #195

Closed 1717greg1717 closed 2 years ago

1717greg1717 commented 2 years ago

Please describe the problem you are having in as much detail as possible:

My music bot for some reason crashed (it's not like I never had it before, I just made it) and I couldn't figure out why. (This is almost the same as https://github.com/discordjs/voice/issues/148, but first time it crashed it was 4 minutes, now it was a lot longer)

Include a reproducible code sample here, if possible:

const player = createAudioPlayer();
            const str = ytdl(inl.shortUrl, {
                filter: 'audioonly',
                quality: 'lowest'
            });
            const { stream, type } = await demuxProbe(str);
            const res = require('@discordjs/voice').createAudioResource(stream, { inputType: type } )
            player.play(res);
            getVoiceConnection('859750905838043157').subscribe(player);
            player.once(AudioPlayerStatus.Idle, () => {
                current++;
                nxt();
            });

Further details:

Relevant client options:

iim-ayush commented 2 years ago

So without any errors, no one is going to help.

So please add this code :

player.on("error", console.error);

And test your code again and show us the error.

1717greg1717 commented 2 years ago

Here it is, sorry for the delay it crashed really late: AudioPlayerError: aborted at connResetException (node:internal/errors:691:14) at TLSSocket.socketCloseListener (node:_http_client:407:19) at TLSSocket.emit (node:events:406:35) at node:net:672:12 at TCP.done (node:_tls_wrap:580:7) { resource: AudioResource { playbackDuration: 104360, started: true, silenceRemaining: -1, edges: [ [Object] ], playStream: WebmDemuxer { _readableState: [ReadableState], _events: [Object: null prototype], _eventsCount: 5, _maxListeners: undefined, _writableState: [WritableState], allowHalfOpen: true, _remainder: null, _length: 688128, _count: 688096, _skipUntil: null, _track: [Object], _incompleteTrack: {}, _ebmlFound: true,

  [Symbol(kCallback)]: [Function: bound onwrite]
},
metadata: null,
silencePaddingFrames: 5,
audioPlayer: AudioPlayer {
  _events: [Object: null prototype],
  _eventsCount: 2,
  _maxListeners: undefined,
  subscribers: [Array],
  _state: [Object],
  behaviors: [Object],
  debug: [Function (anonymous)],
  [Symbol(kCapture)]: false
}

} }

iim-ayush commented 2 years ago

Here it is, sorry for the delay it crashed really late: AudioPlayerError: aborted

This is a error from ytdl-core, discord.js voice can't do anything about it

For more info : see this

iim-ayush commented 2 years ago

Anyone close this issue.