mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-13 15:14:49 -06:00
simple add keep open
This commit is contained in:
parent
f612a45550
commit
ff82987144
@ -107,6 +107,7 @@ QRCODE_COLOR=#198754
|
||||
|
||||
# old | latest
|
||||
TYPEBOT_API_VERSION=latest
|
||||
TYPEBOT_KEEP_OPEN=false
|
||||
|
||||
# Defines an authentication type for the api
|
||||
# We recommend using the apikey because it will allow you to use a custom token,
|
||||
|
@ -130,7 +130,7 @@ export type SslConf = { PRIVKEY: string; FULLCHAIN: string };
|
||||
export type Webhook = { GLOBAL?: GlobalWebhook; EVENTS: EventsWebhook };
|
||||
export type ConfigSessionPhone = { CLIENT: string; NAME: string };
|
||||
export type QrCode = { LIMIT: number; COLOR: string };
|
||||
export type Typebot = { API_VERSION: string };
|
||||
export type Typebot = { API_VERSION: string; KEEP_OPEN: boolean };
|
||||
export type Production = boolean;
|
||||
|
||||
export interface Env {
|
||||
@ -308,6 +308,7 @@ export class ConfigService {
|
||||
},
|
||||
TYPEBOT: {
|
||||
API_VERSION: process.env?.TYPEBOT_API_VERSION || 'old',
|
||||
KEEP_OPEN: process.env.TYPEBOT_KEEP_OPEN === 'true',
|
||||
},
|
||||
AUTHENTICATION: {
|
||||
TYPE: process.env.AUTHENTICATION_TYPE as 'apikey',
|
||||
|
@ -148,6 +148,7 @@ QRCODE:
|
||||
|
||||
TYPEBOT:
|
||||
API_VERSION: 'old' # old | latest
|
||||
KEEP_OPEN: false
|
||||
|
||||
# Defines an authentication type for the api
|
||||
# We recommend using the apikey because it will allow you to use a custom token,
|
||||
|
@ -16,6 +16,9 @@ export class TypebotService {
|
||||
private readonly eventEmitter: EventEmitter2,
|
||||
) {
|
||||
this.eventEmitter.on('typebot:end', async (data) => {
|
||||
const keep_open = this.configService.get<Typebot>('TYPEBOT').KEEP_OPEN;
|
||||
if (keep_open) return;
|
||||
|
||||
await this.clearSessions(data.instance, data.remoteJid);
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user