Code Monkey home page Code Monkey logo

Comments (24)

roledxd avatar roledxd commented on May 23, 2024

welp

from master-bot.

galnir avatar galnir commented on May 23, 2024

@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.

nmbarker avatar nmbarker commented on May 23, 2024

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.

galnir avatar galnir commented on May 23, 2024

@nmbarker I'll debug this today, thanks for letting me know

from master-bot.

galnir avatar galnir commented on May 23, 2024

@nmbarker @iNPGT I pushed a new commit, can you check if that solves the problem? Works on my end

from master-bot.

nmbarker avatar nmbarker commented on May 23, 2024

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.

galnir avatar galnir commented on May 23, 2024

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.

nmbarker avatar nmbarker commented on May 23, 2024

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.

galnir avatar galnir commented on May 23, 2024

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.

nmbarker avatar nmbarker commented on May 23, 2024

Running a Compute Engine on Google Cloud.
Current OS Version: Ubuntu 18.04.1 LTS (Bionic Beaver)

from master-bot.

galnir avatar galnir commented on May 23, 2024

Is the link you're providing as an argument a playlist?

from master-bot.

nmbarker avatar nmbarker commented on May 23, 2024

No, the test video I've been using is: https://www.youtube.com/watch?v=Cuyd2rgIBWg

from master-bot.

galnir avatar galnir commented on May 23, 2024

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.

nmbarker avatar nmbarker commented on May 23, 2024

Alright, just let me know. I appreciate it.

from master-bot.

galnir avatar galnir commented on May 23, 2024

@nmbarker Can you run apt list ffmpeg on your ubuntu terminal and check if it is installed and up to date?

from master-bot.

nmbarker avatar nmbarker commented on May 23, 2024

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.

galnir avatar galnir commented on May 23, 2024

@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:

  1. Uninstall ffmpeg
  2. Install ffmpeg again

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.

nmbarker avatar nmbarker commented on May 23, 2024

Still no dice, it still says that connection.play is not a function

from master-bot.

galnir avatar galnir commented on May 23, 2024

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.

nmbarker avatar nmbarker commented on May 23, 2024

Do you want to move this conversation into a discord just so I'm not blowing up your github inbox?

from master-bot.

galnir avatar galnir commented on May 23, 2024

hyperzone#1185

from master-bot.

galnir avatar galnir commented on May 23, 2024

@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.

 avatar commented on May 23, 2024

Must be you because it works fine for me.

from master-bot.

galnir avatar galnir commented on May 23, 2024

Will reopen if that won't solve it for you

from master-bot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.