Error with choices in slash commands

Error:
ExpectedConstraintError: Invalid string format
at Object.run (C:\Users\4339u\Desktop\UNORP2.2\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:2350:64)
at C:\Users\4339u\Desktop\UNORP2.2\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:939:67
at Array.reduce (<anonymous>)
at _StringValidator.parse (C:\Users\4339u\Desktop\UNORP2.2\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:939:29)
at validateName (C:\Users\4339u\Desktop\UNORP2.2\node_modules\@discordjs\builders\dist\index.js:1578:17)
at SlashCommandUserOption.setName (C:\Users\4339u\Desktop\UNORP2.2\node_modules\@discordjs\builders\dist\index.js:1678:5)
at C:\Users\4339u\Desktop\UNORP2.2\Commands\Duno-send.cjs:8:11
at MixedClass._sharedAddOptionMethod (C:\Users\4339u\Desktop\UNORP2.2\node_modules\@discordjs\builders\dist\index.js:2280:50)
at MixedClass.addUserOption (C:\Users\4339u\Desktop\UNORP2.2\node_modules\@discordjs\builders\dist\index.js:2212:17)
at Object.<anonymous> (C:\Users\4339u\Desktop\UNORP2.2\Commands\Duno-send.cjs:7:10) {
constraint: 's.string.regex',
given: 'UserID',
expected: 'expected /^[\\p{Ll}\\p{Lm}\\p{Lo}\\p{N}\\p{sc=Devanagari}\\p{sc=Thai}_-]+$/u.test(expected) to be true'
}

Node.js v20.11.0
ExpectedConstraintError: Invalid string format
at Object.run (C:\Users\4339u\Desktop\UNORP2.2\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:2350:64)
at C:\Users\4339u\Desktop\UNORP2.2\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:939:67
at Array.reduce (<anonymous>)
at _StringValidator.parse (C:\Users\4339u\Desktop\UNORP2.2\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:939:29)
at validateName (C:\Users\4339u\Desktop\UNORP2.2\node_modules\@discordjs\builders\dist\index.js:1578:17)
at SlashCommandUserOption.setName (C:\Users\4339u\Desktop\UNORP2.2\node_modules\@discordjs\builders\dist\index.js:1678:5)
at C:\Users\4339u\Desktop\UNORP2.2\Commands\Duno-send.cjs:8:11
at MixedClass._sharedAddOptionMethod (C:\Users\4339u\Desktop\UNORP2.2\node_modules\@discordjs\builders\dist\index.js:2280:50)
at MixedClass.addUserOption (C:\Users\4339u\Desktop\UNORP2.2\node_modules\@discordjs\builders\dist\index.js:2212:17)
at Object.<anonymous> (C:\Users\4339u\Desktop\UNORP2.2\Commands\Duno-send.cjs:7:10) {
constraint: 's.string.regex',
given: 'UserID',
expected: 'expected /^[\\p{Ll}\\p{Lm}\\p{Lo}\\p{N}\\p{sc=Devanagari}\\p{sc=Thai}_-]+$/u.test(expected) to be true'
}

Node.js v20.11.0
Code:
data: new D.SlashCommandBuilder()
.setName("uno-send")
.setDescription("Takes your message and sends it to the member")
.addUserOption(option =>
option.setName('UserID').setDescription('The member to send message to').setRequired(true))
.addUserOption(option =>
option.setName('Preset').setDescription('The preset to use, write 0 for no preset').setRequired(true))
.addUserOption(option =>
option.setName('msg').setDescription('Comments to the message').setRequired(true)),
data: new D.SlashCommandBuilder()
.setName("uno-send")
.setDescription("Takes your message and sends it to the member")
.addUserOption(option =>
option.setName('UserID').setDescription('The member to send message to').setRequired(true))
.addUserOption(option =>
option.setName('Preset').setDescription('The preset to use, write 0 for no preset').setRequired(true))
.addUserOption(option =>
option.setName('msg').setDescription('Comments to the message').setRequired(true)),
Any tips?
6 Replies
d.js toolkit
d.js toolkit8mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by staff
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
U
U8mo ago
Huh, i had no idea. Thanks wish the discord.js guides showed that.
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
U
U8mo ago
Ah, guess i didnt read it. Thanks
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server