Compare commits

...
1 Commits
Author SHA1 Message Date
allburov 8b82f76668 Start session at the launch time with WHATSAPP_START_SESSION
Release / deploy-docker (push) Waiting to run
2022-09-28 10:28:07 +07:00
3 changed files with 8 additions and 0 deletions

No files matched your search

+1
View File
@@ -116,6 +116,7 @@ If you try to send an image the "echo server" will send a path to the downloaded
- `DEBUG` - show debug and verbose logs, set in any value
- `WHATSAPP_API_PORT` - listen port for HTTP server (default: `3000`)
- `WHATSAPP_API_HOSTNAME` - Hostname for HTTP server (default: `localhost`)
- `WHATSAPP_START_SESSION` - start session with that name right after launching the app
## Webhooks
+4
View File
@@ -46,6 +46,10 @@ export class WhatsappConfigService {
return types ? types.split(',') : null
}
get startSession(): string | undefined {
return this.configService.get('WHATSAPP_START_SESSION', undefined)
}
get(name: string): any {
return this.configService.get(name)
}
+3
View File
@@ -221,6 +221,9 @@ export class WhatsappSessionManager implements OnApplicationShutdown {
this.log.setContext('WhatsappSessionManager')
this.cleanDownloadsFolder(this.config.filesFolder)
this.sessions = {}
if (config.startSession) {
this.startSession(config.startSession)
}
}
async startSession(name: string) {