#Getting: Invalid bitfield flag or number: VIEW_CHANNEL. (creating a text channel)

4 messages · Page 1 of 1 (latest)

echo sentinel
#

dont rlly know.
code:

        collector.on('collect', async(i) => {
            const selection = i.values.join(', ')
            if(selection==='report') {
                i.guild.channels.create({
                    name: `report-ticket-${i.user.tag}`,
                    type: ChannelType.GuildText,
                    parent: ticketCategory,
                    permissionOverwrites: [
                    {
                        id: i.guild.roles.cache.find(r => r.name==='@everyone').id,
                        deny: ['VIEW_CHANNEL'],
                    }
                ]
                })
            }
        })
tame carbonBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • Consider reading #how-to-get-help to improve your question!
  • Explain what exactly your issue is.
  • Post the full error stack trace, not just the top part!
  • Show your code!
  • Issue solved? Press the button!
  • Marked as resolved by OP
grand burrowBOT
#

RangeError [BitFieldInvalid]: Invalid bitfield flag or number: undefined

  • All SCREAMING_SNAKE_CASE enums have been changed to PascalCase
  • Intents: Intents.FLAGS.GUILD_MESSAGES -> GatewayIntentBits.GuildMessages
  • Permissions: Permissions.FLAGS.SEND_MESSAGES -> PermissionFlagsBits.SendMessages
echo sentinel
#

Ah, it's ViewChannel.