Getting a Type Error on getApplicationCommand function
Hello š
I have been learning how to make a discord bot and wanted to make an advanced command + event handler.
One of the things that I have found that I have to do is the
getApplicationCommand.js
function
Here is the code for said file
For some reason, I get this error: TypeError: Cannot read properties of undefined (reading 'fetch')
Any ideas?13 Replies
ā¢ What's your exact discord.js
npm list discord.js
and node node -v
version?
ā¢ Post the full error stack trace, not just the top part!
ā¢ Show your code!
ā¢ Explain what exactly your issue is.
ā¢ Not a discord.js issue? Check out #useful-servers.[email protected]
node version v18.12.1
on which fetch cann do you get the error
Bottom one
await applicationCommands.fetch();
Any idea what this issue may be? Or maybe just a better way to implement the handler all together?not really, but you can make a handler using your command files
I am doing this by following a tutorial by Under Ctrl, they do not experience this issue at all, so I'm pretty sure it has something to do with the discordjs version as he made the video 5 months ago ish
videos outdate pretty quickly, better to follow the guide
Alright I'll try to figure it out, moving on tho just a quick question, is there any way to create multipage modals? or do I have to make them submit the first one, and then send a prompt to open the next page?
yep
uh yep to the first part as in there is a way to do it, or yep to the 2nd part as in i have to do it the other way (doesn't really look nice)
yep to the second part, you'll have to show them a prompt
also note that .showModal cannot be used on a ModalSubmitInteraction so you'll have to use commands / buttons etc
Yeah alrighty thankyou very much, I still need to figure out how to do the advanced command + event handler, if I do end up experiencing any more issues ill come back here ig š