pawel02/discord-js-music-bot

Encountering error when using /play song

Closed this issue · 0 comments

I'm having trouble while following the tutorial. I run the command /play song. Here is my code in play.js, it can be found here.

The error I get is:

TypeError: Cannot read properties of undefined (reading 'createQueue')
    at Object.run (C:\Users\jagop\Desktop\Coding\DiscordBots\JBOT\src\commands\Music Bot\play.js:9:39)
    at Client.<anonymous> (C:\Users\jagop\Desktop\Coding\DiscordBots\JBOT\node_modules\commandkit\dist\handlers\command-handler\CommandHandler.js:236:31)
    at Client.emit (node:events:525:35)
    at InteractionCreateAction.handle (C:\Users\jagop\Desktop\Coding\DiscordBots\JBOT\node_modules\discord.js\src\client\actions\InteractionCreate.js:97:12)
    at module.exports [as INTERACTION_CREATE] (C:\Users\jagop\Desktop\Coding\DiscordBots\JBOT\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36)
    at WebSocketManager.handlePacket (C:\Users\jagop\Desktop\Coding\DiscordBots\JBOT\node_modules\discord.js\src\client\websocket\WebSocketManager.js:354:31)
    at WebSocketManager.<anonymous> (C:\Users\jagop\Desktop\Coding\DiscordBots\JBOT\node_modules\discord.js\src\client\websocket\WebSocketManager.js:238:12)
    at WebSocketManager.emit (C:\Users\jagop\Desktop\Coding\DiscordBots\JBOT\node_modules\@vladfrangu\async_event_emitter\dist\index.js:282:31)
    at WebSocketShard.<anonymous> (C:\Users\jagop\Desktop\Coding\DiscordBots\JBOT\node_modules\@discordjs\ws\dist\index.js:1103:51)
    at WebSocketShard.emit (C:\Users\jagop\Desktop\Coding\DiscordBots\JBOT\node_modules\@vladfrangu\async_event_emitter\dist\index.js:282:31)

Any help would be amazing!