Home > other >  TypeError: PermissionsBitField is not a constructor
TypeError: PermissionsBitField is not a constructor

Time:01-23

after consulting the documentation I wrote this code:

const {PermissionsBitField} = require("discord.js"); console.log(new PermissionsBitField(8n).toArray())

in theory i should print in console: ["administrator"]

bat doesn't work the error is: TypeError: PermissionsBitField is not a constructor.

I am using discord.js v13.7.

CodePudding user response:

That is because PermissionsBitField does not exist in v13 - there's another class called Permissions. If you need to use v13, then refer to the v13 docs or upgrade to newer version.

  • Related