#command handler help
1 messages · Page 1 of 1 (latest)
So what do u think i should do
I can't tell you without seeing your handler code
1s
lemme send
module.exports = {
name: 'interactionCreate',
execute(interaction, client) {
if (!interaction.isCommand()) return;
const command = client.commands.get(interaction.commandName);
if (!command) return;
try {
command.execute(interaction);
} catch (error) {
console.error(error);
interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true });
}
},
};```
command.execute(interaction)
oki
if you call command.execute(interaction) then client will be your interaction and interaction will be undefined inside the function