Event listener breaking upon using command

Hello, my bot cannot complete a command properly and as far as I can tell in the node console is that something is breaking in the event/command listener. I tried modifying the commands.get part, but my attempts at that only gave me the second error. I don't know why .get isn't a function as I am just following the example template bot's RegisterEvent file.
No description
13 Replies
d.js toolkit
d.js toolkit9mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Du
DuOP9mo ago
No description
Du
DuOP9mo ago
Listener:
No description
Du
DuOP9mo ago
Command:
No description
Danial
Danial9mo ago
Where and how are you calling that function?
Du
DuOP9mo ago
In the main.js
No description
Du
DuOP9mo ago
Here is the loaders as well if it is stemming all the way back to that
No description
Du
DuOP9mo ago
This is the result on Discord when attempting to use the command:
No description
Danial
Danial9mo ago
items is an array in the load function, so commands is also an array, and <Array>.get indeed does not exist Seems like you're using the create-discord-bot template but it's modified, in that template, loadCommands returns a Map, not an array And <Map>.get does exist
Du
DuOP9mo ago
I didn't intentionally do that, what is causing mine to not return a map and the create-discord-bot to return one? They appear to be doing the same thing to me.
Du
DuOP9mo ago
Oh, that functions return is different, I missed that, thank you
Danial
Danial9mo ago
Of course
Want results from more Discord servers?
Add your server