Comments (24)
welp
from master-bot.
@iNPGT What did you try to do that fired this error?
And as I wrote in other issues, please check if you installed discord.js master and commando correctly. When running npm view discord.js version
you should get 11.5.1, and you should get 0.10.0 from running npm view discord.js-commando version
from master-bot.
I also got this issue when running play followed by a youtube link. When I try the "leave" command, I get this error from the bot:
TypeError: Cannot set property 'length' of undefined
Been looking around, nothing seems to work.
EDIT:
Here's the whole error from console:
(node:2349) DeprecationWarning: Collection#filterArray: use Collection#filter instead TypeError: connection.play is not a function at queue.(anonymous function).voiceChannel.join.then.connection (/home/projectcamel/camel/commands/music/play.js:259:10) at <anonymous> (node:2349) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'leave' of undefined at queue.(anonymous function).voiceChannel.join.then.catch.e (/home/projectcamel/camel/commands/music/play.js:295:27) at <anonymous> (node:2349) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:2349) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
EDIT PT 2 (just to remove any doubt it's the packages):
npm -v --> 6.11.2
npm view discord.js-commando version --> 0.10.0
npm view discord.js version --> 11.5.1
from master-bot.
@nmbarker I'll debug this today, thanks for letting me know
from master-bot.
@nmbarker @iNPGT I pushed a new commit, can you check if that solves the problem? Works on my end
from master-bot.
Alright the leave command is "fixed." If there is no music and I want it to leave, it won't leave. I will try to fix on my own but I still get the error:
(node:10513) DeprecationWarning: Collection#filterArray: use Collection#filter instead TypeError: connection.play is not a function at queue.(anonymous function).voiceChannel.join.then.connection (/home/projectcamel/camel/commands/music/play.js:259:10) at <anonymous> (node:10513) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'leave' of undefined at queue.(anonymous function).voiceChannel.join.then.catch.e (/home/projectcamel/camel/commands/music/play.js:295:27) at <anonymous> (node:10513) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:10513) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
When ever I try to play a song with the command
>play <insert youtube link here>
Where ">" is my prefix.
from master-bot.
How did you get the bot to be on the channel and not play music? When there are no songs left in the queue the bot automatically leaves the channel.
Did you restart the bot while it played music and then you called leave?
from master-bot.
Alright so when I use the >play command it spits out that error into my console and plays no music so the bot stays in the channel indefinitely. Don't know why it happens, been debugging since last night and nothing seems to work. It has something to do with connection.play
not being a function.
EDIT:
adding the line
message.guild.voiceConnection.disconnect();
Allows me to kick the bot out when it's not playing any music.
from master-bot.
The problem with running Discord bots is they require tough set up and installation of many stuff like python 2.7, ffmpeg, and some linux packages if you're running on linux. It took me a week to get rid of errors on my Windows machine and Debian 9 machine(main bot machine).
What OS are you using?
from master-bot.
Running a Compute Engine on Google Cloud.
Current OS Version: Ubuntu 18.04.1 LTS (Bionic Beaver)
from master-bot.
Is the link you're providing as an argument a playlist?
from master-bot.
No, the test video I've been using is: https://www.youtube.com/watch?v=Cuyd2rgIBWg
from master-bot.
gif
This works on my end(no audio cuz gif), I'm trying to figure out what is the issue, I probably forgot to mention some package that you should install in the README
from master-bot.
Alright, just let me know. I appreciate it.
from master-bot.
@nmbarker Can you run apt list ffmpeg
on your ubuntu terminal and check if it is installed and up to date?
from master-bot.
What is the most recent version of ffmpeg?
apt list ffmpeg spits out
ffmpeg/bionic-updates,bionic-security,now 7:3.4.6-0ubuntu0.18.04.1 amd64 [installed]
from master-bot.
@nmbarker Mine spits out ffmpeg/stable,stable,now 7:3.2.12-1~deb9u1 amd64 [installed]
. There might be a slight chance the installed version you have is not correct.
Before I seek other solutions, please try to follow these 2 articles:
There is a ytdl package a discord.js dev published which avoides using ffmpeg for playing most music. I tried to use it but ran into many errors since it is still new, hopefully somewhere in the future I will replace ytdl-core with it.
from master-bot.
Still no dice, it still says that connection.play is not a function
from master-bot.
It doesn't make sense, .play is a function in discord.js/master it's literally on the docs.. I'll keep looking for solutions idk why it works on my end and not on yours
from master-bot.
Do you want to move this conversation into a discord just so I'm not blowing up your github inbox?
from master-bot.
hyperzone#1185
from master-bot.
@iNPGT If you didn't clone the repo, replace the versions of discord.js and discord.js commando in your package.json with:
"discord.js": "github:discordjs/discord.js#master",
"discord.js-commando": "github:discordjs/Commando"
That fixed the problem for nmbarker
from master-bot.
Must be you because it works fine for me.
from master-bot.
Will reopen if that won't solve it for you
from master-bot.
Related Issues (20)
- Alternative Postgres Hosting HOT 3
- Unable to run BOT after following setup bot guides HOT 9
- Unable to start up bot HOT 6
- bot cannot respond from container HOT 9
- Gif commands not working HOT 6
- Discussion - bot compatibility with other bots HOT 9
- Invalid enviroment Variables on startup HOT 3
- Crash when attempting to play song HOT 8
- Try signing in with a different account HOT 5
- napi-rs/canvas is not marked as a dependency
- Twitch command not working HOT 4
- Top and Controversial not working in Reddit command HOT 2
- Error: P1000: Authentication failed against database server at `localhost` HOT 5
- npm run dev:bot exited with code -4058 & npm run dev:dashboard exited with code -4058 HOT 8
- `npm run dev` outputting multiple errors HOT 1
- Features to be added back after turborepo rewrite HOT 2
- pnpm i fails HOT 10
- STUCK : Watching for files changes HOT 9
- Not able to access website and bot not responding on discord. HOT 3
- Docker Deployment HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from master-bot.