allow dashes in redirect links

merge-requests/11/merge
Matthew 2020-05-05 19:25:19 -04:00
parent 333296cee8
commit 6a1d94e9aa
No known key found for this signature in database
GPG Key ID: 766BE43AE75F7559
1 changed files with 1 additions and 1 deletions

View File

@ -23,7 +23,7 @@ export default class AddRedirect extends Command {
} catch { } catch {
return this.error(message.channel, 'This doesn\'t appear to be a valid URL.'); 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 // eslint-disable-next-line new-cap
const redirect = new this.client.db.redirect({ const redirect = new this.client.db.redirect({
key: args[1].toLowerCase(), key: args[1].toLowerCase(),