StringSelectMenu interaction isnt working

else if(interaction.isStringSelectMenu()) // String Select Menu Interactions
{
  const role = interaction.guild.roles.cache.get(ROLE_IDS[interaction.customId.toUpperCase()]);

  if(role)
  {
    const hasRole = interaction.member.roles.cache.has(role.id);

    if(hasRole)
      return interaction.member.roles
        .remove(role)
        .then((member) =>
          interaction.reply(
          {
            embeds: [EMBEDS.ROLE_REMOVED],
            ephemeral: true,
          })
        )
        .catch((err) =>
        {
          console.log(err);
          return interaction.reply(
          {
            embeds: [EMBEDS.ERROR],
            ephemeral: true,
          });
        });
    else
      return interaction.member.roles
        .add(role)
        .then((member) =>
          interaction.reply(
          {
            embeds: [EMBEDS.ROLE_ADDED],
            ephemeral: true,
          })
        )
        .catch((err) =>
        {
          console.log(err);
          return interaction.reply(
          {
            embeds: [EMBEDS.ERROR],
            ephemeral: true,
          });
        });
  }
}
Was this page helpful?