Getting error TypeError: client.actions.InteractionCreate.hasPermissionshandle is not a function

I'm getting the error TypeError: client.actions.InteractionCreate.hasPermissionshandle is not a function for some reason and I can't figure it out https://pastebin.com/yYf9kj5N
Pastebin
const { SlashCommandBuilder } = require('@discordjs/builders');modu...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
8 Replies
d.js toolkit
d.js toolkit2y ago
- 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.
Ethereal <3
Ethereal <3OP2y ago
[email protected] and v18.16.0
monbrey
monbrey2y ago
Can you share the full error please? That kinda suggests you've accidentally modified a discord.js file
Ethereal <3
Ethereal <3OP2y ago
C:\projects\SulfurBot\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4 client.actions.InteractionCreate.hasPermissionshandle(packet.d); ^ TypeError: client.actions.InteractionCreate.hasPermissionshandle is not a function at module.exports [as INTERACTION_CREATE] (C:\projects\SulfurBot\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (C:\projects\SulfurBot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:354:31) at WebSocketManager.<anonymous> (C:\projects\SulfurBot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:238:12) at WebSocketManager.emit (C:\projects\SulfurBot\node_modules@vladfrangu\async_event_emitter\dist\index.js:282:31) at WebSocketShard.<anonymous> (C:\projects\SulfurBot\node_modules@discordjs\ws\dist\index.js:1103:51) at WebSocketShard.emit (C:\projects\SulfurBot\node_modules@vladfrangu\async_event_emitter\dist\index.js:282:31) at WebSocketShard.onMessage (C:\projects\SulfurBot\node_modules@discordjs\ws\dist\index.js:938:14) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) Node.js v18.16.0 wait i think its referring to this:
client.on("interactionCreate", async (interaction) => {
if (!interaction.isCommand()) return;

const command = client.commands.get(interaction.commandName);

if (!command) {
console.error(`No command matching ${interaction.commandName} was found.`);
return;
}

try {
await command.execute(interaction);
} catch (error) {
console.error(error);

// Handle error response based on interaction state
if (interaction.replied || interaction.deferred) {
await interaction.followUp({ content: "There was an error while executing this command!", ephemeral: true });
} else {
await interaction.reply({ content: "There was an error while executing this command!", ephemeral: true });
}
}
});
client.on("interactionCreate", async (interaction) => {
if (!interaction.isCommand()) return;

const command = client.commands.get(interaction.commandName);

if (!command) {
console.error(`No command matching ${interaction.commandName} was found.`);
return;
}

try {
await command.execute(interaction);
} catch (error) {
console.error(error);

// Handle error response based on interaction state
if (interaction.replied || interaction.deferred) {
await interaction.followUp({ content: "There was an error while executing this command!", ephemeral: true });
} else {
await interaction.reply({ content: "There was an error while executing this command!", ephemeral: true });
}
}
});
monbrey
monbrey2y ago
No it isnt
monbrey
monbrey2y ago
GitHub
discord.js/packages/discord.js/src/client/websocket/handlers/INTERA...
A powerful JavaScript library for interacting with the Discord API - discord.js/packages/discord.js/src/client/websocket/handlers/INTERACTION_CREATE.js at main · discordjs/discord.js
monbrey
monbrey2y ago
You've somehow modified it by mistake A reinstall should fix it
Ethereal <3
Ethereal <3OP2y ago
thats weird that was the problem thanks
Want results from more Discord servers?
Add your server