discord.js - Imagine ❄d-I❄
discord.js - Imagine ❄12mo ago
8 replies
Alix

TypeError: interaction.isCommand is not a function

I made a instagram command however when i try to do the command i get the error

" TypeError: interaction.isCommand is not a function"

export async function InteractionCreate(interaction: BaseInteraction): Promise<void> {
    try {
        if (interaction.isCommand()) {  // General check for command interactions
            if (interaction instanceof ChatInputCommandInteraction) {
                await handleCommandInteraction(interaction);
            }
        } else if (interaction.isButton()) {
            await handleButtonInteraction(interaction);
        }
    } catch (error) {
        console.error("Error handling interaction:", error);

        if (interaction.isRepliable() && !interaction.replied && !interaction.deferred) {
            try {
                await interaction.reply({
                    content: "An error occurred while processing your request.",
                    ephemeral: true
                });
            } catch (replyError) {
                console.error("Error sending error message:", replyError);
            }
        }
    }
}
Was this page helpful?