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
UndiedGFX6mo ago
i want to see what exactly "permissions" is in your code
PHI
PHIOP6mo ago
ok
kyra
kyra6mo ago
permissions.FLAGS.BAN_MEMBERS is discord.js v13, Sapphire v4 and upwards require v14.
UndiedGFX
UndiedGFX6mo ago
also i think it is permissions.Flags
PHI
PHIOP6mo ago
so what to give in there? .setRequiredPermissions([permissions.FLAGS.BAN_MEMBERS])
kyra
kyra6mo ago
PermissionsFlagsBits.BanMember
PHI
PHIOP6mo ago
ok thanks!
UndiedGFX
UndiedGFX6mo 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
UndiedGFX6mo ago
@kyra 🩵🩷🤍🩷🩵 where was the djs docs search command
kyra
kyra6mo 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
PHIOP6mo 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
UndiedGFX6mo ago
you have to import it
kyra
kyra6mo ago
Import it from discord.js
PHI
PHIOP6mo ago
what permissions?
kyra
kyra6mo ago
Or discord-api-types/v10
UndiedGFX
UndiedGFX6mo ago
const { PermissionsFlagsBits } = require('discord.js') add this to the top (and yes they use cjs kyra)
kyra
kyra6mo ago
I know, I saw cjs in the error stack
PHI
PHIOP6mo ago
now this error
[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 'BanMember')
at /home/runner/bot/commands/ban.js:26:55
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:10: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)
[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 'BanMember')
at /home/runner/bot/commands/ban.js:26:55
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:10: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)
kyra
kyra6mo ago
Ok, what version of discord.js do you have installed? And @sapphire/framework while we’re at it
PHI
PHIOP6mo ago
v14
{
"name": "nodejs",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@sapphire/framework": "^5.2.1",
"@types/node": "^18.0.6",
"discord-api-types": "^0.37.79",
"discord.js": "^14.15.2"
}
}
{
"name": "nodejs",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@sapphire/framework": "^5.2.1",
"@types/node": "^18.0.6",
"discord-api-types": "^0.37.79",
"discord.js": "^14.15.2"
}
}
see
kyra
kyra6mo ago
You can remove the discord-api-types dependency, it’s re-exported by discord.js Installing it without extra (and slightly more advanced steps) would install a version not compatible with discord.js
PHI
PHIOP6mo ago
ok so how to resolve the error
UndiedGFX
UndiedGFX6mo ago
its PermissionsFlagsBits.BanMembers there was a mistake my apologies from kyra's side
PHI
PHIOP6mo ago
[ERROR] Encountered error while handling the command application command registry for command "ban" at path "/home/runner/bot/commands/ban.js" ReferenceError: PermissionFlagsBits is not defined
at /home/runner/bot/commands/ban.js:26: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:10: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)
[ERROR] Encountered error while handling the command application command registry for command "ban" at path "/home/runner/bot/commands/ban.js" ReferenceError: PermissionFlagsBits is not defined
at /home/runner/bot/commands/ban.js:26: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:10: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)
now this error
UndiedGFX
UndiedGFX6mo ago
i edited it pal
kyra
kyra6mo ago
Show your code please
PHI
PHIOP6mo ago
const { Command } = require("@sapphire/framework");
const { EmbedBuilder, PermissionsFlagsBits } = require("discord.js");

