title: discord.js bot crashes after trying to send a message in a channel it can't send messages
body: <p>Well discord.js bot crashes after trying to send a message in a channel it sees but can't send messages</p>
  <p>well I get a crash after that, how can I fix this? here is the error it shows it shows for other commands too</p>
  <pre class="lang-js prettyprint-override"><code> /home/pi/Desktop/floppa_gaming/node_modules/discord.js/src/rest/RequestHandler.js:298
        throw new DiscordAPIError(data, res.status, request);
              ^
  
  DiscordAPIError: Missing Permissions
      at RequestHandler.execute (/home/pi/Desktop/floppa_gaming/node_modules/discord.js/src/rest/RequestHandler.js:298:13)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)
      at async RequestHandler.push (/home/pi/Desktop/floppa_gaming/node_modules/discord.js/src/rest/RequestHandler.js:50:14)
      at async TextChannel.send (/home/pi/Desktop/floppa_gaming/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:171:15) {
    method: 'post',
    path: '/channels/785243249072930869/messages',
    code: 50013,
    httpStatus: 403,
    requestData: {
      json: {
        content: 'You can use get help by saying &quot;floppa help&quot; in the chat :wink:',
        tts: false,
        nonce: undefined,
        embeds: undefined,
        components: undefined,
        username: undefined,
        avatar_url: undefined,
        allowed_mentions: undefined,
        flags: undefined,
        message_reference: undefined,
        attachments: undefined,
        sticker_ids: undefined
      },
      files: []
    }
  }
  </code></pre>
  <p>and if anyobody wants to see my terrible code here it is</p>
  <pre class="lang-js prettyprint-override"><code> const { Client, Intents, MessageEmbed, Permissions } = require('discord.js');
  const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES,] });
  
  
  var fs = require('fs');
  var files = fs.readdirSync('./floppa/');
  
  
  
  client.on('ready', () =&gt; {
    client.user.setStatus('invisible') //You can set idle, dnd or invisible
    client.user.setActivity(&quot;use floppa to get a image!&quot;,  { type: 'PLAYING' }) // PLAYING , LISTENING , WATCHING , STREAMING
    console.log(&quot;on discord lol&quot;);
  });
  
  
  
   const { AutoPoster } = require('topgg-autoposter')
  
   const poster = AutoPoster('token', client) // tells topgg amount of servers ur bot is in 
  
   // optional
   poster.on('posted', (stats) =&gt; { // ran when succesfully posted
    console.log(`Posted stats to Top.gg | ${stats.serverCount} servers`)
  })
  
  
   client.on('message', msg =&gt; {
      if (msg.content === 'floppa') 
      {
          imageNumber = files[Math.floor(Math.random()*files.length)]
          msg.channel.send ( {files: [&quot;./floppa/&quot; + imageNumber]} )
      }
          
  // finds a random image in a folder
   
  </code></pre>