8 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!client.on(Events.InteractionCreate, interaction => {
if(!interaction.isChatInputCommand()) return;
if(interaction.isUserSelectMenu()) {
console.log('Hey')
}
console.log(client.commands)
let command = client.commands.get(interaction.commandName);
try {
if(interaction.replied) return;
command.execute(interaction)
} catch (error){
console.error(error);
}
});
No Error
Just wont print
Whenever the select menu is ranIf it is a select menu, then it can't be a chat input command... and that would make the first if statement return
Oh
Now I get this error
TypeError: Cannot read properties of undefined (reading 'execute')
at Client.<anonymous> (C:\Users\yeeca\Desktop\DMM Auto\index.js:32:17)
at Client.emit (node:events:513:28)
at InteractionCreateAction.handle (C:\Users\yeeca\Desktop\DMM Auto\node_modules\discord.js\src\client\actions\InteractionCreate.js:97:12)
at module.exports [as INTERACTION_CREATE] (C:\Users\yeeca\Desktop\DMM Auto\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (C:\Users\yeeca\Desktop\DMM Auto\node_modules\discord.js\src\client\websocket\WebSocketManager.js:354:31)
at WebSocketManager.<anonymous> (C:\Users\yeeca\Desktop\DMM Auto\node_modules\discord.js\src\client\websocket\WebSocketManager.js:238:12)
at WebSocketManager.emit (C:\Users\yeeca\Desktop\DMM Auto\node_modules@vladfrangu\async_event_emitter\dist\index.js:282:31)
at WebSocketShard.<anonymous> (C:\Users\yeeca\Desktop\DMM Auto\node_modules@discordjs\ws\dist\index.js:1103:51)
at WebSocketShard.emit (C:\Users\yeeca\Desktop\DMM Auto\node_modules@vladfrangu\async_event_emitter\dist\index.js:282:31)
at WebSocketShard.onMessage (C:\Users\yeeca\Desktop\DMM Auto\node_modules@discordjs\ws\dist\index.js:938:14)
cause of this line
command.execute(interaction)
command
isn't a thing or not imported.Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
yea that is what i meant, by undefined
It was just all the way up I figured it out