class BanCommand extends Command {
constructor(context, options) {
super(context, { ...options });
}

registerApplicationCommands(registry) {
registry.registerChatInputCommand((builder) =>
builder
.setName("ban")
.setDescription("Ban a member from the server")
.addUserOption((option) =>
option
.setName("member")
.setDescription("The member to ban")
.setRequired(true),
)
.addStringOption((option) =>
option
.setName("reason")
.setDescription("The reason for the ban (optional)")
.setRequired(false),
)
.setRequiredPermissions([PermissionFlagsBits.BanMembers])
);
}
const { Command } = require("@sapphire/framework");
const { EmbedBuilder, PermissionsFlagsBits } = require("discord.js");

class BanCommand extends Command {
constructor(context, options) {
super(context, { ...options });
}

registerApplicationCommands(registry) {
registry.registerChatInputCommand((builder) =>
builder
.setName("ban")
.setDescription("Ban a member from the server")
.addUserOption((option) =>
option
.setName("member")
.setDescription("The member to ban")
.setRequired(true),
)
.addStringOption((option) =>
option
.setName("reason")
.setDescription("The reason for the ban (optional)")
.setRequired(false),
)
.setRequiredPermissions([PermissionFlagsBits.BanMembers])
);
}
UndiedGFX
UndiedGFX6mo ago
kyra its fixed @PHI
PHI
PHIOP6mo ago
still error
UndiedGFX
UndiedGFX6mo ago
PermissionsFlagsBits.BanMembers
PHI
PHIOP6mo ago
[ERROR] Encountered error while handling the command application command registry for command "ban" at path "/home/runner/bot/commands/ban.js" ReferenceError: PermissionFlagsBits is not defined
at /home/runner/bot/commands/ban.js:26: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:10: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)
[ERROR] Encountered error while handling the command application command registry for command "ban" at path "/home/runner/bot/commands/ban.js" ReferenceError: PermissionFlagsBits is not defined
at /home/runner/bot/commands/ban.js:26: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:10: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)
now this error
UndiedGFX
UndiedGFX6mo ago
good lord
kyra
kyra6mo ago
Permissions
UndiedGFX
UndiedGFX6mo ago
.
Photon
Photon6mo ago
Import it if not defined
PHI
PHIOP6mo ago
how to
UndiedGFX
UndiedGFX6mo ago
🤦‍♂️
PHI
PHIOP6mo ago
@Priyam see code imported already @Priyam see code imported already see
kyra
kyra6mo ago
Oh it's PermissionFlagsBits Singular Permission
UndiedGFX
UndiedGFX6mo ago
const { Command } = require("@sapphire/framework");
const { EmbedBuilder, PermissionFlagsBits } = require("discord.js");

class BanCommand extends Command {
constructor(context, options) {
super(context, { ...options });
}

registerApplicationCommands(registry) {
registry.registerChatInputCommand((builder) =>
builder
.setName("ban")
.setDescription("Ban a member from the server")
.addUserOption((option) =>
option
.setName("member")
.setDescription("The member to ban")
.setRequired(true),
)
.addStringOption((option) =>
option
.setName("reason")
.setDescription("The reason for the ban (optional)")
.setRequired(false),
)
.setRequiredPermissions([PermissionFlagsBits.BanMembers])
);
}
const { Command } = require("@sapphire/framework");
const { EmbedBuilder, PermissionFlagsBits } = require("discord.js");

class BanCommand extends Command {
constructor(context, options) {
super(context, { ...options });
}

registerApplicationCommands(registry) {
registry.registerChatInputCommand((builder) =>
builder
.setName("ban")
.setDescription("Ban a member from the server")
.addUserOption((option) =>
option
.setName("member")
.setDescription("The member to ban")
.setRequired(true),
)
.addStringOption((option) =>
option
.setName("reason")
.setDescription("The reason for the ban (optional)")
.setRequired(false),
)
.setRequiredPermissions([PermissionFlagsBits.BanMembers])
);
}
use this code @PHI
kyra
kyra6mo ago
Looks good
PHI
PHIOP6mo ago
Ready! Logged in as Soda#5947
[INFO] ApplicationCommandRegistries: Initializing...
[ERROR] Encountered error while handling the command application command registry for command "ban" at path "/home/runner/bot/commands/ban.js" TypeError: builder.setName(...).setDescription(...).addUserOption(...).addStringOption(...).setRequiredPermissions is not a function
at /home/runner/bot/commands/ban.js:26:10
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:10: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)
[INFO] ApplicationCommandRegistries: Took 5ms to initialize.

this error now
Ready! Logged in as Soda#5947
[INFO] ApplicationCommandRegistries: Initializing...
[ERROR] Encountered error while handling the command application command registry for command "ban" at path "/home/runner/bot/commands/ban.js" TypeError: builder.setName(...).setDescription(...).addUserOption(...).addStringOption(...).setRequiredPermissions is not a function
at /home/runner/bot/commands/ban.js:26:10
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:10: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)
[INFO] ApplicationCommandRegistries: Took 5ms to initialize.

