Discord.js Music bot joins the voice channel and leaves it

The bot was joined to my voice channel and leaves it immediately. And the console log it says " undefined"

Just a thought, but are your bot permissions setup to allow connecting to voice channels?

Hello @SplitXPlayZ

Can you show me a full copy of the error you get in the logs, either by image, or by copying and pasting it here!

I allowed it, but nothing happens. Screenshot_115

It only says was undefined. Screenshot_114

Could you show the code you are using?

I fixed it, the problem was with the guild.

2 days later the bot again starting to say undefined, idk this the problem now.