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

156
Views
Channel permissionOverwrites

For some reason whenever I assign permission overwrites for @everyone when making a channel it doesn't actually do the overwrites I select.

    if (!interaction.isButton()) return
    if (interaction.customId === 'ticketcreate') 
            {
                
                const ticketCreation = await interaction.guild.channels.create(interaction.user.username + ' ticket', { //Create ticket channel
                    type: 'GUILD_TEXT',
                    permissionOverwrites: [
                        {
                            id: interaction.user.id,
                            allow: ["VIEW_CHANNEL", "READ_MESSAGE_HISTORY", "SEND_MESSAGES"]
                        },
                        {
                            id: interaction.guild.roles.everyone,
                            deny: ["VIEW_CHANNEL", "READ_MESSAGE_HISTORY"]
                        }
                    ],
                })

So this should make everyone in the guild not be able to view the channel or read message history and make the person that interacted with the button view the channel and read message history. However it doesn't do this. (this button creates a support ticket and I don't want everyone to be able to see the support ticket for obvious reasons)

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

you're passing in strings for the permissions...I believe the docs say this should be bitfield flags...here's the specs:

https://discord.js.org/#/docs/discord.js/stable/class/GuildChannelManager?scrollTo=create

and the example listed shows the code example too:

deny: [Permissions.FLAGS.VIEW_CHANNEL],

info from discordjs on Permissions: https://discordjs.guide/popular-topics/permissions.html#terminology

scroll down to Base permissions #Setting role permissions

guild.channels.create('new-channel', {
    type: 'GUILD_TEXT',
    permissionOverwrites: [
        {
            id: message.guild.id,
            deny: [Permissions.FLAGS.VIEW_CHANNEL],
        },
        {
            id: message.author.id,
            allow: [Permissions.FLAGS.VIEW_CHANNEL],
        },
    ],
});```
about 4 years ago · Juan Pablo Isaza Report
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!