Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

157
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda