title: discord js, deafen a mentioned user
body: <p>I'm probably misunderstanding exactly what's being returned by the <code>members</code> object here, but I'm attempting to test a <code>deafen</code> command within my bot - the documentation for discord.js states that the <code>Message</code> object contains a <code>Mentions</code> property that holds all the valid mentions within a sent message, from there, I can drill down a bit further and get to the <code>Members</code> property from within <code>Mentions</code> - which returns a collection of <code>GuildMembers</code> that have been mentioned in the message - which is what I want. The problems arises when I attempt to grab those <code>GuildMember</code> objects from within the collection that I get back - I'm not quite sure what I'm doing wrong, but I get back errors.  The code I have is as follows:</p>
  
  <pre><code>module.exports = {
      name: 'deafen',
      cooldown: 5,
      description: 'Deafens mentioned user or users.',
      args: true,
      execute(message) {
          const taggedMembers = message.mentions.members;
  
          for(const member of taggedMembers) {
              member.setDeaf(true)
                  .then(() =&gt; console.log(`Deafened ${member.displayName}`))
                  .catch(console.error);
          }
      },
  };
  </code></pre>
  
  <p>and I get back this error in my terminal window:</p>
  
  <pre><code>TypeError: member.setDeaf is not a function 
      at Object.execute (/home/tai/dev/FutabaBot/commands/admin/deafen.js:10:20)
      at Client.&lt;anonymous&gt; (/home/tai/dev/FutabaBot/FutabaBot.js:80:17)
      at Client.emit (events.js:210:5)
      at MessageCreateHandler.handle (/home/tai/dev/FutabaBot/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)     
      at WebSocketPacketManager.handle (/home/tai/dev/FutabaBot/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:105:65) 
      at WebSocketConnection.onPacket (/home/tai/dev/FutabaBot/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35)
      at WebSocketConnection.onMessage (/home/tai/dev/FutabaBot/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:296:17)
      at WebSocket.onMessage (/home/tai/dev/FutabaBot/node_modules/ws/lib/event-target.js:120:16)
      at WebSocket.emit (events.js:210:5)
      at Receiver.receiverOnMessage (/home/tai/dev/FutabaBot/node_modules/ws/lib/websocket.js:789:20)
  </code></pre>
  
  <p>I'm not sure if it's necessary, but I can post the other pieces of code that relate to this - and the documentation for discord.js can be found <a href="https://discord.js.org/#/docs/main/stable/general/welcome" rel="nofollow noreferrer">here</a></p>