I have added a StringOption to a slash command in my Discord.js bot that I wish to validate before the command is sent.
I can limit the length of the string with .setMaxLength()
and .setMinLength()
but I would like to further restrict what can be input.
There are too many valid entries (approximately 600) to use Choices and I would prefer not to break it up and add several Required Options to an already Option-heavy Command.
Is there a way to validate user string input (perhaps using RegEx) inside the SlashCommandBuilder or is my only option to wait until the command is sent and reply with a message saying their input was invalid?