Max 4310
Max 4310

Reputation: 3

TypeError: PermissionsBitField is not a constructor

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.

Upvotes: 0

Views: 93

Answers (1)

SimProch
SimProch

Reputation: 148

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.

Upvotes: 2

Related Questions