How do I make the bot react to its own message and edit the previous sent embed?

I’m making a discord bot in discord.js and here’s the problem: When I react to the message, the bot gives me an error… maybe because I’ve tried multiple codes… (please also read the comments)

TypeError: Function.prototype.apply was called on #< Object >, which is a object and not a function

module.exports = { 
    name: 'emoji',
    group: 'misc',
    aliases: ['emoticon'],
    description: 'mostra ajuda.', 
    use:'.help <comando>',
    async execute(message,args){
        
        try{
            const filter = (reaction, user) => reaction.emoji.name === '▶️' && user.id === message.author.id;

            let newEmbed = new Discord.MessageEmbed() //I was using this to test the part where the bot edited the embed but I just ended up deleting that to see where the error was coming from.
                .setDescription('a')
            

            let ajuda = new Discord.MessageEmbed()
                .setColor('#0099ff')
                .setAuthor(`Comando por ${message.author.username}`, message.author.displayAvatarURL({dynamic: true}),message.url)
                .setTitle(`**Ajuda**`) 
                .setDescription('**Modo de uso:** .help <comando> n _Exemplo: .help config_')
                .addFields(
                    {name: '**configuração**', value: 'mostra comandos de.'},
                )
                .setTimestamp()
                .setFooter('[PRD] Corridas todos os direitos reservados.')
            await message.channel.send({embed: ajuda})
                .then(function (message) {
                    message.react("▶️")
                    message.awaitReactions({ filter, max: 1, time: 60000, errors: ['time'] })
                        .then(collected => {
                            const collect = collected.first();
                            if(emojis.first(collect.emoji) === '▶️') {
                                message.reply('code worked')// HERE SHOULD GO THE CODE TO EDIT THE EMBED INSTEAD.  
                            }
                        })
                            .catch(err => { 
                                console.log(err)
                            })
                        }).catch(function(){   

                        })      
        }
        catch(error){
            console.log(error)
        }
    }
}

Answer

I have tested your code and came up with a solution.

When you call the reaction collector you do:

message.awaitReactions({ filter, max: 1, time: 60000, errors: ['time'] })

And filter is your filter function, however I determined that the filter function is meant to be the first argument in the function, and the rest of the options is the second argument, thus the line should look something like this:

message.awaitReactions(filter, { max: 1, time: 60000, errors: ["time"] })

You got the code to edit the embed right

Essentially Your final code should look something like:
I took some liberties in formating the code and moving a few things around

module.exports = {
    name: "emoji",
    group: "misc",
    aliases: ["emoticon"],
    description: "mostra ajuda.",
    use: ".help <comando>",
    async execute(message, args) {
        try {
            const filter = (reaction, user) =>
                reaction.emoji.name === "▶️" && user.id === message.author.id;

            let ajuda = new Discord.MessageEmbed()
                .setColor("#0099ff")
                .setAuthor(
                    `Comando por ${message.author.username}`,
                    message.author.displayAvatarURL({ dynamic: true }),
                    message.url
                )
                .setTitle(`**Ajuda**`)
                .setDescription(
                    "**Modo de uso:** .help <comando> n _Exemplo: .help config_"
                )
                .addFields({
                    name: "**config**",
                    value: "shows config commands",
                })
                .setTimestamp()
                .setFooter("[PRD] Corridas todos os direitos reservados.");
            await message.channel
                .send({ embed: ajuda })
                .then(function (message) {
                    message.react("▶️");

                    message
                        .awaitReactions(filter, {
                            max: 1,
                            time: 60000,
                            errors: ["time"],
                        })

                        // When a reaction is collected
                        .then((collected) => {
                            let newEmbed =
                                new Discord.MessageEmbed().setDescription("a");

                            // Edit the embed
                            message.edit(newEmbed);
                        })
                        .catch((err) => {
                            console.log(err);
                        });
                })
                .catch(function () {
                    //Something
                });
        } catch (error) {
            console.log(error);
        }
    },
};