title: Change Permissions Of A Channel Just Created
body: <p>I have the below code which is intended to create a new channel with a name. This works fine. It then needs to set the permissions of the channel to making it VIEW_CHANNEL false for all users. It then needs to overwrite permissions for the message author to grant them VIEW_CHANNEL. Im getting stuck on how to make the permissions apply on the channel just created.</p>
  
  <pre><code>const Discord = require("discord.js");
  
  module.exports.run = async (bot, message, args) =&gt; {
  
  let botIcon = bot.user.displayAvatarURL;
  let ticketEmbed = new Discord.RichEmbed()
  .setDescription("TicketBot")
  .setColor("#bc0000")
  .setThumbnail(botIcon)
  .addField("New Ticket", `${message.author} your ticket has been created.`);
  
  let ticketchannel = message.guild.channels.find(`name`, "bot-testing");
  if(!ticketchannel) return message.channel.send("Couldn't find bot testing channel.");
  
  ticketchannel.send(ticketEmbed);
  
  function getRandomInt(max) {
    return Math.floor(Math.random() * Math.floor(max));
  }
  let ticketid = getRandomInt(10000);
  let name = `ticket-${message.author.username}-${ticketid}`;
  
  message.guild.createChannel(name, "text")
  .then(
  
      message.channel.overwritePermissions(message.author, {
          VIEW_CHANNEL: true
      })
  );    
  }
  
  module.exports.help = {
      name: "new"
  }
  </code></pre>