How to remove all permissions of the 'everyone' role?

Is there a way to remove all permissions of the @everyone role using the setPermissions() function?
11 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Syjalo
Syjalo2y ago
Pass '0'
PAdventures
PAdventuresOP2y ago
that doesn't work Ive tried
Syjalo
Syjalo2y ago
Show the code
PAdventures
PAdventuresOP2y ago
guild.roles.everyone.setPermissions(0)
E:\Yara Bot\node_modules\discord.js\src\util\BitField.js:168
throw new RangeError(ErrorCodes.BitFieldInvalid, bit);
^

RangeError [BitFieldInvalid]: Invalid bitfield flag or number: 0.
at Function.resolve (E:\Yara Bot\node_modules\discord.js\src\util\BitField.js:168:11)
at new BitField (E:\Yara Bot\node_modules\discord.js\src\util\BitField.js:33:38)
at new PermissionsBitField (E:\Yara Bot\node_modules\discord.js\src\util\PermissionsBitField.js:12:1)
at RoleManager.edit (E:\Yara Bot\node_modules\discord.js\src\managers\RoleManager.js:203:74)
at Role.edit (E:\Yara Bot\node_modules\discord.js\src\structures\Role.js:219:29)
at Role.setPermissions (E:\Yara Bot\node_modules\discord.js\src\structures\Role.js:298:17)
at Object.execute (E:\Yara Bot\Events\Guild\guildCreate.js:10:34)
at Client.<anonymous> (E:\Yara Bot\Handlers\eventHandler.js:25:63)
at Client.emit (node:events:520:28)
at Object.module.exports [as GUILD_CREATE] (E:\Yara Bot\node_modules\discord.js\src\client\websocket\handlers\GUILD_CREATE.js:23:14)
at WebSocketManager.handlePacket (E:\Yara Bot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:352:31)
at WebSocketShard.onPacket (E:\Yara Bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:481:22)
at WebSocketShard.onMessage (E:\Yara Bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:321:10)
at WebSocket.onMessage (E:\Yara Bot\node_modules\ws\lib\event-target.js:199:18)
at WebSocket.emit (node:events:520:28)
at Receiver.receiverOnMessage (E:\Yara Bot\node_modules\ws\lib\websocket.js:1178:20) {
code: 'BitFieldInvalid'
}
E:\Yara Bot\node_modules\discord.js\src\util\BitField.js:168
throw new RangeError(ErrorCodes.BitFieldInvalid, bit);
^

RangeError [BitFieldInvalid]: Invalid bitfield flag or number: 0.
at Function.resolve (E:\Yara Bot\node_modules\discord.js\src\util\BitField.js:168:11)
at new BitField (E:\Yara Bot\node_modules\discord.js\src\util\BitField.js:33:38)
at new PermissionsBitField (E:\Yara Bot\node_modules\discord.js\src\util\PermissionsBitField.js:12:1)
at RoleManager.edit (E:\Yara Bot\node_modules\discord.js\src\managers\RoleManager.js:203:74)
at Role.edit (E:\Yara Bot\node_modules\discord.js\src\structures\Role.js:219:29)
at Role.setPermissions (E:\Yara Bot\node_modules\discord.js\src\structures\Role.js:298:17)
at Object.execute (E:\Yara Bot\Events\Guild\guildCreate.js:10:34)
at Client.<anonymous> (E:\Yara Bot\Handlers\eventHandler.js:25:63)
at Client.emit (node:events:520:28)
at Object.module.exports [as GUILD_CREATE] (E:\Yara Bot\node_modules\discord.js\src\client\websocket\handlers\GUILD_CREATE.js:23:14)
at WebSocketManager.handlePacket (E:\Yara Bot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:352:31)
at WebSocketShard.onPacket (E:\Yara Bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:481:22)
at WebSocketShard.onMessage (E:\Yara Bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:321:10)
at WebSocket.onMessage (E:\Yara Bot\node_modules\ws\lib\event-target.js:199:18)
at WebSocket.emit (node:events:520:28)
at Receiver.receiverOnMessage (E:\Yara Bot\node_modules\ws\lib\websocket.js:1178:20) {
code: 'BitFieldInvalid'
}
Syjalo
Syjalo2y ago
Should be 0n (BigInt) or '0' (string), not a number
PAdventures
PAdventuresOP2y ago
guild.roles.everyone.setPermissions('0n'); like this?
Syjalo
Syjalo2y ago
No
PAdventures
PAdventuresOP2y ago
guild.roles.everyone.setPermissions('0'); like this?
Syjalo
Syjalo2y ago
0n or '0'. not '0n'
PAdventures
PAdventuresOP2y ago
ok thanks
Want results from more Discord servers?
Add your server