interaction deferreply

i used interaction.deferReply but console tells me haven't
const { SlashCommandBuilder, PermissionFlagsBits, EmbedBuilder } = require('discord.js');

module.exports = {
    data: new SlashCommandBuilder()
        .setName('eve')
        .setDescription('Select status of event.')
        .addSubcommand(subcommand =>
            subcommand
            .setName('status')
            .setDescription('The status of the event.')
            .addStringOption(option =>
                option
                .setName('sta')
                .setDescription('Status of event.')
        .setRequired(true)
                .addChoices(
                    { name: 'Accept', value: 'acc' },
                    { name: 'Deny', value: 'deny' },
                    { name: 'Pending', value: 'ped' },
                )
            )
        )
        .setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
        .setDMPermission(false),
  async execute(interaction) {
        const sta = interaction.options.getString('sta');
        const error = new EmbedBuilder()
        .setColor('Red')    
        .setTitle(`Error`)
        .setDescription(`Commmand error`);
        function Accept() {
            interaction.deferReply();
            interaction.editReply('222222');
            interaction.channel.send('111');
        }
        function Deny() {
            interaction.channel.send('111133331');
            interaction.editReply(
                `Status of this ticket has been changed to 🟢 - **ACCEPT**.

                We will offer Supervisions, when we are free to do that.
                :pushpin: Our Staff are notified about this event at the right time !
                
                >Please modify your event rules to the rules we need, and add our banner on the TMP event page
                
                Thanks for your choose us  understanding! :huge: 
                
                **Kind Regards,**
                **1111**
                **Marking | Event Manager / Event Supervisions**`);
        }
        function Pending() {
            interaction.channel.send('222222');
            interaction.deferReply();
            interaction.editReply({ content: 'Success!', ephemeral: true });
        }
        if (sta == 'acc') {
            Accept();
        } 
        else if (sta == 'deny') {
            Deny();
        } 
        else if (sta == 'ped') {
            Pending();
        } 
        else
        {
            interaction.deferReply();
            interaction.editReply(
                {embed:[error],
                });
            return;
        }
  },
};
Was this page helpful?