help needed

ializing... [ERROR] Encountered error while handling the command application command registry for command "ban" at path "/home/runner/bot/commands/ban.js" TypeError: Cannot read properties of undefined (reading 'FLAGS') at /home/runner/bot/commands/ban.js:27:46 at Object.normalizeChatInputCommand (/home/runner/bot/node_modules/@sapphire/framework/dist/cjs/lib/utils/application-commands/normalizeInputs.cjs:30:5) at _ApplicationCommandRegistry.registerChatInputCommand (/home/runner/bot/node_modules/@sapphire/framework/dist/cjs/lib/utils/application-commands/ApplicationCommandRegistry.cjs:65:43) at BanCommand.registerApplicationCommands (/home/runner/bot/commands/ban.js:11:14) at Object.handleRegistryAPICalls (/home/runner/bot/node_modules/@sapphire/framework/dist/cjs/lib/utils/application-commands/ApplicationCommandRegistries.cjs:63:23) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async _CoreListener.run (/home/runner/bot/node_modules/@sapphire/framework/dist/cjs/listeners/CoreReady.cjs:16:5) at async Object.fromAsync (/home/runner/bot/node_modules/@sapphire/result/dist/cjs/index.cjs:619:22) at async _CoreListener._run (/home/runner/bot/node_modules/@sapphire/framework/dist/cjs/lib/structures/Listener.cjs:27:22) at async _CoreListener._runOnce (/home/runner/bot/node_modules/@sapphire/framework/dist/cjs/lib/structures/Listener.cjs:31:5) THIS ERROR in this
.setRequiredPermissions([permissions.FLAGS.BAN_MEMBERS])
.setRequiredPermissions([permissions.FLAGS.BAN_MEMBERS])
Solution:
alright
Jump to solution
55 Replies
UndiedGFX
UndiedGFX4mo ago
i want to see what exactly "permissions" is in your code
PHI
PHI4mo ago
ok
kyra
kyra4mo ago
permissions.FLAGS.BAN_MEMBERS is discord.js v13, Sapphire v4 and upwards require v14.
UndiedGFX
UndiedGFX4mo ago
also i think it is permissions.Flags
PHI
PHI4mo ago
so what to give in there? .setRequiredPermissions([permissions.FLAGS.BAN_MEMBERS])
kyra
kyra4mo ago
PermissionsFlagsBits.BanMember
PHI
PHI4mo ago
ok thanks!
UndiedGFX
UndiedGFX4mo ago
discord.js
discord.js
discord.js is a powerful Node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
UndiedGFX
UndiedGFX4mo ago
@kyra 🩵🩷🤍🩷🩵 where was the djs docs search command
kyra
kyra4mo ago
It’s much shorter to use the enum directly Uhh I think @Favna removed it from Spinel in favour of using the djs docs bot directly
PHI
PHI4mo ago
now this error
the command application command registry for command "ban" at path "/home/runner/bot/commands/ban.js" ReferenceError: PermissionsFlagsBits is not defined
at /home/runner/bot/commands/ban.js:27:34
at Object.normalizeChatInputCommand (/home/runner/bot/node_modules/@sapphire/framework/dist/cjs/lib/utils/application-commands/normalizeInputs.cjs:30:5)
at _ApplicationCommandRegistry.registerChatInputCommand (/home/runner/bot/node_modules/@sapphire/framework/dist/cjs/lib/utils/application-commands/ApplicationCommandRegistry.cjs:65:43)
at BanCommand.registerApplicationCommands (/home/runner/bot/commands/ban.js:11:14)
at Object.handleRegistryAPICalls (/home/runner/bot/node_modules/@sapphire/framework/dist/cjs/lib/utils/application-commands/ApplicationCommandRegistries.cjs:63:23)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async _CoreListener.run (/home/runner/bot/node_modules/@sapphire/framework/dist/cjs/listeners/CoreReady.cjs:16:5)
at async Object.fromAsync (/home/runner/bot/node_modules/@sapphire/result/dist/cjs/index.cjs:619:22)
at async _CoreListener._run (/home/runner/bot/node_modules/@sapphire/framework/dist/cjs/lib/structures/Listener.cjs:27:22)
at async _CoreListener._runOnce (/home/runner/bot/node_modules/@sapphire/framework/dist/cjs/lib/structures/Listener.cjs:31:5)
the command application command registry for command "ban" at path "/home/runner/bot/commands/ban.js" ReferenceError: PermissionsFlagsBits is not defined
at /home/runner/bot/commands/ban.js:27:34
at Object.normalizeChatInputCommand (/home/runner/bot/node_modules/@sapphire/framework/dist/cjs/lib/utils/application-commands/normalizeInputs.cjs:30:5)
at _ApplicationCommandRegistry.registerChatInputCommand (/home/runner/bot/node_modules/@sapphire/framework/dist/cjs/lib/utils/application-commands/ApplicationCommandRegistry.cjs:65:43)
at BanCommand.registerApplicationCommands (/home/runner/bot/commands/ban.js:11:14)
at Object.handleRegistryAPICalls (/home/runner/bot/node_modules/@sapphire/framework/dist/cjs/lib/utils/application-commands/ApplicationCommandRegistries.cjs:63:23)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async _CoreListener.run (/home/runner/bot/node_modules/@sapphire/framework/dist/cjs/listeners/CoreReady.cjs:16:5)
at async Object.fromAsync (/home/runner/bot/node_modules/@sapphire/result/dist/cjs/index.cjs:619:22)
at async _CoreListener._run (/home/runner/bot/node_modules/@sapphire/framework/dist/cjs/lib/structures/Listener.cjs:27:22)
at async _CoreListener._runOnce (/home/runner/bot/node_modules/@sapphire/framework/dist/cjs/lib/structures/Listener.cjs:31:5)
UndiedGFX
UndiedGFX4mo ago
you have to import it
kyra
kyra4mo ago
Import it from discord.js
PHI
PHI4mo ago
what permissions?
kyra
kyra4mo ago
Or discord-api-types/v10
Want results from more Discord servers?
Add your server