aiko-chan-ai / discord.js-selfbot-v13

An unofficial discord.js fork for creating selfbots
https://discordjs-self-v13.netlify.app
GNU General Public License v3.0
751 stars 160 forks source link

Voice Call stops after time #249

Closed SinanAkkoyun closed 2 years ago

SinanAkkoyun commented 2 years ago

Which package has the bugs?

The core library

Issue description

When running my example, the bot stops playing back audio in a private DM call after around 55 seconds. The play-dl is still streaming (see code debug) but somehow the discord voice connection is stopped. the green ring also disappears. (there is no error nor traceback, same happens in guild vc)

Thank you so so much for the awesome library, I really appreciate the work!

Code sample

const client = new Client({
  patchVoice: true
})

//...

client.on("messageCreate", async (message) => {
  if (message.content.startsWith("call me") && message.channel.type === 'DM') {
    const connection = await message.channel.call()

    console.log('call accepted')

    let stream = await play.stream('https://www.youtube.com/watch?v=D-TAO7U6rtg');
    console.log('playing stream')
    let resource = createAudioResource(stream.stream, {
      inputType: stream.type,
      inlineVolume: true
    })
    stream.stream.on('data', (data) => {
      process.stdout.write('.') // still outputs . when voice is not outputting anymore
    })
    //resource.volume.setVolume(10)
    let player = createAudioPlayer({
      behaviors: {
        maxMissedFrames: 99999999999999,
        noSubscriber: NoSubscriberBehavior.Play,
      },
    })
    player.play(resource);
    connection.subscribe(player);
  }
});

Package version

2.5.0

Node.js version

18.7.0

Operating system

Ubuntu Linux (WSL2)

Priority this issue should have

Medium (should be fixed soon)

Checklist

Additional Information

Thanks so much for the lib <3

aiko-chan-ai commented 2 years ago

calling is not fully supported yet but I can still play a full 3 minute song during a call

SinanAkkoyun commented 2 years ago

but I can still play a full 3 minute song during a call

How does your code look? I would like to reproduce that... Mine still cuts off after 50 seconds

aiko-chan-ai commented 2 years ago

How does your code look? I would like to reproduce that... Mine still cuts off after 50 seconds

https://github.com/aiko-chan-ai/discord.js-selfbot-v13/blob/main/Document/VoiceCall.md#play-music-using-play-dl

SinanAkkoyun commented 2 years ago

That's extremely odd, I run the same code and it cuts off after around 55 seconds. The dl is working and still streaming when the audio vanishes, it's only the discord library. Also, the exact same thing happens in guild VCs.

I will try to do further investigation, changing host and maybe porting it to pure discord.js to see if it's something about that...

aiko-chan-ai commented 2 years ago

maybe it's your network problem

aiko-chan-ai commented 2 years ago

@SinanAkkoyun https://github.com/discordjs/discord.js/issues/8482

SinanAkkoyun commented 2 years ago

Thank you very much, apparently this is a WSL2 disord.js problem and has nothing to do with your repo. I just tested it on a native linux server and it works fine. Thank you very much for the help