fent / fent/node-ytdl-core

Error: imput stream: aborted

Open
#902 65 comments 5 reactions 0 assignees View on GitHub
bug
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 ?
![print screen](https://user-images.githubusercontent.com/62336875/111180167-0be00800-85ad-11eb-8b8e-aec97c9181be.png)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.