Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

172
Views
permissionOverwrites not working properly while creating channel

While creating I'd like to deny the VIEW_CHANNEL permission for the @everyone role. While creating the channel it doesn't work. However after handling the promise using permissionOverwrites.edit does work. Does anyone why it behaves this weird. I've included the code below:

client.on('messageCreate', (message) => {
    let guild = message.guild;
    if(message.content === '.raid'){
        const ch = guild.channels.create(`${message.member.displayName}\'s raid`, {
            type: 'GUILD_VOICE',
            parent: state.categories.raids,
            userLimit:50,
            permissionOverwrites: [
                {
                    //@everyone ID
                    //This does not work.
                    id: state.roles.everyone,
                    deny: ['VIEW_CHANNEL'],
             },
         ],
        }).then(channel => {
            //This works
            client.channels.cache.get(channel.id).permissionOverwrites.edit(state.roles.everyone, {VIEW_CHANNEL : false});
        })
    }
})
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!