#Channel can be viewed by everyone when permission is set to deny viewing channel

17 messages · Page 1 of 1 (latest)

high belfry
#

My command creates a new text channel, it was working earlier but recently noticed it was allowing the everyone role to be set to allow everyone to view the current channel.

 permissionOverwrites: [
        {
          id: interaction.guild.roles.everyone,
          deny: [PermissionsBitField.Flags.ViewChannel],
        },

My code is right, right?

maiden echo
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

high belfry
#

node v: v18.12.1

high belfry
#

anyone??

timber arrow
#

That looks correct

high belfry
#

I've resolved it now code was acting up for some reason had to re write it out and it now works

tall silo
#

I have the same but it is not working.

#
 const channel = await interaction.guild.channels.create({
        name: 'new-general',
        type: ChannelType.GuildText,
        permissionOverwrites: [
           {
             id: interaction.guild.roles.everyone,
             allow: [PermissionsBitField.Flags.ViewChannel],
          },
        ],
      })
odd walrus
tall silo
#

sync

#

but i have this now js permissionOverwrites: [ { id: interaction.guild.roles.everyone, deny: [PermissionsBitField.Flags.ViewChannel], }, { id: interaction.user.id, allow: [PermissionsBitField.Flags.ViewChannel], }, { id: interaction.user.id, allow: [PermissionsBitField.Flags.SendMessages], }, ],

#

the second one is not working

#

viewchannel for the member

odd walrus
#

Because you overwrite it with the third one having the same id… add the two permissions into one overwrite (that’s why allow takes an array)