Possible Bug In Validate Name

Hey, I'm trying to register a context menu command with the name "✅ Mark Solution" and encountering an error with the following stack, with the error being thrown from validateName (/workspace/node_modules/@discordjs/builders/dist/index.js:1480:18). Emojis are valid to have in Discord context menu command, attached is a screenshot from my bot in Python that has an emoji in its name - so I'm guessing this is a bug? Error Log
2023-01-30 19:00:42 - ERROR - Encountered error while handling the command application command registry for command ":white_check_mark: mark solution" at path "/workspace/apps/discord-bot/dist/commands/settings/mark-solution.js" ExpectedConstraintError > s.string.regex
2023-01-30 19:00:42 - ERROR - Invalid string format
2023-01-30 19:00:42 - ERROR -
2023-01-30 19:00:42 - ERROR - Expected: expected /^( *[\p{P}\p{L}\p{N}\p{sc=Devanagari}\p{sc=Thai}]+ *)+$/u.test(expected) to be true
2023-01-30 19:00:42 - ERROR -
2023-01-30 19:00:42 - ERROR - Received:
2023-01-30 19:00:42 - ERROR - | '✅ Mark Solution'
2023-01-30 19:00:42 - ERROR -
2023-01-30 19:00:42 - ERROR - at Object.run (/workspace/node_modules/@sapphire/shapeshift/dist/index.js:1582:64)
2023-01-30 19:00:42 - ERROR - at /workspace/node_modules/@sapphire/shapeshift/dist/index.js:201:66
2023-01-30 19:00:42 - ERROR - at Array.reduce (<anonymous>)
2023-01-30 19:00:42 - ERROR - at StringValidator.parse (/workspace/node_modules/@sapphire/shapeshift/dist/index.js:201:29)
2023-01-30 19:00:42 - ERROR - at validateName (/workspace/node_modules/@discordjs/builders/dist/index.js:1480:18)
2023-01-30 19:00:42 - ERROR - at ContextMenuCommandBuilder.setName (/workspace/node_modules/@discordjs/builders/dist/index.js:1516:5)
2023-01-30 19:00:42 - ERROR - at MarkSolution2.registerApplicationCommands (/workspace/apps/discord-bot/dist/commands/settings/mark-solution.js:42:88)
2023-01-30 19:00:42 - ERROR - at Object.handleRegistryAPICalls (/workspace/node_modules/@sapphire/framework/dist/lib/utils/application-commands/ApplicationCommandRegistries.js:39:23)
2023-01-30 19:00:42 - ERROR - at processTicksAndRejections (node:internal/process/task_queues:96:5)
2023-01-30 19:00:42 - ERROR - at async CoreEvent.run (/workspace/node_modules/@sapphire/framework/dist/listeners/CoreReady.js:18:5)
2023-01-30 19:00:42 - ERROR - Encountered error while handling the command application command registry for command ":white_check_mark: mark solution" at path "/workspace/apps/discord-bot/dist/commands/settings/mark-solution.js" ExpectedConstraintError > s.string.regex
2023-01-30 19:00:42 - ERROR - Invalid string format
2023-01-30 19:00:42 - ERROR -
2023-01-30 19:00:42 - ERROR - Expected: expected /^( *[\p{P}\p{L}\p{N}\p{sc=Devanagari}\p{sc=Thai}]+ *)+$/u.test(expected) to be true
2023-01-30 19:00:42 - ERROR -
2023-01-30 19:00:42 - ERROR - Received:
2023-01-30 19:00:42 - ERROR - | '✅ Mark Solution'
2023-01-30 19:00:42 - ERROR -
2023-01-30 19:00:42 - ERROR - at Object.run (/workspace/node_modules/@sapphire/shapeshift/dist/index.js:1582:64)
2023-01-30 19:00:42 - ERROR - at /workspace/node_modules/@sapphire/shapeshift/dist/index.js:201:66
2023-01-30 19:00:42 - ERROR - at Array.reduce (<anonymous>)
2023-01-30 19:00:42 - ERROR - at StringValidator.parse (/workspace/node_modules/@sapphire/shapeshift/dist/index.js:201:29)
2023-01-30 19:00:42 - ERROR - at validateName (/workspace/node_modules/@discordjs/builders/dist/index.js:1480:18)
2023-01-30 19:00:42 - ERROR - at ContextMenuCommandBuilder.setName (/workspace/node_modules/@discordjs/builders/dist/index.js:1516:5)
2023-01-30 19:00:42 - ERROR - at MarkSolution2.registerApplicationCommands (/workspace/apps/discord-bot/dist/commands/settings/mark-solution.js:42:88)
2023-01-30 19:00:42 - ERROR - at Object.handleRegistryAPICalls (/workspace/node_modules/@sapphire/framework/dist/lib/utils/application-commands/ApplicationCommandRegistries.js:39:23)
2023-01-30 19:00:42 - ERROR - at processTicksAndRejections (node:internal/process/task_queues:96:5)
2023-01-30 19:00:42 - ERROR - at async CoreEvent.run (/workspace/node_modules/@sapphire/framework/dist/listeners/CoreReady.js:18:5)
Sample Code
new ContextMenuCommandBuilder()
.setName("✅ Mark Solution")
.setDMPermission(false)
.setType(ApplicationCommandType.Message)
new ContextMenuCommandBuilder()
.setName("✅ Mark Solution")
.setDMPermission(false)
.setType(ApplicationCommandType.Message)
2 Replies
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
Rhys
Rhys17mo ago
npm list discord.js
ao-monorepo@0.0.0 /workspace
└─┬ @answeroverflow/discord-bot@1.0.0 -> ./apps/discord-bot
├─┬ @answeroverflow/api@0.1.0 -> ./packages/api
│ └── discord.js@14.7.1 deduped
├─┬ @answeroverflow/reacord@0.5.7
│ └── discord.js@14.7.1 deduped
└── discord.js@14.7.1
ao-monorepo@0.0.0 /workspace
└─┬ @answeroverflow/discord-bot@1.0.0 -> ./apps/discord-bot
├─┬ @answeroverflow/api@0.1.0 -> ./packages/api
│ └── discord.js@14.7.1 deduped
├─┬ @answeroverflow/reacord@0.5.7
│ └── discord.js@14.7.1 deduped
└── discord.js@14.7.1
Node: v16.18.0FeelsBadMan for the response, I’ll see about opening a GitHub issue on the discord api to see if they’ll either say emojis are/aren’t allowed
Want results from more Discord servers?
Add your server
More Posts