title: message.guild.createChannel is not a function
body: <p>Hello I'm making a ticket bot for my server.
  But I'm getting error like <code>message.guild.createChannel is not a function</code></p>
  
  <p>The code</p>
  
  <pre><code>if (message.content.toLowerCase().startsWith(prefix + `openticket`)) {
      const reason = message.content.split(" ").slice(1).join(" ");
      if (message.guild.channels.cache.find(c =&gt; c === `ticket-${message.author.id}`)) return message.channel.send(`You already opened a ticket.`);
      message.guild.createChannel(`ticket-${message.author.id}`, "text").then(c =&gt; {
          let role2 = message.guild.roles.find("name", "@everyone");
          c.overwritePermissions(role, {
              SEND_MESSAGES: true,
              READ_MESSAGES: true
          });
          c.overwritePermissions(role2, {
              SEND_MESSAGES: false,
              READ_MESSAGES: false
          });
          c.overwritePermissions(message.author, {
              SEND_MESSAGES: true,
              READ_MESSAGES: true
          });
          message.channel.send(`:white_check_mark: Your ticket is opened, #${c.name}.`);
          const embed = new Discord.RichEmbed()
          .setColor(0xCF40FA)
          .addField(`Hey ${message.author.username}!`, `Your Ticket is opened.`)
          .setTimestamp();
          c.send({ embed: embed });
          message.delete();
      }).catch(console.error);
  }
  </code></pre>
  
  <p>İ think the code is too old. I got this code from my friends.</p>