title: TypeError: message.guild.channels.filter is not a function
body: <p>I'm currently working on a Discord bot using discord.js for a server. While working on a command to display the server's information, I came across an error.</p>
  
  <p>Here's the code:</p>
  
  <pre><code>const dateFormat = require('dateformat');
  const Discord = require('discord.js');
  const colors = require('../colors.json');
  
  const date = new Date();
  dateFormat(date, 'dddd, mmmm dS, yyyy, h:MM:ss TT');
  
  exports.run = async (client, message, args, ops) =&gt; {
  
      const millis = new Date().getTime() - message.guild.createdAt.getTime();
      const days = millis / 1000 / 60 / 60 / 24;
  
      const owner = message.guild.owner.user || {};
  
      const verificationLevels = ['None ,(^.^),', 'Low ┬─┬ ノ( ゜-゜ノ)', 'Medium ヽ(ຈل͜ຈ)ﾉ︵ ┻━┻ ', 'High (╯°□°）╯︵ ┻━┻', 'Extreme ┻━┻彡 ヽ(ಠ益ಠ)ノ彡┻━┻'];
  
      let embed = new Discord.MessageEmbed()
                      .setThumbnail(message.guild.iconURL)
                      .setFooter(`requested by ${message.author.username}#${message.author.discriminator}`, message.author.avatarURL)
                      .setColor(colors.cyan)
                      .addField('Server Name', message.guild.name, true)
                      .addField('Server ID', message.guild.id, true)
                      .addField('Owner',`${owner.username + "#" + owner.discriminator || '� Owner not found...'}`,true)
                      .addField('Owner ID', `${owner.id || '� Owner not found...'}`,true)
                      .addField('Created On',`${dateFormat(message.guild.createdAt)}`, true)
                      .addField('Days Since Creation', `${days.toFixed(0)}`, true)
                      .addField('Region',`${message.guild.region}`, true)
                      .addField('Verification Level',`${verificationLevels[message.guild.verificationLevel]}`,true)
                      .addField('Text Channels',`${message.guild.channels.filter(m =&gt; m.type === 'text').size}`,true)
                      .addField('Voice Channels',`${message.guild.channels.filter(m =&gt; m.type === 'voice').size}`,true)
                      .addField('Member Count',`${message.guild.members.filter(m =&gt; m.presence.status !== 'offline').size} / ${message.guild.memberCount}`, true)
                      .addField('Roles',`${message.guild.roles.size}`,true)
                      message.channel.send(embed);
  }
  </code></pre>
  
  <p>And here's the error:</p>
  
  <pre><code>(node:17432) UnhandledPromiseRejectionWarning: TypeError: message.guild.channels.filter is not a function
      at Object.exports.run (C:\Users\brigh\Desktop\XontavsBot\commands\serverinfo.js:29:73)
      at Client.client.on (C:\Users\brigh\Desktop\XontavsBot\index.js:30:21)
      at Client.emit (events.js:197:13)
      at MessageCreateAction.handle (C:\Users\brigh\Desktop\XontavsBot\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
      at Object.module.exports [as MESSAGE_CREATE] (C:\Users\brigh\Desktop\XontavsBot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
      at WebSocketManager.handlePacket (C:\Users\brigh\Desktop\XontavsBot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:386:31)
      at WebSocketShard.onPacket (C:\Users\brigh\Desktop\XontavsBot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:435:22)
      at WebSocketShard.onMessage (C:\Users\brigh\Desktop\XontavsBot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:293:10)
      at WebSocket.onMessage (C:\Users\brigh\Desktop\XontavsBot\node_modules\ws\lib\event-target.js:120:16)
      at WebSocket.emit (events.js:197:13)
  (node:17432) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
  (node:17432) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
  </code></pre>
  
  <p>If anybody knows what the problem is, please let me know.</p>