简体   繁体   中英

"The reply to this interaction has not been sent or deferred." Is an error I keep getting on discord.js v13

So I've just completed writing a ping.js, echo.js, guildMemberAdd.js, and guildMemberRemove.js and I'm moving on to writing a ban.js and kick.js and currently all slash commands work except the latest commands which is kick and ban. I keep getting the error that "The reply to this interaction has not been sent or deferred." and I have no idea how to find a solution to it. I originally had it written "return interaction.followUp" and I switched them all to "await interaction.followUp" hoping it'd be the solution the problem, but it seems like that wasn't it. I originally also had it written "run: async (interaction) => {" but then I get the error that "command.execute" is not a function so I switched it to "async execute (intereaction) {" I've also tried a couple of other things, but still can't seem to find a fix, does anyone have any idea on this? I'll leave my interactionCreate.js and kick.js below


    module.exports = {
        name: "interactionCreate",
        async execute(interaction) {
            if (!interaction.isCommand()) return;
    
            const command = interaction.client.commands.get(interaction.commandName);
    
            if (!command) return;
    
            try {
                await command.execute(interaction);
            } catch (err) {
                if (err) console.error(err);
    
                await interaction.reply({
                    content: "An error occured while executing that command.",
                    ephemeral: true
                });
            }
    
        }
    }

您可以在回复交互之前尝试编辑回复

"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM