Skip to content

Commit

Permalink
fix: Disallow special characters in shortcut names
Browse files Browse the repository at this point in the history
  • Loading branch information
LordLuceus committed May 14, 2024
1 parent 07b3d50 commit cf2bdbd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/commands/dice/rollShortcut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,10 @@ export class RollShortcutCommand extends Subcommand {
});
}

const regex = /\s+/;
const regex = /[^a-zA-Z0-9-_ ]/g;
if (regex.test(name)) {
return interaction.reply({
content: "A roll shortcut cannot contain any spaces.",
content: "A roll shortcut cannot contain any special characters.",
ephemeral: true,
});
}
Expand Down

0 comments on commit cf2bdbd

Please sign in to comment.