skick1234 / DisTube

A powerful Discord.js module for simplifying music commands and effortless playback of various sources with integrated audio filters.
https://distube.js.org
MIT License
423 stars 94 forks source link

Cannot read property 'guildQueues' of undefined #103

Closed unqxl closed 3 years ago

unqxl commented 3 years ago

Please describe your problem in as much detail as possible: So, I tryed to create Music Control using Discord.JS Buttons, but DisTube keeps send me error "TypeError: Cannot read property 'guildQueues' of undefined" Code and Full Error on screenshots.

error code

Further information:

skick1234 commented 3 years ago

Because DisTube class this in the getQueue() is not the DisTube class, and it is undefined. Check how you declared and called this method, not related to distube source code.

unqxl commented 3 years ago

So uh, maybe I didn't understand You, but I think that all is ok.., first second

unqxl commented 3 years ago

It used to work well, but it seems that after updating the module, something went wrong

skick1234 commented 3 years ago

It used to work well, but it seems that after updating the module, something went wrong

Sometimes, clean install solve this npm ci I cannot reproduce your error.

unqxl commented 3 years ago

Still not working... But thanks.

skick1234 commented 3 years ago

Still not working... But thanks.

It's due to you declared your function. This makes your getQueue variable is a clone function of DisTube.getQueue method and this is undefined in a function.

To fix it, just use const music = client.music instead, then use music.getQueue()