this error now
PHI
PHIOP6mo ago
now this error
Ready! Logged in as Soda#5947
[INFO] ApplicationCommandRegistries: Initializing...
[ERROR] Encountered error while handling the command application command registry for command "ban" at path "/home/runner/bot/commands/ban.js" CombinedError (4)
Received one or more errors

1 ValidationError > s.nullish
| Expected undefined or null
|
| Received:
| | [ {} ]

2 ValidationError > s.bigint
| Expected a bigint primitive
|
| Received:
| | [ {} ]

3 ValidationError > s.number
| Expected a number primitive
|
| Received:
| | [ {} ]

4 ValidationError > s.string
| Expected a string primitive
|
| Received:
| | [ {} ]

at _UnionValidator.handle (/home/runner/bot/node_modules/@sapphire/shapeshift/dist/cjs/index.cjs:1854:23)
at _UnionValidator.parse (/home/runner/bot/node_modules/@sapphire/shapeshift/dist/cjs/index.cjs:939:90)
at validateDefaultMemberPermissions (/home/runner/bot/node_modules/@discordjs/builders/dist/index.js:1639:36)
at MixedClass.setDefaultMemberPermissions (/home/runner/bot/node_modules/@discordjs/builders/dist/index.js:1796:29)
at /home/runner/bot/commands/ban.js:26:10
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:10: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)
[INFO] ApplicationCommandRegistries: Took 3ms to initialize.
Ready! Logged in as Soda#5947
[INFO] ApplicationCommandRegistries: Initializing...
[ERROR] Encountered error while handling the command application command registry for command "ban" at path "/home/runner/bot/commands/ban.js" CombinedError (4)
Received one or more errors

1 ValidationError > s.nullish
| Expected undefined or null
|
| Received:
| | [ {} ]

2 ValidationError > s.bigint
| Expected a bigint primitive
|
| Received:
| | [ {} ]

3 ValidationError > s.number
| Expected a number primitive
|
| Received:
| | [ {} ]

4 ValidationError > s.string
| Expected a string primitive
|
| Received:
| | [ {} ]

at _UnionValidator.handle (/home/runner/bot/node_modules/@sapphire/shapeshift/dist/cjs/index.cjs:1854:23)
at _UnionValidator.parse (/home/runner/bot/node_modules/@sapphire/shapeshift/dist/cjs/index.cjs:939:90)
at validateDefaultMemberPermissions (/home/runner/bot/node_modules/@discordjs/builders/dist/index.js:1639:36)
at MixedClass.setDefaultMemberPermissions (/home/runner/bot/node_modules/@discordjs/builders/dist/index.js:1796:29)
at /home/runner/bot/commands/ban.js:26:10
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:10: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)
[INFO] ApplicationCommandRegistries: Took 3ms to initialize.
@kyra 🩵🩷🤍🩷🩵 ^
kyra
kyra6mo ago
We can't handhold you on every single step, please read the docs
PHI
PHIOP6mo ago
ok
Favna
Favna6mo ago
Correct because souji has access to the doc search dB so it's much better @UndiedGFX
PHI
PHIOP6mo ago
Ready! Logged in as Soda#5947
[INFO] ApplicationCommandRegistries: Initializing...
[ERROR] Encountered error while handling the command application command registry for command "ban" at path "/home/runner/bot/commands/ban.js" CombinedError (4)
Received one or more errors

1 ValidationError > s.nullish
| Expected undefined or null
|
| Received:
| | [ {} ]

2 ValidationError > s.bigint
| Expected a bigint primitive
|
| Received:
| | [ {} ]

3 ValidationError > s.number
| Expected a number primitive
|
| Received:
| | [ {} ]

4 ValidationError > s.string
| Expected a string primitive
|
| Received:
| | [ {} ]

