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
55 Replies
i want to see what exactly "permissions" is in your code
ok
permissions.FLAGS.BAN_MEMBERS
is discord.js v13, Sapphire v4 and upwards require v14.also i think it is
permissions.Flags
so what to give in there?
.setRequiredPermissions([permissions.FLAGS.BAN_MEMBERS])
PermissionsFlagsBits.BanMember
ok thanks!
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.
@kyra 🩵🩷🤍🩷🩵 where was the djs docs search command
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
now this error
you have to import it
Import it from
discord.js
what permissions?
Or
discord-api-types/v10