Valid way to check if role?

Hey, if this is a valid method to check if a user has the specific role needed? If not, is there any other ways? Haven't gotten the hang of the one specified in the docs.

  async execute(interaction) {
    // Check if user has role "Dev"
    if (!interaction.member.roles.cache.has('1151994432678273034')) {
      return interaction.reply({
        content: 'You do not have permission to use this command.',
        ephemeral: true,
      });
Was this page helpful?