From d62e8846a48d6153df2460f9c821802e982a95de Mon Sep 17 00:00:00 2001 From: Matthew R Date: Tue, 1 Mar 2022 12:18:56 -0500 Subject: [PATCH] typo fix and port check --- src/commands/cwg_selfserv.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; }