title: Uncaught TypeError: Cannot read properties of undefined (reading 'roles')
body: <p>I want to make a whitlisted role to do a command and i puted this line</p>
  <pre class="lang-js prettyprint-override"><code>if (!message.guild.cache.roles.find(role =&gt; role.id === '873595824469344256')) return;
  </code></pre>
  <p>Error I get: <code>Uncaught TypeError: Cannot read properties of undefined (reading 'roles')</code></p>
  <pre class="lang-js prettyprint-override"><code>const Discord = require(&quot;discord.js&quot;);
  const { Client, Intents } = require('discord.js');
  const bot = new Discord.Client({ intents: [&quot;GUILDS&quot;, &quot;GUILD_MESSAGES&quot;, &quot;DIRECT_MESSAGE_TYPING&quot;, &quot;GUILD_MEMBERS&quot;, &quot;GUILD_PRESENCES&quot;] });
  const config = require('./config.json');
  const prefix = &quot;g!&quot;
  
  bot.on(&quot;ready&quot;, () =&gt; {
      console.log(`${bot.user.tag} bot is online`);
  });
  
  bot.on(&quot;messageCreate&quot;, message =&gt; {
      if(message.content === prefix + &quot;help&quot;) {
          if (!message.guild.cache.roles.find(role =&gt; role.id === '873595824469344256')) return;
          let helpembed = new Discord.MessageEmbed()
          .setColor('#0099ff')
          .setTitle('Help Guide')
          .setAuthor('Request : ' + `${message.author.username}`)
          .addFields(
              { name: 'Ban Usage', value: `${prefix}ban **id** | **reason** | **time** \n**__Exemple__** : ${prefix}ban id ALT-F4+Troll (without espace) 32H`},
              { name: 'Warn Usage', value: `${prefix}warn **id** | **reason** | **time** \n**__Exemple__** : ${prefix}warn id Bunny-Hope (without espace) warn-1/2/3`},
          )
          .setFooter('© ©');
      
      message.reply({ embeds: [helpembed] });
      };
  });
  </code></pre>