diff --git a/src/whatsapp/controllers/instance.controller.ts b/src/whatsapp/controllers/instance.controller.ts index cf8678c1..f0adb3a3 100644 --- a/src/whatsapp/controllers/instance.controller.ts +++ b/src/whatsapp/controllers/instance.controller.ts @@ -64,7 +64,10 @@ export class InstanceController { this.repository, this.cache, ); - instance.instanceName = instanceName; + instance.instanceName = instanceName + .toLowerCase() + .replace(/[^a-z0-9]/g, '') + .replace(' ', ''); this.logger.verbose('instance: ' + instance.instanceName + ' created'); this.waMonitor.waInstances[instance.instanceName] = instance; @@ -191,7 +194,10 @@ export class InstanceController { this.repository, this.cache, ); - instance.instanceName = instanceName; + instance.instanceName = instanceName + .toLowerCase() + .replace(/[^a-z0-9]/g, '') + .replace(' ', ''); this.logger.verbose('instance: ' + instance.instanceName + ' created');