diff --git a/src/commands/cwg_selfserv.ts b/src/commands/cwg_selfserv.ts index 4a6fe18..46a4d27 100644 --- a/src/commands/cwg_selfserv.ts +++ b/src/commands/cwg_selfserv.ts @@ -14,7 +14,7 @@ export default class CWG_SelfService extends Command { this.name = 'selfserv'; this.description = 'Creates a subdomain on your account. Do not include the entire subdomain: if you want `mydomain.cloud.libraryofcode.org`, just supply `mydomain` in the command parameters.\nYou must receive an authentication token from the Instant Application Service, see `?apply` for more information.'; this.usage = `${this.client.config.prefix}cwg selfserv `; - this.aliases = ['bind']; + this.aliases = ['ss']; this.enabled = true; this.urlRegex = /^[a-zA-Z0-9\-._~:/?#[\]@!$&'()*+,;=]+$/; } @@ -107,6 +107,7 @@ export default class CWG_SelfService extends Command { public async getPort() { const port = Number(await this.client.redis.get('cwgsspc')); if (await this.client.db.Domain.exists({ port })) throw new Error('Error retreiving port.'); + if (port >= Number(process.env.MAX_CWG_PORT)) throw new Error('Error retrieving port.'); await this.client.redis.incr('cwgsspc'); return port; }