diff --git a/src/commands/addredirect.ts b/src/commands/addredirect.ts index 79aa97f..11bc1e1 100644 --- a/src/commands/addredirect.ts +++ b/src/commands/addredirect.ts @@ -23,7 +23,7 @@ export default class AddRedirect extends Command { } catch { return this.error(message.channel, 'This doesn\'t appear to be a valid URL.'); } - if ((/^[a-zA-Z0-9]+$/gi.test(args[1].toLowerCase()) === false) || args[1].toLowerCase().length > 15) return this.error(message.channel, 'Invalid key. The key must be alphanumeric and less than 16 characters.'); + if ((/^[a-zA-Z0-9]+$/gi.test(args[1].toLowerCase().replace('-', '').trim()) === false) || args[1].toLowerCase().length > 15) return this.error(message.channel, 'Invalid key. The key must be alphanumeric and less than 16 characters.'); // eslint-disable-next-line new-cap const redirect = new this.client.db.redirect({ key: args[1].toLowerCase(),