at _UnionValidator.handle (/home/runner/bot/node_modules/@sapphire/shapeshift/dist/cjs/index.cjs:1854:23)
at _UnionValidator.parse (/home/runner/bot/node_modules/@sapphire/shapeshift/dist/cjs/index.cjs:939:90)
at validateDefaultMemberPermissions (/home/runner/bot/node_modules/@discordjs/builders/dist/index.js:1639:36)
at MixedClass.setDefaultMemberPermissions (/home/runner/bot/node_modules/@discordjs/builders/dist/index.js:1796:29)
at /home/runner/bot/commands/ban.js:26:10
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:10: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)
[INFO] ApplicationCommandRegistries: Took 4ms to initialize.
Ready! Logged in as Soda#5947
[INFO] ApplicationCommandRegistries: Initializing...
[ERROR] Encountered error while handling the command application command registry for command "ban" at path "/home/runner/bot/commands/ban.js" CombinedError (4)
Received one or more errors

1 ValidationError > s.nullish
| Expected undefined or null
|
| Received:
| | [ {} ]

2 ValidationError > s.bigint
| Expected a bigint primitive
|
| Received:
| | [ {} ]

3 ValidationError > s.number
| Expected a number primitive
|
| Received:
| | [ {} ]

4 ValidationError > s.string
| Expected a string primitive
|
| Received:
| | [ {} ]

at _UnionValidator.handle (/home/runner/bot/node_modules/@sapphire/shapeshift/dist/cjs/index.cjs:1854:23)
at _UnionValidator.parse (/home/runner/bot/node_modules/@sapphire/shapeshift/dist/cjs/index.cjs:939:90)
at validateDefaultMemberPermissions (/home/runner/bot/node_modules/@discordjs/builders/dist/index.js:1639:36)
at MixedClass.setDefaultMemberPermissions (/home/runner/bot/node_modules/@discordjs/builders/dist/index.js:1796:29)
at /home/runner/bot/commands/ban.js:26:10
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:10: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)
[INFO] ApplicationCommandRegistries: Took 4ms to initialize.
can help in error plz
Favna
Favna6mo ago
This is where this tag applies, also Kyra already answered that. We can't handhold you every step. At that point we might as well write the bot for you as a paid service.
Spinel
Spinel6mo ago
Before you make a Discord Bot, you should have a good understanding of JavaScript. This means you should have a basic understanding of the following topics: - Read and understand docs - Debug code - Syntax - NodeJS module system If you aren't sure that your understanding of JavaScript is truly good enough to make a bot, you should try to continue learning first. Here are good resources to learn both Javascript and NodeJS: - Codecademy: https://www.codecademy.com/learn/javascript - Udemy: https://www.udemy.com/javascript-essentials/ - Eloquent JavaScript, free book: http://eloquentjavascript.net/ - You-Dont-Know-JS: https://github.com/getify/You-Dont-Know-JS - JavaScript Garden: https://bonsaiden.github.io/JavaScript-Garden/ - JavaScript reference/docs: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference - Nodeschool: https://nodeschool.io/ - Pluralsight: https://www.codeschool.com/courses/real-time-web-with-node-js Before you ask a question, you should ask these yourself: 1. Is this question related to JavaScript, or the library I am using? - If it is the library you are using, go to the proper server. You would get better answers there. 2. Have I tried to google and/or check StackOverflow? - Double-check that you can't find anywhere that can lead you to a solution online. 3. Have I tried to look on MDN or the library documentation? - You should always check documentation to make sure you aren't missing any details. 4. Does my question make enough sense so that people can understand it, and do they understand what I am trying to accomplish? - If no, revise your question. Give as much detail as possible. Include any error or code output that can help us help you. 5. Am I aware of what I am doing, and not just mindlessly copying and pasting? - If you are just copying and pasting code from a guide, you are not going to be able to solve anything. Make sure you understand the code you are writing.
Solution
UndiedGFX
UndiedGFX6mo ago
alright
UndiedGFX
UndiedGFX6mo ago
@Favna you might need to reconsider the marked solution 💀
Favna
Favna6mo ago
lol... cant. @Rhys any particular reason for that btw?
UndiedGFX
UndiedGFX6mo ago
that feature would be so helpful tbh
PHI
PHIOP6mo ago
not helpful at all
Want results from more Discord servers?
Add your server