#TypeError: interaction.isCommand is not a function

1 messages · Page 1 of 1 (latest)

edgy cedar

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);
            }
        }
    }
}