title: Why is "message.channel.find" not a function?
body: <p>I am creating a discord bot, and I want to create a "warn" command for it, to warn users in a discord server when they are misbehaving. But, when I run the code and try out the command it only gets to about halfway through, where an unhandled promise rejection message pops up, saying that I haven't defined my <code>message.channel.find()</code> function, even though I have fully defined it.   </p>
  
  <p>For some background, I am coding this bot in javascript, node.js to be more specific. I am using the discord.js library as well. I've tried restarting my code, re-entering what is inside of my parentheses, and even tried reformatting it a couple of times. But, none of that has worked. I've included my code to help you all better understand my issue.</p>
  
  <pre><code>// Here is where it starts to get shakey
  let firstslice = message.content.slice(6);
  let membertag = membertobewarned.tag;
  let reason = firstslice.slice(membertag);
  message.channel.send("Second debugging check, check!");
  
  // Here is where it stops working, and the line below this text is where I 
  // am getting unhandled promise rejection errors from.
  let warnchannel = message.channel.find(`name`, "logs");
  if (message.author.bot) return;
  if (!message.author.hasPermission("MANAGE_MESSAGES")) return message.channel.send("Sorry, but you do not have permission to use this command.");
  if (!membertobewarned.hasPermission("MANAGE_MESSAGES")) return message.channel.send("Sorry, but you cannot warn this member.");
  
  message.channel.send("Third debugging thing, check!");
  
  let warnembed = new Discord.RichEmbed()
    .setDescription("Warning")
    .setColor("#FFA500")
    .addField("User:", membertobewarned)
    .addField("Warned By:", commanduser)
    .addField("For Reason:", reason)
    .addField("Time:", timewarned);
  warnchannel.send(warnembed);
  
  message.channel.send("I'm all done!");
  </code></pre>
  
  <p>What's supposed to happen is the bot will get the channel the message was sent in, who to warn, who warned that person, their mention, and the reason for the warning.<br>
  It will then take that information, and compile it into a discord <code>RichEmbed</code>, and then send it into a <code>#logs</code> channel.<br>
  But, what actually happens is when the command is running, it takes all the info, and then right where it checks for the <code>#logs</code> channel, it throws the error:</p>
  
  <pre class="lang-none prettyprint-override"><code>UnhandledPromiseRejectionWarning TypeError: message.channel.find is not a function. 
  </code></pre>
  
  <p>I am hoping to be able to figure out why am I getting this error, and how to fix it. Thank you all for reading this, and I hope that you can all help me soon, and have and have an awesome rest of your day.</p>