Enhancement of Session Initialization in "StartTypebot" Function

Enhanced "StartTypebot" to initialize sessionIDs during the initial interaction, improving user experience on WhatsApp and preventing unexpected bot restarts.
This commit is contained in:
Matheus Gomes
2023-09-25 02:38:37 -03:00
parent 4dfe6bdbe8
commit c656bd6f4b
3 changed files with 63 additions and 26 deletions

View File

@@ -8,6 +8,11 @@ class Session {
status?: string;
createdAt?: number;
updateAt?: number;
prefilledVariables?: {
remoteJid?: string;
pushName?: string;
additionalData?: { [key: string]: any };
};
}
export class TypebotRaw {
@@ -40,6 +45,11 @@ const typebotSchema = new Schema<TypebotRaw>({
status: { type: String, required: true },
createdAt: { type: Number, required: true },
updateAt: { type: Number, required: true },
prefilledVariables: {
remoteJid: { type: String, required: false },
pushName: { type: String, required: false },
additionalData: { type: Schema.Types.Mixed, required: false }
},
},
],
});