Applications commands are registered throug rest api but not working
Hello, I am having a bit of a problem.. I a file named
command.handler.ts
. This file is responsible for loading commands and registration of them through the rest api. This works fine and my test command is also available in my server.
However, when I execute the command nothing happens. I am not also not getting any output when I try to console.log(). The event for INTERACTION_CREATE
is also being registered.. so I am not getting why it does not work6 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.
- Issue solved? Press the button!DiscordJS Version: [email protected]
NodeJS Version: v16.14.2
command.handler.ts
:
ping.command.ts
:
interactionCreate.event.ts
:
ready.event.ts
:
Inside the ready event I am registering the application commands. I am also getting the success message of the ready event so the events are working as intended.
I do not get any errors logged just the discord message "The application did not respond"
So I assume it handles the command somewhere but console.log() in different places does not log anythingthe name is interactionCreate
Or use the Events enum as alternative
Huh.. okay when I logged GatewayDispatchEvents it logged "INTERACTION_CREATE" that's wyh I thought its named like that
Okay, so I get the logging now when it hits the handleInteraction.
But now is a point where I don't know anymore..
I am using the CommandInteraction type which does have the function isChatInputCommand
But now I just get the error
No stack trace whatsoever just this message
I think you should use
BaseInteraction
instead of ComamndInteraction
But BaseInteraction does not have the .reply function I have in my ping command to test if it's working
Also I am getting the same error that isChatInputCommand() is not a function :/
Okay, so I tried to log the commandName but it's undefined somehow
Hitted handleInteraction()! undefined - undefined
It ain't adding up tho lmao