sb
Explore posts from serversDIdiscord.js - Imagine ❄
•Created by sb on 1/1/2025 in #djs-questions
Mentioning users showing as unknown-user
13 replies
DIdiscord.js - Imagine ❄
•Created by sb on 1/1/2025 in #djs-questions
Expected SlashCommandSubcommandBuilder
data: new SlashCommandBuilder()
.setName('user').setDefaultMemberPermissions(0)
.setDescription('add user')
.addSubcommand(subCommand =>
subCommand.setName("add").setDescription("Add a user")
.addStringOption(option =>
option.setName("nickname").setDescription("nickname of the player").setRequired(true)
)
)
.addSubcommand(subCommand =>
subCommand.setName("remove").setDescription("Remove a user")
.addUserOption(option =>
option.setName("user").setDescription("User to remove")
)
)
.addSubcommand(subCommand => {
subCommand.setName("list").setDescription("Get list of users saved")
}),
async execute(interaction) {
data: new SlashCommandBuilder()
.setName('user').setDefaultMemberPermissions(0)
.setDescription('add user')
.addSubcommand(subCommand =>
subCommand.setName("add").setDescription("Add a user")
.addStringOption(option =>
option.setName("nickname").setDescription("nickname of the player").setRequired(true)
)
)
.addSubcommand(subCommand =>
subCommand.setName("remove").setDescription("Remove a user")
.addUserOption(option =>
option.setName("user").setDescription("User to remove")
)
)
.addSubcommand(subCommand => {
subCommand.setName("list").setDescription("Get list of users saved")
}),
async execute(interaction) {
list
subcommand has given this error
ExpectedValidationError: Expected
at _InstanceValidator.handle (C:\dev\discordBotRust\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:1531:75)
at _InstanceValidator.parse (C:\dev\discordBotRust\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:972:90)
at assertReturnOfBuilder (C:\dev\discordBotRust\node_modules\@discordjs\builders\dist\index.js:1638:53)
at MixedClass.addSubcommand (C:\dev\discordBotRust\node_modules\@discordjs\builders\dist\index.js:2563:5)
at Object.<anonymous> (C:\dev\discordBotRust\commands\user\user.js:32:10)
at Module._compile (node:internal/modules/cjs/loader:1256:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
at Module.load (node:internal/modules/cjs/loader:1119:32)
at Module._load (node:internal/modules/cjs/loader:960:12)
at Module.require (node:internal/modules/cjs/loader:1143:19) {
validator: 's.instance(V)',
given: undefined,
expected: [Function: SlashCommandSubcommandBuilder]
ExpectedValidationError: Expected
at _InstanceValidator.handle (C:\dev\discordBotRust\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:1531:75)
at _InstanceValidator.parse (C:\dev\discordBotRust\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:972:90)
at assertReturnOfBuilder (C:\dev\discordBotRust\node_modules\@discordjs\builders\dist\index.js:1638:53)
at MixedClass.addSubcommand (C:\dev\discordBotRust\node_modules\@discordjs\builders\dist\index.js:2563:5)
at Object.<anonymous> (C:\dev\discordBotRust\commands\user\user.js:32:10)
at Module._compile (node:internal/modules/cjs/loader:1256:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
at Module.load (node:internal/modules/cjs/loader:1119:32)
at Module._load (node:internal/modules/cjs/loader:960:12)
at Module.require (node:internal/modules/cjs/loader:1143:19) {
validator: 's.instance(V)',
given: undefined,
expected: [Function: SlashCommandSubcommandBuilder]
4 replies