From cf2bdbdda025c15f8f5d646af40426780341380f Mon Sep 17 00:00:00 2001 From: LordLuceus Date: Tue, 14 May 2024 17:10:19 +0200 Subject: [PATCH] fix: Disallow special characters in shortcut names --- src/commands/dice/rollShortcut.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/dice/rollShortcut.ts b/src/commands/dice/rollShortcut.ts index ad6a8d3..56e426d 100644 --- a/src/commands/dice/rollShortcut.ts +++ b/src/commands/dice/rollShortcut.ts @@ -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, }); }