'Why my reaction role command is not giving roles?

I have been messing around with this reaction role command, and it is meant to send embed, react to it, and give reaction roles. It does send embed and reacts to it, but it wont give any roles?

I would appreciate very much if someone could help me with this struggling, im not going to give up with this.

Error that i get:

throw new TypeError('INVALID_TYPE', 'roles', 'Role, Snowflake or Array or Collection of Roles or Snowflakes'); ^

TypeError [INVALID_TYPE]: Supplied roles is not a Role, Snowflake or Array or Collection of Roles or Snowflakes. at GuildMemberRoleManager.add


Reactionrole.js:



module.exports = {
    name: 'reactionrole',
    description: "Sends Embed with reactionrole!",
    async execute(message, args, Discord, kaoru) {
        const { MessageEmbed } = require('discord.js');
        


        //Define roles and emojis
        const FemaleRole =  message.guild.roles.cache.get('Female');
        const MaleRole = message.guild.roles.cache.get('Male');

        const emoji1 = '♀️';
        const emoji2 = '♂️';


        //Embed
        
            let embed = new MessageEmbed()
                .setColor("#FF6BDB")
                .setTitle(" <:pink_sakura:926036002932416542> Choose Gender <:pink_sakura:926036002932416542> ")
               
                .addFields(
                    {
                        name: "————————————",
                        value: "᲼᲼",
                    },
                    {   name: "᲼᲼᲼᲼♀️ Female ♀️\n᲼᲼᲼᲼♂️   Male   ♂️",
                        value: "᲼᲼",
                    },

                {
                        name: "————————————",
                        value: "᲼᲼",
                }
                   
                )
                


        //sends embed and reacts

        message.channel.send({ embeds: [embed] })
            .then(m => {
                m.react(`${emoji1}`);
                m.react(`${emoji2}`);
             });
            
            
    
      
     //Gives roles
     kaoru.on('messageReactionAdd', async (reaction, user) => {
        if (reaction.message.partial) await reaction.message.fetch();
        if (reaction.partial) await reaction.fetch();
        if (user.bot) return;
        if (!reaction.message.guild) return;

        
            if (reaction.emoji.name === emoji1) {
                await reaction.message.guild.members.cache.get(user.id).roles.add(FemaleRole)
            }
            if (reaction.emoji.name === emoji2) {
                await reaction.message.guild.members.cache.get(user.id).roles.add(MaleRole)
            }
     })
            
        
      
    

    kaoru.on('messageReactionRemove', async (reaction, user) => {
        if (reaction.message.partial) await reaction.message.fetch();
        if (reaction.partial) await reaction.fetch();
        if (user.bot) return;
        if (!reaction.message.guild) return;

      
            if (reaction.emoji.name === emoji1) {
                await reaction.message.guild.members.cache.get(user.id).roles.remove(FemaleRole)
            }
            if (reaction.emoji.name === emoji2) {
                await reaction.message.guild.members.cache.get(user.id).roles.remove(MaleRole)
            }
        
    });
}
}


Solution 1:[1]

<GuildRoleManager>.cache.get() expects a valid ID (snowflake) as an argument, so does any other cached managers.

const member = ...
const someRole = guild.roles.cache.get("123456789012345678900")

member.roles.add(someRole)

If you needed to find roles by own names, consider using the find() method instead.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Palm