Need help with setting up a Role option in a slash command

im tryna make a command to specify a income role, when i try to start the bot i get this error:
/home/container/node_modules/@sapphire/shapeshift/dist/index.js:47
throw this.error;
^
ExpectedConstraintError: Invalid string format
at Object.run (/home/container/node_modules/@sapphire/shapeshift/dist/index.js:1587:64)
at /home/container/node_modules/@sapphire/shapeshift/dist/index.js:207:66
at Array.reduce (<anonymous>)
at StringValidator.parse (/home/container/node_modules/@sapphire/shapeshift/dist/index.js:207:29)
at validateName (/home/container/node_modules/@discordjs/builders/dist/index.js:1384:17)
at SlashCommandRoleOption.setName (/home/container/node_modules/@discordjs/builders/dist/index.js:1468:5)
at /home/container/commands/Administration/setup-income-roles.js:8:39
at MixedClass._sharedAddOptionMethod (/home/container/node_modules/@discordjs/builders/dist/index.js:2008:50)
at MixedClass.addRoleOption (/home/container/node_modules/@discordjs/builders/dist/index.js:1963:17)
at Object.<anonymous> (/home/container/commands/Administration/setup-income-roles.js:8:6) {
constraint: 's.string.regex',
given: 'Role',
expected: 'expected /^[\\p{Ll}\\p{Lm}\\p{Lo}\\p{N}\\p{sc=Devanagari}\\p{sc=Thai}_-]+$/u.test(expected) to be true'
}
Node.js v19.0.0
/home/container/node_modules/@sapphire/shapeshift/dist/index.js:47
throw this.error;
^
ExpectedConstraintError: Invalid string format
at Object.run (/home/container/node_modules/@sapphire/shapeshift/dist/index.js:1587:64)
at /home/container/node_modules/@sapphire/shapeshift/dist/index.js:207:66
at Array.reduce (<anonymous>)
at StringValidator.parse (/home/container/node_modules/@sapphire/shapeshift/dist/index.js:207:29)
at validateName (/home/container/node_modules/@discordjs/builders/dist/index.js:1384:17)
at SlashCommandRoleOption.setName (/home/container/node_modules/@discordjs/builders/dist/index.js:1468:5)
at /home/container/commands/Administration/setup-income-roles.js:8:39
at MixedClass._sharedAddOptionMethod (/home/container/node_modules/@discordjs/builders/dist/index.js:2008:50)
at MixedClass.addRoleOption (/home/container/node_modules/@discordjs/builders/dist/index.js:1963:17)
at Object.<anonymous> (/home/container/commands/Administration/setup-income-roles.js:8:6) {
constraint: 's.string.regex',
given: 'Role',
expected: 'expected /^[\\p{Ll}\\p{Lm}\\p{Lo}\\p{N}\\p{sc=Devanagari}\\p{sc=Thai}_-]+$/u.test(expected) to be true'
}
Node.js v19.0.0
3 Replies
d.js toolkit
d.js toolkit11mo 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!
NNKtv28
NNKtv2811mo ago
Gist
setup-income-roles.js
GitHub Gist: instantly share code, notes, and snippets.
NNKtv28
NNKtv2811mo ago
based on the docs of discord.js V14 its .addRoleOption but i dont know what im doing wrong there ? is that the issue? yes it was omfg thx mate