larsrickert / discord-player-plus

🤖 Library for creating discord music bots using discord.js v14 written in TypeScript.
https://discordplayerplus.lars-rickert.de
MIT License
7 stars 2 forks source link

handleSlashCommand isCommand check error #4

Closed chudders1231 closed 2 years ago

chudders1231 commented 2 years ago

When using the example provided, passing the interaction through to handleSlashCommand throws an error reporting .isCommand as not a function.

[ERROR] 20:06:36 TypeError: interaction.isCommand is not a function

larsrickert commented 2 years ago

Hey, which version of discord-player-plus and discordjs are you using?

chudders1231 commented 2 years ago

Very sorry, i wrote that real quick and forgot to include any of that info.

discord-player-plus: 1.1.0 discord.js: 14.0.3

I have only tried the /help command. I quickly setup the example to mess around and instantly hit a road block. Unsure if you need any additional info.

larsrickert commented 2 years ago

Thanks for providing the information! I reproduced the steps from the Getting Started and Pre-build Slash Commands documentation and it works without any error.

The missing function (interaction.isCommand is not a function) was implemented in discord.js v13 and discord-player-plus < 1.1.0. Can try to follow the below steps to check if that fixes the issue?`

  1. Verify that you are using at least discord-player-plus version ^1.1.0 and discord.js version ^14.0.3 in your package.json
  2. Delete your node_modules folder and package-lock.json
  3. Run npm install
  4. Check if the error still exists
chudders1231 commented 2 years ago

Hi, i just deleted the package-lock.json file and the node_modules folder. I reinstalled everything, and it now works without a problem.

Thanks! I don't know what was different but at least it works now.

larsrickert commented 2 years ago

Great! Your're welcome 😄

If you face any other issues, please feel free to open another issue.