allow dashes in redirect links
parent
4eff7a1e05
commit
a2a144b0b4
|
@ -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(),
|
||||||
|
|
Loading…
Reference in New Issue