Error: imput stream: aborted
- Dominant language
- JavaScript
- Stars
- 4.7k
- Forks
- 852
- PR merge metrics
- No merged PRs in 30d
Description
Today i wrote simple play command for discord bot.
But after some time of music plaing i get this error
My code for music play is:
```js
const { Permissions:{FLAGS} } = require ("discord.js")
const ytdl = require('ytdl-core')
const fs = require('fs')
module.exports={
name: "play",
description: "Puszczanie muzyki",
args: true,
usage: "",
guildOnly: true,
cooldown: 10,
aliases: ["p"],
botPermissions: [FLAGS.CONNECT,FLAGS.SPEAK],
async run(message, args) {
//console.log(args)
const voiceChannel = message.member.voice.channel
if(!voiceChannel) return message.channel.send("Potrzebujesz być na kanale głosowym by to zrobić")
try {
var connection = await voiceChannel.join()
} catch (error) {
console.log(`There was an error connecting to the voice channel: ${error}`)
}
const dispatcher = connection.play(ytdl(args[0],{Quality: 'highestaudio'},{filter:'audiooly'},{highWaterMark: 1<<23},{dlChunkSize:0}))
.on('finish',() => {
voiceChannel.leave()
})
.on('error', error => {
console.log(error)
})
dispatcher.setVolumeLogarithmic(5 / 5)
}
}
```
Any ideas how to fix it ?

Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.